diff --git a/packages/mobile/src/views/Equipment/EquipmentManagement.vue b/packages/mobile/src/views/Equipment/EquipmentManagement.vue index 762b19b..d68ec84 100644 --- a/packages/mobile/src/views/Equipment/EquipmentManagement.vue +++ b/packages/mobile/src/views/Equipment/EquipmentManagement.vue @@ -11,7 +11,7 @@ - 20台设备待确认 + {{ pendingConfirmList.length }}个设备待确认
@@ -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 { diff --git a/packages/screen/index.html b/packages/screen/index.html index c6d88e2..fc4311f 100644 --- a/packages/screen/index.html +++ b/packages/screen/index.html @@ -3,7 +3,7 @@ - 数据大屏 + 渝路智管
diff --git a/packages/screen/src/views/EquipmentManagement/index.js b/packages/screen/src/views/EquipmentManagement/index.js index 544528f..197895a 100644 --- a/packages/screen/src/views/EquipmentManagement/index.js +++ b/packages/screen/src/views/EquipmentManagement/index.js @@ -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,25 +108,30 @@ const getTreeData = async () => { method: 'GET' }) if (res.code === '00000') { - treeData.value = res.data.map((qx, index) => ( - { - id: index, - name: `${qx.qxmc}(${qx.sbsl})`, - type: 'area', - children: qx.yhzList.map(site => ({ - id: site.id, - name: `${site.mc}(${site.sbsl})`, - type: 'site', - qxmc: qx.qxmc, - rawName: site.mc, - jd: site.jd, - wd: site.wd, - sbwz: qx.qxmc - })), - rawName: qx.qxmc, // 原始名称 - }) - ); - console.log('treeData', toRaw(treeData.value)) + treeData.value = [{ + id: -1, + name: `全部(${res.data.totalSbsl})`, + type: "root", + children: res.data.areaList.map((qx, index) => ( + { + id: qx.qxmc, + name: `${qx.qxmc}(${qx.sbsl})`, + type: 'area', + children: qx.yhzList.map(site => ({ + id: site.id, + name: `${site.mc}(${site.sbsl})`, + type: 'site', + qxmc: qx.qxmc, + rawName: site.mc, + jd: site.jd, + wd: site.wd, + sbwz: qx.qxmc + })), + rawName: qx.qxmc, // 原始名称 + }) + ) + }] + // 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 延迟确保过滤完成 }) diff --git a/packages/screen/src/views/EquipmentManagement/index.vue b/packages/screen/src/views/EquipmentManagement/index.vue index e00a818..e155bde 100644 --- a/packages/screen/src/views/EquipmentManagement/index.vue +++ b/packages/screen/src/views/EquipmentManagement/index.vue @@ -16,6 +16,8 @@ @node-click="script.handleNodeClick" accordion :filter-node-method="script.filterNode" + node-key="id" + :default-expanded-keys="[-1]" />
diff --git a/packages/screen/src/views/MaterialManagement/index.js b/packages/screen/src/views/MaterialManagement/index.js index c1c0490..edeeeaa 100644 --- a/packages/screen/src/views/MaterialManagement/index.js +++ b/packages/screen/src/views/MaterialManagement/index.js @@ -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) => ( - { - id: index, - 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, // 原始名称 - jd: site.jd, - wd: site.wd, - })), - rawName: qx.qxmc, // 原始名称 - }) - ); - console.log('treeData', toRaw(treeData.value)) + treeData.value = [{ + id: -1, + name: `全部(${res.data.totalWzsl})`, + type: "root", + children: res.data.areaList.map((qx, 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', + qxmc: qx.qxmc, + rawName: site.mc, + jd: site.jd, + wd: site.wd, + })), + rawName: qx.qxmc, // 原始名称 + }) + ) + }] + // 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 延迟确保过滤完成 }) diff --git a/packages/screen/src/views/MaterialManagement/index.vue b/packages/screen/src/views/MaterialManagement/index.vue index a1f7ab2..72b5c9c 100644 --- a/packages/screen/src/views/MaterialManagement/index.vue +++ b/packages/screen/src/views/MaterialManagement/index.vue @@ -16,6 +16,8 @@ @node-click="script.handleNodeClick" accordion :filter-node-method="script.filterNode" + node-key="id" + :default-expanded-keys="[-1]" /> diff --git a/packages/screen/src/views/ServiceStationManagePage/detailDrawer.vue b/packages/screen/src/views/ServiceStationManagePage/detailDrawer.vue index c2f2443..fe5fb75 100644 --- a/packages/screen/src/views/ServiceStationManagePage/detailDrawer.vue +++ b/packages/screen/src/views/ServiceStationManagePage/detailDrawer.vue @@ -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", diff --git a/packages/screen/src/views/SnowEventManagement/index.js b/packages/screen/src/views/SnowEventManagement/index.js index 3f7d45b..94b1c4d 100644 --- a/packages/screen/src/views/SnowEventManagement/index.js +++ b/packages/screen/src/views/SnowEventManagement/index.js @@ -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,19 +107,24 @@ const getTreeData = async () => { method: 'GET' }) if (res.code === '00000') { - treeData.value = res.data.map((qx, index) => ( - { - id: index, - name: `${qx.qxmc}(${qx.bxsjsl})`, - type: 'area', - children: qx.yhzList.map(site => ({ - id: site.id, - name: `${site.mc}(${site.bxsjsl})`, - type: 'site' - })), - rawName: qx.qxmc, // 原始名称 - }) - ); + treeData.value = [{ + id: -1, + name: `全部(${res.data.totalBxsjsl})`, + type: 'root', + children: res.data.areaList.map((qx, index) => ( + { + id: qx.qxmc, + name: `${qx.qxmc}(${qx.bxsjsl})`, + type: 'area', + children: qx.yhzList.map(site => ({ + id: site.id, + name: `${site.mc}(${site.bxsjsl})`, + type: 'site' + })), + 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) @@ -152,8 +166,8 @@ const formatDate = (date) => { if (!date) return ''; const pad = n => n.toString().padStart(2, '0'); const d = new Date(date); - return `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())} ` + - `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`; + return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ` + + `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`; }; // 获取冰雪事件列表 @@ -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 延迟确保过滤完成 }) diff --git a/packages/screen/src/views/SnowEventManagement/index.vue b/packages/screen/src/views/SnowEventManagement/index.vue index a3347fc..0036371 100644 --- a/packages/screen/src/views/SnowEventManagement/index.vue +++ b/packages/screen/src/views/SnowEventManagement/index.vue @@ -16,6 +16,8 @@ @node-click="script.handleNodeClick" accordion :filter-node-method="script.filterNode" + node-key="id" + :default-expanded-keys="[-1]" /> diff --git a/packages/screen/src/views/index.vue b/packages/screen/src/views/index.vue index 25c8d6c..63e6979 100644 --- a/packages/screen/src/views/index.vue +++ b/packages/screen/src/views/index.vue @@ -3,6 +3,9 @@

政务·渝路智管

+
+ +
@@ -17,6 +20,7 @@