Browse Source

优化推送信息搜索条件

develop
ljlong_2630 1 year ago
parent
commit
f21544ae13
  1. 3
      src/views/model/heatapiconf/heatMainOperatorLog.vue
  2. 53
      src/views/model/heatapiconf/heatSendContent.vue

3
src/views/model/heatapiconf/heatMainOperatorLog.vue

@ -171,8 +171,7 @@
<el-input v-model="form.excludeDevices" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.excludeDevices" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">

53
src/views/model/heatapiconf/heatSendContent.vue

@ -1,15 +1,15 @@
<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="设备编号" prop="deviceUuid"> <!-- <el-form-item label="设备编号" prop="deviceUuid">
<el-input <el-input
v-model="queryParams.deviceUuid" v-model="queryParams.deviceUuid"
placeholder="请输入设备编号" placeholder="请输入设备编号"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item> -->
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称模糊" prop="deviceName">
<el-input <el-input
v-model="queryParams.deviceName" v-model="queryParams.deviceName"
placeholder="请输入设备名称" placeholder="请输入设备名称"
@ -17,6 +17,17 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="设备名称多选" prop="deviceUuid">
<el-select v-model="queryParams.deviceUuid" placeholder="请选择设备" clearable multiple
class="custom-select">
<el-option
v-for="dict in listDeviceAll"
:key="dict.uuid"
:label="dict.deviceName"
:value="dict.uuid"
/>
</el-select>
</el-form-item>
<el-form-item label="参数编号" prop="paramCode"> <el-form-item label="参数编号" prop="paramCode">
<el-input <el-input
v-model="queryParams.paramCode" v-model="queryParams.paramCode"
@ -74,11 +85,21 @@
.blueTheButton{ .blueTheButton{
color:blue color:blue
} }
//
.custom-select {
display: inline-block;
overflow: hidden;
width: 100%;
}
.app-container .el-select__tags {
white-space: nowrap!important;
}
</style> </style>
<script setup> <script setup>
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { listDeviceNoPage } from "@/api/model/device";
const heatapiContentList = ref([]); const heatapiContentList = ref([]);
const oldData = ref(""); const oldData = ref("");
const loading = ref(false); const loading = ref(false);
@ -86,6 +107,7 @@ const showSearch = ref(true);
const currentPage = ref(1); const currentPage = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const expandRowKeys = ref([]); const expandRowKeys = ref([]);
const listDeviceAll = ref([]);
const queryParams = reactive({ const queryParams = reactive({
deviceUuid: null, deviceUuid: null,
deviceName: null, deviceName: null,
@ -116,14 +138,23 @@ function handleQuery() {
// heatapiContentList // heatapiContentList
const filteredHeatapiContentList = JSON.parse(oldData.value).filter((item) => { const filteredHeatapiContentList = JSON.parse(oldData.value).filter((item) => {
// 使 // 使
let flagb = true;
// //
let flag = (!queryParams.deviceUuid || item.deviceId?.includes(queryParams.deviceUuid)) && let flag = (!queryParams.deviceUuid || item.deviceId?.includes(queryParams.deviceUuid)) &&
(!queryParams.deviceName || item.name?.toLowerCase().includes(queryParams.deviceName.toLowerCase())); (!queryParams.deviceName || item.name?.toLowerCase().includes(queryParams.deviceName.toLowerCase()));
if(!flag){ if(!flag){
if (!queryParams.deviceUuid || typeof queryParams.deviceUuid !== 'string') {
const deviceUuids = queryParams.deviceUuid;
//
flagb = deviceUuids.some(uuid => !uuid || item.deviceId == uuid) &&
(!queryParams.deviceName || item.name?.toLowerCase().includes(queryParams.deviceName.toLowerCase()));
if(!flagb){
return false;
}
}else{
return false; return false;
} }
}
// //
const matchedParams = item.params.filter((param) => { const matchedParams = item.params.filter((param) => {
@ -140,8 +171,7 @@ function handleQuery() {
const hasMatchedParams = matchedParams.length > 0; const hasMatchedParams = matchedParams.length > 0;
// //
flag = flag && (queryParams.paramCode || queryParams.paramName) ? hasMatchedParams : flag; flag = flagb && (queryParams.paramCode || queryParams.paramName) ? hasMatchedParams : flagb;
return flag; return flag;
}); });
@ -202,4 +232,11 @@ function collapseAllRows() {
expandRowKeys.value = []; expandRowKeys.value = [];
} }
function getDevicesAll(){
listDeviceNoPage().then(response => {
listDeviceAll.value = response.data;
});
}
getDevicesAll();
</script> </script>

Loading…
Cancel
Save