|
@@ -441,10 +441,11 @@
|
|
|
:visible.sync="dialogReportEventConfigVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
:append-to-body="true">
|
|
|
- <el-form :model="reportEventConfigForm" ref="reportEventConfigForm" :rules="reportEventConfigFormRules" label-position="top">
|
|
|
+ <el-form :model="reportEventConfigForm" ref="reportEventConfigForm" :rules="reportEventConfigFormRules" label-position="top"
|
|
|
+ style="height: 50vh; overflow: auto;">
|
|
|
<el-form-item label="条件数据项:" prop="itemName">
|
|
|
<el-radio-group v-model="reportEventConfigForm.itemName">
|
|
|
- <el-radio v-for="item in groupBasicForm.itemList" :label="item.itemName" style="margin: 5px 0;">
|
|
|
+ <el-radio v-for="item in groupBasicForm.itemList" :label="item.itemName" style="margin: 5px 0; width: 100%;">
|
|
|
{{ item.itemName }}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
@@ -702,7 +703,7 @@ export default {
|
|
|
} else if (this.groupRateForm.readMode == 2) {
|
|
|
tips = '条件值'
|
|
|
} else {
|
|
|
- tips = '模式值'
|
|
|
+ tips = '周期值'
|
|
|
}
|
|
|
if (value == null) {
|
|
|
callback(new Error(tips + '不能为空'))
|
|
@@ -944,6 +945,7 @@ export default {
|
|
|
daySetting: [],
|
|
|
valuePeriod: ['00:00:00', '23:59:59']
|
|
|
}
|
|
|
+ this.updateGroupData = null
|
|
|
this.chooseItemDataView = false
|
|
|
this.getDataSourceList()
|
|
|
this.groupDialogVisible = true
|
|
@@ -979,6 +981,8 @@ export default {
|
|
|
for (let i = 0; i < _itemList.length; i ++) {
|
|
|
if (_itemList[i].itemName == this.reportEventConfigForm.itemName) {
|
|
|
_itemList[i].tableReportId = this.reportEventConfigForm.tableReportId
|
|
|
+ } else {
|
|
|
+ _itemList[i].tableReportId = null
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1090,35 +1094,7 @@ export default {
|
|
|
this.chooseItemDataView = true
|
|
|
this.groupDialogTitle = '修改数据组'
|
|
|
this.groupRateForm.readMode = item.readMode + ''
|
|
|
- this.groupRateForm.modeValue = item.modeValue
|
|
|
- if (item.readMode == 0) { // 周期
|
|
|
- if (parseInt(item.modeValue) % 3600 == 0) { // 时
|
|
|
- this.groupRateForm.modeValueH = item.modeValue / 3600
|
|
|
- this.groupRateForm.modeValueM = 0
|
|
|
- this.groupRateForm.modeValueS = 0
|
|
|
- } else {
|
|
|
- if ((parseInt(item.modeValue) % 3600) % 60 == 0) { // 分
|
|
|
- this.groupRateForm.modeValueH = Math.floor(item.modeValue / 3600)
|
|
|
- this.groupRateForm.modeValueM = (parseInt(item.modeValue) % 3600) / 60
|
|
|
- this.groupRateForm.modeValueS = 0
|
|
|
- } else { // 秒
|
|
|
- this.groupRateForm.modeValueH = Math.floor(item.modeValue / 3600)
|
|
|
- this.groupRateForm.modeValueM = Math.floor((parseInt(item.modeValue) % 3600) / 60)
|
|
|
- this.groupRateForm.modeValueS = (parseInt(item.modeValue) % 3600) % 60
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (item.readMode == 1) { // 值改变读取
|
|
|
- this.groupRateForm.readModeType = item.readModeType
|
|
|
- } else if (item.readMode == 2) { // 条件读取
|
|
|
- this.groupRateForm.eventMode = item.eventMode
|
|
|
- let _itemList = item.itemList
|
|
|
- for (let i = 0; i < _itemList.length; i ++) {
|
|
|
- if (_itemList[i].tableReportId) {
|
|
|
- this.reportEventConfigForm.tableReportId = _itemList[i].tableReportId
|
|
|
- this.reportEventConfigForm.itemName = _itemList[i].itemName
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this.withReadMode(item, item.readMode)
|
|
|
this.groupRateForm.valuePeriod = [item.startReadTime, item.endReadTime]
|
|
|
this.groupRateForm.daySetting = item.readWeek ? item.readWeek.split(',') : []
|
|
|
}).catch((e) => {
|
|
@@ -1126,6 +1102,38 @@ export default {
|
|
|
showAlertWin(this, e)
|
|
|
})
|
|
|
},
|
|
|
+ /** 处理模式不同值显示不同 */
|
|
|
+ withReadMode(item, readMode) {
|
|
|
+ this.groupRateForm.modeValue = item.modeValue
|
|
|
+ if (readMode == 0) { // 周期
|
|
|
+ if (parseInt(item.modeValue) % 3600 == 0) { // 时
|
|
|
+ this.groupRateForm.modeValueH = item.modeValue / 3600
|
|
|
+ this.groupRateForm.modeValueM = 0
|
|
|
+ this.groupRateForm.modeValueS = 0
|
|
|
+ } else {
|
|
|
+ if ((parseInt(item.modeValue) % 3600) % 60 == 0) { // 分
|
|
|
+ this.groupRateForm.modeValueH = Math.floor(item.modeValue / 3600)
|
|
|
+ this.groupRateForm.modeValueM = (parseInt(item.modeValue) % 3600) / 60
|
|
|
+ this.groupRateForm.modeValueS = 0
|
|
|
+ } else { // 秒
|
|
|
+ this.groupRateForm.modeValueH = Math.floor(item.modeValue / 3600)
|
|
|
+ this.groupRateForm.modeValueM = Math.floor((parseInt(item.modeValue) % 3600) / 60)
|
|
|
+ this.groupRateForm.modeValueS = (parseInt(item.modeValue) % 3600) % 60
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (readMode == 1) { // 值改变读取
|
|
|
+ this.groupRateForm.readModeType = item.readModeType
|
|
|
+ } else if (readMode == 2) { // 条件读取
|
|
|
+ this.groupRateForm.eventMode = item.eventMode
|
|
|
+ let _itemList = item.itemList
|
|
|
+ for (let i = 0; i < _itemList.length; i ++) {
|
|
|
+ if (_itemList[i].tableReportId) {
|
|
|
+ this.reportEventConfigForm.tableReportId = _itemList[i].tableReportId
|
|
|
+ this.reportEventConfigForm.itemName = _itemList[i].itemName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 更新组项信息 */
|
|
|
updateGroupItem() {
|
|
|
let id = this.chooseGroupData.id
|
|
@@ -1348,11 +1356,10 @@ export default {
|
|
|
this.groupRateForm.modeValueH = 0
|
|
|
this.groupRateForm.modeValueM = 0
|
|
|
this.groupRateForm.modeValueS = 0
|
|
|
- this.reportEventConfigForm = {
|
|
|
- itemName: '',
|
|
|
- tableReportId: null,
|
|
|
- tableReportName: null
|
|
|
- },
|
|
|
+ this.resetReportEventConfigForm()
|
|
|
+ if (this.updateGroupData && this.updateGroupData.readMode == val) {
|
|
|
+ this.withReadMode(this.updateGroupData, val)
|
|
|
+ }
|
|
|
|
|
|
this.groupRateForm.readMode = val
|
|
|
this.$refs.groupRateForm.clearValidate()
|
|
@@ -1699,6 +1706,16 @@ export default {
|
|
|
this.itemDataStep = 1
|
|
|
this.filterItemData = ''
|
|
|
this.dataLineListSelections = []
|
|
|
+ let flag = false
|
|
|
+ for (let i = 0; i < this.chooseItemDataList.length; i ++) {
|
|
|
+ if (this.chooseItemDataList[i].itemName == this.reportEventConfigForm.itemName) {
|
|
|
+ flag = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag) {
|
|
|
+ this.resetReportEventConfigForm()
|
|
|
+ }
|
|
|
this.dataItemDialogVisible = false
|
|
|
this.chooseItemDataView = true
|
|
|
},
|
|
@@ -1834,14 +1851,7 @@ export default {
|
|
|
this.bomCheckKey = new Date().getTime()
|
|
|
this.dataLineListSelections = []
|
|
|
this.dialogReportEventConfigVisible = false
|
|
|
- if (this.$refs['reportEventConfigForm']) {
|
|
|
- this.reportEventConfigForm = {
|
|
|
- itemName: '',
|
|
|
- tableReportId: null,
|
|
|
- tableReportName: null
|
|
|
- }
|
|
|
- this.$refs['reportEventConfigForm'].resetFields()
|
|
|
- }
|
|
|
+ this.resetReportEventConfigForm()
|
|
|
})
|
|
|
},
|
|
|
/** 保存数据模型事件 */
|
|
@@ -2022,16 +2032,31 @@ export default {
|
|
|
},
|
|
|
resetReportEventConfigForm() {
|
|
|
if (this.$refs['reportEventConfigForm']) {
|
|
|
- this.reportEventConfigForm = {
|
|
|
- itemName: '',
|
|
|
- tableReportId: null,
|
|
|
- tableReportName: null
|
|
|
- }
|
|
|
this.$refs['reportEventConfigForm'].resetFields()
|
|
|
}
|
|
|
+ this.reportEventConfigForm = {
|
|
|
+ itemName: '',
|
|
|
+ tableReportId: null,
|
|
|
+ tableReportName: null
|
|
|
+ }
|
|
|
},
|
|
|
/** 弹出层关闭事件 */
|
|
|
dialogReportEventConfigClose() {
|
|
|
+ this.resetReportEventConfigForm()
|
|
|
+ if (this.updateGroupData && this.updateGroupData.readMode == 2) {
|
|
|
+ let _itemList = this.updateGroupData.itemList
|
|
|
+ for (let i = 0; i < _itemList.length; i ++) {
|
|
|
+ if (_itemList[i].tableReportId) {
|
|
|
+ let items = this.groupBasicForm.itemList
|
|
|
+ items.forEach((item) => {
|
|
|
+ if (_itemList[i].itemName == item.itemName) {
|
|
|
+ this.reportEventConfigForm.tableReportId = _itemList[i].tableReportId
|
|
|
+ this.reportEventConfigForm.itemName = _itemList[i].itemName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (typeof(done) === 'function') {
|
|
|
done()
|
|
|
} else {
|