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