diff --git a/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue b/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue index 059d614b..4e832fcb 100644 --- a/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue +++ b/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue @@ -8,6 +8,7 @@ :props="{ checkStrictly: true, value: 'id', label: 'name' }" popper-class="cascaderParent" size="small" + style="width: 250px;" clearable> @@ -157,7 +158,31 @@ export default { this.$emit('submit', this.queryParams) }, exportData() { - this.$emit('exportD') + let name + if (this.queryParams.objId) { + name = this.getObjName(this.objList, this.queryParams.objId) + } else { + this.$modal.msgWarning("对象不能为空") + return false + } + this.$emit('exportD', {name: name}) + }, + // 递归取对象name + getObjName(list, id) { + let _this = this + for (let i = 0; i < list.length; i++) { + let a = list[i] + if (a.id === id) { + return a.name + } else { + if (a.children && a.children.length > 0) { + let res = _this.getObjName(a.children, id) + if (res) { + return res + } + } + } + } }, transformTime(timeStamp) {// 本月最后一天 let year = moment(timeStamp).format('YYYY') diff --git a/src/views/energy/analysis/qoqAnalysis/index.vue b/src/views/energy/analysis/qoqAnalysis/index.vue index 0a76dd41..d8e9766e 100644 --- a/src/views/energy/analysis/qoqAnalysis/index.vue +++ b/src/views/energy/analysis/qoqAnalysis/index.vue @@ -83,9 +83,10 @@ export default { } this.chartData = this.list }, - exportData() { + exportData(val) { if (this.list.length > 0) { var wb = XLSX.utils.table_to_book(document.querySelector(".qoq-out-table")) + let fileName = val.name + "环比分析.xlsx" var wbout = XLSX.write(wb, { bookType: "xlsx", bookSST: true, @@ -94,7 +95,7 @@ export default { try { FileSaver.saveAs( new Blob([wbout], { type: "application/octet-stream" }), - "环比分析.xlsx" + fileName ) } catch (e) { if (typeof console !== "undefined") console.log(e, wbout); diff --git a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue index 3915bc3f..cd63836d 100644 --- a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue +++ b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue @@ -99,7 +99,7 @@ export default { if (res.code === 0) { this.form = res.data this.form.plcParamId = res.data.plcParamId || '' - this.form.limitType = this.form.limitType + '' + this.form.limitType = this.form.limitType ? this.form.limitType + '' : '' this.objIds = this.changeDetSelect(this.form.objectId, this.objList) if (this.form.type === 2) { this.getDetailList() diff --git a/src/views/energy/monitoring/energyOverlimitLog/index.vue b/src/views/energy/monitoring/energyOverlimitLog/index.vue index 9ed41515..d16aff6b 100644 --- a/src/views/energy/monitoring/energyOverlimitLog/index.vue +++ b/src/views/energy/monitoring/energyOverlimitLog/index.vue @@ -46,7 +46,7 @@ const tableProps = [ label: '监控模式' }, { - prop: 'plcParamId', + prop: 'paramName', label: '监控参数' }, {