@luzhaoqi/test 0.0.22 → 0.0.23
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/lib-cjs.js +97 -8
- package/package.json +1 -1
package/dist/lib-cjs.js
CHANGED
@@ -17576,8 +17576,6 @@ var path$1 = {
|
|
17576
17576
|
query
|
17577
17577
|
};
|
17578
17578
|
|
17579
|
-
const TOKENKEY = 'Admin-Token';
|
17580
|
-
|
17581
17579
|
const setGolbalData = (Vue, option) => {
|
17582
17580
|
if (!Vue.prototype.$z) {
|
17583
17581
|
Vue.prototype.$z = option || {};
|
@@ -93730,6 +93728,8 @@ var errorCode = {
|
|
93730
93728
|
default: '系统未知错误,请反馈给管理员'
|
93731
93729
|
};
|
93732
93730
|
|
93731
|
+
const TOKENKEY = 'Admin-Token';
|
93732
|
+
|
93733
93733
|
// 是否显示重新登录
|
93734
93734
|
let isRelogin = { show: false };
|
93735
93735
|
|
@@ -98322,7 +98322,7 @@ const actions$5 = {
|
|
98322
98322
|
GenerateRoutes({ commit }, $z) {
|
98323
98323
|
return new Promise((resolve) => {
|
98324
98324
|
const $http = $z.$http;
|
98325
|
-
const routerOption = $z.
|
98325
|
+
const routerOption = $z.routerConfig || {};
|
98326
98326
|
let api = function () {
|
98327
98327
|
if ($http) {
|
98328
98328
|
return $http.request({
|
@@ -98342,7 +98342,7 @@ const actions$5 = {
|
|
98342
98342
|
const sidebarRoutes = filterAsyncRouter(sdata);
|
98343
98343
|
const rewriteRoutes = filterAsyncRouter(rdata, false, true);
|
98344
98344
|
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true });
|
98345
|
-
const constantRoutes = $z.
|
98345
|
+
const constantRoutes = $z.routerConfig.routes || [];
|
98346
98346
|
|
98347
98347
|
commit('SET_ADD_ROUTES', rewriteRoutes);
|
98348
98348
|
commit('SET_ROUTES', constantRoutes.concat(rewriteRoutes));
|
@@ -98438,8 +98438,11 @@ function createRouter(Vue) {
|
|
98438
98438
|
if (!(VueRouterObj && VueRouterObj[0])) {
|
98439
98439
|
Vue.use(VueRouter);
|
98440
98440
|
const $z = Vue.prototype.$z;
|
98441
|
-
const
|
98442
|
-
|
98441
|
+
const routerObj = $z.router;
|
98442
|
+
const routerOption = $z.routerConfig;
|
98443
|
+
if (routerObj) {
|
98444
|
+
Vue.prototype.$z.$router = routerObj;
|
98445
|
+
} else if (routerOption) {
|
98443
98446
|
const defaultConfig = {
|
98444
98447
|
mode: routerOption.mode || 'history', // 去掉url中的#
|
98445
98448
|
scrollBehavior: () => ({ y: 0 }),
|
@@ -98534,7 +98537,7 @@ const actions$4 = {
|
|
98534
98537
|
GetInfo({ commit }, $z) {
|
98535
98538
|
return new Promise((resolve, reject) => {
|
98536
98539
|
const $http = $z.$http;
|
98537
|
-
const routerOption = $z.
|
98540
|
+
const routerOption = $z.routerConfig || {};
|
98538
98541
|
let api = function () {
|
98539
98542
|
if ($http) {
|
98540
98543
|
return $http.request({
|
@@ -100378,6 +100381,90 @@ __vue_component__$j.install = function (Vue, option = {}) {
|
|
100378
100381
|
registerStateModule(store);
|
100379
100382
|
};
|
100380
100383
|
|
100384
|
+
// import store from '@/store'
|
100385
|
+
// import router from '@/router';
|
100386
|
+
|
100387
|
+
function tab (Vue, option) {
|
100388
|
+
console.log(Vue.prototype.$z.store);
|
100389
|
+
const store = Vue.prototype.$z.store;
|
100390
|
+
const router = Vue.prototype.$z.$router;
|
100391
|
+
return {
|
100392
|
+
// 刷新当前tab页签
|
100393
|
+
refreshPage(obj) {
|
100394
|
+
const { path, query, matched } = router.currentRoute;
|
100395
|
+
if (obj === undefined) {
|
100396
|
+
matched.forEach((m) => {
|
100397
|
+
if (m.components && m.components.default && m.components.default.name) {
|
100398
|
+
if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
|
100399
|
+
obj = { name: m.components.default.name, path: path, query: query };
|
100400
|
+
}
|
100401
|
+
}
|
100402
|
+
});
|
100403
|
+
}
|
100404
|
+
return store.dispatch('z-tagsView/delCachedView', obj).then(() => {
|
100405
|
+
const { path, query } = obj;
|
100406
|
+
router.replace({
|
100407
|
+
path: '/redirect' + path,
|
100408
|
+
query: query
|
100409
|
+
});
|
100410
|
+
})
|
100411
|
+
},
|
100412
|
+
// 关闭当前tab页签,打开新页签
|
100413
|
+
closeOpenPage(obj) {
|
100414
|
+
store.dispatch('z-tagsView/delView', router.currentRoute);
|
100415
|
+
if (obj !== undefined) {
|
100416
|
+
return router.push(obj)
|
100417
|
+
}
|
100418
|
+
},
|
100419
|
+
// 关闭指定tab页签
|
100420
|
+
closePage(obj) {
|
100421
|
+
if (obj === undefined) {
|
100422
|
+
return store.dispatch('z-tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
|
100423
|
+
const latestView = visitedViews.slice(-1)[0];
|
100424
|
+
if (latestView) {
|
100425
|
+
return router.push(latestView.fullPath)
|
100426
|
+
}
|
100427
|
+
return router.push('/')
|
100428
|
+
})
|
100429
|
+
}
|
100430
|
+
return store.dispatch('z-tagsView/delView', obj)
|
100431
|
+
},
|
100432
|
+
// 关闭所有tab页签
|
100433
|
+
closeAllPage() {
|
100434
|
+
return store.dispatch('z-tagsView/delAllViews')
|
100435
|
+
},
|
100436
|
+
// 关闭左侧tab页签
|
100437
|
+
closeLeftPage(obj) {
|
100438
|
+
return store.dispatch('z-tagsView/delLeftTags', obj || router.currentRoute)
|
100439
|
+
},
|
100440
|
+
// 关闭右侧tab页签
|
100441
|
+
closeRightPage(obj) {
|
100442
|
+
return store.dispatch('z-tagsView/delRightTags', obj || router.currentRoute)
|
100443
|
+
},
|
100444
|
+
// 关闭其他tab页签
|
100445
|
+
closeOtherPage(obj) {
|
100446
|
+
return store.dispatch('z-tagsView/delOthersViews', obj || router.currentRoute)
|
100447
|
+
},
|
100448
|
+
// 添加tab页签
|
100449
|
+
openPage(title, url, params) {
|
100450
|
+
var obj = { path: url, meta: { title: title } };
|
100451
|
+
store.dispatch('z-tagsView/addView', obj);
|
100452
|
+
return router.push({ path: url, query: params })
|
100453
|
+
},
|
100454
|
+
// 修改tab页签
|
100455
|
+
updatePage(obj) {
|
100456
|
+
return store.dispatch('z-tagsView/updateVisitedView', obj)
|
100457
|
+
}
|
100458
|
+
}
|
100459
|
+
}
|
100460
|
+
|
100461
|
+
var PluginsZ = {
|
100462
|
+
install(Vue, option = {}) {
|
100463
|
+
// 页签操作
|
100464
|
+
Vue.prototype.$tab = tab(Vue);
|
100465
|
+
}
|
100466
|
+
};
|
100467
|
+
|
100381
100468
|
//
|
100382
100469
|
//
|
100383
100470
|
//
|
@@ -101396,7 +101483,8 @@ const components = [
|
|
101396
101483
|
__vue_component__$3,
|
101397
101484
|
__vue_component__$2,
|
101398
101485
|
__vue_component__$1,
|
101399
|
-
__vue_component__$j
|
101486
|
+
__vue_component__$j,
|
101487
|
+
PluginsZ
|
101400
101488
|
];
|
101401
101489
|
const install = (Vue, option = {}) => {
|
101402
101490
|
setGolbalData(Vue, option);
|
@@ -101425,6 +101513,7 @@ exports.LayoutZ = __vue_component__$j;
|
|
101425
101513
|
exports.ListZ = __vue_component__$g;
|
101426
101514
|
exports.MainZ = __vue_component__$5;
|
101427
101515
|
exports.OptionZ = __vue_component__$4;
|
101516
|
+
exports.PluginsZ = PluginsZ;
|
101428
101517
|
exports.RequestZ = RequestZ;
|
101429
101518
|
exports.RouterZ = RouterZ;
|
101430
101519
|
exports.RowZ = __vue_component__$3;
|