Commit 64ea760a authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 9d4a4b3e fca720f0
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@chenfengyuan/vue-qrcode": "^1.0.2", "@chenfengyuan/vue-qrcode": "^1.0.2",
"@jiaminghi/data-view": "^2.10.0",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"@vue/babel-preset-app": "^4.5.13", "@vue/babel-preset-app": "^4.5.13",
"@xunlei/vue-context-menu": "^1.0.2", "@xunlei/vue-context-menu": "^1.0.2",
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",
"vue-cropper": "0.5.5", "vue-cropper": "0.5.5",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vue-seamless-scroll": "^1.1.23",
"vue2-org-tree": "^1.3.5", "vue2-org-tree": "^1.3.5",
"vuex": "3.6.0" "vuex": "3.6.0"
}, },
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>设备管理平台</title> <title>设备管理平台</title>
<link rel="stylesheet" href="https://unpkg.zhimg.com/element-ui@2.15.5/lib/theme-chalk/index.css"> <link
rel="stylesheet"
href="https://unpkg.zhimg.com/element-ui@2.15.5/lib/theme-chalk/index.css"
/>
<style>
@font-face {
font-family: "PangMenZhengDao";
src: url("./PangMenZhengDaoBiaoTiTi-1.ttf");
}
</style>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong
>We're sorry but app doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong
>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
...@@ -54,6 +54,12 @@ ...@@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;"> <div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe639;</span>
<div class="name">退出登录</div>
<div class="code-name">&amp;#xe639;</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont">&#xe627;</span> <span class="icon iconfont">&#xe627;</span>
<div class="name">系统管理-部门管理</div> <div class="name">系统管理-部门管理</div>
...@@ -114,9 +120,9 @@ ...@@ -114,9 +120,9 @@
<pre><code class="language-css" <pre><code class="language-css"
>@font-face { >@font-face {
font-family: 'iconfont'; font-family: 'iconfont';
src: url('iconfont.woff2?t=1660811949301') format('woff2'), src: url('iconfont.woff2?t=1682488711815') format('woff2'),
url('iconfont.woff?t=1660811949301') format('woff'), url('iconfont.woff?t=1682488711815') format('woff'),
url('iconfont.ttf?t=1660811949301') format('truetype'); url('iconfont.ttf?t=1682488711815') format('truetype');
} }
</code></pre> </code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
...@@ -142,6 +148,15 @@ ...@@ -142,6 +148,15 @@
<div class="content font-class"> <div class="content font-class">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-exit"></span>
<div class="name">
退出登录
</div>
<div class="code-name">.icon-exit
</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont icon-xitongguanli"></span> <span class="icon iconfont icon-xitongguanli"></span>
<div class="name"> <div class="name">
...@@ -232,6 +247,14 @@ ...@@ -232,6 +247,14 @@
<div class="content symbol"> <div class="content symbol">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-exit"></use>
</svg>
<div class="name">退出登录</div>
<div class="code-name">#icon-exit</div>
</li>
<li class="dib"> <li class="dib">
<svg class="icon svg-icon" aria-hidden="true"> <svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xitongguanli"></use> <use xlink:href="#icon-xitongguanli"></use>
......
@font-face { @font-face {
font-family: "iconfont"; /* Project id 3597207 */ font-family: "iconfont"; /* Project id 3597207 */
src: url('iconfont.woff2?t=1660811949301') format('woff2'), src: url('iconfont.woff2?t=1682488711815') format('woff2'),
url('iconfont.woff?t=1660811949301') format('woff'), url('iconfont.woff?t=1682488711815') format('woff'),
url('iconfont.ttf?t=1660811949301') format('truetype'); url('iconfont.ttf?t=1682488711815') format('truetype');
} }
.iconfont { .iconfont {
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-exit:before {
content: "\e639";
}
.icon-xitongguanli:before { .icon-xitongguanli:before {
content: "\e627"; content: "\e627";
} }
......
...@@ -5,6 +5,13 @@ ...@@ -5,6 +5,13 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "10554935",
"name": "退出登录",
"font_class": "exit",
"unicode": "e639",
"unicode_decimal": 58937
},
{ {
"icon_id": "12889883", "icon_id": "12889883",
"name": "系统管理-部门管理", "name": "系统管理-部门管理",
......
...@@ -17,7 +17,7 @@ html,body { ...@@ -17,7 +17,7 @@ html,body {
font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif; font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif;
} }
body { body {
overflow-y: scroll; overflow-y: auto;
} }
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section { body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
margin: 0; margin: 0;
......
/* 颜色 */
:root {
--project_blue: #00d1ff;
--project_yellow: #e8ba57;
--project_orange: #e77649;
}
*{
box-sizing: border-box;
}
.primary {
color: #1890ff;
}
.delete {
color: #ff4d4f;
}
.green {
color: #1bbc9b;
}
.clofff {
color: #fff;
}
.ordinary {
color: #999;
}
.wraning {
color: #ff7200;
}
.bgdel {
background-color: #ff4d4f;
}
.bgpr {
background-color: #1890ff;
}
.bgg {
background-color: #1bbc9b;
}
/* 弹性布局 */
.flex {
display: flex;
}
.flex1 {
flex: 1;
}
.flexc {
flex-direction: column;
}
.flexwrap {
flex-wrap: wrap;
}
.jcc {
justify-content: center;
}
.jca {
justify-content: space-around;
}
.jcb {
justify-content: space-between;
}
.jce {
justify-content: space-evenly;
}
.aic {
align-items: center;
}
.aca {
align-content: space-around;
}
.acb {
align-content: space-between;
}
.ace {
align-content: space-evenly;
}
/* margin */
.m10 {
margin: 10px;
}
.m15 {
margin: 15px;
}
.m20 {
margin: 20px;
}
.mt10 {
margin-top: 10px;
}
.mt15 {
margin-top: 15px;
}
.mt20 {
margin-top: 20px;
}
.mt30 {
margin-top: 30px;
}
.mt50 {
margin-top: 50px;
}
.ml10 {
margin-left: 10px;
}
.ml15 {
margin-left: 15px;
}
.ml20 {
margin-left: 20px;
}
.ml25 {
margin-left: 25px;
}
.mr10 {
margin-right: 10px;
}
.mr15 {
margin-right: 15px;
}
.mr20 {
margin-right: 20px;
}
.mr25 {
margin-right: 25px;
}
.mr50 {
margin-right: 50px;
}
.mr100 {
margin-right: 100px;
}
.mb10 {
margin-bottom: 10px;
}
.mb15 {
margin-bottom: 15px;
}
.mb20 {
margin-bottom: 20px;
}
.mb25 {
margin-bottom: 25px;
}
.mb30{
margin-bottom: 30px;
}
/* padding */
.pd10 {
padding: 10px;
}
.pd15 {
padding: 15px;
}
.pd20 {
padding: 20px;
}
.pdt10 {
padding-top: 10px;
}
.pdt15 {
padding-top: 15px;
}
.pdt20 {
padding-top: 20px;
}
.pdt30 {
padding-top: 30px;
}
.pdl8 {
padding-left: 8px;
}
.pdl10 {
padding-left: 10px;
}
.pdl15 {
padding-left: 15px;
}
.pdl20 {
padding-left: 20px;
}
.pdr10 {
padding-right: 10px;
}
.pdr15 {
padding-right: 15px;
}
.pdr20 {
padding-right: 20px;
}
.pdb10 {
padding-bottom: 10px;
}
.pdb15 {
padding-bottom: 15px;
}
.pdb20 {
padding-bottom: 20px;
}
/* 字体大小 */
.font14 {
font-size: 16px;
}
.font16 {
font-size: 16px;
}
.font18 {
font-size: 18px;
}
.font20 {
font-size: 20px;
}
.font22 {
font-size: 22px;
}
.font24 {
font-size: 24px;
}
.font26 {
font-size: 26px;
}
.font28 {
font-size: 28px;
}
.font30 {
font-size: 30px;
}
/* 字体位置 */
.tac {
text-align: center;
}
.tal {
text-align: left;
}
.tar {
text-align: right;
}
/* 加粗 */
.fontw600 {
font-weight: 600;
}
.fontw700 {
font-weight: 700;
}
.fontw800 {
font-weight: 800;
}
/* 手型鼠标 */
.pointer {
cursor: pointer;
}
.pagination {
margin-top: 10px;
text-align: right;
}
...@@ -15,7 +15,7 @@ const session = { ...@@ -15,7 +15,7 @@ const session = {
// 删除本地存储 // 删除本地存储
removeSession(key) { removeSession(key) {
sessionStorage.removeItem(key) sessionStorage.removeItem(key);
}, },
// 清空本地存储 // 清空本地存储
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
:active="submenu.path === item.path" :active="submenu.path === item.path"
:title="item.name" :title="item.name"
> >
<i :class="`iconfont ${item.icon}`"></i> <i :class="item.icon"></i>
<span> <span>
{{ item.name }} {{ item.name }}
</span> </span>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
:active="submenu.path === item.path" :active="submenu.path === item.path"
:title="item.name" :title="item.name"
> >
<i :class="'el-icon-' + item.icon"></i> <i :class="item.icon"></i>
{{ item.name }} {{ item.name }}
</router-link> </router-link>
</li> </li>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</slot> </slot>
<div slot="overlay" class="select-site" v-if="show"> <div slot="overlay" class="select-site" v-if="show">
<div class="flex_row flex_align_c primary-color name"> <div class="flex_row flex_align_c primary-color name">
<a-icon type="environment" style="margin-right: 10px" /> <i class="el-icon-location-outline"></i>
<span style="">{{ siteName }}</span> <span style="">{{ siteName }}</span>
</div> </div>
<div class="site-list"> <div class="site-list">
...@@ -112,8 +112,6 @@ export default { ...@@ -112,8 +112,6 @@ export default {
? "http://192.168.0.98:11078/base/site/siteTree" ? "http://192.168.0.98:11078/base/site/siteTree"
: process.env.VUE_APP_SITETREE_URL; : process.env.VUE_APP_SITETREE_URL;
this.$get(url).then((res) => { this.$get(url).then((res) => {
const { siteTree } = res.data; const { siteTree } = res.data;
this.sitelist = siteTree; this.sitelist = siteTree;
......
import Vue from 'vue' import Vue from "vue";
import ElementUI from 'element-ui' import ElementUI from "element-ui";
import 'element-ui/lib/theme-chalk/index.css' import "element-ui/lib/theme-chalk/index.css";
import './assets/less/base.less' import "./assets/less/base.less";
import App from './App.vue' import App from "./App.vue";
import router from './router' import router from "./router";
import store from './store' import store from "./store";
import Prototype from './assets/utils/prototype' import Prototype from "./assets/utils/prototype";
import Filter from './assets/utils/filter.js' import Filter from "./assets/utils/filter.js";
import GlobalComponents from './assets/utils/globalComponents.js' import GlobalComponents from "./assets/utils/globalComponents.js";
import Global from './assets/utils/global.js' import Global from "./assets/utils/global.js";
import VueClipboard from 'vue-clipboard2' import VueClipboard from "vue-clipboard2";
import VueAMap from 'vue-amap'; import VueAMap from "vue-amap";
import * as echarts from 'echarts' import * as echarts from "echarts";
import "@/assets/less/common.less";
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;
Vue.config.productionTip = false Vue.config.productionTip = false;
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(Prototype); Vue.use(Prototype);
Vue.use(Filter); Vue.use(Filter);
Vue.use(GlobalComponents); // 全局组件 Vue.use(GlobalComponents); // 全局组件
Vue.use(VueClipboard) Vue.use(VueClipboard);
Vue.use(VueAMap) Vue.use(VueAMap);
// 引入iconfont // 引入iconfont
import './assets/fonts/iconfont.css' import "./assets/fonts/iconfont.css";
// moment 时间处理 // moment 时间处理
import moment from 'moment'; import moment from "moment";
Vue.prototype.$moment = moment; Vue.prototype.$moment = moment;
// dataV
// 将自动注册所有组件为全局组件
import dataV from "@jiaminghi/data-view";
Vue.use(dataV);
// 滚动插件
import scroll from "vue-seamless-scroll";
Vue.use(scroll);
VueAMap.initAMapApiLoader({ VueAMap.initAMapApiLoader({
key: 'f45cca59553214543a5a77e50a7e04df', key: "f45cca59553214543a5a77e50a7e04df",
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], plugin: [
v: '1.4.4', "AMap.Scale",
uiVersion: '1.0', "AMap.OverView",
}) "AMap.ToolBar",
"AMap.MapType",
"AMap.PlaceSearch",
"AMap.Geolocation",
"AMap.Geocoder",
],
v: "1.4.4",
uiVersion: "1.0",
});
Vue.prototype.Global = Global; Vue.prototype.Global = Global;
new Vue({ new Vue({
router, router,
store, store,
render: h => h(App) render: (h) => h(App),
}).$mount('#app') }).$mount("#app");
import Vue from 'vue' import Vue from "vue";
import Router from 'vue-router' import Router from "vue-router";
import Store from './store' import Store from "./store";
import Layout from './views/Layout.vue' import Layout from "./views/Layout.vue";
import fileNotFound from './views/errors/fileNotFound.vue' import fileNotFound from "./views/errors/fileNotFound.vue";
import NProgress from 'nprogress' import NProgress from "nprogress";
import 'nprogress/nprogress.css' import "nprogress/nprogress.css";
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false });
Vue.use(Router); Vue.use(Router);
const originalPush = VueRouter.prototype.push;
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) { VueRouter.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) if (onResolve || onReject)
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location, onResolve, onReject);
} return originalPush.call(this, location).catch((err) => err);
};
const router = new Router({ const router = new Router({
routes: [ routes: [
builder('/authentication', 'login/authentication'), builder("/authentication", "login/authentication"),
builder('/login', 'login/login'), builder("/login", "login/login"),
builder('/go', 'codeGen/index'), builder("/go", "codeGen/index"),
builder('/sso', 'SSO'), builder("/sso", "SSO"),
builder("/analysis", "analysis/Analysis"), //数据分析
{ {
path: '/', path: "/",
name: 'layout', name: "layout",
component: Layout, component: Layout,
meta: { meta: {
requiresAuth: true requiresAuth: true,
}, },
children: [ children: [
...restBuilder('oper/log', 'system/log'), // 系统管理-操作日志 ...restBuilder("oper/log", "system/log"), // 系统管理-操作日志
...restBuilder('validcode', 'system/validcode'), // 接入管理-接入信息 ...restBuilder("validcode", "system/validcode"), // 接入管理-接入信息
...restBuilder('menu', 'system/menu'), // 系统管理--菜单管理 ...restBuilder("menu", "system/menu"), // 系统管理--菜单管理
...restBuilder('resource', 'system/resource'), // 系统管理--资源管理 ...restBuilder("resource", "system/resource"), // 系统管理--资源管理
...restBuilder('role', 'system/role'), // 系统管理--角色管理 ...restBuilder("role", "system/role"), // 系统管理--角色管理
...restBuilder('user', 'system/user'), // 用户管理 -- 管理用户 ...restBuilder("user", "system/user"), // 用户管理 -- 管理用户
...restBuilder('param', 'system/param'), // 系统管理--参数管理 ...restBuilder("param", "system/param"), // 系统管理--参数管理
...restBuilder('task', 'system/task'), // 系统管理--任务管理 ...restBuilder("task", "system/task"), // 系统管理--任务管理
// builder('site/list', 'system/site/index'),//站点 // builder('site/list', 'system/site/index'),//站点
...restBuilder('sitestat', 'sitestat'),//站点设备管理 ...restBuilder("sitestat", "sitestat"), //站点设备管理
builder('sitestat/maplist', 'sitestat/maplist'),//地图站点 builder("sitestat/maplist", "sitestat/maplist"), //地图站点
builder('sitestat/mapDetail', 'sitestat/mapDetail'),//地图设备 builder("sitestat/mapDetail", "sitestat/mapDetail"), //地图设备
...restBuilder('platform', 'platform'),//平台 ...restBuilder("platform", "platform"), //平台
...restBuilder('product', 'product'),//产品 ...restBuilder("product", "product"), //产品
...restBuilder('device', 'device'),//设备 ...restBuilder("device", "device"), //设备
...restBuilder('device/alarm/info', 'device/alarm/info'),//设备告警信息 ...restBuilder("device/alarm/info", "device/alarm/info"), //设备告警信息
...restBuilder('device/module', 'device/module'),//设备模块使用率 ...restBuilder("device/module", "device/module"), //设备模块使用率
...restBuilder('device/module/use', 'device/module/use'),//设备模块使用率 ...restBuilder("device/module/use", "device/module/use"), //设备模块使用率
...restBuilder('device/module/distribute', 'device/module/distribute'),//设备前端模块部署 ...restBuilder("device/module/distribute", "device/module/distribute"), //设备前端模块部署
...restBuilder('device/log', 'device/log'), ...restBuilder("device/log", "device/log"),
...restBuilder('firm', 'firm'),// ...restBuilder("firm", "firm"), //
...restBuilder('alarm/config', 'alarm/config'),//设备告警配置 ...restBuilder("alarm/config", "alarm/config"), //设备告警配置
...restBuilder('alarm/sms/send', 'alarm/sms/send'),//设备告警短信 ...restBuilder("alarm/sms/send", "alarm/sms/send"), //设备告警短信
...restBuilder("alarm/sms/send", "alarm/sms/send"), //设备告警短信
...restBuilder('product/version', 'product/version'),//产品 ...restBuilder("app/publish", "app/publish"), //产品
...restBuilder('app/publish', 'app/publish'),//产品 ...restBuilder("site", "site"), // 站点管理
...restBuilder('site', 'site'), // 站点管理
//以下为基础路由配置 //以下为基础路由配置
builder('', 'Home'), builder("", "Home"),
builder('index', 'Home'), builder("index", "Home"),
builder('login/updatePwd', 'login/updatePwd'), builder("login/updatePwd", "login/updatePwd"),
builder('403', 'errors/403'), builder("403", "errors/403"),
builder('*', 'errors/404'), builder("*", "errors/404"),
] ],
}, },
] ],
}) });
/** /**
* rest路由生成器 * rest路由生成器
...@@ -98,63 +99,69 @@ function restBuilder(path, component = path) { ...@@ -98,63 +99,69 @@ function restBuilder(path, component = path) {
function builder(path, component = path, requiresAuth = false) { function builder(path, component = path, requiresAuth = false) {
return { return {
path: path, path: path,
name: path || 'homepage', name: path || "homepage",
component: getComponent(component), component: getComponent(component),
meta: { meta: {
requiresAuth: requiresAuth requiresAuth: requiresAuth,
} },
} };
} }
function getComponent(fileName) { function getComponent(fileName) {
try { try {
return require('./views/' + fileName).default return require("./views/" + fileName).default;
} catch (error) { } catch (error) {
return fileNotFound; return fileNotFound;
} }
} }
//检查是否跳转到sso地址 //检查是否跳转到sso地址
function ssoCheck(to, from, next) { function ssoCheck(to, from, next) {
console.log("to", to) console.log("to", to);
console.log("from", from) console.log("from", from);
console.log("next", next) console.log("next", next);
let redirect = (to.path === '/login/updatePwd') ? '/#/updatePwd' : '' let redirect = to.path === "/login/updatePwd" ? "/#/updatePwd" : "";
redirect = (redirect === '' && to.path === '/login') ? (location.protocol + '//' + location.host + '/#' + from.fullPath) : redirect redirect =
if (redirect != '') { redirect === "" && to.path === "/login"
next(false) ? location.protocol + "//" + location.host + "/#" + from.fullPath
window.location.href = '//' + location.host + '/m/login/logout?redirect=' + encodeURIComponent(redirect) : redirect;
if (redirect != "") {
next(false);
window.location.href =
"//" +
location.host +
"/m/login/logout?redirect=" +
encodeURIComponent(redirect);
return true; return true;
} }
return false; return false;
} }
router.afterEach(() => { router.afterEach(() => {
document.body.scrollTop = 0 document.body.scrollTop = 0;
document.documentElement.scrollTop = 0 document.documentElement.scrollTop = 0;
NProgress.done() NProgress.done();
}) });
// 路由鉴权 // 路由鉴权
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// if (ssoCheck(to, from, next)) { //sso鉴权检查 // if (ssoCheck(to, from, next)) { //sso鉴权检查
// return // return
// } // }
NProgress.start() NProgress.start();
if (to.matched.some(record => record.meta.requiresAuth)) { if (to.matched.some((record) => record.meta.requiresAuth)) {
if (Store.state.isLogin) { if (Store.state.isLogin) {
next(); next();
} else { } else {
next({ next({
path: '/authentication', path: "/authentication",
query: { query: {
redirect: to.fullPath redirect: to.fullPath,
} },
}) });
} }
} else { } else {
next(); next();
} }
}) });
export default router; export default router;
This diff is collapsed.
<template>
<el-popover placement="bottom-start" trigger="manual" v-model="visible">
<a slot="reference" class="ant-dropdown-link" @click="visible = true">
{{ siteName }} <i class="el-icon-arrow-down"></i>
</a>
<div class="content" style="min-width: 50vw; min-height: 200px">
<div class="flex_row flex_align_c primary-color name">
<i class="el-icon-location" style="margin-right: 10px"></i>
<span style="">{{ siteName }}</span>
</div>
<div class="site-list">
<span
v-for="(item, index) in sitelist"
:key="index"
:class="{ 'primary-color': item.id == checkid }"
@click="setSite(item)"
>{{ item.label }}</span
>
</div>
<div class="check-site">
<span>您的选择是:</span>
<span
v-for="(item, index) in checkarr"
:key="index"
@click="updataSite(item)"
>{{ index > 0 ? ">" : "" }}{{ item.label }}</span
>
</div>
<div class="site-btn">
<el-button
type="primary"
size="small"
style="margin-right: 10px"
@click="onSucessSite"
:disabled="isSite"
>确定</el-button
>
<el-button size="small" @click="visible = false">取消</el-button>
</div>
</div>
</el-popover>
</template>
<script>
import session from "@/assets/utils/session.js";
export default {
data() {
return {
sitelist: [],
visible: false,
offsetLeft: 0,
checkarr: [], //选中站点
checkid: undefined, //最终选中站点
siteName: "请选择站点",
isSite: true,
};
},
computed: {},
created() {
this.getwaitedListdata();
},
mounted() {},
methods: {
// 确认站点
onSucessSite() {
if (this.checkarr.length == 0) return;
let obj = this.checkarr[this.checkarr.length - 1];
this.clickSite(obj);
},
// 选中
setSite(obj) {
this.checkid = undefined;
// 为子节点不添加数据
let data = this.checkarr[this.checkarr.length - 1];
if (data && (data.isLeaf || data.children.length == 0)) {
// 如果为子节点更新最后一个数据
this.checkid = obj.id;
this.checkarr[this.checkarr.length - 1] = obj;
} else {
this.checkarr.push(obj);
if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children;
}
}
if (obj && obj.type == "site") {
this.isSite = false;
} else {
this.isSite = true;
}
},
// 更新选中
updataSite(row) {
const { id } = row;
this.checkid = undefined;
let index = this.checkarr.findIndex((v) => v.id == id);
this.checkarr.length = index + 1;
this.sitelist = row.children;
if (row && row.type == "site") {
this.isSite = false;
} else {
this.isSite = true;
}
},
getwaitedListdata() {
let url =
process.env.VUE_APP_SITETREE_URL == "undefined"
? "http://192.168.0.98:11078/base/site/siteTree"
: process.env.VUE_APP_SITETREE_URL;
this.$get(url).then((res) => {
const { siteTree } = res.data;
this.sitelist = siteTree;
let arr = [];
const treeFn = function (e) {
e.forEach((element) => {
arr.push(element);
if (element.children && element.children.length > 0) {
treeFn(element.children);
}
});
};
const siteid = session.getSession("siteid");
treeFn(siteTree);
const siteObj = arr.find((v) => v.id == siteid);
this.siteName = siteObj ? siteObj.label : "请选择站点";
});
},
clickSite(obj) {
session.setSession("siteid", obj.id);
this.show = false;
if (location.href.search(/token/gi) >= 0) {
setTimeout(() => {
location.reload();
});
} else {
location.reload();
}
},
},
};
</script>
<style lang="less" scoped>
.ant-dropdown-link {
padding: 0px;
font-size: 16px;
min-width: 200px;
display: inline-block;
}
.content {
display: flex;
flex-direction: column;
justify-content: space-around;
.name {
font-size: 20px;
color: #1890ff;
}
.site-list {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
display: flex;
flex-wrap: wrap;
span {
line-height: 1.5;
padding: 10px 20px;
cursor: pointer;
&:hover {
color: #1890ff;
}
}
}
.check-site,
.site-btn {
padding: 0 20px;
}
.check-site {
cursor: pointer;
}
}
.trigger {
display: inline-block;
position: relative;
}
.ant-dropdown-link {
padding: 0px;
font-size: 16px;
display: inline-block;
color: #fff;
cursor: pointer;
}
.select-site {
position: fixed;
left: 300px !important;
top: 65px;
background: #fff;
border-radius: 6px;
padding: 10px;
min-width: 60%;
max-width: 80%;
z-index: 9;
color: rgba(0, 0, 0, 0.8);
font-size: 14px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
.name {
font-size: 20px;
}
.site-list {
// padding: 10px 0;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
overflow: hidden;
span {
float: left;
line-height: 1.5;
padding: 10px 20px;
cursor: pointer;
&:hover {
color: #1890ff;
}
}
}
.check-site,
.site-btn {
padding: 0 20px;
}
}
</style>
<template>
<div class="title-item">
{{ title }}
</div>
</template>
<script>
export default {
props: {
title: {
required: true,
default: "",
},
},
data() {
return {};
},
};
</script>
<style lang="less" scoped>
.title-item {
width: 436px;
height: 48px;
padding-left: 36px;
padding-top: 10px;
background: url("~@/assets/images/data/xb.png") no-repeat center;
background-size: 100% 100%;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #ffffff;
}
</style>
\ No newline at end of file
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
:key="index" :key="index"
:label="icon" :label="icon"
> >
<i :class="`iconfont ${icon}`"></i> <i :class="icon"></i>
{{ icon }} {{ icon }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
...@@ -82,13 +82,37 @@ export default { ...@@ -82,13 +82,37 @@ export default {
return { return {
toString: ["parentId", "authType", "status"], toString: ["parentId", "authType", "status"],
icons: [ icons: [
"icon-shouye", "el-icon-pie-chart",
"icon-shezhi", "el-icon-data-analysis",
"icon-xiaoxi", "el-icon-files",
"icon-xitongguanli", "el-icon-shopping-cart-1",
"icon-gaojing", "el-icon-coin",
"icon-dalou", "el-icon-guide",
"icon-xitongguanli1", "el-icon-position",
"el-icon-school",
"el-icon-office-building",
"el-icon-table-lamp",
"el-icon-house",
"el-icon-box",
"el-icon-guide",
"el-icon-odometer",
"el-icon-wallet",
"el-icon-printer",
"el-icon-document-remove",
"el-icon-tickets",
"el-icon-document-checked",
"el-icon-date",
"el-icon-folder",
"el-icon-search",
"el-icon-brush",
"el-icon-message",
"el-icon-connection",
"el-icon-sunrise",
"el-icon-lightning",
"el-icon-light-rain",
"el-icon-sunset",
"el-icon-wind-power",
"el-icon-monitor",
], ],
rules: { rules: {
name: [{ required: true, message: "请输入名称", trigger: "blur" }], name: [{ required: true, message: "请输入名称", trigger: "blur" }],
......
...@@ -1031,6 +1031,13 @@ ...@@ -1031,6 +1031,13 @@
dependencies: dependencies:
regenerator-runtime "^0.13.4" regenerator-runtime "^0.13.4"
"@babel/runtime@^7.5.5":
version "7.21.0"
resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673"
integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==
dependencies:
regenerator-runtime "^0.13.11"
"@babel/template@^7.0.0", "@babel/template@^7.14.5": "@babel/template@^7.0.0", "@babel/template@^7.14.5":
version "7.14.5" version "7.14.5"
resolved "https://registry.nlark.com/@babel/template/download/@babel/template-7.14.5.tgz?cache=0&sync_timestamp=1623280991117&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40babel%2Ftemplate%2Fdownload%2F%40babel%2Ftemplate-7.14.5.tgz" resolved "https://registry.nlark.com/@babel/template/download/@babel/template-7.14.5.tgz?cache=0&sync_timestamp=1623280991117&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40babel%2Ftemplate%2Fdownload%2F%40babel%2Ftemplate-7.14.5.tgz"
...@@ -1161,6 +1168,51 @@ ...@@ -1161,6 +1168,51 @@
cssnano-preset-default "^4.0.0" cssnano-preset-default "^4.0.0"
postcss "^7.0.0" postcss "^7.0.0"
"@jiaminghi/bezier-curve@*":
version "0.0.9"
resolved "https://registry.npmmirror.com/@jiaminghi/bezier-curve/-/bezier-curve-0.0.9.tgz#5196aca93c8b061a612b4c3eabcedf9490cef6ee"
integrity sha512-u9xJPOEl6Dri2E9FfmJoGxYQY7vYJkURNX04Vj64tdi535tPrpkuf9Sm0lNr3QTKdHQh0DdNRsaa62FLQNQEEw==
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/c-render@^0.4.3":
version "0.4.3"
resolved "https://registry.npmmirror.com/@jiaminghi/c-render/-/c-render-0.4.3.tgz#982ebd8f71b443bb9507834227834973ebd9b6d8"
integrity sha512-FJfzj5hGj7MLqqqI2D7vEzHKbQ1Ynnn7PJKgzsjXaZpJzTqs2Yw5OSeZnm6l7Qj7jyPAP53lFvEQNH4o4j6s+Q==
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/bezier-curve" "*"
"@jiaminghi/color" "*"
"@jiaminghi/transition" "*"
"@jiaminghi/charts@*":
version "0.2.18"
resolved "https://registry.npmmirror.com/@jiaminghi/charts/-/charts-0.2.18.tgz#63ded95200789fc1a1fd04b7fd9e56f58d22d90f"
integrity sha512-K+HXaOOeWG9OOY1VG6M4mBreeeIAPhb9X+khG651AbnwEwL6G2UtcAQ8GWCq6GzhczcLwwhIhuaHqRygwHC0sA==
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/c-render" "^0.4.3"
"@jiaminghi/color@*":
version "1.1.3"
resolved "https://registry.npmmirror.com/@jiaminghi/color/-/color-1.1.3.tgz#a2336750d1266155ffe80375c58c26fdec495611"
integrity sha512-ZY3hdorgODk4OSTbxyXBPxAxHPIVf9rPlKJyK1C1db46a50J0reFKpAvfZG8zMG3lvM60IR7Qawgcu4ZDO3+Hg==
"@jiaminghi/data-view@^2.10.0":
version "2.10.0"
resolved "https://registry.npmmirror.com/@jiaminghi/data-view/-/data-view-2.10.0.tgz#2146d8fc71b9f24be808238ca050ddb7a4c8949f"
integrity sha512-Cud2MTiMcqc5k2KWabR/svuVQmXHANqURo+yj40370/LdI/gyUJ6LG203hWXEnT1nMCeiv/SLVmxv3PXLScCeA==
dependencies:
"@babel/runtime" "^7.5.5"
"@jiaminghi/charts" "*"
"@jiaminghi/transition@*":
version "1.1.11"
resolved "https://registry.npmmirror.com/@jiaminghi/transition/-/transition-1.1.11.tgz#576d8af092434b34201eba5eaecc79dd33c8ad8c"
integrity sha512-owBggipoHMikDHHDW5Gc7RZYlVuvxHADiU4bxfjBVkHDAmmck+fCkm46n2JzC3j33hWvP9nSCAeh37t6stgWeg==
dependencies:
"@babel/runtime" "^7.5.5"
"@jridgewell/gen-mapping@^0.1.0": "@jridgewell/gen-mapping@^0.1.0":
version "0.1.1" version "0.1.1"
resolved "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz" resolved "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz"
...@@ -2959,6 +3011,11 @@ compression@^1.7.4: ...@@ -2959,6 +3011,11 @@ compression@^1.7.4:
safe-buffer "5.1.2" safe-buffer "5.1.2"
vary "~1.1.2" vary "~1.1.2"
comutils@^1.1.9:
version "1.1.19"
resolved "https://registry.npmmirror.com/comutils/-/comutils-1.1.19.tgz#3e07f306abf48e83726511713a72b20565034443"
integrity sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw==
concat-map@0.0.1: concat-map@0.0.1:
version "0.0.1" version "0.0.1"
resolved "https://registry.nlark.com/concat-map/download/concat-map-0.0.1.tgz" resolved "https://registry.nlark.com/concat-map/download/concat-map-0.0.1.tgz"
...@@ -7881,6 +7938,11 @@ regenerator-runtime@^0.11.0: ...@@ -7881,6 +7938,11 @@ regenerator-runtime@^0.11.0:
resolved "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz" resolved "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz"
integrity sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk= integrity sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=
regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
regenerator-runtime@^0.13.4: regenerator-runtime@^0.13.4:
version "0.13.9" version "0.13.9"
resolved "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.13.9.tgz" resolved "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.13.9.tgz"
...@@ -9540,6 +9602,13 @@ vue-router@3.4.9: ...@@ -9540,6 +9602,13 @@ vue-router@3.4.9:
resolved "https://registry.nlark.com/vue-router/download/vue-router-3.4.9.tgz" resolved "https://registry.nlark.com/vue-router/download/vue-router-3.4.9.tgz"
integrity sha1-wBb0IDCuKTLxTkdIs5odmg4lDmY= integrity sha1-wBb0IDCuKTLxTkdIs5odmg4lDmY=
vue-seamless-scroll@^1.1.23:
version "1.1.23"
resolved "https://registry.npmmirror.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz#dde81b3c79aa499791b3c3bffd0fdb22ff3e59a7"
integrity sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==
dependencies:
comutils "^1.1.9"
vue-style-loader@^4.1.0, vue-style-loader@^4.1.2: vue-style-loader@^4.1.0, vue-style-loader@^4.1.2:
version "4.1.3" version "4.1.3"
resolved "https://registry.nlark.com/vue-style-loader/download/vue-style-loader-4.1.3.tgz" resolved "https://registry.nlark.com/vue-style-loader/download/vue-style-loader-4.1.3.tgz"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment