Browse Source

修复bug第3波

pull/1/head
ljlong_2630 1 year ago
parent
commit
f2c949eee1
  1. 11
      src/api/model/logicconfig.js
  2. 9
      src/api/model/method.js
  3. 10
      src/views/flowable/params/index.vue
  4. 124
      src/views/model/alert/deviceparamalert.vue
  5. 48
      src/views/model/alert/logicconfig.vue
  6. 29
      src/views/model/alert/method.vue
  7. 20
      src/views/model/alert/model.vue
  8. 56
      src/views/model/alert/policy.vue
  9. 48
      src/views/model/params/index.vue

11
src/api/model/logicconfig.js

@ -51,3 +51,14 @@ export function exportLogicconfig(query) {
params: query params: query
}) })
} }
// 查询告警逻辑列表
export function listLogicconfigNoPage(query) {
return request({
url: '/model/dcBusiAlertLogicConfig/listNoPage',
method: 'get',
params: query
})
}

9
src/api/model/method.js

@ -51,3 +51,12 @@ export function exportMethod(query) {
params: query params: query
}) })
} }
// 查询告警方式列表
export function listMethodNoPage(query) {
return request({
url: '/model/dcBusiAlertMethod/listNoPage',
method: 'get',
params: query
})
}

10
src/views/flowable/params/index.vue

@ -1,10 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="中台设备UUID" prop="deviceUuid"> <el-form-item label="中台设备编码" prop="deviceUuid">
<el-input <el-input
v-model="queryParams.deviceUuid" v-model="queryParams.deviceUuid"
placeholder="请输入中台设备UUID" placeholder="请输入中台设备编码"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
@ -151,7 +151,7 @@
<el-table v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="paramsList" @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="中台设备UUID" align="center" prop="deviceUuid" /> <el-table-column label="中台设备编码" align="center" prop="deviceUuid" />
<el-table-column label="参数名称" align="center" prop="paramName" /> <el-table-column label="参数名称" align="center" prop="paramName" />
<el-table-column label="参数编码" align="center" prop="paramCode" /> <el-table-column label="参数编码" align="center" prop="paramCode" />
<el-table-column label="数据类型" align="center" prop="paramType"> <el-table-column label="数据类型" align="center" prop="paramType">
@ -204,8 +204,8 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="中台设备UUID" prop="deviceUuid"> <el-form-item label="中台设备编码" prop="deviceUuid">
<el-input v-model="form.deviceUuid" placeholder="请输入中台设备UUID" /> <el-input v-model="form.deviceUuid" placeholder="请输入中台设备编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">

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

