diff --git a/src/assets/scss/dataBoard/listBox.scss b/src/assets/scss/dataBoard/listBox.scss index 56d538a25..e33b8383c 100644 --- a/src/assets/scss/dataBoard/listBox.scss +++ b/src/assets/scss/dataBoard/listBox.scss @@ -1,15 +1,55 @@ -.m-listbox-main{ +.g-pgi { min-height: 100%; box-sizing: border-box; - margin-left:16px; - - .g-listbox{ - - } + padding: 0 25px 50px; +} +.m-title { + display: flex; + align-items: center; + margin-top: 15px; -} + .title_img { + width: 17px; + height: 17px; + } + .tip_title { + margin-left: 8px; + font-size: 16px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: #ffffff; + line-height: 22px; + } + .title_line { + margin-left: 8px; + width: 244px; + height: 1px; + background: linear-gradient(270deg, rgba(55, 198, 255, 0.1) 0%, #1995ff 100%); + } + .second-select { + margin: 0 10px 0 10px; + ::v-deep .el-input { + width: 180px; + height: 36px; + .el-input__inner { + height: 100%; + padding: 0 10px; + color: #fff; + line-height: 36px; + background: #06186d; + border: 1px solid #1a64cc; + } + .el-icon-arrow-up:before { + content: "\e78f"; + } + // .el-select__caret:before { + // content: '\E790' + // } + } + } +} diff --git a/src/assets/scss/dataBoard/renfang/index.scss b/src/assets/scss/dataBoard/renfang/index.scss index ab4abc8ab..ca35bb0d7 100644 --- a/src/assets/scss/dataBoard/renfang/index.scss +++ b/src/assets/scss/dataBoard/renfang/index.scss @@ -267,7 +267,10 @@ height: 115px; } .m-rkyj { - height: 253px; + height: 423px; + &.z-shrink { + height: 253px; + } } .m-per { diff --git a/src/router/index.js b/src/router/index.js index 4dbf47817..257509d9b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,375 +9,424 @@ Vue.use(Router); const CUSTOMER = process.env.VUE_APP_CUSTOMER; // 页面路由(独立页面) export const pageRoutes = [ - { - path: "/login", - component: () => import("@/views/pages/login"), - name: "login", - meta: { - title: "登录", - }, - }, - { - path: "/", - name: "index", - // component: () => import("@/views/pages/index"), - redirect: { - path: "/main/home", - }, - }, - { - path: "/404", - component: () => import("@/views/pages/404"), - name: "404", - meta: { - title: "404未找到", - }, - beforeEnter(to, from, next) { - // 拦截处理特殊业务场景 - // 如果, 重定向路由包含__双下划线, 为临时添加路由 - if (/__.*/.test(to.redirectedFrom)) { - return next(to.redirectedFrom.replace(/__.*/, "")); - } - next(); - }, - }, + { + path: "/login", + component: () => import("@/views/pages/login"), + name: "login", + meta: { + title: "登录", + }, + }, + { + path: "/", + name: "index", + // component: () => import("@/views/pages/index"), + redirect: { + path: "/main/home", + }, + }, + { + path: "/404", + component: () => import("@/views/pages/404"), + name: "404", + meta: { + title: "404未找到", + }, + beforeEnter(to, from, next) { + // 拦截处理特殊业务场景 + // 如果, 重定向路由包含__双下划线, 为临时添加路由 + if (/__.*/.test(to.redirectedFrom)) { + return next(to.redirectedFrom.replace(/__.*/, "")); + } + next(); + }, + }, ]; // 模块路由(基于主入口布局页面) export const moduleRoutes = { - path: "/main", - component: () => import("@/views/main"), - name: "main", - redirect: { - path: "/main/home", - }, - meta: { - title: "主入口布局", - isTab: false, - }, - children: [ - { - path: "home", - component: () => import("@/views/modules/home/index"), - name: "home", - meta: { - title: "首页", - isTab: true, - }, - }, - { - path: "unopen", - component: () => import("@/views/modules/unopen"), - name: "unopen", - meta: { - title: "未开放功能", - isTab: true, - }, - }, - { - path: "404", - props: true, - component: () => import("@/views/modules/404"), - name: "main-404", - meta: { - title: "页面未找到或无权访问", - isTab: false, - }, - }, - { - path: "home-notice", - props: true, - name: "home-notice", - component: () => import("@/views/modules/home/notice"), - meta: { - isTab: true, - title: "智能提醒", - parent: [ - { - title: "首页", - path: "/main/home-index", - }, - ], - }, - }, - { - path: "shequ-chaxun", - props: true, - name: "shequ-chaxun", - component: () => import("@/views/modules/shequ/chaxun"), - meta: { - isTab: true, - title: "社区查询", - }, - }, - ], + path: "/main", + component: () => import("@/views/main"), + name: "main", + redirect: { + path: "/main/home", + }, + meta: { + title: "主入口布局", + isTab: false, + }, + children: [ + { + path: "home", + component: () => import("@/views/modules/home/index"), + name: "home", + meta: { + title: "首页", + isTab: true, + }, + }, + { + path: "unopen", + component: () => import("@/views/modules/unopen"), + name: "unopen", + meta: { + title: "未开放功能", + isTab: true, + }, + }, + { + path: "404", + props: true, + component: () => import("@/views/modules/404"), + name: "main-404", + meta: { + title: "页面未找到或无权访问", + isTab: false, + }, + }, + { + path: "home-notice", + props: true, + name: "home-notice", + component: () => import("@/views/modules/home/notice"), + meta: { + isTab: true, + title: "智能提醒", + parent: [ + { + title: "首页", + path: "/main/home-index", + }, + ], + }, + }, + { + path: "shequ-chaxun", + props: true, + name: "shequ-chaxun", + component: () => import("@/views/modules/shequ/chaxun"), + meta: { + isTab: true, + title: "社区查询", + }, + }, + ], }; // pc端菜单的 如果没有配置 默认的 或者配置了默认的 但没有权限 默认选中第一 function cookApiDataItem(item) { - function n2one(v) { - let ret = []; - for (let i = 0; i < v.length; i++) { - // console.log("xxxxx", v[i]); - ret.push(v[i]); - if (Array.isArray(v[i].children) && v[i].children.length > 0) { - ret.push(...n2one(v[i].children)); - } - } - // console.log("aaaa", ret); - return ret; - } + function n2one(v) { + let ret = []; + for (let i = 0; i < v.length; i++) { + // console.log("xxxxx", v[i]); + ret.push(v[i]); + if (Array.isArray(v[i].children) && v[i].children.length > 0) { + ret.push(...n2one(v[i].children)); + } + } + // console.log("aaaa", ret); + return ret; + } - let allChildrenUrl = n2one(item.children) - .filter((i) => i.url != "" && i.showFlag == 1) - .map((i) => i.url); - // console.log("))))))))))))", allChildrenUrl); + let allChildrenUrl = n2one(item.children) + .filter((i) => i.url != "" && i.showFlag == 1) + .map((i) => i.url); + // console.log("))))))))))))", allChildrenUrl); - if (item.children.length > 0) { - if (item.url == "" || !allChildrenUrl.find((i) => i.url == item.url)) { - item.url = allChildrenUrl[0]; - } - } - // item.children.forEach((item) => { - // item.color = "#f00"; - // return item; - // }); - return item; + if (item.children.length > 0) { + if (item.url == "" || !allChildrenUrl.find((i) => i.url == item.url)) { + item.url = allChildrenUrl[0]; + } + } + // item.children.forEach((item) => { + // item.color = "#f00"; + // return item; + // }); + return item; } // 把按钮都化为页面内部的权限 function cookApiDataItem2(item) { - let { children } = item; - if (children && Array.isArray(children) && children.length > 0) { - let btns = item.children.filter((item) => item.type == 1); - item.btns = btns; - item.children = item.children - .filter((val) => val.type == 0) - .map((val) => cookApiDataItem2(val)); - } - return item; + let { children } = item; + if (children && Array.isArray(children) && children.length > 0) { + let btns = item.children.filter((item) => item.type == 1); + item.btns = btns; + item.children = item.children + .filter((val) => val.type == 0) + .map((val) => cookApiDataItem2(val)); + } + return item; } // 把父级拼到子集 function cookApiDataItem3(item, parent = []) { - item.parent = parent; - let { children } = item; - if (children && Array.isArray(children) && children.length > 0) { - item.children = children.map((val) => - cookApiDataItem3(val, [ - ...parent, - { - title: item.name || "", - path: (item.url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => - eval(s2) - ), - }, - ]) - ); - } - return item; + item.parent = parent; + let { children } = item; + if (children && Array.isArray(children) && children.length > 0) { + item.children = children.map((val) => + cookApiDataItem3(val, [ + ...parent, + { + title: item.name || "", + path: (item.url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => + eval(s2) + ), + }, + ]) + ); + } + return item; } // 新数据模块 export const dataBoardRoutes = { - path: "/dataBoard", - component: () => import("@/views/dataBoardMain/main"), - name: "dataBoard", - redirect: { - path: "/dataBoard/renfang/index", - }, - meta: { - title: "主入口布局", - }, - children: [ - { - path: "renfang/index", - props: true, - component: () => import("@/views/dataBoard/renfang/index"), - name: "dataBoard-renfang-index", - meta: { - title: "人房总览", - isTab: false, - }, - }, - { - path: "404", - props: true, - component: () => import("@/views/dataBoard/404"), - name: "dataBoard-404", - meta: { - title: "页面未找到或无权访问", - isTab: false, - }, - beforeEnter(to, from, next) { - // 拦截处理特殊业务场景 - // 如果, 重定向路由包含__双下划线, 为临时添加路由 - if (/__.*/.test(to.redirectedFrom)) { - return next(to.redirectedFrom.replace(/__.*/, "")); - } - next(); - }, - }, - ], + path: "/dataBoard", + component: () => import("@/views/dataBoardMain/main"), + name: "dataBoard", + redirect: { + path: "/dataBoard/renfang/index", + }, + meta: { + title: "主入口布局", + }, + children: [ + { + path: "renfang/index", + props: true, + component: () => import("@/views/dataBoard/renfang/index"), + name: "dataBoard-renfang-index", + meta: { + title: "人房总览", + isTab: false, + }, + }, + { + path: "renfang/resi-list", + props: true, + component: () => import("@/views/dataBoard/renfang/resi/list"), + name: "dataBoard-renfang-resi-list", + meta: { + title: "居民列表", + isTab: false, + }, + }, + { + path: "renfang/resi-class", + props: true, + component: () => import("@/views/dataBoard/renfang/resi/class"), + name: "dataBoard-renfang-resi-class", + meta: { + title: "居民分类列表", + isTab: false, + }, + }, + { + path: "renfang/house-list", + props: true, + component: () => import("@/views/dataBoard/renfang/house/list"), + name: "dataBoard-renfang-house-list", + meta: { + title: "房屋列表", + isTab: false, + }, + }, + { + path: "renfang/warn-building", + props: true, + component: () => import("@/views/dataBoard/renfang/warn/building"), + name: "dataBoard-renfang-warn-building", + meta: { + title: "预警楼栋列表", + isTab: false, + }, + }, + { + path: "renfang/warn-resi", + props: true, + component: () => import("@/views/dataBoard/renfang/warn/resi"), + name: "dataBoard-renfang-warn-resi", + meta: { + title: "预警楼栋居民", + isTab: false, + }, + }, + { + path: "404", + props: true, + component: () => import("@/views/dataBoard/404"), + name: "dataBoard-404", + meta: { + title: "页面未找到或无权访问", + isTab: false, + }, + beforeEnter(to, from, next) { + // 拦截处理特殊业务场景 + // 如果, 重定向路由包含__双下划线, 为临时添加路由 + if (/__.*/.test(to.redirectedFrom)) { + return next(to.redirectedFrom.replace(/__.*/, "")); + } + next(); + }, + }, + ], }; // 模块路由(基于主入口布局页面) 可视化数据 export const moduleShujuRoutes = { - path: "/main-shuju", - component: () => import("@/views/main-shuju/main"), - name: "main-shuju", - redirect: { - path: "/main-shuju/visual-basicinfo-basicInfoMain", - }, - meta: { - title: "主入口布局", - }, - children: [ - { - path: "/main-shuju/visual-basicinfo-people/:uid", - props: true, - component: () => import("@/views/modules/visual/basicinfo/people"), - name: "visual-basicinfo-people", - meta: { - title: "个人详情", - isTab: false, - }, - }, - { - path: "/main-shuju/visual-basicinfo-people-list", - props: true, - component: () => import("@/views/modules/visual/basicinfo/peopleList"), - name: "visual-basicinfo-people-list", - meta: { - title: "人员列表", - isTab: false, - }, - }, - { - path: "404", - props: true, - component: () => import("@/views/modules/visual/404"), - name: "main-shuju-404", - meta: { - title: "页面未找到或无权访问", - isTab: false, - }, - }, - ], + path: "/main-shuju", + component: () => import("@/views/main-shuju/main"), + name: "main-shuju", + redirect: { + path: "/main-shuju/visual-basicinfo-basicInfoMain", + }, + meta: { + title: "主入口布局", + }, + children: [ + { + path: "/main-shuju/visual-basicinfo-people/:uid", + props: true, + component: () => import("@/views/modules/visual/basicinfo/people"), + name: "visual-basicinfo-people", + meta: { + title: "个人详情", + isTab: false, + }, + }, + { + path: "/main-shuju/visual-basicinfo-people-list", + props: true, + component: () => + import("@/views/modules/visual/basicinfo/peopleList"), + name: "visual-basicinfo-people-list", + meta: { + title: "人员列表", + isTab: false, + }, + }, + { + path: "404", + props: true, + component: () => import("@/views/modules/visual/404"), + name: "main-shuju-404", + meta: { + title: "页面未找到或无权访问", + isTab: false, + }, + }, + ], }; export function addDynamicRoute(routeParams, router) { - // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 - var routeName = routeParams.routeName; - var dynamicRoute = window.SITE_CONFIG["dynamicRoutes"].filter( - (item) => item.name === routeName - )[0]; - if (dynamicRoute) { - return router.push({ - name: routeName, - params: routeParams.params, - }); - } - // 否则: 添加并全局变量保存, 再跳转 - dynamicRoute = { - path: routeName, - component: () => import(`@/views/modules/${routeParams.path}`), - name: routeName, - meta: { - ...window.SITE_CONFIG["contentTabDefault"], - menuId: routeParams.menuId, - title: `${routeParams.title}`, - }, - }; - router.addRoutes([ - { - ...moduleRoutes, - name: `main-dynamic__${dynamicRoute.name}`, - children: [dynamicRoute], - }, - ]); - window.SITE_CONFIG["dynamicRoutes"].push(dynamicRoute); - router.push({ - name: dynamicRoute.name, - params: routeParams.params, - }); + // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 + var routeName = routeParams.routeName; + var dynamicRoute = window.SITE_CONFIG["dynamicRoutes"].filter( + (item) => item.name === routeName + )[0]; + if (dynamicRoute) { + return router.push({ + name: routeName, + params: routeParams.params, + }); + } + // 否则: 添加并全局变量保存, 再跳转 + dynamicRoute = { + path: routeName, + component: () => import(`@/views/modules/${routeParams.path}`), + name: routeName, + meta: { + ...window.SITE_CONFIG["contentTabDefault"], + menuId: routeParams.menuId, + title: `${routeParams.title}`, + }, + }; + router.addRoutes([ + { + ...moduleRoutes, + name: `main-dynamic__${dynamicRoute.name}`, + children: [dynamicRoute], + }, + ]); + window.SITE_CONFIG["dynamicRoutes"].push(dynamicRoute); + router.push({ + name: dynamicRoute.name, + params: routeParams.params, + }); } const router = new Router({ - mode: "hash", - scrollBehavior: () => ({ - y: 0, - }), - routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes, dataBoardRoutes), + mode: "hash", + scrollBehavior: () => ({ + y: 0, + }), + routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes, dataBoardRoutes), }); router.beforeEach((to, from, next) => { - // 添加动态(菜单)路由 - // 已添加或者当前路由为页面路由, 可直接访问 - if (to.name === "caiji") { - return next(); - } - if ( - window.SITE_CONFIG["dynamicMenuRoutesHasAdded"] || - fnCurrentRouteIsPageRoute(to, pageRoutes) - ) { - return next(); - } + // 添加动态(菜单)路由 + // 已添加或者当前路由为页面路由, 可直接访问 + if (to.name === "caiji") { + return next(); + } + if ( + window.SITE_CONFIG["dynamicMenuRoutesHasAdded"] || + fnCurrentRouteIsPageRoute(to, pageRoutes) + ) { + return next(); + } - const customerId = localStorage.getItem("customerId"); - console.log("customerId:", customerId); + const customerId = localStorage.getItem("customerId"); + console.log("customerId:", customerId); - http - .get("gov/access/menu/navDigitalCommunity?tableName=data_menu") - .then(({ data: res }) => { - if (res.code == 10005 || res.code == 10006 || res.code == 10007) { - // 10005 token为空 10006登陆超时 10007别处登录 - console.log("登录失效"); - Vue.prototype.$message.error(res.msg); - return next({ - name: "login", - }); - } + http.get("gov/access/menu/navDigitalCommunity?tableName=data_menu") + .then(({ data: res }) => { + if (res.code == 10005 || res.code == 10006 || res.code == 10007) { + // 10005 token为空 10006登陆超时 10007别处登录 + console.log("登录失效"); + Vue.prototype.$message.error(res.msg); + return next({ + name: "login", + }); + } - window.SITE_CONFIG["menuShujuList"] = res.data; - fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]); + window.SITE_CONFIG["menuShujuList"] = res.data; + fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]); - next({ - ...to, - replace: true, - }); - }) - .catch(() => { - next({ - name: "login", - }); - }); + next({ + ...to, + replace: true, + }); + }) + .catch(() => { + next({ + name: "login", + }); + }); - http - .get("gov/access/menu/navDigitalCommunity") - .then(({ data: res }) => { - if (res.code == 10005 || res.code == 10006 || res.code == 10007) { - // 10005 token为空 10006登陆超时 10007别处登录 - console.log("登录失效"); - Vue.prototype.$message.error(res.msg); - return next({ - name: "login", - }); - } - window.SITE_CONFIG["menuList"] = res.data - .map((item) => cookApiDataItem3(item)) - .map((item) => cookApiDataItem2(item)) - .map((item) => cookApiDataItem(item)); - fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); - // next({ ...to, replace: true }) - next({ - ...to, - replace: true, - }); - }) - .catch(() => { - // next({ - // name: "login", - // }); - }); + http.get("gov/access/menu/navDigitalCommunity") + .then(({ data: res }) => { + if (res.code == 10005 || res.code == 10006 || res.code == 10007) { + // 10005 token为空 10006登陆超时 10007别处登录 + console.log("登录失效"); + Vue.prototype.$message.error(res.msg); + return next({ + name: "login", + }); + } + window.SITE_CONFIG["menuList"] = res.data + .map((item) => cookApiDataItem3(item)) + .map((item) => cookApiDataItem2(item)) + .map((item) => cookApiDataItem(item)); + fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); + // next({ ...to, replace: true }) + next({ + ...to, + replace: true, + }); + }) + .catch(() => { + // next({ + // name: "login", + // }); + }); }); /** @@ -386,16 +435,16 @@ router.beforeEach((to, from, next) => { * @param {*} pageRoutes 页面路由 */ function fnCurrentRouteIsPageRoute(route, pageRoutes = []) { - var temp = []; - for (var i = 0; i < pageRoutes.length; i++) { - if (route.path === pageRoutes[i].path) { - return true; - } - if (pageRoutes[i].children && pageRoutes[i].children.length >= 1) { - temp = temp.concat(pageRoutes[i].children); - } - } - return temp.length >= 1 ? fnCurrentRouteIsPageRoute(route, temp) : false; + var temp = []; + for (var i = 0; i < pageRoutes.length; i++) { + if (route.path === pageRoutes[i].path) { + return true; + } + if (pageRoutes[i].children && pageRoutes[i].children.length >= 1) { + temp = temp.concat(pageRoutes[i].children); + } + } + return temp.length >= 1 ? fnCurrentRouteIsPageRoute(route, temp) : false; } /** @@ -404,154 +453,160 @@ function fnCurrentRouteIsPageRoute(route, pageRoutes = []) { * @param {*} routes 递归创建的动态(菜单)路由 */ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { - var temp = []; - for (var i = 0; i < menuList.length; i++) { - if (menuList[i].children && menuList[i].children.length >= 1) { - temp = temp.concat(menuList[i].children); - // continue; - } - // 组装路由 - var route = { - path: "", - component: null, - name: "", - meta: { - ...window.SITE_CONFIG["contentTabDefault"], - menuId: menuList[i].id, - title: menuList[i].name, - btns: menuList[i].btns || [], - parent: menuList[i].parent || [], - }, - }; - // eslint-disable-next-line - let URL = (menuList[i].url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => - eval(s2) - ); // URL支持{{ window.xxx }}占位符变量 - if (isURL(URL)) { - if (menuList[i].children && menuList[i].children.length >= 1) { - let item = menuList[i].children.find( - (subMenu) => subMenu.url == menuList[i].url - ); - if (item) { - route["path"] = route["name"] = `i-${menuList[i].id}`; - route["redirect"] = `i-${item.id}`; - } else { - route["path"] = route["name"] = `i-${menuList[i].id}`; - route["meta"]["iframeURL"] = URL; - } - } else { - route["path"] = route["name"] = `i-${menuList[i].id}`; - route["meta"]["iframeURL"] = URL; - } - } else { - URL = URL.replace(/^\//, "").replace(/_/g, "-"); - if (URL.startsWith("unopen")) { - route["path"] = route["name"] = URL.replace(/\//g, "-"); - route["component"] = () => import(`@/views/modules/unopen`); - } else if (menuList[i].children && menuList[i].children.length >= 1) { - route["path"] = route["name"] = URL; - route["redirect"] = URL.replace(/\//g, "-"); - } else { - route["path"] = route["name"] = URL.replace(/\//g, "-"); - route["component"] = () => import(`@/views/modules/${URL}`); - } - } - routes.push(route); - } - if (temp.length >= 1) { - return fnAddDynamicMenuRoutes(temp, routes); - } - // routers.reverse(); - // 添加路由 - router.addRoutes([ - { - ...moduleRoutes, - name: "main-dynamic-menu", - children: routes, - }, - { - path: "/main/*", - redirect: { - path: "/main/404", - }, - }, - ]); - window.SITE_CONFIG["dynamicMenuRoutes"] = routes; - window.SITE_CONFIG["dynamicMenuRoutesHasAdded"] = true; + var temp = []; + for (var i = 0; i < menuList.length; i++) { + if (menuList[i].children && menuList[i].children.length >= 1) { + temp = temp.concat(menuList[i].children); + // continue; + } + // 组装路由 + var route = { + path: "", + component: null, + name: "", + meta: { + ...window.SITE_CONFIG["contentTabDefault"], + menuId: menuList[i].id, + title: menuList[i].name, + btns: menuList[i].btns || [], + parent: menuList[i].parent || [], + }, + }; + // eslint-disable-next-line + let URL = (menuList[i].url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => + eval(s2) + ); // URL支持{{ window.xxx }}占位符变量 + if (isURL(URL)) { + if (menuList[i].children && menuList[i].children.length >= 1) { + let item = menuList[i].children.find( + (subMenu) => subMenu.url == menuList[i].url + ); + if (item) { + route["path"] = route["name"] = `i-${menuList[i].id}`; + route["redirect"] = `i-${item.id}`; + } else { + route["path"] = route["name"] = `i-${menuList[i].id}`; + route["meta"]["iframeURL"] = URL; + } + } else { + route["path"] = route["name"] = `i-${menuList[i].id}`; + route["meta"]["iframeURL"] = URL; + } + } else { + URL = URL.replace(/^\//, "").replace(/_/g, "-"); + if (URL.startsWith("unopen")) { + route["path"] = route["name"] = URL.replace(/\//g, "-"); + route["component"] = () => import(`@/views/modules/unopen`); + } else if ( + menuList[i].children && + menuList[i].children.length >= 1 + ) { + route["path"] = route["name"] = URL; + route["redirect"] = URL.replace(/\//g, "-"); + } else { + route["path"] = route["name"] = URL.replace(/\//g, "-"); + route["component"] = () => import(`@/views/modules/${URL}`); + } + } + routes.push(route); + } + if (temp.length >= 1) { + return fnAddDynamicMenuRoutes(temp, routes); + } + // routers.reverse(); + // 添加路由 + router.addRoutes([ + { + ...moduleRoutes, + name: "main-dynamic-menu", + children: routes, + }, + { + path: "/main/*", + redirect: { + path: "/main/404", + }, + }, + ]); + window.SITE_CONFIG["dynamicMenuRoutes"] = routes; + window.SITE_CONFIG["dynamicMenuRoutesHasAdded"] = true; } function fnAddDynamicMenuRoutes2(menuList = [], routes = []) { - var temp = []; - for (var i = 0; i < menuList.length; i++) { - if (menuList[i].children && menuList[i].children.length >= 1) { - temp = temp.concat(menuList[i].children); - continue; - } - // 组装路由 - var route = { - path: "", - component: null, - name: "", - meta: { - // ...window.SITE_CONFIG["contentTabDefault"], - menuId: menuList[i].id, - title: menuList[i].name, - }, - }; - // eslint-disable-next-line - let URL = (menuList[i].url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => - eval(s2) - ); // URL支持{{ window.xxx }}占位符变量 - if (isURL(URL)) { - if (menuList[i].children && menuList[i].children.length >= 1) { - let item = menuList[i].children.find( - (subMenu) => subMenu.url == menuList[i].url - ); - if (item) { - route["path"] = route["name"] = `i-${menuList[i].id}`; - route["redirect"] = `i-${item.id}`; - } else { - route["path"] = route["name"] = `i-${menuList[i].id}`; - route["meta"]["iframeURL"] = URL; - } - } else { - route["path"] = route["name"] = `i-${menuList[i].id}`; - route["meta"]["iframeURL"] = URL; - } - } else { - URL = URL.replace(/^\//, "").replace(/_/g, "-"); - if (URL.startsWith("unopen")) { - route["path"] = route["name"] = URL.replace(/\//g, "-"); - route["component"] = () => import(`@/views/modules/unopen`); - } else if (menuList[i].children && menuList[i].children.length >= 1) { - route["path"] = route["name"] = URL; - route["redirect"] = URL.replace(/\//g, "-"); - } else { - route["path"] = route["name"] = URL.replace(/\//g, "-"); - route["component"] = () => import(`@/views/modules/${URL}`); - } - } - routes.push(route); - } - if (temp.length >= 1) { - return fnAddDynamicMenuRoutes2(temp, routes); - } - // 添加路由 - router.addRoutes([ - { - ...moduleShujuRoutes, - name: "main-dynamic-menu-shuju", - children: routes, - }, - { - path: "/main-shuju/*", - redirect: { - path: "/main-shuju/404", - }, - }, - ]); - window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes; - window.SITE_CONFIG["dynamicMenuRoutesShujuHasAdded"] = true; + var temp = []; + for (var i = 0; i < menuList.length; i++) { + if (menuList[i].children && menuList[i].children.length >= 1) { + temp = temp.concat(menuList[i].children); + continue; + } + // 组装路由 + var route = { + path: "", + component: null, + name: "", + meta: { + // ...window.SITE_CONFIG["contentTabDefault"], + menuId: menuList[i].id, + title: menuList[i].name, + }, + }; + // eslint-disable-next-line + let URL = (menuList[i].url || "").replace(/{{([^}}]+)?}}/g, (s1, s2) => + eval(s2) + ); // URL支持{{ window.xxx }}占位符变量 + if (isURL(URL)) { + if (menuList[i].children && menuList[i].children.length >= 1) { + let item = menuList[i].children.find( + (subMenu) => subMenu.url == menuList[i].url + ); + if (item) { + route["path"] = route["name"] = `i-${menuList[i].id}`; + route["redirect"] = `i-${item.id}`; + } else { + route["path"] = route["name"] = `i-${menuList[i].id}`; + route["meta"]["iframeURL"] = URL; + } + } else { + route["path"] = route["name"] = `i-${menuList[i].id}`; + route["meta"]["iframeURL"] = URL; + } + } else { + URL = URL.replace(/^\//, "").replace(/_/g, "-"); + if (URL.startsWith("unopen")) { + route["path"] = route["name"] = URL.replace(/\//g, "-"); + route["component"] = () => import(`@/views/modules/unopen`); + } else if ( + menuList[i].children && + menuList[i].children.length >= 1 + ) { + route["path"] = route["name"] = URL; + route["redirect"] = URL.replace(/\//g, "-"); + } else { + route["path"] = route["name"] = URL.replace(/\//g, "-"); + route["component"] = () => import(`@/views/modules/${URL}`); + } + } + routes.push(route); + } + if (temp.length >= 1) { + return fnAddDynamicMenuRoutes2(temp, routes); + } + // 添加路由 + router.addRoutes([ + { + ...moduleShujuRoutes, + name: "main-dynamic-menu-shuju", + children: routes, + }, + { + path: "/main-shuju/*", + redirect: { + path: "/main-shuju/404", + }, + }, + ]); + window.SITE_CONFIG["dynamicMenuRoutesShuju"] = routes; + window.SITE_CONFIG["dynamicMenuRoutesShujuHasAdded"] = true; } export default router; diff --git a/src/views/dataBoard/cpts/bread.vue b/src/views/dataBoard/cpts/bread.vue index e4ad2e52b..c2ba6f0ba 100644 --- a/src/views/dataBoard/cpts/bread.vue +++ b/src/views/dataBoard/cpts/bread.vue @@ -31,7 +31,7 @@ import ScreenLoading from "./loading"; import { mapGetters } from "vuex"; export default { - name: "table", + name: "bread", components: { ScreenLoading, }, diff --git a/src/views/dataBoard/cpts/map/popup.vue b/src/views/dataBoard/cpts/map/popup.vue index 5b53fe058..5cffd9376 100644 --- a/src/views/dataBoard/cpts/map/popup.vue +++ b/src/views/dataBoard/cpts/map/popup.vue @@ -2,50 +2,58 @@
+ 居民信息
+
+ 小区信息
+
+ 楼栋信息
+
+ 房屋信息
+
- | - {{ item }} - | -
|---|
|
-
- {{ item }}
-
-
-
-
-
-
-
-
-
- {{ btn }}
- {{ item.name }}
-
-
-
- {{ index + 1 }}
- |
-
-
+
+
+ {{ index + 1 }}
+
+
{{ dataitem.yellow }}栋
-
{{ dataitem.red }}栋
-
{{ dataitem.yellow_warn }}栋 ({{
+ dataitem.yellow_threshold
+ }})
{{ dataitem.red_warn }}栋 ({{ dataitem.red_threshold }})
+
人口预警
+
+
+
+