import{_ as U}from"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";import{_ as g}from"./WhiteButton.vue_vue_type_script_setup_true_lang-DlfUhvlb.js";import{A as D,r as f,l as w,D as E,o as N,c as S,a as n,t as p,K as k,S as B,m as I,w as v,f as x,i as T,b as V}from"./index-Bb2UEb_P.js";import{u as K}from"./global-BK91p1BE.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";const O={class:"tw-text-2xl"},$={class:"tw-mt-4"},h={class:"tw-flex tw-items-center tw-justify-end tw-gap-4 tw-mt-4"},j={__name:"ModalWindowNoticeEdit",props:{data:{type:Object,default:()=>{}}},emits:["modalClose"],setup(o,{emit:_}){const t=o,d=_,l=K(),r=D("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)}),E(()=>{document.removeEventListener("keyup",u)}),(e,a)=>{const b=g,C=U;return N(),S("div",null,[n("div",O,"Редактирование примечания, заказ #"+p(o.data?.OrderID),1),n("div",$,[k(n("textarea",{"onUpdate:modelValue":a[0]||(a[0]=s=>i.value=s),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),[[B,i.value]])]),n("div",h,[o.data?.UserNotice!==null&&o.data?.UserNotice!==""?(N(),I(b,{key:0,loading:c.value,onClick:a[1]||(a[1]=s=>y())},{default:v(()=>a[3]||(a[3]=[x(" Удалить ",-1)])),_:1,__:[3]},8,["loading"])):T("",!0),V(C,{loading:c.value,onClick:a[2]||(a[2]=s=>m())},{default:v(()=>[x(p(o.data?.UserNotice!==null&&o.data?.UserNotice!==""?"Изменить":"Добавить"),1)]),_:1},8,["loading"])])])}}},q=M(j,[["__scopeId","data-v-d3effe97"]]);export{q as default};
