2025-08-01 17:16:03 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="comom-title">
|
2025-10-26 12:25:50 +08:00
|
|
|
<div class="title">预警列表</div>
|
|
|
|
|
<div class="expand-btn" @click="changeTab('deployControl')">
|
|
|
|
|
<el-icon size="20">
|
|
|
|
|
<ArrowDownBold v-if="isExpanded" />
|
|
|
|
|
<ArrowUpBold v-else />
|
|
|
|
|
</el-icon>
|
|
|
|
|
</div>
|
2025-08-01 17:16:03 +08:00
|
|
|
</div>
|
2025-10-26 12:25:50 +08:00
|
|
|
<div class=" zdryBox" v-show="isExpanded">
|
|
|
|
|
<div>
|
|
|
|
|
<CheckBox :data="checkDatas" @changeData="changeDatas"></CheckBox>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="typeS">
|
2025-08-01 17:16:03 +08:00
|
|
|
<CheckBox :data="checkData" @changeData="changeData"></CheckBox>
|
|
|
|
|
</div>
|
2025-10-26 12:25:50 +08:00
|
|
|
<ul class="ryBox" ref="scrollTableRef" @mouseenter="stopAutoScroll" @mouseleave="startAutoScroll"
|
|
|
|
|
v-loading="loading" v-infinite-scroll="loadList">
|
2025-08-01 17:16:03 +08:00
|
|
|
<li v-for="item in personList" :key="item.id" @click="chooseItem(item)">
|
2025-10-26 12:25:50 +08:00
|
|
|
<DeployControlItem :item="item" :dict="{ D_BZ_HPZL }" />
|
2025-08-01 17:16:03 +08:00
|
|
|
</li>
|
|
|
|
|
<MOSTY.Empty :show="!loading && personList.length <= 0" :imgSize="100"></MOSTY.Empty>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import emitter from "@/utils/eventBus.js";
|
|
|
|
|
import { qcckPost } from "@/api/qcckApi.js";
|
|
|
|
|
import DeployControlItem from "@/views/home/components/deployControlItem.vue";
|
|
|
|
|
import * as MOSTY from "@/components/MyComponents/index";
|
|
|
|
|
import CheckBox from "@/components/checkBox/index.vue";
|
2025-10-26 12:25:50 +08:00
|
|
|
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance } from 'vue';
|
|
|
|
|
import { ArrowDownBold, ArrowUpBold } from '@element-plus/icons-vue';
|
|
|
|
|
|
|
|
|
|
|
2025-08-01 17:16:03 +08:00
|
|
|
const { proxy } = getCurrentInstance();
|
2025-10-26 12:25:50 +08:00
|
|
|
const { D_BZ_HPZL } = proxy.$dict('D_BZ_HPZL')
|
2025-08-01 17:16:03 +08:00
|
|
|
const checkData = reactive({
|
|
|
|
|
list: ["一级", "二级", "三级", "四级"],
|
|
|
|
|
hasChoose: ["一级", "二级", "三级", "四级"]
|
|
|
|
|
});
|
2025-10-26 12:25:50 +08:00
|
|
|
const checkDatas = reactive({
|
|
|
|
|
list: ["布控", "行为", "身份", "组合"],
|
|
|
|
|
hasChoose: ["布控", "行为", "身份", "组合"]
|
|
|
|
|
});
|
2025-08-01 17:16:03 +08:00
|
|
|
const total = ref(0);
|
|
|
|
|
const yjJb = ref('10,20,30,40');
|
|
|
|
|
const pageNum = ref(1);
|
|
|
|
|
const loading = ref(false); // 加载中
|
|
|
|
|
const personList = ref([]);
|
2025-10-26 12:25:50 +08:00
|
|
|
const scrollTableRef = ref(null);
|
|
|
|
|
const isAutoScrolling = ref(false);
|
|
|
|
|
let scrollTimer = null;
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList();
|
|
|
|
|
// 数据加载完成后启动自动滚动
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (personList.value.length > 0) {
|
|
|
|
|
startAutoScroll();
|
2025-08-29 14:30:58 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
}, 1000);
|
|
|
|
|
})
|
2025-08-01 17:16:03 +08:00
|
|
|
// 复选框切换
|
2025-10-26 12:25:50 +08:00
|
|
|
function changeData(val) {
|
2025-08-01 17:16:03 +08:00
|
|
|
pageNum.value = 1;
|
|
|
|
|
personList.value = [];
|
|
|
|
|
checkData.hasChoose = val;
|
|
|
|
|
let ids = [];
|
|
|
|
|
val.forEach(it => {
|
2025-10-26 12:25:50 +08:00
|
|
|
if (it == '一级') ids.push(10);
|
|
|
|
|
if (it == '二级') ids.push(20);
|
|
|
|
|
if (it == '三级') ids.push(30);
|
|
|
|
|
if (it == '四级') ids.push(40);
|
2025-08-01 17:16:03 +08:00
|
|
|
});
|
|
|
|
|
yjJb.value = ids.join(',')
|
2025-10-26 12:25:50 +08:00
|
|
|
if (val.length == 0) personList.value = [];
|
2025-08-01 17:16:03 +08:00
|
|
|
else getList();
|
|
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
const typeS=ref(true)
|
|
|
|
|
function changeDatas(val) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
console.log(val.includes('布控'));
|
|
|
|
|
|
|
|
|
|
pageNum.value = 1;
|
|
|
|
|
personList.value = [];
|
|
|
|
|
checkDatas.hasChoose = val;
|
|
|
|
|
let ids = [];
|
|
|
|
|
if (val.includes('布控')) {
|
|
|
|
|
typeS.value=true
|
|
|
|
|
} else {
|
|
|
|
|
typeS.value=false
|
|
|
|
|
}
|
|
|
|
|
val.forEach(it => {
|
|
|
|
|
if (it == '布控') {
|
|
|
|
|
ids.push(10)
|
|
|
|
|
typeS.value=true
|
|
|
|
|
};
|
|
|
|
|
if (it == '行为') ids.push(20);
|
|
|
|
|
if (it == '身份') ids.push(30);
|
|
|
|
|
if (it == '组合') ids.push(40);
|
|
|
|
|
});
|
|
|
|
|
yjJb.value = ids.join(',')
|
|
|
|
|
if (val.length == 0) personList.value = [];
|
|
|
|
|
else getList();
|
|
|
|
|
}
|
|
|
|
|
const isExpanded = ref(true); // 控制展开/收缩状态
|
|
|
|
|
|
|
|
|
|
const changeTab = () => {
|
|
|
|
|
// 切换展开/收缩状态
|
|
|
|
|
isExpanded.value = !isExpanded.value;
|
|
|
|
|
|
|
|
|
|
// 如果是收缩状态,停止自动滚动
|
|
|
|
|
if (!isExpanded.value) {
|
|
|
|
|
stopAutoScroll();
|
|
|
|
|
} else if (personList.value.length > 0) {
|
|
|
|
|
// 如果是展开状态并且有数据,启动自动滚动
|
|
|
|
|
startAutoScroll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 自动滚动函数
|
|
|
|
|
const autoScroll = () => {
|
|
|
|
|
if (!scrollTableRef.value || !isAutoScrolling.value) return;
|
|
|
|
|
const container = scrollTableRef.value;
|
|
|
|
|
const speed = 1; // 滚动速度
|
|
|
|
|
// 滚动容器
|
|
|
|
|
container.scrollTop += speed;
|
|
|
|
|
// 判断是否滚动到底部,如果是则回到顶部重新开始
|
|
|
|
|
if (container.scrollTop >= container.scrollHeight - container.clientHeight - 5) {
|
|
|
|
|
container.scrollTop = 0;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 开始自动滚动
|
|
|
|
|
const startAutoScroll = () => {
|
|
|
|
|
if (isAutoScrolling.value || !scrollTableRef.value) return;
|
|
|
|
|
isAutoScrolling.value = true;
|
|
|
|
|
// 清除可能存在的定时器
|
|
|
|
|
if (scrollTimer) {
|
|
|
|
|
clearInterval(scrollTimer);
|
|
|
|
|
}
|
|
|
|
|
// 设置新的定时器,控制滚动速度
|
|
|
|
|
scrollTimer = setInterval(autoScroll, 30);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 停止自动滚动
|
|
|
|
|
const stopAutoScroll = () => {
|
|
|
|
|
isAutoScrolling.value = false;
|
|
|
|
|
if (scrollTimer) {
|
|
|
|
|
clearInterval(scrollTimer);
|
|
|
|
|
scrollTimer = null;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
// 组件卸载时清理定时器
|
|
|
|
|
stopAutoScroll();
|
|
|
|
|
});
|
2025-08-01 17:16:03 +08:00
|
|
|
|
|
|
|
|
// 触底加载
|
2025-10-26 12:25:50 +08:00
|
|
|
const loadList = () => {
|
|
|
|
|
if (personList.value.length == total.value) return;
|
2025-08-01 17:16:03 +08:00
|
|
|
pageNum.value++;
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-26 12:25:50 +08:00
|
|
|
const getList = (type) => {
|
|
|
|
|
let data = { pageSize: 10, pageNum: pageNum.value, yjJb: yjJb.value, bkyj: 1 };
|
2025-08-29 14:30:58 +08:00
|
|
|
loading.value = !type ? true : false;
|
2025-10-26 12:25:50 +08:00
|
|
|
qcckPost(data, '/mosty-gsxt/tbYjxx/getPageList').then(res => {
|
2025-08-01 17:16:03 +08:00
|
|
|
loading.value = false;
|
|
|
|
|
let arr = res.records || [];
|
|
|
|
|
personList.value = pageNum.value == 1 ? arr : personList.value.concat(arr);
|
|
|
|
|
total.value = res.total;
|
2025-10-26 12:25:50 +08:00
|
|
|
}).catch(() => {
|
2025-08-01 17:16:03 +08:00
|
|
|
loading.value = false;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-26 12:25:50 +08:00
|
|
|
const chooseItem = (item) => {
|
|
|
|
|
emitter.emit('showHomeYJ', [item]);
|
|
|
|
|
// emitter.emit('deletePointArea','home_yj_map');
|
|
|
|
|
// if(!item.jd || !item.jd) return proxy.$message({ type: "warning", message: "该预警没有坐标!" });
|
|
|
|
|
// let icon = require('@/assets/point/yj.png');
|
|
|
|
|
// if(item.yjjb == '20') icon = require('@/assets/point/yj1.png');
|
|
|
|
|
// if(item.yjjb == '30') icon = require('@/assets/point/yj2.png');
|
|
|
|
|
// if(item.yjjb == '40') icon = require('@/assets/point/yj3.png');
|
|
|
|
|
// emitter.emit('addPointArea',{flag:'home_yj_map',icon,coords:[item]});
|
|
|
|
|
// emitter.emit('setMapCenter',{location:[item.jd,item.wd],zoomLevel:10});
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
2025-10-26 12:25:50 +08:00
|
|
|
.el-loading-mask {
|
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import "@/assets/css/homeScreen.scss";
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
.zdryBox {
|
2025-08-01 17:16:03 +08:00
|
|
|
background: #052249;
|
2025-10-26 12:25:50 +08:00
|
|
|
height: 560px;
|
|
|
|
|
|
|
|
|
|
.ryBox {
|
|
|
|
|
height: calc(100% - 80px);
|
2025-08-01 17:16:03 +08:00
|
|
|
overflow: hidden;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-26 12:25:50 +08:00
|
|
|
::v-deep .el-checkbox {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-01 17:16:03 +08:00
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
background-color: #263b70;
|
|
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
2025-08-01 17:16:03 +08:00
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
|
background-color: #146bbe;
|
|
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
2025-08-01 17:16:03 +08:00
|
|
|
::-webkit-scrollbar-track {
|
|
|
|
|
background-color: #263b70;
|
|
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
2025-08-01 17:16:03 +08:00
|
|
|
::-webkit-scrollbar-corner {
|
|
|
|
|
background-color: #142141;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-26 12:25:50 +08:00
|
|
|
::v-deep .el-checkbox__label {
|
|
|
|
|
color: #fff;
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__input.is-checked+.el-checkbox__label {
|
|
|
|
|
color: #00FFFF;
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__inner {
|
|
|
|
|
background: rgba(0, 144, 255, 0.2);
|
|
|
|
|
border: 1px solid #0072FF;
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
|
2025-08-01 17:16:03 +08:00
|
|
|
background-color: #00FFFF;
|
2025-10-26 12:25:50 +08:00
|
|
|
border-color: #00FFFF;
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
2025-08-01 17:16:03 +08:00
|
|
|
background-color: #00FFFF;
|
2025-10-26 12:25:50 +08:00
|
|
|
border-color: #00FFFF;
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__inner::after {
|
|
|
|
|
border: 2px solid #000;
|
|
|
|
|
border-left: 0;
|
|
|
|
|
border-top: 0;
|
|
|
|
|
left: 3px;
|
|
|
|
|
top: 0px;
|
2025-08-01 17:16:03 +08:00
|
|
|
}
|
2025-10-26 12:25:50 +08:00
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
|
2025-08-01 17:16:03 +08:00
|
|
|
background: #000;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-26 12:25:50 +08:00
|
|
|
.comom-title {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expand-btn {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
// background: linear-gradient(135deg, #0072FF 0%, #00B4FF 100%);
|
|
|
|
|
// border-radius: 50%;
|
|
|
|
|
color: white;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 114, 255, 0.3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expand-btn:hover {
|
|
|
|
|
transform: scale(1.1);
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 114, 255, 0.5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.expand-btn:active {
|
|
|
|
|
transform: scale(0.95);
|
|
|
|
|
}
|
2025-08-01 17:16:03 +08:00
|
|
|
</style>
|