mirror of
https://gitee.com/myxzgzs/boyue-kfcode-hasfj.git
synced 2025-06-21 17:59:37 +08:00
2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
import{C as ge,d as ye,r as c,O as ve,S as be,j as n,H as L,c as I,o as u,F as f,e as t,R as Q,k as o,w as a,l as j,I as M,J as O,h as _,P as $,m as r,f as P,B as q,V as we}from"./index-CrAWI0wi.js";import{l as ke,g as Ve,d as he,r as Ce,u as Te,a as xe}from"./type-DhGCOOB_.js";const Se={class:"app-container"},Ne={class:"dialog-footer"},De=ge({name:"Dict"}),$e=Object.assign(De,{setup(Re){const{proxy:p}=ye(),{sys_normal_disable:x}=p.useDict("sys_normal_disable"),B=c([]),y=c(!1),S=c(!0),C=c(!0),N=c([]),F=c(!0),E=c(!0),D=c(0),R=c(""),V=c([]),A=ve({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:d,form:i,rules:H}=be(A);function b(){S.value=!0,ke(p.addDateRange(d.value,V.value)).then(s=>{B.value=s.rows,D.value=s.total,S.value=!1})}function J(){y.value=!1,U()}function U(){i.value={dictId:void 0,dictName:void 0,dictType:void 0,status:"0",remark:void 0},p.resetForm("dictRef")}function T(){d.value.pageNum=1,b()}function G(){V.value=[],p.resetForm("queryRef"),T()}function W(){U(),y.value=!0,R.value="添加字典类型"}function X(s){N.value=s.map(e=>e.dictId),F.value=s.length!=1,E.value=!s.length}function Y(s){U();const e=s.dictId||N.value;Ve(e).then(w=>{i.value=w.data,y.value=!0,R.value="修改字典类型"})}function Z(){p.$refs.dictRef.validate(s=>{s&&(i.value.dictId!=null?Te(i.value).then(e=>{p.$modal.msgSuccess("修改成功"),y.value=!1,b()}):xe(i.value).then(e=>{p.$modal.msgSuccess("新增成功"),y.value=!1,b()}))})}function z(s){const e=s.dictId||N.value;p.$modal.confirm('是否确认删除字典编号为"'+e+'"的数据项?').then(function(){return he(e)}).then(()=>{b(),p.$modal.msgSuccess("删除成功")}).catch(()=>{})}function ee(){p.download("system/dict/type/export",{...d.value},`dict_${new Date().getTime()}.xlsx`)}function te(){Ce().then(()=>{p.$modal.msgSuccess("刷新成功"),we().cleanDict()})}return b(),(s,e)=>{const w=n("el-input"),g=n("el-form-item"),le=n("el-option"),ae=n("el-select"),oe=n("el-date-picker"),m=n("el-button"),K=n("el-form"),h=n("el-col"),ne=n("right-toolbar"),de=n("el-row"),v=n("el-table-column"),ie=n("router-link"),se=n("dict-tag"),ue=n("el-table"),re=n("pagination"),pe=n("el-radio"),me=n("el-radio-group"),ce=n("el-dialog"),k=L("hasPermi"),fe=L("loading");return u(),I("div",Se,[f(t(K,{model:o(d),ref:"queryRef",inline:!0,"label-width":"68px"},{default:a(()=>[t(g,{label:"字典名称",prop:"dictName"},{default:a(()=>[t(w,{modelValue:o(d).dictName,"onUpdate:modelValue":e[0]||(e[0]=l=>o(d).dictName=l),placeholder:"请输入字典名称",clearable:"",style:{width:"240px"},onKeyup:j(T,["enter"])},null,8,["modelValue"])]),_:1}),t(g,{label:"字典类型",prop:"dictType"},{default:a(()=>[t(w,{modelValue:o(d).dictType,"onUpdate:modelValue":e[1]||(e[1]=l=>o(d).dictType=l),placeholder:"请输入字典类型",clearable:"",style:{width:"240px"},onKeyup:j(T,["enter"])},null,8,["modelValue"])]),_:1}),t(g,{label:"状态",prop:"status"},{default:a(()=>[t(ae,{modelValue:o(d).status,"onUpdate:modelValue":e[2]||(e[2]=l=>o(d).status=l),placeholder:"字典状态",clearable:"",style:{width:"240px"}},{default:a(()=>[(u(!0),I(M,null,O(o(x),l=>(u(),_(le,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(g,{label:"创建时间",style:{width:"308px"}},{default:a(()=>[t(oe,{modelValue:o(V),"onUpdate:modelValue":e[3]||(e[3]=l=>$(V)?V.value=l:null),"value-format":"YYYY-MM-DD",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},null,8,["modelValue"])]),_:1}),t(g,null,{default:a(()=>[t(m,{type:"primary",icon:"Search",onClick:T},{default:a(()=>e[12]||(e[12]=[r("搜索")])),_:1}),t(m,{icon:"Refresh",onClick:G},{default:a(()=>e[13]||(e[13]=[r("重置")])),_:1})]),_:1})]),_:1},8,["model"]),[[Q,o(C)]]),t(de,{gutter:10,class:"mb8"},{default:a(()=>[t(h,{span:1.5},{default:a(()=>[f((u(),_(m,{type:"primary",plain:"",icon:"Plus",onClick:W},{default:a(()=>e[14]||(e[14]=[r("新增")])),_:1})),[[k,["system:dict:add"]]])]),_:1}),t(h,{span:1.5},{default:a(()=>[f((u(),_(m,{type:"success",plain:"",icon:"Edit",disabled:o(F),onClick:Y},{default:a(()=>e[15]||(e[15]=[r("修改")])),_:1},8,["disabled"])),[[k,["system:dict:edit"]]])]),_:1}),t(h,{span:1.5},{default:a(()=>[f((u(),_(m,{type:"danger",plain:"",icon:"Delete",disabled:o(E),onClick:z},{default:a(()=>e[16]||(e[16]=[r("删除")])),_:1},8,["disabled"])),[[k,["system:dict:remove"]]])]),_:1}),t(h,{span:1.5},{default:a(()=>[f((u(),_(m,{type:"warning",plain:"",icon:"Download",onClick:ee},{default:a(()=>e[17]||(e[17]=[r("导出")])),_:1})),[[k,["system:dict:export"]]])]),_:1}),t(h,{span:1.5},{default:a(()=>[f((u(),_(m,{type:"danger",plain:"",icon:"Refresh",onClick:te},{default:a(()=>e[18]||(e[18]=[r("刷新缓存")])),_:1})),[[k,["system:dict:remove"]]])]),_:1}),t(ne,{showSearch:o(C),"onUpdate:showSearch":e[4]||(e[4]=l=>$(C)?C.value=l:null),onQueryTable:b},null,8,["showSearch"])]),_:1}),f((u(),_(ue,{data:o(B),onSelectionChange:X},{default:a(()=>[t(v,{type:"selection",width:"55",align:"center"}),t(v,{label:"字典编号",align:"center",prop:"dictId"}),t(v,{label:"字典名称",align:"center",prop:"dictName","show-overflow-tooltip":!0}),t(v,{label:"字典类型",align:"center","show-overflow-tooltip":!0},{default:a(l=>[t(ie,{to:"/system/dict-data/index/"+l.row.dictId,class:"link-type"},{default:a(()=>[P("span",null,q(l.row.dictType),1)]),_:2},1032,["to"])]),_:1}),t(v,{label:"状态",align:"center",prop:"status"},{default:a(l=>[t(se,{options:o(x),value:l.row.status},null,8,["options","value"])]),_:1}),t(v,{label:"备注",align:"center",prop:"remark","show-overflow-tooltip":!0}),t(v,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:a(l=>[P("span",null,q(s.parseTime(l.row.createTime)),1)]),_:1}),t(v,{label:"操作",align:"center",width:"160","class-name":"small-padding fixed-width",fixed:"right"},{default:a(l=>[f((u(),_(m,{link:"",type:"primary",icon:"Edit",onClick:_e=>Y(l.row)},{default:a(()=>e[19]||(e[19]=[r("修改")])),_:2},1032,["onClick"])),[[k,["system:dict:edit"]]]),f((u(),_(m,{link:"",type:"primary",icon:"Delete",onClick:_e=>z(l.row)},{default:a(()=>e[20]||(e[20]=[r("删除")])),_:2},1032,["onClick"])),[[k,["system:dict:remove"]]])]),_:1})]),_:1},8,["data"])),[[fe,o(S)]]),f(t(re,{total:o(D),page:o(d).pageNum,"onUpdate:page":e[5]||(e[5]=l=>o(d).pageNum=l),limit:o(d).pageSize,"onUpdate:limit":e[6]||(e[6]=l=>o(d).pageSize=l),onPagination:b},null,8,["total","page","limit"]),[[Q,o(D)>0]]),t(ce,{title:o(R),modelValue:o(y),"onUpdate:modelValue":e[11]||(e[11]=l=>$(y)?y.value=l:null),width:"500px","append-to-body":""},{footer:a(()=>[P("div",Ne,[t(m,{type:"primary",onClick:Z},{default:a(()=>e[21]||(e[21]=[r("确 定")])),_:1}),t(m,{onClick:J},{default:a(()=>e[22]||(e[22]=[r("取 消")])),_:1})])]),default:a(()=>[t(K,{ref:"dictRef",model:o(i),rules:o(H),"label-width":"80px"},{default:a(()=>[t(g,{label:"字典名称",prop:"dictName"},{default:a(()=>[t(w,{modelValue:o(i).dictName,"onUpdate:modelValue":e[7]||(e[7]=l=>o(i).dictName=l),placeholder:"请输入字典名称"},null,8,["modelValue"])]),_:1}),t(g,{label:"字典类型",prop:"dictType"},{default:a(()=>[t(w,{modelValue:o(i).dictType,"onUpdate:modelValue":e[8]||(e[8]=l=>o(i).dictType=l),placeholder:"请输入字典类型"},null,8,["modelValue"])]),_:1}),t(g,{label:"状态",prop:"status"},{default:a(()=>[t(me,{modelValue:o(i).status,"onUpdate:modelValue":e[9]||(e[9]=l=>o(i).status=l)},{default:a(()=>[(u(!0),I(M,null,O(o(x),l=>(u(),_(pe,{key:l.value,value:l.value},{default:a(()=>[r(q(l.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(g,{label:"备注",prop:"remark"},{default:a(()=>[t(w,{modelValue:o(i).remark,"onUpdate:modelValue":e[10]||(e[10]=l=>o(i).remark=l),type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}});export{$e as default};
|