import{r as c,aa as De,ae as Ne,C as Ve,e as u,D as H,h as e,o as d,c as y,F as w,K as q,f as o,w as t,G as D,H as N,l as b,p as _,ab as J,L as Oe,m as z,J as K,z as Q,n as Ye,v as Ce}from"./index.82404a61.js";import{r as Se,s as xe,b as Fe,a as Te,c as Ue,d as Ie,e as qe}from"./surfaceWater.fc02dc70.js";const ze={key:0,class:"app-container"},Le={class:"dialog-footer"},Me={__name:"index",props:["paramsData"],setup(W,{emit:X}){const{paramsData:L}=W,{proxy:g}=Ce(),{hc_sample_factor:$e,sample_type:Pe,black_odor_level:$}=g.useDict("hc_sample_factor","sample_type","black_odor_level");console.log($,"black_odor_level");const h=c(!1),P=c(!1),p=c(!1),V=c(!0),S=c(!0),O=c(!1),Z=c(!0),x=c([]),F=c(0),Y=c(""),R=c([]),C=c([]),E=c([]);console.log("paramsDataparamsData",L.examineYear);const ee=De({formData:{configs:[]},queryParams:{pageNum:1,pageSize:10,sampleTime:"",riverId:"",blackOdor:"",sampleYear:"",sampleLocation:""},formRules:{riverId:[{required:!0,message:"\u8BF7\u9009\u62E9",trigger:"blur"}],sampleTime:[{required:!0,message:"\u8BF7\u9009\u62E9",trigger:"blur"}]}}),{queryParams:s,formData:r,formRules:T}=Ne(ee);function M(){r.value={riverId:void 0,sampleYear:void 0,sampleTime:void 0,blackOdor:void 0,sampleLocation:void 0,riverType:"black_odor"},g.resetForm("ruleForm")}function ae(){X("searchClick",0)}function le(){M(),O.value=!1,h.value=!1,p.value=!0,Y.value="\u65B0\u589E\u68C0\u6D4B\u8BB0\u5F55"}function A(){s.value.pageNum=1,k()}function oe(){g.resetForm("queryRef"),A()}const te=async()=>{Se({riverType:"black_odor"}).then(l=>{l.code==200&&(x.value=l.data)})},re=async()=>{xe({sampleType:"hcst"}).then(l=>{l.code==200&&(C.value=l.data,C.value.forEach(m=>{T.value[m.sampleFactor]=[{required:!0,message:"\u8BF7\u8F93\u5165",trigger:"blur",type:"number"}]}),console.log(T.value))})},ne=async()=>{Fe().then(n=>{n.code==200&&(E.value=n.data)})},k=async()=>{S.value=!0;const n=await Te(s.value);R.value=n.data.records,F.value=n.data.total,S.value=!1};async function se(){g.$refs.ruleForm.validate(n=>{if(n){r.value.configs=[];let l=[];C.value.forEach(m=>{l.push(m.sampleFactor)}),l.forEach(m=>{r.value.configs.push({factor:m,value:r.value[m]}),delete r.value[m]}),console.log(r.value,"formData.value.configs"),r.value.id!=null?Ue(r.value).then(()=>{console.log(r.value,"formData.value"),g.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),p.value=!1,k()}):Ie(r.value).then(()=>{console.log(r.value,"formData.valueformData.valueformData.value"),g.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),p.value=!1,k()})}})}function ue(n){r.value={...n},h.value=!1,P.value=!0,p.value=!0,Y.value="\u4FEE\u6539\u68C0\u6D4B\u8BB0\u5F55",O.value=!0,console.log(n,"row")}function de(n){g.$modal.confirm("\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F").then(async()=>{const l=await qe(n.id);(l==null?void 0:l.code)===200&&(g.$modal.msgSuccess("\u64CD\u4F5C\u6210\u529F\uFF01"),k())}).catch(()=>{})}function ie(n){Y.value="\u67E5\u770B\u68C0\u6D4B\u8BB0\u5F55",h.value=!0,p.value=!0,P.value=!0,O.value=!0,r.value={...n}}function ce(){p.value=!1,M()}function me(n){console.log(n,"val"),s.value.sampleYear=n}return Ve(()=>{s.value.sampleYear=L.examineYear,console.log(s.value.sampleYear,"queryParams.value.sampleYear"),k(),te(),re(),ne()}),(n,l)=>{const m=u("el-option"),U=u("el-select"),f=u("el-form-item"),B=u("el-date-picker"),v=u("el-button"),j=u("el-form"),pe=u("el-col"),fe=u("right-toolbar"),G=u("el-row"),I=u("el-table-column"),ve=u("el-table"),be=u("pagination"),_e=u("el-input"),ge=u("el-input-number"),ke=u("el-dialog"),ye=u("waterquality"),he=H("hasPermi"),we=H("loading");return e(Z)?(d(),y("div",ze,[w(o(j,{model:e(s),ref:"queryRef",inline:!0},{default:t(()=>[o(f,{label:"\u8003\u6838\u6C34\u4F53:",prop:"riverId"},{default:t(()=>[o(U,{clearable:"",modelValue:e(s).riverId,"onUpdate:modelValue":l[0]||(l[0]=a=>e(s).riverId=a),class:"m-2",placeholder:"\u8BF7\u9009\u62E9",size:"mini"},{default:t(()=>[(d(!0),y(D,null,N(e(x),a=>(d(),b(m,{key:a.id,label:a.riverName,value:Number(a.id)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(f,{label:"\u91C7\u6837\u5E74\u4EFD:",prop:"sampleYear"},{default:t(()=>[o(B,{modelValue:e(s).sampleYear,"onUpdate:modelValue":l[1]||(l[1]=a=>e(s).sampleYear=a),type:"year",placeholder:"\u8BF7\u9009\u62E9",format:"YYYY","value-format":"YYYY",onChange:me},null,8,["modelValue"])]),_:1}),o(f,{label:"\u8BC4\u4EF7\u7ED3\u679C:",prop:"blackOdor"},{default:t(()=>[o(U,{clearable:"",modelValue:e(s).blackOdor,"onUpdate:modelValue":l[2]||(l[2]=a=>e(s).blackOdor=a),class:"m-2",placeholder:"\u8BF7\u9009\u62E9",size:"mini"},{default:t(()=>[(d(!0),y(D,null,N(e($),a=>(d(),b(m,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(f,null,{default:t(()=>[o(v,{type:"primary",icon:"Search",onClick:A},{default:t(()=>[_("\u641C\u7D22")]),_:1}),o(v,{icon:"Refresh",onClick:oe},{default:t(()=>[_("\u91CD\u7F6E")]),_:1}),o(v,{icon:"CaretLeft",onClick:ae},{default:t(()=>[_(" \u8FD4\u56DE")]),_:1})]),_:1})]),_:1},8,["model"]),[[q,e(V)]]),o(G,{gutter:10,class:"mb8"},{default:t(()=>[o(pe,{span:1.5},{default:t(()=>[w((d(),b(v,{type:"primary",plain:"",icon:"Plus",onClick:le},{default:t(()=>[_("\u65B0\u589E")]),_:1})),[[he,["system:post:add"]]])]),_:1},8,["span"]),o(fe,{showSearch:e(V),"onUpdate:showSearch":l[3]||(l[3]=a=>J(V)?V.value=a:null),onQueryTable:k},null,8,["showSearch"])]),_:1}),w((d(),b(ve,{data:e(R),stripe:"","max-height":600,border:""},{default:t(()=>[o(I,{type:"index",width:"55",label:"\u5E8F\u53F7",fixed:"left"}),(d(!0),y(D,null,N(e(E),a=>(d(),b(I,{label:a.value,prop:a.key},Oe({_:2},[a.key=="blackOdorName"?{name:"default",fn:t(i=>[z("span",{style:K({color:i.row.blackOdorName=="\u65E0\u9ED1\u81ED"?"greenyellow":i.row.blackOdorName=="\u8F7B\u5EA6\u9ED1\u81ED"?" #419fff":i.row.blackOdorName=="\u4E2D\u5EA6\u9ED1\u81ED"?"orange":i.row.blackOdorName=="\u91CD\u5EA6\u9ED1\u81ED"?"red":""})},Q(i.row.blackOdorName=="\u65E0\u9ED1\u81ED"?"\u65E0\u9ED1\u81ED":i.row.blackOdorName=="\u8F7B\u5EA6\u9ED1\u81ED"?"\u8F7B\u5EA6\u9ED1\u81ED":i.row.blackOdorName=="\u4E2D\u5EA6\u9ED1\u81ED"?"\u4E2D\u5EA6\u9ED1\u81ED":i.row.blackOdorName=="\u91CD\u5EA6\u9ED1\u81ED"?"\u91CD\u5EA6\u9ED1\u81ED":""),5)]),key:"0"}:void 0]),1032,["label","prop"]))),256)),o(I,{label:"\u64CD\u4F5C","show-overflow-tooltip":"",width:"200",fixed:"right"},{default:t(({row:a})=>[o(v,{type:"primary",link:"",onClick:i=>ie(a)},{default:t(()=>[_("\u8BE6\u60C5")]),_:2},1032,["onClick"]),o(v,{type:"primary",link:"",onClick:i=>ue(a)},{default:t(()=>[_("\u4FEE\u6539")]),_:2},1032,["onClick"]),o(v,{type:"danger",link:"",onClick:i=>de(a)},{default:t(()=>[_("\u5220\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[we,e(S)]]),w(o(be,{total:e(F),page:e(s).pageNum,"onUpdate:page":l[4]||(l[4]=a=>e(s).pageNum=a),limit:e(s).pageSize,"onUpdate:limit":l[5]||(l[5]=a=>e(s).pageSize=a),onPagination:k},null,8,["total","page","limit"]),[[q,e(F)>0]]),o(ke,{title:e(Y),modelValue:e(p),"onUpdate:modelValue":l[9]||(l[9]=a=>J(p)?p.value=a:null),width:"70%","close-on-click-modal":!1},{footer:t(()=>[z("div",Le,[w(o(v,{type:"primary",onClick:se},{default:t(()=>[_("\u4FDD \u5B58")]),_:1},512),[[q,!e(h)]]),o(v,{onClick:ce},{default:t(()=>[_("\u5173\u95ED")]),_:1})])]),default:t(()=>[o(j,{ref:"ruleForm",model:e(r),rules:e(T),"label-width":"auto",disabled:e(h)},{default:t(()=>[o(G,null,{default:t(()=>[o(f,{label:"\u8003\u6838\u6C34\u4F53:",prop:"riverId",style:{width:"45%"}},{default:t(()=>[o(U,{clearable:"",modelValue:e(r).riverId,"onUpdate:modelValue":l[6]||(l[6]=a=>e(r).riverId=a),class:"m-2",placeholder:"\u8BF7\u9009\u62E9",size:"mini",style:{width:"100%"}},{default:t(()=>[(d(!0),y(D,null,N(e(x),a=>(d(),b(m,{key:a.id,label:a.riverName,value:Number(a.id)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(f,{label:"\u91C7\u6837\u65F6\u95F4:",prop:"sampleTime",style:{width:"45%"}},{default:t(()=>[o(B,{style:{width:"100%"},clearable:"",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",modelValue:e(r).sampleTime,"onUpdate:modelValue":l[7]||(l[7]=a=>e(r).sampleTime=a),type:"date"},null,8,["modelValue"])]),_:1}),o(f,{label:"\u91C7\u6837\u70B9:",prop:"sampleLocation",style:{width:"45%"}},{default:t(()=>[o(_e,{modelValue:e(r).sampleLocation,"onUpdate:modelValue":l[8]||(l[8]=a=>e(r).sampleLocation=a),placeholder:"\u8BF7\u8F93\u5165",style:{width:"100%"},clearable:""},null,8,["modelValue"])]),_:1}),(d(!0),y(D,null,N(e(C),a=>(d(),b(f,{label:a.sampleFactorName,prop:a.sampleFactor,style:{width:"45%"}},{default:t(()=>[o(ge,{modelValue:e(r)[a.sampleFactor],"onUpdate:modelValue":i=>e(r)[a.sampleFactor]=i,placeholder:"\u8BF7\u8F93\u5165",clearable:"","controls-position":"right",style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop"]))),256)),e(O)?(d(),b(f,{key:0,label:"\u9ED1\u81ED\u7A0B\u5EA6:",prop:"blackOdorName",style:{width:"45%"}},{default:t(()=>[z("div",{style:K({color:e(r).blackOdorName=="\u65E0\u9ED1\u81ED"?"greenyellow":e(r).blackOdorName=="\u8F7B\u5EA6\u9ED1\u81ED"?" #419fff":e(r).blackOdorName=="\u4E2D\u5EA6\u9ED1\u81ED"?"orange":e(r).blackOdorName=="\u91CD\u5EA6\u9ED1\u81ED"?"red":""})},Q(e(r).blackOdorName=="\u65E0\u9ED1\u81ED"?"\u65E0\u9ED1\u81ED":e(r).blackOdorName=="\u8F7B\u5EA6\u9ED1\u81ED"?"\u8F7B\u5EA6\u9ED1\u81ED":e(r).blackOdorName=="\u4E2D\u5EA6\u9ED1\u81ED"?"\u4E2D\u5EA6\u9ED1\u81ED":e(r).blackOdorName=="\u91CD\u5EA6\u9ED1\u81ED"?"\u91CD\u5EA6\u9ED1\u81ED":""),5)]),_:1})):Ye("",!0)]),_:1})]),_:1},8,["model","rules","disabled"])]),_:1},8,["title","modelValue"])])):(d(),b(ye,{key:1}))}}};export{Me as default};