|
@ -38,7 +38,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="级别" prop="level"> |
|
|
<el-form-item label="级别" prop="level"> |
|
|
<el-select v-model="form.level" placeholder="请选择告警级别"> |
|
|
<el-select v-model="queryParams.level" placeholder="请选择告警级别" clearable> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="dict in dc_alert_level" |
|
|
v-for="dict in dc_alert_level" |
|
|
:key="dict.value" |
|
|
:key="dict.value" |
|
@ -52,7 +52,7 @@ |
|
|
<el-form-item label="运算符" prop="operator"> |
|
|
<el-form-item label="运算符" prop="operator"> |
|
|
<el-select v-model="queryParams.operator" placeholder="请选择运算符" clearable> |
|
|
<el-select v-model="queryParams.operator" placeholder="请选择运算符" clearable> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="dict in operator_sign" |
|
|
v-for="dict in dc_operator_sign" |
|
|
:key="dict.value" |
|
|
:key="dict.value" |
|
|
:label="dict.label" |
|
|
:label="dict.label" |
|
|
:value="dict.value" |
|
|
:value="dict.value" |
|
@ -98,13 +98,13 @@ |
|
|
@click="handleAdd" |
|
|
@click="handleAdd" |
|
|
>新增</el-button> |
|
|
>新增</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<!-- <el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="success" |
|
|
type="success" |
|
|
icon="Edit" |
|
|
icon="Edit" |
|
|
@click="handleUpdate" |
|
|
@click="handleUpdate" |
|
|
>修改</el-button> |
|
|
>修改</el-button> |
|
|
</el-col> |
|
|
</el-col> --> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="success" |
|
|
type="success" |
|
@ -124,7 +124,7 @@ |
|
|
|
|
|
|
|
|
<el-table ref="modelTable" v-loading="loading" :data="modelList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
<el-table ref="modelTable" v-loading="loading" :data="modelList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
<el-table-column type="selection" width="55" align="center" fixed="left" /> |
|
|
<el-table-column type="selection" width="55" align="center" fixed="left" /> |
|
|
<el-table-column label="主键" align="center" prop="id" /> |
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
<el-table-column label="参数数据类型" align="center" prop="paramType" > |
|
|
<el-table-column label="参数数据类型" align="center" prop="paramType" > |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
@ -144,7 +144,7 @@ |
|
|
<el-table-column label="排序" align="center" prop="sort" /> |
|
|
<el-table-column label="排序" align="center" prop="sort" /> |
|
|
<el-table-column label="运算符" align="center" prop="operator" > |
|
|
<el-table-column label="运算符" align="center" prop="operator" > |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="operator_sign" :value="scope.row.operator"/> |
|
|
<dict-tag :options="dc_operator_sign" :value="scope.row.operator"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="名称" align="center" prop="name" /> |
|
|
<el-table-column label="名称" align="center" prop="name" /> |
|
@ -233,7 +233,7 @@ |
|
|
<el-form-item label="运算符" prop="operator"> |
|
|
<el-form-item label="运算符" prop="operator"> |
|
|
<el-select v-model="form.operator" :disabled="operatorDisabled" placeholder="请选择运算符"> |
|
|
<el-select v-model="form.operator" :disabled="operatorDisabled" placeholder="请选择运算符"> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="dict in operator_sign" |
|
|
v-for="dict in dc_operator_sign" |
|
|
:key="dict.value" |
|
|
:key="dict.value" |
|
|
:label="dict.label" |
|
|
:label="dict.label" |
|
|
:value="dict.value" |
|
|
:value="dict.value" |
|
@ -255,7 +255,7 @@ |
|
|
<el-form-item label="值" prop="value"> |
|
|
<el-form-item label="值" prop="value"> |
|
|
<el-select v-model="form.value" placeholder="请选择值"> |
|
|
<el-select v-model="form.value" placeholder="请选择值"> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="dict in alert_value" |
|
|
v-for="dict in dc_alert_value" |
|
|
:key="dict.label" |
|
|
:key="dict.label" |
|
|
:label="dict.label" |
|
|
:label="dict.label" |
|
|
:value="parseFloat(dict.label)" |
|
|
:value="parseFloat(dict.label)" |
|
@ -282,7 +282,7 @@ import { listModel,listModelEnabledNoPage, getModel, delModel, addModel, updateM |
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { dc_param_value_type,operator_sign,dc_alert_level } = proxy.useDict('dc_param_value_type','operator_sign','dc_alert_level'); |
|
|
const { dc_param_value_type,dc_operator_sign,dc_alert_level } = proxy.useDict('dc_param_value_type','dc_operator_sign','dc_alert_level'); |
|
|
const modelList = ref([]); |
|
|
const modelList = ref([]); |
|
|
const open = ref(false); |
|
|
const open = ref(false); |
|
|
const loading = ref(true); |
|
|
const loading = ref(true); |
|
@ -305,6 +305,7 @@ const sortItemMap = ref({}); |
|
|
const queryParamFilter = ref({}); |
|
|
const queryParamFilter = ref({}); |
|
|
const sortProps = ref([]); |
|
|
const sortProps = ref([]); |
|
|
const collapseVisible = ref(false); |
|
|
const collapseVisible = ref(false); |
|
|
|
|
|
const names = ref([]); |
|
|
const editName = ref("更多筛选项"); |
|
|
const editName = ref("更多筛选项"); |
|
|
const flagEnabled = ref([ |
|
|
const flagEnabled = ref([ |
|
|
{label: '有效', value: 1, elTagType: 'default', elTagClass: null}, |
|
|
{label: '有效', value: 1, elTagType: 'default', elTagClass: null}, |
|
@ -314,7 +315,7 @@ const flagEnabledTable = ref([ |
|
|
{label: '有效', value: '1', elTagType: 'default', elTagClass: null}, |
|
|
{label: '有效', value: '1', elTagType: 'default', elTagClass: null}, |
|
|
{label: '无效', value: '0', elTagType: 'default', elTagClass: null} |
|
|
{label: '无效', value: '0', elTagType: 'default', elTagClass: null} |
|
|
]); |
|
|
]); |
|
|
const alert_value = ref([ |
|
|
const dc_alert_value = ref([ |
|
|
{label: '1', value: true, elTagType: 'default', elTagClass: null}, |
|
|
{label: '1', value: true, elTagType: 'default', elTagClass: null}, |
|
|
{label: '0', value: false, elTagType: 'default', elTagClass: null} |
|
|
{label: '0', value: false, elTagType: 'default', elTagClass: null} |
|
|
]); |
|
|
]); |
|
@ -438,6 +439,7 @@ function handleQuery() { |
|
|
|
|
|
|
|
|
/** 重置按钮操作 */ |
|
|
/** 重置按钮操作 */ |
|
|
function resetQuery() { |
|
|
function resetQuery() { |
|
|
|
|
|
reset(); |
|
|
proxy.resetForm("queryRef"); |
|
|
proxy.resetForm("queryRef"); |
|
|
codeVisiable.value = true; |
|
|
codeVisiable.value = true; |
|
|
sortVisiable.value = true; |
|
|
sortVisiable.value = true; |
|
@ -451,6 +453,7 @@ function resetQuery() { |
|
|
// 多选框选中数据 |
|
|
// 多选框选中数据 |
|
|
function handleSelectionChange(selection) { |
|
|
function handleSelectionChange(selection) { |
|
|
ids.value = selection.map(item => item.id); |
|
|
ids.value = selection.map(item => item.id); |
|
|
|
|
|
names.value = selection.map(item => item.name); |
|
|
single.value = selection.length != 1; |
|
|
single.value = selection.length != 1; |
|
|
multiple.value = !selection.length; |
|
|
multiple.value = !selection.length; |
|
|
} |
|
|
} |
|
@ -466,7 +469,20 @@ function handleAdd() { |
|
|
/** 修改按钮操作 */ |
|
|
/** 修改按钮操作 */ |
|
|
function handleUpdate(row) { |
|
|
function handleUpdate(row) { |
|
|
reset(); |
|
|
reset(); |
|
|
const _id = row.id || ids.value |
|
|
const _id = row.id || ids.value; |
|
|
|
|
|
if(_id.length === 0){ |
|
|
|
|
|
ElMessageBox.alert('请选择需要修改的记录', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
center: true, |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
}else if(_id.length > 1){ |
|
|
|
|
|
ElMessageBox.alert('只能选择一条记录进行修改', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
center: true, |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
getModel(_id).then(response => { |
|
|
getModel(_id).then(response => { |
|
|
form.value = response.data; |
|
|
form.value = response.data; |
|
|
open.value = true; |
|
|
open.value = true; |
|
@ -516,7 +532,15 @@ function submitForm() { |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
function handleDelete(row) { |
|
|
function handleDelete(row) { |
|
|
const _ids = row.id || ids.value; |
|
|
const _ids = row.id || ids.value; |
|
|
proxy.$modal.confirm('是否确认删除告警模版编号为"' + _ids + '"的数据项?').then(function() { |
|
|
if(_ids.length == 0){ |
|
|
|
|
|
ElMessageBox.alert('请先选择需要删除的记录', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
center: true, |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
const _names = row.name || names.value; |
|
|
|
|
|
proxy.$modal.confirm('是否确认删除告警模版名称为"' + _names + '"的数据项?').then(function() { |
|
|
return delModel(_ids); |
|
|
return delModel(_ids); |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
getList(); |
|
|
getList(); |
|
@ -526,7 +550,7 @@ function handleDelete(row) { |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
function handleExport() { |
|
|
function handleExport() { |
|
|
proxy.download('model/model/export', { |
|
|
proxy.download('model/dcBusiAlertModel/export', { |
|
|
...queryParams.value |
|
|
...queryParams.value |
|
|
}, `model_${new Date().getTime()}.xlsx`) |
|
|
}, `model_${new Date().getTime()}.xlsx`) |
|
|
} |
|
|
} |
|
@ -655,7 +679,14 @@ const calculateTableHeight = () => { |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function toggleCollapse() { |
|
|
|
|
|
collapseVisible.value = !collapseVisible.value; |
|
|
|
|
|
if(collapseVisible.value){ |
|
|
|
|
|
editName.value = "折叠筛选项"; |
|
|
|
|
|
}else{ |
|
|
|
|
|
editName.value = "更多筛选项" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
getList(); |
|
|
getList(); |
|
|
</script> |
|
|
</script> |
|
|