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..e866870 100644 --- a/packages/screen/src/views/EquipmentManagement/index.js +++ b/packages/screen/src/views/EquipmentManagement/index.js @@ -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: 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)) } 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; } }; diff --git a/packages/screen/src/views/MaterialManagement/index.js b/packages/screen/src/views/MaterialManagement/index.js index c1c0490..2bdf86e 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: index, + 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,29 @@ 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' && 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 - yhzData.value = null; // 重置养护站信息 - qxmc.value = data.id; // 保存区县名称 - + qxmc.value = data.rawName; // 保存区县名称 + return; } if (data.type === 'site') { console.log('你点击的是站点', data.name) yhzid.value = data.id; // 保存养护站id - yhzData.value = data; // 保存养护站信息 qxmc.value = ''; // 重置区县名称 + return; } }; 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..a0ae615 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: 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, // 原始名称 + }) + ) + }] 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]) : '', 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 @@