1 |
- import{_ as x,d as C,w as c,ag as q,bs as p,x as k,r as t,o as I,G as M,C as a,j as n,l as o,h as j,M as N,aq as R}from"./index.js";import{d as U}from"./index.da6d65fd.js";const z={class:"flex w-full justify-end"},A=C({__name:"modal",props:{data:{type:null,required:!0,default:{unit:"",id:""}},visible:{type:Boolean,required:!0},disabled:{type:Boolean,required:!0}},emits:["submit"],setup(d,{emit:f}){const i=d,_={id:"",unit:""},F=c([]),v=q(()=>e.value.id?i.disabled?"\u67E5\u770B\u5355\u4F4D":"\u7F16\u8F91\u5355\u4F4D":"\u6DFB\u52A0\u5355\u4F4D"),e=p(i,"data"),s=p(i,"visible"),m=c(null),D={unit:[{required:!0,trigger:"change",message:"\u8F93\u5165\u5355\u4F4D\u540D\u79F0"}]};async function b(){const l=await U({size:100});F.value=l.code===0?l.data.list:[]}function B(){e.value={..._},s.value=!1}async function y(){try{await m.value.validate(),f("submit")}catch{}}return k(b),(l,u)=>{const E=t("ElInput"),V=t("ElFormItem"),h=t("ElButton"),w=t("ElForm"),g=t("ElDialog");return I(),M(g,{modelValue:o(s),"onUpdate:modelValue":u[1]||(u[1]=r=>R(s)?s.value=r:null),title:o(v),center:"",onClose:B},{default:a(()=>[n(w,{model:o(e),rules:D,size:"small",ref_key:"formRef",ref:m,disabled:d.disabled},{default:a(()=>[n(V,{label:"\u5355\u4F4D\u540D\u79F0",prop:"result"},{default:a(()=>[n(E,{modelValue:o(e).unit,"onUpdate:modelValue":u[0]||(u[0]=r=>o(e).unit=r),style:{width:"100%"},placeholder:"\u5355\u4F4D\u540D\u79F0",maxlength:50,"show-word-limit":""},null,8,["modelValue"])]),_:1}),j("div",z,[n(h,{type:"primary",onClick:y},{default:a(()=>[N("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model","disabled"])]),_:1},8,["modelValue","title"])}}});var S=x(A,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/unit/components/modal.vue"]]);export{S as default};
|