|
@@ -108,13 +108,13 @@
|
|
|
:visible.sync="dialogItemVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
:append-to-body="true">
|
|
|
- <el-form ref="itemForm" :model="itemForm" label-width="80px">
|
|
|
+ <el-form ref="itemForm" :model="itemForm" label-width="150px">
|
|
|
<el-form-item label="ID" prop="id" style="display: none;">
|
|
|
<el-input v-model='itemForm.id'
|
|
|
type="text"
|
|
|
auto-complete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="表达式" prop="dataModelId">
|
|
|
+ <el-form-item label="四则运算表达式:" prop="dataModelId">
|
|
|
<el-select v-model="itemForm.dataModelId" filterable clearable placeholder="请选择表达式" style="width: 100%;">
|
|
|
<el-option
|
|
|
v-for="(item, index) in this.dataModelList"
|
|
@@ -124,7 +124,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="描述" prop="describe">
|
|
|
+ <el-form-item label="数据项描述信息:" prop="describe">
|
|
|
<el-input v-model.trim='itemForm.describe'
|
|
|
type="text"
|
|
|
auto-complete="off"
|
|
@@ -132,6 +132,29 @@
|
|
|
maxlength="20"
|
|
|
placeholder="请输入描述信息"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-divider content-position="left" class="cy-divider">事件报表配置(以下任意一项配置为空都将会无效)</el-divider>
|
|
|
+ <el-form-item label="事件驱动产生条件:" prop="eventMode">
|
|
|
+ <el-radio-group v-model="itemForm.eventMode">
|
|
|
+ <el-radio label="0">大于</el-radio>
|
|
|
+ <el-radio label="1">小于</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="阈值:" prop="eventValue">
|
|
|
+ <el-input v-model="itemForm.eventValue" placeholder="请输入阈值"
|
|
|
+ oninput="value=value.replace(/[^0-9.]/g,'')">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="事件驱动报表:" prop="tableReportId">
|
|
|
+ <el-select v-model="itemForm.tableReportId" filterable clearable
|
|
|
+ placeholder="请选择事件驱动报表" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in this.eventReportList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.reportTableName"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<span slot='footer'>
|
|
|
<el-button type="primary" @click="editConfirmEvent" style="margin-top: 20px;">确定</el-button>
|
|
@@ -144,7 +167,7 @@
|
|
|
<script>
|
|
|
import {
|
|
|
deleteItemByIdList,
|
|
|
- getAllDataModel,
|
|
|
+ getAllDataModel, getAllReportTable,
|
|
|
getItemById,
|
|
|
getItemGroupById,
|
|
|
getItemValueById,
|
|
@@ -165,6 +188,7 @@ export default {
|
|
|
groupDataList: [],
|
|
|
dataModelList: [],
|
|
|
selectionItems: [],
|
|
|
+ eventReportList: [],
|
|
|
chooseGroup: null,
|
|
|
chooseGroupId: null,
|
|
|
groupRunStatus: false,
|
|
@@ -173,6 +197,9 @@ export default {
|
|
|
itemForm: {
|
|
|
id: null,
|
|
|
dataModelId: null,
|
|
|
+ eventMode: null,
|
|
|
+ eventValue: null,
|
|
|
+ tableReportId: null,
|
|
|
describe: ''
|
|
|
}
|
|
|
}
|
|
@@ -343,23 +370,44 @@ export default {
|
|
|
_this.getAllDataModel(status => {
|
|
|
if (!status) return
|
|
|
const loading = showLoading(_this, '加载中,请稍候···')
|
|
|
- getItemById(row.id).then(res => {
|
|
|
- loading.close()
|
|
|
- _this.$nextTick(() => {
|
|
|
- _this.itemForm.id = row.id
|
|
|
- _this.itemForm.dataModelId = res.data.dataModelId
|
|
|
- _this.itemForm.describe = res.data.describe
|
|
|
- _this.dialogItemVisible = true
|
|
|
+ let params = {
|
|
|
+ 'page': 1,
|
|
|
+ 'limit': 1000,
|
|
|
+ 'isAutoReport': 3
|
|
|
+ }
|
|
|
+ getAllReportTable(params).then(res => {
|
|
|
+ let eventReportList = res.data.reportTableList
|
|
|
+ this.eventReportList = eventReportList
|
|
|
+ getItemById(row.id).then(res => {
|
|
|
+ loading.close()
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ _this.itemForm.id = row.id
|
|
|
+ _this.itemForm.dataModelId = res.data.dataModelId
|
|
|
+ _this.itemForm.describe = res.data.describe
|
|
|
+ _this.itemForm.tableReportId = res.data.tableReportId
|
|
|
+ _this.itemForm.eventMode = res.data.eventMode + ''
|
|
|
+ _this.itemForm.eventValue = res.data.eventValue
|
|
|
+ _this.dialogItemVisible = true
|
|
|
+ })
|
|
|
+ }).catch((e) => {
|
|
|
+ loading.close()
|
|
|
+ showAlertWin(_this, e)
|
|
|
})
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
- showAlertWin(_this, e)
|
|
|
+ showAlertWin(this, e)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
/** 编辑确认事件 */
|
|
|
editConfirmEvent() {
|
|
|
const loading = showLoading(this, '加载中,请稍候···')
|
|
|
+ // 若驱动报表事件任意一项为空,则清空报表事项
|
|
|
+ if (!this.itemForm.eventMode || !this.itemForm.eventValue || !this.itemForm.tableReportId) {
|
|
|
+ this.itemForm.eventMode = null
|
|
|
+ this.itemForm.eventValue = null
|
|
|
+ this.itemForm.tableReportId = null
|
|
|
+ }
|
|
|
updateItem(this.itemForm).then(res => {
|
|
|
loading.close()
|
|
|
let msg = res.data ? '编辑成功!' : '编辑失败!'
|
|
@@ -461,4 +509,12 @@ export default {
|
|
|
.el-table--enable-row-hover .el-table__body tr:hover > td {
|
|
|
background-color: transparent !important;
|
|
|
}
|
|
|
+
|
|
|
+.cy-divider {
|
|
|
+ margin-top: 50px;
|
|
|
+ .el-divider__text {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #5e5e5e;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|