DictDataForm-7d845fd1.js 5.1 KB

1
  1. import{d as H,r as i,g as P,cc as Q,o as n,k as f,w as t,i as l,l as y,a,C as X,c as T,B as k,F as U,t as z,Q as J,A as K,cd as W,ce as $,cf as Y,X as Z,H as ee,E as le,n as ae,aV as te,D as se,G as ue,ai as oe,aj as re,I as de,q as ce,L as me,__tla as pe}from"./index-abaca7e8.js";import{_ as ie,__tla as ne}from"./Dialog-a2f7c92a.js";import{a as _e,D as fe,__tla as ve}from"./dict-885a7988.js";import{C as S}from"./constants-e43f22dd.js";import{u as be,__tla as ye}from"./useMessage-7c79d01b.js";import{_ as Ve}from"./_plugin-vue_export-helper-1b428a4d.js";let w,ge=Promise.all([(()=>{try{return pe}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return ve}catch{}})(),(()=>{try{return ye}catch{}})()]).then(async()=>{w=Ve(H({name:"SystemDictDataForm",__name:"DictDataForm",emits:["success"],setup(Ce,{expose:D,emit:q}){const{t:v}=K(),V=be(),c=i(!1),g=i(""),m=i(!1),C=i(""),u=i({id:void 0,sort:void 0,label:"",value:"",dictType:"",status:S.ENABLE,colorType:"",cssClass:"",remark:""}),E=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"}]}),_=i(),x=Q([{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(o,s,r)=>{if(c.value=!0,g.value=v("action."+o),C.value=o,F(),r&&(u.value.dictType=r),s){m.value=!0;try{u.value=await W(s)}finally{m.value=!1}}}});const A=q,B=async()=>{if(_&&await _.value.validate()){m.value=!0;try{const o=u.value;C.value==="create"?(await $(o),V.success(v("common.createSuccess"))):(await Y(o),V.success(v("common.updateSuccess"))),c.value=!1,A("success")}finally{m.value=!1}}},F=()=>{var o;u.value={id:void 0,sort:void 0,label:"",value:"",dictType:"",status:S.ENABLE,colorType:"",cssClass:"",remark:""},(o=_.value)==null||o.resetFields()};return(o,s)=>{const r=Z,d=ee,p=le,b=ae,L=te,N=se,I=ue,M=oe,O=re,R=de,h=ce,j=ie,G=me;return n(),f(j,{modelValue:a(c),"onUpdate:modelValue":s[9]||(s[9]=e=>J(c)?c.value=e:null),title:a(g)},{footer:t(()=>[l(h,{disabled:a(m),type:"primary",onClick:B},{default:t(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),l(h,{onClick:s[8]||(s[8]=e=>c.value=!1)},{default:t(()=>[y("\u53D6 \u6D88")]),_:1})]),default:t(()=>[X((n(),f(R,{ref_key:"formRef",ref:_,model:a(u),rules:a(E),"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(r,{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(r,{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(r,{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(L,{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(I,{modelValue:a(u).colorType,"onUpdate:modelValue":s[4]||(s[4]=e=>a(u).colorType=e)},{default:t(()=>[(n(!0),T(U,null,k(a(x),e=>(n(),f(N,{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(O,{modelValue:a(u).status,"onUpdate:modelValue":s[5]||(s[5]=e=>a(u).status=e)},{default:t(()=>[(n(!0),T(U,null,k(a(_e)(a(fe).COMMON_STATUS),e=>(n(),f(M,{key:e.value,label:e.value},{default:t(()=>[y(z(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(d,{label:"CSS Class",prop:"cssClass"},{default:t(()=>[l(r,{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(r,{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"])),[[G,a(m)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-507d17bd"]])});export{ge as __tla,w as default};