From 92dd179525767984f89503b53ca0a13a94454457 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 14 Oct 2026 20:31:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?chore(seller):=20=E6=B8=85=E7=90=86?= =?UTF-8?q?=E6=AD=BB=E4=BB=A3=E7=A0=81=E4=B8=8E=E5=A4=B1=E6=95=88=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E7=94=9F=E4=BA=A7=E6=9E=84=E5=BB=BA=E5=89=A5?= =?UTF-8?q?=E7=A6=BB=20console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除零引用组件 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 兜底 --- seller/src/App.vue | 1 - seller/src/libs/util.js | 12 +- seller/src/stores/app.js | 48 -- seller/src/views/Main.vue | 3 - .../components/ServiceAreaFence.vue | 1 - .../goods/goods-seller/alertQuantity.vue | 2 +- .../goods/goods-seller/goodsOperationSec.vue | 181 ------ .../views/lili-components/editor/index.vue | 2 - .../views/lili-components/multiple-region.vue | 1 - seller/src/views/lili-dialog/index.vue | 4 - seller/src/views/lili-dialog/link-dialog.vue | 3 - .../views/lili-dialog/template/category.vue | 1 - .../src/views/lili-dialog/template/pages.vue | 12 - .../src/views/main-components/message-tip.vue | 41 -- .../shrinkable-menu/shrinkable-menu.vue | 4 +- .../main-components/tags-page-opened.vue | 5 +- .../my-components/lili/upload-pic-input.vue | 2 - .../my-components/lili/upload-pic-thumb.vue | 2 - seller/src/views/my-components/map/index.vue | 1 - .../after-order/reurnGoodsOrderDetail.vue | 4 - .../views/order/order/exportOrderDeliver.vue | 4 +- seller/src/views/order/order/orderDetail.vue | 7 - seller/src/views/order/order/orderList.vue | 36 +- seller/src/views/promotion/coupon/coupon.vue | 22 - seller/src/views/promotion/live/addLive.vue | 2 - seller/src/views/promotion/live/liveGoods.vue | 16 - seller/src/views/shop/bill/billDetail.vue | 5 +- .../views/shop/hotzone/components/Zone.vue | 16 +- seller/src/views/shop/modelForm.vue | 5 +- seller/src/views/shop/modelList/forYour.vue | 6 - .../src/views/shop/modelList/goodsAndType.vue | 11 - seller/src/views/shop/modelList/mixModel.vue | 6 - .../shop/modelList/oneRowThreeColumns.vue | 2 - .../views/shop/modelList/onlyGoodsModel.vue | 11 - seller/src/views/shop/modelList/recommend.vue | 1 - seller/src/views/shop/renovation.vue | 4 +- seller/src/views/shop/ship/logistics.vue | 6 - seller/src/views/shop/shopSetting.vue | 36 -- .../department/storeDepartmentManage.vue | 15 - .../shop/system/role/storeRoleManage.vue | 26 - seller/src/views/shop/wap/decorate.vue | 32 +- seller/src/views/shop/wap/index.vue | 2 - seller/src/views/shop/wap/navbar.vue | 51 -- seller/src/views/statistics/order.vue | 31 - .../views/statistics/order/refundOrder.vue | 9 - seller/src/views/sys/oss-manage/ossManage.vue | 553 +----------------- seller/vue.config.js | 8 + 47 files changed, 20 insertions(+), 1233 deletions(-) delete mode 100644 seller/src/views/main-components/message-tip.vue diff --git a/seller/src/App.vue b/seller/src/App.vue index 56c6fe7e5..52a8915b8 100644 --- a/seller/src/App.vue +++ b/seller/src/App.vue @@ -22,7 +22,6 @@ onMounted(() => { util.bootstrapDynamicRoutesFromCache(); util.initRouter(); appStore.setOpenedList(); - appStore.initCachepage(); if (!localStorage.getItem("category")) { getCategoryTree() .then((res) => { diff --git a/seller/src/libs/util.js b/seller/src/libs/util.js index 67f7a4f0d..98d757135 100644 --- a/seller/src/libs/util.js +++ b/seller/src/libs/util.js @@ -313,7 +313,6 @@ util.setCurrentPath = function (name) { ]; } } - appStore.setCurrentPath(currentPathArr); return currentPathArr; }; @@ -351,7 +350,6 @@ util.openNewPage = function (name, argu, query) { appStore.increateTag(tag); } } - appStore.setCurrentPageName(name); }; util.toDefaultPage = function (routers, name, route, next) { @@ -451,16 +449,8 @@ util.initMenuData = function (data) { } appStore.setNavList(navList); let currNav = window.localStorage.getItem("currNav"); - if (currNav) { - for (let item of navList) { - if (item.name == currNav) { - appStore.setCurrNavTitle(item.title); - break; - } - } - } else { + if (!currNav) { currNav = HOME_NAV_NAME; - appStore.setCurrNavTitle(HOME_NAV_ITEM.title); } appStore.setCurrNav(currNav); diff --git a/seller/src/stores/app.js b/seller/src/stores/app.js index 3cda0c3fa..054785eaa 100644 --- a/seller/src/stores/app.js +++ b/seller/src/stores/app.js @@ -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); }, diff --git a/seller/src/views/Main.vue b/seller/src/views/Main.vue index f0d80136d..dd6cce6b0 100644 --- a/seller/src/views/Main.vue +++ b/seller/src/views/Main.vue @@ -93,7 +93,6 @@ import util from "@/libs/util.js"; import { logout } from "@/api/index"; import { getIMDetail } from "@/api/common"; import { userMsg } from "@/api/index"; -import config from "@/config/index.js"; import { Message } from "@/utils/message"; import { getStore, setStore } from "@/libs/storage"; import { useAppStore } from "@/stores/app"; @@ -199,13 +198,11 @@ function resize() { watch( () => route.name, (name) => { - appStore.setCurrentPageName(name); const pathArr = util.setCurrentPath(name); if (pathArr.length > 2) { appStore.addOpenSubmenu(pathArr[1].name); } checkTag(name); - localStorage.currentPageName = name; } ); diff --git a/seller/src/views/appointment/components/ServiceAreaFence.vue b/seller/src/views/appointment/components/ServiceAreaFence.vue index f82aaf997..7982eac3e 100644 --- a/seller/src/views/appointment/components/ServiceAreaFence.vue +++ b/seller/src/views/appointment/components/ServiceAreaFence.vue @@ -73,7 +73,6 @@ let editor = null; let polygon = null; let suggestion = null; let TMap = null; -let geometryId = ""; let draftRing = []; let clickRing = []; let areas = []; diff --git a/seller/src/views/goods/goods-seller/alertQuantity.vue b/seller/src/views/goods/goods-seller/alertQuantity.vue index bba4e82dc..d29b9ffb1 100644 --- a/seller/src/views/goods/goods-seller/alertQuantity.vue +++ b/seller/src/views/goods/goods-seller/alertQuantity.vue @@ -221,7 +221,7 @@ async function exportStock() { navigator.msSaveBlob(blob, randomNumber + ".xlsx"); } }) - .catch((err) => console.log(err)); + .catch(() => {}); } function openImportStock() { importModal.value = true; diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 2859d8ecb..73c060f6f 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -745,8 +745,6 @@ const loadingVideo = ref(false); const listImages = ref([]); const newSkuValues = ref([]); const contentImage = ref(""); -const previewImage = ref(''); // 预览图片地址 -const global = ref(0); const accessToken = ref(""); //令牌token const goodsParams = ref([]); const categoryId = ref(""); // 商品分类第三级id @@ -764,8 +762,6 @@ const previewGoodsPicture = ref(""); const visible = ref(false); //展示商品图片 const goodsPictureVisible = ref(false); -//展示sku图片 -const showSkuPicture = ref(false); //选择的sku const selectedSku = ref({}); @@ -809,47 +805,10 @@ const baseInfoForm = ref({ // 原 Options API 中直接挂在 this 上的非响应式字段 let goodsId; let currentSkuItem = ""; -let form; -let editTitle; -let selectCount; let scrollParent = null; let _onPublishScroll; let _scrollTick = false; let _scrollClickTimer; -let skuIndex; - -const wholesalePreviewColumns = [ - { - title: "销售规则", - width: 480, - render: (h, params) => { - let guide = - "当商品购买数量 ≥" + - params.row.num + - " 时,售价为 ¥" + - params.row.price + - " /" + - baseInfoForm.value.goodsUnit; - return h("div", guide); - }, - }, -]; - -const wholesaleColumns = [ - { - title: "购买数量", - key: "num", - align: "center", - slot: "wholesaleNum", - }, - { - title: "商品单价", - key: "price", - align: "center", - width: "280px", - slot: "wholesalePrice", - }, -]; const wholesaleData = ref([ { @@ -890,7 +849,6 @@ const params_panel = ref([]); /** 存储未通过校验的单元格位置 */ const validateError = ref([]); const currentSkuVal = ref(""); -const skuInfoRules = ref({}); /** 品牌列表 */ const brandList = ref([]); /** 店铺分类列表 */ @@ -1035,13 +993,6 @@ function changeSkuOpenImage() { }) } } -// ship大小不正确 -function handleVideoMaxSize(file) { - Notice.warning({ - title: "超过文件大小限制", - desc: "视频大小不能超过10MB", - }); -} function parseOssSelectionUrl(item) { if (!item) return ""; if (typeof item === "string") { @@ -1108,22 +1059,6 @@ function refresh(v) { getGoodsBrandList('localRefresh'); } } -function getImages(v) { - previewImage.value = v; - visible.value = true; -} -function mouseOver(v) { - showContent.value = true - listImages.value = v - if (listImages.value.images.length <= 0) { - contentImage.value = '规格专属图片暂无' - } else { - contentImage.value = '当前规格专属图片' - } -} -function mouseLeave() { - // showContent.value = false -} function getParamOptions(options) { if (!options) return []; return String(options) @@ -1179,15 +1114,6 @@ function selectParams(params, value, paramsIndex) { // 同步更新表单项的值 params.paramValue = value; } -// 编辑sku图片 -function editSkuPicture(row) { - showContent.value = false - if (row.images && row.images.length > 0) { - previewPicture.value = row.images[0]; - } - selectedSku.value = row; - showSkuPicture.value = true; -} // 初始化视频操作 async function initVideo() { if (baseInfoForm.value.goodsVideo) { @@ -1349,17 +1275,6 @@ function assignSkuTableIndex() { row._index = index; }); } -// 更新sku图片 -function updateSkuPicture() { - baseInfoForm.value.regeneratorSkuFlag = true; - let _index = selectedSku.value._index; - if (_index === undefined || _index === null) { - _index = skuTableData.value.indexOf(selectedSku.value); - } - if (_index >= 0) { - skuTableData.value[_index] = selectedSku.value; - } -} // sku图片上传成功 function handleSuccess(res, file, images) { if (file.response) { @@ -1460,20 +1375,6 @@ function checkWholesalePrice(index) { renderTableData(skuTableData.value); syncWholesalePriceToSku(); } -// 商品图片上传成功 -function handleSuccessGoodsPicture(res, file) { - if (file.response) { - file.url = file.response.result; - baseInfoForm.value.goodsGalleryFiles.push(file.url); - } -} -// 图片格式不正确 -function handleFormatError(file) { - Notice.warning({ - title: "文件格式不正确", - desc: "文件 " + file.name + " 的格式不正确", - }); -} function beforeVideoUpload(file) { const allowTypes = ["avi", "wmv", "mpeg", "mp4", "mov"]; const ext = (file.name.split(".").pop() || "").toLowerCase(); @@ -1510,16 +1411,6 @@ function handleMaxSize(size = 2) { desc: `图片大小不能超过${size}MB`, }); } -// 图片上传前钩子 -function handleBeforeUploadGoodsPicture(file) { - const check = baseInfoForm.value.goodsGalleryFiles.length < 5; - if (!check) { - Notice.warning({ - title: "图片数量不能大于五张", - }); - return false; - } -} // sku图片上传前钩子 function handleBeforeUpload(file) { const check = @@ -2189,11 +2080,6 @@ function addSpec($index, item) { skuInfoCopy.value = cloneObj(skuInfo.value); } } -function handleClearSku() { - skuInfo.value = []; - skuTableData.value = []; - renderTableData(skuTableData.value); -} /** 移除当前规格值 */ function handleCloseSkuValue(item, index, spec) { if (spec.spec_values.length <= 1) { @@ -2363,55 +2249,6 @@ function renderTableData(skus) { } } -/** - * 迭代属性,形成表格 - * result 渲染的数据 - * array spec数据 - */ -function specIterator(result, spec, skus) { - let table = result; - if (spec.length > 0) { - //清除当前循环的分组 - let cloneTemp = cloneObj(spec); - cloneTemp.shift(); - spec[0].spec_values.forEach((specItem) => { - let index = skuIndex; - if (table[index]) { - table[index][spec[0].name] = specItem.value; - } else if (skus && skus[index] && specItem.value !== "") { - let obj = { - ...skus[index], - id: skus[index].id, - sn: skus[index].sn, - quantity: skus[index].quantity, - cost: skus[index].cost, - price: skus[index].price, - // [spec[0].name]: skus[index][spec[0].name] ? skus[index][spec[0].name] : specItem.value, - [spec[0].name]: specItem.value, - images: - skus[index].images || baseInfoForm.value.goodsGalleryFiles || [], - }; - if (specItem.value !== "") { - obj.id = skus[index].id; - } - if (skus[index].weight !== "") { - obj.weight = skus[index].weight; - } - table.push(obj); - } else if (specItem.value !== "") { - table.push({ - [spec[0].name]: specItem.value, - images: baseInfoForm.value.goodsGalleryFiles || [], - }); - } - - table = specIterator(table, cloneTemp, skus, index); - }); - } else { - skuIndex++; - } - return table; -} /** * 生成所有可能的规格组合 * @param {Array} skuInfo 规格信息 @@ -2469,19 +2306,6 @@ function generateSkuCombinations(skuInfo) { return generateCombinations(0, []); } -// 判断相同数组的值 -function scalarArrayEquals(array1, array2) { - return ( - array1.length === array2.length && - array1.every(function (v, i) { - return v === array2[i]; - }) - ); -} -/** 自动完成表单所需方法*/ -function filterMethod(value, option) { - return option.toUpperCase().indexOf(value.toUpperCase()) !== -1; -} /** 数据改变之后 抛出数据 */ function updateSkuTable(row, item, rowIndex) { let index = rowIndex; @@ -2535,15 +2359,10 @@ function selectTree(v) { v[0][attr] = ""; } } - let str = JSON.stringify(v[0]); - let menu = JSON.parse(str); - form = menu; - editTitle = menu.title; } } // 店内分类选中 function changeSelect(v) { - selectCount = v.length; let ids = ""; v.forEach(function (e) { ids += e.id + ","; diff --git a/seller/src/views/lili-components/editor/index.vue b/seller/src/views/lili-components/editor/index.vue index afd1854b9..728fecae4 100644 --- a/seller/src/views/lili-components/editor/index.vue +++ b/seller/src/views/lili-components/editor/index.vue @@ -48,8 +48,6 @@ const pendingContent = ref(null); // 编辑器未就绪时暂存待回填内容 const tinymceId = "tinymce-" + +new Date() + ((Math.random() * 1000).toFixed(0) + ""); // 生成唯一的编辑器 ID const fullscreen = ref(false); // 标记编辑器是否处于全屏模式 -const toolbar = ref([]); // 工具栏配置 -const content = ref(""); // 编辑器内容 const bindValue = computed(() => { return props.modelValue ?? props.value ?? ""; diff --git a/seller/src/views/lili-components/multiple-region.vue b/seller/src/views/lili-components/multiple-region.vue index f9864f00d..da98b25ad 100644 --- a/seller/src/views/lili-components/multiple-region.vue +++ b/seller/src/views/lili-components/multiple-region.vue @@ -37,7 +37,6 @@ const switched = ref(false); const spinShow = ref(false); const data = ref([]); const selectedWay = ref([]); -const callBackData = ref(""); const treeProps = reactive({ label: "title", children: "children", diff --git a/seller/src/views/lili-dialog/index.vue b/seller/src/views/lili-dialog/index.vue index 1b5d415d7..b82daffd5 100755 --- a/seller/src/views/lili-dialog/index.vue +++ b/seller/src/views/lili-dialog/index.vue @@ -122,10 +122,6 @@ function open(type, mutiple) { linkVisible.value = true; } } -function close() { - clickClose(); -} - // 外部通过 ref 访问的成员(grep seller/src 全量确认): // - open:所有调用方打开弹窗(goods/link) // - singleGoods:shop/modelList/forYour.vue、mixModel.vue 直接调用 diff --git a/seller/src/views/lili-dialog/link-dialog.vue b/seller/src/views/lili-dialog/link-dialog.vue index 7a22c367b..0d4acf5c8 100755 --- a/seller/src/views/lili-dialog/link-dialog.vue +++ b/seller/src/views/lili-dialog/link-dialog.vue @@ -23,14 +23,11 @@