This commit is contained in:
weipengfei 2024-01-16 10:57:29 +08:00
parent ab83fa876f
commit 6443174f14
4 changed files with 153 additions and 127 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -7,6 +7,8 @@ import {getStore, setStore} from "../assets/js/storage";
import {createRoute, isTokenExpired} from "../assets/js/utils"; import {createRoute, isTokenExpired} from "../assets/js/utils";
import config from "../config/config"; import config from "../config/config";
import {refreshAccessToken} from "../api/common/common"; import {refreshAccessToken} from "../api/common/common";
import dataV from "@/views/datav/dataV";
import copyV from "@/views/datav/copyV";
let HOME_PAGE = config.HOME_PAGE; let HOME_PAGE = config.HOME_PAGE;
const currentOrganization = getStore('currentOrganization', true); const currentOrganization = getStore('currentOrganization', true);
@ -21,9 +23,32 @@ const routes = [].concat(
// const router = new Router({ // const router = new Router({
// routes: routers // routes: routers
// }); // });
function checkPropertyValue(obj, targetValue) {
// 检查当前对象是否是目标值
if (obj === targetValue) {
return true;
}
// 检查当前对象是否为对象类型
if (typeof obj === 'object') {
// 遍历对象的所有属性
for (let key in obj) {
// 递归调用检查属性值
if (checkPropertyValue(obj[key], targetValue)) {
return true;
}
}
}
// 如果没有找到目标值,则返回 false
return false;
}
const menu = getStore('menu', true); const menu = getStore('menu', true);
if (menu) { if (menu) {
menu.forEach(function (v) { menu.forEach(function (v) {
if(checkPropertyValue(v, 'datasv'))return;
if(checkPropertyValue(v, 'copysv'))return;
routes.push(createRoute(v)); routes.push(createRoute(v));
if (v.children) { if (v.children) {
v.children.forEach(function (v2) { v.children.forEach(function (v2) {
@ -48,14 +73,12 @@ const router = new Router({
{ {
name: 'datasv', name: 'datasv',
path: '/datasv', path: '/datasv',
component: resolve => require(['@/views/datav/dataV'], resolve), component: dataV
meta: {model: 'error'},
}, },
{ {
name: 'copysv', name: 'copysv',
path: '/copysv', path: '/copysv',
component: resolve => require(['@/views/datav/copyV'], resolve), component: copyV
meta: {model: 'error'},
}, },
// { // {
// name: 'login', // name: 'login',
@ -148,6 +171,7 @@ router.beforeEach((to, from, next) => {
} }
if (to.name === 'datasv' || to.path === '/datasv' || to.name === 'copysv' || to.path === '/copysv') { if (to.name === 'datasv' || to.path === '/datasv' || to.name === 'copysv' || to.path === '/copysv') {
console.log('跳转', to);
next(); next();
return false; return false;
} }

View File

@ -175,7 +175,7 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less" scoped>
.marker-d { .marker-d {
width: 260px; width: 260px;
img { img {
@ -232,103 +232,103 @@ export default {
} }
// //
.ant-dropdown-open, .ant-dropdown-open:hover{ // ::v-deep .ant-dropdown-open, .ant-dropdown-open:hover{
background: #0a1a29; // background: #0a1a29;
color: #fff !important; // color: #fff !important;
.name{ // .name{
color: #fff !important; // color: #fff !important;
} // }
} // }
.ant-dropdown-trigger, .ant-dropdown-trigger:hover{ // ::v-deep .ant-dropdown-trigger, .ant-dropdown-trigger:hover{
background: #0a1a29; // background: #0a1a29;
color: #fff !important; // color: #fff !important;
.name{ // .name{
color: #fff !important; // color: #fff !important;
} // }
} // }
.ant-dropdown-content, .ant-dropdown-content:hover{ // ::v-deep .ant-dropdown-content, .ant-dropdown-content:hover{
background: #0a1a29; // background: #0a1a29;
color: #fff !important; // color: #fff !important;
.name{ // .name{
color: #fff !important; // color: #fff !important;
} // }
} // }
.ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn.active{ // ::v-deep .ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn.active{
background: #0a1a29; // background: #0a1a29;
color: #fff !important; // color: #fff !important;
.name{ // .name{
color: #fff !important; // color: #fff !important;
} // }
} // }
.ant-dropdown-menu-item:hover{ // ::v-deep .ant-dropdown-menu-item:hover{
background-color: rgba(#0c3e6d, 0.8); // background-color: rgba(#0c3e6d, 0.8);
color: #fff !important; // color: #fff !important;
.name{ // .name{
color: #fff !important; // color: #fff !important;
} // }
} // }
// // //
.ant-input{ // ::v-deep .ant-input{
background: #0a1a29; // background: #0a1a29;
color: #fff !important; // color: #fff !important;
} // }
.anticon.anticon-calendar.ant-calendar-picker-icon{ // ::v-deep .anticon.anticon-calendar.ant-calendar-picker-icon{
color: #fff; // color: #fff;
} // }
.ant-calendar.ant-calendar-picker-container-content{ // ::v-deep .ant-calendar.ant-calendar-picker-container-content{
background: #0a1a29; // background: #0a1a29;
.ant-calendar-column-header-inner{ // ::v-deep .ant-calendar-column-header-inner{
color: #fff !important; // color: #fff !important;
} // }
.ant-calendar-date{ // ::v-deep .ant-calendar-date{
color: #fff !important; // color: #fff !important;
} // }
.ant-calendar-date:hover{ // ::v-deep .ant-calendar-date:hover{
color: #fff !important; // color: #fff !important;
background-color: rgba(#0c3e6d, 0.8); // background-color: rgba(#0c3e6d, 0.8);
} // }
.ant-calendar-today-btn { // ::v-deep .ant-calendar-today-btn {
color: #fff !important; // color: #fff !important;
} // }
.ant-calendar-year-select{ // ::v-deep .ant-calendar-year-select{
color: #fff !important; // color: #fff !important;
} // }
.ant-calendar-month-select{ // ::v-deep .ant-calendar-month-select{
color: #fff !important; // color: #fff !important;
} // }
} // }
.ant-calendar-picker-input.ant-input{ // ::v-deep .ant-calendar-picker-input.ant-input{
// height: 40px; // // height: 40px;
} // }
.ant-calendar .ant-calendar-ok-btn{ // ::v-deep .ant-calendar .ant-calendar-ok-btn{
background: rgba(#0c3e6d, 0.8); // background: rgba(#0c3e6d, 0.8);
border-color: rgba(#0c3e6d, 0.8); // border-color: rgba(#0c3e6d, 0.8);
} // }
.ant-calendar-today .ant-calendar-date { // ::v-deep .ant-calendar-today .ant-calendar-date {
background: rgba(#0c3e6d, 0.8); // background: rgba(#0c3e6d, 0.8);
border-color: rgba(#0c3e6d, 0.8); // border-color: rgba(#0c3e6d, 0.8);
color: #fff; // color: #fff;
} // }
.ant-calendar-selected-day .ant-calendar-date { // ::v-deep .ant-calendar-selected-day .ant-calendar-date {
background: rgba(#0c3e6d, 0.8); // background: rgba(#0c3e6d, 0.8);
border-color: #0095bc; // border-color: #0095bc;
} // }
.ant-calendar-time .ant-calendar-footer .ant-calendar-time-picker-btn-disabled{ // ::v-deep .ant-calendar-time .ant-calendar-footer .ant-calendar-time-picker-btn-disabled{
color: #202020; // color: #202020;
} // }
.ant-calendar-today-btn { // ::v-deep .ant-calendar-today-btn {
color: #202020; // color: #202020;
} // }
.ant-input:hover, // ::v-deep .ant-input:hover,
.ant-calendar-picker:hover .ant-calendar-picker-input:not(.ant-input-disabled){ // .ant-calendar-picker:hover .ant-calendar-picker-input:not(.ant-input-disabled){
border-color: #0095bc; // border-color: #0095bc;
} // }
.ant-input:focus, // ::v-deep .ant-input:focus,
.ant-calendar-picker:focus .ant-calendar-picker-input:not(.ant-input-disabled) { // .ant-calendar-picker:focus .ant-calendar-picker-input:not(.ant-input-disabled) {
border-color: #0095bc; // border-color: #0095bc;
box-shadow: none; // box-shadow: none;
} // }
</style> </style>

View File

@ -327,33 +327,35 @@
menuModelClick(event) { menuModelClick(event) {
// //
console.log('event', event); console.log('event', event);
if(event.key==179){ // // if(event.key==175){ //
return this.$router.push('/datasv'); // return this.$router.push('/datasv');
} // }
if(event.key==181){ // // if(event.key==180){ //
return this.$router.push('/copysv'); // return this.$router.push('/copysv');
} // }
let that = this; let that = this;
that.menu.forEach(function (v, k) { that.menus = that.menu.find(v=>v.id == event.key).children;
if (v.id == event.key) { let turnPath = '/';
that.menus = v.children; if (!that.menus) {
let turnPath = '/'; turnPath += v.fullUrl;
if (!v.children) { } else if (!that.menus[0].children) {
turnPath += v.fullUrl; turnPath += that.menus[0].fullUrl;
} else if (!v.children[0].children) { } else {
turnPath += v.children[0].fullUrl; turnPath += that.menus[0].children[0].fullUrl;
} else { }
turnPath += v.children[0].children[0].fullUrl; if(turnPath.includes('datasv')){
} return that.$router.push('/datasv');
if (turnPath == '/home') { }
that.toHome(); if(turnPath.includes('copysv')){
return false; return that.$router.push('/copysv');
} }
if (turnPath != '/#') { if (turnPath == '/home') {
that.$router.push(turnPath); that.toHome();
} return false;
} }
}); if (turnPath != '/#') {
that.$router.push(turnPath);
}
}, },
onModelOpenChange(openKeys) { onModelOpenChange(openKeys) {
}, },