Agriculture-front-end/dist/assets/index.afbd9438.js

2 lines
9.0 KiB
JavaScript
Raw Normal View History

2023-09-21 17:37:29 +08:00
import{L as k,B as ye,r as g,D as ve,P as he,d as a,O as Q,o as d,c as $,G as _,H as z,f as n,e,w as o,i as j,Q as M,R as O,j as y,F as q,m as s,k as A,x as G,s as be}from"./index.57224d07.js";function Ve(p){return k({url:"/system/config/list",method:"get",params:p})}function we(p){return k({url:"/system/config/"+p,method:"get"})}function ke(p){return k({url:"/system/config",method:"post",data:p})}function Ce(p){return k({url:"/system/config",method:"put",data:p})}function xe(p){return k({url:"/system/config/"+p,method:"delete"})}function Ne(){return k({url:"/system/config/refreshCache",method:"delete"})}const Se={class:"app-container"},Te={class:"dialog-footer"},Ke=ye({name:"Config"}),De=Object.assign(Ke,{setup(p){const{proxy:c}=be(),{sys_yes_no:T}=c.useDict("sys_yes_no"),P=g([]),h=g(!1),K=g(!0),N=g(!0),U=g([]),B=g(!0),F=g(!0),D=g(0),R=g(""),C=g([]),H=ve({form:{},queryParams:{pageNum:1,pageSize:10,configName:void 0,configKey:void 0,configType:void 0},rules:{configName:[{required:!0,message:"\u53C2\u6570\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],configKey:[{required:!0,message:"\u53C2\u6570\u952E\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],configValue:[{required:!0,message:"\u53C2\u6570\u952E\u503C\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}}),{queryParams:u,form:i,rules:J}=he(H);function V(){K.value=!0,Ve(c.addDateRange(u.value,C.value)).then(r=>{P.value=r.rows,D.value=r.total,K.value=!1})}function W(){h.value=!1,I()}function I(){i.value={configId:void 0,configName:void 0,configKey:void 0,configValue:void 0,configType:"Y",remark:void 0},c.resetForm("configRef")}function S(){u.value.pageNum=1,V()}function X(){C.value=[],c.resetForm("queryRef"),S()}function Z(r){U.value=r.map(t=>t.configId),B.value=r.length!=1,F.value=!r.length}function ee(){I(),h.value=!0,R.value="\u6DFB\u52A0\u53C2\u6570"}function Y(r){I();const t=r.configId||U.value;we(t).then(b=>{i.value=b.data,h.value=!0,R.value="\u4FEE\u6539\u53C2\u6570"})}function le(){c.$refs.configRef.validate(r=>{r&&(i.value.configId!=null?Ce(i.value).then(t=>{c.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),h.value=!1,V()}):ke(i.value).then(t=>{c.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),h.value=!1,V()}))})}function E(r){const t=r.configId||U.value;c.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u53C2\u6570\u7F16\u53F7\u4E3A"'+t+'"\u7684\u6570\u636E\u9879\uFF1F').then(function(){return xe(t)}).then(()=>{V(),c.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}function oe(){c.download("system/config/export",{...u.value},`config_${new Date().getTime()}.xlsx`)}function ne(){Ne().then(()=>{c.$modal.msgSuccess("\u5237\u65B0\u7F13\u5B58\u6210\u529F")})}return V(),(r,t)=>{const b=a("el-input"),m=a("el-form-item"),te=a("el-option"),ae=a("el-select"),ie=a("el-date-picker"),f=a("el-button"),L=a("el-form"),x=a("el-col"),ue=a("right-toolbar"),re=a("el-row"),v=a("el-table-column"),de=a("dict-tag"),se=a("el-table"),ce=a("pagination"),fe=a("el-radio"),pe=a("el-radio-group"),me=a("el-dialog"),w=Q("hasPermi"),ge=Q("loading");return d(),$("div",Se,[_(e(L,{model:n(u),ref:"queryRef",inline:!0,"label-width":"68px"},{default:o(()=>[e(m,{label:"\u53C2\u6570\u540D\u79F0",prop:"configName"},{default:o(()=>[e(b,{modelValue:n(u).configName,"onUpdate:modelValue":t[0]||(t[0]=l=>n(u).configName=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0",clearable:"",style:{width:"240px"},onKeyup:j(S,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(m,{label:"\u53C2\u6570\u952E\u540D",prop:"configKey"},{default:o(()=>[e(b,{modelValue:n(u).configKey,"onUpdate:modelValue":t[1]||(t[1]=l=>n(u).configKey=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u952E\u540D",clearable:"",style:{width:"240px"},onKeyup:j(S,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(m,{label:"\u7CFB\u7EDF\u5185\u7F6E",prop:"configType"},{default:o(()=>[e(ae,{modelValue:n(u).configType,"onUpdate:modelValue":t[2]||(t[2]=l=>n(u).configType=l),placeholder:"\u7CFB\u7EDF\u5185\u7F6E",clearable:""},{default:o(()=>[(d(!0),$(M,null,O(n(T),l=>(d(),y(te,{key:l.value,label:l.label,value:l.value},null,8,