@ -115,13 +115,13 @@
<template #default="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
icon="Delete" icon="Edit"
@click="handlePolicy(scope.row)" @click="handlePolicy(scope.row)"
>维护告警策略</el-button> >维护告警策略</el-button>
<el-button <el-button
type="text" type="text"
icon="Delete" icon="Delete"
@click="handleDeleteByRow(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -196,7 +196,6 @@
<el-row> <el-row>
<el-col :span="12" v-show="boolValueVisiable"> <el-col :span="12" v-show="boolValueVisiable">
<el-form-item label="告警值" prop="boolValue"> <el-form-item label="告警值" prop="boolValue">
<!-- <el-input v-model="formPolicy.boolValue" placeholder="请输入开始值" /> -->
<el-select v-model="formPolicy.boolValue" placeholder="请选择是否告警"> <el-select v-model="formPolicy.boolValue" placeholder="请选择是否告警">
<el-option <el-option
v-for="item in alert_value" v-for="item in alert_value"
@ -376,6 +375,7 @@ const paramTip = ref("请先选择设备");
const paramDisabled = ref(false); const paramDisabled = ref(false);
const partionDisabled = ref(false); const partionDisabled = ref(false);
const submitDisabled = ref(true); const submitDisabled = ref(true);
const names = ref([]);
const alert_value = ref([ const 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}
@ -415,7 +415,7 @@ const data = reactive({
}, },
rules: { rules: {
deviceUuid: [ deviceUuid: [
{ required: true, message: "中台设备UUID不能为空", trigger: "blur" } { required: true, message: "中台设备编码不能为空", trigger: "blur" }
], ],
paramCode: [ paramCode: [
{ required: true, message: "参数编码不能为空", trigger: "blur" } { required: true, message: "参数编码不能为空", trigger: "blur" }
@ -426,7 +426,7 @@ const data = reactive({
}, },
rulesPolicy: { rulesPolicy: {
deviceUuid: [ deviceUuid: [
{ required: true, message: "中台设备UUID不能为空", trigger: "blur" } { required: true, message: "中台设备编码不能为空", trigger: "blur" }
], ],
paramCode: [ paramCode: [
{ required: true, message: "参数编码不能为空", trigger: "blur" } { required: true, message: "参数编码不能为空", trigger: "blur" }
@ -527,6 +527,8 @@ function resetQuery() {
// //
function handleSelectionChange(selection) { function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
names.value = selection.map(item => item.deviceName + "-" + item.paramName);
selection.forEach(item=>{ selection.forEach(item=>{
if(!rowPolicySelected.value.includes(item)){ if(!rowPolicySelected.value.includes(item)){
handleValueChange(item); handleValueChange(item);
@ -628,57 +630,66 @@ function submitForm() {
}); });
} }
/** 删除按钮操作 */ // /** */
function handleDelete() { // function handleDelete() {
const rows = proxy.$refs.deviceParamsTable.getSelectionRows(); // const rows = proxy.$refs.deviceParamsTable.getSelectionRows();
let names = ""; // let names = "";
let _ids = []; // let _ids = [];
rows.forEach(item=>{ // rows.forEach(item=>{
_ids.push(item.id); // _ids.push(item.id);
if(names == ""){ // if(names == ""){
names = item.deviceName + item.paramName; // names = item.deviceName + item.paramName;
}else{ // }else{
names = names + "," + item.deviceName + item.paramName; // names = names + "," + item.deviceName + item.paramName;
} // }
}) // })
proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() { // proxy.$modal.confirm('"' + names + '"').then(function() {
return delAlert(_ids); // return delAlert(_ids);
}).then(() => { // }).then(() => {
getList(); // getList();
proxy.$modal.msgSuccess("删除成功"); // proxy.$modal.msgSuccess("");
}).catch(() => {}); // }).catch(() => {});
} // }
function handleDeleteByRow(row) { // function handleDeleteByRow(row) {
let rows = []; // let rows = [];
let names = ""; // let names = "";
let _ids = []; // let _ids = [];
rows.push(row); // rows.push(row);
rows.forEach(item=>{ // rows.forEach(item=>{
_ids.push(item.id); // _ids.push(item.id);
if(names == ""){ // if(names == ""){
names = item.deviceName + item.paramName; // names = item.deviceName + item.paramName;
}else{ // }else{
names = names + "," + item.deviceName + item.paramName; // names = names + "," + item.deviceName + item.paramName;
} // }
}) // })
proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() { // proxy.$modal.confirm('"' + names + '"').then(function() {
return delAlert(_ids); // return delAlert(_ids);
}).then(() => { // }).then(() => {
getList(); // getList();
proxy.$modal.msgSuccess("删除成功"); // proxy.$modal.msgSuccess("");
}).catch(() => {}); // }).catch(() => {});
} // }
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDeleteRow(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){
return delAlert(_ids); ElMessageBox.alert('请先选择需要删除的记录', '提示', {
confirmButtonText: '确定',
center: true,
})
return;
}
const _names = row.deviceName?row.deviceName + "-" + row.paramName : names.value;
proxy.$modal.confirm('是否确认删除"' + _names + '"的告警策略?').then(function() {
return delLogicconfig(_ids);
}).then(() => { }).then(() => {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -698,6 +709,7 @@ function getDeviceList(){
function getParamsListDevice(deviceUuid){ function getParamsListDevice(deviceUuid){
loading.value = true; loading.value = true;
form.value.partion = null;
queryParamsParam.value.deviceUuid = deviceUuid; queryParamsParam.value.deviceUuid = deviceUuid;
if(queryParamsParam.value.partion == null){ if(queryParamsParam.value.partion == null){
partionDisabled.value = true; partionDisabled.value = true;
@ -713,6 +725,7 @@ function getParamsListDevice(deviceUuid){
} }
function getParamsListPartion(partion){ function getParamsListPartion(partion){
loading.value = true; loading.value = true;
form.value.paramCode = null;
queryParamsParam.value.partion = partion; queryParamsParam.value.partion = partion;
if(queryParamsParam.value.deviceUuid == null){ if(queryParamsParam.value.deviceUuid == null){
paramTip.value = "请先选择设备"; paramTip.value = "请先选择设备";
@ -1018,7 +1031,16 @@ function setParamsType(val){
// //
function handleValueChange(row){ function handleValueChange(row){
let flag = true; let flag = true;
let needJudgeFlag = false;
const selectedRowsNow = proxy.$refs.policyTable.getSelectionRows(); const selectedRowsNow = proxy.$refs.policyTable.getSelectionRows();
selectedRowsNow.forEach(item=>{
if(item.id == row.id){
needJudgeFlag = true
}
})
if(!needJudgeFlag){
return;
}
if(selectedRowsNow.length>0){ if(selectedRowsNow.length>0){
selectedRowsNow.forEach(item=>{ selectedRowsNow.forEach(item=>{
if(item.sort < row.sort){ if(item.sort < row.sort){
@ -1052,9 +1074,9 @@ function judgeIfRightValue(){
if(!handleValueChangeSub(item)){ if(!handleValueChangeSub(item)){
flag = false; flag = false;
}; };
// if(item.value === '' || item.methodIds == null || item.methodIds.length === 0){ if(item.value === ''){
// flag = false; flag = false;
// } }
}) })
} }
return flag; return flag;

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

@ -167,7 +167,7 @@
@import "@/assets/styles/self-defined.scss"; @import "@/assets/styles/self-defined.scss";
</style> </style>
<script setup name="Logicconfig"> <script setup name="Logicconfig">
import { listLogicconfig, getLogicconfig, delLogicconfig, addLogicconfig, updateLogicconfig } from "@/api/model/logicconfig"; import { listLogicconfig, getLogicconfig, delLogicconfig, addLogicconfig, updateLogicconfig,listLogicconfigNoPage } from "@/api/model/logicconfig";
import lock from "@/assets/icons/svg/lock.svg"; import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -199,6 +199,12 @@ const data = reactive({
note: null note: null
}, },
rules: { rules: {
logicCode: [
{ required: true, message: "告警方式名称不能为空", trigger: "blur" }
],
paramValueType: [
{ required: true, message: "告警方式是否有效不能为空", trigger: "blur" }
],
} }
}); });
@ -304,18 +310,42 @@ function handleUpdate(row) {
function submitForm() { function submitForm() {
proxy.$refs["logicconfigRef"].validate(valid => { proxy.$refs["logicconfigRef"].validate(valid => {
if (valid) { if (valid) {
let param = {"paramValueType":form.value.paramValueType};
if (form.value.id != null) { if (form.value.id != null) {
updateLogicconfig(form.value).then(response => { listLogicconfigNoPage(param).then(response => {
proxy.$modal.msgSuccess("修改成功"); const result = response.data;
open.value = false; const newArray = result.filter(item => item.id !== form.value.id);
getList(); if (newArray?.length > 0) {
ElMessageBox.alert('存在相同参数类型,请修改', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
listLogicconfigNoPage(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
}
}); });
} else { } else {
addLogicconfig(form.value).then(response => { listLogicconfig(param).then(response => {
proxy.$modal.msgSuccess("新增成功"); const result = response.data;
open.value = false; const newArray = result.filter(item => item.id !== form.value.id);
getList(); if (newArray?.length > 0) {
ElMessageBox.alert('存在相同参数类型,请修改', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
addLogicconfig(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}); });
} }
} }
}); });

29
src/views/model/alert/method.vue

@ -141,7 +141,7 @@
@import "@/assets/styles/self-defined.scss"; @import "@/assets/styles/self-defined.scss";
</style> </style>
<script setup name="Method"> <script setup name="Method">
import { listMethod, getMethod, delMethod, addMethod, updateMethod } from "@/api/model/method"; import { listMethod, getMethod, delMethod, addMethod, updateMethod, listMethodNoPage } from "@/api/model/method";
import lock from "@/assets/icons/svg/lock.svg"; import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus'; import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -281,17 +281,27 @@ function handleUpdate(row) {
function submitForm() { function submitForm() {
proxy.$refs["methodRef"].validate(valid => { proxy.$refs["methodRef"].validate(valid => {
if (valid) { if (valid) {
let param = {"methodName":form.value.methodName};
if (form.value.id != null) { if (form.value.id != null) {
updateMethod(form.value).then(response => { listMethodNoPage(param).then(response => {
proxy.$modal.msgSuccess("修改成功"); const result = response.data;
open.value = false; if(result?.length > 0){
getList(); ElMessageBox.alert('该告警方式名称重复', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
updateMethod(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
}
}); });
} else { } else {
let param = {"methodName":form.value.methodName}; listMethodNoPage(param).then(response => {
listMethod(param).then(response => { const result = response.data;
total.value = response.total; if(result?.length > 0){
if(response.total > 0){
ElMessageBox.alert('该告警方式名称重复', '提示', { ElMessageBox.alert('该告警方式名称重复', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
center: true, center: true,
@ -303,7 +313,6 @@ function submitForm() {
getList(); getList();
}); });
} }
}); });
} }

20
src/views/model/alert/model.vue

@ -579,19 +579,13 @@ function judgeIfRightValue(){
} }
function levelChange(value){ function levelChange(value){
if(form.value.paramType == '4'){ // if(form.value.paramType == '4'){
dc_alert_level.value.forEach(item=>{ // dc_alert_level.value.forEach(item=>{
if(item.value == value){ // if(item.value == value){
form.value.name = item.label // form.value.name = item.label
} // }
}) // })
}else{ // }
dc_alert_level.value.forEach(item=>{
if(item.value == value){
form.value.name = item.label
}
})
}
} }

56
src/views/model/alert/policy.vue

@ -35,10 +35,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" v-show="collapseVisible"> <el-col :span="4" v-show="collapseVisible">
<el-form-item label="设备Id" prop="deviceId"> <el-form-item label="设备编号" prop="deviceId">
<el-input <el-input
v-model="queryParams.deviceId" v-model="queryParams.deviceId"
placeholder="请输入设备Id" placeholder="请输入设备编号"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
@ -67,10 +67,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" v-show="collapseVisible"> <el-col :span="4" v-show="collapseVisible">
<el-form-item label="是否告警" prop="alertFlag"> <el-form-item label="是否告警" prop="enabled">
<el-select v-model="queryParams.alertFlag" placeholder="请选择是否告警" clearable> <el-select v-model="queryParams.enabled" placeholder="请选择是否告警" clearable>
<el-option <el-option
v-for="item in alertFlag" v-for="item in enabled"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@ -100,12 +100,12 @@
</el-col> </el-col>
<el-col :span="4" v-show="collapseVisible"> <el-col :span="4" v-show="collapseVisible">
<el-form-item label="开关值" prop="boolValue"> <el-form-item label="开关值" prop="boolValue">
<el-select v-model="form.value" placeholder="请选择开关值"> <el-select v-model="queryParams.boolValue" placeholder="请选择开关值">
<el-option <el-option
v-for="dict in dc_alert_value" v-for="dict in dc_alert_value"
:key="dict.label" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="parseFloat(dict.label)" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -130,7 +130,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" v-show="collapseVisible"> <!-- <el-col :span="4" v-show="collapseVisible">
<el-form-item label="状态值" prop="statusValue"> <el-form-item label="状态值" prop="statusValue">
<el-input <el-input
v-model="queryParams.statusValue" v-model="queryParams.statusValue"
@ -146,8 +146,8 @@
<el-option label="请选择字典生成" value="" /> <el-option label="请选择字典生成" value="" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="4" v-show="collapseVisible"> <!-- <el-col :span="4" v-show="collapseVisible">
<el-form-item label="中台设备ID" prop="deviceId"> <el-form-item label="中台设备ID" prop="deviceId">
<el-input <el-input
v-model="queryParams.deviceId" v-model="queryParams.deviceId"
@ -156,7 +156,7 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="4" v-show="collapseVisible"> <el-col :span="4" v-show="collapseVisible">
<el-form-item label="排序" prop="sortId"> <el-form-item label="排序" prop="sortId">
<el-input-number v-model="queryParams.sortId" :min="1" :max="1000" /> <el-input-number v-model="queryParams.sortId" :min="1" :max="1000" />
@ -205,18 +205,18 @@
</el-table-column> </el-table-column>
<el-table-column label="字符值" align="center" prop="stringValue" /> <el-table-column label="字符值" align="center" prop="stringValue" />
<!-- <el-table-column label="结束值" align="center" prop="endValue" /> --> <!-- <el-table-column label="结束值" align="center" prop="endValue" /> -->
<el-table-column label="是否告警" align="center" prop="alertFlag" > <el-table-column label="是否告警" align="center" prop="enabled" >
<template #default="scope"> <template #default="scope">
<dict-tag :options="alertFlag" :value="scope.row.alertFlag"/> <dict-tag :options="enabledTable" :value="scope.row.enabled"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="策略ID" align="center" prop="alertId" /> <el-table-column label="策略ID" align="center" prop="alertId" />
<el-table-column label="状态值" align="center" prop="statusValue" /> <!-- <el-table-column label="状态值" align="center" prop="statusValue" /> -->
<el-table-column label="状态类型" align="center" prop="statusType" > <!-- <el-table-column label="状态类型" align="center" prop="statusType" >
<template #default="scope"> <template #default="scope">
<dict-tag :options="statusType" :value="scope.row.statusType"/> <dict-tag :options="statusType" :value="scope.row.statusType"/>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="排序" align="center" prop="sortId" /> <el-table-column label="排序" align="center" prop="sortId" />
<el-table-column label="告警方式" align="center" prop="methodIds" > <el-table-column label="告警方式" align="center" prop="methodIds" >
<template #default="scope"> <template #default="scope">
@ -244,10 +244,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否告警" prop="alertFlag"> <el-form-item label="是否告警" prop="enabled">
<el-select v-model="form.alertFlag" placeholder="请选择是否告警"> <el-select v-model="form.enabled" placeholder="请选择是否告警">
<el-option <el-option
v-for="item in alertFlag" v-for="item in enabled"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@ -309,7 +309,7 @@ import { selectDeviceParamPolicy, listPolicy, getPolicy, delPolicy, addPolicy, u
import { listMethod } from "@/api/model/method"; import { listMethod } from "@/api/model/method";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const router = useRouter(); const router = useRouter();
const { dc_param_value_type,dc_bool_value } = proxy.useDict('dc_param_value_type','dc_bool_value'); const { dc_param_value_type,dc_alert_value } = proxy.useDict('dc_param_value_type','dc_alert_value');
const policyList = ref([]); const policyList = ref([]);
const open = ref(false); const open = ref(false);
const loading = ref(true); const loading = ref(true);
@ -328,9 +328,13 @@ const queryParamFilter = ref({});
const sortProps = ref([]); const sortProps = ref([]);
const collapseVisible = ref(false); const collapseVisible = ref(false);
const editName = ref("更多筛选项"); const editName = ref("更多筛选项");
const alertFlag = ref([ const enabled = ref([
{label: '告警', value: 'true', elTagType: 'default', elTagClass: null}, {label: '告警', value: 1, elTagType: 'default', elTagClass: null},
{label: '不告警', value: 'false', elTagType: 'default', elTagClass: null} {label: '不告警', value: 0, elTagType: 'default', elTagClass: null}
]);
const enabledTable = ref([
{label: '告警', value: '1', elTagType: 'default', elTagClass: null},
{label: '不告警', value: '0', elTagType: 'default', elTagClass: null}
]); ]);
const statusType = ref([ const statusType = ref([
{label: '状态1', value: '1', elTagType: 'default', elTagClass: null}, {label: '状态1', value: '1', elTagType: 'default', elTagClass: null},
@ -361,7 +365,9 @@ const { queryParams, form, rules } = toRefs(data);
function getList() { function getList() {
loading.value = true; loading.value = true;
queryParams.value.deviceId = deviceUuid; queryParams.value.deviceId = deviceUuid;
selectDeviceParamPolicy(queryParams.value).then(response => { let paramForSearch = {...queryParams.value};
paramForSearch.methodIds = paramForSearch?.methodIds?.join(',');
selectDeviceParamPolicy(paramForSearch).then(response => {
policyList.value = response.rows; policyList.value = response.rows;
total.value = response.total; total.value = response.total;
loading.value = false; loading.value = false;

48
src/views/model/params/index.vue

@ -3,10 +3,10 @@
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px" class="my-custom-form"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px" class="my-custom-form">
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="中台设备UUID" prop="deviceUuid"> <el-form-item label="中台设备编码" prop="deviceUuid">
<el-input <el-input
v-model="queryParams.deviceUuid" v-model="queryParams.deviceUuid"
placeholder="请输入中台设备UUID" placeholder="请输入中台设备编码"
:disabled="uuidDisabled" :disabled="uuidDisabled"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
@ -100,28 +100,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" v-show="collapseVisible"> <el-col :span="4" v-show="collapseVisible">
<el-form-item label="验证范围" prop="validateScope"> <el-form-item label="参数模版" prop="paramModelId">
<el-input <el-select v-model="queryParams.paramModelId" placeholder="请选择参数模版" clearable>
v-model="queryParams.validateScope"
placeholder="请输入验证范围"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4" v-show="collapseVisible">
<el-form-item label="全局统一编码" prop="globalCode">
<el-input
v-model="queryParams.globalCode"
placeholder="请输入全局统一编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4" v-show="collapseVisible">
<el-form-item label="参数模版ID" prop="paramModelId">
<el-select v-model="queryParams.paramModelId" placeholder="请选择参数模版ID" clearable>
<el-option <el-option
v-for="dict in paramClassList" v-for="dict in paramClassList"
:label="dict.paramClassName" :label="dict.paramClassName"
@ -196,7 +176,7 @@
<el-table ref="deviceParamTable" v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange" @sort-change="sortChange" @filter-change="filterChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> <el-table ref="deviceParamTable" v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange" @sort-change="sortChange" @filter-change="filterChange" :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="中台设备UUID" align="center" prop="deviceUuid" :width="120"/> --> <el-table-column label="中台设备编码" align="center" prop="deviceUuid" :width="120"/> -->
<el-table-column label="参数名称" align="center" prop="paramName" :width="130" sortable/> <el-table-column label="参数名称" align="center" prop="paramName" :width="130" sortable/>
<el-table-column label="参数编码" align="center" prop="paramCode" :width="120" sortable/> <el-table-column label="参数编码" align="center" prop="paramCode" :width="120" sortable/>
<el-table-column label="数据类型" align="center" prop="paramType" column-key="paramType" filter-placement="bottom-end" <el-table-column label="数据类型" align="center" prop="paramType" column-key="paramType" filter-placement="bottom-end"
@ -217,7 +197,7 @@
<dict-tag :options="enabledTable" :value="scope.row.enabled"/> <dict-tag :options="enabledTable" :value="scope.row.enabled"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计算单位" align="center" prop="contrlType" column-key="contrlType" filter-placement="bottom-end" <el-table-column label="参数单位" align="center" prop="contrlType" column-key="contrlType" filter-placement="bottom-end"
:filters="getfilterNameItem('contrlType')" :filter-method="filterMethod" :width="120" sortable :filters="getfilterNameItem('contrlType')" :filter-method="filterMethod" :width="120" sortable
> >
<template #default="scope"> <template #default="scope">
@ -313,6 +293,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="参数单位" prop="contrlType">
<el-select v-model="form.contrlType" placeholder="请选择参数单位">
<el-option
v-for="dict in dc_param_uint_type"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否可控" prop="contrlFlag"> <el-form-item label="是否可控" prop="contrlFlag">
<el-select v-model="form.contrlFlag" placeholder="请选择是否可控"> <el-select v-model="form.contrlFlag" placeholder="请选择是否可控">
@ -463,7 +455,7 @@ const data = reactive({
}, },
rules: { rules: {
deviceUuid: [ deviceUuid: [
{ required: true, message: "中台设备UUID不能为空", trigger: "blur" } { required: true, message: "中台设备编码不能为空", trigger: "blur" }
], ],
paramName: [ paramName: [
{ required: true, message: "参数名称不能为空", trigger: "blur" } { required: true, message: "参数名称不能为空", trigger: "blur" }
@ -712,6 +704,7 @@ function getParamModelName(id){
function checkedParamModel(val){ function checkedParamModel(val){
paramClassList.value.forEach(item=>{ paramClassList.value.forEach(item=>{
form.value.contrlType = item.paramUnit;
if(item.paramClassCode == val){ if(item.paramClassCode == val){
paramClassCodeSeleted.value = item.paramClassCode; paramClassCodeSeleted.value = item.paramClassCode;
if(form.value.partion !== undefined && form.value.partion !== null && form.value.partion !== ""){ if(form.value.partion !== undefined && form.value.partion !== null && form.value.partion !== ""){
@ -720,6 +713,7 @@ function checkedParamModel(val){
}else{ }else{
hintMessage.value = "请选择分区"; hintMessage.value = "请选择分区";
} }
return; return;
} }
}) })

Loading…
Cancel
Save