Browse Source

参数页面bug修复

pull/1/head
ljlong_2630 2 years ago
parent
commit
8dbf99f8ba
  1. 9
      src/api/model/paramclass.js
  2. 25
      src/views/model/alert/deviceparamalert.vue
  3. 9
      src/views/model/params/index.vue

9
src/api/model/paramclass.js

@ -51,3 +51,12 @@ export function exportParamclass(query) {
params: query params: query
}) })
} }
// 查询参数模型信息列表
export function listParamclassNoPage(query) {
return request({
url: '/model/dcModelParamclass/listNoPage',
method: 'get',
params: query
})
}

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

@ -89,7 +89,7 @@
<el-table-column label="中台设备ID" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false"> <el-table-column label="中台设备ID" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false">
<template #header> <template #header>
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> <div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns">
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> <span style="text-align: center;display: block;">中台设备ID<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -121,7 +121,7 @@
<el-button <el-button
type="text" type="text"
icon="Delete" icon="Delete"
@click="handleDelete(scope.row)" @click="handleDeleteByRow(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -649,6 +649,27 @@ function handleDelete() {
}).catch(() => {}); }).catch(() => {});
} }
function handleDeleteByRow(row) {
let rows = [];
let names = "";
let _ids = [];
rows.push(row);
rows.forEach(item=>{
_ids.push(item.id);
if(names == ""){
names = item.deviceName + item.paramName;
}else{
names = names + "," + item.deviceName + item.paramName;
}
})
proxy.$modal.confirm('是否确认删除设备参数名称为"' + names + '"的数据项?').then(function() {
return delAlert(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 删除按钮操作 */ /** 删除按钮操作 */
function handleDeleteRow(row) { function handleDeleteRow(row) {
const _ids = row.id || ids.value; const _ids = row.id || ids.value;

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

@ -375,7 +375,7 @@
</style> </style>
<script setup name="Params"> <script setup name="Params">
import { listParams, getParams, delParams, addParams, updateParams,listWithFilterColumn } from "@/api/model/params"; import { listParams, getParams, delParams, addParams, updateParams,listWithFilterColumn } from "@/api/model/params";
import { listParamclass } from "@/api/model/paramclass"; import { listParamclassNoPage } from "@/api/model/paramclass";
import lock from "@/assets/icons/svg/lock.svg"; import lock from "@/assets/icons/svg/lock.svg";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const router = useRouter(); const router = useRouter();
@ -658,12 +658,15 @@ function handleExport() {
} }
function getParamModel() { function getParamModel() {
listParamclass({}).then(response => { listParamclassNoPage({}).then(response => {
paramClassList.value = response.rows; paramClassList.value = response.data;
}); });
} }
function getParamModelName(id){ function getParamModelName(id){
if(paramClassList.value.length == 0){
return;
}
paramClassList.value.forEach(item=>{ paramClassList.value.forEach(item=>{
if(item.id == id){ if(item.id == id){
return item.getParamModelName; return item.getParamModelName;

Loading…
Cancel
Save