modal.eb608d.js 1.8 KB

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