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