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