import{_ as M,r as _,am as N,y as $,C as A,e as h,o as s,c as i,m as z,f as S,w as f,G as q,H,l as b,h as t,p as k,ab as Y,J as C,z as m,F as Z,K as G,v as J,E as K}from"./index.82404a61.js";import{p as O}from"./naturalWaterArea.e895856c.js";import{p as Q}from"./rules.4ab3a271.js";const W={class:"water-analysis-page"},X={class:"top"},ee={style:{display:"flex","flex-direction":"column"}},te={key:4},ae={key:5},le={key:6},se={key:8},oe={__name:"tableDalgo",props:["typeList"],setup(n,{expose:V,emit:T}){const{typeList:o}=n,{proxy:L}=J(),w=_({Authorization:"Bearer "+N()});V({submit:U,closed:B,resetFiled:I});const u=_(-1),x=_("");let a=_({projectNo:"",fileSaveRequestList:[]});const g=$(()=>{var l,r;return(r=(l=o.data)==null?void 0:l.itemDataTypePerformanceEvaluateItemList[0])==null?void 0:r.itemTarget}),y=_([]);function D(l){return K.confirm(`\u4E0B\u8F7D\u6B64\u6587\u4EF6: ${l.name}\uFF1F`).then(()=>window.open(l.url),()=>!1)}function R(l){return!0}function U(){L.$refs.ruleForm.validate(l=>{if(l){const r=[];let c=null;u.value>0?c=1:c=0;let d=o.data.itemDataTypePerformanceEvaluateItemList,F=o.data;d.length>0?(d[0].standardFlag=c,d[0].realValue=o.data.zzsUseRate,o.iSstandardFlag||c==1?d[0].realScore=d[0].itemScore:d[0].realScore=0):d.push({standardFlag:c,realScore:u.value>0&&F.zssUseCount||0}),o.data.itemDataTypePerformanceEvaluateItemList=d,y.value.forEach(p=>{p.hasOwnProperty("response")?(p.response.data.refType="ZSSLYL",r.push(p.response.data)):r.push(p)}),a.value={fileSaveRequestList:r,...o.data,itemDataType:"ZSSLYL"},O(a.value).then(({code:p})=>{p==200&&T("onModalClose")})}})}function E(){a.value=o.data,y.value=o.fileList1,u.value=o.data.zssUseCount*1-(g.value*o.allRealValue/100||0),L.$refs.ruleForm.resetFields(),console.log("FormList",a.value)}function I(){L.$refs.ruleForm.resetFields(),y.value=[]}function B(){T("onModalClose")}function P(l){console.log("v",l),a.value.zzsUseRate=(l*1/a.value.zssTotalCount*100||0).toFixed(2),a.value.zzsUseRate-g.value>=0?u.value=1:u.value=0}return A(()=>{E()}),(l,r)=>{const c=h("el-input-number"),d=h("el-button"),F=h("el-upload"),p=h("el-form-item"),j=h("el-form");return s(),i("div",W,[z("div",X,[S(j,{"label-width":"auto",rules:t(Q),inline:"",ref:"ruleForm",model:t(a),disabled:n.typeList.type==1},{default:f(()=>[(s(!0),i(q,null,H(n.typeList.monitorDynamicTableTitleList,e=>(s(),i("div",ee,[S(p,{label:e.value+":",prop:e.key,disabled:n.typeList.type==1||n.typeList.type==2},{default:f(()=>[e.key=="zssUseCount"?(s(),b(c,{key:0,style:{width:"300px"},placeholder:e.value,min:0,precision:2,step:.1,max:t(a).zssTotalCount,onChange:P,modelValue:t(a)[e.key],"onUpdate:modelValue":v=>t(a)[e.key]=v},{append:f(()=>[k(" k\u33A1 ")]),_:2},1032,["placeholder","step","max","modelValue","onUpdate:modelValue"])):e.key=="zssTotalCount"?(s(),b(c,{key:1,style:{width:"300px"},placeholder:e.value,min:0,precision:2,step:.1,modelValue:t(a)[e.key],"onUpdate:modelValue":v=>t(a)[e.key]=v},{append:f(()=>[k(" k\u33A1 ")]),_:2},1032,["placeholder","step","modelValue","onUpdate:modelValue"])):e.key=="attachFileList"?(s(),b(F,{key:2,"file-list":t(y),"onUpdate:file-list":r[0]||(r[0]=v=>Y(y)?y.value=v:null),class:"upload-demo",action:"/prod-api/system/upload",headers:t(w),multiple:"","on-preview":D,"before-remove":R,style:{width:"100vh"}},{default:f(()=>[S(d,{type:"primary"},{default:f(()=>[k("\u9009\u62E9\u6587\u4EF6")]),_:1})]),_:1},8,["file-list","headers"])):e.key=="standardFlag"&&n.typeList.iSstandardFlag?(s(),i("div",{key:3,style:C({color:n.typeList.iSstandardFlag?"#108ee9":"red"})},m(n.typeList.iSstandardFlag?"\u8FBE\u6807":"\u672A\u8FBE\u6807"),5)):e.key=="allRealValue"?(s(),i("div",te,m(n.typeList.allRealValue),1)):e.key=="zssTargetAreaCount"?(s(),i("div",ae,m((t(a).zssTotalCount*t(g)/100||0).toFixed(2)),1)):e.key=="itemTarget"?(s(),i("div",le,m(t(g)||0),1)):e.key=="standardFlag"&&!n.typeList.iSstandardFlag?(s(),i("div",{key:7,style:C({color:t(u)>=0?"#108ee9":"red"})},[Z(z("span",null,m(t(u)?x.value=1:x.value=0),513),[[G,!1]]),k(" "+m(t(u)>=0?"\u8FBE\u6807":"\u672A\u8FBE\u6807"),1)],4)):(s(),i("div",se,m(t(a)[e.key]),1))]),_:2},1032,["label","prop","disabled"])]))),256))]),_:1},8,["rules","model","disabled"])])])}}},ie=M(oe,[["__scopeId","data-v-d0015003"]]);export{ie as default};