|
@@ -46,11 +46,11 @@
|
|
|
<span>关闭</span>
|
|
|
</div>
|
|
|
<el-divider></el-divider>
|
|
|
- <div class="cy-chart-div" @click="templateEvent()" v-if="templateReportType != 2">
|
|
|
+ <div class="cy-chart-div" @click="templateEvent()" v-if="templateReportType != 2 && templateReportType != 5">
|
|
|
<svg-icon icon-class="report_template" style="width: 35px;"/>
|
|
|
<span>模板库</span>
|
|
|
</div>
|
|
|
- <div class="cy-chart-div" @click="dataEvent(1)" v-if="templateReportType != 2">
|
|
|
+ <div class="cy-chart-div" @click="dataEvent(1)" v-if="templateReportType != 2 && templateReportType != 5">
|
|
|
<svg-icon icon-class="report_basedata" style="width: 35px;"/>
|
|
|
<span>基础数据项</span>
|
|
|
</div>
|
|
@@ -62,15 +62,15 @@
|
|
|
<svg-icon icon-class="report_data" style="width: 35px;"/>
|
|
|
<span>数据项</span>
|
|
|
</div>
|
|
|
- <div class="cy-chart-div" @click="barEvent('bar')" v-if="templateReportType != 2">
|
|
|
+ <div class="cy-chart-div" @click="barEvent('bar')" v-if="templateReportType != 2 && templateReportType != 5">
|
|
|
<svg-icon icon-class="bar_chart"/>
|
|
|
<span>柱状图</span>
|
|
|
</div>
|
|
|
- <div class="cy-chart-div" @click="barEvent('line')" v-if="templateReportType != 2">
|
|
|
+ <div class="cy-chart-div" @click="barEvent('line')" v-if="templateReportType != 2 && templateReportType != 5">
|
|
|
<svg-icon icon-class="line_chart"/>
|
|
|
<span>折线图</span>
|
|
|
</div>
|
|
|
- <div class="cy-chart-div" @click="barEvent('pie')" v-if="templateReportType != 2">
|
|
|
+ <div class="cy-chart-div" @click="barEvent('pie')" v-if="templateReportType != 2 && templateReportType != 5">
|
|
|
<svg-icon icon-class="pie_chart"/>
|
|
|
<span>饼状图</span>
|
|
|
</div>
|
|
@@ -227,6 +227,57 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 数据组选择(设备报表) -->
|
|
|
+ <el-dialog
|
|
|
+ title="选择条件数据项"
|
|
|
+ width="600px"
|
|
|
+ top="10vh"
|
|
|
+ center
|
|
|
+ v-dialog-drag-and-zoom
|
|
|
+ v-if="dialogDeviceDataItemVisible"
|
|
|
+ :before-close="dialogItemClose"
|
|
|
+ :visible.sync="dialogDeviceDataItemVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :append-to-body="true">
|
|
|
+ <div>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span>组名称:{{ itemDataListByGroupName }}(共 {{ itemDeviceDataListByTree.length }} 项)</span>
|
|
|
+ </div>
|
|
|
+ <el-input placeholder="请输入关键字进行过滤" v-model="filterDeviceItemData"></el-input>
|
|
|
+ <div style="height: 50vh; margin-top: 10px; overflow: auto;">
|
|
|
+ <el-tree class="cy-item-tree"
|
|
|
+ ref="deviceItemTree"
|
|
|
+ :data="itemDeviceDataListByTree"
|
|
|
+ :indent="10"
|
|
|
+ node-key="id"
|
|
|
+ show-checkbox
|
|
|
+ :check-on-click-node="true"
|
|
|
+ :filter-node-method="filterItemDataNode"
|
|
|
+ :highlight-current="true"
|
|
|
+ :default-expand-all="true">
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <svg-icon v-if="!data.children || data.children.length == 0" icon-class="file"/>
|
|
|
+ <svg-icon v-else-if="node.expanded" icon-class="folder-open"/>
|
|
|
+ <svg-icon v-else icon-class="folder"/>
|
|
|
+ <span :title='data.itemName || "-"' style="margin-left: 2px;">
|
|
|
+ {{
|
|
|
+ data.describe
|
|
|
+ ? ((data.itemName ? data.itemName : '') + '(' + data.describe + ')')
|
|
|
+ : data.itemName ? data.itemName : ''
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%;text-align: center;">
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="chooseDeviceItemTreeEvent"
|
|
|
+ style="margin-top: 20px;">确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 选择基础数据项 -->
|
|
|
<el-dialog
|
|
|
title="选择基础数据项"
|
|
@@ -355,11 +406,12 @@
|
|
|
:visible.sync="dialogGroupItemVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
:append-to-body="true">
|
|
|
- <div>
|
|
|
+ <div style="height: 60vh; overflow: auto;">
|
|
|
<div>
|
|
|
<label>数据组:</label>
|
|
|
<el-select filterable
|
|
|
v-model="chooseDataGroup"
|
|
|
+ @change="getGroupById"
|
|
|
placeholder="请选择数据组"
|
|
|
style="width: 330px;">
|
|
|
<el-option
|
|
@@ -388,11 +440,20 @@
|
|
|
<el-button size="mini" type="primary" @click="multipleDataItemEvent"
|
|
|
style="width: 100px;margin-top: 4px;">设置数据条件
|
|
|
</el-button>
|
|
|
- <el-button v-if="templateReportType==2" size="mini" type="primary" @click="setDriverCondition"
|
|
|
- style="width: 100px;margin-top: 4px;">配置驱动条件
|
|
|
- </el-button>
|
|
|
+<!-- <el-button v-if="templateReportType==2" size="mini" type="primary" @click="setDriverCondition"-->
|
|
|
+<!-- style="width: 100px;margin-top: 4px;">配置驱动条件-->
|
|
|
+<!-- </el-button>-->
|
|
|
</template>
|
|
|
</div>
|
|
|
+ <div v-if="chooseDataGroup && !hasBelongDataFlag && templateReportType == 2"
|
|
|
+ style="margin-top: 10px; display: flex;">
|
|
|
+ <label>条件:</label>
|
|
|
+ <div style="color: #a5a5a5;">
|
|
|
+ <span>{{ this.conditionObj.itemName }}</span>
|
|
|
+ <span>{{ this.conditionObj.eventModeName }}</span>
|
|
|
+ <span>{{ this.conditionObj.modeValue }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div style="height: 30vh; margin-top: 10px; overflow: auto;">
|
|
|
<template v-if="!hasBelongDataFlag">
|
|
|
<el-table :data="chooseGroupItemList"
|
|
@@ -485,7 +546,57 @@
|
|
|
</el-table>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <div v-if="chooseGroupItemList.length > 0 && templateReportType != 2">
|
|
|
+ <!-- 设备报表 -->
|
|
|
+ <div v-if="templateReportType == 5">
|
|
|
+ <el-divider content-position="left">设备报表条件配置</el-divider>
|
|
|
+ <div class="cy-line custom-tree" style="display: flex; flex-direction: column;">
|
|
|
+ <div class="device-condition">
|
|
|
+ <label>条件类型:</label>
|
|
|
+ <el-radio v-model="deviceReportCondition.variableType" label="1">单变量</el-radio>
|
|
|
+ <el-radio v-model="deviceReportCondition.variableType" label="2">多变量</el-radio>
|
|
|
+ </div>
|
|
|
+ <div class="device-condition">
|
|
|
+ <label>开始变量:</label>
|
|
|
+ <template v-if="deviceReportCondition.variableType == 2">
|
|
|
+ <el-button size="mini" @click="addDataItemByDevice(1)">
|
|
|
+ 选择开始变量
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-button size="mini" @click="addDataItemByDevice(0)">
|
|
|
+ 选择变量
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <div v-if="deviceReportCondition.startItemId" style="margin-left: 20px;">
|
|
|
+ <span>{{ deviceReportCondition.startItemName }}</span>
|
|
|
+ <span><b>等于</b></span>
|
|
|
+ <el-input-number v-model="deviceReportCondition.startValue" placeholder="请输入值"
|
|
|
+ :min="0" :max="99999" :controls="false" :precision="0"
|
|
|
+ style="width: 120px;margin-right: 50px;"></el-input-number>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="device-condition">
|
|
|
+ <label>结束变量:</label>
|
|
|
+ <el-button v-if="deviceReportCondition.variableType == 2"
|
|
|
+ size="mini" @click="addDataItemByDevice(2)">
|
|
|
+ 选择结束变量
|
|
|
+ </el-button>
|
|
|
+ <div v-if="deviceReportCondition.endItemId" style="margin-left: 20px;">
|
|
|
+ <span>{{ deviceReportCondition.endItemName }}</span>
|
|
|
+ <span><b>等于</b></span>
|
|
|
+ <el-input-number v-model="deviceReportCondition.endValue" placeholder="请输入值"
|
|
|
+ :min="0" :max="99999" :controls="false" :precision="0"
|
|
|
+ style="width: 120px;margin-right: 50px;"></el-input-number>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="device-condition">
|
|
|
+ <label>是否自动计算运行时间:</label>
|
|
|
+ <el-radio v-model="deviceReportCondition.isGenCountTime" label="0">不计算</el-radio>
|
|
|
+ <el-radio v-model="deviceReportCondition.isGenCountTime" label="1">计算</el-radio>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="chooseGroupItemList.length > 0 && templateReportType != 2 && templateReportType != 5">
|
|
|
<template>
|
|
|
<el-divider content-position="left">{{ hasBelongDataFlag ? '显示方式' : '数据项排列方式' }}</el-divider>
|
|
|
<div class="cy-line custom-tree">
|
|
@@ -638,7 +749,7 @@
|
|
|
<!-- 模板报表类型选择 -->
|
|
|
<el-dialog
|
|
|
title="选择模板报表类型"
|
|
|
- width="500px"
|
|
|
+ width="600px"
|
|
|
center
|
|
|
v-dialog-drag
|
|
|
v-if="dialogReportTypeVisible"
|
|
@@ -651,8 +762,9 @@
|
|
|
<el-radio v-model="templateReportType" label="0">手动报表</el-radio>
|
|
|
<el-radio v-model="templateReportType" label="1">自动报表</el-radio>
|
|
|
<el-radio v-model="templateReportType" label="2">事件驱动报表</el-radio>
|
|
|
+ <el-radio v-model="templateReportType" label="5">设备报表</el-radio>
|
|
|
</div>
|
|
|
- <div v-if="templateReportType == 2" style="margin-top: 20px;">
|
|
|
+ <div v-if="templateReportType == 2 || templateReportType == 5" style="margin-top: 20px;">
|
|
|
<label>记录数量:</label>
|
|
|
<el-input-number label="请输入事件驱动显示记录数量"
|
|
|
v-model="templateEventReportNum"
|
|
@@ -677,7 +789,7 @@ import RulerView from '@/components/RulerView'
|
|
|
import LuckyExcel from 'luckyexcel'
|
|
|
import {
|
|
|
getAllDataModel,
|
|
|
- getAllItemGroup, getSysTableTemplate, getSysTableTemplateById,
|
|
|
+ getAllItemGroup, getItemGroupById, getSysTableTemplate, getSysTableTemplateById,
|
|
|
getTableItemGroupById,
|
|
|
getTableTemplateById,
|
|
|
saveReportTemplate,
|
|
@@ -708,6 +820,7 @@ export default {
|
|
|
showReportData: true,
|
|
|
dialogBarChartVisible: false,
|
|
|
dialogDataItemVisible: false,
|
|
|
+ dialogDeviceDataItemVisible: false,
|
|
|
dialogDataModelVisible: false,
|
|
|
dialogCommReportVisible: false,
|
|
|
dialogGroupItemVisible: false,
|
|
@@ -763,6 +876,24 @@ export default {
|
|
|
{'label': '小于', 'value': 1},
|
|
|
{'label': '等于', 'value': 2}
|
|
|
],
|
|
|
+ // 条件值
|
|
|
+ conditionObj: {
|
|
|
+ itemName: '',
|
|
|
+ eventModeName: '',
|
|
|
+ modeValue: ''
|
|
|
+ },
|
|
|
+ // 设备报表条件
|
|
|
+ deviceReportCondition: {
|
|
|
+ type: null,
|
|
|
+ variableType: '1',
|
|
|
+ isGenCountTime: '0',
|
|
|
+ startItemId: null,
|
|
|
+ startItemName: null,
|
|
|
+ startValue: 0,
|
|
|
+ endItemId: null,
|
|
|
+ endItemName: null,
|
|
|
+ endValue: 0
|
|
|
+ },
|
|
|
// 数据项取值条件
|
|
|
itemConditionForm: {
|
|
|
valueType: 0, // 0原始值1计算值
|
|
@@ -799,6 +930,7 @@ export default {
|
|
|
{'label': '附属项', 'value': 0},
|
|
|
{'label': '数据项', 'value': 1}
|
|
|
],
|
|
|
+ itemDeviceDataListByTree: [],
|
|
|
itemDataListByTree: [],
|
|
|
itemDataListByGroupName: '',
|
|
|
itemDataListByCalc: [],
|
|
@@ -813,6 +945,7 @@ export default {
|
|
|
chooseDataGroupType: null,
|
|
|
chooseItemData: [],
|
|
|
filterItemData: '',
|
|
|
+ filterDeviceItemData: '',
|
|
|
searchReportTxt: '',
|
|
|
keyType: 'report_template',
|
|
|
reportTypes: [],
|
|
@@ -895,6 +1028,9 @@ export default {
|
|
|
filterItemData(val) {
|
|
|
this.$refs.itemTree.filter(val)
|
|
|
},
|
|
|
+ filterDeviceItemData(val) {
|
|
|
+ this.$refs.deviceItemTree.filter(val)
|
|
|
+ },
|
|
|
visibleChartMenu(value) {
|
|
|
if (value) {
|
|
|
document.body.addEventListener('click', this.closeMenu)
|
|
@@ -1257,12 +1393,43 @@ export default {
|
|
|
if (this.templateReportType == 2) {
|
|
|
data.eventNum = this.templateEventReportNum;
|
|
|
if (this.eventMode == null || this.modeValue == null) {
|
|
|
- showAlertMsgWin(this, null, '保存失败!驱动条件或驱动值未设置')
|
|
|
- return
|
|
|
+ // showAlertMsgWin(this, null, '保存失败!驱动条件或驱动值未设置')
|
|
|
+ // return
|
|
|
}
|
|
|
data.eventMode = this.eventMode;
|
|
|
data.modeValue = this.modeValue;
|
|
|
}
|
|
|
+ // 设备报表模板
|
|
|
+ if (this.templateReportType == 5) {
|
|
|
+ data.eventNum = this.templateEventReportNum
|
|
|
+ data.isGenCountTime = this.deviceReportCondition.isGenCountTime
|
|
|
+ data.variableType = this.deviceReportCondition.variableType
|
|
|
+ data.startItemId = this.deviceReportCondition.startItemId
|
|
|
+ data.endItemId = this.deviceReportCondition.endItemId
|
|
|
+ data.startValue = this.deviceReportCondition.startValue
|
|
|
+ data.endValue = this.deviceReportCondition.endValue
|
|
|
+ let _temp = null
|
|
|
+ data.tableTemplateItemList.forEach((_t) => {
|
|
|
+ // 单变量
|
|
|
+ if (data.variableType == 1) {
|
|
|
+ if (data.startItemId == _t.itemId) {
|
|
|
+ _t.timeItemType = 0
|
|
|
+ _temp = JSON.parse(JSON.stringify(_t))
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (data.startItemId == _t.itemId) {
|
|
|
+ _t.timeItemType = 0
|
|
|
+ }
|
|
|
+ if (data.endItemId == _t.itemId) {
|
|
|
+ _t.timeItemType = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (_temp) {
|
|
|
+ _temp.timeItemType = 1
|
|
|
+ data.tableTemplateItemList.push(_temp)
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.templateId && type != 'saveAs') {
|
|
|
data.id = this.templateId
|
|
|
data.version = this.templateVersion
|
|
@@ -1522,6 +1689,18 @@ export default {
|
|
|
showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
+ /** 添加数据项(设备报表条件数据项) */
|
|
|
+ addDataItemByDevice(type) {
|
|
|
+ if (!this.deviceReportCondition.variableType) {
|
|
|
+ showAlertMsgWin(this, null, '请选择条件类型!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.deviceReportCondition.type = type
|
|
|
+ this.filterDeviceItemData = ''
|
|
|
+ let _data = this.chooseGroupItemList
|
|
|
+ this.itemDeviceDataListByTree = _data ? _data : []
|
|
|
+ this.dialogDeviceDataItemVisible = true
|
|
|
+ },
|
|
|
/** 选择的数据项:第一步 */
|
|
|
chooseItemTreeEvent() {
|
|
|
let checkedNodes = this.$refs.itemTree.getCheckedNodes(false, true)
|
|
@@ -1558,6 +1737,33 @@ export default {
|
|
|
this.filterItemData = ''
|
|
|
// this.getAllDataModel(chooseList)
|
|
|
},
|
|
|
+ /** 选择的设备报表数据 */
|
|
|
+ chooseDeviceItemTreeEvent() {
|
|
|
+ let checkedNodes = this.$refs.deviceItemTree.getCheckedNodes(false, true)
|
|
|
+ if (checkedNodes.length != 1) {
|
|
|
+ showAlertMsgWin(this, null, '请选择一项数据项!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 单变量
|
|
|
+ if (this.deviceReportCondition.type == 0) {
|
|
|
+ this.deviceReportCondition.startItemId = checkedNodes[0].id
|
|
|
+ this.deviceReportCondition.startItemName = checkedNodes[0].itemName
|
|
|
+ this.deviceReportCondition.endItemId = checkedNodes[0].id
|
|
|
+ this.deviceReportCondition.endItemName = checkedNodes[0].itemName
|
|
|
+ }
|
|
|
+ // 双变量:开始
|
|
|
+ else if (this.deviceReportCondition.type == 1) {
|
|
|
+ this.deviceReportCondition.startItemId = checkedNodes[0].id
|
|
|
+ this.deviceReportCondition.startItemName = checkedNodes[0].itemName
|
|
|
+ }
|
|
|
+ // 双变量:结束
|
|
|
+ else if (this.deviceReportCondition.type == 2) {
|
|
|
+ this.deviceReportCondition.endItemId = checkedNodes[0].id
|
|
|
+ this.deviceReportCondition.endItemName = checkedNodes[0].itemName
|
|
|
+ }
|
|
|
+ this.deviceReportCondition.type = null
|
|
|
+ this.dialogDeviceDataItemVisible = false
|
|
|
+ },
|
|
|
initGroupItem() {
|
|
|
let group = null
|
|
|
for (let i = 0; i < this.dataGroupList.length; i++) {
|
|
@@ -1773,6 +1979,17 @@ export default {
|
|
|
valLine: 1,
|
|
|
dataId: new Date().getTime()
|
|
|
}
|
|
|
+ this.deviceReportCondition = {
|
|
|
+ type: null,
|
|
|
+ variableType: '1',
|
|
|
+ isGenCountTime: '0',
|
|
|
+ startItemId: null,
|
|
|
+ startItemName: null,
|
|
|
+ startValue: 0,
|
|
|
+ endItemId: null,
|
|
|
+ endItemName: null,
|
|
|
+ endValue: 0
|
|
|
+ }
|
|
|
this.hasBelongDataFlag = false
|
|
|
if (type == 2) this.hasBelongDataFlag = true
|
|
|
this.chooseDataGroup = null
|
|
@@ -1821,38 +2038,66 @@ export default {
|
|
|
showAlertMsgWin(this, null, '请设置数据条件!')
|
|
|
return
|
|
|
}
|
|
|
+ // 设备报表
|
|
|
+ if (this.templateReportType == 5) {
|
|
|
+ if (!this.deviceReportCondition.startItemId || !this.deviceReportCondition.endItemId) {
|
|
|
+ showAlertMsgWin(this, null, '请设置设备报表条件!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.deviceReportCondition.startItemId == this.deviceReportCondition.endItemId
|
|
|
+ && this.deviceReportCondition.startValue == this.deviceReportCondition.endValue) {
|
|
|
+ showAlertMsgWin(this, null, '设备报表开始和结束变量条件不合法!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
let c, r
|
|
|
condCount = 0;
|
|
|
- let driverCount = 0;
|
|
|
+ let rangeWithFlatten = luckysheet.getRangeWithFlatten()
|
|
|
+ c = rangeWithFlatten[0].c
|
|
|
+ r = rangeWithFlatten[0].r
|
|
|
// 事件驱动报表格式设置
|
|
|
if (this.templateReportType == 2) {
|
|
|
this.chooseGroupItemList.forEach((item, i) => {
|
|
|
if (item.valueType == null) {
|
|
|
condCount++
|
|
|
}
|
|
|
- if (item.isDriverItem == 1) {
|
|
|
- driverCount++;
|
|
|
- }
|
|
|
})
|
|
|
if (condCount > 0) {
|
|
|
showAlertMsgWin(this, null, '请设置数据条件!')
|
|
|
return
|
|
|
}
|
|
|
- if (this.eventMode == null || this.modeValue == null) {
|
|
|
- showAlertMsgWin(this, null, '请配置驱动条件!')
|
|
|
- return
|
|
|
- }
|
|
|
- if (driverCount != 1) {
|
|
|
- showAlertMsgWin(this, null, '事件驱动项有且仅有一个!')
|
|
|
- return
|
|
|
+ // 清空之前选择的数据组、数据项信息
|
|
|
+ let tempItem = JSON.parse(JSON.stringify(this.toolItemTable))
|
|
|
+ tempItem.forEach((t, i) => {
|
|
|
+ if (i == 0) {
|
|
|
+ luckysheet.setCellValue(t.xaxis - 1, t.yaxis - 1, '')
|
|
|
+ }
|
|
|
+ luckysheet.setCellValue(t.xaxis - 1, t.yaxis, '')
|
|
|
+ luckysheet.setCellValue(t.xaxis, t.yaxis, '')
|
|
|
+ })
|
|
|
+ this.toolItemTable = []
|
|
|
+ luckysheet.setCellValue(r, c, '数据时间')
|
|
|
+ r++
|
|
|
+ c++
|
|
|
+ }
|
|
|
+ // 设备报表
|
|
|
+ else if (this.templateReportType == 5) {
|
|
|
+ console.log(this.deviceReportCondition)
|
|
|
+ luckysheet.setCellValue(r, c, '序号')
|
|
|
+ luckysheet.setCellValue(r + 1, c, '${index}')
|
|
|
+ c++
|
|
|
+ luckysheet.setCellValue(r, c, '开始时间')
|
|
|
+ luckysheet.setCellValue(r + 1, c, '${startTime}')
|
|
|
+ c++
|
|
|
+ luckysheet.setCellValue(r, c, '停止时间')
|
|
|
+ luckysheet.setCellValue(r + 1, c, '${stopTime}')
|
|
|
+ if (this.deviceReportCondition.isGenCountTime == 1) {
|
|
|
+ c++
|
|
|
+ luckysheet.setCellValue(r, c, '运行时间(分钟)')
|
|
|
+ luckysheet.setCellValue(r + 1, c, '${runMinute}')
|
|
|
}
|
|
|
- c = 1
|
|
|
- r = 1
|
|
|
- luckysheet.setCellValue(0, 0, '时间')
|
|
|
- } else {
|
|
|
- let rangeWithFlatten = luckysheet.getRangeWithFlatten()
|
|
|
- c = rangeWithFlatten[0].c
|
|
|
- r = rangeWithFlatten[0].r
|
|
|
+ r++
|
|
|
+ c++
|
|
|
}
|
|
|
// 值显示数量
|
|
|
for (let n = 0; n < this.itemShowParams.valLine; n++) {
|
|
@@ -1878,9 +2123,9 @@ export default {
|
|
|
}
|
|
|
item.xaxis = p_r
|
|
|
item.yaxis = p_c
|
|
|
- // 事件驱动报表格式设置
|
|
|
- if (this.templateReportType == 2) {
|
|
|
- luckysheet.setCellValue(0, p_c, describe ? describe : name)
|
|
|
+ // 事件驱动报表和设备报表格式设置
|
|
|
+ if (this.templateReportType == 2 || this.templateReportType == 5) {
|
|
|
+ luckysheet.setCellValue((p_r > 1 ? (p_r - 1) : 0), p_c, describe ? describe : name)
|
|
|
}
|
|
|
luckysheet.setCellValue(p_r, p_c, v)
|
|
|
this.pushToItemTable(item)
|
|
@@ -2263,6 +2508,42 @@ export default {
|
|
|
this.itemShowParams.valType = '1'
|
|
|
}
|
|
|
},
|
|
|
+ /** 根据ID查询组信息 */
|
|
|
+ getGroupById(val) {
|
|
|
+ if (this.templateReportType == 2 || this.templateReportType == 5) {
|
|
|
+ this.chooseGroupItemList = []
|
|
|
+ }
|
|
|
+ if (this.templateReportType != 2) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const loading = showLoading(this, '加载中,请稍候···')
|
|
|
+ getItemGroupById(val, null).then(res => {
|
|
|
+ loading.close()
|
|
|
+ let data = res.data
|
|
|
+ let itemList = data.itemList
|
|
|
+ let itemName = ''
|
|
|
+ itemList.forEach((item) => {
|
|
|
+ if (item.isDriverItem == 1) {
|
|
|
+ itemName = item.itemName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let list = [
|
|
|
+ {'label': '大于', 'value': 0},
|
|
|
+ {'label': '小于', 'value': 1},
|
|
|
+ {'label': '等于', 'value': 2},
|
|
|
+ {'label': '动态大于', 'value': 3},
|
|
|
+ {'label': '动态小于', 'value': 4}
|
|
|
+ ]
|
|
|
+ this.conditionObj = {
|
|
|
+ itemName: itemName,
|
|
|
+ eventModeName: this.getValByProp(list, data.eventMode),
|
|
|
+ modeValue: data.modeValue
|
|
|
+ }
|
|
|
+ }).catch((e) => {
|
|
|
+ loading.close()
|
|
|
+ showAlertWin(this, null, e)
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 打印操作 */
|
|
|
printExcel() {
|
|
|
const loading = showLoading(this, '请稍候···')
|
|
@@ -2365,6 +2646,7 @@ export default {
|
|
|
this.chooseItemData = []
|
|
|
this.chooseGroupItemList = []
|
|
|
this.filterItemData = ''
|
|
|
+ this.filterDeviceItemData = ''
|
|
|
this.clearRt()
|
|
|
|
|
|
this.commTemplate = null
|
|
@@ -2384,10 +2666,12 @@ export default {
|
|
|
dialogItemClose(done) {
|
|
|
this.itemDataListByTree = []
|
|
|
this.filterItemData = ''
|
|
|
+ this.filterDeviceItemData = ''
|
|
|
if (typeof (done) === 'function') {
|
|
|
done()
|
|
|
} else {
|
|
|
this.dialogDataItemVisible = false
|
|
|
+ this.dialogDeviceDataItemVisible = false
|
|
|
}
|
|
|
},
|
|
|
/** 弹出层关闭事件 */
|
|
@@ -2530,4 +2814,8 @@ export default {
|
|
|
.el-transfer-panel {
|
|
|
width: 300px !important;
|
|
|
}
|
|
|
+
|
|
|
+.device-condition {
|
|
|
+ margin: 5px;
|
|
|
+}
|
|
|
</style>
|