mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +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 '*.jpg';
|
||||||
declare module '*.scss';
|
declare module '*.scss';
|
||||||
declare module '*.ts';
|
declare module '*.ts';
|
||||||
declare module 'qrcodejs2-fixes';
|
declare module '*.js';
|
||||||
declare module 'element-plus';
|
|
||||||
declare module 'element-plus/lib/locale/lang/zh-cn';
|
|
||||||
|
@ -5,7 +5,7 @@ import router, { resetRoute } from '/@/router/index.ts';
|
|||||||
|
|
||||||
// 配置新建一个 axios 实例
|
// 配置新建一个 axios 实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: 'http://localhost:10000/',
|
baseURL: import.meta.env.VITE_API_URL as any,
|
||||||
timeout: 50000,
|
timeout: 50000,
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
});
|
});
|
||||||
|
@ -107,7 +107,7 @@ export default {
|
|||||||
if (state.tagsViewList.some((v: any) => v.path === path)) return false;
|
if (state.tagsViewList.some((v: any) => v.path === path)) return false;
|
||||||
const item = state.tagsViewRoutesList.find((v: any) => v.path === path);
|
const item = state.tagsViewRoutesList.find((v: any) => v.path === path);
|
||||||
if (item.meta.isLink && !item.meta.isIframe) return false;
|
if (item.meta.isLink && !item.meta.isIframe) return false;
|
||||||
if (!item.meta.isHide) state.tagsViewList.push({ ...item });
|
state.tagsViewList.push({ ...item });
|
||||||
addBrowserSetSession(state.tagsViewList);
|
addBrowserSetSession(state.tagsViewList);
|
||||||
};
|
};
|
||||||
// 2、刷新当前 tagsView:
|
// 2、刷新当前 tagsView:
|
||||||
@ -157,6 +157,16 @@ export default {
|
|||||||
screenfulls.request(element);
|
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) => {
|
const onCurrentContextmenuClick = (data: any) => {
|
||||||
let { id, path } = data;
|
let { id, path } = data;
|
||||||
@ -318,7 +328,8 @@ export default {
|
|||||||
initSortable();
|
initSortable();
|
||||||
});
|
});
|
||||||
// 路由更新时
|
// 路由更新时
|
||||||
onBeforeRouteUpdate((to) => {
|
onBeforeRouteUpdate((to, from) => {
|
||||||
|
removeCurrentTagsView(from);
|
||||||
state.routePath = to.path;
|
state.routePath = to.path;
|
||||||
addTagsView(to.path);
|
addTagsView(to.path);
|
||||||
getTagsRefsIndex(to.path);
|
getTagsRefsIndex(to.path);
|
||||||
|
Loading…
Reference in New Issue
Block a user