DictDataForm-30b211f8.js 5.2 KB

1
  1. import{d as G,h as K,r as c,e as P,d4 as X,o as n,x as f,w as t,f as l,a,y,z as j,c as T,F as k,v as U,t as J,l as Q,d5 as W,d6 as Y,d7 as Z,R as $,C as ee,E as le,i as ae,bw as te,A as se,B as ue,ad as re,ae as oe,H as de,G as me,K as ie,_ as pe,__tla as ce}from"./index-8dc1e40a.js";import{_ as ne,__tla as _e}from"./Dialog-41802231.js";import{a as fe,D as ve,__tla as be}from"./dict-f13a3c8f.js";import{C as w}from"./constants-a1da293a.js";import{u as ye,__tla as Ve}from"./useMessage-7a27dd80.js";let S,ge=Promise.all([(()=>{try{return ce}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return be}catch{}})(),(()=>{try{return Ve}catch{}})()]).then(async()=>{S=pe(G({name:"SystemDictDataForm",__name:"DictDataForm",emits:["success"],setup(he,{expose:D,emit:x}){const{t:v}=K(),V=ye(),m=c(!1),g=c(""),i=c(!1),h=c(""),u=c({id:void 0,sort:void 0,label:"",value:"",dictType:"",status:w.ENABLE,colorType:"",cssClass:"",remark:""}),F=P({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"}]}),_=c(),E=X([{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,s,o)=>{if(m.value=!0,g.value=v("action."+r),h.value=r,B(),o&&(u.value.dictType=o),s){i.value=!0;try{u.value=await W(s)}finally{i.value=!1}}}});const q=x,A=async()=>{if(_&&await _.value.validate()){i.value=!0;try{const r=u.value;h.value==="create"?(await Y(r),V.success(v("common.createSuccess"))):(await Z(r),V.success(v("common.updateSuccess"))),m.value=!1,q("success")}finally{i.value=!1}}},B=()=>{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,s)=>{const o=$,d=ee,p=le,b=ae,N=te,z=se,M=ue,O=re,R=oe,H=de,C=me,I=ne,L=ie;return n(),f(I,{modelValue:a(m),"onUpdate:modelValue":s[9]||(s[9]=e=>Q(m)?m.value=e:null),title:a(g)},{footer:t(()=>[l(C,{disabled:a(i),type:"primary",onClick:A},{default:t(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),l(C,{onClick:s[8]||(s[8]=e=>m.value=!1)},{default:t(()=>[y("\u53D6 \u6D88")]),_:1})]),default:t(()=>[j((n(),f(H,{ref_key:"formRef",ref:_,model:a(u),rules:a(F),"label-width":"80px"},{default:t(()=>[l(b,{gutter:30},{default:t(()=>[l(p,{span:"12"},{default:t(()=>[l(d,{label:"\u5B57\u5178\u7C7B\u578B",prop:"type"},{default:t(()=>[l(o,{modelValue:a(u).dictType,"onUpdate:modelValue":s[0]||(s[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(p,{span:"12"},{default:t(()=>[l(d,{label:"\u6570\u636E\u6807\u7B7E",prop:"label"},{default:t(()=>[l(o,{modelValue:a(u).label,"onUpdate:modelValue":s[1]||(s[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:t(()=>[l(p,{span:"12"},{default:t(()=>[l(d,{label:"\u6570\u636E\u952E\u503C",prop:"value"},{default:t(()=>[l(o,{modelValue:a(u).value,"onUpdate:modelValue":s[2]||(s[2]=e=>a(u).value=e),placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u952E\u503C"},null,8,["modelValue"])]),_:1})]),_:1}),l(p,{span:"12"},{default:t(()=>[l(d,{label:"\u663E\u793A\u6392\u5E8F",prop:"sort"},{default:t(()=>[l(N,{modelValue:a(u).sort,"onUpdate:modelValue":s[3]||(s[3]=e=>a(u).sort=e),min:0,"controls-position":"right"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(b,{gutter:30},{default:t(()=>[l(p,{span:"12"},{default:t(()=>[l(d,{label:"\u989C\u8272\u7C7B\u578B",prop:"colorType"},{default:t(()=>[l(M,{modelValue:a(u).colorType,"onUpdate:modelValue":s[4]||(s[4]=e=>a(u).colorType=e)},{default:t(()=>[(n(!0),T(k,null,U(a(E),e=>(n(),f(z,{key:e.value,label:e.label+"("+e.value+")",value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(p,{span:"12"},{default:t(()=>[l(d,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[l(R,{modelValue:a(u).status,"onUpdate:modelValue":s[5]||(s[5]=e=>a(u).status=e)},{default:t(()=>[(n(!0),T(k,null,U(a(fe)(a(ve).COMMON_STATUS),e=>(n(),f(O,{key:e.value,label:e.value},{default:t(()=>[y(J(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(d,{label:"CSS Class",prop:"cssClass"},{default:t(()=>[l(o,{modelValue:a(u).cssClass,"onUpdate:modelValue":s[6]||(s[6]=e=>a(u).cssClass=e),placeholder:"\u8BF7\u8F93\u5165 CSS Class"},null,8,["modelValue"])]),_:1}),l(d,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[l(o,{modelValue:a(u).remark,"onUpdate:modelValue":s[7]||(s[7]=e=>a(u).remark=e),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[L,a(i)]])]),_: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};