Browse Source

告警改动初版

pull/1/head
ljlong_2630 1 year ago
parent
commit
5aba24d28f
  1. 3
      .gitignore
  2. 53
      src/api/model/logicconfig.js
  3. 4
      src/api/model/policy.js
  4. 9
      src/assets/styles/self-defined.scss
  5. 447
      src/views/model/alert/deviceparamalert.vue
  6. 298
      src/views/model/alert/logicconfig.vue
  7. 58
      src/views/model/alert/model.vue
  8. 132
      src/views/model/device/index.vue

3
.gitignore

@ -20,4 +20,5 @@ bin-release/
*.DS_Store *.DS_Store
node_modules/ node_modules/
package-lock.json package-lock.json
dist/ dist/
dist.tar.gz

53
src/api/model/logicconfig.js

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询告警逻辑列表
export function listLogicconfig(query) {
return request({
url: '/model/dcBusiAlertLogicConfig/list',
method: 'get',
params: query
})
}
// 查询告警逻辑详细
export function getLogicconfig(id) {
return request({
url: '/model/dcBusiAlertLogicConfig/' + id,
method: 'get'
})
}
// 新增告警逻辑
export function addLogicconfig(data) {
return request({
url: '/model/dcBusiAlertLogicConfig',
method: 'post',
data: data
})
}
// 修改告警逻辑
export function updateLogicconfig(data) {
return request({
url: '/model/dcBusiAlertLogicConfig',
method: 'put',
data: data
})
}
// 删除告警逻辑
export function delLogicconfig(id) {
return request({
url: '/model/dcBusiAlertLogicConfig/' + id,
method: 'delete'
})
}
// 导出告警逻辑
export function exportLogicconfig(query) {
return request({
url: '/${baseUrl}/export',
method: 'get',
params: query
})
}

4
src/api/model/policy.js

@ -81,11 +81,11 @@ export function listPolicyNoPage(query) {
} }
// 批量修改参数值状态策略 // 批量修改参数值状态策略
export function updatePolicyBatch(data) { export function updatePolicyBatch(updateList,deleteList,addList) {
return request({ return request({
url: '/model/dcBusiAlertParamPolicy/batchUpdate', url: '/model/dcBusiAlertParamPolicy/batchUpdate',
method: 'put', method: 'put',
data: data data: {"updateList":updateList,"deleteList":deleteList,"addList":addList}
}) })
} }

9
src/assets/styles/self-defined.scss

@ -59,7 +59,6 @@
margin-top:10px; margin-top:10px;
} }
<<<<<<< Updated upstream
.el-step__icon { .el-step__icon {
position: relative; position: relative;
z-index: 1; z-index: 1;
@ -90,15 +89,12 @@
width: 0; width: 0;
height: 0; height: 0;
} }
=======
>>>>>>> Stashed changes
.divsonmarginleft0{ .divsonmarginleft0{
div{ div{
margin-left:0 !important; margin-left:0 !important;
} }
} }
<<<<<<< Updated upstream
.marginbottom{ .marginbottom{
@ -184,8 +180,3 @@
display: block; display: block;
} }
=======
.marginbottom{
margin-bottom: 0 !important;
}
>>>>>>> Stashed changes

447
src/views/model/alert/deviceparamalert.vue

