@luzhaoqi/test 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/css/index.css +1 -0
- package/dist/lib-cjs.js +1166 -559
- package/package.json +1 -1
package/dist/lib-cjs.js
CHANGED
@@ -17603,7 +17603,7 @@ var variables = {"menuColor":"#bfcbd9","menuLightColor":"rgba(0, 0, 0, 0.7)","me
|
|
17603
17603
|
|
17604
17604
|
// import Item from './Item.vue'
|
17605
17605
|
|
17606
|
-
var script$
|
17606
|
+
var script$z = {
|
17607
17607
|
name: 'k-icon',
|
17608
17608
|
data() {
|
17609
17609
|
return {
|
@@ -17712,10 +17712,10 @@ var normalizeComponent_1 = normalizeComponent;
|
|
17712
17712
|
var __vue_normalize__ = /*@__PURE__*/getDefaultExportFromCjs(normalizeComponent_1);
|
17713
17713
|
|
17714
17714
|
/* script */
|
17715
|
-
const __vue_script__$
|
17715
|
+
const __vue_script__$z = script$z;
|
17716
17716
|
|
17717
17717
|
/* template */
|
17718
|
-
var __vue_render__$
|
17718
|
+
var __vue_render__$B = function () {
|
17719
17719
|
var _vm = this;
|
17720
17720
|
var _h = _vm.$createElement;
|
17721
17721
|
var _c = _vm._self._c || _h;
|
@@ -17725,17 +17725,17 @@ var __vue_render__$y = function () {
|
|
17725
17725
|
_c("img", { attrs: { src: _vm.img, alt: "" } }),
|
17726
17726
|
])
|
17727
17727
|
};
|
17728
|
-
var __vue_staticRenderFns__$
|
17729
|
-
__vue_render__$
|
17728
|
+
var __vue_staticRenderFns__$B = [];
|
17729
|
+
__vue_render__$B._withStripped = true;
|
17730
17730
|
|
17731
17731
|
/* style */
|
17732
|
-
const __vue_inject_styles__$
|
17732
|
+
const __vue_inject_styles__$B = undefined;
|
17733
17733
|
/* scoped */
|
17734
|
-
const __vue_scope_id__$
|
17734
|
+
const __vue_scope_id__$B = undefined;
|
17735
17735
|
/* module identifier */
|
17736
|
-
const __vue_module_identifier__$
|
17736
|
+
const __vue_module_identifier__$B = undefined;
|
17737
17737
|
/* functional template */
|
17738
|
-
const __vue_is_functional_template__$
|
17738
|
+
const __vue_is_functional_template__$B = false;
|
17739
17739
|
/* style inject */
|
17740
17740
|
|
17741
17741
|
/* style inject SSR */
|
@@ -17744,22 +17744,22 @@ __vue_render__$y._withStripped = true;
|
|
17744
17744
|
|
17745
17745
|
|
17746
17746
|
|
17747
|
-
const __vue_component__$
|
17748
|
-
{ render: __vue_render__$
|
17749
|
-
__vue_inject_styles__$
|
17750
|
-
__vue_script__$
|
17751
|
-
__vue_scope_id__$
|
17752
|
-
__vue_is_functional_template__$
|
17753
|
-
__vue_module_identifier__$
|
17747
|
+
const __vue_component__$B = /*#__PURE__*/__vue_normalize__(
|
17748
|
+
{ render: __vue_render__$B, staticRenderFns: __vue_staticRenderFns__$B },
|
17749
|
+
__vue_inject_styles__$B,
|
17750
|
+
__vue_script__$z,
|
17751
|
+
__vue_scope_id__$B,
|
17752
|
+
__vue_is_functional_template__$B,
|
17753
|
+
__vue_module_identifier__$B,
|
17754
17754
|
false,
|
17755
17755
|
undefined,
|
17756
17756
|
undefined,
|
17757
17757
|
undefined
|
17758
17758
|
);
|
17759
17759
|
|
17760
|
-
__vue_component__$
|
17760
|
+
__vue_component__$B.install = function (Vue, option) {
|
17761
17761
|
setGolbalData(Vue, option);
|
17762
|
-
Vue.component(__vue_component__$
|
17762
|
+
Vue.component(__vue_component__$B.name, __vue_component__$B);
|
17763
17763
|
};
|
17764
17764
|
|
17765
17765
|
var axios$3 = {exports: {}};
|
@@ -94391,178 +94391,6 @@ var nprogress = {exports: {}};
|
|
94391
94391
|
var nprogressExports = nprogress.exports;
|
94392
94392
|
var NProgress = /*@__PURE__*/getDefaultExportFromCjs(nprogressExports);
|
94393
94393
|
|
94394
|
-
NProgress.configure({ showSpinner: false });
|
94395
|
-
|
94396
|
-
//todo 需要优化
|
94397
|
-
function chuli(arr) {
|
94398
|
-
const hasChildren = (arr) => {
|
94399
|
-
arr.forEach((item) => {
|
94400
|
-
if (item.children) {
|
94401
|
-
hasChildren(item.children);
|
94402
|
-
}
|
94403
|
-
if (item.component === 'Layout') {
|
94404
|
-
console.log('Layout');
|
94405
|
-
// item.component = Layout
|
94406
|
-
}
|
94407
|
-
});
|
94408
|
-
};
|
94409
|
-
hasChildren(arr);
|
94410
|
-
}
|
94411
|
-
|
94412
|
-
function createRouter(Vue) {
|
94413
|
-
// 判断是否已经use过VueRouter
|
94414
|
-
const VueRouterObj = Vue._installedPlugins.filter((item) => {
|
94415
|
-
return item.name === 'VueRouter'
|
94416
|
-
});
|
94417
|
-
if (!(VueRouterObj && VueRouterObj[0])) {
|
94418
|
-
Vue.use(VueRouter);
|
94419
|
-
const $z = Vue.prototype.$z;
|
94420
|
-
const routerOption = $z.router;
|
94421
|
-
if (routerOption) {
|
94422
|
-
const defaultConfig = {
|
94423
|
-
mode: routerOption.mode || 'history', // 去掉url中的#
|
94424
|
-
scrollBehavior: () => ({ y: 0 }),
|
94425
|
-
routes: routerOption.routes || []
|
94426
|
-
};
|
94427
|
-
chuli(defaultConfig.routes);
|
94428
|
-
const router = new VueRouter(defaultConfig);
|
94429
|
-
router.beforeEach((to, from, next) => {
|
94430
|
-
if (routerOption.beforeEach) {
|
94431
|
-
routerOption.beforeEach(to, from, next);
|
94432
|
-
} else {
|
94433
|
-
NProgress.start();
|
94434
|
-
const httpOption = $z.http || {};
|
94435
|
-
const token = getCookie(httpOption.tokenKey || TOKENKEY);
|
94436
|
-
const store = $z.store;
|
94437
|
-
if (!routerOption.whiteList) {
|
94438
|
-
routerOption.whiteList = ['/login', '/register'];
|
94439
|
-
}
|
94440
|
-
if (token) {
|
94441
|
-
if (to.path === '/login') {
|
94442
|
-
next({ path: '/' });
|
94443
|
-
NProgress.done();
|
94444
|
-
} else {
|
94445
|
-
// 判断是不是第一次 需要动态加载路由
|
94446
|
-
if (!router.options.isAddDynamicMenuRoutes && store) {
|
94447
|
-
router.options.isAddDynamicMenuRoutes = true;
|
94448
|
-
isRelogin.show = true;
|
94449
|
-
store.dispatch('user/GetInfo', $z).then(() => {
|
94450
|
-
isRelogin.show = false;
|
94451
|
-
store.dispatch('permission/GenerateRoutes', $z).then((accessRoutes) => {
|
94452
|
-
// 根据roles权限生成可访问的路由表
|
94453
|
-
router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
94454
|
-
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
|
94455
|
-
});
|
94456
|
-
});
|
94457
|
-
next();
|
94458
|
-
} else {
|
94459
|
-
next();
|
94460
|
-
}
|
94461
|
-
}
|
94462
|
-
} else {
|
94463
|
-
// 没有token
|
94464
|
-
if (routerOption.whiteList.indexOf(to.path) !== -1) {
|
94465
|
-
// 在免登录白名单,直接进入
|
94466
|
-
next();
|
94467
|
-
} else {
|
94468
|
-
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
|
94469
|
-
NProgress.done();
|
94470
|
-
}
|
94471
|
-
}
|
94472
|
-
}
|
94473
|
-
});
|
94474
|
-
router.afterEach(() => {
|
94475
|
-
if (routerOption.afterEach) {
|
94476
|
-
routerOption.afterEach();
|
94477
|
-
} else {
|
94478
|
-
NProgress.done();
|
94479
|
-
}
|
94480
|
-
});
|
94481
|
-
|
94482
|
-
Vue.prototype.$z.$router = router;
|
94483
|
-
}
|
94484
|
-
}
|
94485
|
-
}
|
94486
|
-
|
94487
|
-
const state$5 = {
|
94488
|
-
token: '',
|
94489
|
-
userinfo: {},
|
94490
|
-
roles: [],
|
94491
|
-
permissions: []
|
94492
|
-
};
|
94493
|
-
const mutations$5 = {
|
94494
|
-
SET_TOKEN: (state, token) => {
|
94495
|
-
state.token = token;
|
94496
|
-
},
|
94497
|
-
SET_ROLES: (state, roles) => {
|
94498
|
-
state.roles = roles;
|
94499
|
-
},
|
94500
|
-
SET_USERINFO: (state, userinfo) => {
|
94501
|
-
state.userinfo = userinfo;
|
94502
|
-
},
|
94503
|
-
SET_PERMISSIONS: (state, permissions) => {
|
94504
|
-
state.permissions = permissions;
|
94505
|
-
}
|
94506
|
-
};
|
94507
|
-
const actions$5 = {
|
94508
|
-
// 登录 todo
|
94509
|
-
Login({ commit }, userInfo) {},
|
94510
|
-
|
94511
|
-
// 获取用户信息
|
94512
|
-
GetInfo({ commit }, $z) {
|
94513
|
-
return new Promise((resolve, reject) => {
|
94514
|
-
const $http = $z.$http;
|
94515
|
-
const routerOption = $z.router || {};
|
94516
|
-
let api = function () {
|
94517
|
-
if ($http) {
|
94518
|
-
return $http.request({
|
94519
|
-
url: routerOption.getUserInfo || '/getInfo',
|
94520
|
-
method: 'get'
|
94521
|
-
})
|
94522
|
-
} else {
|
94523
|
-
Promise.resolve({});
|
94524
|
-
}
|
94525
|
-
};
|
94526
|
-
if (typeof routerOption.getUserInfo === 'function') {
|
94527
|
-
api = routerOption.getUserInfo;
|
94528
|
-
}
|
94529
|
-
api()
|
94530
|
-
.then((res) => {
|
94531
|
-
commit('SET_USERINFO', res.user || {});
|
94532
|
-
commit('SET_PERMISSIONS', res.permissions || '*:*:*');
|
94533
|
-
if (res.roles && res.roles.length > 0) {
|
94534
|
-
commit('SET_ROLES', res.roles);
|
94535
|
-
} else {
|
94536
|
-
commit('SET_ROLES', ['ROLE_DEFAULT']);
|
94537
|
-
}
|
94538
|
-
resolve(res);
|
94539
|
-
})
|
94540
|
-
.catch((error) => {
|
94541
|
-
reject(error);
|
94542
|
-
});
|
94543
|
-
})
|
94544
|
-
},
|
94545
|
-
|
94546
|
-
// 退出系统 todo
|
94547
|
-
LogOut({ commit, state }) {},
|
94548
|
-
|
94549
|
-
// 前端 登出 todo
|
94550
|
-
FedLogOut({ commit }) {}
|
94551
|
-
};
|
94552
|
-
|
94553
|
-
function registerStateModule$5(store) {
|
94554
|
-
if (!store || !store.hasModule) return
|
94555
|
-
if (!store.hasModule('user')) {
|
94556
|
-
const statesModule = {
|
94557
|
-
namespaced: true,
|
94558
|
-
state: state$5,
|
94559
|
-
mutations: mutations$5,
|
94560
|
-
actions: actions$5
|
94561
|
-
};
|
94562
|
-
store.registerModule('user', statesModule);
|
94563
|
-
}
|
94564
|
-
}
|
94565
|
-
|
94566
94394
|
/*!
|
94567
94395
|
* vuex v3.6.2
|
94568
94396
|
* (c) 2021 Evan You
|
@@ -95533,11 +95361,6 @@ function getModuleByNamespace (store, helper, namespace) {
|
|
95533
95361
|
return module
|
95534
95362
|
}
|
95535
95363
|
|
95536
|
-
//
|
95537
|
-
//
|
95538
|
-
//
|
95539
|
-
//
|
95540
|
-
//
|
95541
95364
|
//
|
95542
95365
|
//
|
95543
95366
|
//
|
@@ -95545,11 +95368,11 @@ function getModuleByNamespace (store, helper, namespace) {
|
|
95545
95368
|
//
|
95546
95369
|
//
|
95547
95370
|
|
95548
|
-
var script$
|
95371
|
+
var script$y = {
|
95549
95372
|
props: {
|
95550
95373
|
src: {
|
95551
95374
|
type: String,
|
95552
|
-
default:
|
95375
|
+
default: '/'
|
95553
95376
|
},
|
95554
95377
|
iframeId: {
|
95555
95378
|
type: String
|
@@ -95558,17 +95381,17 @@ var script$w = {
|
|
95558
95381
|
data() {
|
95559
95382
|
return {
|
95560
95383
|
loading: false,
|
95561
|
-
height: document.documentElement.clientHeight - 94.5 +
|
95562
|
-
}
|
95384
|
+
height: document.documentElement.clientHeight - 94.5 + 'px;'
|
95385
|
+
}
|
95563
95386
|
},
|
95564
95387
|
mounted() {
|
95565
95388
|
var _this = this;
|
95566
|
-
const iframeId = (
|
95389
|
+
const iframeId = ('#' + this.iframeId).replace(/\//g, '\\/');
|
95567
95390
|
const iframe = document.querySelector(iframeId);
|
95568
95391
|
// iframe页面loading控制
|
95569
95392
|
if (iframe.attachEvent) {
|
95570
95393
|
this.loading = true;
|
95571
|
-
iframe.attachEvent(
|
95394
|
+
iframe.attachEvent('onload', function () {
|
95572
95395
|
_this.loading = false;
|
95573
95396
|
});
|
95574
95397
|
} else {
|
@@ -95581,10 +95404,10 @@ var script$w = {
|
|
95581
95404
|
};
|
95582
95405
|
|
95583
95406
|
/* script */
|
95584
|
-
const __vue_script__$
|
95407
|
+
const __vue_script__$y = script$y;
|
95585
95408
|
|
95586
95409
|
/* template */
|
95587
|
-
var __vue_render__$
|
95410
|
+
var __vue_render__$A = function () {
|
95588
95411
|
var _vm = this;
|
95589
95412
|
var _h = _vm.$createElement;
|
95590
95413
|
var _c = _vm._self._c || _h;
|
@@ -95610,17 +95433,17 @@ var __vue_render__$x = function () {
|
|
95610
95433
|
]
|
95611
95434
|
)
|
95612
95435
|
};
|
95613
|
-
var __vue_staticRenderFns__$
|
95614
|
-
__vue_render__$
|
95436
|
+
var __vue_staticRenderFns__$A = [];
|
95437
|
+
__vue_render__$A._withStripped = true;
|
95615
95438
|
|
95616
95439
|
/* style */
|
95617
|
-
const __vue_inject_styles__$
|
95440
|
+
const __vue_inject_styles__$A = undefined;
|
95618
95441
|
/* scoped */
|
95619
|
-
const __vue_scope_id__$
|
95442
|
+
const __vue_scope_id__$A = undefined;
|
95620
95443
|
/* module identifier */
|
95621
|
-
const __vue_module_identifier__$
|
95444
|
+
const __vue_module_identifier__$A = undefined;
|
95622
95445
|
/* functional template */
|
95623
|
-
const __vue_is_functional_template__$
|
95446
|
+
const __vue_is_functional_template__$A = false;
|
95624
95447
|
/* style inject */
|
95625
95448
|
|
95626
95449
|
/* style inject SSR */
|
@@ -95629,13 +95452,13 @@ __vue_render__$x._withStripped = true;
|
|
95629
95452
|
|
95630
95453
|
|
95631
95454
|
|
95632
|
-
const __vue_component__$
|
95633
|
-
{ render: __vue_render__$
|
95634
|
-
__vue_inject_styles__$
|
95635
|
-
__vue_script__$
|
95636
|
-
__vue_scope_id__$
|
95637
|
-
__vue_is_functional_template__$
|
95638
|
-
__vue_module_identifier__$
|
95455
|
+
const __vue_component__$A = /*#__PURE__*/__vue_normalize__(
|
95456
|
+
{ render: __vue_render__$A, staticRenderFns: __vue_staticRenderFns__$A },
|
95457
|
+
__vue_inject_styles__$A,
|
95458
|
+
__vue_script__$y,
|
95459
|
+
__vue_scope_id__$A,
|
95460
|
+
__vue_is_functional_template__$A,
|
95461
|
+
__vue_module_identifier__$A,
|
95639
95462
|
false,
|
95640
95463
|
undefined,
|
95641
95464
|
undefined,
|
@@ -95656,20 +95479,20 @@ __vue_render__$x._withStripped = true;
|
|
95656
95479
|
//
|
95657
95480
|
|
95658
95481
|
|
95659
|
-
var script$
|
95660
|
-
components: { InnerLink: __vue_component__$
|
95482
|
+
var script$x = {
|
95483
|
+
components: { InnerLink: __vue_component__$A },
|
95661
95484
|
computed: {
|
95662
95485
|
iframeViews() {
|
95663
|
-
return this.$store.state
|
95486
|
+
return this.$store.state['z-tagsView'].iframeViews
|
95664
95487
|
}
|
95665
95488
|
}
|
95666
95489
|
};
|
95667
95490
|
|
95668
95491
|
/* script */
|
95669
|
-
const __vue_script__$
|
95492
|
+
const __vue_script__$x = script$x;
|
95670
95493
|
|
95671
95494
|
/* template */
|
95672
|
-
var __vue_render__$
|
95495
|
+
var __vue_render__$z = function () {
|
95673
95496
|
var _vm = this;
|
95674
95497
|
var _h = _vm.$createElement;
|
95675
95498
|
var _c = _vm._self._c || _h;
|
@@ -95693,17 +95516,17 @@ var __vue_render__$w = function () {
|
|
95693
95516
|
1
|
95694
95517
|
)
|
95695
95518
|
};
|
95696
|
-
var __vue_staticRenderFns__$
|
95697
|
-
__vue_render__$
|
95519
|
+
var __vue_staticRenderFns__$z = [];
|
95520
|
+
__vue_render__$z._withStripped = true;
|
95698
95521
|
|
95699
95522
|
/* style */
|
95700
|
-
const __vue_inject_styles__$
|
95523
|
+
const __vue_inject_styles__$z = undefined;
|
95701
95524
|
/* scoped */
|
95702
|
-
const __vue_scope_id__$
|
95525
|
+
const __vue_scope_id__$z = undefined;
|
95703
95526
|
/* module identifier */
|
95704
|
-
const __vue_module_identifier__$
|
95527
|
+
const __vue_module_identifier__$z = undefined;
|
95705
95528
|
/* functional template */
|
95706
|
-
const __vue_is_functional_template__$
|
95529
|
+
const __vue_is_functional_template__$z = false;
|
95707
95530
|
/* style inject */
|
95708
95531
|
|
95709
95532
|
/* style inject SSR */
|
@@ -95712,13 +95535,13 @@ __vue_render__$w._withStripped = true;
|
|
95712
95535
|
|
95713
95536
|
|
95714
95537
|
|
95715
|
-
const __vue_component__$
|
95716
|
-
{ render: __vue_render__$
|
95717
|
-
__vue_inject_styles__$
|
95718
|
-
__vue_script__$
|
95719
|
-
__vue_scope_id__$
|
95720
|
-
__vue_is_functional_template__$
|
95721
|
-
__vue_module_identifier__$
|
95538
|
+
const __vue_component__$z = /*#__PURE__*/__vue_normalize__(
|
95539
|
+
{ render: __vue_render__$z, staticRenderFns: __vue_staticRenderFns__$z },
|
95540
|
+
__vue_inject_styles__$z,
|
95541
|
+
__vue_script__$x,
|
95542
|
+
__vue_scope_id__$z,
|
95543
|
+
__vue_is_functional_template__$z,
|
95544
|
+
__vue_module_identifier__$z,
|
95722
95545
|
false,
|
95723
95546
|
undefined,
|
95724
95547
|
undefined,
|
@@ -95738,12 +95561,12 @@ __vue_render__$w._withStripped = true;
|
|
95738
95561
|
//
|
95739
95562
|
|
95740
95563
|
|
95741
|
-
var script$
|
95564
|
+
var script$w = {
|
95742
95565
|
name: 'AppMain',
|
95743
|
-
components: { iframeToggle: __vue_component__$
|
95566
|
+
components: { iframeToggle: __vue_component__$z },
|
95744
95567
|
computed: {
|
95745
95568
|
cachedViews() {
|
95746
|
-
return this.$store.state
|
95569
|
+
return this.$store.state['z-tagsView'].cachedViews
|
95747
95570
|
},
|
95748
95571
|
key() {
|
95749
95572
|
return this.$route.path
|
@@ -95810,10 +95633,10 @@ var browser = createInjector;
|
|
95810
95633
|
var __vue_create_injector__ = /*@__PURE__*/getDefaultExportFromCjs(browser);
|
95811
95634
|
|
95812
95635
|
/* script */
|
95813
|
-
const __vue_script__$
|
95636
|
+
const __vue_script__$w = script$w;
|
95814
95637
|
|
95815
95638
|
/* template */
|
95816
|
-
var __vue_render__$
|
95639
|
+
var __vue_render__$y = function () {
|
95817
95640
|
var _vm = this;
|
95818
95641
|
var _h = _vm.$createElement;
|
95819
95642
|
var _c = _vm._self._c || _h;
|
@@ -95844,35 +95667,35 @@ var __vue_render__$v = function () {
|
|
95844
95667
|
1
|
95845
95668
|
)
|
95846
95669
|
};
|
95847
|
-
var __vue_staticRenderFns__$
|
95848
|
-
__vue_render__$
|
95670
|
+
var __vue_staticRenderFns__$y = [];
|
95671
|
+
__vue_render__$y._withStripped = true;
|
95849
95672
|
|
95850
95673
|
/* style */
|
95851
|
-
const __vue_inject_styles__$
|
95674
|
+
const __vue_inject_styles__$y = function (inject) {
|
95852
95675
|
if (!inject) return
|
95853
|
-
inject("data-v-
|
95854
|
-
,inject("data-v-
|
95676
|
+
inject("data-v-7ff2a9cf_0", { source: "/**\n$base-menu-color:hsla(0,0%,100%,.65);\n$base-menu-color-active:#fff;\n$base-menu-background:#001529;\n$base-logo-title-color: #ffffff;\n\n$base-menu-light-color:rgba(0,0,0,.70);\n$base-menu-light-background:#ffffff;\n$base-logo-light-title-color: #001529;\n\n$base-sub-menu-background:#000c17;\n$base-sub-menu-hover:#001528;\n*/\n[data-v-7ff2a9cf]:export {\n menuColor: #bfcbd9;\n menuLightColor: rgba(0, 0, 0, 0.7);\n menuColorActive: #f4f4f5;\n menuBackground: #304156;\n menuLightBackground: #ffffff;\n subMenuBackground: #1f2d3d;\n subMenuHover: #001528;\n sideBarWidth: 200px;\n logoTitleColor: #ffffff;\n logoLightTitleColor: #001529;\n}\n.app-main[data-v-7ff2a9cf] {\n /* 50= navbar 50 */\n min-height: calc(100vh - 50px);\n width: 100%;\n position: relative;\n overflow: hidden;\n padding: 20px;\n color: #30B08F;\n}\n.fixed-header + .app-main[data-v-7ff2a9cf] {\n padding-top: 50px;\n}\n.hasTagsView .app-main[data-v-7ff2a9cf] {\n /* 84 = navbar + tags-view = 50 + 34 */\n min-height: calc(100vh - 84px);\n}\n.hasTagsView .fixed-header + .app-main[data-v-7ff2a9cf] {\n padding-top: 84px;\n}\n\n/*# sourceMappingURL=AppMain.vue.map */", map: {"version":3,"sources":["AppMain.vue","D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\AppMain.vue"],"names":[],"mappings":"AAAA;;;;;;;;;;;;CAYC;AC8BD;ED5BE,kBAAkB;EC8BpB,kCAAA;EACA,wBAAA;EACA,uBAAA;EACA,4BAAA;EACA,0BAAA;ED5BE,qBAAqB;EC8BvB,mBAZA;EAaA,uBAAA;EACA,4BAAA;AD5BA;ACMA;EACA,oBAAA;EACA,8BAAA;EACA,WAAA;EACA,kBAAA;EACA,gBAAA;EACA,aAAA;EACA,cAAA;ADHA;ACMA;EACA,iBAAA;ADHA;ACOA;EACA,sCAAA;EACA,8BAAA;ADJA;ACOA;EACA,iBAAA;ADLA;;AAEA,sCAAsC","file":"AppMain.vue","sourcesContent":["/**\n$base-menu-color:hsla(0,0%,100%,.65);\n$base-menu-color-active:#fff;\n$base-menu-background:#001529;\n$base-logo-title-color: #ffffff;\n\n$base-menu-light-color:rgba(0,0,0,.70);\n$base-menu-light-background:#ffffff;\n$base-logo-light-title-color: #001529;\n\n$base-sub-menu-background:#000c17;\n$base-sub-menu-hover:#001528;\n*/\n:export {\n menuColor: #bfcbd9;\n menuLightColor: rgba(0, 0, 0, 0.7);\n menuColorActive: #f4f4f5;\n menuBackground: #304156;\n menuLightBackground: #ffffff;\n subMenuBackground: #1f2d3d;\n subMenuHover: #001528;\n sideBarWidth: 200px;\n logoTitleColor: #ffffff;\n logoLightTitleColor: #001529;\n}\n\n.app-main {\n /* 50= navbar 50 */\n min-height: calc(100vh - 50px);\n width: 100%;\n position: relative;\n overflow: hidden;\n padding: 20px;\n color: #30B08F;\n}\n\n.fixed-header + .app-main {\n padding-top: 50px;\n}\n\n.hasTagsView .app-main {\n /* 84 = navbar + tags-view = 50 + 34 */\n min-height: calc(100vh - 84px);\n}\n.hasTagsView .fixed-header + .app-main {\n padding-top: 84px;\n}\n\n/*# sourceMappingURL=AppMain.vue.map */","<template>\n <section class=\"app-main\">\n <transition name=\"fade-transform\" mode=\"out-in\">\n <keep-alive :include=\"cachedViews\">\n <router-view v-if=\"!$route.meta.link\" :key=\"key\" />\n </keep-alive>\n </transition>\n <iframe-toggle />\n </section>\n</template>\n\n<script>\nimport iframeToggle from './IframeToggle/index.vue'\n\nexport default {\n name: 'AppMain',\n components: { iframeToggle },\n computed: {\n cachedViews() {\n return this.$store.state['z-tagsView'].cachedViews\n },\n key() {\n return this.$route.path\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../scss/variables.module.scss';\n.app-main {\n /* 50= navbar 50 */\n min-height: calc(100vh - 50px);\n width: 100%;\n position: relative;\n overflow: hidden;\n padding: 20px;\n color: $green;\n}\n\n.fixed-header + .app-main {\n padding-top: 50px;\n}\n\n.hasTagsView {\n .app-main {\n /* 84 = navbar + tags-view = 50 + 34 */\n min-height: calc(100vh - 84px);\n }\n\n .fixed-header + .app-main {\n padding-top: 84px;\n }\n}\n</style>\n\n<style lang=\"scss\">\n// fix css style bug in open el-dialog\n.el-popup-parent--hidden {\n .fixed-header {\n padding-right: 6px;\n }\n}\n\n::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n}\n\n::-webkit-scrollbar-track {\n background-color: #f1f1f1;\n}\n\n::-webkit-scrollbar-thumb {\n background-color: #c0c0c0;\n border-radius: 3px;\n}\n</style>\n"]}, media: undefined })
|
95677
|
+
,inject("data-v-7ff2a9cf_1", { source: ".el-popup-parent--hidden .fixed-header {\n padding-right: 6px;\n}\n::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n}\n::-webkit-scrollbar-track {\n background-color: #f1f1f1;\n}\n::-webkit-scrollbar-thumb {\n background-color: #c0c0c0;\n border-radius: 3px;\n}\n\n/*# sourceMappingURL=AppMain.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\AppMain.vue","AppMain.vue"],"names":[],"mappings":"AA2DA;EACA,kBAAA;AC1DA;AD8DA;EACA,UAAA;EACA,WAAA;AC3DA;AD8DA;EACA,yBAAA;AC3DA;AD8DA;EACA,yBAAA;EACA,kBAAA;AC3DA;;AAEA,sCAAsC","file":"AppMain.vue","sourcesContent":["<template>\n <section class=\"app-main\">\n <transition name=\"fade-transform\" mode=\"out-in\">\n <keep-alive :include=\"cachedViews\">\n <router-view v-if=\"!$route.meta.link\" :key=\"key\" />\n </keep-alive>\n </transition>\n <iframe-toggle />\n </section>\n</template>\n\n<script>\nimport iframeToggle from './IframeToggle/index.vue'\n\nexport default {\n name: 'AppMain',\n components: { iframeToggle },\n computed: {\n cachedViews() {\n return this.$store.state['z-tagsView'].cachedViews\n },\n key() {\n return this.$route.path\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@import '../scss/variables.module.scss';\n.app-main {\n /* 50= navbar 50 */\n min-height: calc(100vh - 50px);\n width: 100%;\n position: relative;\n overflow: hidden;\n padding: 20px;\n color: $green;\n}\n\n.fixed-header + .app-main {\n padding-top: 50px;\n}\n\n.hasTagsView {\n .app-main {\n /* 84 = navbar + tags-view = 50 + 34 */\n min-height: calc(100vh - 84px);\n }\n\n .fixed-header + .app-main {\n padding-top: 84px;\n }\n}\n</style>\n\n<style lang=\"scss\">\n// fix css style bug in open el-dialog\n.el-popup-parent--hidden {\n .fixed-header {\n padding-right: 6px;\n }\n}\n\n::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n}\n\n::-webkit-scrollbar-track {\n background-color: #f1f1f1;\n}\n\n::-webkit-scrollbar-thumb {\n background-color: #c0c0c0;\n border-radius: 3px;\n}\n</style>\n",".el-popup-parent--hidden .fixed-header {\n padding-right: 6px;\n}\n\n::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n}\n\n::-webkit-scrollbar-track {\n background-color: #f1f1f1;\n}\n\n::-webkit-scrollbar-thumb {\n background-color: #c0c0c0;\n border-radius: 3px;\n}\n\n/*# sourceMappingURL=AppMain.vue.map */"]}, media: undefined });
|
95855
95678
|
|
95856
95679
|
};
|
95857
95680
|
/* scoped */
|
95858
|
-
const __vue_scope_id__$
|
95681
|
+
const __vue_scope_id__$y = "data-v-7ff2a9cf";
|
95859
95682
|
/* module identifier */
|
95860
|
-
const __vue_module_identifier__$
|
95683
|
+
const __vue_module_identifier__$y = undefined;
|
95861
95684
|
/* functional template */
|
95862
|
-
const __vue_is_functional_template__$
|
95685
|
+
const __vue_is_functional_template__$y = false;
|
95863
95686
|
/* style inject SSR */
|
95864
95687
|
|
95865
95688
|
/* style inject shadow dom */
|
95866
95689
|
|
95867
95690
|
|
95868
95691
|
|
95869
|
-
const __vue_component__$
|
95870
|
-
{ render: __vue_render__$
|
95871
|
-
__vue_inject_styles__$
|
95872
|
-
__vue_script__$
|
95873
|
-
__vue_scope_id__$
|
95874
|
-
__vue_is_functional_template__$
|
95875
|
-
__vue_module_identifier__$
|
95692
|
+
const __vue_component__$y = /*#__PURE__*/__vue_normalize__(
|
95693
|
+
{ render: __vue_render__$y, staticRenderFns: __vue_staticRenderFns__$y },
|
95694
|
+
__vue_inject_styles__$y,
|
95695
|
+
__vue_script__$w,
|
95696
|
+
__vue_scope_id__$y,
|
95697
|
+
__vue_is_functional_template__$y,
|
95698
|
+
__vue_module_identifier__$y,
|
95876
95699
|
false,
|
95877
95700
|
__vue_create_injector__,
|
95878
95701
|
undefined,
|
@@ -95890,8 +95713,10 @@ __vue_render__$v._withStripped = true;
|
|
95890
95713
|
//
|
95891
95714
|
//
|
95892
95715
|
//
|
95716
|
+
//
|
95717
|
+
//
|
95893
95718
|
|
95894
|
-
var script$
|
95719
|
+
var script$v = {
|
95895
95720
|
data() {
|
95896
95721
|
return {
|
95897
95722
|
levelList: null
|
@@ -95910,16 +95735,22 @@ var script$t = {
|
|
95910
95735
|
this.getBreadcrumb();
|
95911
95736
|
},
|
95912
95737
|
methods: {
|
95738
|
+
getIndexRouter() {
|
95739
|
+
const arr = this.$store.state['z-permission'].sidebarRouters;
|
95740
|
+
const rootItem = arr.find((item) => {
|
95741
|
+
return (item.path === '' || item.path === '/') && item.redirect
|
95742
|
+
});
|
95743
|
+
return { path: '/', meta: { title: rootItem?.meta?.title || '首页' } }
|
95744
|
+
},
|
95913
95745
|
getBreadcrumb() {
|
95914
95746
|
// only show routes with meta.title
|
95915
|
-
let matched = this.$route.matched.filter(item => item.meta && item.meta.title);
|
95747
|
+
let matched = this.$route.matched.filter((item) => item.meta && item.meta.title);
|
95748
|
+
matched = matched.filter((item) => item.path !== '' && item.path !== '/');
|
95916
95749
|
const first = matched[0];
|
95917
|
-
|
95918
95750
|
if (!this.isDashboard(first)) {
|
95919
|
-
matched = [
|
95751
|
+
matched = [this.getIndexRouter()].concat(matched);
|
95920
95752
|
}
|
95921
|
-
|
95922
|
-
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false);
|
95753
|
+
this.levelList = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
|
95923
95754
|
},
|
95924
95755
|
isDashboard(route) {
|
95925
95756
|
const name = route && route.name;
|
@@ -95940,74 +95771,81 @@ var script$t = {
|
|
95940
95771
|
};
|
95941
95772
|
|
95942
95773
|
/* script */
|
95943
|
-
const __vue_script__$
|
95774
|
+
const __vue_script__$v = script$v;
|
95944
95775
|
|
95945
95776
|
/* template */
|
95946
|
-
var __vue_render__$
|
95777
|
+
var __vue_render__$x = function () {
|
95947
95778
|
var _vm = this;
|
95948
95779
|
var _h = _vm.$createElement;
|
95949
95780
|
var _c = _vm._self._c || _h;
|
95950
95781
|
return _c(
|
95951
|
-
"
|
95952
|
-
{ staticClass: "app-breadcrumb", attrs: { separator: "/" } },
|
95782
|
+
"div",
|
95953
95783
|
[
|
95954
95784
|
_c(
|
95955
|
-
"
|
95956
|
-
{ attrs: {
|
95957
|
-
|
95958
|
-
|
95959
|
-
|
95960
|
-
|
95961
|
-
|
95962
|
-
|
95963
|
-
|
95964
|
-
|
95965
|
-
{
|
95966
|
-
|
95967
|
-
|
95968
|
-
|
95969
|
-
|
95785
|
+
"el-breadcrumb",
|
95786
|
+
{ staticClass: "app-breadcrumb", attrs: { separator: "/" } },
|
95787
|
+
[
|
95788
|
+
_c(
|
95789
|
+
"transition-group",
|
95790
|
+
{ attrs: { name: "breadcrumb" } },
|
95791
|
+
_vm._l(_vm.levelList, function (item, index) {
|
95792
|
+
return _c("el-breadcrumb-item", { key: item.path }, [
|
95793
|
+
item.redirect === "noRedirect" ||
|
95794
|
+
index == _vm.levelList.length - 1
|
95795
|
+
? _c("span", { staticClass: "no-redirect" }, [
|
95796
|
+
_vm._v(_vm._s(item.meta.title)),
|
95797
|
+
])
|
95798
|
+
: _c(
|
95799
|
+
"a",
|
95800
|
+
{
|
95801
|
+
on: {
|
95802
|
+
click: function ($event) {
|
95803
|
+
$event.preventDefault();
|
95804
|
+
return _vm.handleLink(item)
|
95805
|
+
},
|
95806
|
+
},
|
95970
95807
|
},
|
95971
|
-
|
95972
|
-
|
95973
|
-
|
95974
|
-
|
95975
|
-
|
95976
|
-
|
95808
|
+
[_vm._v(_vm._s(item.meta.title))]
|
95809
|
+
),
|
95810
|
+
])
|
95811
|
+
}),
|
95812
|
+
1
|
95813
|
+
),
|
95814
|
+
],
|
95977
95815
|
1
|
95978
95816
|
),
|
95979
95817
|
],
|
95980
95818
|
1
|
95981
95819
|
)
|
95982
95820
|
};
|
95983
|
-
var __vue_staticRenderFns__$
|
95984
|
-
__vue_render__$
|
95821
|
+
var __vue_staticRenderFns__$x = [];
|
95822
|
+
__vue_render__$x._withStripped = true;
|
95985
95823
|
|
95986
95824
|
/* style */
|
95987
|
-
const __vue_inject_styles__$
|
95825
|
+
const __vue_inject_styles__$x = function (inject) {
|
95988
95826
|
if (!inject) return
|
95989
|
-
inject("data-v-
|
95827
|
+
inject("data-v-5878a65c_0", { source: ".app-breadcrumb.el-breadcrumb[data-v-5878a65c] {\n display: inline-block;\n font-size: 14px;\n line-height: 50px;\n margin-left: 8px;\n}\n.app-breadcrumb.el-breadcrumb .no-redirect[data-v-5878a65c] {\n color: #97a8be;\n cursor: text;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\Breadcrumb\\index.vue","index.vue"],"names":[],"mappings":"AAsEA;EACA,qBAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;ACrEA;ADsEA;EACA,cAAA;EACA,YAAA;ACpEA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <div>\n <el-breadcrumb class=\"app-breadcrumb\" separator=\"/\">\n <transition-group name=\"breadcrumb\">\n <el-breadcrumb-item v-for=\"(item, index) in levelList\" :key=\"item.path\">\n <span v-if=\"item.redirect === 'noRedirect' || index == levelList.length - 1\" class=\"no-redirect\">{{ item.meta.title }}</span>\n <a v-else @click.prevent=\"handleLink(item)\">{{ item.meta.title }}</a>\n </el-breadcrumb-item>\n </transition-group>\n </el-breadcrumb>\n </div>\n</template>\n\n<script>\nexport default {\n data() {\n return {\n levelList: null\n }\n },\n watch: {\n $route(route) {\n // if you go to the redirect page, do not update the breadcrumbs\n if (route.path.startsWith('/redirect/')) {\n return\n }\n this.getBreadcrumb()\n }\n },\n created() {\n this.getBreadcrumb()\n },\n methods: {\n getIndexRouter() {\n const arr = this.$store.state['z-permission'].sidebarRouters\n const rootItem = arr.find((item) => {\n return (item.path === '' || item.path === '/') && item.redirect\n })\n return { path: '/', meta: { title: rootItem?.meta?.title || '首页' } }\n },\n getBreadcrumb() {\n // only show routes with meta.title\n let matched = this.$route.matched.filter((item) => item.meta && item.meta.title)\n matched = matched.filter((item) => item.path !== '' && item.path !== '/')\n const first = matched[0]\n if (!this.isDashboard(first)) {\n matched = [this.getIndexRouter()].concat(matched)\n }\n this.levelList = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false)\n },\n isDashboard(route) {\n const name = route && route.name\n if (!name) {\n return false\n }\n return name.trim() === 'Index'\n },\n handleLink(item) {\n const { redirect, path } = item\n if (redirect) {\n this.$router.push(redirect)\n return\n }\n this.$router.push(path)\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.app-breadcrumb.el-breadcrumb {\n display: inline-block;\n font-size: 14px;\n line-height: 50px;\n margin-left: 8px;\n .no-redirect {\n color: #97a8be;\n cursor: text;\n }\n}\n</style>\n",".app-breadcrumb.el-breadcrumb {\n display: inline-block;\n font-size: 14px;\n line-height: 50px;\n margin-left: 8px;\n}\n.app-breadcrumb.el-breadcrumb .no-redirect {\n color: #97a8be;\n cursor: text;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
95990
95828
|
|
95991
95829
|
};
|
95992
95830
|
/* scoped */
|
95993
|
-
const __vue_scope_id__$
|
95831
|
+
const __vue_scope_id__$x = "data-v-5878a65c";
|
95994
95832
|
/* module identifier */
|
95995
|
-
const __vue_module_identifier__$
|
95833
|
+
const __vue_module_identifier__$x = undefined;
|
95996
95834
|
/* functional template */
|
95997
|
-
const __vue_is_functional_template__$
|
95835
|
+
const __vue_is_functional_template__$x = false;
|
95998
95836
|
/* style inject SSR */
|
95999
95837
|
|
96000
95838
|
/* style inject shadow dom */
|
96001
95839
|
|
96002
95840
|
|
96003
95841
|
|
96004
|
-
const __vue_component__$
|
96005
|
-
{ render: __vue_render__$
|
96006
|
-
__vue_inject_styles__$
|
96007
|
-
__vue_script__$
|
96008
|
-
__vue_scope_id__$
|
96009
|
-
__vue_is_functional_template__$
|
96010
|
-
__vue_module_identifier__$
|
95842
|
+
const __vue_component__$x = /*#__PURE__*/__vue_normalize__(
|
95843
|
+
{ render: __vue_render__$x, staticRenderFns: __vue_staticRenderFns__$x },
|
95844
|
+
__vue_inject_styles__$x,
|
95845
|
+
__vue_script__$v,
|
95846
|
+
__vue_scope_id__$x,
|
95847
|
+
__vue_is_functional_template__$x,
|
95848
|
+
__vue_module_identifier__$x,
|
96011
95849
|
false,
|
96012
95850
|
__vue_create_injector__,
|
96013
95851
|
undefined,
|
@@ -96041,7 +95879,7 @@ __vue_render__$u._withStripped = true;
|
|
96041
95879
|
// 隐藏侧边栏路由
|
96042
95880
|
const hideList = ['/index', '/user/profile'];
|
96043
95881
|
|
96044
|
-
var script$
|
95882
|
+
var script$u = {
|
96045
95883
|
data() {
|
96046
95884
|
return {
|
96047
95885
|
// 顶部栏初始数
|
@@ -96052,7 +95890,7 @@ var script$s = {
|
|
96052
95890
|
},
|
96053
95891
|
computed: {
|
96054
95892
|
theme() {
|
96055
|
-
return this.$store.state
|
95893
|
+
return this.$store.state['z-settings'].theme
|
96056
95894
|
},
|
96057
95895
|
// 顶部显示菜单
|
96058
95896
|
topMenus() {
|
@@ -96071,7 +95909,7 @@ var script$s = {
|
|
96071
95909
|
},
|
96072
95910
|
// 所有的路由信息
|
96073
95911
|
routers() {
|
96074
|
-
return this.$store.state
|
95912
|
+
return this.$store.state['z-permission'].topbarRouters
|
96075
95913
|
},
|
96076
95914
|
// 设置子路由
|
96077
95915
|
childrenMenus() {
|
@@ -96101,11 +95939,11 @@ var script$s = {
|
|
96101
95939
|
const tmpPath = path.substring(1, path.length);
|
96102
95940
|
activePath = '/' + tmpPath.substring(0, tmpPath.indexOf('/'));
|
96103
95941
|
if (!this.$route.meta.link) {
|
96104
|
-
this.$store.dispatch('app/toggleSideBarHide', false);
|
95942
|
+
this.$store.dispatch('z-app/toggleSideBarHide', false);
|
96105
95943
|
}
|
96106
95944
|
} else if (!this.$route.children) {
|
96107
95945
|
activePath = path;
|
96108
|
-
this.$store.dispatch('app/toggleSideBarHide', true);
|
95946
|
+
this.$store.dispatch('z-app/toggleSideBarHide', true);
|
96109
95947
|
}
|
96110
95948
|
this.activeRoutes(activePath);
|
96111
95949
|
return activePath
|
@@ -96142,11 +95980,11 @@ var script$s = {
|
|
96142
95980
|
} else {
|
96143
95981
|
this.$router.push({ path: key });
|
96144
95982
|
}
|
96145
|
-
this.$store.dispatch('app/toggleSideBarHide', true);
|
95983
|
+
this.$store.dispatch('z-app/toggleSideBarHide', true);
|
96146
95984
|
} else {
|
96147
95985
|
// 显示左侧联动菜单
|
96148
95986
|
this.activeRoutes(key);
|
96149
|
-
this.$store.dispatch('app/toggleSideBarHide', false);
|
95987
|
+
this.$store.dispatch('z-app/toggleSideBarHide', false);
|
96150
95988
|
}
|
96151
95989
|
},
|
96152
95990
|
// 当前激活的路由
|
@@ -96162,7 +96000,7 @@ var script$s = {
|
|
96162
96000
|
if (routes.length > 0) {
|
96163
96001
|
this.$store.commit('SET_SIDEBAR_ROUTERS', routes);
|
96164
96002
|
} else {
|
96165
|
-
this.$store.dispatch('app/toggleSideBarHide', true);
|
96003
|
+
this.$store.dispatch('z-app/toggleSideBarHide', true);
|
96166
96004
|
}
|
96167
96005
|
},
|
96168
96006
|
ishttp(url) {
|
@@ -96172,10 +96010,10 @@ var script$s = {
|
|
96172
96010
|
};
|
96173
96011
|
|
96174
96012
|
/* script */
|
96175
|
-
const __vue_script__$
|
96013
|
+
const __vue_script__$u = script$u;
|
96176
96014
|
|
96177
96015
|
/* template */
|
96178
|
-
var __vue_render__$
|
96016
|
+
var __vue_render__$w = function () {
|
96179
96017
|
var _vm = this;
|
96180
96018
|
var _h = _vm.$createElement;
|
96181
96019
|
var _c = _vm._self._c || _h;
|
@@ -96228,34 +96066,34 @@ var __vue_render__$t = function () {
|
|
96228
96066
|
2
|
96229
96067
|
)
|
96230
96068
|
};
|
96231
|
-
var __vue_staticRenderFns__$
|
96232
|
-
__vue_render__$
|
96069
|
+
var __vue_staticRenderFns__$w = [];
|
96070
|
+
__vue_render__$w._withStripped = true;
|
96233
96071
|
|
96234
96072
|
/* style */
|
96235
|
-
const __vue_inject_styles__$
|
96073
|
+
const __vue_inject_styles__$w = function (inject) {
|
96236
96074
|
if (!inject) return
|
96237
|
-
inject("data-v-
|
96075
|
+
inject("data-v-7562f229_0", { source: ".topmenu-container.el-menu--horizontal > .el-menu-item {\n float: left;\n height: 50px !important;\n line-height: 50px !important;\n color: #999093 !important;\n padding: 0 5px !important;\n margin: 0 10px !important;\n}\n.topmenu-container.el-menu--horizontal > .el-menu-item.is-active,\n.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {\n border-bottom: 2px solid var(--theme) !important;\n color: #303133;\n}\n\n/* submenu item */\n.topmenu-container.el-menu--horizontal > .el-submenu .el-submenu__title {\n float: left;\n height: 50px !important;\n line-height: 50px !important;\n color: #999093 !important;\n padding: 0 5px !important;\n margin: 0 10px !important;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\TopNav\\index.vue","index.vue"],"names":[],"mappings":"AAgKA;EACA,WAAA;EACA,uBAAA;EACA,4BAAA;EACA,yBAAA;EACA,yBAAA;EACA,yBAAA;AC/JA;ADkKA;;EAEA,gDAAA;EACA,cAAA;AC/JA;;ADkKA,iBAAA;AACA;EACA,WAAA;EACA,uBAAA;EACA,4BAAA;EACA,yBAAA;EACA,yBAAA;EACA,yBAAA;AC/JA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\n <el-menu :default-active=\"activeMenu\" mode=\"horizontal\" @select=\"handleSelect\">\n <template v-for=\"(item, index) in topMenus\">\n <el-menu-item :style=\"{ '--theme': theme }\" :index=\"item.path\" :key=\"index\" v-if=\"index < visibleNumber\">\n <!-- <z-icon :icon-class=\"item.meta.icon\" />-->\n {{ item.meta.title }}</el-menu-item\n >\n </template>\n\n <!-- 顶部菜单超出数量折叠 -->\n <el-submenu :style=\"{ '--theme': theme }\" index=\"more\" v-if=\"topMenus.length > visibleNumber\">\n <template slot=\"title\">更多菜单</template>\n <template v-for=\"(item, index) in topMenus\">\n <el-menu-item :index=\"item.path\" :key=\"index\" v-if=\"index >= visibleNumber\">\n <!-- <z-icon :icon-class=\"item.meta.icon\" />-->\n {{ item.meta.title }}</el-menu-item\n >\n </template>\n </el-submenu>\n </el-menu>\n</template>\n\n<script>\nimport { constantRoutes } from '@/router'\n\n// 隐藏侧边栏路由\nconst hideList = ['/index', '/user/profile']\n\nexport default {\n data() {\n return {\n // 顶部栏初始数\n visibleNumber: 5,\n // 当前激活菜单的 index\n currentIndex: undefined\n }\n },\n computed: {\n theme() {\n return this.$store.state['z-settings'].theme\n },\n // 顶部显示菜单\n topMenus() {\n let topMenus = []\n this.routers.map((menu) => {\n if (menu.hidden !== true) {\n // 兼容顶部栏一级菜单内部跳转\n if (menu.path === '/') {\n topMenus.push(menu.children[0])\n } else {\n topMenus.push(menu)\n }\n }\n })\n return topMenus\n },\n // 所有的路由信息\n routers() {\n return this.$store.state['z-permission'].topbarRouters\n },\n // 设置子路由\n childrenMenus() {\n var childrenMenus = []\n this.routers.map((router) => {\n for (var item in router.children) {\n if (router.children[item].parentPath === undefined) {\n if (router.path === '/') {\n router.children[item].path = '/' + router.children[item].path\n } else {\n if (!this.ishttp(router.children[item].path)) {\n router.children[item].path = router.path + '/' + router.children[item].path\n }\n }\n router.children[item].parentPath = router.path\n }\n childrenMenus.push(router.children[item])\n }\n })\n return constantRoutes.concat(childrenMenus)\n },\n // 默认激活的菜单\n activeMenu() {\n const path = this.$route.path\n let activePath = path\n if (path !== undefined && path.lastIndexOf('/') > 0 && hideList.indexOf(path) === -1) {\n const tmpPath = path.substring(1, path.length)\n activePath = '/' + tmpPath.substring(0, tmpPath.indexOf('/'))\n if (!this.$route.meta.link) {\n this.$store.dispatch('z-app/toggleSideBarHide', false)\n }\n } else if (!this.$route.children) {\n activePath = path\n this.$store.dispatch('z-app/toggleSideBarHide', true)\n }\n this.activeRoutes(activePath)\n return activePath\n }\n },\n beforeMount() {\n window.addEventListener('resize', this.setVisibleNumber)\n },\n beforeDestroy() {\n window.removeEventListener('resize', this.setVisibleNumber)\n },\n mounted() {\n this.setVisibleNumber()\n },\n methods: {\n // 根据宽度计算设置显示栏数\n setVisibleNumber() {\n const width = document.body.getBoundingClientRect().width / 3\n this.visibleNumber = parseInt(width / 85)\n },\n // 菜单选择事件\n handleSelect(key, keyPath) {\n this.currentIndex = key\n const route = this.routers.find((item) => item.path === key)\n if (this.ishttp(key)) {\n // http(s):// 路径新窗口打开\n window.open(key, '_blank')\n } else if (!route || !route.children) {\n // 没有子路由路径内部打开\n const routeMenu = this.childrenMenus.find((item) => item.path === key)\n if (routeMenu && routeMenu.query) {\n let query = JSON.parse(routeMenu.query)\n this.$router.push({ path: key, query: query })\n } else {\n this.$router.push({ path: key })\n }\n this.$store.dispatch('z-app/toggleSideBarHide', true)\n } else {\n // 显示左侧联动菜单\n this.activeRoutes(key)\n this.$store.dispatch('z-app/toggleSideBarHide', false)\n }\n },\n // 当前激活的路由\n activeRoutes(key) {\n var routes = []\n if (this.childrenMenus && this.childrenMenus.length > 0) {\n this.childrenMenus.map((item) => {\n if (key == item.parentPath || (key == 'index' && '' == item.path)) {\n routes.push(item)\n }\n })\n }\n if (routes.length > 0) {\n this.$store.commit('SET_SIDEBAR_ROUTERS', routes)\n } else {\n this.$store.dispatch('z-app/toggleSideBarHide', true)\n }\n },\n ishttp(url) {\n return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1\n }\n }\n}\n</script>\n\n<style lang=\"scss\">\n.topmenu-container.el-menu--horizontal > .el-menu-item {\n float: left;\n height: 50px !important;\n line-height: 50px !important;\n color: #999093 !important;\n padding: 0 5px !important;\n margin: 0 10px !important;\n}\n\n.topmenu-container.el-menu--horizontal > .el-menu-item.is-active,\n.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {\n border-bottom: 2px solid #{'var(--theme)'} !important;\n color: #303133;\n}\n\n/* submenu item */\n.topmenu-container.el-menu--horizontal > .el-submenu .el-submenu__title {\n float: left;\n height: 50px !important;\n line-height: 50px !important;\n color: #999093 !important;\n padding: 0 5px !important;\n margin: 0 10px !important;\n}\n</style>\n",".topmenu-container.el-menu--horizontal > .el-menu-item {\n float: left;\n height: 50px !important;\n line-height: 50px !important;\n color: #999093 !important;\n padding: 0 5px !important;\n margin: 0 10px !important;\n}\n\n.topmenu-container.el-menu--horizontal > .el-menu-item.is-active,\n.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {\n border-bottom: 2px solid var(--theme) !important;\n color: #303133;\n}\n\n/* submenu item */\n.topmenu-container.el-menu--horizontal > .el-submenu .el-submenu__title {\n float: left;\n height: 50px !important;\n line-height: 50px !important;\n color: #999093 !important;\n padding: 0 5px !important;\n margin: 0 10px !important;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
96238
96076
|
|
96239
96077
|
};
|
96240
96078
|
/* scoped */
|
96241
|
-
const __vue_scope_id__$
|
96079
|
+
const __vue_scope_id__$w = undefined;
|
96242
96080
|
/* module identifier */
|
96243
|
-
const __vue_module_identifier__$
|
96081
|
+
const __vue_module_identifier__$w = undefined;
|
96244
96082
|
/* functional template */
|
96245
|
-
const __vue_is_functional_template__$
|
96083
|
+
const __vue_is_functional_template__$w = false;
|
96246
96084
|
/* style inject SSR */
|
96247
96085
|
|
96248
96086
|
/* style inject shadow dom */
|
96249
96087
|
|
96250
96088
|
|
96251
96089
|
|
96252
|
-
const __vue_component__$
|
96253
|
-
{ render: __vue_render__$
|
96254
|
-
__vue_inject_styles__$
|
96255
|
-
__vue_script__$
|
96256
|
-
__vue_scope_id__$
|
96257
|
-
__vue_is_functional_template__$
|
96258
|
-
__vue_module_identifier__$
|
96090
|
+
const __vue_component__$w = /*#__PURE__*/__vue_normalize__(
|
96091
|
+
{ render: __vue_render__$w, staticRenderFns: __vue_staticRenderFns__$w },
|
96092
|
+
__vue_inject_styles__$w,
|
96093
|
+
__vue_script__$u,
|
96094
|
+
__vue_scope_id__$w,
|
96095
|
+
__vue_is_functional_template__$w,
|
96096
|
+
__vue_module_identifier__$w,
|
96259
96097
|
false,
|
96260
96098
|
__vue_create_injector__,
|
96261
96099
|
undefined,
|
@@ -96278,7 +96116,7 @@ __vue_render__$t._withStripped = true;
|
|
96278
96116
|
//
|
96279
96117
|
//
|
96280
96118
|
|
96281
|
-
var script$
|
96119
|
+
var script$t = {
|
96282
96120
|
name: 'Hamburger',
|
96283
96121
|
props: {
|
96284
96122
|
isActive: {
|
@@ -96294,10 +96132,10 @@ var script$r = {
|
|
96294
96132
|
};
|
96295
96133
|
|
96296
96134
|
/* script */
|
96297
|
-
const __vue_script__$
|
96135
|
+
const __vue_script__$t = script$t;
|
96298
96136
|
|
96299
96137
|
/* template */
|
96300
|
-
var __vue_render__$
|
96138
|
+
var __vue_render__$v = function () {
|
96301
96139
|
var _vm = this;
|
96302
96140
|
var _h = _vm.$createElement;
|
96303
96141
|
var _c = _vm._self._c || _h;
|
@@ -96328,34 +96166,34 @@ var __vue_render__$s = function () {
|
|
96328
96166
|
]
|
96329
96167
|
)
|
96330
96168
|
};
|
96331
|
-
var __vue_staticRenderFns__$
|
96332
|
-
__vue_render__$
|
96169
|
+
var __vue_staticRenderFns__$v = [];
|
96170
|
+
__vue_render__$v._withStripped = true;
|
96333
96171
|
|
96334
96172
|
/* style */
|
96335
|
-
const __vue_inject_styles__$
|
96173
|
+
const __vue_inject_styles__$v = function (inject) {
|
96336
96174
|
if (!inject) return
|
96337
96175
|
inject("data-v-3b0f2894_0", { source: "\n.hamburger[data-v-3b0f2894] {\r\n display: inline-block;\r\n vertical-align: middle;\r\n width: 20px;\r\n height: 20px;\n}\n.hamburger.is-active[data-v-3b0f2894] {\r\n transform: rotate(180deg);\n}\r\n", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\Hamburger\\index.vue"],"names":[],"mappings":";AAiCA;EACA,qBAAA;EACA,sBAAA;EACA,WAAA;EACA,YAAA;AACA;AAEA;EACA,yBAAA;AACA","file":"index.vue","sourcesContent":["<template>\r\n <div style=\"padding: 0 15px;\" @click=\"toggleClick\">\r\n <svg\r\n :class=\"{'is-active':isActive}\"\r\n class=\"hamburger\"\r\n viewBox=\"0 0 1024 1024\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"64\"\r\n height=\"64\"\r\n >\r\n <path d=\"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z\" />\r\n </svg>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'Hamburger',\r\n props: {\r\n isActive: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n methods: {\r\n toggleClick() {\r\n this.$emit('toggleClick')\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n.hamburger {\r\n display: inline-block;\r\n vertical-align: middle;\r\n width: 20px;\r\n height: 20px;\r\n}\r\n\r\n.hamburger.is-active {\r\n transform: rotate(180deg);\r\n}\r\n</style>\r\n"]}, media: undefined });
|
96338
96176
|
|
96339
96177
|
};
|
96340
96178
|
/* scoped */
|
96341
|
-
const __vue_scope_id__$
|
96179
|
+
const __vue_scope_id__$v = "data-v-3b0f2894";
|
96342
96180
|
/* module identifier */
|
96343
|
-
const __vue_module_identifier__$
|
96181
|
+
const __vue_module_identifier__$v = undefined;
|
96344
96182
|
/* functional template */
|
96345
|
-
const __vue_is_functional_template__$
|
96183
|
+
const __vue_is_functional_template__$v = false;
|
96346
96184
|
/* style inject SSR */
|
96347
96185
|
|
96348
96186
|
/* style inject shadow dom */
|
96349
96187
|
|
96350
96188
|
|
96351
96189
|
|
96352
|
-
const __vue_component__$
|
96353
|
-
{ render: __vue_render__$
|
96354
|
-
__vue_inject_styles__$
|
96355
|
-
__vue_script__$
|
96356
|
-
__vue_scope_id__$
|
96357
|
-
__vue_is_functional_template__$
|
96358
|
-
__vue_module_identifier__$
|
96190
|
+
const __vue_component__$v = /*#__PURE__*/__vue_normalize__(
|
96191
|
+
{ render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v },
|
96192
|
+
__vue_inject_styles__$v,
|
96193
|
+
__vue_script__$t,
|
96194
|
+
__vue_scope_id__$v,
|
96195
|
+
__vue_is_functional_template__$v,
|
96196
|
+
__vue_module_identifier__$v,
|
96359
96197
|
false,
|
96360
96198
|
__vue_create_injector__,
|
96361
96199
|
undefined,
|
@@ -96365,23 +96203,23 @@ __vue_render__$s._withStripped = true;
|
|
96365
96203
|
/* script */
|
96366
96204
|
|
96367
96205
|
/* template */
|
96368
|
-
var __vue_render__$
|
96206
|
+
var __vue_render__$u = function () {
|
96369
96207
|
var _vm = this;
|
96370
96208
|
var _h = _vm.$createElement;
|
96371
96209
|
var _c = _vm._self._c || _h;
|
96372
96210
|
return _c("div", [_vm._v("全屏")])
|
96373
96211
|
};
|
96374
|
-
var __vue_staticRenderFns__$
|
96375
|
-
__vue_render__$
|
96212
|
+
var __vue_staticRenderFns__$u = [];
|
96213
|
+
__vue_render__$u._withStripped = true;
|
96376
96214
|
|
96377
96215
|
/* style */
|
96378
|
-
const __vue_inject_styles__$
|
96216
|
+
const __vue_inject_styles__$u = undefined;
|
96379
96217
|
/* scoped */
|
96380
|
-
const __vue_scope_id__$
|
96218
|
+
const __vue_scope_id__$u = undefined;
|
96381
96219
|
/* module identifier */
|
96382
|
-
const __vue_module_identifier__$
|
96220
|
+
const __vue_module_identifier__$u = undefined;
|
96383
96221
|
/* functional template */
|
96384
|
-
const __vue_is_functional_template__$
|
96222
|
+
const __vue_is_functional_template__$u = false;
|
96385
96223
|
/* style inject */
|
96386
96224
|
|
96387
96225
|
/* style inject SSR */
|
@@ -96390,13 +96228,13 @@ __vue_render__$r._withStripped = true;
|
|
96390
96228
|
|
96391
96229
|
|
96392
96230
|
|
96393
|
-
const __vue_component__$
|
96394
|
-
{ render: __vue_render__$
|
96395
|
-
__vue_inject_styles__$
|
96231
|
+
const __vue_component__$u = /*#__PURE__*/__vue_normalize__(
|
96232
|
+
{ render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u },
|
96233
|
+
__vue_inject_styles__$u,
|
96396
96234
|
{},
|
96397
|
-
__vue_scope_id__$
|
96398
|
-
__vue_is_functional_template__$
|
96399
|
-
__vue_module_identifier__$
|
96235
|
+
__vue_scope_id__$u,
|
96236
|
+
__vue_is_functional_template__$u,
|
96237
|
+
__vue_module_identifier__$u,
|
96400
96238
|
false,
|
96401
96239
|
undefined,
|
96402
96240
|
undefined,
|
@@ -96417,7 +96255,7 @@ __vue_render__$r._withStripped = true;
|
|
96417
96255
|
//
|
96418
96256
|
//
|
96419
96257
|
|
96420
|
-
var script$
|
96258
|
+
var script$s = {
|
96421
96259
|
data() {
|
96422
96260
|
return {
|
96423
96261
|
sizeOptions: [
|
@@ -96436,7 +96274,7 @@ var script$q = {
|
|
96436
96274
|
methods: {
|
96437
96275
|
handleSetSize(size) {
|
96438
96276
|
this.$ELEMENT.size = size;
|
96439
|
-
this.$store.dispatch('app/setSize', size);
|
96277
|
+
this.$store.dispatch('z-app/setSize', size);
|
96440
96278
|
this.refreshView();
|
96441
96279
|
this.$message({
|
96442
96280
|
message: 'Switch Size Success',
|
@@ -96445,7 +96283,7 @@ var script$q = {
|
|
96445
96283
|
},
|
96446
96284
|
refreshView() {
|
96447
96285
|
// In order to make the cached page re-rendered
|
96448
|
-
this.$store.dispatch('tagsView/delAllCachedViews', this.$route);
|
96286
|
+
this.$store.dispatch('z-tagsView/delAllCachedViews', this.$route);
|
96449
96287
|
|
96450
96288
|
const { fullPath } = this.$route;
|
96451
96289
|
|
@@ -96459,10 +96297,10 @@ var script$q = {
|
|
96459
96297
|
};
|
96460
96298
|
|
96461
96299
|
/* script */
|
96462
|
-
const __vue_script__$
|
96300
|
+
const __vue_script__$s = script$s;
|
96463
96301
|
|
96464
96302
|
/* template */
|
96465
|
-
var __vue_render__$
|
96303
|
+
var __vue_render__$t = function () {
|
96466
96304
|
var _vm = this;
|
96467
96305
|
var _h = _vm.$createElement;
|
96468
96306
|
var _c = _vm._self._c || _h;
|
@@ -96491,17 +96329,17 @@ var __vue_render__$q = function () {
|
|
96491
96329
|
1
|
96492
96330
|
)
|
96493
96331
|
};
|
96494
|
-
var __vue_staticRenderFns__$
|
96495
|
-
__vue_render__$
|
96332
|
+
var __vue_staticRenderFns__$t = [];
|
96333
|
+
__vue_render__$t._withStripped = true;
|
96496
96334
|
|
96497
96335
|
/* style */
|
96498
|
-
const __vue_inject_styles__$
|
96336
|
+
const __vue_inject_styles__$t = undefined;
|
96499
96337
|
/* scoped */
|
96500
|
-
const __vue_scope_id__$
|
96338
|
+
const __vue_scope_id__$t = undefined;
|
96501
96339
|
/* module identifier */
|
96502
|
-
const __vue_module_identifier__$
|
96340
|
+
const __vue_module_identifier__$t = undefined;
|
96503
96341
|
/* functional template */
|
96504
|
-
const __vue_is_functional_template__$
|
96342
|
+
const __vue_is_functional_template__$t = false;
|
96505
96343
|
/* style inject */
|
96506
96344
|
|
96507
96345
|
/* style inject SSR */
|
@@ -96510,13 +96348,13 @@ __vue_render__$q._withStripped = true;
|
|
96510
96348
|
|
96511
96349
|
|
96512
96350
|
|
96513
|
-
const __vue_component__$
|
96514
|
-
{ render: __vue_render__$
|
96515
|
-
__vue_inject_styles__$
|
96516
|
-
__vue_script__$
|
96517
|
-
__vue_scope_id__$
|
96518
|
-
__vue_is_functional_template__$
|
96519
|
-
__vue_module_identifier__$
|
96351
|
+
const __vue_component__$t = /*#__PURE__*/__vue_normalize__(
|
96352
|
+
{ render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t },
|
96353
|
+
__vue_inject_styles__$t,
|
96354
|
+
__vue_script__$s,
|
96355
|
+
__vue_scope_id__$t,
|
96356
|
+
__vue_is_functional_template__$t,
|
96357
|
+
__vue_module_identifier__$t,
|
96520
96358
|
false,
|
96521
96359
|
undefined,
|
96522
96360
|
undefined,
|
@@ -96562,7 +96400,7 @@ var Fuse = /*@__PURE__*/getDefaultExportFromCjs(fuse_minExports);
|
|
96562
96400
|
//
|
96563
96401
|
|
96564
96402
|
|
96565
|
-
var script$
|
96403
|
+
var script$r = {
|
96566
96404
|
name: 'HeaderSearch',
|
96567
96405
|
data() {
|
96568
96406
|
return {
|
@@ -96575,7 +96413,7 @@ var script$p = {
|
|
96575
96413
|
},
|
96576
96414
|
computed: {
|
96577
96415
|
routes() {
|
96578
|
-
return this.$store.state
|
96416
|
+
return this.$store.state['z-permission'].routes
|
96579
96417
|
}
|
96580
96418
|
},
|
96581
96419
|
watch: {
|
@@ -96692,10 +96530,10 @@ var script$p = {
|
|
96692
96530
|
};
|
96693
96531
|
|
96694
96532
|
/* script */
|
96695
|
-
const __vue_script__$
|
96533
|
+
const __vue_script__$r = script$r;
|
96696
96534
|
|
96697
96535
|
/* template */
|
96698
|
-
var __vue_render__$
|
96536
|
+
var __vue_render__$s = function () {
|
96699
96537
|
var _vm = this;
|
96700
96538
|
var _h = _vm.$createElement;
|
96701
96539
|
var _c = _vm._self._c || _h;
|
@@ -96736,34 +96574,34 @@ var __vue_render__$p = function () {
|
|
96736
96574
|
1
|
96737
96575
|
)
|
96738
96576
|
};
|
96739
|
-
var __vue_staticRenderFns__$
|
96740
|
-
__vue_render__$
|
96577
|
+
var __vue_staticRenderFns__$s = [];
|
96578
|
+
__vue_render__$s._withStripped = true;
|
96741
96579
|
|
96742
96580
|
/* style */
|
96743
|
-
const __vue_inject_styles__$
|
96581
|
+
const __vue_inject_styles__$s = function (inject) {
|
96744
96582
|
if (!inject) return
|
96745
|
-
inject("data-v-
|
96583
|
+
inject("data-v-b6965cc4_0", { source: ".header-search[data-v-b6965cc4] {\n font-size: 0 !important;\n}\n.header-search .search-icon[data-v-b6965cc4] {\n cursor: pointer;\n font-size: 18px;\n vertical-align: middle;\n}\n.header-search .header-search-select[data-v-b6965cc4] {\n font-size: 18px;\n transition: width 0.2s;\n width: 0;\n overflow: hidden;\n background: transparent;\n border-radius: 0;\n display: inline-block;\n vertical-align: middle;\n}\n.header-search .header-search-select[data-v-b6965cc4] .el-input__inner {\n border-radius: 0;\n border: 0;\n padding-left: 0;\n padding-right: 0;\n box-shadow: none !important;\n border-bottom: 1px solid #d9d9d9;\n vertical-align: middle;\n}\n.header-search.show .header-search-select[data-v-b6965cc4] {\n width: 210px;\n margin-left: 10px;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\HeaderSearch\\index.vue","index.vue"],"names":[],"mappings":"AA4JA;EACA,uBAAA;AC3JA;AD4JA;EACA,eAAA;EACA,eAAA;EACA,sBAAA;AC1JA;AD4JA;EACA,eAAA;EACA,sBAAA;EACA,QAAA;EACA,gBAAA;EACA,uBAAA;EACA,gBAAA;EACA,qBAAA;EACA,sBAAA;AC1JA;AD2JA;EACA,gBAAA;EACA,SAAA;EACA,eAAA;EACA,gBAAA;EACA,2BAAA;EACA,gCAAA;EACA,sBAAA;ACzJA;AD6JA;EACA,YAAA;EACA,iBAAA;AC3JA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div :class=\"{ show: show }\" class=\"header-search\">\r\n <!-- <z-icon class-name=\"search-icon\" icon-class=\"search\" @click.stop=\"click\" />-->\r\n <el-select\r\n ref=\"headerSearchSelect\"\r\n v-model=\"search\"\r\n :remote-method=\"querySearch\"\r\n filterable\r\n default-first-option\r\n remote\r\n placeholder=\"Search\"\r\n class=\"header-search-select\"\r\n @change=\"change\"\r\n >\r\n <el-option v-for=\"option in options\" :key=\"option.item.path\" :value=\"option.item\" :label=\"option.item.title.join(' > ')\" />\r\n </el-select>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n// fuse is a lightweight fuzzy-search module\r\n// make search results more in line with expectations\r\nimport Fuse from 'fuse.js/dist/fuse.min.js'\r\nimport path from '../../../../utils/utils'\r\n\r\nexport default {\r\n name: 'HeaderSearch',\r\n data() {\r\n return {\r\n search: '',\r\n options: [],\r\n searchPool: [],\r\n show: false,\r\n fuse: undefined\r\n }\r\n },\r\n computed: {\r\n routes() {\r\n return this.$store.state['z-permission'].routes\r\n }\r\n },\r\n watch: {\r\n routes() {\r\n // this.searchPool = this.generateRoutes(this.routes)\r\n },\r\n searchPool(list) {\r\n // this.initFuse(list)\r\n },\r\n show(value) {\r\n if (value) {\r\n document.body.addEventListener('click', this.close)\r\n } else {\r\n document.body.removeEventListener('click', this.close)\r\n }\r\n }\r\n },\r\n mounted() {\r\n // this.searchPool = this.generateRoutes(this.routes)\r\n },\r\n methods: {\r\n click() {\r\n this.show = !this.show\r\n if (this.show) {\r\n this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()\r\n }\r\n },\r\n close() {\r\n this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()\r\n this.options = []\r\n this.show = false\r\n },\r\n change(val) {\r\n const path = val.path\r\n if (this.ishttp(val.path)) {\r\n // http(s):// 路径新窗口打开\r\n const pindex = path.indexOf('http')\r\n window.open(path.substr(pindex, path.length), '_blank')\r\n } else {\r\n this.$router.push(val.path)\r\n }\r\n this.search = ''\r\n this.options = []\r\n this.$nextTick(() => {\r\n this.show = false\r\n })\r\n },\r\n initFuse(list) {\r\n this.fuse = new Fuse(list, {\r\n shouldSort: true,\r\n threshold: 0.4,\r\n location: 0,\r\n distance: 100,\r\n minMatchCharLength: 1,\r\n keys: [\r\n {\r\n name: 'title',\r\n weight: 0.7\r\n },\r\n {\r\n name: 'path',\r\n weight: 0.3\r\n }\r\n ]\r\n })\r\n },\r\n // Filter out the routes that can be displayed in the sidebar\r\n // And generate the internationalized title\r\n generateRoutes(routes, basePath = '/', prefixTitle = []) {\r\n let res = []\r\n\r\n for (const router of routes) {\r\n // skip hidden router\r\n if (router.hidden) {\r\n continue\r\n }\r\n\r\n const data = {\r\n path: !this.ishttp(router.path) ? path.resolve(basePath, router.path) : router.path,\r\n title: [...prefixTitle]\r\n }\r\n\r\n if (router.meta && router.meta.title) {\r\n data.title = [...data.title, router.meta.title]\r\n\r\n if (router.redirect !== 'noRedirect') {\r\n // only push the routes with title\r\n // special case: need to exclude parent router without redirect\r\n res.push(data)\r\n }\r\n }\r\n\r\n // recursive child routes\r\n if (router.children) {\r\n const tempRoutes = this.generateRoutes(router.children, data.path, data.title)\r\n if (tempRoutes.length >= 1) {\r\n res = [...res, ...tempRoutes]\r\n }\r\n }\r\n }\r\n return res\r\n },\r\n querySearch(query) {\r\n if (query !== '') {\r\n this.options = this.fuse.search(query)\r\n } else {\r\n this.options = []\r\n }\r\n },\r\n ishttp(url) {\r\n return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.header-search {\r\n font-size: 0 !important;\r\n .search-icon {\r\n cursor: pointer;\r\n font-size: 18px;\r\n vertical-align: middle;\r\n }\r\n .header-search-select {\r\n font-size: 18px;\r\n transition: width 0.2s;\r\n width: 0;\r\n overflow: hidden;\r\n background: transparent;\r\n border-radius: 0;\r\n display: inline-block;\r\n vertical-align: middle;\r\n ::v-deep .el-input__inner {\r\n border-radius: 0;\r\n border: 0;\r\n padding-left: 0;\r\n padding-right: 0;\r\n box-shadow: none !important;\r\n border-bottom: 1px solid #d9d9d9;\r\n vertical-align: middle;\r\n }\r\n }\r\n &.show {\r\n .header-search-select {\r\n width: 210px;\r\n margin-left: 10px;\r\n }\r\n }\r\n}\r\n</style>\r\n",".header-search {\n font-size: 0 !important;\n}\n.header-search .search-icon {\n cursor: pointer;\n font-size: 18px;\n vertical-align: middle;\n}\n.header-search .header-search-select {\n font-size: 18px;\n transition: width 0.2s;\n width: 0;\n overflow: hidden;\n background: transparent;\n border-radius: 0;\n display: inline-block;\n vertical-align: middle;\n}\n.header-search .header-search-select ::v-deep .el-input__inner {\n border-radius: 0;\n border: 0;\n padding-left: 0;\n padding-right: 0;\n box-shadow: none !important;\n border-bottom: 1px solid #d9d9d9;\n vertical-align: middle;\n}\n.header-search.show .header-search-select {\n width: 210px;\n margin-left: 10px;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
96746
96584
|
|
96747
96585
|
};
|
96748
96586
|
/* scoped */
|
96749
|
-
const __vue_scope_id__$
|
96587
|
+
const __vue_scope_id__$s = "data-v-b6965cc4";
|
96750
96588
|
/* module identifier */
|
96751
|
-
const __vue_module_identifier__$
|
96589
|
+
const __vue_module_identifier__$s = undefined;
|
96752
96590
|
/* functional template */
|
96753
|
-
const __vue_is_functional_template__$
|
96591
|
+
const __vue_is_functional_template__$s = false;
|
96754
96592
|
/* style inject SSR */
|
96755
96593
|
|
96756
96594
|
/* style inject shadow dom */
|
96757
96595
|
|
96758
96596
|
|
96759
96597
|
|
96760
|
-
const __vue_component__$
|
96761
|
-
{ render: __vue_render__$
|
96762
|
-
__vue_inject_styles__$
|
96763
|
-
__vue_script__$
|
96764
|
-
__vue_scope_id__$
|
96765
|
-
__vue_is_functional_template__$
|
96766
|
-
__vue_module_identifier__$
|
96598
|
+
const __vue_component__$s = /*#__PURE__*/__vue_normalize__(
|
96599
|
+
{ render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s },
|
96600
|
+
__vue_inject_styles__$s,
|
96601
|
+
__vue_script__$r,
|
96602
|
+
__vue_scope_id__$s,
|
96603
|
+
__vue_is_functional_template__$s,
|
96604
|
+
__vue_module_identifier__$s,
|
96767
96605
|
false,
|
96768
96606
|
__vue_create_injector__,
|
96769
96607
|
undefined,
|
@@ -96811,24 +96649,24 @@ __vue_render__$p._withStripped = true;
|
|
96811
96649
|
//
|
96812
96650
|
|
96813
96651
|
|
96814
|
-
var script$
|
96652
|
+
var script$q = {
|
96815
96653
|
components: {
|
96816
|
-
Breadcrumb: __vue_component__$
|
96817
|
-
TopNav: __vue_component__$
|
96818
|
-
Hamburger: __vue_component__$
|
96819
|
-
Screenfull: __vue_component__$
|
96820
|
-
SizeSelect: __vue_component__$
|
96821
|
-
Search: __vue_component__$
|
96654
|
+
Breadcrumb: __vue_component__$x,
|
96655
|
+
TopNav: __vue_component__$w,
|
96656
|
+
Hamburger: __vue_component__$v,
|
96657
|
+
Screenfull: __vue_component__$u,
|
96658
|
+
SizeSelect: __vue_component__$t,
|
96659
|
+
Search: __vue_component__$s
|
96822
96660
|
},
|
96823
96661
|
computed: {
|
96824
|
-
...mapState('app', ['sidebar', 'device']),
|
96825
|
-
...mapState('user', ['avatar']),
|
96662
|
+
...mapState('z-app', ['sidebar', 'device']),
|
96663
|
+
...mapState('z-user', ['avatar']),
|
96826
96664
|
setting: {
|
96827
96665
|
get() {
|
96828
|
-
return this.$store.state
|
96666
|
+
return this.$store.state['z-settings'].showSettings
|
96829
96667
|
},
|
96830
96668
|
set(val) {
|
96831
|
-
this.$store.dispatch('settings/changeSetting', {
|
96669
|
+
this.$store.dispatch('z-settings/changeSetting', {
|
96832
96670
|
key: 'showSettings',
|
96833
96671
|
value: val
|
96834
96672
|
});
|
@@ -96836,13 +96674,13 @@ var script$o = {
|
|
96836
96674
|
},
|
96837
96675
|
topNav: {
|
96838
96676
|
get() {
|
96839
|
-
return this.$store.state
|
96677
|
+
return this.$store.state['z-settings'].topNav
|
96840
96678
|
}
|
96841
96679
|
}
|
96842
96680
|
},
|
96843
96681
|
methods: {
|
96844
96682
|
toggleSideBar() {
|
96845
|
-
this.$store.dispatch('app/toggleSideBar');
|
96683
|
+
this.$store.dispatch('z-app/toggleSideBar');
|
96846
96684
|
},
|
96847
96685
|
async logout() {
|
96848
96686
|
this.$confirm('确定注销并退出系统吗?', '提示', {
|
@@ -96861,10 +96699,10 @@ var script$o = {
|
|
96861
96699
|
};
|
96862
96700
|
|
96863
96701
|
/* script */
|
96864
|
-
const __vue_script__$
|
96702
|
+
const __vue_script__$q = script$q;
|
96865
96703
|
|
96866
96704
|
/* template */
|
96867
|
-
var __vue_render__$
|
96705
|
+
var __vue_render__$r = function () {
|
96868
96706
|
var _vm = this;
|
96869
96707
|
var _h = _vm.$createElement;
|
96870
96708
|
var _c = _vm._self._c || _h;
|
@@ -96934,34 +96772,34 @@ var __vue_render__$o = function () {
|
|
96934
96772
|
1
|
96935
96773
|
)
|
96936
96774
|
};
|
96937
|
-
var __vue_staticRenderFns__$
|
96938
|
-
__vue_render__$
|
96775
|
+
var __vue_staticRenderFns__$r = [];
|
96776
|
+
__vue_render__$r._withStripped = true;
|
96939
96777
|
|
96940
96778
|
/* style */
|
96941
|
-
const __vue_inject_styles__$
|
96779
|
+
const __vue_inject_styles__$r = function (inject) {
|
96942
96780
|
if (!inject) return
|
96943
|
-
inject("data-v-
|
96781
|
+
inject("data-v-4f3f513a_0", { source: ".navbar[data-v-4f3f513a] {\n height: 50px;\n overflow: hidden;\n position: relative;\n background: #fff;\n box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);\n}\n.navbar .hamburger-container[data-v-4f3f513a] {\n line-height: 46px;\n height: 100%;\n float: left;\n cursor: pointer;\n transition: background 0.3s;\n -webkit-tap-highlight-color: transparent;\n}\n.navbar .hamburger-container[data-v-4f3f513a]:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n.navbar .breadcrumb-container[data-v-4f3f513a] {\n float: left;\n}\n.navbar .topmenu-container[data-v-4f3f513a] {\n position: absolute;\n left: 50px;\n}\n.navbar .errLog-container[data-v-4f3f513a] {\n display: inline-block;\n vertical-align: top;\n}\n.navbar .right-menu[data-v-4f3f513a] {\n float: right;\n height: 100%;\n line-height: 50px;\n}\n.navbar .right-menu[data-v-4f3f513a]:focus {\n outline: none;\n}\n.navbar .right-menu .right-menu-item[data-v-4f3f513a] {\n display: inline-block;\n padding: 0 8px;\n height: 100%;\n font-size: 18px;\n color: #5a5e66;\n vertical-align: text-bottom;\n}\n.navbar .right-menu .right-menu-item.hover-effect[data-v-4f3f513a] {\n cursor: pointer;\n transition: background 0.3s;\n}\n.navbar .right-menu .right-menu-item.hover-effect[data-v-4f3f513a]:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n.navbar .right-menu .avatar-container[data-v-4f3f513a] {\n margin-right: 30px;\n}\n.navbar .right-menu .avatar-container .avatar-wrapper[data-v-4f3f513a] {\n margin-top: 5px;\n position: relative;\n}\n.navbar .right-menu .avatar-container .avatar-wrapper .user-avatar[data-v-4f3f513a] {\n cursor: pointer;\n width: 40px;\n height: 40px;\n border-radius: 10px;\n}\n.navbar .right-menu .avatar-container .avatar-wrapper .el-icon-caret-bottom[data-v-4f3f513a] {\n cursor: pointer;\n position: absolute;\n right: -20px;\n top: 25px;\n font-size: 12px;\n}\n\n/*# sourceMappingURL=Navbar.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\Navbar.vue","Navbar.vue"],"names":[],"mappings":"AAmGA;EACA,YAAA;EACA,gBAAA;EACA,kBAAA;EACA,gBAAA;EACA,2CAAA;AClGA;ADmGA;EACA,iBAAA;EACA,YAAA;EACA,WAAA;EACA,eAAA;EACA,2BAAA;EACA,wCAAA;ACjGA;ADkGA;EACA,gCAAA;AChGA;ADmGA;EACA,WAAA;ACjGA;ADmGA;EACA,kBAAA;EACA,UAAA;ACjGA;ADmGA;EACA,qBAAA;EACA,mBAAA;ACjGA;ADmGA;EACA,YAAA;EACA,YAAA;EACA,iBAAA;ACjGA;ADkGA;EACA,aAAA;AChGA;ADkGA;EACA,qBAAA;EACA,cAAA;EACA,YAAA;EACA,eAAA;EACA,cAAA;EACA,2BAAA;AChGA;ADiGA;EACA,eAAA;EACA,2BAAA;AC/FA;ADgGA;EACA,gCAAA;AC9FA;ADkGA;EACA,kBAAA;AChGA;ADiGA;EACA,eAAA;EACA,kBAAA;AC/FA;ADgGA;EACA,eAAA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;AC9FA;ADgGA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EACA,SAAA;EACA,eAAA;AC9FA;;AAEA,qCAAqC","file":"Navbar.vue","sourcesContent":["<template>\r\n <div class=\"navbar\">\r\n <hamburger id=\"hamburger-container\" :is-active=\"sidebar.opened\" class=\"hamburger-container\" @toggleClick=\"toggleSideBar\" />\r\n\r\n <breadcrumb id=\"breadcrumb-container\" class=\"breadcrumb-container\" v-if=\"!topNav\" />\r\n <top-nav id=\"topmenu-container\" class=\"topmenu-container\" v-if=\"topNav\" />\r\n\r\n <div class=\"right-menu\">\r\n <template v-if=\"device !== 'mobile'\">\r\n <search id=\"header-search\" class=\"right-menu-item\" />\r\n\r\n <screenfull id=\"screenfull\" class=\"right-menu-item hover-effect\" />\r\n\r\n <el-tooltip content=\"布局大小\" effect=\"dark\" placement=\"bottom\">\r\n <size-select id=\"size-select\" class=\"right-menu-item hover-effect\" />\r\n </el-tooltip>\r\n </template>\r\n\r\n <!-- <el-dropdown class=\"avatar-container right-menu-item hover-effect\" trigger=\"click\">-->\r\n <!-- <div class=\"avatar-wrapper\">-->\r\n <!-- <img :src=\"avatar\" class=\"user-avatar\" />-->\r\n <!-- <i class=\"el-icon-caret-bottom\" />-->\r\n <!-- </div>-->\r\n <!-- <el-dropdown-menu slot=\"dropdown\">-->\r\n <!-- <router-link to=\"/user/profile\">-->\r\n <!-- <el-dropdown-item>个人中心</el-dropdown-item>-->\r\n <!-- </router-link>-->\r\n <!-- <el-dropdown-item @click.native=\"setting = true\">-->\r\n <!-- <span>布局设置</span>-->\r\n <!-- </el-dropdown-item>-->\r\n <!-- <el-dropdown-item divided @click.native=\"logout\">-->\r\n <!-- <span>退出登录</span>-->\r\n <!-- </el-dropdown-item>-->\r\n <!-- </el-dropdown-menu>-->\r\n <!-- </el-dropdown>-->\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mapState } from 'vuex'\r\nimport Breadcrumb from './Breadcrumb/index.vue'\r\nimport TopNav from './TopNav/index.vue'\r\nimport Hamburger from './Hamburger/index.vue'\r\nimport Screenfull from './Screenfull/index.vue'\r\nimport SizeSelect from './SizeSelect/index.vue'\r\nimport Search from './HeaderSearch/index.vue'\r\n\r\nexport default {\r\n components: {\r\n Breadcrumb,\r\n TopNav,\r\n Hamburger,\r\n Screenfull,\r\n SizeSelect,\r\n Search\r\n },\r\n computed: {\r\n ...mapState('z-app', ['sidebar', 'device']),\r\n ...mapState('z-user', ['avatar']),\r\n setting: {\r\n get() {\r\n return this.$store.state['z-settings'].showSettings\r\n },\r\n set(val) {\r\n this.$store.dispatch('z-settings/changeSetting', {\r\n key: 'showSettings',\r\n value: val\r\n })\r\n }\r\n },\r\n topNav: {\r\n get() {\r\n return this.$store.state['z-settings'].topNav\r\n }\r\n }\r\n },\r\n methods: {\r\n toggleSideBar() {\r\n this.$store.dispatch('z-app/toggleSideBar')\r\n },\r\n async logout() {\r\n this.$confirm('确定注销并退出系统吗?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(() => {\r\n this.$store.dispatch('LogOut').then(() => {\r\n location.href = '/index'\r\n })\r\n })\r\n .catch(() => {})\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.navbar {\r\n height: 50px;\r\n overflow: hidden;\r\n position: relative;\r\n background: #fff;\r\n box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);\r\n .hamburger-container {\r\n line-height: 46px;\r\n height: 100%;\r\n float: left;\r\n cursor: pointer;\r\n transition: background 0.3s;\r\n -webkit-tap-highlight-color: transparent;\r\n &:hover {\r\n background: rgba(0, 0, 0, 0.025);\r\n }\r\n }\r\n .breadcrumb-container {\r\n float: left;\r\n }\r\n .topmenu-container {\r\n position: absolute;\r\n left: 50px;\r\n }\r\n .errLog-container {\r\n display: inline-block;\r\n vertical-align: top;\r\n }\r\n .right-menu {\r\n float: right;\r\n height: 100%;\r\n line-height: 50px;\r\n &:focus {\r\n outline: none;\r\n }\r\n .right-menu-item {\r\n display: inline-block;\r\n padding: 0 8px;\r\n height: 100%;\r\n font-size: 18px;\r\n color: #5a5e66;\r\n vertical-align: text-bottom;\r\n &.hover-effect {\r\n cursor: pointer;\r\n transition: background 0.3s;\r\n &:hover {\r\n background: rgba(0, 0, 0, 0.025);\r\n }\r\n }\r\n }\r\n .avatar-container {\r\n margin-right: 30px;\r\n .avatar-wrapper {\r\n margin-top: 5px;\r\n position: relative;\r\n .user-avatar {\r\n cursor: pointer;\r\n width: 40px;\r\n height: 40px;\r\n border-radius: 10px;\r\n }\r\n .el-icon-caret-bottom {\r\n cursor: pointer;\r\n position: absolute;\r\n right: -20px;\r\n top: 25px;\r\n font-size: 12px;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n",".navbar {\n height: 50px;\n overflow: hidden;\n position: relative;\n background: #fff;\n box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);\n}\n.navbar .hamburger-container {\n line-height: 46px;\n height: 100%;\n float: left;\n cursor: pointer;\n transition: background 0.3s;\n -webkit-tap-highlight-color: transparent;\n}\n.navbar .hamburger-container:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n.navbar .breadcrumb-container {\n float: left;\n}\n.navbar .topmenu-container {\n position: absolute;\n left: 50px;\n}\n.navbar .errLog-container {\n display: inline-block;\n vertical-align: top;\n}\n.navbar .right-menu {\n float: right;\n height: 100%;\n line-height: 50px;\n}\n.navbar .right-menu:focus {\n outline: none;\n}\n.navbar .right-menu .right-menu-item {\n display: inline-block;\n padding: 0 8px;\n height: 100%;\n font-size: 18px;\n color: #5a5e66;\n vertical-align: text-bottom;\n}\n.navbar .right-menu .right-menu-item.hover-effect {\n cursor: pointer;\n transition: background 0.3s;\n}\n.navbar .right-menu .right-menu-item.hover-effect:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n.navbar .right-menu .avatar-container {\n margin-right: 30px;\n}\n.navbar .right-menu .avatar-container .avatar-wrapper {\n margin-top: 5px;\n position: relative;\n}\n.navbar .right-menu .avatar-container .avatar-wrapper .user-avatar {\n cursor: pointer;\n width: 40px;\n height: 40px;\n border-radius: 10px;\n}\n.navbar .right-menu .avatar-container .avatar-wrapper .el-icon-caret-bottom {\n cursor: pointer;\n position: absolute;\n right: -20px;\n top: 25px;\n font-size: 12px;\n}\n\n/*# sourceMappingURL=Navbar.vue.map */"]}, media: undefined });
|
96944
96782
|
|
96945
96783
|
};
|
96946
96784
|
/* scoped */
|
96947
|
-
const __vue_scope_id__$
|
96785
|
+
const __vue_scope_id__$r = "data-v-4f3f513a";
|
96948
96786
|
/* module identifier */
|
96949
|
-
const __vue_module_identifier__$
|
96787
|
+
const __vue_module_identifier__$r = undefined;
|
96950
96788
|
/* functional template */
|
96951
|
-
const __vue_is_functional_template__$
|
96789
|
+
const __vue_is_functional_template__$r = false;
|
96952
96790
|
/* style inject SSR */
|
96953
96791
|
|
96954
96792
|
/* style inject shadow dom */
|
96955
96793
|
|
96956
96794
|
|
96957
96795
|
|
96958
|
-
const __vue_component__$
|
96959
|
-
{ render: __vue_render__$
|
96960
|
-
__vue_inject_styles__$
|
96961
|
-
__vue_script__$
|
96962
|
-
__vue_scope_id__$
|
96963
|
-
__vue_is_functional_template__$
|
96964
|
-
__vue_module_identifier__$
|
96796
|
+
const __vue_component__$r = /*#__PURE__*/__vue_normalize__(
|
96797
|
+
{ render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r },
|
96798
|
+
__vue_inject_styles__$r,
|
96799
|
+
__vue_script__$q,
|
96800
|
+
__vue_scope_id__$r,
|
96801
|
+
__vue_is_functional_template__$r,
|
96802
|
+
__vue_module_identifier__$r,
|
96965
96803
|
false,
|
96966
96804
|
__vue_create_injector__,
|
96967
96805
|
undefined,
|
@@ -96995,7 +96833,7 @@ var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAA
|
|
96995
96833
|
//
|
96996
96834
|
|
96997
96835
|
|
96998
|
-
var script$
|
96836
|
+
var script$p = {
|
96999
96837
|
name: 'SidebarLogo',
|
97000
96838
|
props: {
|
97001
96839
|
collapse: {
|
@@ -97008,7 +96846,7 @@ var script$n = {
|
|
97008
96846
|
return variables
|
97009
96847
|
},
|
97010
96848
|
sideTheme() {
|
97011
|
-
return this.$store.state
|
96849
|
+
return this.$store.state['z-settings'].sideTheme
|
97012
96850
|
}
|
97013
96851
|
},
|
97014
96852
|
data() {
|
@@ -97023,10 +96861,10 @@ var script$n = {
|
|
97023
96861
|
};
|
97024
96862
|
|
97025
96863
|
/* script */
|
97026
|
-
const __vue_script__$
|
96864
|
+
const __vue_script__$p = script$p;
|
97027
96865
|
|
97028
96866
|
/* template */
|
97029
|
-
var __vue_render__$
|
96867
|
+
var __vue_render__$q = function () {
|
97030
96868
|
var _vm = this;
|
97031
96869
|
var _h = _vm.$createElement;
|
97032
96870
|
var _c = _vm._self._c || _h;
|
@@ -97117,34 +96955,34 @@ var __vue_render__$n = function () {
|
|
97117
96955
|
1
|
97118
96956
|
)
|
97119
96957
|
};
|
97120
|
-
var __vue_staticRenderFns__$
|
97121
|
-
__vue_render__$
|
96958
|
+
var __vue_staticRenderFns__$q = [];
|
96959
|
+
__vue_render__$q._withStripped = true;
|
97122
96960
|
|
97123
96961
|
/* style */
|
97124
|
-
const __vue_inject_styles__$
|
96962
|
+
const __vue_inject_styles__$q = function (inject) {
|
97125
96963
|
if (!inject) return
|
97126
|
-
inject("data-v-
|
96964
|
+
inject("data-v-183d881d_0", { source: ".sidebarLogoFade-enter-active[data-v-183d881d] {\n transition: opacity 1.5s;\n}\n.sidebarLogoFade-enter[data-v-183d881d],\n.sidebarLogoFade-leave-to[data-v-183d881d] {\n opacity: 0;\n}\n.sidebar-logo-container[data-v-183d881d] {\n position: relative;\n width: 100%;\n height: 50px;\n line-height: 50px;\n background: #2b2f3a;\n text-align: center;\n overflow: hidden;\n}\n.sidebar-logo-container .sidebar-logo-link[data-v-183d881d] {\n height: 100%;\n width: 100%;\n}\n.sidebar-logo-container .sidebar-logo-link .sidebar-logo[data-v-183d881d] {\n width: 32px;\n height: 32px;\n vertical-align: middle;\n margin-right: 12px;\n}\n.sidebar-logo-container .sidebar-logo-link .sidebar-title[data-v-183d881d] {\n display: inline-block;\n margin: 0;\n color: #fff;\n font-weight: 600;\n line-height: 50px;\n font-size: 14px;\n font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;\n vertical-align: middle;\n}\n.sidebar-logo-container.collapse .sidebar-logo[data-v-183d881d] {\n margin-right: 0px;\n}\n\n/*# sourceMappingURL=Logo.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\Sidebar\\Logo.vue","Logo.vue"],"names":[],"mappings":"AAwDA;EACA,wBAAA;ACvDA;AD0DA;;EAEA,UAAA;ACvDA;AD0DA;EACA,kBAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,mBAAA;EACA,kBAAA;EACA,gBAAA;ACvDA;ADyDA;EACA,YAAA;EACA,WAAA;ACvDA;ADyDA;EACA,WAAA;EACA,YAAA;EACA,sBAAA;EACA,kBAAA;ACvDA;AD0DA;EACA,qBAAA;EACA,SAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,eAAA;EACA,iEAAA;EACA,sBAAA;ACxDA;AD6DA;EACA,iBAAA;AC3DA;;AAEA,mCAAmC","file":"Logo.vue","sourcesContent":["<template>\r\n <div\r\n class=\"sidebar-logo-container\"\r\n :class=\"{ collapse: collapse }\"\r\n :style=\"{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }\"\r\n >\r\n <transition name=\"sidebarLogoFade\">\r\n <router-link v-if=\"collapse\" key=\"collapse\" class=\"sidebar-logo-link\" to=\"/\">\r\n <img v-if=\"logo\" :src=\"logo\" class=\"sidebar-logo\" />\r\n <h1 v-else class=\"sidebar-title\" :style=\"{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }\">\r\n {{ $z.title }}\r\n </h1>\r\n </router-link>\r\n <router-link v-else key=\"expand\" class=\"sidebar-logo-link\" to=\"/\">\r\n <img v-if=\"logo\" :src=\"logo\" class=\"sidebar-logo\" />\r\n <h1 class=\"sidebar-title\" :style=\"{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }\">\r\n {{ $z.title }}\r\n </h1>\r\n </router-link>\r\n </transition>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport logoImg from '../../logo/logo.png'\r\nimport variables from '../../scss/variables.module.scss'\r\n\r\nexport default {\r\n name: 'SidebarLogo',\r\n props: {\r\n collapse: {\r\n type: Boolean,\r\n required: true\r\n }\r\n },\r\n computed: {\r\n variables() {\r\n return variables\r\n },\r\n sideTheme() {\r\n return this.$store.state['z-settings'].sideTheme\r\n }\r\n },\r\n data() {\r\n return {\r\n // title: process.env.VUE_APP_TITLE,\r\n logo: logoImg\r\n }\r\n },\r\n mounted() {\r\n // console.log(process.env.VUE_APP_TITLE)\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.sidebarLogoFade-enter-active {\r\n transition: opacity 1.5s;\r\n}\r\n\r\n.sidebarLogoFade-enter,\r\n.sidebarLogoFade-leave-to {\r\n opacity: 0;\r\n}\r\n\r\n.sidebar-logo-container {\r\n position: relative;\r\n width: 100%;\r\n height: 50px;\r\n line-height: 50px;\r\n background: #2b2f3a;\r\n text-align: center;\r\n overflow: hidden;\r\n\r\n & .sidebar-logo-link {\r\n height: 100%;\r\n width: 100%;\r\n\r\n & .sidebar-logo {\r\n width: 32px;\r\n height: 32px;\r\n vertical-align: middle;\r\n margin-right: 12px;\r\n }\r\n\r\n & .sidebar-title {\r\n display: inline-block;\r\n margin: 0;\r\n color: #fff;\r\n font-weight: 600;\r\n line-height: 50px;\r\n font-size: 14px;\r\n font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;\r\n vertical-align: middle;\r\n }\r\n }\r\n\r\n &.collapse {\r\n .sidebar-logo {\r\n margin-right: 0px;\r\n }\r\n }\r\n}\r\n</style>\r\n",".sidebarLogoFade-enter-active {\n transition: opacity 1.5s;\n}\n\n.sidebarLogoFade-enter,\n.sidebarLogoFade-leave-to {\n opacity: 0;\n}\n\n.sidebar-logo-container {\n position: relative;\n width: 100%;\n height: 50px;\n line-height: 50px;\n background: #2b2f3a;\n text-align: center;\n overflow: hidden;\n}\n.sidebar-logo-container .sidebar-logo-link {\n height: 100%;\n width: 100%;\n}\n.sidebar-logo-container .sidebar-logo-link .sidebar-logo {\n width: 32px;\n height: 32px;\n vertical-align: middle;\n margin-right: 12px;\n}\n.sidebar-logo-container .sidebar-logo-link .sidebar-title {\n display: inline-block;\n margin: 0;\n color: #fff;\n font-weight: 600;\n line-height: 50px;\n font-size: 14px;\n font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;\n vertical-align: middle;\n}\n.sidebar-logo-container.collapse .sidebar-logo {\n margin-right: 0px;\n}\n\n/*# sourceMappingURL=Logo.vue.map */"]}, media: undefined });
|
97127
96965
|
|
97128
96966
|
};
|
97129
96967
|
/* scoped */
|
97130
|
-
const __vue_scope_id__$
|
96968
|
+
const __vue_scope_id__$q = "data-v-183d881d";
|
97131
96969
|
/* module identifier */
|
97132
|
-
const __vue_module_identifier__$
|
96970
|
+
const __vue_module_identifier__$q = undefined;
|
97133
96971
|
/* functional template */
|
97134
|
-
const __vue_is_functional_template__$
|
96972
|
+
const __vue_is_functional_template__$q = false;
|
97135
96973
|
/* style inject SSR */
|
97136
96974
|
|
97137
96975
|
/* style inject shadow dom */
|
97138
96976
|
|
97139
96977
|
|
97140
96978
|
|
97141
|
-
const __vue_component__$
|
97142
|
-
{ render: __vue_render__$
|
97143
|
-
__vue_inject_styles__$
|
97144
|
-
__vue_script__$
|
97145
|
-
__vue_scope_id__$
|
97146
|
-
__vue_is_functional_template__$
|
97147
|
-
__vue_module_identifier__$
|
96979
|
+
const __vue_component__$q = /*#__PURE__*/__vue_normalize__(
|
96980
|
+
{ render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q },
|
96981
|
+
__vue_inject_styles__$q,
|
96982
|
+
__vue_script__$p,
|
96983
|
+
__vue_scope_id__$q,
|
96984
|
+
__vue_is_functional_template__$q,
|
96985
|
+
__vue_module_identifier__$q,
|
97148
96986
|
false,
|
97149
96987
|
__vue_create_injector__,
|
97150
96988
|
undefined,
|
@@ -97158,7 +96996,7 @@ __vue_render__$n._withStripped = true;
|
|
97158
96996
|
//
|
97159
96997
|
//
|
97160
96998
|
|
97161
|
-
var script$
|
96999
|
+
var script$o = {
|
97162
97000
|
name: 'MenuItem',
|
97163
97001
|
props: {
|
97164
97002
|
icon: {
|
@@ -97173,10 +97011,10 @@ var script$m = {
|
|
97173
97011
|
};
|
97174
97012
|
|
97175
97013
|
/* script */
|
97176
|
-
const __vue_script__$
|
97014
|
+
const __vue_script__$o = script$o;
|
97177
97015
|
|
97178
97016
|
/* template */
|
97179
|
-
var __vue_render__$
|
97017
|
+
var __vue_render__$p = function () {
|
97180
97018
|
var _vm = this;
|
97181
97019
|
var _h = _vm.$createElement;
|
97182
97020
|
var _c = _vm._self._c || _h;
|
@@ -97186,17 +97024,17 @@ var __vue_render__$m = function () {
|
|
97186
97024
|
]),
|
97187
97025
|
])
|
97188
97026
|
};
|
97189
|
-
var __vue_staticRenderFns__$
|
97190
|
-
__vue_render__$
|
97027
|
+
var __vue_staticRenderFns__$p = [];
|
97028
|
+
__vue_render__$p._withStripped = true;
|
97191
97029
|
|
97192
97030
|
/* style */
|
97193
|
-
const __vue_inject_styles__$
|
97031
|
+
const __vue_inject_styles__$p = undefined;
|
97194
97032
|
/* scoped */
|
97195
|
-
const __vue_scope_id__$
|
97033
|
+
const __vue_scope_id__$p = undefined;
|
97196
97034
|
/* module identifier */
|
97197
|
-
const __vue_module_identifier__$
|
97035
|
+
const __vue_module_identifier__$p = undefined;
|
97198
97036
|
/* functional template */
|
97199
|
-
const __vue_is_functional_template__$
|
97037
|
+
const __vue_is_functional_template__$p = false;
|
97200
97038
|
/* style inject */
|
97201
97039
|
|
97202
97040
|
/* style inject SSR */
|
@@ -97205,13 +97043,13 @@ __vue_render__$m._withStripped = true;
|
|
97205
97043
|
|
97206
97044
|
|
97207
97045
|
|
97208
|
-
const __vue_component__$
|
97209
|
-
{ render: __vue_render__$
|
97210
|
-
__vue_inject_styles__$
|
97211
|
-
__vue_script__$
|
97212
|
-
__vue_scope_id__$
|
97213
|
-
__vue_is_functional_template__$
|
97214
|
-
__vue_module_identifier__$
|
97046
|
+
const __vue_component__$p = /*#__PURE__*/__vue_normalize__(
|
97047
|
+
{ render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p },
|
97048
|
+
__vue_inject_styles__$p,
|
97049
|
+
__vue_script__$o,
|
97050
|
+
__vue_scope_id__$p,
|
97051
|
+
__vue_is_functional_template__$p,
|
97052
|
+
__vue_module_identifier__$p,
|
97215
97053
|
false,
|
97216
97054
|
undefined,
|
97217
97055
|
undefined,
|
@@ -97226,7 +97064,7 @@ __vue_render__$m._withStripped = true;
|
|
97226
97064
|
//
|
97227
97065
|
|
97228
97066
|
|
97229
|
-
var script$
|
97067
|
+
var script$n = {
|
97230
97068
|
props: {
|
97231
97069
|
to: {
|
97232
97070
|
type: [String, Object],
|
@@ -97261,10 +97099,10 @@ var script$l = {
|
|
97261
97099
|
};
|
97262
97100
|
|
97263
97101
|
/* script */
|
97264
|
-
const __vue_script__$
|
97102
|
+
const __vue_script__$n = script$n;
|
97265
97103
|
|
97266
97104
|
/* template */
|
97267
|
-
var __vue_render__$
|
97105
|
+
var __vue_render__$o = function () {
|
97268
97106
|
var _vm = this;
|
97269
97107
|
var _h = _vm.$createElement;
|
97270
97108
|
var _c = _vm._self._c || _h;
|
@@ -97275,17 +97113,17 @@ var __vue_render__$l = function () {
|
|
97275
97113
|
2
|
97276
97114
|
)
|
97277
97115
|
};
|
97278
|
-
var __vue_staticRenderFns__$
|
97279
|
-
__vue_render__$
|
97116
|
+
var __vue_staticRenderFns__$o = [];
|
97117
|
+
__vue_render__$o._withStripped = true;
|
97280
97118
|
|
97281
97119
|
/* style */
|
97282
|
-
const __vue_inject_styles__$
|
97120
|
+
const __vue_inject_styles__$o = undefined;
|
97283
97121
|
/* scoped */
|
97284
|
-
const __vue_scope_id__$
|
97122
|
+
const __vue_scope_id__$o = undefined;
|
97285
97123
|
/* module identifier */
|
97286
|
-
const __vue_module_identifier__$
|
97124
|
+
const __vue_module_identifier__$o = undefined;
|
97287
97125
|
/* functional template */
|
97288
|
-
const __vue_is_functional_template__$
|
97126
|
+
const __vue_is_functional_template__$o = false;
|
97289
97127
|
/* style inject */
|
97290
97128
|
|
97291
97129
|
/* style inject SSR */
|
@@ -97294,13 +97132,13 @@ __vue_render__$l._withStripped = true;
|
|
97294
97132
|
|
97295
97133
|
|
97296
97134
|
|
97297
|
-
const __vue_component__$
|
97298
|
-
{ render: __vue_render__$
|
97299
|
-
__vue_inject_styles__$
|
97300
|
-
__vue_script__$
|
97301
|
-
__vue_scope_id__$
|
97302
|
-
__vue_is_functional_template__$
|
97303
|
-
__vue_module_identifier__$
|
97135
|
+
const __vue_component__$o = /*#__PURE__*/__vue_normalize__(
|
97136
|
+
{ render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o },
|
97137
|
+
__vue_inject_styles__$o,
|
97138
|
+
__vue_script__$n,
|
97139
|
+
__vue_scope_id__$o,
|
97140
|
+
__vue_is_functional_template__$o,
|
97141
|
+
__vue_module_identifier__$o,
|
97304
97142
|
false,
|
97305
97143
|
undefined,
|
97306
97144
|
undefined,
|
@@ -97310,7 +97148,7 @@ __vue_render__$l._withStripped = true;
|
|
97310
97148
|
var FixiOSBug = {
|
97311
97149
|
computed: {
|
97312
97150
|
device() {
|
97313
|
-
return this.$store.state
|
97151
|
+
return this.$store.state['z-app'].device
|
97314
97152
|
}
|
97315
97153
|
},
|
97316
97154
|
mounted() {
|
@@ -97361,9 +97199,9 @@ var FixiOSBug = {
|
|
97361
97199
|
//
|
97362
97200
|
|
97363
97201
|
|
97364
|
-
var script$
|
97202
|
+
var script$m = {
|
97365
97203
|
name: 'SidebarItem',
|
97366
|
-
components: { Item: __vue_component__$
|
97204
|
+
components: { Item: __vue_component__$p, AppLink: __vue_component__$o },
|
97367
97205
|
mixins: [FixiOSBug],
|
97368
97206
|
props: {
|
97369
97207
|
// route object
|
@@ -97429,10 +97267,10 @@ var script$k = {
|
|
97429
97267
|
};
|
97430
97268
|
|
97431
97269
|
/* script */
|
97432
|
-
const __vue_script__$
|
97270
|
+
const __vue_script__$m = script$m;
|
97433
97271
|
|
97434
97272
|
/* template */
|
97435
|
-
var __vue_render__$
|
97273
|
+
var __vue_render__$n = function () {
|
97436
97274
|
var _vm = this;
|
97437
97275
|
var _h = _vm.$createElement;
|
97438
97276
|
var _c = _vm._self._c || _h;
|
@@ -97526,17 +97364,17 @@ var __vue_render__$k = function () {
|
|
97526
97364
|
)
|
97527
97365
|
: _vm._e()
|
97528
97366
|
};
|
97529
|
-
var __vue_staticRenderFns__$
|
97530
|
-
__vue_render__$
|
97367
|
+
var __vue_staticRenderFns__$n = [];
|
97368
|
+
__vue_render__$n._withStripped = true;
|
97531
97369
|
|
97532
97370
|
/* style */
|
97533
|
-
const __vue_inject_styles__$
|
97371
|
+
const __vue_inject_styles__$n = undefined;
|
97534
97372
|
/* scoped */
|
97535
|
-
const __vue_scope_id__$
|
97373
|
+
const __vue_scope_id__$n = undefined;
|
97536
97374
|
/* module identifier */
|
97537
|
-
const __vue_module_identifier__$
|
97375
|
+
const __vue_module_identifier__$n = undefined;
|
97538
97376
|
/* functional template */
|
97539
|
-
const __vue_is_functional_template__$
|
97377
|
+
const __vue_is_functional_template__$n = false;
|
97540
97378
|
/* style inject */
|
97541
97379
|
|
97542
97380
|
/* style inject SSR */
|
@@ -97545,13 +97383,13 @@ __vue_render__$k._withStripped = true;
|
|
97545
97383
|
|
97546
97384
|
|
97547
97385
|
|
97548
|
-
const __vue_component__$
|
97549
|
-
{ render: __vue_render__$
|
97550
|
-
__vue_inject_styles__$
|
97551
|
-
__vue_script__$
|
97552
|
-
__vue_scope_id__$
|
97553
|
-
__vue_is_functional_template__$
|
97554
|
-
__vue_module_identifier__$
|
97386
|
+
const __vue_component__$n = /*#__PURE__*/__vue_normalize__(
|
97387
|
+
{ render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
|
97388
|
+
__vue_inject_styles__$n,
|
97389
|
+
__vue_script__$m,
|
97390
|
+
__vue_scope_id__$n,
|
97391
|
+
__vue_is_functional_template__$n,
|
97392
|
+
__vue_module_identifier__$n,
|
97555
97393
|
false,
|
97556
97394
|
undefined,
|
97557
97395
|
undefined,
|
@@ -97583,12 +97421,12 @@ __vue_render__$k._withStripped = true;
|
|
97583
97421
|
//
|
97584
97422
|
|
97585
97423
|
|
97586
|
-
var script$
|
97587
|
-
components: { SidebarItem: __vue_component__$
|
97424
|
+
var script$l = {
|
97425
|
+
components: { SidebarItem: __vue_component__$n, Logo: __vue_component__$q },
|
97588
97426
|
computed: {
|
97589
|
-
...mapState(['settings']),
|
97590
|
-
...mapState('app', ['sidebar']),
|
97591
|
-
...mapState('permission', ['sidebarRouters']),
|
97427
|
+
...mapState(['z-settings']),
|
97428
|
+
...mapState('z-app', ['sidebar']),
|
97429
|
+
...mapState('z-permission', ['sidebarRouters']),
|
97592
97430
|
activeMenu() {
|
97593
97431
|
const route = this.$route;
|
97594
97432
|
const { meta, path } = route;
|
@@ -97599,7 +97437,7 @@ var script$j = {
|
|
97599
97437
|
return path
|
97600
97438
|
},
|
97601
97439
|
showLogo() {
|
97602
|
-
return this.$store.state
|
97440
|
+
return this.$store.state['z-settings'].sidebarLogo
|
97603
97441
|
},
|
97604
97442
|
variables() {
|
97605
97443
|
return variables
|
@@ -97612,10 +97450,10 @@ var script$j = {
|
|
97612
97450
|
};
|
97613
97451
|
|
97614
97452
|
/* script */
|
97615
|
-
const __vue_script__$
|
97453
|
+
const __vue_script__$l = script$l;
|
97616
97454
|
|
97617
97455
|
/* template */
|
97618
|
-
var __vue_render__$
|
97456
|
+
var __vue_render__$m = function () {
|
97619
97457
|
var _vm = this;
|
97620
97458
|
var _h = _vm.$createElement;
|
97621
97459
|
var _c = _vm._self._c || _h;
|
@@ -97625,7 +97463,7 @@ var __vue_render__$j = function () {
|
|
97625
97463
|
class: { "has-logo": _vm.showLogo },
|
97626
97464
|
style: {
|
97627
97465
|
backgroundColor:
|
97628
|
-
|
97466
|
+
this["z-settings"].sideTheme === "theme-dark"
|
97629
97467
|
? _vm.variables.menuBackground
|
97630
97468
|
: _vm.variables.menuLightBackground,
|
97631
97469
|
},
|
@@ -97638,7 +97476,7 @@ var __vue_render__$j = function () {
|
|
97638
97476
|
_c(
|
97639
97477
|
"el-scrollbar",
|
97640
97478
|
{
|
97641
|
-
class:
|
97479
|
+
class: this["z-settings"].sideTheme,
|
97642
97480
|
attrs: { "wrap-class": "scrollbar-wrapper" },
|
97643
97481
|
},
|
97644
97482
|
[
|
@@ -97649,15 +97487,15 @@ var __vue_render__$j = function () {
|
|
97649
97487
|
"default-active": _vm.activeMenu,
|
97650
97488
|
collapse: _vm.isCollapse,
|
97651
97489
|
"background-color":
|
97652
|
-
|
97490
|
+
this["z-settings"].sideTheme === "theme-dark"
|
97653
97491
|
? _vm.variables.menuBackground
|
97654
97492
|
: _vm.variables.menuLightBackground,
|
97655
97493
|
"text-color":
|
97656
|
-
|
97494
|
+
this["z-settings"].sideTheme === "theme-dark"
|
97657
97495
|
? _vm.variables.menuColor
|
97658
97496
|
: _vm.variables.menuLightColor,
|
97659
97497
|
"unique-opened": true,
|
97660
|
-
"active-text-color":
|
97498
|
+
"active-text-color": this["z-settings"].theme,
|
97661
97499
|
"collapse-transition": false,
|
97662
97500
|
mode: "vertical",
|
97663
97501
|
},
|
@@ -97677,17 +97515,17 @@ var __vue_render__$j = function () {
|
|
97677
97515
|
1
|
97678
97516
|
)
|
97679
97517
|
};
|
97680
|
-
var __vue_staticRenderFns__$
|
97681
|
-
__vue_render__$
|
97518
|
+
var __vue_staticRenderFns__$m = [];
|
97519
|
+
__vue_render__$m._withStripped = true;
|
97682
97520
|
|
97683
97521
|
/* style */
|
97684
|
-
const __vue_inject_styles__$
|
97522
|
+
const __vue_inject_styles__$m = undefined;
|
97685
97523
|
/* scoped */
|
97686
|
-
const __vue_scope_id__$
|
97524
|
+
const __vue_scope_id__$m = undefined;
|
97687
97525
|
/* module identifier */
|
97688
|
-
const __vue_module_identifier__$
|
97526
|
+
const __vue_module_identifier__$m = undefined;
|
97689
97527
|
/* functional template */
|
97690
|
-
const __vue_is_functional_template__$
|
97528
|
+
const __vue_is_functional_template__$m = false;
|
97691
97529
|
/* style inject */
|
97692
97530
|
|
97693
97531
|
/* style inject SSR */
|
@@ -97696,19 +97534,582 @@ __vue_render__$j._withStripped = true;
|
|
97696
97534
|
|
97697
97535
|
|
97698
97536
|
|
97699
|
-
const __vue_component__$
|
97700
|
-
{ render: __vue_render__$
|
97701
|
-
__vue_inject_styles__$
|
97702
|
-
__vue_script__$
|
97703
|
-
__vue_scope_id__$
|
97704
|
-
__vue_is_functional_template__$
|
97705
|
-
__vue_module_identifier__$
|
97537
|
+
const __vue_component__$m = /*#__PURE__*/__vue_normalize__(
|
97538
|
+
{ render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
|
97539
|
+
__vue_inject_styles__$m,
|
97540
|
+
__vue_script__$l,
|
97541
|
+
__vue_scope_id__$m,
|
97542
|
+
__vue_is_functional_template__$m,
|
97543
|
+
__vue_module_identifier__$m,
|
97706
97544
|
false,
|
97707
97545
|
undefined,
|
97708
97546
|
undefined,
|
97709
97547
|
undefined
|
97710
97548
|
);
|
97711
97549
|
|
97550
|
+
//
|
97551
|
+
//
|
97552
|
+
//
|
97553
|
+
//
|
97554
|
+
//
|
97555
|
+
//
|
97556
|
+
|
97557
|
+
const tagAndTagSpacing = 4; // tagAndTagSpacing
|
97558
|
+
|
97559
|
+
var script$k = {
|
97560
|
+
name: 'ScrollPane',
|
97561
|
+
data() {
|
97562
|
+
return {
|
97563
|
+
left: 0
|
97564
|
+
}
|
97565
|
+
},
|
97566
|
+
computed: {
|
97567
|
+
scrollWrapper() {
|
97568
|
+
return this.$refs.scrollContainer.$refs.wrap
|
97569
|
+
}
|
97570
|
+
},
|
97571
|
+
mounted() {
|
97572
|
+
this.scrollWrapper.addEventListener('scroll', this.emitScroll, true);
|
97573
|
+
},
|
97574
|
+
beforeDestroy() {
|
97575
|
+
this.scrollWrapper.removeEventListener('scroll', this.emitScroll);
|
97576
|
+
},
|
97577
|
+
methods: {
|
97578
|
+
handleScroll(e) {
|
97579
|
+
const eventDelta = e.wheelDelta || -e.deltaY * 40;
|
97580
|
+
const $scrollWrapper = this.scrollWrapper;
|
97581
|
+
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4;
|
97582
|
+
},
|
97583
|
+
emitScroll() {
|
97584
|
+
this.$emit('scroll');
|
97585
|
+
},
|
97586
|
+
moveToTarget(currentTag) {
|
97587
|
+
const $container = this.$refs.scrollContainer.$el;
|
97588
|
+
const $containerWidth = $container.offsetWidth;
|
97589
|
+
const $scrollWrapper = this.scrollWrapper;
|
97590
|
+
const tagList = this.$parent.$refs.tag;
|
97591
|
+
|
97592
|
+
let firstTag = null;
|
97593
|
+
let lastTag = null;
|
97594
|
+
|
97595
|
+
// find first tag and last tag
|
97596
|
+
if (tagList.length > 0) {
|
97597
|
+
firstTag = tagList[0];
|
97598
|
+
lastTag = tagList[tagList.length - 1];
|
97599
|
+
}
|
97600
|
+
|
97601
|
+
if (firstTag === currentTag) {
|
97602
|
+
$scrollWrapper.scrollLeft = 0;
|
97603
|
+
} else if (lastTag === currentTag) {
|
97604
|
+
$scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth;
|
97605
|
+
} else {
|
97606
|
+
// find preTag and nextTag
|
97607
|
+
const currentIndex = tagList.findIndex(item => item === currentTag);
|
97608
|
+
const prevTag = tagList[currentIndex - 1];
|
97609
|
+
const nextTag = tagList[currentIndex + 1];
|
97610
|
+
|
97611
|
+
// the tag's offsetLeft after of nextTag
|
97612
|
+
const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing;
|
97613
|
+
|
97614
|
+
// the tag's offsetLeft before of prevTag
|
97615
|
+
const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing;
|
97616
|
+
|
97617
|
+
if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {
|
97618
|
+
$scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth;
|
97619
|
+
} else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {
|
97620
|
+
$scrollWrapper.scrollLeft = beforePrevTagOffsetLeft;
|
97621
|
+
}
|
97622
|
+
}
|
97623
|
+
}
|
97624
|
+
}
|
97625
|
+
};
|
97626
|
+
|
97627
|
+
/* script */
|
97628
|
+
const __vue_script__$k = script$k;
|
97629
|
+
|
97630
|
+
/* template */
|
97631
|
+
var __vue_render__$l = function () {
|
97632
|
+
var _vm = this;
|
97633
|
+
var _h = _vm.$createElement;
|
97634
|
+
var _c = _vm._self._c || _h;
|
97635
|
+
return _c(
|
97636
|
+
"el-scrollbar",
|
97637
|
+
{
|
97638
|
+
ref: "scrollContainer",
|
97639
|
+
staticClass: "scroll-container",
|
97640
|
+
attrs: { vertical: false },
|
97641
|
+
nativeOn: {
|
97642
|
+
wheel: function ($event) {
|
97643
|
+
$event.preventDefault();
|
97644
|
+
return _vm.handleScroll.apply(null, arguments)
|
97645
|
+
},
|
97646
|
+
},
|
97647
|
+
},
|
97648
|
+
[_vm._t("default")],
|
97649
|
+
2
|
97650
|
+
)
|
97651
|
+
};
|
97652
|
+
var __vue_staticRenderFns__$l = [];
|
97653
|
+
__vue_render__$l._withStripped = true;
|
97654
|
+
|
97655
|
+
/* style */
|
97656
|
+
const __vue_inject_styles__$l = function (inject) {
|
97657
|
+
if (!inject) return
|
97658
|
+
inject("data-v-083b80f3_0", { source: ".scroll-container[data-v-083b80f3] {\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n width: 100%;\n}\n.scroll-container[data-v-083b80f3] .el-scrollbar__bar {\n bottom: 0px;\n}\n.scroll-container[data-v-083b80f3] .el-scrollbar__wrap {\n height: 49px;\n}\n\n/*# sourceMappingURL=ScrollPane.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\TagsView\\ScrollPane.vue","ScrollPane.vue"],"names":[],"mappings":"AA+EA;EACA,mBAAA;EACA,kBAAA;EACA,gBAAA;EACA,WAAA;AC9EA;ADgFA;EACA,WAAA;AC9EA;ADgFA;EACA,YAAA;AC9EA;;AAEA,yCAAyC","file":"ScrollPane.vue","sourcesContent":["<template>\n <el-scrollbar ref=\"scrollContainer\" :vertical=\"false\" class=\"scroll-container\" @wheel.native.prevent=\"handleScroll\">\n <slot />\n </el-scrollbar>\n</template>\n\n<script>\nconst tagAndTagSpacing = 4 // tagAndTagSpacing\n\nexport default {\n name: 'ScrollPane',\n data() {\n return {\n left: 0\n }\n },\n computed: {\n scrollWrapper() {\n return this.$refs.scrollContainer.$refs.wrap\n }\n },\n mounted() {\n this.scrollWrapper.addEventListener('scroll', this.emitScroll, true)\n },\n beforeDestroy() {\n this.scrollWrapper.removeEventListener('scroll', this.emitScroll)\n },\n methods: {\n handleScroll(e) {\n const eventDelta = e.wheelDelta || -e.deltaY * 40\n const $scrollWrapper = this.scrollWrapper\n $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4\n },\n emitScroll() {\n this.$emit('scroll')\n },\n moveToTarget(currentTag) {\n const $container = this.$refs.scrollContainer.$el\n const $containerWidth = $container.offsetWidth\n const $scrollWrapper = this.scrollWrapper\n const tagList = this.$parent.$refs.tag\n\n let firstTag = null\n let lastTag = null\n\n // find first tag and last tag\n if (tagList.length > 0) {\n firstTag = tagList[0]\n lastTag = tagList[tagList.length - 1]\n }\n\n if (firstTag === currentTag) {\n $scrollWrapper.scrollLeft = 0\n } else if (lastTag === currentTag) {\n $scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth\n } else {\n // find preTag and nextTag\n const currentIndex = tagList.findIndex(item => item === currentTag)\n const prevTag = tagList[currentIndex - 1]\n const nextTag = tagList[currentIndex + 1]\n\n // the tag's offsetLeft after of nextTag\n const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing\n\n // the tag's offsetLeft before of prevTag\n const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing\n\n if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {\n $scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth\n } else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {\n $scrollWrapper.scrollLeft = beforePrevTagOffsetLeft\n }\n }\n }\n }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.scroll-container {\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n width: 100%;\n ::v-deep {\n .el-scrollbar__bar {\n bottom: 0px;\n }\n .el-scrollbar__wrap {\n height: 49px;\n }\n }\n}\n</style>\n",".scroll-container {\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n width: 100%;\n}\n.scroll-container ::v-deep .el-scrollbar__bar {\n bottom: 0px;\n}\n.scroll-container ::v-deep .el-scrollbar__wrap {\n height: 49px;\n}\n\n/*# sourceMappingURL=ScrollPane.vue.map */"]}, media: undefined });
|
97659
|
+
|
97660
|
+
};
|
97661
|
+
/* scoped */
|
97662
|
+
const __vue_scope_id__$l = "data-v-083b80f3";
|
97663
|
+
/* module identifier */
|
97664
|
+
const __vue_module_identifier__$l = undefined;
|
97665
|
+
/* functional template */
|
97666
|
+
const __vue_is_functional_template__$l = false;
|
97667
|
+
/* style inject SSR */
|
97668
|
+
|
97669
|
+
/* style inject shadow dom */
|
97670
|
+
|
97671
|
+
|
97672
|
+
|
97673
|
+
const __vue_component__$l = /*#__PURE__*/__vue_normalize__(
|
97674
|
+
{ render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
|
97675
|
+
__vue_inject_styles__$l,
|
97676
|
+
__vue_script__$k,
|
97677
|
+
__vue_scope_id__$l,
|
97678
|
+
__vue_is_functional_template__$l,
|
97679
|
+
__vue_module_identifier__$l,
|
97680
|
+
false,
|
97681
|
+
__vue_create_injector__,
|
97682
|
+
undefined,
|
97683
|
+
undefined
|
97684
|
+
);
|
97685
|
+
|
97686
|
+
//
|
97687
|
+
//
|
97688
|
+
//
|
97689
|
+
//
|
97690
|
+
//
|
97691
|
+
//
|
97692
|
+
//
|
97693
|
+
//
|
97694
|
+
//
|
97695
|
+
//
|
97696
|
+
//
|
97697
|
+
//
|
97698
|
+
//
|
97699
|
+
//
|
97700
|
+
//
|
97701
|
+
//
|
97702
|
+
//
|
97703
|
+
//
|
97704
|
+
//
|
97705
|
+
//
|
97706
|
+
//
|
97707
|
+
//
|
97708
|
+
//
|
97709
|
+
//
|
97710
|
+
//
|
97711
|
+
//
|
97712
|
+
//
|
97713
|
+
//
|
97714
|
+
//
|
97715
|
+
//
|
97716
|
+
|
97717
|
+
|
97718
|
+
var script$j = {
|
97719
|
+
components: { ScrollPane: __vue_component__$l },
|
97720
|
+
data() {
|
97721
|
+
return {
|
97722
|
+
visible: false,
|
97723
|
+
top: 0,
|
97724
|
+
left: 0,
|
97725
|
+
selectedTag: {},
|
97726
|
+
affixTags: []
|
97727
|
+
}
|
97728
|
+
},
|
97729
|
+
computed: {
|
97730
|
+
visitedViews() {
|
97731
|
+
return this.$store.state['z-tagsView'].visitedViews
|
97732
|
+
},
|
97733
|
+
routes() {
|
97734
|
+
return this.$store.state['z-permission'].routes
|
97735
|
+
},
|
97736
|
+
theme() {
|
97737
|
+
return this.$store.state['z-settings'].theme
|
97738
|
+
}
|
97739
|
+
},
|
97740
|
+
watch: {
|
97741
|
+
$route() {
|
97742
|
+
this.addTags();
|
97743
|
+
this.moveToCurrentTag();
|
97744
|
+
},
|
97745
|
+
visible(value) {
|
97746
|
+
if (value) {
|
97747
|
+
document.body.addEventListener('click', this.closeMenu);
|
97748
|
+
} else {
|
97749
|
+
document.body.removeEventListener('click', this.closeMenu);
|
97750
|
+
}
|
97751
|
+
}
|
97752
|
+
},
|
97753
|
+
mounted() {
|
97754
|
+
this.initTags();
|
97755
|
+
this.addTags();
|
97756
|
+
},
|
97757
|
+
methods: {
|
97758
|
+
isActive(route) {
|
97759
|
+
return route.path === this.$route.path
|
97760
|
+
},
|
97761
|
+
activeStyle(tag) {
|
97762
|
+
if (!this.isActive(tag)) return {}
|
97763
|
+
return {
|
97764
|
+
'background-color': this.theme,
|
97765
|
+
'border-color': this.theme
|
97766
|
+
}
|
97767
|
+
},
|
97768
|
+
isAffix(tag) {
|
97769
|
+
return tag.meta && tag.meta.affix
|
97770
|
+
},
|
97771
|
+
isFirstView() {
|
97772
|
+
try {
|
97773
|
+
return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath
|
97774
|
+
} catch (err) {
|
97775
|
+
return false
|
97776
|
+
}
|
97777
|
+
},
|
97778
|
+
isLastView() {
|
97779
|
+
try {
|
97780
|
+
return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
97781
|
+
} catch (err) {
|
97782
|
+
return false
|
97783
|
+
}
|
97784
|
+
},
|
97785
|
+
filterAffixTags(routes, basePath = '/') {
|
97786
|
+
let tags = [];
|
97787
|
+
routes.forEach((route) => {
|
97788
|
+
if (route.meta && route.meta.affix) {
|
97789
|
+
const tagPath = path.resolve(basePath, route.path);
|
97790
|
+
tags.push({
|
97791
|
+
fullPath: tagPath,
|
97792
|
+
path: tagPath,
|
97793
|
+
name: route.name,
|
97794
|
+
meta: { ...route.meta }
|
97795
|
+
});
|
97796
|
+
}
|
97797
|
+
if (route.children) {
|
97798
|
+
const tempTags = this.filterAffixTags(route.children, route.path);
|
97799
|
+
if (tempTags.length >= 1) {
|
97800
|
+
tags = [...tags, ...tempTags];
|
97801
|
+
}
|
97802
|
+
}
|
97803
|
+
});
|
97804
|
+
return tags
|
97805
|
+
},
|
97806
|
+
initTags() {
|
97807
|
+
const affixTags = (this.affixTags = this.filterAffixTags(this.routes));
|
97808
|
+
for (const tag of affixTags) {
|
97809
|
+
// Must have tag name
|
97810
|
+
if (tag.name) {
|
97811
|
+
this.$store.dispatch('z-tagsView/addVisitedView', tag);
|
97812
|
+
}
|
97813
|
+
}
|
97814
|
+
},
|
97815
|
+
addTags() {
|
97816
|
+
const { name } = this.$route;
|
97817
|
+
if (name) {
|
97818
|
+
this.$store.dispatch('z-tagsView/addView', this.$route);
|
97819
|
+
if (this.$route.meta.link) {
|
97820
|
+
this.$store.dispatch('z-tagsView/addIframeView', this.$route);
|
97821
|
+
}
|
97822
|
+
}
|
97823
|
+
return false
|
97824
|
+
},
|
97825
|
+
moveToCurrentTag() {
|
97826
|
+
const tags = this.$refs.tag;
|
97827
|
+
this.$nextTick(() => {
|
97828
|
+
for (const tag of tags) {
|
97829
|
+
if (tag.to.path === this.$route.path) {
|
97830
|
+
this.$refs.scrollPane.moveToTarget(tag);
|
97831
|
+
// when query is different then update
|
97832
|
+
if (tag.to.fullPath !== this.$route.fullPath) {
|
97833
|
+
this.$store.dispatch('z-tagsView/updateVisitedView', this.$route);
|
97834
|
+
}
|
97835
|
+
break
|
97836
|
+
}
|
97837
|
+
}
|
97838
|
+
});
|
97839
|
+
},
|
97840
|
+
refreshSelectedTag(view) {
|
97841
|
+
this.$tab.refreshPage(view);
|
97842
|
+
if (this.$route.meta.link) {
|
97843
|
+
this.$store.dispatch('z-tagsView/delIframeView', this.$route);
|
97844
|
+
}
|
97845
|
+
},
|
97846
|
+
closeSelectedTag(view) {
|
97847
|
+
this.$tab.closePage(view).then(({ visitedViews }) => {
|
97848
|
+
if (this.isActive(view)) {
|
97849
|
+
this.toLastView(visitedViews, view);
|
97850
|
+
}
|
97851
|
+
});
|
97852
|
+
},
|
97853
|
+
closeRightTags() {
|
97854
|
+
this.$tab.closeRightPage(this.selectedTag).then((visitedViews) => {
|
97855
|
+
if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {
|
97856
|
+
this.toLastView(visitedViews);
|
97857
|
+
}
|
97858
|
+
});
|
97859
|
+
},
|
97860
|
+
closeLeftTags() {
|
97861
|
+
this.$tab.closeLeftPage(this.selectedTag).then((visitedViews) => {
|
97862
|
+
if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {
|
97863
|
+
this.toLastView(visitedViews);
|
97864
|
+
}
|
97865
|
+
});
|
97866
|
+
},
|
97867
|
+
closeOthersTags() {
|
97868
|
+
this.$router.push(this.selectedTag.fullPath).catch(() => {});
|
97869
|
+
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
97870
|
+
this.moveToCurrentTag();
|
97871
|
+
});
|
97872
|
+
},
|
97873
|
+
closeAllTags(view) {
|
97874
|
+
this.$tab.closeAllPage().then(({ visitedViews }) => {
|
97875
|
+
if (this.affixTags.some((tag) => tag.path === this.$route.path)) {
|
97876
|
+
return
|
97877
|
+
}
|
97878
|
+
this.toLastView(visitedViews, view);
|
97879
|
+
});
|
97880
|
+
},
|
97881
|
+
toLastView(visitedViews, view) {
|
97882
|
+
const latestView = visitedViews.slice(-1)[0];
|
97883
|
+
if (latestView) {
|
97884
|
+
this.$router.push(latestView.fullPath);
|
97885
|
+
} else {
|
97886
|
+
// now the default is to redirect to the home page if there is no tags-view,
|
97887
|
+
// you can adjust it according to your needs.
|
97888
|
+
if (view.name === 'Dashboard') {
|
97889
|
+
// to reload home page
|
97890
|
+
this.$router.replace({ path: '/redirect' + view.fullPath });
|
97891
|
+
} else {
|
97892
|
+
this.$router.push('/');
|
97893
|
+
}
|
97894
|
+
}
|
97895
|
+
},
|
97896
|
+
openMenu(tag, e) {
|
97897
|
+
const menuMinWidth = 105;
|
97898
|
+
const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left
|
97899
|
+
const offsetWidth = this.$el.offsetWidth; // container width
|
97900
|
+
const maxLeft = offsetWidth - menuMinWidth; // left boundary
|
97901
|
+
const left = e.clientX - offsetLeft + 15; // 15: margin right
|
97902
|
+
|
97903
|
+
if (left > maxLeft) {
|
97904
|
+
this.left = maxLeft;
|
97905
|
+
} else {
|
97906
|
+
this.left = left;
|
97907
|
+
}
|
97908
|
+
|
97909
|
+
this.top = e.clientY;
|
97910
|
+
this.visible = true;
|
97911
|
+
this.selectedTag = tag;
|
97912
|
+
},
|
97913
|
+
closeMenu() {
|
97914
|
+
this.visible = false;
|
97915
|
+
},
|
97916
|
+
handleScroll() {
|
97917
|
+
this.closeMenu();
|
97918
|
+
}
|
97919
|
+
}
|
97920
|
+
};
|
97921
|
+
|
97922
|
+
/* script */
|
97923
|
+
const __vue_script__$j = script$j;
|
97924
|
+
|
97925
|
+
/* template */
|
97926
|
+
var __vue_render__$k = function () {
|
97927
|
+
var _vm = this;
|
97928
|
+
var _h = _vm.$createElement;
|
97929
|
+
var _c = _vm._self._c || _h;
|
97930
|
+
return _c(
|
97931
|
+
"div",
|
97932
|
+
{
|
97933
|
+
staticClass: "tags-view-container",
|
97934
|
+
attrs: { id: "tags-view-container" },
|
97935
|
+
},
|
97936
|
+
[
|
97937
|
+
_c(
|
97938
|
+
"scroll-pane",
|
97939
|
+
{
|
97940
|
+
ref: "scrollPane",
|
97941
|
+
staticClass: "tags-view-wrapper",
|
97942
|
+
on: { scroll: _vm.handleScroll },
|
97943
|
+
},
|
97944
|
+
_vm._l(_vm.visitedViews, function (tag) {
|
97945
|
+
return _c(
|
97946
|
+
"router-link",
|
97947
|
+
{
|
97948
|
+
key: tag.path,
|
97949
|
+
ref: "tag",
|
97950
|
+
refInFor: true,
|
97951
|
+
staticClass: "tags-view-item",
|
97952
|
+
class: _vm.isActive(tag) ? "active" : "",
|
97953
|
+
style: _vm.activeStyle(tag),
|
97954
|
+
attrs: {
|
97955
|
+
to: {
|
97956
|
+
path: tag.path,
|
97957
|
+
query: tag.query,
|
97958
|
+
fullPath: tag.fullPath,
|
97959
|
+
},
|
97960
|
+
tag: "span",
|
97961
|
+
},
|
97962
|
+
nativeOn: {
|
97963
|
+
mouseup: function ($event) {
|
97964
|
+
if ("button" in $event && $event.button !== 1) {
|
97965
|
+
return null
|
97966
|
+
}
|
97967
|
+
!_vm.isAffix(tag) ? _vm.closeSelectedTag(tag) : "";
|
97968
|
+
},
|
97969
|
+
contextmenu: function ($event) {
|
97970
|
+
$event.preventDefault();
|
97971
|
+
return _vm.openMenu(tag, $event)
|
97972
|
+
},
|
97973
|
+
},
|
97974
|
+
},
|
97975
|
+
[
|
97976
|
+
_vm._v("\n " + _vm._s(tag.title) + "\n "),
|
97977
|
+
!_vm.isAffix(tag)
|
97978
|
+
? _c("span", {
|
97979
|
+
staticClass: "el-icon-close",
|
97980
|
+
on: {
|
97981
|
+
click: function ($event) {
|
97982
|
+
$event.preventDefault();
|
97983
|
+
$event.stopPropagation();
|
97984
|
+
return _vm.closeSelectedTag(tag)
|
97985
|
+
},
|
97986
|
+
},
|
97987
|
+
})
|
97988
|
+
: _vm._e(),
|
97989
|
+
]
|
97990
|
+
)
|
97991
|
+
}),
|
97992
|
+
1
|
97993
|
+
),
|
97994
|
+
_vm._v(" "),
|
97995
|
+
_c(
|
97996
|
+
"ul",
|
97997
|
+
{
|
97998
|
+
directives: [
|
97999
|
+
{
|
98000
|
+
name: "show",
|
98001
|
+
rawName: "v-show",
|
98002
|
+
value: _vm.visible,
|
98003
|
+
expression: "visible",
|
98004
|
+
},
|
98005
|
+
],
|
98006
|
+
staticClass: "contextmenu",
|
98007
|
+
style: { left: _vm.left + "px", top: _vm.top + "px" },
|
98008
|
+
},
|
98009
|
+
[
|
98010
|
+
_c(
|
98011
|
+
"li",
|
98012
|
+
{
|
98013
|
+
on: {
|
98014
|
+
click: function ($event) {
|
98015
|
+
return _vm.refreshSelectedTag(_vm.selectedTag)
|
98016
|
+
},
|
98017
|
+
},
|
98018
|
+
},
|
98019
|
+
[
|
98020
|
+
_c("i", { staticClass: "el-icon-refresh-right" }),
|
98021
|
+
_vm._v(" 刷新页面"),
|
98022
|
+
]
|
98023
|
+
),
|
98024
|
+
_vm._v(" "),
|
98025
|
+
!_vm.isAffix(_vm.selectedTag)
|
98026
|
+
? _c(
|
98027
|
+
"li",
|
98028
|
+
{
|
98029
|
+
on: {
|
98030
|
+
click: function ($event) {
|
98031
|
+
return _vm.closeSelectedTag(_vm.selectedTag)
|
98032
|
+
},
|
98033
|
+
},
|
98034
|
+
},
|
98035
|
+
[_c("i", { staticClass: "el-icon-close" }), _vm._v(" 关闭当前")]
|
98036
|
+
)
|
98037
|
+
: _vm._e(),
|
98038
|
+
_vm._v(" "),
|
98039
|
+
_c("li", { on: { click: _vm.closeOthersTags } }, [
|
98040
|
+
_c("i", { staticClass: "el-icon-circle-close" }),
|
98041
|
+
_vm._v(" 关闭其他"),
|
98042
|
+
]),
|
98043
|
+
_vm._v(" "),
|
98044
|
+
!_vm.isFirstView()
|
98045
|
+
? _c("li", { on: { click: _vm.closeLeftTags } }, [
|
98046
|
+
_c("i", { staticClass: "el-icon-back" }),
|
98047
|
+
_vm._v(" 关闭左侧"),
|
98048
|
+
])
|
98049
|
+
: _vm._e(),
|
98050
|
+
_vm._v(" "),
|
98051
|
+
!_vm.isLastView()
|
98052
|
+
? _c("li", { on: { click: _vm.closeRightTags } }, [
|
98053
|
+
_c("i", { staticClass: "el-icon-right" }),
|
98054
|
+
_vm._v(" 关闭右侧"),
|
98055
|
+
])
|
98056
|
+
: _vm._e(),
|
98057
|
+
_vm._v(" "),
|
98058
|
+
_c(
|
98059
|
+
"li",
|
98060
|
+
{
|
98061
|
+
on: {
|
98062
|
+
click: function ($event) {
|
98063
|
+
return _vm.closeAllTags(_vm.selectedTag)
|
98064
|
+
},
|
98065
|
+
},
|
98066
|
+
},
|
98067
|
+
[
|
98068
|
+
_c("i", { staticClass: "el-icon-circle-close" }),
|
98069
|
+
_vm._v(" 全部关闭"),
|
98070
|
+
]
|
98071
|
+
),
|
98072
|
+
]
|
98073
|
+
),
|
98074
|
+
],
|
98075
|
+
1
|
98076
|
+
)
|
98077
|
+
};
|
98078
|
+
var __vue_staticRenderFns__$k = [];
|
98079
|
+
__vue_render__$k._withStripped = true;
|
98080
|
+
|
98081
|
+
/* style */
|
98082
|
+
const __vue_inject_styles__$k = function (inject) {
|
98083
|
+
if (!inject) return
|
98084
|
+
inject("data-v-1621f612_0", { source: ".tags-view-container[data-v-1621f612] {\n height: 34px;\n width: 100%;\n background: #fff;\n border-bottom: 1px solid #d8dce5;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);\n}\n.tags-view-container .tags-view-wrapper .tags-view-item[data-v-1621f612] {\n display: inline-block;\n position: relative;\n cursor: pointer;\n height: 26px;\n line-height: 26px;\n border: 1px solid #d8dce5;\n color: #495060;\n background: #fff;\n padding: 0 8px;\n font-size: 12px;\n margin-left: 5px;\n margin-top: 4px;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item[data-v-1621f612]:first-of-type {\n margin-left: 15px;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item[data-v-1621f612]:last-of-type {\n margin-right: 15px;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item.active[data-v-1621f612] {\n background-color: #42b983;\n color: #fff;\n border-color: #42b983;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item.active[data-v-1621f612]::before {\n content: \"\";\n background: #fff;\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n position: relative;\n margin-right: 2px;\n}\n.tags-view-container .contextmenu[data-v-1621f612] {\n margin: 0;\n background: #fff;\n z-index: 3000;\n position: absolute;\n list-style-type: none;\n padding: 5px 0;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 400;\n color: #333;\n box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);\n}\n.tags-view-container .contextmenu li[data-v-1621f612] {\n margin: 0;\n padding: 7px 16px;\n cursor: pointer;\n}\n.tags-view-container .contextmenu li[data-v-1621f612]:hover {\n background: #eee;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\TagsView\\index.vue","index.vue"],"names":[],"mappings":"AAgPA;EACA,YAAA;EACA,WAAA;EACA,gBAAA;EACA,gCAAA;EACA,0EAAA;AC/OA;ADiPA;EACA,qBAAA;EACA,kBAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;EACA,yBAAA;EACA,cAAA;EACA,gBAAA;EACA,cAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;AC/OA;ADgPA;EACA,iBAAA;AC9OA;ADgPA;EACA,kBAAA;AC9OA;ADgPA;EACA,yBAAA;EACA,WAAA;EACA,qBAAA;AC9OA;AD+OA;EACA,WAAA;EACA,gBAAA;EACA,qBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,iBAAA;AC7OA;ADkPA;EACA,SAAA;EACA,gBAAA;EACA,aAAA;EACA,kBAAA;EACA,qBAAA;EACA,cAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,WAAA;EACA,4CAAA;AChPA;ADiPA;EACA,SAAA;EACA,iBAAA;EACA,eAAA;AC/OA;ADgPA;EACA,gBAAA;AC9OA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div id=\"tags-view-container\" class=\"tags-view-container\">\r\n <scroll-pane ref=\"scrollPane\" class=\"tags-view-wrapper\" @scroll=\"handleScroll\">\r\n <router-link\r\n v-for=\"tag in visitedViews\"\r\n ref=\"tag\"\r\n :key=\"tag.path\"\r\n :class=\"isActive(tag) ? 'active' : ''\"\r\n :to=\"{ path: tag.path, query: tag.query, fullPath: tag.fullPath }\"\r\n tag=\"span\"\r\n class=\"tags-view-item\"\r\n :style=\"activeStyle(tag)\"\r\n @click.middle.native=\"!isAffix(tag) ? closeSelectedTag(tag) : ''\"\r\n @contextmenu.prevent.native=\"openMenu(tag, $event)\"\r\n >\r\n {{ tag.title }}\r\n <span v-if=\"!isAffix(tag)\" class=\"el-icon-close\" @click.prevent.stop=\"closeSelectedTag(tag)\" />\r\n </router-link>\r\n </scroll-pane>\r\n <ul v-show=\"visible\" :style=\"{ left: left + 'px', top: top + 'px' }\" class=\"contextmenu\">\r\n <li @click=\"refreshSelectedTag(selectedTag)\"><i class=\"el-icon-refresh-right\"></i> 刷新页面</li>\r\n <li v-if=\"!isAffix(selectedTag)\" @click=\"closeSelectedTag(selectedTag)\"><i class=\"el-icon-close\"></i> 关闭当前</li>\r\n <li @click=\"closeOthersTags\"><i class=\"el-icon-circle-close\"></i> 关闭其他</li>\r\n <li v-if=\"!isFirstView()\" @click=\"closeLeftTags\"><i class=\"el-icon-back\"></i> 关闭左侧</li>\r\n <li v-if=\"!isLastView()\" @click=\"closeRightTags\"><i class=\"el-icon-right\"></i> 关闭右侧</li>\r\n <li @click=\"closeAllTags(selectedTag)\"><i class=\"el-icon-circle-close\"></i> 全部关闭</li>\r\n </ul>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport ScrollPane from './ScrollPane.vue'\r\nimport { path } from '../../../../utils/utils.js'\r\n\r\nexport default {\r\n components: { ScrollPane },\r\n data() {\r\n return {\r\n visible: false,\r\n top: 0,\r\n left: 0,\r\n selectedTag: {},\r\n affixTags: []\r\n }\r\n },\r\n computed: {\r\n visitedViews() {\r\n return this.$store.state['z-tagsView'].visitedViews\r\n },\r\n routes() {\r\n return this.$store.state['z-permission'].routes\r\n },\r\n theme() {\r\n return this.$store.state['z-settings'].theme\r\n }\r\n },\r\n watch: {\r\n $route() {\r\n this.addTags()\r\n this.moveToCurrentTag()\r\n },\r\n visible(value) {\r\n if (value) {\r\n document.body.addEventListener('click', this.closeMenu)\r\n } else {\r\n document.body.removeEventListener('click', this.closeMenu)\r\n }\r\n }\r\n },\r\n mounted() {\r\n this.initTags()\r\n this.addTags()\r\n },\r\n methods: {\r\n isActive(route) {\r\n return route.path === this.$route.path\r\n },\r\n activeStyle(tag) {\r\n if (!this.isActive(tag)) return {}\r\n return {\r\n 'background-color': this.theme,\r\n 'border-color': this.theme\r\n }\r\n },\r\n isAffix(tag) {\r\n return tag.meta && tag.meta.affix\r\n },\r\n isFirstView() {\r\n try {\r\n return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath\r\n } catch (err) {\r\n return false\r\n }\r\n },\r\n isLastView() {\r\n try {\r\n return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath\r\n } catch (err) {\r\n return false\r\n }\r\n },\r\n filterAffixTags(routes, basePath = '/') {\r\n let tags = []\r\n routes.forEach((route) => {\r\n if (route.meta && route.meta.affix) {\r\n const tagPath = path.resolve(basePath, route.path)\r\n tags.push({\r\n fullPath: tagPath,\r\n path: tagPath,\r\n name: route.name,\r\n meta: { ...route.meta }\r\n })\r\n }\r\n if (route.children) {\r\n const tempTags = this.filterAffixTags(route.children, route.path)\r\n if (tempTags.length >= 1) {\r\n tags = [...tags, ...tempTags]\r\n }\r\n }\r\n })\r\n return tags\r\n },\r\n initTags() {\r\n const affixTags = (this.affixTags = this.filterAffixTags(this.routes))\r\n for (const tag of affixTags) {\r\n // Must have tag name\r\n if (tag.name) {\r\n this.$store.dispatch('z-tagsView/addVisitedView', tag)\r\n }\r\n }\r\n },\r\n addTags() {\r\n const { name } = this.$route\r\n if (name) {\r\n this.$store.dispatch('z-tagsView/addView', this.$route)\r\n if (this.$route.meta.link) {\r\n this.$store.dispatch('z-tagsView/addIframeView', this.$route)\r\n }\r\n }\r\n return false\r\n },\r\n moveToCurrentTag() {\r\n const tags = this.$refs.tag\r\n this.$nextTick(() => {\r\n for (const tag of tags) {\r\n if (tag.to.path === this.$route.path) {\r\n this.$refs.scrollPane.moveToTarget(tag)\r\n // when query is different then update\r\n if (tag.to.fullPath !== this.$route.fullPath) {\r\n this.$store.dispatch('z-tagsView/updateVisitedView', this.$route)\r\n }\r\n break\r\n }\r\n }\r\n })\r\n },\r\n refreshSelectedTag(view) {\r\n this.$tab.refreshPage(view)\r\n if (this.$route.meta.link) {\r\n this.$store.dispatch('z-tagsView/delIframeView', this.$route)\r\n }\r\n },\r\n closeSelectedTag(view) {\r\n this.$tab.closePage(view).then(({ visitedViews }) => {\r\n if (this.isActive(view)) {\r\n this.toLastView(visitedViews, view)\r\n }\r\n })\r\n },\r\n closeRightTags() {\r\n this.$tab.closeRightPage(this.selectedTag).then((visitedViews) => {\r\n if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {\r\n this.toLastView(visitedViews)\r\n }\r\n })\r\n },\r\n closeLeftTags() {\r\n this.$tab.closeLeftPage(this.selectedTag).then((visitedViews) => {\r\n if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {\r\n this.toLastView(visitedViews)\r\n }\r\n })\r\n },\r\n closeOthersTags() {\r\n this.$router.push(this.selectedTag.fullPath).catch(() => {})\r\n this.$tab.closeOtherPage(this.selectedTag).then(() => {\r\n this.moveToCurrentTag()\r\n })\r\n },\r\n closeAllTags(view) {\r\n this.$tab.closeAllPage().then(({ visitedViews }) => {\r\n if (this.affixTags.some((tag) => tag.path === this.$route.path)) {\r\n return\r\n }\r\n this.toLastView(visitedViews, view)\r\n })\r\n },\r\n toLastView(visitedViews, view) {\r\n const latestView = visitedViews.slice(-1)[0]\r\n if (latestView) {\r\n this.$router.push(latestView.fullPath)\r\n } else {\r\n // now the default is to redirect to the home page if there is no tags-view,\r\n // you can adjust it according to your needs.\r\n if (view.name === 'Dashboard') {\r\n // to reload home page\r\n this.$router.replace({ path: '/redirect' + view.fullPath })\r\n } else {\r\n this.$router.push('/')\r\n }\r\n }\r\n },\r\n openMenu(tag, e) {\r\n const menuMinWidth = 105\r\n const offsetLeft = this.$el.getBoundingClientRect().left // container margin left\r\n const offsetWidth = this.$el.offsetWidth // container width\r\n const maxLeft = offsetWidth - menuMinWidth // left boundary\r\n const left = e.clientX - offsetLeft + 15 // 15: margin right\r\n\r\n if (left > maxLeft) {\r\n this.left = maxLeft\r\n } else {\r\n this.left = left\r\n }\r\n\r\n this.top = e.clientY\r\n this.visible = true\r\n this.selectedTag = tag\r\n },\r\n closeMenu() {\r\n this.visible = false\r\n },\r\n handleScroll() {\r\n this.closeMenu()\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.tags-view-container {\r\n height: 34px;\r\n width: 100%;\r\n background: #fff;\r\n border-bottom: 1px solid #d8dce5;\r\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);\r\n .tags-view-wrapper {\r\n .tags-view-item {\r\n display: inline-block;\r\n position: relative;\r\n cursor: pointer;\r\n height: 26px;\r\n line-height: 26px;\r\n border: 1px solid #d8dce5;\r\n color: #495060;\r\n background: #fff;\r\n padding: 0 8px;\r\n font-size: 12px;\r\n margin-left: 5px;\r\n margin-top: 4px;\r\n &:first-of-type {\r\n margin-left: 15px;\r\n }\r\n &:last-of-type {\r\n margin-right: 15px;\r\n }\r\n &.active {\r\n background-color: #42b983;\r\n color: #fff;\r\n border-color: #42b983;\r\n &::before {\r\n content: '';\r\n background: #fff;\r\n display: inline-block;\r\n width: 8px;\r\n height: 8px;\r\n border-radius: 50%;\r\n position: relative;\r\n margin-right: 2px;\r\n }\r\n }\r\n }\r\n }\r\n .contextmenu {\r\n margin: 0;\r\n background: #fff;\r\n z-index: 3000;\r\n position: absolute;\r\n list-style-type: none;\r\n padding: 5px 0;\r\n border-radius: 4px;\r\n font-size: 12px;\r\n font-weight: 400;\r\n color: #333;\r\n box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);\r\n li {\r\n margin: 0;\r\n padding: 7px 16px;\r\n cursor: pointer;\r\n &:hover {\r\n background: #eee;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n\r\n<style lang=\"scss\">\r\n//reset element css of el-icon-close\r\n.tags-view-wrapper {\r\n .tags-view-item {\r\n .el-icon-close {\r\n width: 16px;\r\n height: 16px;\r\n vertical-align: 2px;\r\n border-radius: 50%;\r\n text-align: center;\r\n transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n transform-origin: 100% 50%;\r\n &:before {\r\n transform: scale(0.6);\r\n display: inline-block;\r\n vertical-align: -3px;\r\n }\r\n &:hover {\r\n background-color: #b4bccc;\r\n color: #fff;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n",".tags-view-container {\n height: 34px;\n width: 100%;\n background: #fff;\n border-bottom: 1px solid #d8dce5;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);\n}\n.tags-view-container .tags-view-wrapper .tags-view-item {\n display: inline-block;\n position: relative;\n cursor: pointer;\n height: 26px;\n line-height: 26px;\n border: 1px solid #d8dce5;\n color: #495060;\n background: #fff;\n padding: 0 8px;\n font-size: 12px;\n margin-left: 5px;\n margin-top: 4px;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item:first-of-type {\n margin-left: 15px;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item:last-of-type {\n margin-right: 15px;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item.active {\n background-color: #42b983;\n color: #fff;\n border-color: #42b983;\n}\n.tags-view-container .tags-view-wrapper .tags-view-item.active::before {\n content: \"\";\n background: #fff;\n display: inline-block;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n position: relative;\n margin-right: 2px;\n}\n.tags-view-container .contextmenu {\n margin: 0;\n background: #fff;\n z-index: 3000;\n position: absolute;\n list-style-type: none;\n padding: 5px 0;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 400;\n color: #333;\n box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);\n}\n.tags-view-container .contextmenu li {\n margin: 0;\n padding: 7px 16px;\n cursor: pointer;\n}\n.tags-view-container .contextmenu li:hover {\n background: #eee;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined })
|
98085
|
+
,inject("data-v-1621f612_1", { source: ".tags-view-wrapper .tags-view-item .el-icon-close {\n width: 16px;\n height: 16px;\n vertical-align: 2px;\n border-radius: 50%;\n text-align: center;\n transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform-origin: 100% 50%;\n}\n.tags-view-wrapper .tags-view-item .el-icon-close:before {\n transform: scale(0.6);\n display: inline-block;\n vertical-align: -3px;\n}\n.tags-view-wrapper .tags-view-item .el-icon-close:hover {\n background-color: #b4bccc;\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */", map: {"version":3,"sources":["D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\components\\TagsView\\index.vue","index.vue"],"names":[],"mappings":"AAuTA;EACA,WAAA;EACA,YAAA;EACA,mBAAA;EACA,kBAAA;EACA,kBAAA;EACA,yDAAA;EACA,0BAAA;ACtTA;ADuTA;EACA,qBAAA;EACA,qBAAA;EACA,oBAAA;ACrTA;ADuTA;EACA,yBAAA;EACA,WAAA;ACrTA;;AAEA,oCAAoC","file":"index.vue","sourcesContent":["<template>\r\n <div id=\"tags-view-container\" class=\"tags-view-container\">\r\n <scroll-pane ref=\"scrollPane\" class=\"tags-view-wrapper\" @scroll=\"handleScroll\">\r\n <router-link\r\n v-for=\"tag in visitedViews\"\r\n ref=\"tag\"\r\n :key=\"tag.path\"\r\n :class=\"isActive(tag) ? 'active' : ''\"\r\n :to=\"{ path: tag.path, query: tag.query, fullPath: tag.fullPath }\"\r\n tag=\"span\"\r\n class=\"tags-view-item\"\r\n :style=\"activeStyle(tag)\"\r\n @click.middle.native=\"!isAffix(tag) ? closeSelectedTag(tag) : ''\"\r\n @contextmenu.prevent.native=\"openMenu(tag, $event)\"\r\n >\r\n {{ tag.title }}\r\n <span v-if=\"!isAffix(tag)\" class=\"el-icon-close\" @click.prevent.stop=\"closeSelectedTag(tag)\" />\r\n </router-link>\r\n </scroll-pane>\r\n <ul v-show=\"visible\" :style=\"{ left: left + 'px', top: top + 'px' }\" class=\"contextmenu\">\r\n <li @click=\"refreshSelectedTag(selectedTag)\"><i class=\"el-icon-refresh-right\"></i> 刷新页面</li>\r\n <li v-if=\"!isAffix(selectedTag)\" @click=\"closeSelectedTag(selectedTag)\"><i class=\"el-icon-close\"></i> 关闭当前</li>\r\n <li @click=\"closeOthersTags\"><i class=\"el-icon-circle-close\"></i> 关闭其他</li>\r\n <li v-if=\"!isFirstView()\" @click=\"closeLeftTags\"><i class=\"el-icon-back\"></i> 关闭左侧</li>\r\n <li v-if=\"!isLastView()\" @click=\"closeRightTags\"><i class=\"el-icon-right\"></i> 关闭右侧</li>\r\n <li @click=\"closeAllTags(selectedTag)\"><i class=\"el-icon-circle-close\"></i> 全部关闭</li>\r\n </ul>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport ScrollPane from './ScrollPane.vue'\r\nimport { path } from '../../../../utils/utils.js'\r\n\r\nexport default {\r\n components: { ScrollPane },\r\n data() {\r\n return {\r\n visible: false,\r\n top: 0,\r\n left: 0,\r\n selectedTag: {},\r\n affixTags: []\r\n }\r\n },\r\n computed: {\r\n visitedViews() {\r\n return this.$store.state['z-tagsView'].visitedViews\r\n },\r\n routes() {\r\n return this.$store.state['z-permission'].routes\r\n },\r\n theme() {\r\n return this.$store.state['z-settings'].theme\r\n }\r\n },\r\n watch: {\r\n $route() {\r\n this.addTags()\r\n this.moveToCurrentTag()\r\n },\r\n visible(value) {\r\n if (value) {\r\n document.body.addEventListener('click', this.closeMenu)\r\n } else {\r\n document.body.removeEventListener('click', this.closeMenu)\r\n }\r\n }\r\n },\r\n mounted() {\r\n this.initTags()\r\n this.addTags()\r\n },\r\n methods: {\r\n isActive(route) {\r\n return route.path === this.$route.path\r\n },\r\n activeStyle(tag) {\r\n if (!this.isActive(tag)) return {}\r\n return {\r\n 'background-color': this.theme,\r\n 'border-color': this.theme\r\n }\r\n },\r\n isAffix(tag) {\r\n return tag.meta && tag.meta.affix\r\n },\r\n isFirstView() {\r\n try {\r\n return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath\r\n } catch (err) {\r\n return false\r\n }\r\n },\r\n isLastView() {\r\n try {\r\n return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath\r\n } catch (err) {\r\n return false\r\n }\r\n },\r\n filterAffixTags(routes, basePath = '/') {\r\n let tags = []\r\n routes.forEach((route) => {\r\n if (route.meta && route.meta.affix) {\r\n const tagPath = path.resolve(basePath, route.path)\r\n tags.push({\r\n fullPath: tagPath,\r\n path: tagPath,\r\n name: route.name,\r\n meta: { ...route.meta }\r\n })\r\n }\r\n if (route.children) {\r\n const tempTags = this.filterAffixTags(route.children, route.path)\r\n if (tempTags.length >= 1) {\r\n tags = [...tags, ...tempTags]\r\n }\r\n }\r\n })\r\n return tags\r\n },\r\n initTags() {\r\n const affixTags = (this.affixTags = this.filterAffixTags(this.routes))\r\n for (const tag of affixTags) {\r\n // Must have tag name\r\n if (tag.name) {\r\n this.$store.dispatch('z-tagsView/addVisitedView', tag)\r\n }\r\n }\r\n },\r\n addTags() {\r\n const { name } = this.$route\r\n if (name) {\r\n this.$store.dispatch('z-tagsView/addView', this.$route)\r\n if (this.$route.meta.link) {\r\n this.$store.dispatch('z-tagsView/addIframeView', this.$route)\r\n }\r\n }\r\n return false\r\n },\r\n moveToCurrentTag() {\r\n const tags = this.$refs.tag\r\n this.$nextTick(() => {\r\n for (const tag of tags) {\r\n if (tag.to.path === this.$route.path) {\r\n this.$refs.scrollPane.moveToTarget(tag)\r\n // when query is different then update\r\n if (tag.to.fullPath !== this.$route.fullPath) {\r\n this.$store.dispatch('z-tagsView/updateVisitedView', this.$route)\r\n }\r\n break\r\n }\r\n }\r\n })\r\n },\r\n refreshSelectedTag(view) {\r\n this.$tab.refreshPage(view)\r\n if (this.$route.meta.link) {\r\n this.$store.dispatch('z-tagsView/delIframeView', this.$route)\r\n }\r\n },\r\n closeSelectedTag(view) {\r\n this.$tab.closePage(view).then(({ visitedViews }) => {\r\n if (this.isActive(view)) {\r\n this.toLastView(visitedViews, view)\r\n }\r\n })\r\n },\r\n closeRightTags() {\r\n this.$tab.closeRightPage(this.selectedTag).then((visitedViews) => {\r\n if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {\r\n this.toLastView(visitedViews)\r\n }\r\n })\r\n },\r\n closeLeftTags() {\r\n this.$tab.closeLeftPage(this.selectedTag).then((visitedViews) => {\r\n if (!visitedViews.find((i) => i.fullPath === this.$route.fullPath)) {\r\n this.toLastView(visitedViews)\r\n }\r\n })\r\n },\r\n closeOthersTags() {\r\n this.$router.push(this.selectedTag.fullPath).catch(() => {})\r\n this.$tab.closeOtherPage(this.selectedTag).then(() => {\r\n this.moveToCurrentTag()\r\n })\r\n },\r\n closeAllTags(view) {\r\n this.$tab.closeAllPage().then(({ visitedViews }) => {\r\n if (this.affixTags.some((tag) => tag.path === this.$route.path)) {\r\n return\r\n }\r\n this.toLastView(visitedViews, view)\r\n })\r\n },\r\n toLastView(visitedViews, view) {\r\n const latestView = visitedViews.slice(-1)[0]\r\n if (latestView) {\r\n this.$router.push(latestView.fullPath)\r\n } else {\r\n // now the default is to redirect to the home page if there is no tags-view,\r\n // you can adjust it according to your needs.\r\n if (view.name === 'Dashboard') {\r\n // to reload home page\r\n this.$router.replace({ path: '/redirect' + view.fullPath })\r\n } else {\r\n this.$router.push('/')\r\n }\r\n }\r\n },\r\n openMenu(tag, e) {\r\n const menuMinWidth = 105\r\n const offsetLeft = this.$el.getBoundingClientRect().left // container margin left\r\n const offsetWidth = this.$el.offsetWidth // container width\r\n const maxLeft = offsetWidth - menuMinWidth // left boundary\r\n const left = e.clientX - offsetLeft + 15 // 15: margin right\r\n\r\n if (left > maxLeft) {\r\n this.left = maxLeft\r\n } else {\r\n this.left = left\r\n }\r\n\r\n this.top = e.clientY\r\n this.visible = true\r\n this.selectedTag = tag\r\n },\r\n closeMenu() {\r\n this.visible = false\r\n },\r\n handleScroll() {\r\n this.closeMenu()\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.tags-view-container {\r\n height: 34px;\r\n width: 100%;\r\n background: #fff;\r\n border-bottom: 1px solid #d8dce5;\r\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);\r\n .tags-view-wrapper {\r\n .tags-view-item {\r\n display: inline-block;\r\n position: relative;\r\n cursor: pointer;\r\n height: 26px;\r\n line-height: 26px;\r\n border: 1px solid #d8dce5;\r\n color: #495060;\r\n background: #fff;\r\n padding: 0 8px;\r\n font-size: 12px;\r\n margin-left: 5px;\r\n margin-top: 4px;\r\n &:first-of-type {\r\n margin-left: 15px;\r\n }\r\n &:last-of-type {\r\n margin-right: 15px;\r\n }\r\n &.active {\r\n background-color: #42b983;\r\n color: #fff;\r\n border-color: #42b983;\r\n &::before {\r\n content: '';\r\n background: #fff;\r\n display: inline-block;\r\n width: 8px;\r\n height: 8px;\r\n border-radius: 50%;\r\n position: relative;\r\n margin-right: 2px;\r\n }\r\n }\r\n }\r\n }\r\n .contextmenu {\r\n margin: 0;\r\n background: #fff;\r\n z-index: 3000;\r\n position: absolute;\r\n list-style-type: none;\r\n padding: 5px 0;\r\n border-radius: 4px;\r\n font-size: 12px;\r\n font-weight: 400;\r\n color: #333;\r\n box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);\r\n li {\r\n margin: 0;\r\n padding: 7px 16px;\r\n cursor: pointer;\r\n &:hover {\r\n background: #eee;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n\r\n<style lang=\"scss\">\r\n//reset element css of el-icon-close\r\n.tags-view-wrapper {\r\n .tags-view-item {\r\n .el-icon-close {\r\n width: 16px;\r\n height: 16px;\r\n vertical-align: 2px;\r\n border-radius: 50%;\r\n text-align: center;\r\n transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n transform-origin: 100% 50%;\r\n &:before {\r\n transform: scale(0.6);\r\n display: inline-block;\r\n vertical-align: -3px;\r\n }\r\n &:hover {\r\n background-color: #b4bccc;\r\n color: #fff;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n",".tags-view-wrapper .tags-view-item .el-icon-close {\n width: 16px;\n height: 16px;\n vertical-align: 2px;\n border-radius: 50%;\n text-align: center;\n transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\n transform-origin: 100% 50%;\n}\n.tags-view-wrapper .tags-view-item .el-icon-close:before {\n transform: scale(0.6);\n display: inline-block;\n vertical-align: -3px;\n}\n.tags-view-wrapper .tags-view-item .el-icon-close:hover {\n background-color: #b4bccc;\n color: #fff;\n}\n\n/*# sourceMappingURL=index.vue.map */"]}, media: undefined });
|
98086
|
+
|
98087
|
+
};
|
98088
|
+
/* scoped */
|
98089
|
+
const __vue_scope_id__$k = "data-v-1621f612";
|
98090
|
+
/* module identifier */
|
98091
|
+
const __vue_module_identifier__$k = undefined;
|
98092
|
+
/* functional template */
|
98093
|
+
const __vue_is_functional_template__$k = false;
|
98094
|
+
/* style inject SSR */
|
98095
|
+
|
98096
|
+
/* style inject shadow dom */
|
98097
|
+
|
98098
|
+
|
98099
|
+
|
98100
|
+
const __vue_component__$k = /*#__PURE__*/__vue_normalize__(
|
98101
|
+
{ render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
|
98102
|
+
__vue_inject_styles__$k,
|
98103
|
+
__vue_script__$j,
|
98104
|
+
__vue_scope_id__$k,
|
98105
|
+
__vue_is_functional_template__$k,
|
98106
|
+
__vue_module_identifier__$k,
|
98107
|
+
false,
|
98108
|
+
__vue_create_injector__,
|
98109
|
+
undefined,
|
98110
|
+
undefined
|
98111
|
+
);
|
98112
|
+
|
97712
98113
|
//
|
97713
98114
|
//
|
97714
98115
|
//
|
@@ -97728,18 +98129,19 @@ __vue_render__$j._withStripped = true;
|
|
97728
98129
|
var script$i = {
|
97729
98130
|
name: 'z-layout',
|
97730
98131
|
components: {
|
97731
|
-
AppMain: __vue_component__$
|
97732
|
-
Navbar: __vue_component__$
|
97733
|
-
Sidebar: __vue_component__$
|
98132
|
+
AppMain: __vue_component__$y,
|
98133
|
+
Navbar: __vue_component__$r,
|
98134
|
+
Sidebar: __vue_component__$m,
|
98135
|
+
TagsView: __vue_component__$k
|
97734
98136
|
},
|
97735
98137
|
computed: {
|
97736
98138
|
...mapState({
|
97737
|
-
theme: (state) => state
|
97738
|
-
sideTheme: (state) => state
|
97739
|
-
sidebar: (state) => state
|
97740
|
-
device: (state) => state
|
97741
|
-
needTagsView: (state) => state
|
97742
|
-
fixedHeader: (state) => state
|
98139
|
+
theme: (state) => state['z-settings'].theme,
|
98140
|
+
sideTheme: (state) => state['z-settings'].sideTheme,
|
98141
|
+
sidebar: (state) => state['z-app'].sidebar,
|
98142
|
+
device: (state) => state['z-app'].device,
|
98143
|
+
needTagsView: (state) => state['z-settings'].tagsView,
|
98144
|
+
fixedHeader: (state) => state['z-settings'].fixedHeader
|
97743
98145
|
}),
|
97744
98146
|
classObj() {
|
97745
98147
|
return {
|
@@ -97755,7 +98157,7 @@ var script$i = {
|
|
97755
98157
|
},
|
97756
98158
|
methods: {
|
97757
98159
|
handleClickOutside() {
|
97758
|
-
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false });
|
98160
|
+
this.$store.dispatch('z-app/closeSideBar', { withoutAnimation: false });
|
97759
98161
|
}
|
97760
98162
|
}
|
97761
98163
|
};
|
@@ -97764,7 +98166,7 @@ var script$i = {
|
|
97764
98166
|
const __vue_script__$i = script$i;
|
97765
98167
|
|
97766
98168
|
/* template */
|
97767
|
-
var __vue_render__$
|
98169
|
+
var __vue_render__$j = function () {
|
97768
98170
|
var _vm = this;
|
97769
98171
|
var _h = _vm.$createElement;
|
97770
98172
|
var _c = _vm._self._c || _h;
|
@@ -97800,7 +98202,11 @@ var __vue_render__$i = function () {
|
|
97800
98202
|
_c(
|
97801
98203
|
"div",
|
97802
98204
|
{ class: { "fixed-header": _vm.fixedHeader } },
|
97803
|
-
[
|
98205
|
+
[
|
98206
|
+
_c("Navbar"),
|
98207
|
+
_vm._v(" "),
|
98208
|
+
_vm.needTagsView ? _c("TagsView") : _vm._e(),
|
98209
|
+
],
|
97804
98210
|
1
|
97805
98211
|
),
|
97806
98212
|
_vm._v(" "),
|
@@ -97812,21 +98218,62 @@ var __vue_render__$i = function () {
|
|
97812
98218
|
1
|
97813
98219
|
)
|
97814
98220
|
};
|
97815
|
-
var __vue_staticRenderFns__$
|
97816
|
-
__vue_render__$
|
98221
|
+
var __vue_staticRenderFns__$j = [];
|
98222
|
+
__vue_render__$j._withStripped = true;
|
97817
98223
|
|
97818
98224
|
/* style */
|
97819
|
-
const __vue_inject_styles__$
|
98225
|
+
const __vue_inject_styles__$j = function (inject) {
|
97820
98226
|
if (!inject) return
|
97821
|
-
inject("data-v-
|
98227
|
+
inject("data-v-18391fbc_0", { source: "/**\n$base-menu-color:hsla(0,0%,100%,.65);\n$base-menu-color-active:#fff;\n$base-menu-background:#001529;\n$base-logo-title-color: #ffffff;\n\n$base-menu-light-color:rgba(0,0,0,.70);\n$base-menu-light-background:#ffffff;\n$base-logo-light-title-color: #001529;\n\n$base-sub-menu-background:#000c17;\n$base-sub-menu-hover:#001528;\n*/\n[data-v-18391fbc]:export {\n menuColor: #bfcbd9;\n menuLightColor: rgba(0, 0, 0, 0.7);\n menuColorActive: #f4f4f5;\n menuBackground: #304156;\n menuLightBackground: #ffffff;\n subMenuBackground: #1f2d3d;\n subMenuHover: #001528;\n sideBarWidth: 200px;\n logoTitleColor: #ffffff;\n logoLightTitleColor: #001529;\n}\n.app-wrapper[data-v-18391fbc] {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.app-wrapper[data-v-18391fbc]:after {\n content: \"\";\n display: table;\n clear: both;\n}\n.app-wrapper.mobile.openSidebar[data-v-18391fbc] {\n position: fixed;\n top: 0;\n}\n.drawer-bg[data-v-18391fbc] {\n background: #000;\n opacity: 0.3;\n width: 100%;\n top: 0;\n height: 100%;\n position: absolute;\n z-index: 999;\n}\n.fixed-header[data-v-18391fbc] {\n position: fixed;\n top: 0;\n right: 0;\n z-index: 9;\n width: calc(100% - 200px);\n transition: width 0.28s;\n}\n.hideSidebar .fixed-header[data-v-18391fbc] {\n width: calc(100% - 54px);\n}\n.sidebarHide .fixed-header[data-v-18391fbc] {\n width: 100%;\n}\n.mobile .fixed-header[data-v-18391fbc] {\n width: 100%;\n}\n\n/*# sourceMappingURL=layout.vue.map */", map: {"version":3,"sources":["layout.vue","D:\\workspace-my\\gitee\\rollup-demo\\lib\\packages\\layout\\layout.vue"],"names":[],"mappings":"AAAA;;;;;;;;;;;;CAYC;AACD;EACE,kBAAkB;EAClB,kCAAkC;EAClC,wBAAwB;EACxB,uBAAuB;EACvB,4BAA4B;EAC5B,0BAA0B;EAC1B,qBAAqB;EACrB,mBAAmB;EACnB,uBAAuB;EACvB,4BAA4B;AAC9B;ACsCA;EAEA,kBAAA;EACA,YAAA;EACA,WAAA;ADpCA;AACA;EACE,WAAW;EACX,cAAc;EACd,WAAW;AACb;ACgCA;EACA,eAAA;EACA,MAAA;AD9BA;ACiCA;EACA,gBAAA;EACA,YAAA;EACA,WAAA;EACA,MAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;AD9BA;ACgCA;EACA,eAAA;EACA,MAAA;EACA,QAAA;EACA,UAAA;EACA,yBAAA;EACA,uBAAA;AD7BA;AC+BA;EACA,wBAAA;AD5BA;AC8BA;EACA,WAAA;AD3BA;AC6BA;EACA,WAAA;AD1BA;;AAEA,qCAAqC","file":"layout.vue","sourcesContent":["/**\n$base-menu-color:hsla(0,0%,100%,.65);\n$base-menu-color-active:#fff;\n$base-menu-background:#001529;\n$base-logo-title-color: #ffffff;\n\n$base-menu-light-color:rgba(0,0,0,.70);\n$base-menu-light-background:#ffffff;\n$base-logo-light-title-color: #001529;\n\n$base-sub-menu-background:#000c17;\n$base-sub-menu-hover:#001528;\n*/\n:export {\n menuColor: #bfcbd9;\n menuLightColor: rgba(0, 0, 0, 0.7);\n menuColorActive: #f4f4f5;\n menuBackground: #304156;\n menuLightBackground: #ffffff;\n subMenuBackground: #1f2d3d;\n subMenuHover: #001528;\n sideBarWidth: 200px;\n logoTitleColor: #ffffff;\n logoLightTitleColor: #001529;\n}\n\n.app-wrapper {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.app-wrapper:after {\n content: \"\";\n display: table;\n clear: both;\n}\n.app-wrapper.mobile.openSidebar {\n position: fixed;\n top: 0;\n}\n\n.drawer-bg {\n background: #000;\n opacity: 0.3;\n width: 100%;\n top: 0;\n height: 100%;\n position: absolute;\n z-index: 999;\n}\n\n.fixed-header {\n position: fixed;\n top: 0;\n right: 0;\n z-index: 9;\n width: calc(100% - 200px);\n transition: width 0.28s;\n}\n\n.hideSidebar .fixed-header {\n width: calc(100% - 54px);\n}\n\n.sidebarHide .fixed-header {\n width: 100%;\n}\n\n.mobile .fixed-header {\n width: 100%;\n}\n\n/*# sourceMappingURL=layout.vue.map */","<template>\r\n <div :class=\"classObj\" class=\"app-wrapper\" :style=\"{ '--current-color': theme }\">\r\n <div v-if=\"device === 'mobile' && sidebar.opened\" class=\"drawer-bg\" @click=\"handleClickOutside\" />\r\n <Sidebar v-if=\"!sidebar.hide\" class=\"sidebar-container\" />\r\n <div :class=\"{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }\" class=\"main-container\">\r\n <div :class=\"{ 'fixed-header': fixedHeader }\">\r\n <Navbar />\r\n <TagsView v-if=\"needTagsView\" />\r\n </div>\r\n <AppMain></AppMain>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { mapState } from 'vuex'\r\nimport variables from './scss/variables.module.scss'\r\nimport AppMain from './components/AppMain.vue'\r\nimport Navbar from './components/Navbar.vue'\r\nimport Sidebar from './components/Sidebar/index.vue'\r\nimport TagsView from './components/TagsView/index.vue'\r\n\r\nexport default {\r\n name: 'z-layout',\r\n components: {\r\n AppMain,\r\n Navbar,\r\n Sidebar,\r\n TagsView\r\n },\r\n computed: {\r\n ...mapState({\r\n theme: (state) => state['z-settings'].theme,\r\n sideTheme: (state) => state['z-settings'].sideTheme,\r\n sidebar: (state) => state['z-app'].sidebar,\r\n device: (state) => state['z-app'].device,\r\n needTagsView: (state) => state['z-settings'].tagsView,\r\n fixedHeader: (state) => state['z-settings'].fixedHeader\r\n }),\r\n classObj() {\r\n return {\r\n hideSidebar: !this.sidebar.opened,\r\n openSidebar: this.sidebar.opened,\r\n withoutAnimation: this.sidebar.withoutAnimation,\r\n mobile: this.device === 'mobile'\r\n }\r\n },\r\n variables() {\r\n return variables\r\n }\r\n },\r\n methods: {\r\n handleClickOutside() {\r\n this.$store.dispatch('z-app/closeSideBar', { withoutAnimation: false })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n@import './scss/mixin.scss';\r\n@import './scss/variables.module.scss';\r\n.app-wrapper {\r\n @include clearfix;\r\n position: relative;\r\n height: 100%;\r\n width: 100%;\r\n &.mobile.openSidebar {\r\n position: fixed;\r\n top: 0;\r\n }\r\n}\r\n.drawer-bg {\r\n background: #000;\r\n opacity: 0.3;\r\n width: 100%;\r\n top: 0;\r\n height: 100%;\r\n position: absolute;\r\n z-index: 999;\r\n}\r\n.fixed-header {\r\n position: fixed;\r\n top: 0;\r\n right: 0;\r\n z-index: 9;\r\n width: calc(100% - #{$base-sidebar-width});\r\n transition: width 0.28s;\r\n}\r\n.hideSidebar .fixed-header {\r\n width: calc(100% - 54px);\r\n}\r\n.sidebarHide .fixed-header {\r\n width: 100%;\r\n}\r\n.mobile .fixed-header {\r\n width: 100%;\r\n}\r\n</style>\r\n"]}, media: undefined });
|
97822
98228
|
|
97823
98229
|
};
|
97824
98230
|
/* scoped */
|
97825
|
-
const __vue_scope_id__$
|
98231
|
+
const __vue_scope_id__$j = "data-v-18391fbc";
|
98232
|
+
/* module identifier */
|
98233
|
+
const __vue_module_identifier__$j = undefined;
|
98234
|
+
/* functional template */
|
98235
|
+
const __vue_is_functional_template__$j = false;
|
98236
|
+
/* style inject SSR */
|
98237
|
+
|
98238
|
+
/* style inject shadow dom */
|
98239
|
+
|
98240
|
+
|
98241
|
+
|
98242
|
+
const __vue_component__$j = /*#__PURE__*/__vue_normalize__(
|
98243
|
+
{ render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
|
98244
|
+
__vue_inject_styles__$j,
|
98245
|
+
__vue_script__$i,
|
98246
|
+
__vue_scope_id__$j,
|
98247
|
+
__vue_is_functional_template__$j,
|
98248
|
+
__vue_module_identifier__$j,
|
98249
|
+
false,
|
98250
|
+
__vue_create_injector__,
|
98251
|
+
undefined,
|
98252
|
+
undefined
|
98253
|
+
);
|
98254
|
+
|
98255
|
+
/* script */
|
98256
|
+
|
98257
|
+
/* template */
|
98258
|
+
var __vue_render__$i = function () {
|
98259
|
+
var _vm = this;
|
98260
|
+
var _h = _vm.$createElement;
|
98261
|
+
var _c = _vm._self._c || _h;
|
98262
|
+
return _c("router-view")
|
98263
|
+
};
|
98264
|
+
var __vue_staticRenderFns__$i = [];
|
98265
|
+
__vue_render__$i._withStripped = true;
|
98266
|
+
|
98267
|
+
/* style */
|
98268
|
+
const __vue_inject_styles__$i = undefined;
|
98269
|
+
/* scoped */
|
98270
|
+
const __vue_scope_id__$i = undefined;
|
97826
98271
|
/* module identifier */
|
97827
98272
|
const __vue_module_identifier__$i = undefined;
|
97828
98273
|
/* functional template */
|
97829
98274
|
const __vue_is_functional_template__$i = false;
|
98275
|
+
/* style inject */
|
98276
|
+
|
97830
98277
|
/* style inject SSR */
|
97831
98278
|
|
97832
98279
|
/* style inject shadow dom */
|
@@ -97836,26 +98283,28 @@ __vue_render__$i._withStripped = true;
|
|
97836
98283
|
const __vue_component__$i = /*#__PURE__*/__vue_normalize__(
|
97837
98284
|
{ render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
|
97838
98285
|
__vue_inject_styles__$i,
|
97839
|
-
|
98286
|
+
{},
|
97840
98287
|
__vue_scope_id__$i,
|
97841
98288
|
__vue_is_functional_template__$i,
|
97842
98289
|
__vue_module_identifier__$i,
|
97843
98290
|
false,
|
97844
|
-
|
98291
|
+
undefined,
|
97845
98292
|
undefined,
|
97846
98293
|
undefined
|
97847
98294
|
);
|
97848
98295
|
|
97849
|
-
const state$
|
98296
|
+
const state$5 = {
|
97850
98297
|
routes: [],
|
97851
98298
|
addRoutes: [],
|
97852
98299
|
defaultRoutes: [],
|
97853
98300
|
topbarRouters: [],
|
97854
98301
|
sidebarRouters: []
|
97855
98302
|
};
|
97856
|
-
const mutations$
|
97857
|
-
|
98303
|
+
const mutations$5 = {
|
98304
|
+
SET_ADD_ROUTES: (state, routes) => {
|
97858
98305
|
state.addRoutes = routes;
|
98306
|
+
},
|
98307
|
+
SET_ROUTES: (state, routes) => {
|
97859
98308
|
state.routes = routes;
|
97860
98309
|
},
|
97861
98310
|
SET_DEFAULT_ROUTES: (state, routes) => {
|
@@ -97868,7 +98317,7 @@ const mutations$4 = {
|
|
97868
98317
|
state.sidebarRouters = routes;
|
97869
98318
|
}
|
97870
98319
|
};
|
97871
|
-
const actions$
|
98320
|
+
const actions$5 = {
|
97872
98321
|
// 生成路由
|
97873
98322
|
GenerateRoutes({ commit }, $z) {
|
97874
98323
|
return new Promise((resolve) => {
|
@@ -97893,8 +98342,11 @@ const actions$4 = {
|
|
97893
98342
|
const sidebarRoutes = filterAsyncRouter(sdata);
|
97894
98343
|
const rewriteRoutes = filterAsyncRouter(rdata, false, true);
|
97895
98344
|
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true });
|
97896
|
-
|
97897
|
-
|
98345
|
+
const constantRoutes = $z.router.routes || [];
|
98346
|
+
|
98347
|
+
commit('SET_ADD_ROUTES', rewriteRoutes);
|
98348
|
+
commit('SET_ROUTES', constantRoutes.concat(rewriteRoutes));
|
98349
|
+
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes));
|
97898
98350
|
commit('SET_DEFAULT_ROUTES', sidebarRoutes);
|
97899
98351
|
commit('SET_TOPBAR_ROUTES', sidebarRoutes);
|
97900
98352
|
resolve(rewriteRoutes);
|
@@ -97909,16 +98361,13 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
|
|
97909
98361
|
if (type && route.children) {
|
97910
98362
|
route.children = filterChildren(route.children);
|
97911
98363
|
}
|
97912
|
-
if (route.component) {
|
97913
|
-
// Layout ParentView 组件特殊处理
|
98364
|
+
if (route.component && typeof route.component === 'string') {
|
97914
98365
|
if (route.component === 'Layout') {
|
97915
|
-
route.component = __vue_component__$
|
98366
|
+
route.component = __vue_component__$j;
|
97916
98367
|
} else if (route.component === 'ParentView') {
|
97917
98368
|
route.component = __vue_component__$i;
|
97918
|
-
// route.component = ParentView
|
97919
98369
|
} else if (route.component === 'InnerLink') {
|
97920
|
-
route.component = __vue_component__$
|
97921
|
-
// route.component = InnerLink
|
98370
|
+
route.component = __vue_component__$A;
|
97922
98371
|
} else {
|
97923
98372
|
route.component = loadView(route.component);
|
97924
98373
|
}
|
@@ -97927,7 +98376,9 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
|
|
97927
98376
|
route.children = filterAsyncRouter(route.children, route, type);
|
97928
98377
|
} else {
|
97929
98378
|
delete route['children'];
|
97930
|
-
|
98379
|
+
if (route.path !== '' && route.path !== '/') {
|
98380
|
+
delete route['redirect'];
|
98381
|
+
}
|
97931
98382
|
}
|
97932
98383
|
return true
|
97933
98384
|
})
|
@@ -97962,27 +98413,183 @@ const loadView = (view) => {
|
|
97962
98413
|
// 使用 import 实现生产环境的路由懒加载
|
97963
98414
|
return () => import(`@/views/${view}.vue`)
|
97964
98415
|
}
|
97965
|
-
|
98416
|
+
};
|
98417
|
+
|
98418
|
+
function registerStateModule$5(store) {
|
98419
|
+
if (!store || !store.hasModule) return
|
98420
|
+
if (!store.hasModule('z-permission')) {
|
98421
|
+
const statesModule = {
|
98422
|
+
namespaced: true,
|
98423
|
+
state: state$5,
|
98424
|
+
mutations: mutations$5,
|
98425
|
+
actions: actions$5
|
98426
|
+
};
|
98427
|
+
store.registerModule('z-permission', statesModule);
|
98428
|
+
}
|
98429
|
+
}
|
98430
|
+
|
98431
|
+
NProgress.configure({ showSpinner: false });
|
98432
|
+
|
98433
|
+
function createRouter(Vue) {
|
98434
|
+
// 判断是否已经use过VueRouter
|
98435
|
+
const VueRouterObj = Vue._installedPlugins.filter((item) => {
|
98436
|
+
return item.name === 'VueRouter'
|
98437
|
+
});
|
98438
|
+
if (!(VueRouterObj && VueRouterObj[0])) {
|
98439
|
+
Vue.use(VueRouter);
|
98440
|
+
const $z = Vue.prototype.$z;
|
98441
|
+
const routerOption = $z.router;
|
98442
|
+
if (routerOption) {
|
98443
|
+
const defaultConfig = {
|
98444
|
+
mode: routerOption.mode || 'history', // 去掉url中的#
|
98445
|
+
scrollBehavior: () => ({ y: 0 }),
|
98446
|
+
routes: routerOption.routes || []
|
98447
|
+
};
|
98448
|
+
filterAsyncRouter(defaultConfig.routes);
|
98449
|
+
const router = new VueRouter(defaultConfig);
|
98450
|
+
router.beforeEach((to, from, next) => {
|
98451
|
+
if (routerOption.beforeEach) {
|
98452
|
+
routerOption.beforeEach(to, from, next);
|
98453
|
+
} else {
|
98454
|
+
NProgress.start();
|
98455
|
+
const httpOption = $z.http || {};
|
98456
|
+
const token = getCookie(httpOption.tokenKey || TOKENKEY);
|
98457
|
+
const store = $z.store;
|
98458
|
+
if (!routerOption.whiteList) {
|
98459
|
+
routerOption.whiteList = ['/login', '/register'];
|
98460
|
+
}
|
98461
|
+
if (token) {
|
98462
|
+
if (to.path === '/login') {
|
98463
|
+
next({ path: '/' });
|
98464
|
+
NProgress.done();
|
98465
|
+
} else {
|
98466
|
+
// 判断是不是第一次 需要动态加载路由
|
98467
|
+
if (!router.options.isAddDynamicMenuRoutes && store) {
|
98468
|
+
router.options.isAddDynamicMenuRoutes = true;
|
98469
|
+
isRelogin.show = true;
|
98470
|
+
store.dispatch('z-user/GetInfo', $z).then(() => {
|
98471
|
+
isRelogin.show = false;
|
98472
|
+
store.dispatch('z-permission/GenerateRoutes', $z).then((accessRoutes) => {
|
98473
|
+
// 根据roles权限生成可访问的路由表
|
98474
|
+
router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
98475
|
+
router.options.routes = Object.assign(router.options.routes, accessRoutes);
|
98476
|
+
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
|
98477
|
+
});
|
98478
|
+
});
|
98479
|
+
next();
|
98480
|
+
} else {
|
98481
|
+
next();
|
98482
|
+
}
|
98483
|
+
}
|
98484
|
+
} else {
|
98485
|
+
// 没有token
|
98486
|
+
if (routerOption.whiteList.indexOf(to.path) !== -1) {
|
98487
|
+
// 在免登录白名单,直接进入
|
98488
|
+
next();
|
98489
|
+
} else {
|
98490
|
+
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
|
98491
|
+
NProgress.done();
|
98492
|
+
}
|
98493
|
+
}
|
98494
|
+
}
|
98495
|
+
});
|
98496
|
+
router.afterEach(() => {
|
98497
|
+
if (routerOption.afterEach) {
|
98498
|
+
routerOption.afterEach();
|
98499
|
+
} else {
|
98500
|
+
NProgress.done();
|
98501
|
+
}
|
98502
|
+
});
|
98503
|
+
|
98504
|
+
Vue.prototype.$z.$router = router;
|
98505
|
+
}
|
98506
|
+
}
|
98507
|
+
}
|
98508
|
+
|
98509
|
+
const state$4 = {
|
98510
|
+
token: '',
|
98511
|
+
userinfo: {},
|
98512
|
+
roles: [],
|
98513
|
+
permissions: []
|
98514
|
+
};
|
98515
|
+
const mutations$4 = {
|
98516
|
+
SET_TOKEN: (state, token) => {
|
98517
|
+
state.token = token;
|
98518
|
+
},
|
98519
|
+
SET_ROLES: (state, roles) => {
|
98520
|
+
state.roles = roles;
|
98521
|
+
},
|
98522
|
+
SET_USERINFO: (state, userinfo) => {
|
98523
|
+
state.userinfo = userinfo;
|
98524
|
+
},
|
98525
|
+
SET_PERMISSIONS: (state, permissions) => {
|
98526
|
+
state.permissions = permissions;
|
98527
|
+
}
|
98528
|
+
};
|
98529
|
+
const actions$4 = {
|
98530
|
+
// 登录 todo
|
98531
|
+
Login({ commit }, userInfo) {},
|
98532
|
+
|
98533
|
+
// 获取用户信息
|
98534
|
+
GetInfo({ commit }, $z) {
|
98535
|
+
return new Promise((resolve, reject) => {
|
98536
|
+
const $http = $z.$http;
|
98537
|
+
const routerOption = $z.router || {};
|
98538
|
+
let api = function () {
|
98539
|
+
if ($http) {
|
98540
|
+
return $http.request({
|
98541
|
+
url: routerOption.getUserInfo || '/getInfo',
|
98542
|
+
method: 'get'
|
98543
|
+
})
|
98544
|
+
} else {
|
98545
|
+
Promise.resolve({});
|
98546
|
+
}
|
98547
|
+
};
|
98548
|
+
if (typeof routerOption.getUserInfo === 'function') {
|
98549
|
+
api = routerOption.getUserInfo;
|
98550
|
+
}
|
98551
|
+
api()
|
98552
|
+
.then((res) => {
|
98553
|
+
commit('SET_USERINFO', res.user || {});
|
98554
|
+
commit('SET_PERMISSIONS', res.permissions || '*:*:*');
|
98555
|
+
if (res.roles && res.roles.length > 0) {
|
98556
|
+
commit('SET_ROLES', res.roles);
|
98557
|
+
} else {
|
98558
|
+
commit('SET_ROLES', ['ROLE_DEFAULT']);
|
98559
|
+
}
|
98560
|
+
resolve(res);
|
98561
|
+
})
|
98562
|
+
.catch((error) => {
|
98563
|
+
reject(error);
|
98564
|
+
});
|
98565
|
+
})
|
98566
|
+
},
|
98567
|
+
|
98568
|
+
// 退出系统 todo
|
98569
|
+
LogOut({ commit, state }) {},
|
98570
|
+
|
98571
|
+
// 前端 登出 todo
|
98572
|
+
FedLogOut({ commit }) {}
|
97966
98573
|
};
|
97967
98574
|
|
97968
98575
|
function registerStateModule$4(store) {
|
97969
98576
|
if (!store || !store.hasModule) return
|
97970
|
-
if (!store.hasModule('
|
98577
|
+
if (!store.hasModule('z-user')) {
|
97971
98578
|
const statesModule = {
|
97972
98579
|
namespaced: true,
|
97973
98580
|
state: state$4,
|
97974
98581
|
mutations: mutations$4,
|
97975
98582
|
actions: actions$4
|
97976
98583
|
};
|
97977
|
-
store.registerModule('
|
98584
|
+
store.registerModule('z-user', statesModule);
|
97978
98585
|
}
|
97979
98586
|
}
|
97980
98587
|
|
97981
98588
|
function install$2(Vue, option = {}) {
|
97982
98589
|
const z = Vue.prototype.$z;
|
97983
98590
|
const store = z.store;
|
97984
|
-
registerStateModule$5(store);
|
97985
98591
|
registerStateModule$4(store);
|
98592
|
+
registerStateModule$5(store);
|
97986
98593
|
setGolbalData(Vue, option);
|
97987
98594
|
createRouter(Vue);
|
97988
98595
|
}
|
@@ -99444,14 +100051,14 @@ const actions$2 = {
|
|
99444
100051
|
|
99445
100052
|
function registerStateModule$2(store) {
|
99446
100053
|
if (!store || !store.hasModule) return
|
99447
|
-
if (!store.hasModule('settings')) {
|
100054
|
+
if (!store.hasModule('z-settings')) {
|
99448
100055
|
const statesModule = {
|
99449
100056
|
namespaced: true,
|
99450
100057
|
state: state$2,
|
99451
100058
|
mutations: mutations$2,
|
99452
100059
|
actions: actions$2
|
99453
100060
|
};
|
99454
|
-
store.registerModule('settings', statesModule);
|
100061
|
+
store.registerModule('z-settings', statesModule);
|
99455
100062
|
}
|
99456
100063
|
}
|
99457
100064
|
|
@@ -99515,14 +100122,14 @@ const actions$1 = {
|
|
99515
100122
|
|
99516
100123
|
function registerStateModule$1(store) {
|
99517
100124
|
if (!store || !store.hasModule) return
|
99518
|
-
if (!store.hasModule('app')) {
|
100125
|
+
if (!store.hasModule('z-app')) {
|
99519
100126
|
const statesModule = {
|
99520
100127
|
namespaced: true,
|
99521
100128
|
state: state$1,
|
99522
100129
|
mutations: mutations$1,
|
99523
100130
|
actions: actions$1
|
99524
100131
|
};
|
99525
|
-
store.registerModule('app', statesModule);
|
100132
|
+
store.registerModule('z-app', statesModule);
|
99526
100133
|
}
|
99527
100134
|
}
|
99528
100135
|
|
@@ -99750,20 +100357,20 @@ const actions = {
|
|
99750
100357
|
|
99751
100358
|
function registerStateModule(store) {
|
99752
100359
|
if (!store || !store.hasModule) return
|
99753
|
-
if (!store.hasModule('tagsView')) {
|
100360
|
+
if (!store.hasModule('z-tagsView')) {
|
99754
100361
|
const statesModule = {
|
99755
100362
|
namespaced: true,
|
99756
100363
|
state,
|
99757
100364
|
mutations,
|
99758
100365
|
actions
|
99759
100366
|
};
|
99760
|
-
store.registerModule('tagsView', statesModule);
|
100367
|
+
store.registerModule('z-tagsView', statesModule);
|
99761
100368
|
}
|
99762
100369
|
}
|
99763
100370
|
|
99764
|
-
__vue_component__$
|
100371
|
+
__vue_component__$j.install = function (Vue, option = {}) {
|
99765
100372
|
setGolbalData(Vue, option);
|
99766
|
-
Vue.component(__vue_component__$
|
100373
|
+
Vue.component(__vue_component__$j.name, __vue_component__$j);
|
99767
100374
|
const z = Vue.prototype.$z;
|
99768
100375
|
const store = z.store;
|
99769
100376
|
registerStateModule$2(store);
|
@@ -100767,7 +101374,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
100767
101374
|
install(window.Vue);
|
100768
101375
|
}
|
100769
101376
|
const components = [
|
100770
|
-
__vue_component__$
|
101377
|
+
__vue_component__$B,
|
100771
101378
|
__vue_component__,
|
100772
101379
|
RequestZ,
|
100773
101380
|
RouterZ,
|
@@ -100789,7 +101396,7 @@ const components = [
|
|
100789
101396
|
__vue_component__$3,
|
100790
101397
|
__vue_component__$2,
|
100791
101398
|
__vue_component__$1,
|
100792
|
-
__vue_component__$
|
101399
|
+
__vue_component__$j
|
100793
101400
|
];
|
100794
101401
|
const install = (Vue, option = {}) => {
|
100795
101402
|
setGolbalData(Vue, option);
|
@@ -100812,9 +101419,9 @@ exports.DictZ = DictZ;
|
|
100812
101419
|
exports.FooterZ = __vue_component__$8;
|
100813
101420
|
exports.HeaderZ = __vue_component__$7;
|
100814
101421
|
exports.Icon2Z = __vue_component__;
|
100815
|
-
exports.IconZ = __vue_component__$
|
101422
|
+
exports.IconZ = __vue_component__$B;
|
100816
101423
|
exports.InputZ = __vue_component__$6;
|
100817
|
-
exports.LayoutZ = __vue_component__$
|
101424
|
+
exports.LayoutZ = __vue_component__$j;
|
100818
101425
|
exports.ListZ = __vue_component__$g;
|
100819
101426
|
exports.MainZ = __vue_component__$5;
|
100820
101427
|
exports.OptionZ = __vue_component__$4;
|