|
@@ -116,7 +116,7 @@
|
|
|
<el-tab-pane name="base-setting">
|
|
|
<div slot="label">基础设置</div>
|
|
|
<div class="cy-form">
|
|
|
- <el-form ref="groupBasicForm" :label-position="labelPosition" :model='groupBasicForm' :rules="groupRules" label-width='100px'>
|
|
|
+ <el-form ref="groupBasicForm" :label-position="labelPosition" :model='groupBasicForm' :rules="groupRules" label-width='80px'>
|
|
|
<el-form-item label='组名称' prop="groupName">
|
|
|
<el-input v-model='groupBasicForm.groupName'
|
|
|
type="text"
|
|
@@ -157,7 +157,7 @@
|
|
|
<el-tab-pane name="rate-setting">
|
|
|
<div slot="label">策略设置</div>
|
|
|
<div class="cy-form">
|
|
|
- <el-form ref="groupRateForm" :label-position="labelPosition" :model='groupRateForm' :rules="groupRateRules" label-width='100px'>
|
|
|
+ <el-form ref="groupRateForm" :model='groupRateForm' :rules="groupRateRules" label-width='80px'>
|
|
|
<el-form-item label='记录模式' prop="readMode">
|
|
|
<el-select v-model="groupRateForm.readMode" placeholder="请选择记录模式" style="width: 100%;" @change="readModeChange">
|
|
|
<el-option
|
|
@@ -168,21 +168,49 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="modeValueTips" prop="modeValue" v-if="groupRateForm.readMode != '1'" class="cy-mv">
|
|
|
- <el-input v-model="groupRateForm.modeValue" :placeholder="'请输入' + modeValueTips" maxlength="8">
|
|
|
- <template slot="append" v-if="groupRateForm.readMode == '0'">
|
|
|
- <el-select v-model="groupRateForm.modeValueUnit" @change="readModeValueUnitChange" placeholder="">
|
|
|
- <el-option
|
|
|
- v-for="dict in modeValueUnitList"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.key"
|
|
|
- :value="dict.value"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
+ <!-- 周期读取 -->
|
|
|
+ <el-form-item v-if="groupRateForm.readMode == 0" label='' prop="modeValue">
|
|
|
+ <el-input-number v-model="groupRateForm.modeValueH" @change="withModeValueTime(1)" :min="0" :max="9999" :controls="false" style="width: 100px;"></el-input-number>
|
|
|
+ <span style="margin: 0 5px;">时</span>
|
|
|
+ <el-input-number v-model="groupRateForm.modeValueM" @change="withModeValueTime(2)" :min="0" :max="59" :controls="false" style="width: 100px;"></el-input-number>
|
|
|
+ <span style="margin: 0 5px;">分</span>
|
|
|
+ <el-input-number v-model="groupRateForm.modeValueS" @change="withModeValueTime(3)" :min="0" :max="59" :controls="false" style="width: 100px;"></el-input-number>
|
|
|
+ <span style="margin: 0 5px;">秒</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label='日期设置' prop="daySetting">
|
|
|
+ <!-- 值改变读取 -->
|
|
|
+ <el-form-item v-if="groupRateForm.readMode == 1" label='' prop="modeValue">
|
|
|
+ <el-input v-model="groupRateForm.modeValue" placeholder="请输入偏差值/偏差率" style="width: 200px;margin-right: 50px;"></el-input>
|
|
|
+ <el-radio-group v-model="groupRateForm.readModeType">
|
|
|
+ <el-radio :label="0">偏差绝对值</el-radio>
|
|
|
+ <el-radio :label="1">偏差率(%)</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 条件读取 -->
|
|
|
+ <el-form-item v-if="groupRateForm.readMode == 2" label='' prop="modeValue">
|
|
|
+ <el-input v-model="groupRateForm.modeValue" placeholder="请输入条件值" style="width: 120px;margin-right: 20px;"></el-input>
|
|
|
+ <el-radio-group v-model="groupRateForm.eventMode">
|
|
|
+ <el-radio :label="0">大于</el-radio>
|
|
|
+ <el-radio :label="1">小于</el-radio>
|
|
|
+ <el-radio :label="2">等于</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ <el-button size="mini" type="info" @click="addEventDataItem" style="float: right;width: 95px;margin-top: 4px;">选择数据项</el-button>
|
|
|
+ <span style="float: right;color: #8a8888;font-size: 12px;line-height: 12px;">{{reportEventConfigForm.itemName}}</span>
|
|
|
+ </el-form-item>
|
|
|
+<!-- <el-form-item :label="modeValueTips" prop="modeValue" v-if="groupRateForm.readMode != '1'" class="cy-mv">-->
|
|
|
+<!-- <el-input v-model="groupRateForm.modeValue" :placeholder="'请输入' + modeValueTips" maxlength="8">-->
|
|
|
+<!-- <template slot="append" v-if="groupRateForm.readMode == '0'">-->
|
|
|
+<!-- <el-select v-model="groupRateForm.modeValueUnit" @change="readModeValueUnitChange" placeholder="">-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="dict in modeValueUnitList"-->
|
|
|
+<!-- :key="dict.value"-->
|
|
|
+<!-- :label="dict.key"-->
|
|
|
+<!-- :value="dict.value"-->
|
|
|
+<!-- ></el-option>-->
|
|
|
+<!-- </el-select>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </el-input>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+ <el-form-item label='日期设置' prop="daySetting" style="margin-top: 20px;">
|
|
|
<el-checkbox-group v-model="groupRateForm.daySetting">
|
|
|
<el-checkbox name="daySetting" label="MON">周一</el-checkbox>
|
|
|
<el-checkbox name="daySetting" label="TUE">周二</el-checkbox>
|
|
@@ -417,7 +445,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog
|
|
|
- title="事件驱动报表配置"
|
|
|
+ title="条件读取配置"
|
|
|
width="500px"
|
|
|
top="10vh"
|
|
|
center
|
|
@@ -427,18 +455,14 @@
|
|
|
:visible.sync="dialogReportEventConfigVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
:append-to-body="true">
|
|
|
- <el-form :model="reportEventConfigForm" ref="reportEventConfigForm" :rules="reportEventConfigFormRules" label-width="150px">
|
|
|
- <el-form-item label="事件驱动产生条件:" prop="eventMode">
|
|
|
- <el-radio-group v-model="reportEventConfigForm.eventMode">
|
|
|
- <el-radio label="0">大于</el-radio>
|
|
|
- <el-radio label="1">小于</el-radio>
|
|
|
- <el-radio label="2">布尔类型</el-radio>
|
|
|
+ <el-form :model="reportEventConfigForm" ref="reportEventConfigForm" :rules="reportEventConfigFormRules" label-position="top">
|
|
|
+ <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;">
|
|
|
+ {{ item.itemName }}
|
|
|
+ </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="阈值:" prop="eventValue">
|
|
|
- <el-input v-model="reportEventConfigForm.eventValue" placeholder="请输入阈值" maxlength="8">
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="事件驱动报表:" prop="tableReportId">
|
|
|
<el-select v-model="reportEventConfigForm.tableReportId" filterable
|
|
|
placeholder="请选择事件驱动报表" style="width: 100%;"
|
|
@@ -514,39 +538,13 @@ export default {
|
|
|
// 右键布局显示位置
|
|
|
menuTop: 0,
|
|
|
reportEventConfigForm: {
|
|
|
- eventMode: null,
|
|
|
- eventValue: null,
|
|
|
+ itemName: '',
|
|
|
tableReportId: null,
|
|
|
tableReportName: null
|
|
|
},
|
|
|
reportEventConfigFormRules: {
|
|
|
- eventMode: [
|
|
|
- { required: true, message: '请选择事件驱动产生条件', trigger: 'change' }
|
|
|
- ],
|
|
|
- eventValue: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- validator: (rule, val, callback) => {
|
|
|
- if (val != null) {
|
|
|
- let reg = /^(\-)?\d+(\.\d{1,2})?$/
|
|
|
- if (reg.test(val)) {
|
|
|
- if (this.reportEventConfigForm.eventMode == '2') {
|
|
|
- if (val == 0 || val == 1) {
|
|
|
- callback()
|
|
|
- } else {
|
|
|
- callback(new Error('布尔类型时阈值只能为0或者1'))
|
|
|
- }
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- } else {
|
|
|
- callback(new Error('阈值不合法'))
|
|
|
- }
|
|
|
- } else {
|
|
|
- callback(new Error('请输入阈值'))
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ itemName: [
|
|
|
+ { required: true, message: '请选择条件数据项', trigger: 'change' }
|
|
|
],
|
|
|
tableReportId: [
|
|
|
{ required: true, message: '请选择事件驱动报表', trigger: 'change' }
|
|
@@ -589,11 +587,8 @@ export default {
|
|
|
'key': '按值改变读取数据',
|
|
|
'value': '1'
|
|
|
}, {
|
|
|
- 'key': '超过阈值读取数据',
|
|
|
+ 'key': '按条件读取数据',
|
|
|
'value': '2'
|
|
|
- }, {
|
|
|
- 'key': '低于阈值读取数据',
|
|
|
- 'value': '3'
|
|
|
}],
|
|
|
// 数据源
|
|
|
dataSourceList: [],
|
|
@@ -620,8 +615,13 @@ export default {
|
|
|
itemList: []
|
|
|
},
|
|
|
groupRateForm: {
|
|
|
- readMode: null,
|
|
|
- modeValue: '',
|
|
|
+ readMode: null, // 0周期,1变化时读取,2超过或者等于设定值读取,3低于或者等于设定值读取,4指定时间读取
|
|
|
+ eventMode: null, // 事件驱动产生的条件,0大于,1小于,2等于
|
|
|
+ readModeType: null, // 读取模式对应的类型,0绝对值,1百分率
|
|
|
+ modeValue: null, // 模式值
|
|
|
+ modeValueH: 0,
|
|
|
+ modeValueM: 0,
|
|
|
+ modeValueS: 0,
|
|
|
modeValueUnit: '1',
|
|
|
daySetting: [],
|
|
|
valuePeriod: ['00:00:00', '23:59:59']
|
|
@@ -639,7 +639,7 @@ export default {
|
|
|
{ required: true, message: '请选择记录模式', trigger: 'blur' }
|
|
|
],
|
|
|
modeValue: [
|
|
|
- { validator: this.testModeValue }
|
|
|
+ { required: true, validator: this.testModeValue }
|
|
|
],
|
|
|
valuePeriod: [
|
|
|
{ required: true, message: '请选择记录周期', trigger: 'blur' }
|
|
@@ -722,23 +722,22 @@ export default {
|
|
|
},
|
|
|
/** 表单验证判断 */
|
|
|
testModeValue(rule, value, callback) {
|
|
|
+ let tips = ''
|
|
|
+ if (this.groupRateForm.readMode == 1) {
|
|
|
+ tips = '偏差值或偏差率'
|
|
|
+ } else if (this.groupRateForm.readMode == 2) {
|
|
|
+ tips = '条件值'
|
|
|
+ } else {
|
|
|
+ tips = '模式值'
|
|
|
+ }
|
|
|
if (value == null) {
|
|
|
- callback(new Error(this.modeValueTips + '不能为空'))
|
|
|
+ callback(new Error(tips + '不能为空'))
|
|
|
} else {
|
|
|
- if (this.groupRateForm.readMode == 0) {
|
|
|
- let regNum = /^[1-9]\d*$/
|
|
|
- if (regNum.test(value)) {
|
|
|
- callback()
|
|
|
- } else {
|
|
|
- callback(new Error(this.modeValueTips + '不合法'))
|
|
|
- }
|
|
|
+ let reg = /^([1-9][0-9]*|0)(\.[0-9]?[0-9])?$/
|
|
|
+ if (reg.test(value)) {
|
|
|
+ callback()
|
|
|
} else {
|
|
|
- let reg = /^(\-)?\d+(\.\d{1,2})?$/
|
|
|
- if (reg.test(value)) {
|
|
|
- callback()
|
|
|
- } else {
|
|
|
- callback(new Error(this.modeValueTips + '不合法'))
|
|
|
- }
|
|
|
+ callback(new Error(tips + '不合法'))
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -962,7 +961,12 @@ export default {
|
|
|
}
|
|
|
this.groupRateForm = {
|
|
|
readMode: null,
|
|
|
- modeValue: '',
|
|
|
+ eventMode: null,
|
|
|
+ readModeType: null,
|
|
|
+ modeValue: null,
|
|
|
+ modeValueH: 0,
|
|
|
+ modeValueM: 0,
|
|
|
+ modeValueS: 0,
|
|
|
modeValueUnit: '1',
|
|
|
daySetting: [],
|
|
|
valuePeriod: ['00:00:00', '23:59:59']
|
|
@@ -972,6 +976,18 @@ export default {
|
|
|
this.getDataSourceList()
|
|
|
this.groupDialogVisible = true
|
|
|
},
|
|
|
+ /** 事件报表选择数据项 */
|
|
|
+ addEventDataItem() {
|
|
|
+ let itemList = this.groupBasicForm.itemList
|
|
|
+ if (itemList && itemList.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '请先添加数据项!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getEventReportList()
|
|
|
+ },
|
|
|
/** 保存数据组 */
|
|
|
handleSave() {
|
|
|
this.$refs['groupBasicForm'].validate(valid => {
|
|
@@ -979,20 +995,21 @@ export default {
|
|
|
// 参数封装
|
|
|
let params = JSON.parse(JSON.stringify(this.groupBasicForm))
|
|
|
params.readMode = this.groupRateForm.readMode
|
|
|
- if (params.readMode == 0) {
|
|
|
- if (this.groupRateForm.modeValueUnit === '2') { // 分
|
|
|
- params.modeValue = parseInt(this.groupRateForm.modeValue) * 60
|
|
|
- } else if (this.groupRateForm.modeValueUnit === '3') { // 时
|
|
|
- params.modeValue = parseInt(this.groupRateForm.modeValue) * 60 * 60
|
|
|
- } else {
|
|
|
- params.modeValue = this.groupRateForm.modeValue
|
|
|
- }
|
|
|
- } else {
|
|
|
- params.modeValue = this.groupRateForm.modeValue
|
|
|
- }
|
|
|
+ params.modeValue = this.groupRateForm.modeValue
|
|
|
params.startReadTime = this.groupRateForm.valuePeriod[0]
|
|
|
params.endReadTime = this.groupRateForm.valuePeriod[1]
|
|
|
params.readWeek = this.groupRateForm.daySetting.join()
|
|
|
+ if (params.readMode == 1) { // 值改变读取
|
|
|
+ params.readModeType = this.groupRateForm.readModeType
|
|
|
+ } else if (params.readMode == 2) { // 条件读取
|
|
|
+ params.eventMode = this.groupRateForm.eventMode
|
|
|
+ let _itemList = params.itemList
|
|
|
+ for (let i = 0; i < _itemList.length; i ++) {
|
|
|
+ if (_itemList[i].itemName == this.reportEventConfigForm.itemName) {
|
|
|
+ _itemList[i].tableReportId = this.reportEventConfigForm.tableReportId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (params.id) {
|
|
|
this.addGroupItem(params, '修改')
|
|
|
} else {
|
|
@@ -1013,6 +1030,7 @@ export default {
|
|
|
this.chooseItemDataListF = []
|
|
|
this.leavesChooseList = []
|
|
|
this.chooseItemDataView = false
|
|
|
+ this.resetReportEventConfigForm()
|
|
|
// 刷新组列表
|
|
|
this.refreshGroupData()
|
|
|
// 刷新右侧数据
|
|
@@ -1100,30 +1118,37 @@ export default {
|
|
|
this.chooseItemDataView = true
|
|
|
this.groupDialogTitle = '修改数据组'
|
|
|
this.groupRateForm.readMode = item.readMode + ''
|
|
|
- if (item.readMode == 0) {
|
|
|
+ this.groupRateForm.modeValue = item.modeValue
|
|
|
+ if (item.readMode == 0) { // 周期
|
|
|
if (parseInt(item.modeValue) % 3600 == 0) { // 时
|
|
|
- this.groupRateForm.modeValueUnit = '3'
|
|
|
- this.groupRateForm.modeValue = item.modeValue / 3600
|
|
|
- } else if (parseInt(item.modeValue) % 60 == 0) { // 分
|
|
|
- this.groupRateForm.modeValueUnit = '2'
|
|
|
- this.groupRateForm.modeValue = item.modeValue / 60
|
|
|
- } else { // 秒
|
|
|
- this.groupRateForm.modeValueUnit = '1'
|
|
|
- this.groupRateForm.modeValue = item.modeValue
|
|
|
+ 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
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- this.groupRateForm.modeValue = item.modeValue
|
|
|
}
|
|
|
this.groupRateForm.valuePeriod = [item.startReadTime, item.endReadTime]
|
|
|
this.groupRateForm.daySetting = item.readWeek ? item.readWeek.split(',') : []
|
|
|
- switch (this.groupRateForm.readMode) {
|
|
|
- case '0':
|
|
|
- this.modeValueTips = '周期值'
|
|
|
- break
|
|
|
- default:
|
|
|
- this.modeValueTips = '阈值'
|
|
|
- break
|
|
|
- }
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
showAlertWin(this, e)
|
|
@@ -1349,15 +1374,8 @@ export default {
|
|
|
},
|
|
|
/** 记录模式值改变事件 */
|
|
|
readModeChange(val) {
|
|
|
+ this.groupRateForm.modeValue = null
|
|
|
this.groupRateForm.readMode = val
|
|
|
- switch (val) {
|
|
|
- case '0':
|
|
|
- this.modeValueTips = '周期值'
|
|
|
- break
|
|
|
- default:
|
|
|
- this.modeValueTips = '阈值'
|
|
|
- break
|
|
|
- }
|
|
|
},
|
|
|
/** 获取右侧数据源类型列表 */
|
|
|
getDataSourceList() {
|
|
@@ -1426,6 +1444,13 @@ export default {
|
|
|
this.leavesList = data.leaves ? data.leaves : []
|
|
|
this.leavesListF = JSON.parse(JSON.stringify(this.leavesList))
|
|
|
},
|
|
|
+ /** 处理周期时间转秒 */
|
|
|
+ withModeValueTime(type) {
|
|
|
+ let h = this.groupRateForm.modeValueH * 60 * 60
|
|
|
+ let m = this.groupRateForm.modeValueM * 60
|
|
|
+ let s = this.groupRateForm.modeValueS
|
|
|
+ this.groupRateForm.modeValue = h + m + s
|
|
|
+ },
|
|
|
/** 参数检查 */
|
|
|
checkParams() {
|
|
|
if (!this.groupBasicForm.groupName) {
|
|
@@ -1449,31 +1474,62 @@ export default {
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- if (this.groupRateForm.readMode != '1' && !this.groupRateForm.modeValue) {
|
|
|
+ let _mv = parseFloat(this.groupRateForm.modeValue)
|
|
|
+ // 周期读取
|
|
|
+ if (this.groupRateForm.readMode == 0 && (isNaN(_mv) || _mv == 0)) {
|
|
|
this.$message({
|
|
|
- message: '策略设置中' + this.modeValueTips + '不能为空!',
|
|
|
+ message: '策略设置中周期读取值不能为0!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- if (this.groupRateForm.readMode == 0) {
|
|
|
- let regNum = /^[1-9]\d*$/
|
|
|
- if (!regNum.test(this.groupRateForm.modeValue)) {
|
|
|
+ // 值改变读取
|
|
|
+ if (this.groupRateForm.readMode == 1) {
|
|
|
+ if (isNaN(parseInt(this.groupRateForm.readModeType))) {
|
|
|
this.$message({
|
|
|
- message: '策略设置中周期值只能为正整数!',
|
|
|
+ message: '请选择策略设置中值改变的读取方式!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
- } else {
|
|
|
- let regNum = /^(\-)?\d+(\.\d{1,2})?$/
|
|
|
- if (!regNum.test(this.groupRateForm.modeValue)) {
|
|
|
+ if (isNaN(_mv)) {
|
|
|
+ this.$message({
|
|
|
+ message: '策略设置中值改变读取的偏差值或偏差率不合法!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 条件读取
|
|
|
+ if (this.groupRateForm.readMode == 2) {
|
|
|
+ if (isNaN(parseInt(this.groupRateForm.eventMode))) {
|
|
|
this.$message({
|
|
|
- message: '策略设置中阈值不合法!',
|
|
|
+ message: '请选择策略设置中条件读取值的方式!',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
+ if (isNaN(_mv)) {
|
|
|
+ this.$message({
|
|
|
+ message: '策略设置中条件读取的条件值不合法!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (!this.reportEventConfigForm.itemName) {
|
|
|
+ this.$message({
|
|
|
+ message: '策略设置中条件读取的数据项不能为空!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.groupRateForm.modeValue) {
|
|
|
+ this.$message({
|
|
|
+ message: '策略设置中记录模式值不能为空!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
}
|
|
|
if (!this.groupBasicForm.dataSourceId) {
|
|
|
this.$message({
|
|
@@ -1676,7 +1732,7 @@ export default {
|
|
|
if (!res.data) {
|
|
|
this.chooseItemDataList = itemList
|
|
|
this.chooseItemDataListF = JSON.parse(JSON.stringify(this.chooseItemDataList))
|
|
|
- this.getEventReportList(itemList)
|
|
|
+ // this.getEventReportList(itemList)
|
|
|
return
|
|
|
}
|
|
|
let dataModelList = res.data.dataModelList
|
|
@@ -1706,7 +1762,7 @@ export default {
|
|
|
}
|
|
|
this.bomCheckKey = new Date().getTime()
|
|
|
this.chooseItemDataListF = JSON.parse(JSON.stringify(this.chooseItemDataList))
|
|
|
- this.getEventReportList(this.chooseItemDataList)
|
|
|
+ // this.getEventReportList(this.chooseItemDataList)
|
|
|
})
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
@@ -1726,28 +1782,30 @@ export default {
|
|
|
loading.close()
|
|
|
let eventReportList = res.data.reportTableList
|
|
|
// console.log(itemList)
|
|
|
- for (let i in itemList) {
|
|
|
- for (let j in eventReportList) {
|
|
|
- if (itemList[i].tableReportId == eventReportList[j].id) {
|
|
|
- itemList[i].tableReportName = eventReportList[j].reportTableName
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let i in itemList) {
|
|
|
+ // for (let j in eventReportList) {
|
|
|
+ // if (itemList[i].tableReportId == eventReportList[j].id) {
|
|
|
+ // itemList[i].tableReportName = eventReportList[j].reportTableName
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.eventReportList = eventReportList
|
|
|
- this.$nextTick(() => {
|
|
|
- this.chooseItemDataList = JSON.parse(JSON.stringify(itemList))
|
|
|
- this.bomCheckKey = new Date().getTime()
|
|
|
- this.chooseItemDataListF = JSON.parse(JSON.stringify(this.chooseItemDataList))
|
|
|
- })
|
|
|
+ this.dialogReportEventConfigVisible = true
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.chooseItemDataList = JSON.parse(JSON.stringify(itemList))
|
|
|
+ // this.bomCheckKey = new Date().getTime()
|
|
|
+ // this.chooseItemDataListF = JSON.parse(JSON.stringify(this.chooseItemDataList))
|
|
|
+ // })
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
showAlertWin(this, e)
|
|
|
})
|
|
|
},
|
|
|
+ /**按条件读取选择数据项 */
|
|
|
saveEventReportEvent() {
|
|
|
this.$refs['reportEventConfigForm'].validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.initEventReportInfo()
|
|
|
+ this.dialogReportEventConfigVisible = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1794,8 +1852,7 @@ export default {
|
|
|
this.dialogReportEventConfigVisible = false
|
|
|
if (this.$refs['reportEventConfigForm']) {
|
|
|
this.reportEventConfigForm = {
|
|
|
- eventMode: null,
|
|
|
- eventValue: null,
|
|
|
+ itemName: '',
|
|
|
tableReportId: null,
|
|
|
tableReportName: null
|
|
|
}
|
|
@@ -1979,17 +2036,18 @@ export default {
|
|
|
this.dialogDataModelVisible = false
|
|
|
}
|
|
|
},
|
|
|
- /** 弹出层关闭事件 */
|
|
|
- dialogReportEventConfigClose() {
|
|
|
+ resetReportEventConfigForm() {
|
|
|
if (this.$refs['reportEventConfigForm']) {
|
|
|
this.reportEventConfigForm = {
|
|
|
- eventMode: null,
|
|
|
- eventValue: null,
|
|
|
+ itemName: '',
|
|
|
tableReportId: null,
|
|
|
tableReportName: null
|
|
|
}
|
|
|
this.$refs['reportEventConfigForm'].resetFields()
|
|
|
}
|
|
|
+ },
|
|
|
+ /** 弹出层关闭事件 */
|
|
|
+ dialogReportEventConfigClose() {
|
|
|
if (typeof(done) === 'function') {
|
|
|
done()
|
|
|
} else {
|