Browse Source

优化推送信息搜索条件

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

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

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

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

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

Loading…
Cancel
Save