Browse Source

测试bug修复第4波

pull/1/head
ljlong_2630 1 year ago
parent
commit
3bd4b42355
  1. 63
      src/views/model/alert/deviceparamalert.vue
  2. 4
      src/views/model/alert/logicconfig.vue
  3. 3
      src/views/model/alert/method.vue
  4. 2
      src/views/model/alert/noalertparams.vue
  5. 10
      src/views/model/alert/policy.vue
  6. 10
      src/views/model/device/index.vue
  7. 50
      src/views/model/paramclass/index.vue
  8. 59
      src/views/model/params/index.vue

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

@ -3,10 +3,10 @@
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px" class="my-custom-form">
<el-row>
<el-col :span="4">
<el-form-item label="中台设备ID" prop="deviceUuid">
<el-form-item label="设备编号" prop="deviceUuid">
<el-input
v-model="queryParams.deviceUuid"
placeholder="请输入中台设备ID"
placeholder="请输入设备编号"
clearable
@keyup.enter="handleQuery"
/>
@ -86,10 +86,10 @@
<el-table ref="deviceParamsTable" v-loading="loading" :data="alertList" @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 label="主键" align="center" prop="id" /> -->
<el-table-column label="中台设备ID" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false">
<el-table-column label="设备编号" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false">
<template #header>
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns">
<span style="text-align: center;display: block;">中台设备ID<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span>
<span style="text-align: center;display: block;">设备编号<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span>
</div>
</template>
</el-table-column>
@ -273,7 +273,7 @@
</el-row>
<el-row v-show="tableVisiable">
<el-col>
<el-table ref="policyTable" v-loading="loading" :data="modelList" :row-key="getRowKey" @selection-change="handleSelectionChange" >
<el-table ref="policyTable" v-loading="loading" :data="modelList" :row-key="getRowKey" >
<el-table-column type="selection" reserve-selection="true" width="55" align="center" fixed="left" />
<el-table-column label="名称" align="center" prop="name"/>
<el-table-column label="符号" align="center" prop="code" :width="120"/>
@ -305,7 +305,6 @@
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
@ -612,18 +611,41 @@ function handlePolicy(row) {
function submitForm() {
proxy.$refs["alertRef"].validate(valid => {
if (valid) {
let param = {"deviceUuid":form.value.deviceUuid,"paramCode":form.value.paramCode};
if (form.value.id != null) {
updateAlert(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
getDeviceParamsAlertInfo(param).then(response => {
const result = response.rows;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该告警方式名称重复', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
updateAlert(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
}
});
} else {
addAlert(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
handlePolicy(response.data);
getDeviceParamsAlertInfo(param).then(response => {
const result = response.rows;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该告警方式名称重复', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
addAlert(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
handlePolicy(response.data);
});
}
});
}
}
@ -684,12 +706,11 @@ function handleDelete(row) {
}
const _names = row.deviceName?row.deviceName + "-" + row.paramName : names.value;
proxy.$modal.confirm('是否确认删除"' + _names + '"的告警策略?').then(function() {
return delLogicconfig(_ids);
return delAlert(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
@ -859,11 +880,13 @@ function getModelList(row){
queryModel.value.logicCode = row.logicCode;
queryModel.value.paramType = row.paramType;
listModelEnabledNoPage(queryModel.value).then(response => {
modelList.value = response.data;
formPolicy.value.alertId = row.id;
formPolicy.value.deviceId = row.deviceUuid;
proxy.$refs.policyTable.clearSelection();
listPolicyInfo(queryPolicy.value).then(responsePolicy=>{
//
if(responsePolicy.data && responsePolicy.data.length>0){
oldPolicyRows.value = responsePolicy.data;
@ -872,6 +895,7 @@ function getModelList(row){
formPolicy.value.id = responsePolicy.data[0].id;
modelList.value.map(element=>{
responsePolicy.data.forEach(item=>{
if(item.alertModelId == element.id){
// policyDeviceUuid.value = item.deviceId;
// policyAlertId.value = item.alertId;
@ -893,8 +917,6 @@ function getModelList(row){
element.id = item.alertModelId;
proxy.$refs.policyTable.toggleRowSelection(element,true);
return element;
}else{
element.id = null;
}
})
})
@ -919,6 +941,7 @@ function mapFormTable(){
}else if(paramTypeValue.value == '1'){
policyParam.intValue = item.value;
}
policyParam.level = item.level;
policyParam.alertModelId = item.id;
policyParam.name = item.name;
@ -947,6 +970,7 @@ function mapFormTableUpdate(){
}else if(paramTypeValue.value == '1'){
policyParam.intValue = item.value;
}
policyParam.level = item.level;
policyParam.alertModelId = item.id;
policyParam.name = item.name;
@ -1195,7 +1219,6 @@ function levelChange(value){
}
})
}
}
function toggleFixedColumns() {

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

@ -321,7 +321,7 @@ function submitForm() {
center: true,
})
}else{
listLogicconfigNoPage(form.value).then(response => {
updateLogicconfig(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
@ -329,7 +329,7 @@ function submitForm() {
}
});
} else {
listLogicconfig(param).then(response => {
listLogicconfigNoPage(param).then(response => {
const result = response.data;
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {

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

@ -285,7 +285,8 @@ function submitForm() {
if (form.value.id != null) {
listMethodNoPage(param).then(response => {
const result = response.data;
if(result?.length > 0){
const newArray = result.filter(item => item.id !== form.value.id);
if (newArray?.length > 0) {
ElMessageBox.alert('该告警方式名称重复', '提示', {
confirmButtonText: '确定',
center: true,

2
src/views/model/alert/noalertparams.vue

@ -63,7 +63,7 @@
<el-table ref="addAlertTable" v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="中台设备ID" align="center" prop="deviceUuid" :width="120"/>
<el-table-column label="设备编号" align="center" prop="deviceUuid" :width="120"/>
<el-table-column label="中台设备" align="center" prop="deviceName" :width="120"/>
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/>
<el-table-column label="参数编码" align="center" prop="paramCode" :width="120"/>

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

@ -148,10 +148,10 @@
</el-form-item>
</el-col> -->
<!-- <el-col :span="4" v-show="collapseVisible">
<el-form-item label="中台设备ID" prop="deviceId">
<el-form-item label="设备编号" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入中台设备ID"
placeholder="请输入设备编号"
clearable
@keyup.enter="handleQuery"
/>
@ -188,7 +188,7 @@
<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="deviceName" :width="120"/>
<el-table-column label="中台设备ID" align="center" prop="deviceId" />
<el-table-column label="设备编号" align="center" prop="deviceId" />
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/>
<el-table-column label="参数编码" align="center" prop="paramCode" />
<el-table-column label="数据类型" align="center" prop="paramType" :width="120">
@ -451,8 +451,10 @@ function submitForm() {
/** 导出按钮操作 */
function handleExport() {
let paramForSearch = {...queryParams.value};
paramForSearch.methodIds = paramForSearch?.methodIds?.join(',');
proxy.download('model/dcBusiAlertParamPolicy/export', {
...queryParams.value
...paramForSearch
}, `policy_${new Date().getTime()}.xlsx`)
}

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

@ -241,7 +241,7 @@
<el-table-column label="设备模型" align="center" prop="deviceModelId" :width="120" column-key="deviceModelId" filter-placement="bottom-end"
:filters="getfilterNameItem('deviceModelId')" :filter-method="filterMethod" sortable>
</el-table-column>
<el-table-column label="租户号" align="center" prop="tentantId" :width="120" sortable/>
<!-- <el-table-column label="租户号" align="center" prop="tentantId" :width="120" sortable/> -->
<el-table-column label="设备分组" align="center" prop="deviceGroupName" :width="150" column-key="deviceGroupName" filter-placement="bottom-end"
:filters="getfilterNameItem('deviceGroupName')" :filter-method="filterMethod" sortable/>
<el-table-column label="设备排序" align="center" prop="sort" :width="120" sortable/>
@ -409,11 +409,11 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="租户号" prop="tentantId">
<el-input v-model="form.tentantId" placeholder="请输入租户号" />
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item label="设备分组" prop="deviceGroupName">
<el-select v-model="form.deviceGroupName" placeholder="请选择设备分组ID">
@ -423,7 +423,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="设备排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入租户号" />
<el-input v-model="form.sort" placeholder="请输入设备排序" />
</el-form-item>
</el-col>
</el-row>
@ -729,7 +729,7 @@ function submitForm() {
listWithFilterColumn(param).then(response => {
let total = response.data.tableData.total;
if(total > 0){
ElMessageBox.alert('设备中台uuid不能重复', '提示', {
ElMessageBox.alert('设备uuid不能重复', '提示', {
confirmButtonText: '确定',
center: true,
})

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

@ -53,10 +53,6 @@
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
@ -174,6 +170,11 @@
</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>
@ -192,9 +193,9 @@
<script setup name="Paramclass">
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass } from "@/api/model/paramclass";
import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance();
const { dc_class_type, dc_param_uint_type } = proxy.useDict('dc_class_type', 'dc_param_uint_type');
const paramclassList = ref([]);
const open = ref(false);
const loading = ref(true);
@ -210,6 +211,7 @@ const sortItemMap = ref({});
const queryParamFilter = ref({});
const sortProps = ref([]);
const collapseVisible = ref(false);
const names = ref([]);
const data = reactive({
form: {},
queryParams: {
@ -222,6 +224,18 @@ const data = reactive({
note: null,
},
rules: {
paramClassName: [
{ required: true, message: "参数模版名称不能为空", trigger: "blur" }
],
paramClassCode: [
{ required: true, message: "参数模版编码不能为空", trigger: "blur" }
],
classType: [
{ required: true, message: "参数类型不能为空", trigger: "blur" }
],
paramUnit: [
{ required: true, message: "单位不能为空", trigger: "blur" }
],
}
});
@ -281,6 +295,7 @@ function resetQuery() {
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
names.value = selection.map(item => item.paramClassName);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
@ -295,7 +310,20 @@ function handleAdd() {
/** 修改按钮操作 */
function handleUpdate(row) {
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;
}
getParamclass(_id).then(response => {
form.value = response.data;
open.value = true;
@ -327,7 +355,15 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
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.paramClassName || names.value;
proxy.$modal.confirm('是否确认删除参数模型名称为"' + _names + '"的数据项?').then(function() {
return delParamclass(_ids);
}).then(() => {
getList();

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

@ -256,8 +256,8 @@
<el-form ref="paramsRef" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="中台设备ID" prop="deviceUuid">
<el-input v-model="form.deviceUuid" placeholder="请输入中台设备ID" :disabled="deviceUuidDisabled"/>
<el-form-item label="设备编号" prop="deviceUuid">
<el-input v-model="form.deviceUuid" placeholder="请输入设备编号" :disabled="deviceUuidDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -267,7 +267,9 @@
</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 :disabled="paramModelDisabled" v-model="form.paramModelId" placeholder="请选择参数模版ID"
@change="checkedParamModel"
>
<el-option
v-for="dict in paramClassList"
:label="dict.paramClassName"
@ -350,7 +352,9 @@
</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 :disabled="partionDisabled" v-model="form.partion" placeholder="请选择分区(字典)"
@change="partionChange"
>
<el-option
v-for="dict in dc_device_partion"
:key="dict.value"
@ -484,9 +488,7 @@ const data = reactive({
partion: [
{ required: true, message: "分区(字典)不能为空", trigger: "change" }
],
plcAdr: [
{ required: true, message: "plc地址不能为空", trigger: "blur" }
],
},
});
@ -634,17 +636,44 @@ function handleUpdate(row) {
function submitForm() {
proxy.$refs["paramsRef"].validate(valid => {
if (valid) {
let param = {
"obj":{"paramCode":form.value.paramCode},
"params":new Object(),
"sort":[],
"pageNum": 1,
"pageSize": 10,
}
if (form.value.id != null) {
updateParams(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
listWithFilterColumn(param).then(response => {
const total = response.data.tableData.total;
if(total > 0){
ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
updateParams(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
}
});
} else {
addParams(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
listWithFilterColumn(param).then(response => {
const total = response.data.tableData.total;
if(total > 0){
ElMessageBox.alert('该参数编号已存在,请重新输入', '提示', {
confirmButtonText: '确定',
center: true,
})
}else{
addParams(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
});
}
}

Loading…
Cancel
Save