Browse Source

测试bug修复第6波

pull/1/head
ljlong_2630 1 year ago
parent
commit
c574fab55f
  1. 11
      src/api/model/method.js
  2. 9
      src/api/model/paramclass.js
  3. 16
      src/views/model/alert/deviceparamalert.vue
  4. 6
      src/views/model/alert/method.vue
  5. 6
      src/views/model/alert/policy.vue
  6. 2
      src/views/model/device/index.vue
  7. 50
      src/views/model/paramclass/index.vue
  8. 27
      src/views/model/params/index.vue

11
src/api/model/method.js

@ -59,4 +59,13 @@ export function listMethodNoPage(query) {
method: 'get',
params: query
})
}
}
// 查询告警方式列表为去重
export function listForJudgeRepetition(query) {
return request({
url: '/model/dcBusiAlertMethod/listForJudgeRepetition',
method: 'get',
params: query
})
}

9
src/api/model/paramclass.js

@ -59,4 +59,13 @@ export function listParamclassNoPage(query) {
method: 'get',
params: query
})
}
// 查询参数模型信息列表
export function listParamclassForRepetition(query) {
return request({
url: '/model/dcModelParamclass/listParamclassForRepetition',
method: 'get',
params: query
})
}

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

@ -232,7 +232,7 @@
</el-col>
<el-col :span="12" v-show="nameVisiable">
<el-form-item label="名称" prop="name">
<el-input disabled v-model="formPolicy.name" placeholder="请选择告警级别"/>
<el-input v-model="formPolicy.name" placeholder="请选择告警级别"/>
</el-form-item>
</el-col>
<el-col :span="12" v-show="sortIdVisiable">
@ -1212,13 +1212,13 @@ function changeEnabled(row){
}
function levelChange(value){
if(logicCode.value == 'A'){
dc_alert_level.value.forEach(item=>{
if(item.value == String(value)){
formPolicy.value.name = item.label
}
})
}
// if(logicCode.value == 'A'){
// dc_alert_level.value.forEach(item=>{
// if(item.value == String(value)){
// formPolicy.value.name = item.label
// }
// })
// }
}
function toggleFixedColumns() {

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

@ -141,7 +141,7 @@
@import "@/assets/styles/self-defined.scss";
</style>
<script setup name="Method">
import { listMethod, getMethod, delMethod, addMethod, updateMethod, listMethodNoPage } from "@/api/model/method";
import { listMethod, getMethod, delMethod, addMethod, updateMethod, listMethodNoPage,listForJudgeRepetition } from "@/api/model/method";
import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance();
@ -283,7 +283,7 @@ function submitForm() {
if (valid) {
let param = {"methodName":form.value.methodName};
if (form.value.id != null) {
listMethodNoPage(param).then(response => {
listForJudgeRepetition(param).then(response => {
const result = response.data;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
@ -300,7 +300,7 @@ function submitForm() {
}
});
} else {
listMethodNoPage(param).then(response => {
listForJudgeRepetition(param).then(response => {
const result = response.data;
if(result?.length > 0){
ElMessageBox.alert('该告警方式名称重复', '提示', {

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

@ -218,11 +218,15 @@
</template>
</el-table-column> -->
<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">
<span>{{ getMethodName(scope.row.methodIds) }}</span>
</template>
</el-table-column>
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="等级" align="center" prop="level" />
<el-table-column label="运算符" align="center" prop="operator" />
<el-table-column label="代码" align="center" prop="code" />
</el-table>
<pagination

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

@ -345,7 +345,7 @@
check-strictly :default-expand-all="true" @node-click="selectDept"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-show="false">
<el-form-item label="所属组织编码" prop="orgCode">
<el-input v-model="form.orgCode" placeholder="请选择组织名称" disabled/>
</el-form-item>

50
src/views/model/paramclass/index.vue

@ -63,13 +63,6 @@
@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"
@ -102,7 +95,7 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="note" />
<el-table-column label="主键" align="center" prop="id" />
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" :fixed="fixedColumns?'right':false">
<template #header>
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns">
@ -191,7 +184,7 @@
@import "@/assets/styles/self-defined.scss";
</style>
<script setup name="Paramclass">
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass } from "@/api/model/paramclass";
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass,listParamclassForRepetition } from "@/api/model/paramclass";
import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance();
@ -335,17 +328,40 @@ function handleUpdate(row) {
function submitForm() {
proxy.$refs["paramclassRef"].validate(valid => {
if (valid) {
const param = {"paramClassCode":form.value.paramClassCode};
if (form.value.id != null) {
updateParamclass(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
listParamclassForRepetition(param).then(response => {
const result = response.data;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该参数模版编号重复', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
updateParamclass(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
}
});
} else {
addParamclass(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
listParamclassForRepetition(param).then(response => {
const result = response.data;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该参数模版编号重复', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
addParamclass(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
});
}
}

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

@ -267,9 +267,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="参数模版" prop="paramModelId">
<el-select :disabled="paramModelDisabled" v-model="form.paramModelId" placeholder="请选择参数模版ID"
@change="checkedParamModel"
>
<el-select v-model="form.paramModelId" filterable placeholder="请选择参数模版ID" @change="paramModelChange">
<el-option
v-for="dict in paramClassList"
:label="dict.paramClassName"
@ -280,7 +278,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="参数编码" prop="paramCode">
<el-input v-model="form.paramCode" :placeholder="hintMessage" disabled/>
<el-input v-model="form.paramCode" :placeholder="hintMessage"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -352,9 +350,7 @@
</el-col> -->
<el-col :span="12">
<el-form-item label="分区(字典)" prop="partion">
<el-select :disabled="partionDisabled" v-model="form.partion" placeholder="请选择分区(字典)"
@change="partionChange"
>
<el-select v-model="form.partion" placeholder="请选择分区(字典)">
<el-option
v-for="dict in dc_device_partion"
:key="dict.value"
@ -645,8 +641,9 @@ function submitForm() {
}
if (form.value.id != null) {
listWithFilterColumn(param).then(response => {
const total = response.data.tableData.total;
if(total > 0){
const result = response.data.tableData.rows;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', {
confirmButtonText: '确定',
center: true,
@ -661,8 +658,9 @@ function submitForm() {
});
} else {
listWithFilterColumn(param).then(response => {
const total = response.data.tableData.total;
if(total > 0){
const result = response.data.tableData.rows;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', {
confirmButtonText: '确定',
center: true,
@ -940,6 +938,13 @@ function sortChange({column, prop, order }){
getList();
}
function paramModelChange(value){
paramClassList.value.forEach(item=>{
if(item.paramClassCode == value){
form.value.paramName = item.paramClassName
}
})
}
getList();

Loading…
Cancel
Save