import{_ as g}from"./BlueButton.vue_vue_type_script_setup_true_lang-CnzqAS80.js";import{_ as U}from"./WhiteButton-B0VC5rKo.js";import{x as E,r as f,H as w,s as S,c as k,o as p,a as s,t as N,I as D,S as I,C as B,h as T,b as V,w as v,e as _}from"./index-CmCGXBst.js";import{u as h}from"./global-5eUCDNCu.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";const O={class:"tw-text-2xl"},j={class:"tw-mt-4"},K={class:"tw-flex tw-items-center tw-justify-end tw-gap-4 tw-mt-4"},L={__name:"ModalWindowNoticeEdit",props:{data:{type:Object,default:()=>{}}},emits:["modalClose"],setup(a,{emit:x}){const t=a,d=x,l=h(),r=E("emitter"),i=f(null),c=f(!1);function m(){l.NoticeEdit({TableID:t.data?.noteTable,RowID:t.data?.OrderID,UserNotice:i.value}).then(e=>{e==="SUCCESS"&&(d("modalClose"),t?.data?.emit&&r.emit(t?.data?.emit))})}function y(){l.NoticeEdit({TableID:t.data?.noteTable,RowID:t.data?.OrderID,UserNotice:""}).then(e=>{e==="SUCCESS"&&(d("modalClose"),t?.data?.emit&&r.emit(t?.data?.emit))})}w(()=>{i.value=t?.data?.UserNotice});const u=e=>{e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&m()};return w(()=>{document.addEventListener("keyup",u)}),S(()=>{document.removeEventListener("keyup",u)}),(e,o)=>{const C=U,b=g;return p(),k("div",null,[s("div",O,"Редактирование примечания, заказ #"+N(a.data?.OrderID),1),s("div",j,[D(s("textarea",{"onUpdate:modelValue":o[0]||(o[0]=n=>i.value=n),class:"tw-border tw-border-solid tw-border-gray-200 tw-rounded tw-h-[300px] tw-w-full tw-p-4 tw-text-sm tw-text-gray-800"},null,512),[[I,i.value]])]),s("div",K,[a.data?.UserNotice!==null&&a.data?.UserNotice!==""?(p(),B(C,{key:0,"is-loading":c.value,onClick:o[1]||(o[1]=n=>y())},{default:v(()=>o[3]||(o[3]=[_("Удалить",-1)])),_:1,__:[3]},8,["is-loading"])):T("",!0),V(b,{"is-loading":c.value,onClick:o[2]||(o[2]=n=>m())},{default:v(()=>[_(N(a.data?.UserNotice!==null&&a.data?.UserNotice!==""?"Изменить":"Добавить"),1)]),_:1},8,["is-loading"])])])}}},q=M(L,[["__scopeId","data-v-acf7014e"]]);export{q as default};
