Newer
Older
Nanping_sponge_JXKH / spongePerformanceDist / assets / index.465bbd66.js
import{_ as H,r as w,u as Q,y as j,aa as G,C as K,e as s,D as W,o as S,c as X,m as Y,f as e,w as l,p as d,F as Z,h as f,l as ee,ab as N,L as te,v as le}from"./index.82404a61.js";import{a as oe,b as ae,c as ne,d as se}from"./examineManage.944deab4.js";import{u as ie}from"./usePagination.1242c574.js";const re={class:"examineManage"},de={class:"top"},ue={class:"dialog-footer"},ce={__name:"index",emits:["toggle"],setup(pe,{emit:me}){const{proxy:i}=le(),u=w({}),T=Q();i.useDict("sponge_engineering_type"),i.useDict("assess_type");const U={year:[{required:!0,message:"\u8003\u6838\u5E74\u5EA6\u4E0D\u80FD\u4E3A\u7A7A",trigger:["change"]}]},_=w({status:"",time:[]}),B=j(()=>{const o=JSON.parse(JSON.stringify(_.value)),{time:t}=o;return delete o.time,{...o,openStartTime:t[0]||"",openEndTime:t[1]||""}}),{pageNum:y,pageSize:b,tableData:E,total:P,loading:R,getTableList:g}=ie(oe,B),c=G({type:"",text:""}),p=w(!1),C=()=>{y.value=1,g()},A=()=>{_.value.year="",i.$refs.ruleForm.resetFields(),C()},x=(o,t)=>{p.value=!0,c.type=t,t=="edit"?u.value=o:u.value={}},$=o=>{p.value=!1,i.$refs.dialogruleForm.resetFields()},I=()=>{i.$refs.dialogruleForm.validate(async(o,t)=>{if(o){const v={...u.value};if(console.log("opts.type",c.type),c.type=="add"){const n=await ae(v);if((n==null?void 0:n.code)!==200)return;i.$modal.msgSuccess("\u64CD\u4F5C\u6210\u529F\uFF01"),p.value=!1}else{const n=await ne(v);if((n==null?void 0:n.code)!==200)return;i.$modal.msgSuccess("\u64CD\u4F5C\u6210\u529F\uFF01"),p.value=!1}g()}else console.log("error submit!",t)})},h=(o,t)=>{console.log("data",o),T.push(`/examinemanage/control/${o.id}?type=${t}&status=${o.status}&name=${o.configName}&year=${o.year}`)},J=o=>{i.$modal.confirm("\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F").then(async()=>{const t=await se(o.id);(t==null?void 0:t.code)===200&&(i.$modal.msgSuccess("\u64CD\u4F5C\u6210\u529F\uFF01"),g())}).catch(()=>{})};return K(()=>{g()}),(o,t)=>{const v=s("el-date-picker"),n=s("el-form-item"),V=s("el-col"),r=s("el-button"),D=s("el-row"),F=s("el-form"),m=s("el-table-column"),L=s("el-table"),M=s("pagination"),O=s("el-input"),q=s("el-dialog"),z=W("loading");return S(),X("div",re,[Y("div",de,[e(F,{ref:"ruleForm",model:_.value},{default:l(()=>[e(D,{gutter:20},{default:l(()=>[e(V,{span:4},{default:l(()=>[e(n,{label:"\u8003\u6838\u5E74\u5EA6:",prop:"time"},{default:l(()=>[e(v,{modelValue:_.value.year,"onUpdate:modelValue":t[0]||(t[0]=a=>_.value.year=a),type:"year","value-format":"YYYY",placeholder:"\u8BF7\u9009\u62E9\u5E74\u4EFD",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),e(V,{span:3},{default:l(()=>[e(n,null,{default:l(()=>[e(r,{type:"primary",icon:"Search",onClick:C},{default:l(()=>[d(" \u67E5\u8BE2")]),_:1}),e(r,{icon:"Refresh",onClick:A},{default:l(()=>[d("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),e(D,{class:"mb8"},{default:l(()=>[e(r,{class:"mr10",type:"primary",plain:"",icon:"Plus",onClick:t[1]||(t[1]=a=>x(o._,"add"))},{default:l(()=>[d("\u65B0\u589E")]),_:1})]),_:1})]),Z((S(),ee(L,{data:f(E),stripe:"","max-height":600},{default:l(()=>[e(m,{type:"index",width:"55",label:"\u5E8F\u53F7",align:"center",fixed:"left"}),e(m,{label:"\u5E74\u4EFD",align:"center",prop:"year","show-overflow-tooltip":""}),e(m,{label:"\u66F4\u65B0\u65F6\u95F4",align:"center",prop:"updateTime","show-overflow-tooltip":""}),e(m,{label:"\u4FEE\u6539\u4EBA",align:"center",prop:"updateBy","show-overflow-tooltip":""}),e(m,{label:"\u5907\u6CE8",align:"center",prop:"remark","show-overflow-tooltip":""}),e(m,{label:"\u64CD\u4F5C",align:"center","show-overflow-tooltip":"",width:"340",fixed:"right"},{default:l(({row:a})=>[e(r,{link:"",type:"primary",icon:"View",onClick:k=>h(a,"view")},{default:l(()=>[d("\u67E5\u770B")]),_:2},1032,["onClick"]),e(r,{type:"warning",icon:"Edit",link:"",onClick:k=>x(a,"edit")},{default:l(()=>[d("\u7F16\u8F91")]),_:2},1032,["onClick"]),e(r,{type:"success",icon:"Edit",link:"",onClick:k=>h(a,"edit")},{default:l(()=>[d("\u6307\u6807")]),_:2},1032,["onClick"]),e(r,{type:"danger",icon:"Delete",link:"",onClick:k=>J(a)},{default:l(()=>[d("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[z,f(R)]]),e(M,{total:f(P),page:f(y),"onUpdate:page":t[2]||(t[2]=a=>N(y)?y.value=a:null),limit:f(b),"onUpdate:limit":t[3]||(t[3]=a=>N(b)?b.value=a:null),onPagination:f(g)},null,8,["total","page","limit","onPagination"]),e(q,{modelValue:p.value,"onUpdate:modelValue":t[6]||(t[6]=a=>p.value=a),title:`${c.text}\u7EE9\u6548\u8BC4\u4F30`,"close-on-click-modal":!1,width:"30%","before-close":$,class:"dialog"},te({default:l(()=>[e(F,{ref:"dialogruleForm",rules:U,model:u.value,"label-width":"auto"},{default:l(()=>[e(n,{label:"\u8003\u6838\u5E74\u5EA6:",prop:"year"},{default:l(()=>[e(v,{modelValue:u.value.year,"onUpdate:modelValue":t[4]||(t[4]=a=>u.value.year=a),type:"year",placeholder:"\u8BF7\u9009\u62E9\u5E74\u4EFD",style:{width:"100%"},"value-format":"YYYY",disabled:c.type=="edit"},null,8,["modelValue","disabled"])]),_:1}),e(n,{label:"\u5907\u6CE8:",prop:"remark"},{default:l(()=>[e(O,{modelValue:u.value.remark,"onUpdate:modelValue":t[5]||(t[5]=a=>u.value.remark=a),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:2},[c.type!=="view"?{name:"footer",fn:l(()=>[Y("div",ue,[e(r,{type:"primary",onClick:I},{default:l(()=>[d("\u4FDD\u5B58")]),_:1}),e(r,{onClick:$},{default:l(()=>[d("\u53D6\u6D88")]),_:1})])]),key:"0"}:void 0]),1032,["modelValue","title"])])}}},ve=H(ce,[["__scopeId","data-v-bdb678f5"]]);export{ve as default};