2 lines
8.4 KiB
JavaScript
2 lines
8.4 KiB
JavaScript
import{Q as e,G as l,r as a,I as o,U as n,d as t,T as i,o as u,c as d,K as r,M as c,f as s,e as p,w as f,j as m,V as g,W as y,k as v,J as h,n as b,l as _,A as V,v as w}from"./index.e5c8b0d6.js";const k={class:"app-container"},C={class:"dialog-footer"},T=l({name:"Config"}),x=Object.assign(T,{setup(l){const{proxy:T}=w(),{sys_yes_no:x}=T.useDict("sys_yes_no"),K=a([]),N=a(!1),U=a(!0),S=a(!0),D=a([]),R=a(!0),q=a(!0),I=a(0),$=a(""),P=a([]),Y=o({form:{},queryParams:{pageNum:1,pageSize:10,configName:void 0,configKey:void 0,configType:void 0},rules:{configName:[{required:!0,message:"参数名称不能为空",trigger:"blur"}],configKey:[{required:!0,message:"参数键名不能为空",trigger:"blur"}],configValue:[{required:!0,message:"参数键值不能为空",trigger:"blur"}]}}),{queryParams:j,form:z,rules:M}=n(Y);function E(){var l;U.value=!0,(l=T.addDateRange(j.value,P.value),e({url:"/system/config/list",method:"get",params:l})).then((e=>{K.value=e.rows,I.value=e.total,U.value=!1}))}function F(){N.value=!1,Q()}function Q(){z.value={configId:void 0,configName:void 0,configKey:void 0,configValue:void 0,configType:"Y",remark:void 0},T.resetForm("configRef")}function A(){j.value.pageNum=1,E()}function G(){P.value=[],T.resetForm("queryRef"),A()}function J(e){D.value=e.map((e=>e.configId)),R.value=1!=e.length,q.value=!e.length}function O(){Q(),N.value=!0,$.value="添加参数"}function W(l){Q();(function(l){return e({url:"/system/config/"+l,method:"get"})})(l.configId||D.value).then((e=>{z.value=e.data,N.value=!0,$.value="修改参数"}))}function B(){T.$refs.configRef.validate((l=>{l&&(null!=z.value.configId?function(l){return e({url:"/system/config",method:"put",data:l})}(z.value).then((e=>{T.$modal.msgSuccess("修改成功"),N.value=!1,E()})):function(l){return e({url:"/system/config",method:"post",data:l})}(z.value).then((e=>{T.$modal.msgSuccess("新增成功"),N.value=!1,E()})))}))}function H(l){const a=l.configId||D.value;T.$modal.confirm('是否确认删除参数编号为"'+a+'"的数据项?').then((function(){return e({url:"/system/config/"+a,method:"delete"})})).then((()=>{E(),T.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function L(){T.download("system/config/export",{...j.value},`config_${(new Date).getTime()}.xlsx`)}function X(){e({url:"/system/config/refreshCache",method:"delete"}).then((()=>{T.$modal.msgSuccess("刷新缓存成功")}))}return E(),(e,l)=>{const a=t("el-input"),o=t("el-form-item"),n=t("el-option"),w=t("el-select"),T=t("el-date-picker"),D=t("el-button"),Y=t("el-form"),Q=t("el-col"),Z=t("right-toolbar"),ee=t("el-row"),le=t("el-table-column"),ae=t("dict-tag"),oe=t("el-table"),ne=t("pagination"),te=t("el-radio"),ie=t("el-radio-group"),ue=t("el-dialog"),de=i("hasPermi"),re=i("loading");return u(),d("div",k,[r(p(Y,{model:s(j),ref:"queryRef",inline:!0,"label-width":"68px"},{default:f((()=>[p(o,{label:"参数名称",prop:"configName"},{default:f((()=>[p(a,{modelValue:s(j).configName,"onUpdate:modelValue":l[0]||(l[0]=e=>s(j).configName=e),placeholder:"请输入参数名称",clearable:"",style:{width:"240px"},onKeyup:m(A,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),p(o,{label:"参数键名",prop:"configKey"},{default:f((()=>[p(a,{modelValue:s(j).configKey,"onUpdate:modelValue":l[1]||(l[1]=e=>s(j).configKey=e),placeholder:"请输入参数键名",clearable:"",style:{width:"240px"},onKeyup:m(A,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),p(o,{label:"系统内置",prop:"configType"},{default:f((()=>[p(w,{modelValue:s(j).configType,"onUpdate:modelValue":l[2]||(l[2]=e=>s(j).configType=e),placeholder:"系统内置",clearable:""},{default:f((()=>[(u(!0),d(g,null,y(s(x),(e=>(u(),v(n,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(o,{label:"创建时间",style:{width:"308px"}},{default:f((()=>[p(T,{modelValue:s(P),"onUpdate:modelValue":l[3]||(l[3]=e=>h(P)?P.value=e:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])])),_:1}),p(o,null,{default:f((()=>[p(D,{type:"primary",icon:"Search",onClick:A},{default:f((()=>[b("搜索")])),_:1}),p(D,{icon:"Refresh",onClick:G},{default:f((()=>[b("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[c,s(S)]]),p(ee,{gutter:10,class:"mb8"},{default:f((()=>[p(Q,{span:1.5},{default:f((()=>[r((u(),v(D,{type:"primary",plain:"",icon:"Plus",onClick:O},{default:f((()=>[b("新增")])),_:1})),[[de,["system:config:add"]]])])),_:1},8,["span"]),p(Q,{span:1.5},{default:f((()=>[r((u(),v(D,{type:"success",plain:"",icon:"Edit",disabled:s(R),onClick:W},{default:f((()=>[b("修改")])),_:1},8,["disabled"])),[[de,["system:config:edit"]]])])),_:1},8,["span"]),p(Q,{span:1.5},{default:f((()=>[r((u(),v(D,{type:"danger",plain:"",icon:"Delete",disabled:s(q),onClick:H},{default:f((()=>[b("删除")])),_:1},8,["disabled"])),[[de,["system:config:remove"]]])])),_:1},8,["span"]),p(Q,{span:1.5},{default:f((()=>[r((u(),v(D,{type:"warning",plain:"",icon:"Download",onClick:L},{default:f((()=>[b("导出")])),_:1})),[[de,["system:config:export"]]])])),_:1},8,["span"]),p(Q,{span:1.5},{default:f((()=>[r((u(),v(D,{type:"danger",plain:"",icon:"Refresh",onClick:X},{default:f((()=>[b("刷新缓存")])),_:1})),[[de,["system:config:remove"]]])])),_:1},8,["span"]),p(Z,{showSearch:s(S),"onUpdate:showSearch":l[4]||(l[4]=e=>h(S)?S.value=e:null),onQueryTable:E},null,8,["showSearch"])])),_:1}),r((u(),v(oe,{data:s(K),onSelectionChange:J},{default:f((()=>[p(le,{type:"selection",width:"55",align:"center"}),p(le,{label:"参数主键",align:"center",prop:"configId"}),p(le,{label:"参数名称",align:"center",prop:"configName","show-overflow-tooltip":!0}),p(le,{label:"参数键名",align:"center",prop:"configKey","show-overflow-tooltip":!0}),p(le,{label:"参数键值",align:"center",prop:"configValue"}),p(le,{label:"系统内置",align:"center",prop:"configType"},{default:f((e=>[p(ae,{options:s(x),value:e.row.configType},null,8,["options","value"])])),_:1}),p(le,{label:"备注",align:"center",prop:"remark","show-overflow-tooltip":!0}),p(le,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:f((l=>[_("span",null,V(e.parseTime(l.row.createTime)),1)])),_:1}),p(le,{label:"操作",align:"center",width:"150","class-name":"small-padding fixed-width"},{default:f((e=>[r((u(),v(D,{link:"",type:"primary",icon:"Edit",onClick:l=>W(e.row)},{default:f((()=>[b("修改")])),_:2},1032,["onClick"])),[[de,["system:config:edit"]]]),r((u(),v(D,{link:"",type:"primary",icon:"Delete",onClick:l=>H(e.row)},{default:f((()=>[b("删除")])),_:2},1032,["onClick"])),[[de,["system:config:remove"]]])])),_:1})])),_:1},8,["data"])),[[re,s(U)]]),r(p(ne,{total:s(I),page:s(j).pageNum,"onUpdate:page":l[5]||(l[5]=e=>s(j).pageNum=e),limit:s(j).pageSize,"onUpdate:limit":l[6]||(l[6]=e=>s(j).pageSize=e),onPagination:E},null,8,["total","page","limit"]),[[c,s(I)>0]]),p(ue,{title:s($),modelValue:s(N),"onUpdate:modelValue":l[12]||(l[12]=e=>h(N)?N.value=e:null),width:"500px","append-to-body":""},{footer:f((()=>[_("div",C,[p(D,{type:"primary",onClick:B},{default:f((()=>[b("确 定")])),_:1}),p(D,{onClick:F},{default:f((()=>[b("取 消")])),_:1})])])),default:f((()=>[p(Y,{ref:"configRef",model:s(z),rules:s(M),"label-width":"80px"},{default:f((()=>[p(o,{label:"参数名称",prop:"configName"},{default:f((()=>[p(a,{modelValue:s(z).configName,"onUpdate:modelValue":l[7]||(l[7]=e=>s(z).configName=e),placeholder:"请输入参数名称"},null,8,["modelValue"])])),_:1}),p(o,{label:"参数键名",prop:"configKey"},{default:f((()=>[p(a,{modelValue:s(z).configKey,"onUpdate:modelValue":l[8]||(l[8]=e=>s(z).configKey=e),placeholder:"请输入参数键名"},null,8,["modelValue"])])),_:1}),p(o,{label:"参数键值",prop:"configValue"},{default:f((()=>[p(a,{modelValue:s(z).configValue,"onUpdate:modelValue":l[9]||(l[9]=e=>s(z).configValue=e),placeholder:"请输入参数键值"},null,8,["modelValue"])])),_:1}),p(o,{label:"系统内置",prop:"configType"},{default:f((()=>[p(ie,{modelValue:s(z).configType,"onUpdate:modelValue":l[10]||(l[10]=e=>s(z).configType=e)},{default:f((()=>[(u(!0),d(g,null,y(s(x),(e=>(u(),v(te,{key:e.value,label:e.value},{default:f((()=>[b(V(e.label),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue"])])),_:1}),p(o,{label:"备注",prop:"remark"},{default:f((()=>[p(a,{modelValue:s(z).remark,"onUpdate:modelValue":l[11]||(l[11]=e=>s(z).remark=e),type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])])),_:1})])),_:1},8,["model","rules"])])),_:1},8,["title","modelValue"])])}}});export{x as default};
|