(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-37a60efc"],{8610:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e._self._c;return t("basic-container",[t("avue-crud",{ref:"crud",attrs:{"table-loading":e.loading,option:e.option,data:e.data,page:e.page},on:{"update:page":function(t){e.page=t},"search-change":e.searchChange,"search-reset":e.searchReset,"current-change":e.currentChange,"size-change":e.sizeChange,"refresh-change":e.refreshChange,"selection-change":e.selectionChange},scopedSlots:e._u([{key:"menu",fn:function({type:i,size:a,row:r}){return[t("el-button",{attrs:{icon:"el-icon-view",size:a,type:i},on:{click:function(t){return e.handleView(r)}}},[e._v("查 看")]),t("el-button",{attrs:{icon:"el-icon-edit-outline",size:a,type:i},on:{click:function(t){return e.handleFilling(r)}}},[e._v("填 报")]),t("el-button",{attrs:{icon:"el-icon-delete",size:a,type:i,disabled:1==r.isRelevance},on:{click:function(t){return e.handleDel(r)}}},[e._v("删 除")]),t("el-button",{attrs:{icon:"el-icon-copy-document",size:a,type:i},on:{click:function(t){return e.handleCopy(r)}}},[e._v("复 制")])]}}])},[t("template",{slot:"menuLeft"},[t("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:e.handleAdd}},[e._v("新 增")])],1)],2),e.addShow?t("el-drawer",{attrs:{title:"新增",visible:e.addShow,direction:"rtl","before-close":e.handleClose,"modal-append-to-body":!1,"append-to-body":!0,size:"60%"},on:{"update:visible":function(t){e.addShow=t}}},[t("Configuration",{ref:"configuration",attrs:{getPageList:e.getPageList},on:{updateAddShow:e.updateAddShow}})],1):e._e(),e.fillingShow?t("el-drawer",{attrs:{title:"填报",visible:e.fillingShow,direction:"rtl","before-close":e.handleCloseFilling,"modal-append-to-body":!1,"append-to-body":!0,size:"90%"},on:{"update:visible":function(t){e.fillingShow=t}}},[t("Filling",{ref:"filling",attrs:{fillingView:e.fillingView,configurationForm:e.configurationForm},on:{updateAddShow:e.updateAddShow}})],1):e._e(),t("el-dialog",{attrs:{title:"修订版本",visible:e.isVersion,width:"30%","before-close":e.handleCloseVersion,"modal-append-to-body":!1,"append-to-body":!0},on:{"update:visible":function(t){e.isVersion=t}}},[t("el-form",{ref:"versionForm",attrs:{rules:e.rules,model:e.versionForm,inline:""}},[t("el-form-item",{attrs:{label:"版本号:",prop:"version"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择版本号"},model:{value:e.versionForm.version,callback:function(t){e.$set(e.versionForm,"version",t)},expression:"versionForm.version"}},e._l(e.versionList,(function(e){return t("el-option",{key:e.id,attrs:{label:e.dictValue,value:e.dictValue}})})),1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.handleSaveVersion}},[e._v("保 存")]),t("el-button",{on:{click:e.handleCloseVersion}},[e._v("取 消")])],1)],1)],1)},r=[],o=i("f1de"),c=function(){var e=this,t=e._self._c;return t("basic-container",[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-form",{ref:"form",staticStyle:{"margin-bottom":"20px"},attrs:{rules:e.rules,model:e.configurationForm,"label-width":"80px"}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"年度:",prop:"year"}},[t("el-date-picker",{staticStyle:{width:"100%"},attrs:{clearable:"",format:"yyyy","value-format":"yyyy","picker-options":e.pickeroption,type:"year",placeholder:"请选择年度"},model:{value:e.configurationForm.year,callback:function(t){e.$set(e.configurationForm,"year",t)},expression:"configurationForm.year"}})],1)],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"行业:",prop:"industryName"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择行业"},on:{change:e.selectIndustryName},model:{value:e.configurationForm.industryName,callback:function(t){e.$set(e.configurationForm,"industryName",t)},expression:"configurationForm.industryName"}},e._l(e.industryNames,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.name}})})),1)],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"机组:",prop:"deviceGroupName"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择机组"},model:{value:e.configurationForm.deviceGroupName,callback:function(t){e.$set(e.configurationForm,"deviceGroupName",t)},expression:"configurationForm.deviceGroupName"}},e._l(e.deviceGroupList,(function(e){return t("el-option",{key:e.id,attrs:{label:e.deviceGroupName,value:e.deviceGroupName}})})),1)],1)],1)],1)],1),t("span",[e._v("自定义因子:")]),t("el-button",{staticStyle:{float:"right"},attrs:{type:"text",icon:"el-icon-circle-plus-outline"},on:{click:e.addOption}},[e._v("添加因子")]),t("el-divider")],1),t("el-col",{attrs:{span:24}},[t("el-tabs",{attrs:{"tab-position":"left"},on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},e._l(e.treeList,(function(i){return t("el-tab-pane",{key:i.id,attrs:{label:i.name,name:i.code}},[t("el-checkbox-group",{on:{change:e.handleFactor},model:{value:e.checkList,callback:function(t){e.checkList=t},expression:"checkList"}},e._l(e.factorObj[e.activeName],(function(e){return t("el-checkbox",{key:e.id,attrs:{label:e.factorName}})})),1)],1)})),1)],1)],1),t("el-dialog",{attrs:{title:"新增因子",visible:e.showAddCheckbox,width:"50%","modal-append-to-body":!1,"append-to-body":!0,modal:e.factorForm,"before-close":e.handleFactorClose},on:{"update:visible":function(t){e.showAddCheckbox=t}}},[t("el-form",{ref:"factorform",staticStyle:{"margin-right":"20px"},attrs:{rules:e.rules,"label-width":"160px"}},[t("el-row",{attrs:{gutter:30}},[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"因子名称:"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择因子名称"},model:{value:e.factorForm.identify,callback:function(t){e.$set(e.factorForm,"identify",t)},expression:"factorForm.identify"}},e._l(e.factorObj[e.activeName],(function(e){return t("el-option",{key:e.id,attrs:{label:e.factorName,value:e.factorName}})})),1)],1)],1),t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"因子名称:"}},[t("el-input",{attrs:{clearable:"",placeholder:"请输入因子名称"},model:{value:e.factorForm.factorName,callback:function(t){e.$set(e.factorForm,"factorName",t)},expression:"factorForm.factorName"}})],1)],1)],1)],1),t("div",{staticClass:"avue-dialog__footer"},[t("el-button",{attrs:{type:"primary",icon:"el-icon-circle-plus-outline"},on:{click:e.handleFactorSave}},[e._v("保存")]),t("el-button",{attrs:{icon:"el-icon-circle-close"},on:{click:e.handleFactorClose}},[e._v("取消")])],1)],1),t("div",{staticClass:"avue-dialog__footer"},[t("el-button",{attrs:{type:"primary",icon:"el-icon-circle-plus-outline"},on:{click:e.handleSave}},[e._v("保存")]),t("el-button",{attrs:{icon:"el-icon-circle-close"},on:{click:e.handleCanCel}},[e._v("取消")])],1)],1)},n=[],s=(i("fcd3"),i("2c14")),l={props:["getPageList"],data(){return{showAddCheckbox:!1,newOptionLabel:"",pickeroption:{disabledDate(e){return e.getTime()>=(new Date).getTime()}},deviceGroupList:[],checkList:[],configurationForm:{year:(new Date).getFullYear().toString(),industryName:"",deviceGroupName:""},rules:{year:[{required:!0,message:"请选择年度",trigger:"blur"}],industryName:[{required:!0,message:"请选择行业",trigger:"change"}],deviceGroupName:[{required:!0,message:"请选择机组",trigger:"change"}]},treeList:[],activeName:"RLRS",factorObj:{},factorList:[],allFactorList:[],factorForm:{factorName:""},deviceGroupId:"",industryNames:[],industryName:"",industryId:"",versionList:[]}},methods:{init(){this.getTreeList(),this.getSystemDict()},initForm(){return{industryName:"",checkList:[]}},addOption(){this.$refs.form.validate(e=>{e&&(this.showAddCheckbox=!0)})},getSystemDict(){Object(o["getDict"])("version").then(e=>{this.versionList=e.data.data[0].children||[]})},getTreeList(){Object(s["getParentList"])({parentId:0}).then(e=>{this.industryNames=e.data.data.records})},selectIndustryName(e){this.industryName=e,this.industryNames.forEach(t=>{t.name===e&&(this.industryId=t.id)}),this.getTree(),this.getOwnFactortList()},getDeviceGroupList(e){let t={...e};Object(o["getSetList"])(t).then(e=>{const t=e.data.data;this.deviceGroupList=t.records||[]})},getTree(){Object(o["getParentTreeList"])(this.industryId).then(e=>{200===e.data.code&&(this.treeList=e.data.data||[])})},getOwnFactortList(){this.factorObj[this.activeName]?this.factorList=this.factorObj[this.activeName]:Object(o["getOwnFactortList"])(this.activeName).then(e=>{if(200===e.data.code){const t=e.data.data||[];this.$set(this.factorObj,this.activeName,t),t.forEach(e=>{this.allFactorList.find(t=>t.factorName===e.factorName)||this.allFactorList.push(e)})}})},handleClick(){this.getOwnFactortList()},handleFactorSave(){if(""!==this.factorForm.factorName){let e={};this.allFactorList.forEach(t=>{this.factorForm.identify===t.factorName&&(e={id:t.id,factorName:this.factorForm.factorName,type:t.type,typeCode:t.typeCode})}),this.factorObj[this.activeName].push(e),this.allFactorList.push(e),this.showAddCheckbox=!1,this.factorForm={}}},handleSave(){this.$refs.form.validate(e=>{if(e){this.deviceGroupList.forEach(e=>{this.configurationForm.deviceGroupName===e.deviceGroupName&&(this.deviceGroupId=e.id)});let e={...this.configurationForm},t=[],i=[],a=[];this.checkList.forEach(e=>{this.allFactorList.forEach(r=>{e===r.factorName&&(t.push(r.type),i.push(r.typeCode),a.push(r.id))})}),e.pcode=t.join(","),e.code=i.join(","),e.factorCode=a.join(","),e.factorName=this.checkList.join(","),e.industryId=this.industryId,e.deviceGroupId=this.deviceGroupId,e.version="v1.5.0",this.checkList.length>0?Object(o["saveDataConfirm"])(e).then(e=>{200===e.data.code&&(this.$message.success("保存成功"),this.$emit("updateAddShow",!1),this.getPageList())}):this.$message.error("请选择因子")}})},handleCanCel(){this.$confirm("确认关闭?").then(e=>{this.$emit("updateAddShow",!1),this.configurationForm=this.initForm()}).catch(e=>{})},handleFactorClose(){this.$confirm("确认关闭?").then(e=>{this.showAddCheckbox=!1,this.factorForm={}}).catch(e=>{})}},mounted(){this.init()},watch:{"configurationForm.year"(e){this.configurationForm.year&&this.configurationForm.industryName&&(this.configurationForm.deviceGroupName="",this.getDeviceGroupList({industryName:this.configurationForm.industryName,year:this.configurationForm.year}))},"configurationForm.industryName"(e){this.configurationForm.year&&this.configurationForm.industryName&&(this.configurationForm.deviceGroupName="",this.getDeviceGroupList({industryName:this.configurationForm.industryName,year:this.configurationForm.year}))}}},d=l,m=(i("ae9f"),i("1805")),u=Object(m["a"])(d,c,n,!1,null,"5ae715db",null),h=u.exports,p=function(){var e=this,t=e._self._c;return t("basic-container",[t("el-tabs",{attrs:{type:"card"},on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},e._l(e.factorNameList,(function(e,i){return t("el-tab-pane",{key:i,attrs:{label:e.name,name:e.name}})})),1),t("el-row",{attrs:{gutter:10}},[t("el-col",{attrs:{span:4}},[t("el-card",[t("el-tree",{ref:"tree",attrs:{data:e.treeData,"node-key":"id",props:e.props,"default-expand-all":!0},on:{"node-click":e.handleNodeClick}})],1)],1),t("el-col",{attrs:{span:20}},[t("el-card",[t("el-form",{ref:"filling",attrs:{rules:e.rules2,model:e.getCurrentForm,"label-width":"160px"}},[t("el-row",{attrs:{gutter:20}},["生产数据"!=e.currentTabItem.name&&"热量"!=e.currentTabItem.name&&"排放强度"!=e.currentTabItem.name&&"排放量"!=e.currentTabItem.name&&"购入电力"!=e.currentTabItem.name?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"配置生产设备:",prop:"deviceName"}},[t("el-select",{attrs:{multiple:"",placeholder:"请选择获取方式"},on:{change:e.handleDevice},model:{value:e.getCurrentForm.deviceName,callback:function(t){e.$set(e.getCurrentForm,"deviceName",t)},expression:"getCurrentForm.deviceName"}},e._l(e.productions,(function(e){return t("el-option",{key:e.id,attrs:{label:e.deviceName,value:e.deviceName}})})),1)],1)],1):e._e(),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"单位:",prop:"unit"}},[t("el-input",{attrs:{placeholder:"请输入单位"},model:{value:e.getCurrentForm.unit,callback:function(t){e.$set(e.getCurrentForm,"unit",t)},expression:"getCurrentForm.unit"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"获取方式:",prop:"access"}},[t("el-select",{attrs:{placeholder:"请选择获取方式"},model:{value:e.getCurrentForm.access,callback:function(t){e.$set(e.getCurrentForm,"access",t)},expression:"getCurrentForm.access"}},e._l(e.accessData,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"具体表述:",prop:"copywriting"}},[t("el-input",{attrs:{placeholder:"请输入具体表述"},model:{value:e.getCurrentForm.copywriting,callback:function(t){e.$set(e.getCurrentForm,"copywriting",t)},expression:"getCurrentForm.copywriting"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"数据来源:",prop:"dataSource"}},[t("el-input",{attrs:{placeholder:"请输入数据来源"},model:{value:e.getCurrentForm.dataSource,callback:function(t){e.$set(e.getCurrentForm,"dataSource",t)},expression:"getCurrentForm.dataSource"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"测量设备:",prop:"measureDevice"}},[t("el-input",{attrs:{placeholder:"请输入测量设备"},model:{value:e.getCurrentForm.measureDevice,callback:function(t){e.$set(e.getCurrentForm,"measureDevice",t)},expression:"getCurrentForm.measureDevice"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"测量型号:",prop:"measureModel"}},[t("el-input",{attrs:{placeholder:"请输入测量型号"},model:{value:e.getCurrentForm.measureModel,callback:function(t){e.$set(e.getCurrentForm,"measureModel",t)},expression:"getCurrentForm.measureModel"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"测量频次:",prop:"measureFrequency"}},[t("el-input",{attrs:{placeholder:"请输入测量频次"},model:{value:e.getCurrentForm.measureFrequency,callback:function(t){e.$set(e.getCurrentForm,"measureFrequency",t)},expression:"getCurrentForm.measureFrequency"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"规定的测量设备校准频率:",prop:"requireTimeMeasure"}},[t("el-input",{attrs:{placeholder:"规定的测量设备校准频率"},model:{value:e.getCurrentForm.requireTimeMeasure,callback:function(t){e.$set(e.getCurrentForm,"requireTimeMeasure",t)},expression:"getCurrentForm.requireTimeMeasure"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"数据记录频次:",prop:"recordingFrequency"}},[t("el-input",{attrs:{placeholder:"请输入数据记录频次"},model:{value:e.getCurrentForm.recordingFrequency,callback:function(t){e.$set(e.getCurrentForm,"recordingFrequency",t)},expression:"getCurrentForm.recordingFrequency"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"数据缺失时的处理方式:",prop:"missingMethod"}},[t("el-input",{attrs:{placeholder:"请输入数据缺失时的处理方式"},model:{value:e.getCurrentForm.missingMethod,callback:function(t){e.$set(e.getCurrentForm,"missingMethod",t)},expression:"getCurrentForm.missingMethod"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"数据获取负责部门:",prop:"orgGetData"}},[t("el-input",{attrs:{placeholder:"请输入数据获取负责部门"},model:{value:e.getCurrentForm.orgGetData,callback:function(t){e.$set(e.getCurrentForm,"orgGetData",t)},expression:"getCurrentForm.orgGetData"}})],1)],1)],1)],1)],1)],1)],1),t("div",{staticClass:"avue-dialog__footer"},[t("el-button",{attrs:{type:"primary",icon:"el-icon-circle-plus-outline"},on:{click:e.handleSave}},[e._v("保 存")]),t("el-button",{attrs:{icon:"el-icon-circle-close"},on:{click:e.handleCanCel}},[e._v("取 消")])],1)],1)},g=[];i("10ca");const f=[{name:"生产数据",value:"sc",pcode:"PR",factorCode:""},{name:"热量",value:"rl",pcode:"PR",factorCode:""},{name:"排放强度",value:"qd",pcode:"PR",factorCode:""},{name:"排放量",value:"pfl",pcode:"PR",factorCode:""}];var v={props:["configurationForm","fillingView"],data(){return{activeName:"生产数据",currentTabItem:{},form:{},rules:[],factorNameList:[],factorCodeList:[],factorList:[],treeData:[],indicatorType:"",codeData:[],allFillingForm:{},fillingForm:{deviceName:"",unit:"",access:"",copywriting:"",dataSource:"",measureDevice:"",measureModel:"",measureFrequency:"",requireTimeMeasure:"",recordingFrequency:"",missingMethod:"",orgGetData:"",factorName:"",factorCode:"",code:"",pcode:"",deviceGroupId:"",configGroupId:"",configEnglishName:"",dataConfirmId:"",indicatorType:"",configName:"",paramName:""},fillForm:{},accessData:[{label:"实测",value:"实测"},{label:"计算",value:"计算"},{label:"缺省",value:"缺省"}],rules2:{unit:[{required:!0,message:"请输入单位",trigger:"blur"}],deviceName:[{required:!0,message:"请选择生产设备",trigger:"blur"}]},productions:[],currentTreeNodeId:"",deviceId:[],deviceList:[],localTabList:["生产数据","热量","排放强度","排放量"],clickTabList:[]}},computed:{getCurrentForm(){return this.allFillingForm[`${this.activeName}_${this.currentTreeNodeId}`]?this.allFillingForm[`${this.activeName}_${this.currentTreeNodeId}`]:JSON.parse(JSON.stringify(this.fillingForm))}},mounted(){this.init()},methods:{init(){this.initTap(),this.getProductionList(),this.getFilling()},handleDevice(e){Object.keys(this.allFillingForm).forEach(t=>{t.split("_")[0]===this.currentTabItem.name&&(this.allFillingForm[t].deviceName=e)})},checkParams(){let e=!0;try{return Object.entries(this.allFillingForm).forEach(([t,i])=>{try{Object.entries(i).forEach(([a,r])=>{if("unit"===a){if(!r)throw e=!1,new Error(this.$message.error(`${t.split("_")[0]}-${i.paramName}下的单位不能为空`))}else if("deviceName"===a&&"生产数据"!=i.factorName&&"热量"!=i.factorName&&"排放强度"!=i.factorName&&"排放量"!=i.factorName&&"购入电力"!=i.factorName&&!r)return this.$message.error(`${t.split("_")[0]}-${i.paramName}下的生产设备不能为空`),void(e=!1)})}finally{}}),e}catch(t){}},async getProductionList(){let e={deviceGroupId:this.configurationForm.deviceGroupId};await Object(o["getProduction"])(e).then(e=>{if(200===e.data.code){const t=e.data.data.records||[];this.productions=t}})},initTap(){const e=this.configurationForm.factorName.split(",");this.activeName=e[0],this.factorCodeList=this.configurationForm.factorCode.split(","),this.factorpCodeList=this.configurationForm.pcode.split(",");const t=this.configurationForm.code.split(",");let i=[];for(let a=0;a{this.handleClick({name:e},"init")}),this.handleClick({name:this.activeName})},getFillingCode(e){return new Promise(t=>{Object(o["getFillingCode"])(e).then(e=>{if(200===e.data.code){const t=e.data.data||[];this.codeData=t;let i=t.filter(e=>1===e.indexType),a=t.filter(e=>2===e.indexType),r=[],o=[];i.forEach((e,t)=>{r.push({label:e.configName,code:e.code,id:e.id,access:e.access,code:e.code,configEnglishName:e.configEnglishName,configName:e.configName,copywriting:e.copywriting,unit:e.unit,indicatorType:"活动数据",factorName:this.currentTabItem.name,paramName:e.configName})}),a.forEach((e,t)=>{o.push({label:e.configName,code:e.code,id:e.id,access:e.access,code:e.code,configEnglishName:e.configEnglishName,configName:e.configName,copywriting:e.copywriting,unit:e.unit,indicatorType:"排放因子",factorName:this.currentTabItem.name,paramName:e.configName})}),this.treeData=[{label:"活动数据",id:"a9",children:r},{label:"排放因子",id:"a10",children:o}]}t()})})},fillAllForm(e){const t=this.factorNameList.find(t=>t.name===e);this.treeData.forEach((e,i)=>{e=this.treeData[i],e.children||this.allFillingForm[`${t.name}_${e.id}`]||this.$set(this.allFillingForm,`${t.name}_${e.id}`,{deviceName:e.deviceName,unit:e.unit,access:e.access,copywriting:e.copywriting,dataSource:"",measureDevice:"",measureModel:"",measureFrequency:"",requireTimeMeasure:"",recordingFrequency:"",missingMethod:"",orgGetData:"",factorName:e.factorName,factorCode:"",code:e.code,pcode:e.pcode,deviceGroupId:this.configurationForm.deviceGroupId,configGroupId:this.configurationForm.id,configEnglishName:e.configEnglishName,dataConfirmId:"",indicatorType:e.indicatorType,configName:e.configName,paramName:e.paramName}),e.children&&e.children.forEach(e=>{this.allFillingForm[`${t.name}_${e.id}`]||this.$set(this.allFillingForm,`${t.name}_${e.id}`,{deviceName:e.deviceName,deviceId:"",unit:e.unit,access:e.access,copywriting:e.copywriting,dataSource:"",measureDevice:"",measureModel:"",measureFrequency:"",requireTimeMeasure:"",recordingFrequency:"",missingMethod:"",orgGetData:"",factorName:e.factorName,factorCode:t.factorCode,code:e.code,pcode:t.pcode,deviceGroupId:this.configurationForm.deviceGroupId,configGroupId:this.configurationForm.id,configEnglishName:e.configEnglishName,dataConfirmId:"",indicatorType:e.indicatorType,configName:e.configName,paramName:e.paramName})})})},setActiveTreeNode(){for(let e=0,t=this.treeData.length;e0){this.handleNodeClick(t.children[0]),this.$nextTick(()=>{this.$refs.tree.setCurrentNode(t.children[0])});break}this.handleNodeClick(t),this.$nextTick(()=>{this.$refs.tree.setCurrentNode(t)});break}},handleClick(e,t){if(this.currentTabItem=e,"生产数据"===e.name)this.treeData=[{factorName:"生产数据",indicatorType:"",paramName:"发电量",configName:"发电量",configEnglishName:"PR",pcode:"PR",code:"PR",unit:"MWh",$cellEdit:!0,copywriting:"自行检测",access:"实测",deviceGroupId:"",configGroupId:"",deviceName:"",label:"发电量",id:"a1"},{factorName:"生产数据",indicatorType:"",paramName:"供热量",configName:"供热量",configEnglishName:"PR",pcode:"PR",code:"PR",unit:"GJ",$cellEdit:!0,copywriting:"自行检测",access:"实测",deviceName:"",label:"供热量",id:"a2"},{factorName:"生产数据",indicatorType:"",paramName:"运行小时数",configName:"运行小时数",configEnglishName:"PR",code:"PR",pcode:"PR",unit:"h",$cellEdit:!0,copywriting:"其他(请填写详细说明),根据机组开停车时间进行统计",access:"实测",deviceName:"",label:"运行小时数",id:"a3"},{factorName:"生产数据",indicatorType:"",paramName:"负荷(出力)系数",configName:"负荷(出力)系数",configEnglishName:"PR",code:"PR",pcode:"PR",unit:"%",$cellEdit:!0,copywriting:"=发电量/∑(单机组运行小时数*单机组装机容量)",access:"计算",deviceName:"",label:"负荷(出力)系数",id:"a4"}],this.fillAllForm(e.name),"init"!==t&&this.setActiveTreeNode();else if("热量"===e.name)this.treeData=[{factorName:"热量",indicatorType:"",paramName:"机组化石燃烧热量",configName:"机组化石燃烧热量",configEnglishName:"HL",code:"HL",pcode:"PR",unit:"GJ",$cellEdit:!0,copywriting:"机组化石燃烧热量=燃煤热量+燃油热量+燃气热量",access:"计算",deviceName:"",label:"机组化石燃烧热量",id:"a5"}],this.fillAllForm(e.name),"init"!==t&&this.setActiveTreeNode();else if("排放强度"===e.name)this.treeData=[{factorName:"排放强度",indicatorType:"",paramName:"综合能源碳排放强度",configName:"综合能源碳排放强度",configEnglishName:"SH",code:"SH",pcode:"PR",unit:"tCO₂/t",$cellEdit:!0,copywriting:"综合能源碳排放强度=机组二氧化碳排放量/耗标煤量",access:"计算",deviceName:"",label:"综合能源碳排放强度",id:"a6"}],this.fillAllForm(e.name),"init"!==t&&this.setActiveTreeNode();else if("排放量"===e.name)this.treeData=[{factorName:"排放量",indicatorType:"",paramName:"化石燃料燃烧碳排放量",configName:"化石燃料燃烧碳排放量",configEnglishName:"EN",code:"EN",pcode:"PR",unit:"tCO₂",$cellEdit:!0,copywriting:"化石燃料燃烧碳排放量=燃煤排放量+燃油排放量+燃气排放量",access:"计算",deviceName:"",label:"化石燃料燃烧碳排放量",id:"a7"},{factorName:"排放量",indicatorType:"",paramName:"机组二氧化碳排放总量",configName:"机组二氧化碳排放总量",configEnglishName:"EN",code:"EN",pcode:"PR",unit:"tCO₂",$cellEdit:!0,copywriting:"机组二氧化碳排放总量=化石燃料燃烧碳排放量+购入使用电力碳排放量",access:"计算",deviceName:"",label:"机组二氧化碳排放总量",id:"a8"}],this.fillAllForm(e.name),"init"!==t&&this.setActiveTreeNode();else{let t;this.factorNameList.forEach(i=>{i.name===e.name&&(t=i.value)});let i=[t];this.getFillingCode(i).then(()=>{this.fillAllForm(e.name);const t=this.clickTabList.includes(e.name)?"":"init";this.getFilling(t),this.setActiveTreeNode(),this.clickTabList.includes(e.name)||this.clickTabList.push(e.name)})}this.localTabList.includes(e.name)&&(this.clickTabList.includes(e.name)||this.clickTabList.push(e.name))},handleNodeClick(e){e.children||(this.currentTreeNodeId=e.id)},handleSave(){if(this.checkParams()){let e=Object.values(this.allFillingForm);const t=e.map(e=>{let t="",i="";const a=[];return Array.isArray(e.deviceName)&&(this.deviceId=this.productions.map(t=>{e.deviceName.includes(t.deviceName)&&!a.includes(t.id)&&a.push(t.id)})),e.deviceName&&(t=e.deviceName.join(","),i=a.join(",")),{...e,deviceName:t,deviceId:i}});Object(o["postFilling"])({dataConfirmConfigEntityList:t}).then(e=>{200===e.data.code&&(this.$message.success("保存成功"),this.$emit("updateAddShow",!1))})}},handleCanCel(){this.$confirm("确认关闭?").then(e=>{this.$emit("updateAddShow",!1)}).catch(e=>{})},handleFormData(e,t,i){return this.localTabList.includes(e.factorName)||"init"===i?{deviceName:t.deviceName||e.deviceName,unit:t.unit||e.unit,access:t.access||e.access,copywriting:t.copywriting||e.copywriting,dataSource:t.dataSource||e.dataSource,measureDevice:t.measureDevice||e.measureDevice,measureModel:t.measureModel||e.measureModel,measureFrequency:t.measureFrequency||e.measureFrequency,requireTimeMeasure:t.requireTimeMeasure||e.requireTimeMeasure,recordingFrequency:t.recordingFrequency||e.recordingFrequency,missingMethod:t.missingMethod||e.missingMethod,orgGetData:t.orgGetData||e.orgGetData,deviceId:t.deviceId||e.deviceId,factorName:t.factorName||e.factorName,factorCode:t.factorCode||e.factorCode,code:t.code||e.code,pcode:t.pcode||e.pcode,deviceGroupId:t.deviceGroupId||e.deviceGroupId,configGroupId:t.configGroupId||e.configGroupId,configEnglishName:t.configEnglishName||e.configEnglishName,dataConfirmId:t.dataConfirmId||e.dataConfirmId,indicatorType:t.indicatorType||e.indicatorType,configName:t.configName||e.configName,paramName:t.paramName||e.paramName}:{deviceName:e.deviceName||t.deviceName,unit:e.unit||t.unit,access:e.access||t.access,copywriting:e.copywriting||t.copywriting,dataSource:e.dataSource||t.dataSource,measureDevice:e.measureDevice||t.measureDevice,measureModel:e.measureModel||t.measureModel,measureFrequency:e.measureFrequency||t.measureFrequency,requireTimeMeasure:e.requireTimeMeasure||t.requireTimeMeasure,recordingFrequency:e.recordingFrequency||t.recordingFrequency,missingMethod:e.missingMethod||t.missingMethod,orgGetData:e.orgGetData||t.orgGetData,deviceId:e.deviceId||t.deviceId,factorName:e.factorName||t.factorName,factorCode:e.factorCode||t.factorCode,code:e.code||t.code,pcode:e.pcode||t.pcode,deviceGroupId:e.deviceGroupId||t.deviceGroupId,configGroupId:e.configGroupId||t.configGroupId,configEnglishName:e.configEnglishName||t.configEnglishName,dataConfirmId:e.dataConfirmId||t.dataConfirmId,indicatorType:e.indicatorType||t.indicatorType,configName:e.configName||t.configName,paramName:e.paramName||t.paramName}},getFilling(e){let t=[this.configurationForm.deviceGroupId];Object(o["getFilling"])(t).then(t=>{if(200===t.data.code){const i=t.data.data;i.forEach(t=>{if(t.deviceName){const i=t.deviceName.split(",");t.deviceName=i,Object.values(this.allFillingForm).forEach(i=>{i.factorName!==t.factorName||i.paramName!==t.paramName||i.createUser||(i=Object.assign(i,t,this.handleFormData(i,t,e)))})}else t.deviceName="",Object.values(this.allFillingForm).forEach(i=>{i.factorName!==t.factorName||i.paramName!==t.paramName||i.createUser||(i=Object.assign(i,t,this.handleFormData(i,t,e)))})})}})}}},N=v,y=(i("ccfe"),Object(m["a"])(N,p,g,!1,null,"6370c430",null)),b=y.exports,F=i("f0a4"),C=i("0e0b"),w={components:{Configuration:h,Filling:b},computed:{...Object(F["b"])(["permission","menuId"])},data(){return{selectList:[],loading:!1,addShow:!1,fillingShow:!1,fillingView:!1,configurationForm:{},data:[],page:{total:0,currentPage:1,pageSize:10},query:{},option:{searchMenuSpan:6,index:!0,tip:!1,height:"auto",align:"center",addBtn:!1,editBtn:!1,delBtn:!1,selection:!0,border:!0,menuWidth:400,column:[{label:"年度",prop:"year",search:!0,type:"year",width:100,valueFormat:"yyyy"},{label:"行业",prop:"industryName",width:200,search:!0},{label:"机组名称",prop:"deviceGroupName"}]},isVersion:!1,rules:{version:[{required:!0,message:"请选择版本",trigger:"blur"}]},versionForm:{version:""},disVersion:!1,versionList:[],versionId:""}},async mounted(){await this.getPageList(),this.menuId&&"chemical_industry"==this.menuId.code&&(this.$refs.crud.option.column.filter(e=>{"deviceGroupName"===e.prop&&(e.label="产品")}),this.data=this.data.map(e=>(e.industryName="化工行业",e.deviceGroupName="乙烯",e)))},methods:{selectionChange(e){this.selectList=e},exportFiles(){},async getPageList(e){this.page.currentPage,this.page.pageSize,this.query;this.loading=!0;const t=[{id:"1759882014070095873",createUser:"1605399440819564545",createDept:"1605399437405401089",createTime:"2024-02-20 18:05:44",updateUser:"1605399440819564545",updateTime:"2024-02-20 18:05:44",status:1,isDeleted:0,tenantId:"999606",deviceGroupName:"20年机组",deviceGroupId:"1729401020364070913",industryId:"1673153349597196289",industryName:"中国发电设施企业",code:"C,C,O,PE",factorName:"烟煤,一般烟煤,柴油,购入电力",factorCode:"1677968285787684866,1677968285787684866,1677972649558351873,1656185047138385921",year:"2020",version:"v1.5.0",isRelevance:0,pcode:"RLRS,RLRS,RLRS,DL"},{id:"1753299687151984642",createUser:"1605399440819564545",createDept:"1605399437405401089",createTime:"2024-02-02 14:09:55",updateUser:"1605399440819564545",updateTime:"2024-02-02 14:09:55",status:1,isDeleted:0,tenantId:"999606",deviceGroupName:"2#机组",deviceGroupId:"1753297026042257410",industryId:"1673153349597196289",industryName:"中国发电设施企业",code:"C,O,C,C,PE",factorName:"烟煤,柴油,焦炭,无烟煤,购入电力",factorCode:"1677968285787684866,1677972649558351873,1677972083323117569,1677968100621746178,1656185047138385921",year:"2024",version:"v1.5.0",isRelevance:0,pcode:"RLRS,RLRS,RLRS,RLRS,DL"},{id:"1752516121564504065",createUser:"1605399440819564545",createDept:"1605399437405401089",createTime:"2024-01-31 10:16:18",updateUser:"1605399440819564545",updateTime:"2024-01-31 10:16:18",status:1,isDeleted:0,tenantId:"999606",deviceGroupName:"1号机组",deviceGroupId:"1752512621006774274",industryId:"1673153349597196289",industryName:"中国发电设施企业",code:"C,C,C,C",factorName:"无烟煤,洗精煤,焦炭,其他洗煤",factorCode:"1677968100621746178,1677968642941059073,1677972083323117569,1677971273944072193",year:"2021",version:"v1.5.0",isRelevance:0,pcode:"RLRS,RLRS,RLRS,RLRS"},{id:"1729465898265104385",createUser:"1605399440819564545",createDept:"1605399437405401089",createTime:"2023-11-28 19:42:57",updateUser:"1605399440819564545",updateTime:"2023-11-28 19:42:57",status:1,isDeleted:0,tenantId:"999606",deviceGroupName:"1机组",deviceGroupId:"1727265236408299522",industryId:"1673153349597196289",industryName:"中国发电设施企业",code:"C,C,PE",factorName:"褐煤,烟煤,购入电力",factorCode:"1677968474233569281,1677968285787684866,1656185047138385921",year:"2022",version:"v1.5.0",isRelevance:0,pcode:"RLRS,RLRS,DL"},{id:"1729431035717767170",createUser:"1605399440819564545",createDept:"1605399437405401089",createTime:"2023-11-28 17:24:25",updateUser:"1605399440819564545",updateTime:"2023-11-28 17:24:25",status:1,isDeleted:0,tenantId:"999606",deviceGroupName:"2#机组",deviceGroupId:"1694645662248861697",industryId:"1673153349597196289",industryName:"中国发电设施企业",code:"C,C,PE",factorName:"无烟煤,烟煤,购入电力",factorCode:"1677968100621746178,1677968285787684866,1656185047138385921",year:"2023",version:"v1.5.0",isRelevance:0,pcode:"RLRS,RLRS,DL"}];this.page.total=t.length,this.data=t,this.loading=!1},getSystemDict(){Object(o["getDict"])("version").then(e=>{this.versionList=e.data.data[0].children||[]})},handleVersion(e){console.log(e),this.isVersion=!0,this.getSystemDict(),this.versionForm.version=e.version,this.versionId=e.id,this.versionForm=Object(C["b"])(e)},handleSaveVersion(){this.$refs.versionForm.validate(e=>{if(e){let e={version:this.versionForm.version,id:this.versionId};this.versionForm.version=this.version,Object(o["getDataVersion"])(e).then(e=>{200===e.data.code&&(this.$message.success("保存成功"),this.version="",this.getPageList(),this.isVersion=!1)})}})},handleCloseVersion(e){this.$confirm("确认关闭?").then(e=>{this.isVersion=!1}).catch(e=>{})},handleAdd(){this.addShow=!0},searchChange(e,t){this.page.currentPage=1,this.query=e,this.getPageList(),t()},searchReset(){this.query={},this.getPageList()},currentChange(e){this.page.currentPage=e,this.getPageList()},sizeChange(e){this.page.pageSize=e,this.getPageList()},refreshChange(){this.page={pageSize:10,currentPage:1,total:0},this.getPageList()},updateAddShow(e){this.addShow=e,this.fillingShow=e},handleClose(){this.$refs.configuration.handleCanCel()},handleCloseFilling(){this.$refs.filling.handleCanCel()},handleView(e){this.fillingShow=!0,this.fillingView=!0,this.configurationForm=Object(C["b"])(e)},handleFilling(e){this.fillingShow=!0,this.fillingView=!1,this.configurationForm=Object(C["b"])(e)},handleDel(e){this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{Object(o["removeDataConfirm"])(e.id).then(e=>{200===e.data.code&&(this.$message.success("删除成功"),this.getPageList())})}).catch(()=>{})},handleCopy(e){Object(o["copyDataConfirm"])({id:e.id}).then(e=>{200===e.data.code&&(this.$message.success("复制成功"),this.getPageList())})}}},L=w,k=Object(m["a"])(L,a,r,!1,null,"2dfadb34",null);t["default"]=k.exports},ae9f:function(e,t,i){"use strict";i("b64b8")},b64b8:function(e,t,i){},ccfe:function(e,t,i){"use strict";i("e1e2")},e1e2:function(e,t,i){}}]);