DictDataForm-f931147e.js 5.2 KB

1
  1. import{d as j,n as G,r as p,f as I,cU as J,o as n,l as f,w as s,i as l,a,j as y,C as K,c as U,F as k,k as T,t as P,y as W,cV as Z,cW as Q,cX as Y,U as $,H as ee,E as le,s as ae,bZ as se,D as te,G as ue,ag as re,ah as oe,K as de,J as ce,N as me,_ as ie,__tla as pe}from"./index-afaf388d.js";import{_ as ne,__tla as _e}from"./Dialog-82c2009c.js";import{a as fe,D as ve,__tla as be}from"./dict-0449a0a1.js";import{C as w}from"./constants-a1da293a.js";import{u as ye,__tla as Ve}from"./useMessage-a290df31.js";let S,ge=Promise.all([(()=>{try{return pe}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ve}catch{}})()]).then(async()=>{S=ie(j({name:"SystemDictDataForm",__name:"DictDataForm",emits:["success"],setup(he,{expose:D,emit:F}){const{t:v}=G(),V=ye(),c=p(!1),g=p(""),m=p(!1),h=p(""),u=p({id:void 0,sort:void 0,label:"",value:"",dictType:"",status:w.ENABLE,colorType:"",cssClass:"",remark:""}),x=I({label:[{required:!0,message:"\u6570\u636E\u6807\u7B7E\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],value:[{required:!0,message:"\u6570\u636E\u952E\u503C\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],sort:[{required:!0,message:"\u6570\u636E\u987A\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),_=p(),E=J([{value:"default",label:"\u9ED8\u8BA4"},{value:"primary",label:"\u4E3B\u8981"},{value:"success",label:"\u6210\u529F"},{value:"info",label:"\u4FE1\u606F"},{value:"warning",label:"\u8B66\u544A"},{value:"danger",label:"\u5371\u9669"}]);D({open:async(r,t,o)=>{if(c.value=!0,g.value=v("action."+r),h.value=r,A(),o&&(u.value.dictType=o),t){m.value=!0;try{u.value=await Z(t)}finally{m.value=!1}}}});const q=F,N=async()=>{if(_&&await _.value.validate()){m.value=!0;try{const r=u.value;h.value==="create"?(await Q(r),V.success(v("common.createSuccess"))):(await Y(r),V.success(v("common.updateSuccess"))),c.value=!1,q("success")}finally{m.value=!1}}},A=()=>{var r;u.value={id:void 0,sort:void 0,label:"",value:"",dictType:"",status:w.ENABLE,colorType:"",cssClass:"",remark:""},(r=_.value)==null||r.resetFields()};return(r,t)=>{const o=$,d=ee,i=le,b=ae,B=se,H=te,L=ue,M=re,O=oe,z=de,C=ce,R=ne,X=me;return n(),f(R,{modelValue:a(c),"onUpdate:modelValue":t[9]||(t[9]=e=>W(c)?c.value=e:null),title:a(g)},{footer:s(()=>[l(C,{disabled:a(m),type:"primary",onClick:N},{default:s(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),l(C,{onClick:t[8]||(t[8]=e=>c.value=!1)},{default:s(()=>[y("\u53D6 \u6D88")]),_:1})]),default:s(()=>[K((n(),f(z,{ref_key:"formRef",ref:_,model:a(u),rules:a(x),"label-width":"80px"},{default:s(()=>[l(b,{gutter:30},{default:s(()=>[l(i,{span:"12"},{default:s(()=>[l(d,{label:"\u5B57\u5178\u7C7B\u578B",prop:"type"},{default:s(()=>[l(o,{modelValue:a(u).dictType,"onUpdate:modelValue":t[0]||(t[0]=e=>a(u).dictType=e),disabled:a(u).id!==void 0,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0"},null,8,["modelValue","disabled"])]),_:1})]),_:1}),l(i,{span:"12"},{default:s(()=>[l(d,{label:"\u6570\u636E\u6807\u7B7E",prop:"label"},{default:s(()=>[l(o,{modelValue:a(u).label,"onUpdate:modelValue":t[1]||(t[1]=e=>a(u).label=e),placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u6807\u7B7E"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(b,{gutter:30},{default:s(()=>[l(i,{span:"12"},{default:s(()=>[l(d,{label:"\u6570\u636E\u952E\u503C",prop:"value"},{default:s(()=>[l(o,{modelValue:a(u).value,"onUpdate:modelValue":t[2]||(t[2]=e=>a(u).value=e),placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u952E\u503C"},null,8,["modelValue"])]),_:1})]),_:1}),l(i,{span:"12"},{default:s(()=>[l(d,{label:"\u663E\u793A\u6392\u5E8F",prop:"sort"},{default:s(()=>[l(B,{modelValue:a(u).sort,"onUpdate:modelValue":t[3]||(t[3]=e=>a(u).sort=e),min:0,"controls-position":"right"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(b,{gutter:30},{default:s(()=>[l(i,{span:"12"},{default:s(()=>[l(d,{label:"\u989C\u8272\u7C7B\u578B",prop:"colorType"},{default:s(()=>[l(L,{modelValue:a(u).colorType,"onUpdate:modelValue":t[4]||(t[4]=e=>a(u).colorType=e)},{default:s(()=>[(n(!0),U(k,null,T(a(E),e=>(n(),f(H,{key:e.value,label:e.label+"("+e.value+")",value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(i,{span:"12"},{default:s(()=>[l(d,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[l(O,{modelValue:a(u).status,"onUpdate:modelValue":t[5]||(t[5]=e=>a(u).status=e)},{default:s(()=>[(n(!0),U(k,null,T(a(fe)(a(ve).COMMON_STATUS),e=>(n(),f(M,{key:e.value,label:e.value},{default:s(()=>[y(P(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(d,{label:"CSS Class",prop:"cssClass"},{default:s(()=>[l(o,{modelValue:a(u).cssClass,"onUpdate:modelValue":t[6]||(t[6]=e=>a(u).cssClass=e),placeholder:"\u8BF7\u8F93\u5165 CSS Class"},null,8,["modelValue"])]),_:1}),l(d,{label:"\u5907\u6CE8",prop:"remark"},{default:s(()=>[l(o,{modelValue:a(u).remark,"onUpdate:modelValue":t[7]||(t[7]=e=>a(u).remark=e),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[X,a(m)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-51e7778b"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/dict/data/DictDataForm.vue"]])});export{ge as __tla,S as default};