@ -1,43 +1,54 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="中台设备ID" prop="deviceUuid"> <el-row>
<el-input <el-col :span="4">
v-model="queryParams.deviceUuid" <el-form-item label="中台设备ID" prop="deviceUuid">
placeholder="请输入中台设备ID" <el-input
clearable v-model="queryParams.deviceUuid"
@keyup.enter="handleQuery" placeholder="请输入中台设备ID"
/> clearable
</el-form-item> @keyup.enter="handleQuery"
<el-form-item label="设备名称" prop="deviceName"> />
<el-input </el-form-item>
v-model="queryParams.deviceName" </el-col>
placeholder="请输入设备名称" <el-col :span="4">
clearable <el-form-item label="设备名称" prop="deviceName">
@keyup.enter="handleQuery" <el-input
/> v-model="queryParams.deviceName"
</el-form-item> placeholder="请输入设备名称"
<el-form-item label="参数编码" prop="paramCode"> clearable
<el-input @keyup.enter="handleQuery"
v-model="queryParams.paramCode" />
placeholder="请输入参数编码" </el-form-item>
clearable </el-col>
@keyup.enter="handleQuery" <el-col :span="4">
/> <el-form-item label="参数编码" prop="paramCode">
</el-form-item> <el-input
v-model="queryParams.paramCode"
<el-form-item label="参数名称" prop="paramName"> placeholder="请输入参数编码"
<el-input clearable
v-model="queryParams.paramName" @keyup.enter="handleQuery"
placeholder="请输入参数名称" />
clearable </el-form-item>
@keyup.enter="handleQuery" </el-col>
/> <el-col :span="4">
</el-form-item> <el-form-item label="参数名称" prop="paramName">
<el-form-item class="childTextAlignCenter"> <el-input
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> v-model="queryParams.paramName"
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button> placeholder="请输入参数名称"
</el-form-item> clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -72,7 +83,7 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="alertList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="alertList">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键" align="center" prop="id" /> --> <!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="中台设备ID" align="center" prop="deviceUuid" /> <el-table-column label="中台设备ID" align="center" prop="deviceUuid" />
@ -136,7 +147,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="告警参数" prop="paramCode"> <el-form-item label="告警参数" prop="paramCode">
<el-select v-model="form.paramCode" filterable placeholder="请选择参数" clearable> <el-select v-model="form.paramCode" filterable placeholder="请选择参数" clearable @change="setParamsType">
<el-option <el-option
v-for="item in paramsList" v-for="item in paramsList"
:key="item.paramCode" :key="item.paramCode"
@ -146,6 +157,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="告警参数类型" v-show="false" prop="paramCode">
<el-input v-model="form.paramType"/>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
@ -156,13 +172,13 @@
</template> </template>
</el-dialog> </el-dialog>
<!-- 添加或修改参数值状态策略对话框 --> <!-- 添加或修改参数值状态策略对话框 -->
<el-dialog :title="titlePolicy" v-model="openPolicy" width="1200px" append-to-body> <el-dialog :title="titlePolicy" v-model="openPolicy" width="1600px" append-to-body>
<el-form ref="policyRef" :model="formPolicy" :rules="rulesPolicy" label-width="120px"> <el-form ref="policyRef" :model="formPolicy" :rules="rulesPolicy" label-width="120px">
<el-row> <el-row>
<el-col :span="12" v-show="beginValueVisiable"> <el-col :span="12" v-show="boolValueVisiable">
<el-form-item label="告警值" prop="beginValue"> <el-form-item label="告警值" prop="boolValue">
<!-- <el-input v-model="formPolicy.beginValue" placeholder="请输入开始值" /> --> <!-- <el-input v-model="formPolicy.boolValue" placeholder="请输入开始值" /> -->
<el-select v-model="formPolicy.beginValue" placeholder="请选择是否告警"> <el-select v-model="formPolicy.boolValue" placeholder="请选择是否告警">
<el-option <el-option
v-for="item in alert_value" v-for="item in alert_value"
:key="item.value" :key="item.value"
@ -172,21 +188,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-show="methodIdsVisiable">
<el-form-item label="是否告警" prop="alertFlag"> <el-form-item label="告警方式" prop="methodIds">
<el-select v-model="formPolicy.alertFlag" placeholder="请选择是否告警"> <el-select v-model="formPolicy.methodIds" placeholder="请选择告警方式">
<el-option
v-for="item in alertFlag"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-show="methodIdVisiable">
<el-form-item label="告警方式" prop="methodId">
<el-select v-model="formPolicy.methodId" placeholder="请选择告警方式">
<el-option <el-option
v-for="item in methodList" v-for="item in methodList"
:key="item.id" :key="item.id"
@ -220,7 +224,7 @@
</el-col> </el-col>
<el-col :span="24" v-show="policyModelVisiable"> <el-col :span="24" v-show="policyModelVisiable">
<el-form-item label="告警算法" prop="policyModel"> <el-form-item label="告警算法" prop="policyModel">
<el-table ref="policyTable" v-loading="loading" :data="modelList" :row-key="getRowKey"> <el-table ref="policyTable" v-loading="loading" :data="modelList" :row-key="getRowKey" @selection-change="handleSelectionChange">
<el-table-column type="selection" reserve-selection="true" width="55" align="center" /> <el-table-column type="selection" reserve-selection="true" width="55" align="center" />
<el-table-column label="名称" align="center" prop="name"> <el-table-column label="名称" align="center" prop="name">
<template #default="scope"> <template #default="scope">
@ -235,7 +239,7 @@
</el-table-column> </el-table-column>
<el-table-column label="限值" align="center" prop="value"> <el-table-column label="限值" align="center" prop="value">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.value"></el-input> <el-input v-model="scope.row.value" @change="handleValueChange(scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="级别" align="center" prop="level"> <el-table-column label="级别" align="center" prop="level">
@ -243,9 +247,14 @@
<el-input v-model="scope.row.level"></el-input> <el-input v-model="scope.row.level"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="告警方式" align="center" prop="methodId"> <el-table-column label="排序" align="center" prop="sort">
<template #default="scope">
<el-input v-model="scope.row.sort"></el-input>
</template>
</el-table-column>
<el-table-column label="告警方式" align="center" prop="methodIds">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.methodId" placeholder="请选择告警方式"> <el-select v-model="scope.row.methodIds" multiple @change="methodIdsChange" placeholder="请选择告警方式">
<el-option <el-option
v-for="item in methodList" v-for="item in methodList"
:key="item.id" :key="item.id"
@ -305,8 +314,6 @@ const openPolicy = ref(false);
const loading = ref(true); const loading = ref(true);
const showSearch = ref(true); const showSearch = ref(true);
const ids = ref([]); const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref(""); const title = ref("");
const deviceList = ref([]); const deviceList = ref([]);
@ -317,25 +324,22 @@ const selectedRows = ref([]);
const deletePolicyRows = ref([]); const deletePolicyRows = ref([]);
const oldPolicyRows = ref([]); const oldPolicyRows = ref([]);
const addPolicyRows = ref([]); const addPolicyRows = ref([]);
const policyParamsUpdateAdd = ref([]); const boolValueVisiable = ref(false);
const beginValueVisiable = ref(false);
const statusValueVisiable = ref(false); const statusValueVisiable = ref(false);
const statusTypeVisiable = ref(false); const statusTypeVisiable = ref(false);
const sortIdVisiable = ref(false); const sortIdVisiable = ref(false);
const methodIdVisiable = ref(false); const methodIdsVisiable = ref(false);
const policyModelVisiable = ref(false); const policyModelVisiable = ref(false);
const policyParams = ref([]); const policyParams = ref([]);
const policyAlertId = ref(""); const policyAlertId = ref("");
const policyDeviceUuid = ref(""); const policyDeviceUuid = ref("");
const paramTypeValue = ref(""); const paramTypeValue = ref("");
const logicCode = ref("");
const rowPolicySelected = ref([]);
const enabledFlagTable = ref([ const enabledFlagTable = ref([
{label: '可用', value: 'true', elTagType: 'default', elTagClass: null}, {label: '可用', value: 'true', elTagType: 'default', elTagClass: null},
{label: '不可用', value: 'false', elTagType: 'default', elTagClass: null} {label: '不可用', value: 'false', elTagType: 'default', elTagClass: null}
]); ]);
const alertFlag = ref([
{label: '告警', value: '1', elTagType: 'default', elTagClass: null},
{label: '不告警', value: '0', elTagType: 'default', elTagClass: null}
]);
const status = ref([ const status = ref([
{label: '状态1', value: '1', elTagType: 'default', elTagClass: null}, {label: '状态1', value: '1', elTagType: 'default', elTagClass: null},
{label: '状态2', value: '2', elTagType: 'default', elTagClass: null} {label: '状态2', value: '2', elTagType: 'default', elTagClass: null}
@ -360,15 +364,14 @@ const data = reactive({
queryParamsPolicy:{ queryParamsPolicy:{
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
beginValue: null, boolValue: null,
endValue: null, endValue: null,
alertFlag: null,
alertId: null, alertId: null,
statusValue: null, statusValue: null,
statusType: null, statusType: null,
deviceId: null, deviceId: null,
sortId: null, sortId: null,
methodId: null methodIds: null
}, },
queryPolicy:{ queryPolicy:{
alertId: null, alertId: null,
@ -412,7 +415,6 @@ function cancel() {
// //
function reset() { function reset() {
form.value = { form.value = {
id: null,
tentantId: null, tentantId: null,
version: null, version: null,
createBy: null, createBy: null,
@ -423,9 +425,18 @@ function reset() {
userId: null, userId: null,
deleteBy: null, deleteBy: null,
deleteTime: null, deleteTime: null,
deviceUuid: null, id: null,
paramCode: null, boolValue: null,
note: null alertId: null,
statusValue: null,
statusType: null,
deviceId: null,
sortId: null,
sort: null,
methodIds: null,
level:null,
operator: null,
operator_sign: null,
}; };
proxy.resetForm("alertRef"); proxy.resetForm("alertRef");
} }
@ -444,15 +455,17 @@ function resetPolicy() {
deleteBy: null, deleteBy: null,
deleteTime: null, deleteTime: null,
id: null, id: null,
beginValue: null, boolValue: null,
endValue: null,
alertFlag: null,
alertId: null, alertId: null,
statusValue: null, statusValue: null,
statusType: null, statusType: null,
deviceId: null, deviceId: null,
sortId: null, sortId: null,
methodId: null sort: null,
methodIds: null,
level:null,
operator: null,
operator_sign: null,
}; };
proxy.resetForm("policyRef"); proxy.resetForm("policyRef");
} }
@ -471,9 +484,13 @@ function resetQuery() {
// //
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id); selection.forEach(item=>{
single.value = selection.length != 1; if(!rowPolicySelected.value.includes(item)){
multiple.value = !selection.length; handleValueChange(item);
}
})
rowPolicySelected.value = selection;
} }
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -489,22 +506,37 @@ function handlePolicy(row) {
resetPolicy(); resetPolicy();
selectedRows.value=[]; selectedRows.value=[];
deletePolicyRows.value=[]; deletePolicyRows.value=[];
if(row.paramType==4){ addPolicyRows.value=[];
deletePolicyRows.value=[];
logicCode.value = row.logicCode;
if(row.logicCode=='A'){
getModelListSwitch(row); getModelListSwitch(row);
beginValueVisiable.value=true; boolValueVisiable.value=true;
policyModelVisiable.value=false; policyModelVisiable.value=false;
statusValueVisiable.value=true; statusValueVisiable.value=true;
statusTypeVisiable.value=true; statusTypeVisiable.value=true;
sortIdVisiable.value=false; sortIdVisiable.value=false;
methodIdVisiable.value=true; methodIdsVisiable.value=true;
}else{ }else if(row.logicCode == 'B'){
getModelList(row); getModelList(row);
policyModelVisiable.value=true; policyModelVisiable.value=true;
beginValueVisiable.value=false; boolValueVisiable.value=false;
statusValueVisiable.value=false; statusValueVisiable.value=false;
statusTypeVisiable.value=false; statusTypeVisiable.value=false;
sortIdVisiable.value=false; sortIdVisiable.value=false;
methodIdVisiable.value=false; methodIdsVisiable.value=false;
}else if(row.logicCode == 'C'){
ElMessageBox.alert('目前该告警逻辑没有实现', '提示', {
confirmButtonText: '确定',
center: true,
})
return;
}else{
ElMessageBox.alert('请确保已创建有效告警逻辑', '提示', {
confirmButtonText: '确定',
center: true,
})
return;
} }
getMethodList(); getMethodList();
queryParamsPolicy.value.alertId = row.id; queryParamsPolicy.value.alertId = row.id;
@ -584,29 +616,32 @@ function submitFormPolicy() {
// //
if (formPolicy.value.id != null) { if (formPolicy.value.id != null) {
// //
if(paramTypeValue.value != 4 ){ if(logicCode.value == 'B' ){
if(proxy.$refs.policyTable.getSelectionRows().length==0){ // if(proxy.$refs.policyTable.getSelectionRows().length==0){
ElMessageBox.alert('请确保至少勾选了一条告警算法', '提示', { // ElMessageBox.alert('', '', {
confirmButtonText: '确定', // confirmButtonText: '',
center: true, // center: true,
}) // })
// return;
// }
if(!judgeIfRightValue()){
return; return;
} };
mapFormTableUpdate(); mapFormTableUpdate();
computeDelPolicy(); computeDelPolicy();
computeAddPolicy(); computeAddPolicy();
updatePolicyBatch(policyParams.value).then(response => { updatePolicyBatch(policyParams.value,deletePolicyRows.value,addPolicyRows.value).then(response => {
if(deletePolicyRows.value.length>0){ // if(deletePolicyRows.value.length>0){
newHandleDeletePolicy(); // newHandleDeletePolicy();
} // }
if(addPolicyRows.value.length>0){ // if(addPolicyRows.value.length>0){
handleAddPolicy(); // handleAddPolicy();
} // }
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
openPolicy.value = false; openPolicy.value = false;
getList(); getList();
}); });
}else{ }else if(logicCode.value == 'A'){
updatePolicy(formPolicy.value).then(response => { updatePolicy(formPolicy.value).then(response => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
openPolicy.value = false; openPolicy.value = false;
@ -615,21 +650,24 @@ function submitFormPolicy() {
} }
} else { } else {
// //
if(paramTypeValue.value != 4 ){ if(logicCode.value == 'B' ){
if(proxy.$refs.policyTable.getSelectionRows().length==0){ // if(proxy.$refs.policyTable.getSelectionRows().length==0){
ElMessageBox.alert('请确保至少勾选了一条告警算法', '提示', { // ElMessageBox.alert('', '', {
confirmButtonText: '确定', // confirmButtonText: '',
center: true, // center: true,
}) // })
// return;
// }
if(!judgeIfRightValue()){
return; return;
} };
mapFormTable(); mapFormTable();
addPolicyBatch(policyParams.value).then(response => { addPolicyBatch(policyParams.value).then(response => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
openPolicy.value = false; openPolicy.value = false;
getList(); getList();
}); });
}else{ }else if(logicCode.value == 'A'){
addPolicy(formPolicy.value).then(response => { addPolicy(formPolicy.value).then(response => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
openPolicy.value = false; openPolicy.value = false;
@ -654,9 +692,8 @@ function getModelListSwitch(row){
if(response.data && response.data.length>0){ if(response.data && response.data.length>0){
formPolicy.value.statusValue = response.data[0].statusValue; formPolicy.value.statusValue = response.data[0].statusValue;
formPolicy.value.statusType = response.data[0].statusType; formPolicy.value.statusType = response.data[0].statusType;
formPolicy.value.methodId = response.data[0].methodId; formPolicy.value.methodIds = response.data[0].methodIds.split(',');
formPolicy.value.alertFlag = response.data[0].alertFlag; formPolicy.value.boolValue = response.data[0].boolValue;
formPolicy.value.beginValue = response.data[0].beginValue;
formPolicy.value.alertId = row.id; formPolicy.value.alertId = row.id;
formPolicy.value.deviceId = row.deviceUuid; formPolicy.value.deviceId = row.deviceUuid;
formPolicy.value.id = response.data[0].id; formPolicy.value.id = response.data[0].id;
@ -672,6 +709,7 @@ function getModelListSwitch(row){
// //
function getModelList(row){ function getModelList(row){
queryPolicy.value.alertId = row.id; queryPolicy.value.alertId = row.id;
queryPolicy.value.flagEnabled = true;
listModel().then(response => { listModel().then(response => {
modelList.value = response.rows; modelList.value = response.rows;
formPolicy.value.alertId = row.id; formPolicy.value.alertId = row.id;
@ -683,7 +721,6 @@ function getModelList(row){
if(response.data && response.data.length>0){ if(response.data && response.data.length>0){
console.log(response.data); console.log(response.data);
oldPolicyRows.value = response.data; oldPolicyRows.value = response.data;
formPolicy.value.alertFlag = response.data[0].alertFlag;
formPolicy.value.alertId = response.data[0].alertId; formPolicy.value.alertId = response.data[0].alertId;
formPolicy.value.deviceId = response.data[0].deviceId; formPolicy.value.deviceId = response.data[0].deviceId;
formPolicy.value.id = response.data[0].id; formPolicy.value.id = response.data[0].id;
@ -692,13 +729,21 @@ function getModelList(row){
if(item.alertModelId == element.id){ if(item.alertModelId == element.id){
policyDeviceUuid.value = item.deviceId; policyDeviceUuid.value = item.deviceId;
policyAlertId.value = item.alertId; policyAlertId.value = item.alertId;
element.value = item.beginValue; if(paramTypeValue.value == '3'){
element.level = item.sortId; element.value = item.floatValue;
}else if(paramTypeValue.value == '2'){
element.value = item.stringValue;
}else if(paramTypeValue.value == '1'){
element.value = item.intValue;
}
element.level = item.level;
element.name = item.name; element.name = item.name;
element.id = item.id; element.id = item.id;
element.statusValue = item.statusValue; element.statusValue = item.statusValue;
element.statusType = item.statusType; element.statusType = item.statusType;
element.methodId = item.methodId; element.methodIds = item.methodIds.split(',');
element.operator = item.operator;
element.sort = item.sortId;
proxy.$refs.policyTable.toggleRowSelection(element,true); proxy.$refs.policyTable.toggleRowSelection(element,true);
return element; return element;
} }
@ -716,16 +761,23 @@ function mapFormTable(){
policyParams.value=[]; policyParams.value=[];
policyTableRows.forEach(item=>{ policyTableRows.forEach(item=>{
let policyParam = {}; let policyParam = {};
policyParam.alertFlag = formPolicy.value.alertFlag;
policyParam.deviceId = policyDeviceUuid.value; policyParam.deviceId = policyDeviceUuid.value;
policyParam.alertId = policyAlertId.value; policyParam.alertId = policyAlertId.value;
policyParam.beginValue = item.value; if(paramTypeValue.value == '3'){
policyParam.sortId = item.level; policyParam.floatValue = item.value;
}else if(paramTypeValue.value == '2'){
policyParam.stringValue = item.value;
}else if(paramTypeValue.value == '1'){
policyParam.intValue = item.value;
}
policyParam.level = item.level;
policyParam.alertModelId = item.id; policyParam.alertModelId = item.id;
policyParam.name = item.name; policyParam.name = item.name;
policyParam.statusValue = item.statusValue; policyParam.statusValue = item.statusValue;
policyParam.statusType = item.statusType; policyParam.statusType = item.statusType;
policyParam.methodId = item.methodId; policyParam.methodIds = item.methodIds.join(',');
policyParam.operator = item.operator;
policyParam.sortId = item.sort;
policyParams.value.push(policyParam); policyParams.value.push(policyParam);
}) })
} }
@ -737,16 +789,23 @@ function mapFormTableUpdate(){
policyTableRows.forEach(item=>{ policyTableRows.forEach(item=>{
let policyParam = {}; let policyParam = {};
policyParam.id = item.id; policyParam.id = item.id;
policyParam.alertFlag = formPolicy.value.alertFlag;
policyParam.deviceId = policyDeviceUuid.value; policyParam.deviceId = policyDeviceUuid.value;
policyParam.alertId = item.alertId; policyParam.alertId = item.alertId;
policyParam.beginValue = item.value; if(paramTypeValue.value == '3'){
policyParam.sortId = item.level; policyParam.floatValue = item.value;
}else if(paramTypeValue.value == '2'){
policyParam.stringValue = item.value;
}else if(paramTypeValue.value == '1'){
policyParam.intValue = item.value;
}
policyParam.level = item.level;
policyParam.alertModelId = item.alertModelId; policyParam.alertModelId = item.alertModelId;
policyParam.name = item.name; policyParam.name = item.name;
policyParam.statusValue = item.statusValue; policyParam.statusValue = item.statusValue;
policyParam.statusType = item.statusType; policyParam.statusType = item.statusType;
policyParam.methodId = item.methodId; policyParam.methodIds = item.methodIds.join(',');
policyParam.operator = item.operator;
policyParam.sortId = item.sort;
policyParams.value.push(policyParam); policyParams.value.push(policyParam);
}) })
} }
@ -757,20 +816,6 @@ function getRowKey(row){
return row.id; return row.id;
} }
/** 删除按钮操作 */
function newHandleDeletePolicy(){
const _names = deletePolicyRows.value.map(item=>{
return item.name;
});
const _ids = deletePolicyRows.value.map(item=>{
return item.id;
});
proxy.$modal.confirm('是否确认删除告警算法"' + _names + '"的数据项?').then(function() {
return newDelPolicy(_ids);
}).then(() => {
}).catch(() => {});
}
function computeDelPolicy() { function computeDelPolicy() {
const newSeletedRows = proxy.$refs.policyTable.getSelectionRows(); const newSeletedRows = proxy.$refs.policyTable.getSelectionRows();
@ -782,6 +827,9 @@ function computeDelPolicy() {
} }
}) })
if(!flag){ if(!flag){
policyParams.value = policyParams.value.filter(element=>{
return item.id === element.id
})
deletePolicyRows.value.push(item); deletePolicyRows.value.push(item);
} }
}) })
@ -797,37 +845,104 @@ function computeAddPolicy() {
} }
}) })
if(!flag){ if(!flag){
addPolicyRows.value.push(item); policyParams.value = policyParams.value.filter(element=>{
return item.id !== element.id;
})
//id
delete item.id;
let policyParam = {};
policyParam.deviceId = policyDeviceUuid.value;
policyParam.alertId = policyAlertId.value;
if(paramTypeValue.value == '3'){
policyParam.floatValue = item.value;
}else if(paramTypeValue.value == '2'){
policyParam.stringValue = item.value;
}else if(paramTypeValue.value == '1'){
policyParam.intValue = item.value;
}
policyParam.level = item.level;
policyParam.alertModelId = item.id;
policyParam.name = item.name;
policyParam.statusValue = item.statusValue;
policyParam.statusType = item.statusType;
policyParam.methodIds = item.methodIds.join(',');
policyParam.operator = item.operator;
policyParam.sortId = item.sort;
addPolicyRows.value.push(policyParam);
} }
}) })
} }
/** 新增方法 */ function setParamsType(val){
function handleAddPolicy(){ paramsList.value.forEach(item=>{
mapFormTableUpdataAdd(); if(item.paramCode == val){
addPolicyBatch(policyParamsUpdateAdd.value); form.value.paramType = item.paramType;
}
})
} }
// //
function mapFormTableUpdataAdd(){ function handleValueChange(row){
policyParamsUpdateAdd.value=[]; let flag = true;
addPolicyRows.value.forEach(item=>{ const selectedRowsNow = proxy.$refs.policyTable.getSelectionRows();
let policyParam = {}; if(selectedRowsNow.length>0){
policyParam.alertFlag = formPolicy.value.alertFlag; selectedRowsNow.forEach(item=>{
policyParam.deviceId = policyDeviceUuid.value; if(item.sort < row.sort){
policyParam.alertId = policyAlertId.value; if(item.value > row.value){
policyParam.beginValue = item.value; flag = false;
policyParam.sortId = item.level; }
policyParam.alertModelId = item.id; }else if(item.sort > row.sort){
policyParam.name = item.name; if(item.value < row.value){
policyParam.statusValue = item.statusValue; flag = false;
policyParam.statusType = item.statusType; }
policyParam.methodId = item.methodId; }
policyParamsUpdateAdd.value.push(policyParam); })
}) }
if(!flag){
ElMessageBox.alert('请确认目前已勾选的告警限值配置是否合理', '提示', {
confirmButtonText: '确定',
center: true,
})
}
return flag;
}
function judgeIfRightValue(){
let flag = true;
const selectedRowsNow = proxy.$refs.policyTable.getSelectionRows();
if(selectedRowsNow.length>0){
selectedRowsNow.forEach(item=>{
if(!handleValueChangeSub(item)){
flag = false;
};
})
}
return flag;
} }
//
function handleValueChangeSub(row){
let flag = true;
const selectedRowsNow = proxy.$refs.policyTable.getSelectionRows();
if(selectedRowsNow.length>0){
selectedRowsNow.forEach(item=>{
if(item.sort < row.sort){
if(item.value > row.value){
flag = false;
}
}else if(item.sort > row.sort){
if(item.value < row.value){
flag = false;
}
}
})
}
return flag;
}
function methodIdsChange(){
proxy.$forceUpdate();
}
getList(); getList();

298
src/views/model/alert/logicconfig.vue

@ -0,0 +1,298 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="逻辑编码" prop="logicCode">
<el-select v-model="queryParams.logicCode" placeholder="请选择逻辑编码" clearable>
<el-option
v-for="dict in dc_alert_logic"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="参数变量类型" prop="paramValueType">
<el-select v-model="queryParams.paramValueType" placeholder="请选择参数变量类型" clearable>
<el-option
v-for="dict in dc_param_value_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input
v-model="queryParams.note"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
icon="Plus"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="Edit"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="Delete"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="Download"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="logicconfigList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="逻辑编码" align="center" prop="logicCode">
<template #default="scope">
<dict-tag :options="dc_alert_logic" :value="scope.row.logicCode"/>
</template>
</el-table-column>
<el-table-column label="参数变量类型" align="center" prop="paramValueType">
<template #default="scope">
<dict-tag :options="dc_param_value_type" :value="scope.row.paramValueType"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="note" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
type="text"
icon="Edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
type="text"
icon="Delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改告警逻辑对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
<el-form ref="logicconfigRef" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="逻辑编码" prop="logicCode">
<el-select v-model="form.logicCode" placeholder="请选择逻辑编码">
<el-option
v-for="dict in dc_alert_logic"
:key="dict.value"
:label="dict.label"
:value="dict.value" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="参数变量类型" prop="paramValueType">
<el-select v-model="form.paramValueType" placeholder="请选择参数变量类型">
<el-option
v-for="dict in dc_param_value_type"
:key="dict.value"
:label="dict.label"
:value="dict.value" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="note">
<el-input v-model="form.note" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Logicconfig">
import { listLogicconfig, getLogicconfig, delLogicconfig, addLogicconfig, updateLogicconfig } from "@/api/model/logicconfig";
const { proxy } = getCurrentInstance();
const { dc_alert_logic, dc_param_value_type } = proxy.useDict('dc_alert_logic', 'dc_param_value_type');
const logicconfigList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
logicCode: null,
paramValueType: null,
note: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询告警逻辑列表 */
function getList() {
loading.value = true;
listLogicconfig(queryParams.value).then(response => {
logicconfigList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
tentantId: null,
version: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
userId: null,
deleteBy: null,
deleteTime: null,
id: null,
logicCode: null,
paramValueType: null,
note: null
};
proxy.resetForm("logicconfigRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加告警逻辑";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getLogicconfig(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改告警逻辑";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["logicconfigRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateLogicconfig(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addLogicconfig(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除告警逻辑编号为"' + _ids + '"的数据项?').then(function() {
return delLogicconfig(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('model/alert/logicconfig/export', {
...queryParams.value
}, `logicconfig_${new Date().getTime()}.xlsx`)
}
getList();
</script>

58
src/views/model/alert/model.vue

@ -101,7 +101,7 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="modelList" @selection-change="handleSelectionChange"> <el-table ref="modelTable" v-loading="loading" :data="modelList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<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" >
@ -116,6 +116,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="级别" align="center" prop="level" /> <el-table-column label="级别" align="center" prop="level" />
<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="operator_sign" :value="scope.row.operator"/>
@ -168,6 +169,16 @@
<el-input v-model="form.code" placeholder="请输入代码" /> <el-input v-model="form.code" placeholder="请输入代码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="级别" prop="level">
<el-input v-model="form.level" placeholder="请输入级别" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入级别" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否有效" prop="flagEnabled"> <el-form-item label="是否有效" prop="flagEnabled">
<el-select v-model="form.flagEnabled" placeholder="请选择是否有效"> <el-select v-model="form.flagEnabled" placeholder="请选择是否有效">
@ -180,11 +191,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="级别" prop="level">
<el-input v-model="form.level" placeholder="请输入级别" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运算符" prop="operator"> <el-form-item label="运算符" prop="operator">
<el-select v-model="form.operator" placeholder="请选择运算符"> <el-select v-model="form.operator" placeholder="请选择运算符">
@ -204,7 +210,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="值" prop="value"> <el-form-item label="值" prop="value">
<el-input v-model="form.value" placeholder="请输入值" /> <el-input v-model="form.value" placeholder="请输入值"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -223,6 +229,7 @@
</style> </style>
<script setup name="Model"> <script setup name="Model">
import { listModel, getModel, delModel, addModel, updateModel } from "@/api/model/alertmodel"; import { listModel, getModel, delModel, addModel, updateModel } from "@/api/model/alertmodel";
import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { dc_param_value_type,operator_sign } = proxy.useDict('dc_param_value_type','operator_sign'); const { dc_param_value_type,operator_sign } = proxy.useDict('dc_param_value_type','operator_sign');
const modelList = ref([]); const modelList = ref([]);
@ -344,12 +351,26 @@ function submitForm() {
proxy.$refs["modelRef"].validate(valid => { proxy.$refs["modelRef"].validate(valid => {
if (valid) { if (valid) {
if (form.value.id != null) { if (form.value.id != null) {
if(!judgeIfRightValue()){
ElMessageBox.alert('请确认目前的告警限值配置是否合理', '提示', {
confirmButtonText: '确定',
center: true,
})
return;
};
updateModel(form.value).then(response => { updateModel(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
getList(); getList();
}); });
} else { } else {
if(!judgeIfRightValue()){
ElMessageBox.alert('请确认目前的告警限值配置是否合理', '提示', {
confirmButtonText: '确定',
center: true,
})
return;
};
addModel(form.value).then(response => { addModel(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;
@ -378,5 +399,28 @@ function handleExport() {
}, `model_${new Date().getTime()}.xlsx`) }, `model_${new Date().getTime()}.xlsx`)
} }
//
function handleValueChange(row){
let flag = true;
if(modelList.value.length>0){
modelList.value.forEach(item=>{
if(item.sort < row.sort){
if(item.value > row.value){
flag = false;
}
}else if(item.sort > row.sort){
if(item.value < row.value){
flag = false;
}
}
})
}
return flag;
}
function judgeIfRightValue(){
return handleValueChange(form.value);
}
getList(); getList();
</script> </script>

132
src/views/model/device/index.vue

@ -1,35 +1,41 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="中台设备编码" prop="centerDeviceCode"> <el-row>
<el-input <el-col :span="4">
v-model="queryParams.centerDeviceCode" <el-form-item label="中台设备编码" prop="centerDeviceCode">
placeholder="请输入中台设备编码" <el-input
clearable v-model="queryParams.centerDeviceCode"
@keyup.enter="handleQuery" placeholder="请输入中台设备编码"
/> clearable
</el-form-item> @keyup.enter="handleQuery"
<el-form-item label="设备名称" prop="deviceName"> />
<el-input </el-form-item>
v-model="queryParams.deviceName" </el-col>
placeholder="请输入设备名称" <el-col :span="4">
clearable <el-form-item label="设备名称" prop="deviceName">
@keyup.enter="handleQuery" <el-input
/> v-model="queryParams.deviceName"
</el-form-item> placeholder="请输入设备名称"
<el-form-item label="通讯来源类型" prop="deviceSource"> clearable
<el-select v-model="queryParams.deviceSourceId" placeholder="请选择通讯来源类型" clearable> @keyup.enter="handleQuery"
<el-option />
v-for="dict in dc_device_source" </el-form-item>
:key="dict.value" </el-col>
:label="dict.label" <el-col :span="4">
:value="dict.value" <el-form-item label="通讯来源类型" prop="deviceSource">
@change="deviceSourceChange" <el-select v-model="queryParams.deviceSourceId" placeholder="请选择通讯来源类型" clearable>
/> <el-option
</el-select> v-for="dict in dc_device_source"
</el-form-item> :key="dict.value"
<el-collapse-transition> :label="dict.label"
<div v-show="collapseVisible"> :value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否可用" prop="enabledFlag"> <el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="queryParams.enabledFlag" placeholder="请选择是否可用" clearable> <el-select v-model="queryParams.enabledFlag" placeholder="请选择是否可用" clearable>
<el-option <el-option
@ -40,6 +46,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="设备类型" prop="deviceType"> <el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable> <el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
<el-option <el-option
@ -50,11 +58,20 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="所属组织名称" prop="orgName"> <el-form-item label="所属组织名称" prop="orgName">
<el-tree-select v-model="queryParams.orgName" :data="deptOptions" <el-tree-select v-model="queryParams.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称" :props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称"
check-strictly :default-expand-all="true" clearable/> check-strictly :default-expand-all="true" clearable/>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-collapse-transition>
<div v-show="collapseVisible">
<el-row>
<el-col :span="4">
<el-form-item label="位置编码" prop="locationCode"> <el-form-item label="位置编码" prop="locationCode">
<el-input <el-input
v-model="queryParams.locationCode" v-model="queryParams.locationCode"
@ -63,6 +80,8 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="位置名称" prop="locationName"> <el-form-item label="位置名称" prop="locationName">
<el-input <el-input
v-model="queryParams.locationName" v-model="queryParams.locationName"
@ -71,6 +90,8 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="设备应用范围" prop="deviceClass"> <el-form-item label="设备应用范围" prop="deviceClass">
<el-input <el-input
v-model="queryParams.deviceClass" v-model="queryParams.deviceClass"
@ -79,14 +100,8 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="接口名称" prop="apiName"> </el-col>
<el-input <el-col :span="4">
v-model="queryParams.apiName"
placeholder="请输入接口名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="服务器地址" prop="serverIp"> <el-form-item label="服务器地址" prop="serverIp">
<el-input <el-input
v-model="queryParams.serverIp" v-model="queryParams.serverIp"
@ -95,6 +110,8 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="从属网关ID" prop="gatewayId"> <el-form-item label="从属网关ID" prop="gatewayId">
<el-input <el-input
v-model="queryParams.gatewayId" v-model="queryParams.gatewayId"
@ -103,6 +120,8 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="纬度" prop="latValue"> <el-form-item label="纬度" prop="latValue">
<el-input <el-input
v-model="queryParams.latValue" v-model="queryParams.latValue"
@ -111,6 +130,10 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4">
<el-form-item label="经度" prop="lagValue"> <el-form-item label="经度" prop="lagValue">
<el-input <el-input
v-model="queryParams.lagValue" v-model="queryParams.lagValue"
@ -119,6 +142,8 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否告警" prop="alertEnabled"> <el-form-item label="是否告警" prop="alertEnabled">
<el-select v-model="queryParams.alertEnabled" placeholder="请选择设备类型" clearable> <el-select v-model="queryParams.alertEnabled" placeholder="请选择设备类型" clearable>
<el-option <el-option
@ -129,31 +154,42 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="设备模型" prop="deviceModelId"> <el-form-item label="设备模型" prop="deviceModelId">
<el-select v-model="queryParams.deviceModelId" placeholder="请选择设备模型id" clearable> <el-select v-model="queryParams.deviceModelId" placeholder="请选择设备模型id" clearable>
<el-option label="请选择设备模型" value="deviceModelId" /> <el-option label="请选择设备模型" value="deviceModelId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="租户号" prop="tentantId"> </el-col>
<el-col :span="4">
<el-form-item label="设备分组" prop="deviceGroupId">
<el-select v-model="queryParams.deviceGroupId" placeholder="请选择设备分组ID" clearable>
<el-option label="请添加设备分组" value="" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<!-- <el-form-item label="租户号" prop="tentantId">
<el-input <el-input
v-model="queryParams.tentantId" v-model="queryParams.tentantId"
placeholder="请输入租户号" placeholder="请输入租户号"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> -->
</el-col>
<el-col :span="4">
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
<el-button @click="toggleCollapse">{{editName}}</el-button>
</el-form-item> </el-form-item>
<el-form-item label="设备分组" prop="deviceGroupId"> </el-col>
<el-select v-model="queryParams.deviceGroupId" placeholder="请选择设备分组ID" clearable> </el-row>
<el-option label="请添加设备分组" value="" />
</el-select>
</el-form-item>
</div> </div>
</el-collapse-transition> </el-collapse-transition>
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
<el-button @click="toggleCollapse">{{editName}}</el-button>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">

Loading…
Cancel
Save