Compare commits

...

2 Commits

6 changed files with 128 additions and 73 deletions

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

@ -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,25 +108,30 @@ 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,
id: index, name: `全部(${res.data.totalSbsl})`,
name: `${qx.qxmc}(${qx.sbsl})`, type: "root",
type: 'area', children: res.data.areaList.map((qx, index) => (
children: qx.yhzList.map(site => ({ {
id: site.id, id: index,
name: `${site.mc}(${site.sbsl})`, name: `${qx.qxmc}(${qx.sbsl})`,
type: 'site', type: 'area',
qxmc: qx.qxmc, children: qx.yhzList.map(site => ({
rawName: site.mc, id: site.id,
jd: site.jd, name: `${site.mc}(${site.sbsl})`,
wd: site.wd, type: 'site',
sbwz: qx.qxmc qxmc: qx.qxmc,
})), rawName: site.mc,
rawName: qx.qxmc, // 原始名称 jd: site.jd,
}) wd: site.wd,
); sbwz: qx.qxmc
console.log('treeData', toRaw(treeData.value)) })),
rawName: qx.qxmc, // 原始名称
})
)
}]
// 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;
} }
}; };

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,
id: index, name: `全部(${res.data.totalWzsl})`,
name: `${qx.qxmc}(${qx.wzsl})`, type: "root",
type: 'area', children: res.data.areaList.map((qx, index) => (
children: qx.yhzList.map(site => ({ {
id: site.id, id: index,
name: `${site.mc}(${site.wzsl})`, name: `${qx.qxmc}(${qx.wzsl})`,
type: 'site', type: 'area',
rawName: site.mc, // 原始名称 children: qx.yhzList.map(site => ({
jd: site.jd, id: site.id,
wd: site.wd, name: `${site.mc}(${site.wzsl})`,
})), type: 'site',
rawName: qx.qxmc, // 原始名称 qxmc: qx.qxmc,
}) rawName: site.mc,
); jd: site.jd,
console.log('treeData', toRaw(treeData.value)) wd: site.wd,
})),
rawName: qx.qxmc, // 原始名称
})
)
}]
// console.log('treeData', toRaw(treeData.value))
} else { } else {
throw new Error(res.message); throw new Error(res.message);
} }
@ -148,25 +158,29 @@ 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; 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
yhzData.value = null; // 重置养护站信息 qxmc.value = data.rawName; // 保存区县名称
qxmc.value = data.id; // 保存区县名称 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 = ''; // 重置区县名称
return;
} }
}; };

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,19 +107,24 @@ 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,
id: index, name: `全部(${res.data.totalBxsjsl})`,
name: `${qx.qxmc}(${qx.bxsjsl})`, type: 'root',
type: 'area', children: res.data.areaList.map((qx, index) => (
children: qx.yhzList.map(site => ({ {
id: site.id, id: index,
name: `${site.mc}(${site.bxsjsl})`, name: `${qx.qxmc}(${qx.bxsjsl})`,
type: 'site' type: 'area',
})), children: qx.yhzList.map(site => ({
rawName: qx.qxmc, // 原始名称 id: site.id,
}) name: `${site.mc}(${site.bxsjsl})`,
); type: 'site'
})),
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]) : '',

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);