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