1 |
- import{d as H,n as R,r as i,f as S,o as V,l as b,w as u,i as s,a,j as k,C as j,y as D,U as z,H as J,K,J as N,N as X,_ as A,__tla as B}from"./index-afaf388d.js";import{_ as E,__tla as G}from"./Dialog-82c2009c.js";import{e as L,c as M,u as O,__tla as Q}from"./property-ad10b7ff.js";import{u as T,__tla as W}from"./useMessage-a290df31.js";let g,Y=Promise.all([(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return W}catch{}})()]).then(async()=>{g=A(H({name:"ProductPropertyValueForm",__name:"ValueForm",emits:["success"],setup(Z,{expose:h,emit:w}){const{t:p}=R(),_=T(),o=i(!1),f=i(""),d=i(!1),v=i(""),l=i({id:void 0,propertyId:void 0,name:"",remark:""}),I=S({propertyId:[{required:!0,message:"\u5C5E\u6027\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=i();h({open:async(r,e,m)=>{if(o.value=!0,f.value=p("action."+r),v.value=r,F(),l.value.propertyId=e,m){d.value=!0;try{l.value=await L(m)}finally{d.value=!1}}}});const U=w,x=async()=>{if(n&&await n.value.validate()){d.value=!0;try{const r=l.value;v.value==="create"?(await M(r),_.success(p("common.createSuccess"))):(await O(r),_.success(p("common.updateSuccess"))),o.value=!1,U("success")}finally{d.value=!1}}},F=()=>{var r;l.value={id:void 0,propertyId:void 0,name:"",remark:""},(r=n.value)==null||r.resetFields()};return(r,e)=>{const m=z,c=J,C=K,y=N,P=E,q=X;return V(),b(P,{modelValue:a(o),"onUpdate:modelValue":e[4]||(e[4]=t=>D(o)?o.value=t:null),title:a(f)},{footer:u(()=>[s(y,{disabled:a(d),type:"primary",onClick:x},{default:u(()=>[k("\u786E \u5B9A")]),_:1},8,["disabled"]),s(y,{onClick:e[3]||(e[3]=t=>o.value=!1)},{default:u(()=>[k("\u53D6 \u6D88")]),_:1})]),default:u(()=>[j((V(),b(C,{ref_key:"formRef",ref:n,model:a(l),rules:a(I),"label-width":"80px"},{default:u(()=>[s(c,{label:"\u5C5E\u6027\u7F16\u53F7",prop:"category"},{default:u(()=>[s(m,{modelValue:a(l).propertyId,"onUpdate:modelValue":e[0]||(e[0]=t=>a(l).propertyId=t),disabled:""},null,8,["modelValue"])]),_:1}),s(c,{label:"\u540D\u79F0",prop:"name"},{default:u(()=>[s(m,{modelValue:a(l).name,"onUpdate:modelValue":e[1]||(e[1]=t=>a(l).name=t),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),s(c,{label:"\u5907\u6CE8",prop:"remark"},{default:u(()=>[s(m,{modelValue:a(l).remark,"onUpdate:modelValue":e[2]||(e[2]=t=>a(l).remark=t),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[q,a(d)]])]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mall/product/property/value/ValueForm.vue"]])});export{Y as __tla,g as default};
|