mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-22 21:22:33 +08:00
'admin-21.03.15:添加开发/线上环境配置.env、修复tagsView页面设置隐藏时不显示的问题'
This commit is contained in:
parent
8c64de8393
commit
577a1cdac6
5
.env.development
Normal file
5
.env.development
Normal file
@ -0,0 +1,5 @@
|
||||
# 本地环境
|
||||
ENV = 'development'
|
||||
|
||||
# 本地环境接口地址
|
||||
VITE_API_URL = 'http://localhost:10000/'
|
5
.env.production
Normal file
5
.env.production
Normal file
@ -0,0 +1,5 @@
|
||||
# 线上环境
|
||||
ENV = 'production'
|
||||
|
||||
# 线上环境接口地址
|
||||
VITE_API_URL = 'https://gitee.com/gitee.io'
|
4
source.d.ts
vendored
4
source.d.ts
vendored
@ -3,6 +3,4 @@ declare module '*.png';
|
||||
declare module '*.jpg';
|
||||
declare module '*.scss';
|
||||
declare module '*.ts';
|
||||
declare module 'qrcodejs2-fixes';
|
||||
declare module 'element-plus';
|
||||
declare module 'element-plus/lib/locale/lang/zh-cn';
|
||||
declare module '*.js';
|
||||
|
@ -5,7 +5,7 @@ import router, { resetRoute } from '/@/router/index.ts';
|
||||
|
||||
// 配置新建一个 axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: 'http://localhost:10000/',
|
||||
baseURL: import.meta.env.VITE_API_URL as any,
|
||||
timeout: 50000,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
|
@ -107,7 +107,7 @@ export default {
|
||||
if (state.tagsViewList.some((v: any) => v.path === path)) return false;
|
||||
const item = state.tagsViewRoutesList.find((v: any) => v.path === path);
|
||||
if (item.meta.isLink && !item.meta.isIframe) return false;
|
||||
if (!item.meta.isHide) state.tagsViewList.push({ ...item });
|
||||
state.tagsViewList.push({ ...item });
|
||||
addBrowserSetSession(state.tagsViewList);
|
||||
};
|
||||
// 2、刷新当前 tagsView:
|
||||
@ -157,6 +157,16 @@ export default {
|
||||
screenfulls.request(element);
|
||||
});
|
||||
};
|
||||
// 7、设置了 `isHide` 界面的,页面离开时关闭当前界面
|
||||
const removeCurrentTagsView = (from: any) => {
|
||||
const { meta, path } = from;
|
||||
state.tagsViewList.map((v: any, k: number) => {
|
||||
if (meta.isHide && path === v.path) {
|
||||
state.tagsViewList.splice(k, 1);
|
||||
addBrowserSetSession(state.tagsViewList);
|
||||
}
|
||||
});
|
||||
};
|
||||
// 当前项右键菜单点击
|
||||
const onCurrentContextmenuClick = (data: any) => {
|
||||
let { id, path } = data;
|
||||
@ -318,7 +328,8 @@ export default {
|
||||
initSortable();
|
||||
});
|
||||
// 路由更新时
|
||||
onBeforeRouteUpdate((to) => {
|
||||
onBeforeRouteUpdate((to, from) => {
|
||||
removeCurrentTagsView(from);
|
||||
state.routePath = to.path;
|
||||
addTagsView(to.path);
|
||||
getTagsRefsIndex(to.path);
|
||||
|
Loading…
Reference in New Issue
Block a user