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"])])),
|