This commit is contained in:
lcw
2026-03-18 11:07:40 +08:00
parent 9fb505eb8e
commit c181530639
71 changed files with 2331 additions and 1027 deletions

View File

@ -42,12 +42,13 @@ const checkData = reactive({
hasChoose: ["一级", "二级", "三级", "四级"]
});
const checkDatas = reactive({
list: ['七类重点人','布控','无人机'],
hasChoose: ['七类重点人']
// list: ['七类重点人','布控','无人机'],
list: ['身份预警','行为预警','组合预警'],
hasChoose: ['身份预警','行为预警','组合预警']
});
const total = ref(0);
const yjJb = ref(['01', '02', '03', '04']);
const yjLx = ref(['01']);
const yjLx = ref(['21','22','23']);
const pageNum = ref(1);
const loading = ref(false); // 加载中
const personList = ref([]);
@ -89,13 +90,19 @@ function changeDatas(val) {
checkDatas.hasChoose = val;
let ids = [];
val.forEach(it => {
if (it == '七类重点人') ids.push('01');
if (it == '布控') ids.push('02');
if (it == '无人机') ids.push('03');
// if (it == '七类重点人') ids.push('01');
// if (it == '布控') ids.push('02');
// if (it == '无人机') ids.push('03');
if (it == '身份预警') ids.push('21');
if (it == '行为预警') ids.push('22');
if (it == '组合预警') ids.push('23');
});
yjLx.value = ids
if (val.length == 0) personList.value = [];
else getList();
if (val.length == 0) {
personList.value = [];
} else {
getList();
}
}
const isExpanded = ref(false); // 控制展开/收缩状态
@ -152,22 +159,26 @@ onUnmounted(() => {
// 触底加载
const loadList = () => {
if (personList.value.length == total.value) return;
// 防止重复加载和无更多数据时的加载
if (loading.value || personList.value.length == total.value) return;
pageNum.value++;
getList()
console.log(pageNum.value,"触底");
getList(true) // 传递true表示触底加载不显示loading
}
const ORDIMG = 'https://89.40.7.122:38496/image'
const IMGYM = 'https://sg.lz.dsj.xz/dhimage'
const getList = (type) => {
let data = { pageSize: 30, pageCurrent: pageNum.value, yjjbList: yjJb.value, lylxList: yjLx.value };
console.log(pageNum.value);
let data = { pageSize: 30, pageCurrent: pageNum.value, yjjbList: yjJb.value, yjLylxList: yjLx.value?.length ? yjLx.value : ['21','22','23'] };
loading.value = !type ? true : false;
getPageAllList(data).then(res => {
loading.value = false;
let arr = res.records.map(item => {
return {
...item,
yjtp:item.yjlx=='01'? item.yjtp.replace(ORDIMG, IMGYM) : item.yjtp
// yjtp:item.yjlx=='01'? item.yjtp.replace(ORDIMG, IMGYM) : item.yjtp
}
}) || [];
personList.value = pageNum.value == 1 ? arr : personList.value.concat(arr);
@ -200,7 +211,6 @@ const chooseItem = (item) => {
case '01':
tbYjxxGetInfo(item.id).then(res => {
console.log(res);
content.value = {
id: item.id,
ryxm: res.yjRyxm || '',
@ -241,7 +251,6 @@ const chooseItem = (item) => {
})
break;
case '03':
yjzxyjzxSfyjSelectList(item.id).then(res => {
content.value = {
id: item.id,

View File

@ -17,18 +17,44 @@
<GdMap :mapid="'map-99'"></GdMap>
<div class="button-container">
<template v-for="(value, index) in butList" :key="index">
<el-popover v-if="value.label === '警情' && value.onChage" placement="top" :width="200" trigger="hover">
<el-popover v-if="value.label === '警情' && value.onChage" placement="top" :width="480" trigger="click"
@show="changeBut(value)">
<template #reference>
<div class="but" :class="{ 'butOk': value.onChage }" @click="changeBut(value)">
<!-- -->
<div class="but" :class="{ 'butOk': value.onChage }">
{{ value.label }}
</div>
</template>
<div class="jqdj-popover">
<el-checkbox-group v-model="jqdjdmFilter" @change="handleJqdjFilterChange">
<el-checkbox v-for="item in D_BZ_JQDJ" :key="item.dm" :label="item.dm">
{{ item.zdmc }}
</el-checkbox>
</el-checkbox-group>
<div class="filter-item">
<span class="filter-label">等级</span>
<el-checkbox-group v-model="jqdjdmFilter" @change="handleJqdjFilterChange" class="checkbox-group">
<el-checkbox v-for="item in D_BZ_JQDJ" :key="item.dm" :label="item.dm" class="checkbox-item">
{{ item.zdmc }}
</el-checkbox>
</el-checkbox-group>
</div>
<div class="filter-item">
<span class="filter-label">时间</span>
<el-date-picker style="width: 100%;" v-model="timeRange" type="datetimerange" start-placeholder="开始时间" end-placeholder="结束时间"
format="YYYY-MM-DD HH:mm:ss" @change="handleTimeRangeChange" />
</div>
</div>
</el-popover>
<el-popover v-else-if="value.label === '事件' && value.onChage" placement="top" :width="480" trigger="click"
@show="changeBut(value)">
<template #reference>
<div class="but" :class="{ 'butOk': value.onChage }">
{{ value.label }}
</div>
</template>
<div class="jqdj-popover">
<div class="filter-item">
<span class="filter-label">时间</span>
<el-date-picker v-model="sjTimeRange" type="datetimerange" style="width: 100%;" start-placeholder="开始时间" end-placeholder="结束时间"
format="YYYY-MM-DD HH:mm:ss" @change="getTimeRange" />
</div>
</div>
</el-popover>
<div v-else class="but" :class="{ 'butOk': value.onChage }" @click="changeBut(value)">
@ -63,7 +89,6 @@
</div>
<div class="dataList" v-infinite-scroll="loadMore" infinite-scroll-disabled="loading"
infinite-scroll-distance="10">
<template v-if="changeState">
<div class="item" v-for="(item, index) in jqList" :key="index" @click="clickJq(item)">
<div class="data-title">接警单{{ item.jjdbh }}</div>
@ -143,14 +168,48 @@ const jqdjdmFilter = ref([])
const handleJqdjFilterChange = () => {
getLzJcjPjdb()
}
// 获取当天的开始和结束时间
const getCurrentMonthRange = () => {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth();
const day = now.getDate();
// 当天零点
const start = new Date(year, month, day, 0, 0, 0);
// 当天23:59:59
const end = new Date(year, month, day, 23, 59, 59);
return [start, end];
};
const timeRange = ref(getCurrentMonthRange())
const sjTimeRange = ref()
const handleTimeRangeChange = () => {
getLzJcjPjdb()
}
const getTimeRange = () => {
getZdsj()
};
// 底部按钮
const changeBut = (row) => {
if (row.label == '清除') {
emitter.emit('deletePointArea', 'sj_flash')
emitter.emit('deletePointArea', 'jq_flash')
emitter.emit('deletePointArea', 'jq')
emitter.emit('deletePointArea', 'sj')
return
}
// 警情按钮点击时不改变onChage状态因为它需要显示popover
if (row.label == '警情') {
// 只执行获取警情数据的操作,不改变状态
getLzJcjPjdb()
return
}
if (row.label == '事件') {
getZdsj()
return
}
let index = butList.value.findIndex(item => item.label == row.label)
@ -170,12 +229,28 @@ const changeBut = (row) => {
}
}
}
// 格式化日期为YYYY-MM-DD HH:mm:ss格式
const formatDate = (date) => {
if (!date) return '';
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
// 获取所有的一级警情
const getLzJcjPjdb = () => {
const jqdjdmStr = jqdjdmFilter.value.length > 0 ? jqdjdmFilter.value.join(',') : ''
emitter.emit("deletePointArea", "jq")
qcckGet({
jqdjdm: jqdjdmStr
jqdjdm: jqdjdmStr,
startTime: timeRange.value ? formatDate(timeRange.value[0]) : '',
endTime: timeRange.value ? formatDate(timeRange.value[1]) : '',
}, "/mosty-gsxt/lzJcjPjdb/selectList").then(res => {
let list = res.filter(item => item.fxdwjd && item.fxdwjd).map(item => {
return {
@ -194,7 +269,10 @@ const loading = ref(false)
const changeState = ref(true)// 点击切换
// 获取所有的重点事件
const getZdsj = () => {
qcckGet({}, "/mosty-gsxt/zdsj/selectList").then(res => {
qcckGet({
startTime: sjTimeRange.value ? sjTimeRange.value[0] : '',
endTime: sjTimeRange.value ? sjTimeRange.value[1] : '',
}, "/mosty-gsxt/zdsj/selectList").then(res => {
let list = res.filter(item => item.jd && item.wd).map(item => {
return {
...item,
@ -596,15 +674,40 @@ const coordStringHandler = (res) => {
}
.jqdj-popover {
:deep(.el-checkbox-group) {
padding: 10px;
.filter-item {
margin-bottom: 10px;
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
flex-wrap: nowrap;
gap: 10px;
}
.filter-label {
white-space: nowrap;
color: #333;
font-size: 14px;
}
.checkbox-group {
display: flex;
flex-wrap: nowrap;
gap: 15px;
align-items: center;
}
:deep(.el-checkbox) {
margin-right: 0;
}
:deep(.el-checkbox__label) {
white-space: nowrap;
}
:deep(.el-date-editor) {
width: 200px;
}
}
.display-flex {