2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
|
import{G as e,r as l,a,I as t,U as d,d as o,T as u,o as i,c as s,K as n,M as r,f as c,e as p,w as m,V as f,W as v,k as b,j as y,n as g,J as _,A as V,l as h,v as w,X as C,Y as k,Z as T,$ as S,a0 as U,a1 as x}from"./index.e5c8b0d6.js";import{g as L,o as D}from"./type.b030370e.js";const $={class:"app-container"},q={key:0},N={class:"dialog-footer"},P=e({name:"Data"}),R=Object.assign(P,{setup(e){const{proxy:P}=w(),{sys_normal_disable:R}=P.useDict("sys_normal_disable"),j=l([]),z=l(!1),I=l(!0),K=l(!0),E=l([]),F=l(!0),O=l(!0),A=l(0),G=l(""),J=l(""),M=l([]),Q=a(),W=l([{value:"default",label:"默认"},{value:"primary",label:"主要"},{value:"success",label:"成功"},{value:"info",label:"信息"},{value:"warning",label:"警告"},{value:"danger",label:"危险"}]),X=t({form:{},queryParams:{pageNum:1,pageSize:10,dictName:void 0,dictType:void 0,status:void 0},rules:{dictLabel:[{required:!0,message:"数据标签不能为空",trigger:"blur"}],dictValue:[{required:!0,message:"数据键值不能为空",trigger:"blur"}],dictSort:[{required:!0,message:"数据顺序不能为空",trigger:"blur"}]}}),{queryParams:Y,form:Z,rules:B}=d(X);function H(){I.value=!0,C(Y.value).then((e=>{j.value=e.rows,A.value=e.total,I.value=!1}))}function ee(){z.value=!1,le()}function le(){Z.value={dictCode:void 0,dictLabel:void 0,dictValue:void 0,cssClass:void 0,listClass:"default",dictSort:0,status:"0",remark:void 0},P.resetForm("dataRef")}function ae(){Y.value.pageNum=1,H()}function te(){P.$tab.closeOpenPage({path:"/system/dict"})}function de(){P.resetForm("queryRef"),Y.value.dictType=J,ae()}function oe(){le(),z.value=!0,G.value="添加字典数据",Z.value.dictType=Y.value.dictType}function ue(e){E.value=e.map((e=>e.dictCode)),F.value=1!=e.length,O.value=!e.length}function ie(e){le();const l=e.dictCode||E.value;k(l).then((e=>{Z.value=e.data,z.value=!0,G.value="修改字典数据"}))}function se(){P.$refs.dataRef.validate((e=>{e&&(null!=Z.value.dictCode?T(Z.value).then((e=>{S().removeDict(Y.value.dictType),P.$modal.msgSuccess("修改成功"),z.value=!1,H()})):U(Z.value).then((e=>{S().removeDict(Y.value.dictType),P.$modal.msgSuccess("新增成功"),z.value=!1,H()})))}))}function ne(e){const l=e.dictCode||E.value;P.$modal.confirm('是否确认删除字典编码为"'+l+'"的数据项?').then((function(){return x(l)})).then((()=>{H(),P.$modal.msgSuccess("删除成功"),S().removeDict(Y.value.dictType)})).catch((()=>{}))}function re(){P.download("system/dict/data/export",{...Y.value},`dict_data_${(new Date).getTime()}.xlsx`)}var ce;return ce=Q.params&&Q.params.dictId,L(ce).then((e=>{Y.value.dictType=e.data.dictType,J.value=e.data.dictType,H()})),D().then((e=>{M.value=e.data})),(e,l)=>{const a=o("el-option"),t=o("el-select"),d=o("el-form-item"),w=o("el-input"),C=o("el-button"),k=o("el-form"),T=o("el-col"),S=o("right-toolbar"),U=o("el-row"),x=o("el-table-column"),L=o("el-tag"),D=o("dict-tag"),P=o("el-table"),E=o("pagination"),J=o("el-input-number"),Q=o("el-radio"),X=o("el-radio-group"),le=o("el-dialog"),ce=u("hasPermi"),pe=u("loading");return i(),s("div",$,[n(p(k,{model:c(Y),ref:"queryRef",inline:!0},{default:m((()=>[p(d,{label:"字典名称",prop:"dictType"},{default:m((()=>[p(t,{modelValue:c(Y).dictType,"onUpdate:modelValue":l[0]||(l[0]=e=>c(Y).dictType=e),style:{width:"200px"}},{default:m((()=>[(i(!0),s(f,null,v(c(M),(e=>(i(),b(a,{key:e.dictId,label:e.dictName,value:e.dictType},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(d,{label:"字典标签",prop:"dictLabel"},{default:m((()=>[p(w,{modelValue:c(Y).dictLabel,"onUpdate:modelValue":l[1]||(l[1]=e=>c(Y).dictLabel=e),placeholder:"请输入字典标签",clearable:"",style:{width:"200px"},onKeyup:y(ae,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),p(d,{label:"状态",prop:"status"},{default:m((()=>[p(t,{modelValue:c(Y).status,"onUpdate:modelValue":l[2]||(l[2]=e=>c(Y).status=e),placeholder:"数据状态",clearable:"",style:{width:"200px"}},{default:m((()=>[(i(!0),s(f,null,v(c(R),(e=>(i(),b(a,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelVal
|