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 title="当前站点" :value="detailData.mc" />
</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">
<van-cell-group>
@ -413,6 +413,7 @@ const route = useRoute();
const detailData = ref({}); //
const searchValue = ref(""); //
const equipmentList = ref([]);
const pendingConfirmList = ref([]); //
const INIT_FORM = {
equipment: {
@ -445,8 +446,9 @@ const form = reactive({ ...INIT_FORM }); // 表单
//
onMounted(() => {
detailData.value = JSON.parse(decodeURIComponent(route.params.data));
console.log('detailData',toRaw(detailData.value));
console.log("detailData", toRaw(detailData.value));
getEquipmentList();
getPendingConfirmList();
});
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) => {
try {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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