import{I as e}from"./IndexPagePro-44077094-1780912037814v=1.0.0.js";import{d as a,g as l,u as t,a as n}from"./fileManage-70ddefc0-1780912037814v=1.0.0.js";import{d as i,r as o,o as u,a as d,b as r,c as s,w as p,e as c,f as m,j as f,H as g,k as _,ae as v,E as y}from"./index-d052b22f-1780912037814v=1.0.0.js";const b={class:"dialog-footer"},w=i({__name:"index",setup(i){const w=o(!1),k=o(!1),x=o(!1),C=o([]),V=o(null),h=o(0),z=({file_type_id:e,des:l,name:t},n)=>{switch(n){case 2:v.confirm("确定删除该文件类型?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((async()=>{await a({file_type_id:e}),y.success("删除成功"),F()}));break;case 1:B.value.file_type_id=e,B.value.des=l,B.value.name=t,k.value=!0}},U=o(1),j=o(10),B=o({name:"",des:"",file_type_id:""}),P={name:[{required:!0,message:"请输入文件名称",trigger:"blur"}]},F=async()=>{w.value=!0;const{data:e}=await l({page:U.value,size:j.value});w.value=!1,C.value=e.list,h.value=e.count};return u((()=>{F()})),(a,l)=>{const i=d("el-button"),o=d("el-table-column"),u=d("el-table"),v=d("el-pagination"),I=d("el-input"),S=d("el-form-item"),T=d("el-form"),q=d("el-dialog");return r(),s(e,null,{toolButton:p((()=>[c(i,{type:"primary",onClick:l[0]||(l[0]=e=>{return a=m(V),k.value=!0,void(null==a||a.resetFields());var a})},{default:p((()=>l[8]||(l[8]=[f("新增")]))),_:1})])),pagination:p((()=>[c(v,{"current-page":m(U),"onUpdate:currentPage":l[1]||(l[1]=e=>g(U)?U.value=e:null),"page-size":m(j),"onUpdate:pageSize":l[2]||(l[2]=e=>g(j)?j.value=e:null),"page-sizes":[10,20,50,100],background:"",layout:"total, sizes, prev, pager, next",total:m(h),onSizeChange:F,onCurrentChange:F},null,8,["current-page","page-size","total"])])),dialog:p((()=>[c(q,{modelValue:m(k),"onUpdate:modelValue":l[7]||(l[7]=e=>g(k)?k.value=e:null),title:"文件类型",width:"30%"},{footer:p((()=>[_("span",b,[c(i,{onClick:l[5]||(l[5]=e=>k.value=!1)},{default:p((()=>l[11]||(l[11]=[f("取消")]))),_:1}),c(i,{type:"primary",loading:m(x),onClick:l[6]||(l[6]=e=>(async e=>{e&&await e.validate((async(e,a)=>{e&&(x.value=!0,B.value.file_type_id?await t(B.value):(delete B.value.file_type_id,await n(B.value)),y.success(B.value.file_type_id?"更新成功":"新增成功"),B.value.file_type_id="",x.value=!1,k.value=!1,F())}))})(m(V)))},{default:p((()=>l[12]||(l[12]=[f(" 确认 ")]))),_:1},8,["loading"])])])),default:p((()=>[c(T,{ref_key:"ruleFormRef",ref:V,model:m(B),rules:P,"label-width":"100px"},{default:p((()=>[c(S,{prop:"name",label:"文件名称"},{default:p((()=>[c(I,{modelValue:m(B).name,"onUpdate:modelValue":l[3]||(l[3]=e=>m(B).name=e)},null,8,["modelValue"])])),_:1}),c(S,{prop:"des",label:"文件填写说明"},{default:p((()=>[c(I,{modelValue:m(B).des,"onUpdate:modelValue":l[4]||(l[4]=e=>m(B).des=e),type:"textarea"},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])])),_:1},8,["modelValue"])])),default:p((()=>[c(u,{data:m(C),border:"",loading:m(w),style:{width:"100%"}},{default:p((()=>[c(o,{type:"index",label:"序号",width:"80",align:"center"}),c(o,{prop:"name",label:"名称",align:"center"}),c(o,{prop:"des",label:"说明",align:"center"}),c(o,{prop:"c_time",label:"创建时间",align:"center"}),c(o,{prop:"operator",label:"创建人",align:"center"}),c(o,{label:"操作",align:"center"},{default:p((e=>[c(i,{type:"primary",link:"",onClick:a=>z(e.row,1)},{default:p((()=>l[9]||(l[9]=[f("编辑")]))),_:2},1032,["onClick"]),c(i,{type:"primary",link:"",onClick:a=>z(e.row,2)},{default:p((()=>l[10]||(l[10]=[f("删除")]))),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data","loading"])])),_:1})}}});export{w as default};
