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

2 lines
7.9 KiB
JavaScript
Raw Normal View History

import{G as e,r as l,I as a,U as t,d,T as o,o as i,c as u,K as n,M as s,f as r,e as c,w as p,j as m,V as f,W as y,k as v,J as g,n as b,l as h,A as _,v as w,$ as V}from"./index.e5c8b0d6.js";import{l as k,g as x,u as T,a as C,d as N,r as U}from"./type.b030370e.js";const S={class:"app-container"},D={class:"dialog-footer"},I=e({name:"Dict"}),R=Object.assign(I,{setup(e){const{proxy:I}=w(),{sys_normal_disable:R}=I.useDict("sys_normal_disable"),$=l([]),q=l(!1),K=l(!0),P=l(!0),j=l([]),Y=l(!0),z=l(!0),M=l(0),E=l(""),F=l([]),A=a({form:{},queryParams:{pageNum:1,pageSize:10,dictName:void 0,dictType:void 0,status:void 0},rules:{dictName:[{required:!0,message:"字典名称不能为空",trigger:"blur"}],dictType:[{required:!0,message:"字典类型不能为空",trigger:"blur"}]}}),{queryParams:G,form:J,rules:O}=t(A);function Q(){K.value=!0,k(I.addDateRange(G.value,F.value)).then((e=>{$.value=e.rows,M.value=e.total,K.value=!1}))}function W(){q.value=!1,B()}function B(){J.value={dictId:void 0,dictName:void 0,dictType:void 0,status:"0",remark:void 0},I.resetForm("dictRef")}function H(){G.value.pageNum=1,Q()}function L(){F.value=[],I.resetForm("queryRef"),H()}function X(){B(),q.value=!0,E.value="添加字典类型"}function Z(e){j.value=e.map((e=>e.dictId)),Y.value=1!=e.length,z.value=!e.length}function ee(e){B();const l=e.dictId||j.value;x(l).then((e=>{J.value=e.data,q.value=!0,E.value="修改字典类型"}))}function le(){I.$refs.dictRef.validate((e=>{e&&(null!=J.value.dictId?T(J.value).then((e=>{I.$modal.msgSuccess("修改成功"),q.value=!1,Q()})):C(J.value).then((e=>{I.$modal.msgSuccess("新增成功"),q.value=!1,Q()})))}))}function ae(e){const l=e.dictId||j.value;I.$modal.confirm('是否确认删除字典编号为"'+l+'"的数据项?').then((function(){return N(l)})).then((()=>{Q(),I.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function te(){I.download("system/dict/type/export",{...G.value},`dict_${(new Date).getTime()}.xlsx`)}function de(){U().then((()=>{I.$modal.msgSuccess("刷新成功"),V().cleanDict()}))}return Q(),(e,l)=>{const a=d("el-input"),t=d("el-form-item"),w=d("el-option"),V=d("el-select"),k=d("el-date-picker"),x=d("el-button"),T=d("el-form"),C=d("el-col"),N=d("right-toolbar"),U=d("el-row"),I=d("el-table-column"),j=d("router-link"),A=d("dict-tag"),B=d("el-table"),oe=d("pagination"),ie=d("el-radio"),ue=d("el-radio-group"),ne=d("el-dialog"),se=o("hasPermi"),re=o("loading");return i(),u("div",S,[n(c(T,{model:r(G),ref:"queryRef",inline:!0,"label-width":"68px"},{default:p((()=>[c(t,{label:"字典名称",prop:"dictName"},{default:p((()=>[c(a,{modelValue:r(G).dictName,"onUpdate:modelValue":l[0]||(l[0]=e=>r(G).dictName=e),placeholder:"请输入字典名称",clearable:"",style:{width:"240px"},onKeyup:m(H,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),c(t,{label:"字典类型",prop:"dictType"},{default:p((()=>[c(a,{modelValue:r(G).dictType,"onUpdate:modelValue":l[1]||(l[1]=e=>r(G).dictType=e),placeholder:"请输入字典类型",clearable:"",style:{width:"240px"},onKeyup:m(H,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),c(t,{label:"状态",prop:"status"},{default:p((()=>[c(V,{modelValue:r(G).status,"onUpdate:modelValue":l[2]||(l[2]=e=>r(G).status=e),placeholder:"字典状态",clearable:"",style:{width:"240px"}},{default:p((()=>[(i(!0),u(f,null,y(r(R),(e=>(i(),v(w,{key:e.value,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),c(t,{label:"创建时间",style:{width:"308px"}},{default:p((()=>[c(k,{modelValue:r(F),"onUpdate:modelValue":l[3]||(l[3]=e=>g(F)?F.value=e:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])])),_:1}),c(t,null,{default:p((()=>[c(x,{type:"primary",icon:"Search",onClick:H},{default:p((()=>[b("搜索")])),_:1}),c(x,{icon:"Refresh",onClick:L},{default:p((()=>[b("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[s,r(P)]]),c(U,{gutter:10,class:"mb8"},{default:p((()=>[c(C,{span:1.5},{default:p((()=>[n((i(),v(x,{type:"primary",plain:"",