Agriculture-front-end/dist/assets/data.75fd2352.js

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,["modelValue"])])),_:1}),p(d,null,{default:m((()=>[p(C,{type:"primary",icon:"Search",onClick:ae},{default:m((()=>[g("搜索")])),_:1}),p(C,{icon:"Refresh",onClick:de},{default:m((()=>[g("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[r,c(K)]]),p(U,{gutter:10,class:"mb8"},{default:m((()=>[p(T,{span:1.5},{default:m((()=>[n((i(),b(C,{type:"primary",plain:"",icon:"Plus",onClick:oe},{default:m((()=>[g("新增")])),_:1})),[[ce,["system:dict:add"]]])])),_:1},8,["span"]),p(T,{span:1.5},{default:m((()=>[n((i(),b(C,{type:"success",plain:"",icon:"Edit",disabled:c(F),onClick:ie},{default:m((()=>[g("修改")])),_:1},8,["disabled"])),[[ce,["system:dict:edit"]]])])),_:1},8,["span"]),p(T,{span:1.5},{default:m((()=>[n((i(),b(C,{type:"danger",plain:"",icon:"Delete",disabled:c(O),onClick:ne},{default:m((()=>[g("删除")])),_:1},8,["disabled"])),[[ce,["system:dict:remove"]]])])),_:1},8,["span"]),p(T,{span:1.5},{default:m((()=>[n((i(),b(C,{type:"warning",plain:"",icon:"Download",onClick:re},{default:m((()=>[g("导出")])),_:1})),[[ce,["system:dict:export"]]])])),_:1},8,["span"]),p(T,{span:1.5},{default:m((()=>[p(C,{type:"warning",plain:"",icon:"Close",onClick:te},{default:m((()=>[g("关闭")])),_:1})])),_:1},8,["span"]),p(S,{showSearch:c(K),"onUpdate:showSearch":l[3]||(l[3]=e=>_(K)?K.value=e:null),onQueryTable:H},null,8,["showSearch"])])),_:1}),n((i(),b(P,{data:c(j),onSelectionChange:ue},{default:m((()=>[p(x,{type:"selection",width:"55",align:"center"}),p(x,{label:"字典编码",align:"center",prop:"dictCode"}),p(x,{label:"字典标签",align:"center",prop:"dictLabel"},{default:m((e=>[""==e.row.listClass||"default"==e.row.listClass?(i(),s("span",q,V(e.row.dictLabel),1)):(i(),b(L,{key:1,type:"primary"==e.row.listClass?"":e.row.listClass},{default:m((()=>[g(V(e.row.dictLabel),1)])),_:2},1032,["type"]))])),_:1}),p(x,{label:"字典键值",align:"center",prop:"dictValue"}),p(x,{label:"字典排序",align:"center",prop:"dictSort"}),p(x,{label:"状态",align:"center",prop:"status"},{default:m((e=>[p(D,{options:c(R),value:e.row.status},null,8,["options","value"])])),_:1}),p(x,{label:"备注",align:"center",prop:"remark","show-overflow-tooltip":!0}),p(x,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:m((l=>[h("span",null,V(e.parseTime(l.row.createTime)),1)])),_:1}),p(x,{label:"操作",align:"center",width:"160","class-name":"small-padding fixed-width"},{default:m((e=>[n((i(),b(C,{link:"",type:"primary",icon:"Edit",onClick:l=>ie(e.row)},{default:m((()=>[g("修改")])),_:2},1032,["onClick"])),[[ce,["system:dict:edit"]]]),n((i(),b(C,{link:"",type:"primary",icon:"Delete",onClick:l=>ne(e.row)},{default:m((()=>[g("删除")])),_:2},1032,["onClick"])),[[ce,["system:dict:remove"]]])])),_:1})])),_:1},8,["data"])),[[pe,c(I)]]),n(p(E,{total:c(A),page:c(Y).pageNum,"onUpdate:page":l[4]||(l[4]=e=>c(Y).pageNum=e),limit:c(Y).pageSize,"onUpdate:limit":l[5]||(l[5]=e=>c(Y).pageSize=e),onPagination:H},null,8,["total","page","limit"]),[[r,c(A)>0]]),p(le,{title:c(G),modelValue:c(z),"onUpdate:modelValue":l[14]||(l[14]=e=>_(z)?z.value=e:null),width:"500px","append-to-body":""},{footer:m((()=>[h("div",N,[p(C,{type:"primary",onClick:se},{default:m((()=>[g("确 定")])),_:1}),p(C,{onClick:ee},{default:m((()=>[g("取 消")])),_:1})])])),default:m((()=>[p(k,{ref:"dataRef",model:c(Z),rules:c(B),"label-width":"80px"},{default:m((()=>[p(d,{label:"字典类型"},{default:m((()=>[p(w,{modelValue:c(Z).dictType,"onUpdate:modelValue":l[6]||(l[6]=e=>c(Z).dictType=e),disabled:!0},null,8,["modelValue"])])),_:1}),p(d,{label:"数据标签",prop:"dictLabel"},{default:m((()=>[p(w,{modelValue:c(Z).dictLabel,"onUpdate:modelValue":l[7]||(l[7]=e=>c(Z).dictLabel=e),placeholder:"请输入数据标签"},null,8,["modelValue"])])),_:1}),p(d,{label:"数据键值",prop:"dictValue"},{default:m((()=>[p(w,{modelValue:c(Z).dictValue,"onUpdate:modelValue":l[8]||(l[8]=e=>c(Z).dictValue=e),placeholder:"请输入数据键值"},null,8,["modelValue"])])),_:1}),p(d,{label:"样式属性",prop:"cssClass"},{default:m((()=>[p(w,{modelValue:c(Z).cssClass,"onUpdate:modelValue":l[9]||(l[9]=e=>c(Z).cssClass=e),placeholder:"请输入样式属性"},null,8,["modelValue"])])),_:1}),p(d,{label:"显示排序",prop:"dictSort"},{default:m((()=>[p(J,{modelValue:c(Z).dictSort,"onUpdate:modelValue":l[10]||(l[10]=e=>c(Z).dictSort=e),"controls-position":"right",min:0},null,8,["modelValue"])])),_:1}),p(d,{label:"回显样式",prop:"listClass"},{default:m((()=>[p(t,{modelValue:c(Z).listClass,"onUpdate:modelValue":l[11]||(l[11]=e=>c(Z).listClass=e)},{default:m((()=>[(i(!0),s(f,null,v(c(W),(e=>(i(),b(a,{key:e.value,label:e.label+"("+e.value+")",value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(d,{label:"状态",prop:"status"},{default:m((()=>[p(X,{modelValue:c(Z).status,"onUpdate:modelValue":l[12]||(l[12]=e=>c(Z).status=e)},{default:m((()=>[(i(!0),s(f,null,v(c(R),(e=>(i(),b(Q,{key:e.value,label:e.value},{default:m((()=>[g(V(e.label),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(d,{label:"备注",prop:"remark"},{default:m((()=>[p(w,{modelValue:c(Z).remark,"onUpdate:modelValue":l[13]||(l[13]=e=>c(Z).remark=e),type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["title","modelValue"])])}}});export{R as default};