2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
import{J as k,_ as ye,K as ve,r as g,z as he,T as be,d as a,S as L,o as s,c as $,M as _,N as M,f as n,e,w as o,j as Q,F as j,D as A,k as y,L as q,m as d,l as J,x as O,g as Ve,s as we}from"./index.276e09af.js";function ke(p){return k({url:"/system/config/list",method:"get",params:p})}function Ce(p){return k({url:"/system/config/"+p,method:"get"})}function xe(p){return k({url:"/system/config",method:"post",data:p})}function Ne(p){return k({url:"/system/config",method:"put",data:p})}function Se(p){return k({url:"/system/config/"+p,method:"delete"})}function Te(){return k({url:"/system/config/refreshCache",method:"delete"})}const Ke={class:"app-container"},Ue={class:"dialog-footer"},De=ve({name:"Config"}),Re=Object.assign(De,{setup(p){const{proxy:c}=we(),{sys_yes_no:T}=c.useDict("sys_yes_no"),P=g([]),h=g(!1),K=g(!0),N=g(!0),U=g([]),F=g(!0),Y=g(!0),D=g(0),R=g(""),C=g([]),G=he({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:H}=be(G);function V(){K.value=!0,ke(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),F.value=r.length!=1,Y.value=!r.length}function ee(){I(),h.value=!0,R.value="\u6DFB\u52A0\u53C2\u6570"}function z(r){I();const t=r.configId||U.value;Ce(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?Ne(i.value).then(t=>{c.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),h.value=!1,V()}):xe(i.value).then(t=>{c.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),h.value=!1,V()}))})}function B(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 Se(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(){Te().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"),E=a("el-form"),x=a("el-col"),ue=a("right-toolbar"),re=a("el-row"),v=a("el-table-column"),se=a("dict-tag"),de=a("el-table"),ce=a("pagination"),fe=a("el-radio"),pe=a("el-radio-group"),me=a("el-dialog"),w=L("hasPermi"),ge=L("loading");return s(),$("div",Ke,[_(e(E,{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:Q(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:Q(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(()=>[(s(!0),$(j,null,A(n(T),l=>(s(),y(te,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(m,{label:"\u521B\u5EFA\u65F6\u95F4",style:{width:"308px"}},{default:o(()=>[e(ie,{modelValue:n(C),"onUpdate:modelValue":t[3]||(t[3]=l=>q(C)?C.value=l:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F"},null,8,["modelValue"])]),_:1}),e(m,null,{default:o(()=>[e(f,{type:"primary",icon:"Search",onClick:S},{default:o(()=>[d("\u641C\u7D22")]),_:1}),e(f,{icon:"Refresh",onClick:X},{default:o(()=>[d("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[M,n(N)]]),e(re,{gutter:10,class:"mb8"},{default:o(()=>[e(x,{span:1.5},{default:o(()=>[_((s(),y(f,{type:"primary",plain:"",icon:"Plus",onClick:ee},{default:o(()=>[d("\u65B0\u589E")]),_:1})),[[w,["system:config:add"]]])]),_:1},8,["span"]),e(x,{span:1.5},{default:o(()=>[_((s(),y(f,{type:"success",plain:"",icon:"Edit",disabled:n(F),onClick:z},{default:o(()=>[d("\u4FEE\u6539")]),_:1},8,["disabled"])),[[w,["system:config:edit"]]])]),_:1},8,["span"]),e(x,{span:1.5},{default:o(()=>[_((s(),y(f,{type:"danger",plain:"",icon:"Delete",disabled:n(Y),onClick:B},{default:o(()=>[d("\u5220\u9664")]),_:1},8,["disabled"])),[[w,["system:config:remove"]]])]),_:1},8,["span"]),e(x,{span:1.5},{default:o(()=>[_((s(),y(f,{type:"warning",plain:"",icon:"Download",onClick:oe},{default:o(()=>[d("\u5BFC\u51FA")]),_:1})),[[w,["system:config:export"]]])]),_:1},8,["span"]),e(x,{span:1.5},{default:o(()=>[_((s(),y(f,{type:"danger",plain:"",icon:"Refresh",onClick:ne},{default:o(()=>[d("\u5237\u65B0\u7F13\u5B58")]),_:1})),[[w,["system:config:remove"]]])]),_:1},8,["span"]),e(ue,{showSearch:n(N),"onUpdate:showSearch":t[4]||(t[4]=l=>q(N)?N.value=l:null),onQueryTable:V},null,8,["showSearch"])]),_:1}),_((s(),y(de,{data:n(P),onSelectionChange:Z},{default:o(()=>[e(v,{type:"selection",width:"55",align:"center"}),e(v,{label:"\u53C2\u6570\u4E3B\u952E",align:"center",prop:"configId"}),e(v,{label:"\u53C2\u6570\u540D\u79F0",align:"center",prop:"configName","show-overflow-tooltip":!0}),e(v,{label:"\u53C2\u6570\u952E\u540D",align:"center",prop:"configKey","show-overflow-tooltip":!0}),e(v,{label:"\u53C2\u6570\u952E\u503C",align:"center",prop:"configValue"}),e(v,{label:"\u7CFB\u7EDF\u5185\u7F6E",align:"center",prop:"configType"},{default:o(l=>[e(se,{options:n(T),value:l.row.configType},null,8,["options","value"])]),_:1}),e(v,{label:"\u5907\u6CE8",align:"center",prop:"remark","show-overflow-tooltip":!0}),e(v,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180"},{default:o(l=>[J("span",null,O(r.parseTime(l.row.createTime)),1)]),_:1}),e(v,{label:"\u64CD\u4F5C",align:"center",width:"150","class-name":"small-padding fixed-width"},{default:o(l=>[_((s(),y(f,{link:"",type:"primary",icon:"Edit",onClick:_e=>z(l.row)},{default:o(()=>[d("\u4FEE\u6539")]),_:2},1032,["onClick"])),[[w,["system:config:edit"]]]),_((s(),y(f,{link:"",type:"primary",icon:"Delete",onClick:_e=>B(l.row)},{default:o(()=>[d("\u5220\u9664")]),_:2},1032,["onClick"])),[[w,["system:config:remove"]]])]),_:1})]),_:1},8,["data"])),[[ge,n(K)]]),_(e(ce,{total:n(D),page:n(u).pageNum,"onUpdate:page":t[5]||(t[5]=l=>n(u).pageNum=l),limit:n(u).pageSize,"onUpdate:limit":t[6]||(t[6]=l=>n(u).pageSize=l),onPagination:V},null,8,["total","page","limit"]),[[M,n(D)>0]]),Ve(" \u6DFB\u52A0\u6216\u4FEE\u6539\u53C2\u6570\u914D\u7F6E\u5BF9\u8BDD\u6846 "),e(me,{title:n(R),modelValue:n(h),"onUpdate:modelValue":t[12]||(t[12]=l=>q(h)?h.value=l:null),width:"500px","append-to-body":""},{footer:o(()=>[J("div",Ue,[e(f,{type:"primary",onClick:le},{default:o(()=>[d("\u786E \u5B9A")]),_:1}),e(f,{onClick:W},{default:o(()=>[d("\u53D6 \u6D88")]),_:1})])]),default:o(()=>[e(E,{ref:"configRef",model:n(i),rules:n(H),"label-width":"80px"},{default:o(()=>[e(m,{label:"\u53C2\u6570\u540D\u79F0",prop:"configName"},{default:o(()=>[e(b,{modelValue:n(i).configName,"onUpdate:modelValue":t[7]||(t[7]=l=>n(i).configName=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(m,{label:"\u53C2\u6570\u952E\u540D",prop:"configKey"},{default:o(()=>[e(b,{modelValue:n(i).configKey,"onUpdate:modelValue":t[8]||(t[8]=l=>n(i).configKey=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u952E\u540D"},null,8,["modelValue"])]),_:1}),e(m,{label:"\u53C2\u6570\u952E\u503C",prop:"configValue"},{default:o(()=>[e(b,{modelValue:n(i).configValue,"onUpdate:modelValue":t[9]||(t[9]=l=>n(i).configValue=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u952E\u503C"},null,8,["modelValue"])]),_:1}),e(m,{label:"\u7CFB\u7EDF\u5185\u7F6E",prop:"configType"},{default:o(()=>[e(pe,{modelValue:n(i).configType,"onUpdate:modelValue":t[10]||(t[10]=l=>n(i).configType=l)},{default:o(()=>[(s(!0),$(j,null,A(n(T),l=>(s(),y(fe,{key:l.value,label:l.value},{default:o(()=>[d(O(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(m,{label:"\u5907\u6CE8",prop:"remark"},{default:o(()=>[e(b,{modelValue:n(i).remark,"onUpdate:modelValue":t[11]||(t[11]=l=>n(i).remark=l),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}}),$e=ye(Re,[["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/system/config/index.vue"]]);export{$e as default};
|