|
@@ -186,15 +186,17 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<!-- 条件读取 -->
|
|
|
- <el-form-item v-if="groupRateForm.readMode == 2" label='' prop="modeValue">
|
|
|
- <el-input v-model="groupRateForm.modeValue" placeholder="请输入条件值" maxlength="6" style="width: 120px;margin-right: 20px;"></el-input>
|
|
|
+ <el-form-item v-if="groupRateForm.readMode == 2" label='' prop="modeValue" class="cy-cltj">
|
|
|
+ <el-button size="mini" type="info" @click="addEventDataItem"
|
|
|
+ style="float: left;width: 95px;margin-top: 4px;margin-right: 10px;">选择数据项</el-button>
|
|
|
<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-input v-model="groupRateForm.modeValue" placeholder="请输入条件值" maxlength="6"
|
|
|
+ style="width: 120px;float: right;"></el-input>
|
|
|
+ <span style="float: left;color: #8a8888;font-size: 12px;line-height: 12px;">{{reportEventConfigForm.itemName}}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label='日期设置' prop="daySetting" style="margin-top: 20px;">
|
|
|
<el-checkbox-group v-model="groupRateForm.daySetting">
|
|
@@ -487,7 +489,7 @@ import {getDictByKey} from "@/api/basic";
|
|
|
import {
|
|
|
customCompare,
|
|
|
deepTreeFilter,
|
|
|
- deepTreeKey,
|
|
|
+ deepTreeKey, showAlertMsgWin,
|
|
|
showAlertWin, showConfirmWin,
|
|
|
showLoading, showPromptWin,
|
|
|
traverseNode,
|
|
@@ -959,10 +961,7 @@ export default {
|
|
|
addEventDataItem() {
|
|
|
let itemList = this.groupBasicForm.itemList
|
|
|
if (itemList && itemList.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请先添加数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请先添加数据项!')
|
|
|
return
|
|
|
}
|
|
|
this.getEventReportList()
|
|
@@ -1013,7 +1012,7 @@ export default {
|
|
|
saveOrUpdateItemGroup(params).then(res => {
|
|
|
loading.close()
|
|
|
if (res.data) {
|
|
|
- showAlertWin(this, type + '成功!', (action) => {
|
|
|
+ showAlertWin(this, null, type + '成功!', (action) => {
|
|
|
this.handleCancel()
|
|
|
this.chooseItemDataList = []
|
|
|
this.chooseItemDataListF = []
|
|
@@ -1028,13 +1027,10 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- this.$message({
|
|
|
- message: type + '失败!',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, type + '失败!')
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 运行、停止运行接口 */
|
|
@@ -1052,23 +1048,17 @@ export default {
|
|
|
sessionStorage.setItem('GROUP_ID', id)
|
|
|
// sessionStorage.removeItem('GROUP_ID')
|
|
|
this.gotoPageByName('/groupItem')
|
|
|
- this.$message({
|
|
|
- message: res.data,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, res.data)
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 数据组运行 */
|
|
|
runOrStopGroup(state) {
|
|
|
let id = this.chooseGroupData.id
|
|
|
if (!id) {
|
|
|
- this.$message({
|
|
|
- message: '运行失败,请刷新后重试!',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '运行失败,请刷新后重试!')
|
|
|
return
|
|
|
}
|
|
|
this.runGroupById(id, state)
|
|
@@ -1077,10 +1067,7 @@ export default {
|
|
|
updateGroup() {
|
|
|
let id = this.chooseGroupData.id
|
|
|
if (!id) {
|
|
|
- this.$message({
|
|
|
- message: '修改失败,请刷新后重试!',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '修改失败,请刷新后重试!')
|
|
|
return
|
|
|
}
|
|
|
const loading = showLoading(this, '加载中,请稍候···')
|
|
@@ -1091,10 +1078,7 @@ export default {
|
|
|
let item = res.data
|
|
|
let runState = item.runState
|
|
|
if (runState == 1) {
|
|
|
- this.$message({
|
|
|
- message: '该数据组正在运行中,禁止修改!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '该数据组正在运行中,禁止修改!')
|
|
|
return
|
|
|
}
|
|
|
this.createGroupEvent()
|
|
@@ -1113,7 +1097,7 @@ export default {
|
|
|
this.groupRateForm.daySetting = item.readWeek ? item.readWeek.split(',') : []
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 处理模式不同值显示不同 */
|
|
@@ -1172,7 +1156,7 @@ export default {
|
|
|
this.getChooseItemData(item)
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 选择的数据项值初始化 */
|
|
@@ -1202,10 +1186,7 @@ export default {
|
|
|
delGroup() {
|
|
|
let _this = this
|
|
|
if (!this.chooseGroupData) {
|
|
|
- _this.$message({
|
|
|
- message: '删除失败!',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(_this, null, '删除失败!')
|
|
|
return
|
|
|
}
|
|
|
showConfirmWin(_this, null, '您确定要删除该数据组吗?', () => {
|
|
@@ -1217,13 +1198,10 @@ export default {
|
|
|
// 刷新右侧数据
|
|
|
sessionStorage.removeItem('GROUP_ID')
|
|
|
_this.gotoPageByName('/groupItem')
|
|
|
- _this.$message({
|
|
|
- message: res.data,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
+ showAlertMsgWin(_this, null, res.data)
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -1243,10 +1221,7 @@ export default {
|
|
|
/** 修改报表模板标题 */
|
|
|
updateReportName() {
|
|
|
if (!this.chooseReportData || !this.chooseReportData.id) {
|
|
|
- this.$message({
|
|
|
- message: cqcyCode[201],
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, cqcyCode[201])
|
|
|
return
|
|
|
}
|
|
|
showPromptWin(this, '修改报表模板名称', '请输入报表模板名称', this.chooseReportData.reportName, (val) => {
|
|
@@ -1265,26 +1240,20 @@ export default {
|
|
|
updateTableTemplateNameById(params).then(res => {
|
|
|
loading.close()
|
|
|
let msg = res.data ? '修改成功!' : '修改失败!'
|
|
|
- let msgType = res.data ? 'success' : 'warning'
|
|
|
- this.$message({
|
|
|
- message: msg,
|
|
|
- type: msgType
|
|
|
+ showAlertMsgWin(this, null, msg, () => {
|
|
|
+ this.refreshReportData()
|
|
|
+ this.gotoPageByName('/reportTemplate', this.chooseReportData.id)
|
|
|
})
|
|
|
- this.refreshReportData()
|
|
|
- this.gotoPageByName('/reportTemplate', this.chooseReportData.id)
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
/** 删除报表信息 */
|
|
|
delReport() {
|
|
|
if (!this.chooseReportData || !this.chooseReportData.id) {
|
|
|
- this.$message({
|
|
|
- message: cqcyCode[201],
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, cqcyCode[201])
|
|
|
return
|
|
|
}
|
|
|
showConfirmWin(this, null, '您确定要删除该报表模板吗?', () => {
|
|
@@ -1292,26 +1261,19 @@ export default {
|
|
|
delTableTemplateById(this.chooseReportData.id).then(res => {
|
|
|
loading.close()
|
|
|
let msg = res.data ? '删除成功!' : '删除失败!'
|
|
|
- let msgType = res.data ? 'success' : 'error'
|
|
|
- this.$message({
|
|
|
- message: msg,
|
|
|
- type: msgType
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, msg)
|
|
|
this.refreshReportData()
|
|
|
this.gotoPageByName('/index')
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
/** 导出模板报表 */
|
|
|
exportReport() {
|
|
|
if (!this.chooseReportData || !this.chooseReportData.id) {
|
|
|
- this.$message({
|
|
|
- message: cqcyCode[201],
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, cqcyCode[201])
|
|
|
return
|
|
|
}
|
|
|
localStorage.setItem('__export', 'export')
|
|
@@ -1370,7 +1332,7 @@ export default {
|
|
|
getAllDataSource().then(res => {
|
|
|
this.dataSourceList = res.data
|
|
|
}).catch((e) => {
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 查询字典表:记录模式 */
|
|
@@ -1380,17 +1342,14 @@ export default {
|
|
|
}).then(res => {
|
|
|
this.readModeList = res.data
|
|
|
}).catch((e) => {
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 添加数据项 */
|
|
|
addDataItem() {
|
|
|
let id = this.groupBasicForm.dataSourceId
|
|
|
if (!id) {
|
|
|
- this.$message({
|
|
|
- message: '请选择数据源!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择数据源!')
|
|
|
return
|
|
|
}
|
|
|
this.isSelectAllItem = false
|
|
@@ -1423,7 +1382,7 @@ export default {
|
|
|
this.dataItemDialogVisible = true
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 数据项点击事件 */
|
|
@@ -1442,88 +1401,55 @@ export default {
|
|
|
/** 参数检查 */
|
|
|
checkParams() {
|
|
|
if (!this.groupBasicForm.groupName) {
|
|
|
- this.$message({
|
|
|
- message: '组名称不能为空!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '组名称不能为空!')
|
|
|
return false
|
|
|
}
|
|
|
if (this.groupBasicForm.itemList.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请添加数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请添加数据项!')
|
|
|
return false
|
|
|
}
|
|
|
if (!this.groupRateForm.readMode) {
|
|
|
- this.$message({
|
|
|
- message: '策略设置中记录模式不能为空!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '策略设置中记录模式不能为空!')
|
|
|
return false
|
|
|
}
|
|
|
let _mv = parseFloat(this.groupRateForm.modeValue)
|
|
|
// 周期读取
|
|
|
if (this.groupRateForm.readMode == 0 && (isNaN(_mv) || _mv == 0)) {
|
|
|
- this.$message({
|
|
|
- message: '策略设置中周期读取值不能为0!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '策略设置中周期读取值不能为0!')
|
|
|
return false
|
|
|
}
|
|
|
// 值改变读取
|
|
|
if (this.groupRateForm.readMode == 1) {
|
|
|
if (isNaN(parseInt(this.groupRateForm.readModeType))) {
|
|
|
- this.$message({
|
|
|
- message: '请选择策略设置中值改变的读取方式!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择策略设置中值改变的读取方式!')
|
|
|
return false
|
|
|
}
|
|
|
if (isNaN(_mv)) {
|
|
|
- this.$message({
|
|
|
- message: '策略设置中值改变读取的偏差值或偏差率不合法!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '策略设置中值改变读取的偏差值或偏差率不合法!')
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
// 条件读取
|
|
|
if (this.groupRateForm.readMode == 2) {
|
|
|
if (isNaN(parseInt(this.groupRateForm.eventMode))) {
|
|
|
- this.$message({
|
|
|
- message: '请选择策略设置中条件读取值的方式!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择策略设置中条件读取值的方式!')
|
|
|
return false
|
|
|
}
|
|
|
if (isNaN(_mv)) {
|
|
|
- this.$message({
|
|
|
- message: '策略设置中条件读取的条件值不合法!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '策略设置中条件读取的条件值不合法!')
|
|
|
return false
|
|
|
}
|
|
|
if (!this.reportEventConfigForm.itemName) {
|
|
|
- this.$message({
|
|
|
- message: '策略设置中条件读取的数据项不能为空!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '策略设置中条件读取的数据项不能为空!')
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
if (!this.groupRateForm.modeValue) {
|
|
|
- this.$message({
|
|
|
- message: '策略设置中记录模式值不能为空!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '策略设置中记录模式值不能为空!')
|
|
|
return false
|
|
|
}
|
|
|
if (!this.groupBasicForm.dataSourceId) {
|
|
|
- this.$message({
|
|
|
- message: '请选择数据源!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择数据源!')
|
|
|
return false
|
|
|
}
|
|
|
return true
|
|
@@ -1556,10 +1482,7 @@ export default {
|
|
|
// WinCC数据项处理
|
|
|
if (this.hasLeavesFlag === 1) {
|
|
|
if (this.leavesChooseList.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请选择数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择数据项!')
|
|
|
return
|
|
|
}
|
|
|
const nodeId = this.$refs.itemTree.getCurrentNode().$treeNodeId
|
|
@@ -1580,10 +1503,7 @@ export default {
|
|
|
else {
|
|
|
let checkedNodes = this.$refs.itemTree.getCheckedNodes(false, true)
|
|
|
if (checkedNodes.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请选择数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择数据项!')
|
|
|
return
|
|
|
}
|
|
|
for (let i in checkedNodes) {
|
|
@@ -1605,10 +1525,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (chooseChannelNameList.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请选择子数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择子数据项!')
|
|
|
}
|
|
|
// 去重
|
|
|
let arr = JSON.parse(JSON.stringify(this.chooseItemDataListByTree))
|
|
@@ -1649,10 +1566,7 @@ export default {
|
|
|
removeCheckNodesBtnEvent() {
|
|
|
let checkedNodes = this.$refs.chooseItemTree.getCheckedNodes(false, true)
|
|
|
if (checkedNodes.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请选择数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择数据项!')
|
|
|
return
|
|
|
}
|
|
|
// 移除当前选择项
|
|
@@ -1670,10 +1584,7 @@ export default {
|
|
|
/** 选择数据项弹出层保存事件:第一步 */
|
|
|
itemDialogSave1() {
|
|
|
if (this.chooseItemDataListByTree.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请选择数据项!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请选择数据项!')
|
|
|
return
|
|
|
}
|
|
|
this.dataItemDialogTitle = '数据项表达式设置'
|
|
@@ -1768,7 +1679,7 @@ export default {
|
|
|
})
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/** 查询所有事件驱动报表 */
|
|
@@ -1800,7 +1711,7 @@ export default {
|
|
|
// })
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
/**按条件读取选择数据项 */
|
|
@@ -1908,10 +1819,7 @@ export default {
|
|
|
/** 批量选择数据模型 */
|
|
|
multipleSetting() {
|
|
|
if (this.dataLineListSelections.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请至少选择一项数据项',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请至少选择一项数据项!')
|
|
|
return
|
|
|
}
|
|
|
this.chooseDataItemIndex = '-1'
|
|
@@ -1920,10 +1828,7 @@ export default {
|
|
|
},
|
|
|
multipleSettingEventReport() {
|
|
|
if (this.dataLineListSelections.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请至少选择一项数据项',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, '请至少选择一项数据项!')
|
|
|
return
|
|
|
}
|
|
|
this.chooseDataItemIndex = '-1'
|
|
@@ -1956,11 +1861,7 @@ export default {
|
|
|
delTableTemplateById(data.id).then(res => {
|
|
|
loading.close()
|
|
|
let msg = res.data ? '删除成功!' : '删除失败!'
|
|
|
- let msgType = res.data ? 'success' : 'error'
|
|
|
- this.$message({
|
|
|
- message: msg,
|
|
|
- type: msgType
|
|
|
- })
|
|
|
+ showAlertMsgWin(this, null, msg)
|
|
|
setTimeout(() => {
|
|
|
this.gotoPageByName('/reportTemplate')
|
|
|
this.$router.go(0)
|
|
@@ -1969,7 +1870,7 @@ export default {
|
|
|
// node.parent.expand()
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(this, e)
|
|
|
+ showAlertWin(this, null, e)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -2239,4 +2140,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.cy-cltj {
|
|
|
+ .el-form-item__error {
|
|
|
+ top: auto;
|
|
|
+ left: calc(100% - 120px);
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|