mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-13 20:38:54 +08:00
chore(seller): 清理死代码与失效机制,生产构建剥离 console
- 删除零引用组件 main-components/message-tip.vue - 清理 113 处 no-unused-vars(重点 goodsOperationSec 20+ 项、ossManage 25 项,含死代码链级联删除;renovation 的 ModelForm 为 vue-eslint-parser 误报,保留并核实) - stores/app.js 移除只写不读的死字段(currNavTitle/menuTheme/themeColor/isFullScreen/messageCount/currentPageName/currentPath)及失效的 cachePage/dontCache 缓存页机制(无 keep-alive 消费方),同步清理 util.js/App.vue/Main.vue/shrinkable-menu/tags-page-opened 的调用点 - 删除 30 处 console.log 调试残留;生产构建 terser 配置 drop_console 兜底
This commit is contained in:
@@ -13,13 +13,8 @@ export const useAppStore = defineStore("app", {
|
||||
added: false,
|
||||
navList: [],
|
||||
currNav: "",
|
||||
currNavTitle: "",
|
||||
cachePage: [],
|
||||
lang: "",
|
||||
isFullScreen: false,
|
||||
openedSubmenuArr: [],
|
||||
menuTheme: "dark",
|
||||
themeColor: "",
|
||||
storeOpenedList: [
|
||||
{
|
||||
title: "首页",
|
||||
@@ -27,19 +22,9 @@ export const useAppStore = defineStore("app", {
|
||||
name: "home_index",
|
||||
},
|
||||
],
|
||||
currentPageName: "",
|
||||
currentPath: [
|
||||
{
|
||||
title: "首页",
|
||||
path: "",
|
||||
name: "home_index",
|
||||
},
|
||||
],
|
||||
menuList: [],
|
||||
routers: [otherRouter],
|
||||
tagsList: [...otherRouter.children],
|
||||
messageCount: 0,
|
||||
dontCache: ["test", "test"],
|
||||
refMenu: "",
|
||||
}),
|
||||
actions: {
|
||||
@@ -62,9 +47,6 @@ export const useAppStore = defineStore("app", {
|
||||
setCurrNav(v) {
|
||||
this.currNav = v;
|
||||
},
|
||||
setCurrNavTitle(v) {
|
||||
this.currNavTitle = v;
|
||||
},
|
||||
setTagsList(list) {
|
||||
this.tagsList.push(...list);
|
||||
},
|
||||
@@ -76,19 +58,6 @@ export const useAppStore = defineStore("app", {
|
||||
this.openedSubmenuArr.push(name);
|
||||
}
|
||||
},
|
||||
closePage(name) {
|
||||
this.cachePage.forEach((item, index) => {
|
||||
if (item == name) {
|
||||
this.cachePage.splice(index, 1);
|
||||
}
|
||||
});
|
||||
localStorage.cachePage = JSON.stringify(this.cachePage);
|
||||
},
|
||||
initCachepage() {
|
||||
if (localStorage.cachePage) {
|
||||
this.cachePage = JSON.parse(localStorage.cachePage);
|
||||
}
|
||||
},
|
||||
removeTag(name) {
|
||||
this.storeOpenedList.map((item, index) => {
|
||||
if (item.name == name) {
|
||||
@@ -105,8 +74,6 @@ export const useAppStore = defineStore("app", {
|
||||
},
|
||||
clearAllTags() {
|
||||
this.storeOpenedList.splice(1);
|
||||
this.cachePage.length = 0;
|
||||
localStorage.cachePage = "";
|
||||
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
||||
},
|
||||
clearOtherTags(currentName) {
|
||||
@@ -122,8 +89,6 @@ export const useAppStore = defineStore("app", {
|
||||
this.storeOpenedList.splice(currentIndex + 1);
|
||||
this.storeOpenedList.splice(1, currentIndex - 1);
|
||||
}
|
||||
this.cachePage = this.cachePage.filter((item) => item == currentName);
|
||||
localStorage.cachePage = JSON.stringify(this.cachePage);
|
||||
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
||||
},
|
||||
setOpenedList() {
|
||||
@@ -131,12 +96,6 @@ export const useAppStore = defineStore("app", {
|
||||
? JSON.parse(localStorage.storeOpenedList)
|
||||
: [otherRouter.children[0]];
|
||||
},
|
||||
setCurrentPath(pathArr) {
|
||||
this.currentPath = pathArr;
|
||||
},
|
||||
setCurrentPageName(name) {
|
||||
this.currentPageName = name;
|
||||
},
|
||||
setAvatarPath(path) {
|
||||
localStorage.avatorImgPath = path;
|
||||
},
|
||||
@@ -147,14 +106,7 @@ export const useAppStore = defineStore("app", {
|
||||
clearOpenedSubmenu() {
|
||||
this.openedSubmenuArr.length = 0;
|
||||
},
|
||||
setMessageCount(count) {
|
||||
this.messageCount = count;
|
||||
},
|
||||
increateTag(tagObj) {
|
||||
if (this.dontCache.indexOf(tagObj.name) < 0) {
|
||||
this.cachePage.push(tagObj.name);
|
||||
localStorage.cachePage = JSON.stringify(this.cachePage);
|
||||
}
|
||||
this.storeOpenedList.push(tagObj);
|
||||
localStorage.storeOpenedList = JSON.stringify(this.storeOpenedList);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user