This commit is contained in:
Zzc 2025-11-21 17:00:15 +08:00
commit 93295fd420
10 changed files with 183 additions and 86 deletions

View File

@ -11,7 +11,7 @@
<van-cell-group> <van-cell-group>
<van-cell title="当前站点" :value="detailData.mc" /> <van-cell title="当前站点" :value="detailData.mc" />
</van-cell-group> </van-cell-group>
<van-notice-bar mode="link">20台设备待确认</van-notice-bar> <van-notice-bar mode="link" v-if="pendingConfirmList.length">{{ pendingConfirmList.length }}个设备待确认</van-notice-bar>
<div class="content"> <div class="content">
<van-cell-group> <van-cell-group>
@ -413,6 +413,7 @@ const route = useRoute();
const detailData = ref({}); // const detailData = ref({}); //
const searchValue = ref(""); // const searchValue = ref(""); //
const equipmentList = ref([]); const equipmentList = ref([]);
const pendingConfirmList = ref([]); //
const INIT_FORM = { const INIT_FORM = {
equipment: { equipment: {
@ -445,8 +446,9 @@ const form = reactive({ ...INIT_FORM }); // 表单
// //
onMounted(() => { onMounted(() => {
detailData.value = JSON.parse(decodeURIComponent(route.params.data)); detailData.value = JSON.parse(decodeURIComponent(route.params.data));
console.log('detailData',toRaw(detailData.value)); console.log("detailData", toRaw(detailData.value));
getEquipmentList(); getEquipmentList();
getPendingConfirmList();
}); });
watch( watch(
@ -458,6 +460,33 @@ watch(
} }
); );
//
const getPendingConfirmList = async (sbmc) => {
try {
const data = {
yhzid: detailData.value.id,
sbmc,
pageNum: 1,
pageSize: 9999,
};
const res = await request({
url: "/snow-ops-platform/yjsb/pendingConfirmList",
method: "get",
params: data,
});
if (res.code === "00000") {
pendingConfirmList.value = res.data.records;
} else {
throw new Error(res.message);
}
} catch (error) {
showToast({
type: "fail",
message: error.message,
});
}
};
// //
const getEquipmentList = async (sbmc) => { const getEquipmentList = async (sbmc) => {
try { try {

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>数据大屏</title> <title>渝路智管</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -65,7 +65,7 @@ const INIT_FORM = {
czyid: "", czyid: "",
gzrq: "", gzrq: "",
gmfy: "", gmfy: "",
sbzt: "", sbzt: "完好",
sccj: "", sccj: "",
sfyjsb: "", sfyjsb: "",
sfnrsjbz: "", sfnrsjbz: "",
@ -82,6 +82,10 @@ const filterNode = (value, node) => {
const nodeData = node || {} const nodeData = node || {}
if (nodeData.type === 'root') {
return true;
}
// 处理区域节点匹配 // 处理区域节点匹配
if (nodeData.type === 'area') { if (nodeData.type === 'area') {
return (nodeData.rawName || '').toLowerCase().includes(keyword) return (nodeData.rawName || '').toLowerCase().includes(keyword)
@ -104,9 +108,13 @@ const getTreeData = async () => {
method: 'GET' method: 'GET'
}) })
if (res.code === '00000') { if (res.code === '00000') {
treeData.value = res.data.map((qx, index) => ( treeData.value = [{
id: -1,
name: `全部(${res.data.totalSbsl})`,
type: "root",
children: res.data.areaList.map((qx, index) => (
{ {
id: index, id: qx.qxmc,
name: `${qx.qxmc}(${qx.sbsl})`, name: `${qx.qxmc}(${qx.sbsl})`,
type: 'area', type: 'area',
children: qx.yhzList.map(site => ({ children: qx.yhzList.map(site => ({
@ -121,8 +129,9 @@ const getTreeData = async () => {
})), })),
rawName: qx.qxmc, // 原始名称 rawName: qx.qxmc, // 原始名称
}) })
); )
console.log('treeData', toRaw(treeData.value)) }]
// console.log('treeData', toRaw(treeData.value))
} else { } else {
throw new Error(res.message); throw new Error(res.message);
} }
@ -134,25 +143,33 @@ const getTreeData = async () => {
// 处理节点点击事件 // 处理节点点击事件
const handleNodeClick = (data, node) => { const handleNodeClick = (data, node) => {
if (!data || !data.type) return; if (!data || !data.type) return;
if (data.type === 'area' && node.expanded === false) { if (data.type === 'root') {
console.log('树节点关闭', node.expanded) console.log('你点击的是全部')
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
selectedYHZData.value = null; selectedYHZData.value = null;
return; return;
} };
// if (data.type === 'area' && node.expanded === false) {
// console.log('树节点关闭', node.expanded)
// yhzid.value = ''; // 重置养护站id
// qxmc.value = ''; // 重置区县名称
// selectedYHZData.value = null;
// return;
// }
if (data.type === 'area') { if (data.type === 'area') {
console.log('你点击的是区县', data.id) console.log('你点击的是区县', data.rawName)
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
qxmc.value = data.id; // 保存区县名称 qxmc.value = data.rawName; // 保存区县名称
selectedYHZData.value = null selectedYHZData.value = null
return;
} }
if (data.type === 'site') { if (data.type === 'site') {
console.log('你点击的是站点', data.name) console.log('你点击的是站点', data.name)
yhzid.value = data.id; // 保存养护站id yhzid.value = data.id; // 保存养护站id
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
selectedYHZData.value = data selectedYHZData.value = data
return;
} }
}; };
@ -439,8 +456,8 @@ export default () => {
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
const visibleNodes = getFilteredVisibleNodes() const visibleNodes = getFilteredVisibleNodes()
if (visibleNodes.length === 2) { if (visibleNodes.length === 3) {
handleAutoClickNode(visibleNodes[1]) handleAutoClickNode(visibleNodes[0])
} }
}, 100) // 增加 100ms 延迟确保过滤完成 }, 100) // 增加 100ms 延迟确保过滤完成
}) })

View File

@ -16,6 +16,8 @@
@node-click="script.handleNodeClick" @node-click="script.handleNodeClick"
accordion accordion
:filter-node-method="script.filterNode" :filter-node-method="script.filterNode"
node-key="id"
:default-expanded-keys="[-1]"
/> />
</div> </div>
</div> </div>

View File

@ -98,6 +98,10 @@ const filterNode = (value, node) => {
const nodeData = node || {} const nodeData = node || {}
if (nodeData.type === 'root') {
return true;
}
// 处理区域节点匹配 // 处理区域节点匹配
if (nodeData.type === 'area') { if (nodeData.type === 'area') {
return (nodeData.rawName || '').toLowerCase().includes(keyword) return (nodeData.rawName || '').toLowerCase().includes(keyword)
@ -120,23 +124,29 @@ const getTreeData = async () => {
method: 'GET' method: 'GET'
}) })
if (res.code === '00000') { if (res.code === '00000') {
treeData.value = res.data.map((qx, index) => ( treeData.value = [{
id: -1,
name: `全部(${res.data.totalWzsl})`,
type: "root",
children: res.data.areaList.map((qx, index) => (
{ {
id: index, id: qx.qxmc,
name: `${qx.qxmc}(${qx.wzsl})`, name: `${qx.qxmc}(${qx.wzsl})`,
type: 'area', type: 'area',
children: qx.yhzList.map(site => ({ children: qx.yhzList.map(site => ({
id: site.id, id: site.id,
name: `${site.mc}(${site.wzsl})`, name: `${site.mc}(${site.wzsl})`,
type: 'site', type: 'site',
rawName: site.mc, // 原始名称 qxmc: qx.qxmc,
rawName: site.mc,
jd: site.jd, jd: site.jd,
wd: site.wd, wd: site.wd,
})), })),
rawName: qx.qxmc, // 原始名称 rawName: qx.qxmc, // 原始名称
}) })
); )
console.log('treeData', toRaw(treeData.value)) }]
// console.log('treeData', toRaw(treeData.value))
} else { } else {
throw new Error(res.message); throw new Error(res.message);
} }
@ -148,25 +158,36 @@ const getTreeData = async () => {
// 处理节点点击事件 // 处理节点点击事件
const handleNodeClick = (data, node) => { const handleNodeClick = (data, node) => {
if (!data || !data.type) return; if (!data || !data.type) return;
if (data.type === 'area' && node.expanded === false) { if (data.type === 'root') {
console.log('树节点关闭', node.expanded) console.log('你点击的是全部')
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
yhzData.value = null; // 重置养护站信息
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
return;
}
if (data.type === 'area') {
console.log('你点击的是区县', data.id)
yhzid.value = ''; // 重置养护站id
yhzData.value = null; // 重置养护站信息 yhzData.value = null; // 重置养护站信息
qxmc.value = data.id; // 保存区县名称 return;
};
// if (data.type === 'area' && node.expanded === false) {
// console.log('树节点关闭', node.expanded)
// yhzid.value = ''; // 重置养护站id
// qxmc.value = ''; // 重置区县名称
// return;
// }
if (data.type === 'area') {
console.log('你点击的是区县', data.rawName)
yhzid.value = ''; // 重置养护站id
qxmc.value = data.rawName; // 保存区县名称
yhzData.value = null; // 重置养护站信息
return;
} }
if (data.type === 'site') { if (data.type === 'site') {
console.log('你点击的是站点', data.name) console.log('你点击的是站点', data.name)
yhzid.value = data.id; // 保存养护站id yhzid.value = data.id; // 保存养护站id
yhzData.value = data; // 保存养护站信息
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
yhzData.value = {
jd: data.jd,
wd: data.wd,
rawName: data.rawName,
}
return;
} }
}; };
@ -434,8 +455,8 @@ export default () => {
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
const visibleNodes = getFilteredVisibleNodes() const visibleNodes = getFilteredVisibleNodes()
if (visibleNodes.length === 2) { if (visibleNodes.length === 3) {
handleAutoClickNode(visibleNodes[1]) handleAutoClickNode(visibleNodes[0])
} }
}, 100) // 增加 100ms 延迟确保过滤完成 }, 100) // 增加 100ms 延迟确保过滤完成
}) })

View File

@ -16,6 +16,8 @@
@node-click="script.handleNodeClick" @node-click="script.handleNodeClick"
accordion accordion
:filter-node-method="script.filterNode" :filter-node-method="script.filterNode"
node-key="id"
:default-expanded-keys="[-1]"
/> />
</div> </div>
</div> </div>

View File

@ -311,7 +311,7 @@ const getMaterialList = async () => {
const data = { const data = {
pageNum: pagination.current, pageNum: pagination.current,
pageSize: pagination.pageSize, pageSize: pagination.pageSize,
yhzid: Number(props.basicData.id), yhzid: props.basicData.id,
}; };
const res = await request({ const res = await request({
url: "/snow-ops-platform/yjwz/list", url: "/snow-ops-platform/yjwz/list",
@ -336,7 +336,7 @@ const getEquipmentList = async () => {
const data = { const data = {
pageNum: pagination.current, pageNum: pagination.current,
pageSize: pagination.pageSize, pageSize: pagination.pageSize,
yhzid: Number(props.basicData.id), yhzid: props.basicData.id,
}; };
const res = await request({ const res = await request({
url: "/snow-ops-platform/yjsb/list", url: "/snow-ops-platform/yjsb/list",

View File

@ -81,6 +81,10 @@ const filterNode = (value, node) => {
const nodeData = node || {} const nodeData = node || {}
if (nodeData.type === 'root') {
return true;
}
// 处理区域节点匹配 // 处理区域节点匹配
if (nodeData.type === 'area') { if (nodeData.type === 'area') {
return (nodeData.rawName || '').toLowerCase().includes(keyword) return (nodeData.rawName || '').toLowerCase().includes(keyword)
@ -103,9 +107,13 @@ const getTreeData = async () => {
method: 'GET' method: 'GET'
}) })
if (res.code === '00000') { if (res.code === '00000') {
treeData.value = res.data.map((qx, index) => ( treeData.value = [{
id: -1,
name: `全部(${res.data.totalBxsjsl})`,
type: 'root',
children: res.data.areaList.map((qx, index) => (
{ {
id: index, id: qx.qxmc,
name: `${qx.qxmc}(${qx.bxsjsl})`, name: `${qx.qxmc}(${qx.bxsjsl})`,
type: 'area', type: 'area',
children: qx.yhzList.map(site => ({ children: qx.yhzList.map(site => ({
@ -115,7 +123,8 @@ const getTreeData = async () => {
})), })),
rawName: qx.qxmc, // 原始名称 rawName: qx.qxmc, // 原始名称
}) })
); )
}]
console.log('treeData', toRaw(treeData.value)) console.log('treeData', toRaw(treeData.value))
} else { } else {
throw new Error(res.message); throw new Error(res.message);
@ -128,17 +137,22 @@ const getTreeData = async () => {
// 处理节点点击事件 // 处理节点点击事件
const handleNodeClick = (data, node) => { const handleNodeClick = (data, node) => {
if (!data || !data.type) return; if (!data || !data.type) return;
if (data.type === 'area' && node.expanded === false) { if (data.type === 'root') {
console.log('树节点关闭', node.expanded) console.log('你点击的是全部')
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
qxmc.value = ''; // 重置区县名称 qxmc.value = ''; // 重置区县名称
return; return;
} }
// if (data.type === 'area' && node.expanded === false) {
// console.log('树节点关闭', node.expanded)
// yhzid.value = ''; // 重置养护站id
// qxmc.value = ''; // 重置区县名称
// return;
// }
if (data.type === 'area') { if (data.type === 'area') {
console.log('你点击的是区县', data.id) console.log('你点击的是区县', data.rawName)
yhzid.value = ''; // 重置养护站id yhzid.value = ''; // 重置养护站id
qxmc.value = data.id; // 保存区县名称 qxmc.value = data.rawName; // 保存区县名称
} }
if (data.type === 'site') { if (data.type === 'site') {
console.log('你点击的是站点', data.name) console.log('你点击的是站点', data.name)
@ -161,7 +175,7 @@ const getyhzeventList = async (qxmc, yhzid, filterData) => {
try { try {
const data = { const data = {
qxmc: qxmc, qxmc: qxmc,
yhzid: yhzid, serviceStationId: yhzid,
routeNo: filterData?.routeNo || '', routeNo: filterData?.routeNo || '',
stakeNo: filterData?.stakeNo || '', stakeNo: filterData?.stakeNo || '',
reportTimeStart: filterData?.reportTime?.[0] ? formatDate(filterData.reportTime[0]) : '', reportTimeStart: filterData?.reportTime?.[0] ? formatDate(filterData.reportTime[0]) : '',
@ -389,8 +403,8 @@ export default () => {
nextTick(() => { nextTick(() => {
setTimeout(() => { setTimeout(() => {
const visibleNodes = getFilteredVisibleNodes() const visibleNodes = getFilteredVisibleNodes()
if (visibleNodes.length === 2) { if (visibleNodes.length === 3) {
handleAutoClickNode(visibleNodes[1]) handleAutoClickNode(visibleNodes[0])
} }
}, 100) // 增加 100ms 延迟确保过滤完成 }, 100) // 增加 100ms 延迟确保过滤完成
}) })

View File

@ -16,6 +16,8 @@
@node-click="script.handleNodeClick" @node-click="script.handleNodeClick"
accordion accordion
:filter-node-method="script.filterNode" :filter-node-method="script.filterNode"
node-key="id"
:default-expanded-keys="[-1]"
/> />
</div> </div>
</div> </div>

View File

@ -3,6 +3,9 @@
<div class="header"> <div class="header">
<img class="logo" src="../assets/imgs/logo.png" alt="logo" /> <img class="logo" src="../assets/imgs/logo.png" alt="logo" />
<h2>政务·渝路智管</h2> <h2>政务·渝路智管</h2>
<div class="user">
<el-icon :size="24"><User /></el-icon>
</div>
</div> </div>
<div class="content"> <div class="content">
<div class="content-leftbar"> <div class="content-leftbar">
@ -17,6 +20,7 @@
<script setup> <script setup>
import MenuBar from "../component/MenuBar/index.vue"; import MenuBar from "../component/MenuBar/index.vue";
import {User} from '@element-plus/icons-vue'
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -33,12 +37,18 @@ import MenuBar from "../component/MenuBar/index.vue";
background-position: center; background-position: center;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
.logo { .logo {
width: 42px; width: 42px;
height: 42px; height: 42px;
margin-left: 16px; margin-left: 16px;
margin-right: 16px; margin-right: 16px;
} }
.user {
margin-left: auto;
cursor: pointer;
margin-right: 16px;
}
} }
.content { .content {
height: calc(100% - 64px); height: calc(100% - 64px);