From a72ff640ccf500e2ea589718ad66f2e3ff38b4fe Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Thu, 23 Jul 2026 09:29:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(ossManage):=20=E8=BF=9B=E8=A1=8C=E5=95=86?= =?UTF-8?q?=E5=AE=B6=20=E7=B4=A0=E6=9D=90=E7=AE=A1=E7=90=86=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=B9=E9=80=A0=E4=B8=8E=E7=95=8C=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seller/scripts/copy-manager-migrations.js | 31 +- seller/src/libs/routerJson.js | 15 + .../goods/goods-seller/goodsOperationSec.vue | 4 +- .../lili-components/editor/upload-image.vue | 3 +- .../my-components/lili/upload-pic-input.vue | 3 +- .../my-components/lili/upload-pic-thumb.vue | 3 +- .../views/shop/hotzone/components/Zone.vue | 2 +- .../src/views/sys/oss-manage/ossManage.scss | 196 ++-- seller/src/views/sys/oss-manage/ossManage.vue | 1011 +++++++++++++---- 9 files changed, 885 insertions(+), 383 deletions(-) diff --git a/seller/scripts/copy-manager-migrations.js b/seller/scripts/copy-manager-migrations.js index 7e1c7bcc..c5868fcb 100644 --- a/seller/scripts/copy-manager-migrations.js +++ b/seller/scripts/copy-manager-migrations.js @@ -93,11 +93,32 @@ function adaptForSeller(content, sellerRel, sellerOriginal) { c = c.replace(/userInfoManager/g, "userInfoSeller"); c = c.replace(/JSON\.parse\(Cookies\.get\("userInfoManager"\)\)/g, 'JSON.parse(Cookies.get("userInfoSeller"))'); - // ossManage seller variant - hide role tabs, use STORE only - if (sellerRel.includes("shop/ossManage.vue")) { - c = c.replace(/[\s\S]*?/, - ''); - c = c.replace(/activeRoleTab: "MANAGER"/, 'activeRoleTab: "STORE"'); + // 从平台同步 ossManage 时,转换为商家版:去掉多角色 Tab、改用 sellerUrl 与 STORE 身份 + if (sellerRel.includes("oss-manage/ossManage") || sellerRel.includes("shop/ossManage")) { + c = c.replace( + /[\s\S]*?<\/el-card>\s*/, + "" + ); + c = c.replace(/managerApiUrl/g, "sellerUrl"); + c = c.replace(/\/manager\/common\/upload\/file/g, "/store/common/upload/file"); + c = c.replace(/activeRoleTab: "MANAGER"/g, 'activeRoleTab: "STORE"'); + c = c.replace(/userEnums: "MANAGER"/g, 'userEnums: "STORE"'); + c = c.replace( + /return this\.activeRoleTab === "MANAGER";/g, + 'return this.activeRoleTab === "STORE";' + ); + c = c.replace( + /this\.activeRoleTab = "MANAGER";\s*\n\s*this\.searchForm\.userEnums = "MANAGER";/g, + 'this.activeRoleTab = "STORE";\n this.searchForm.userEnums = "STORE";' + ); + c = c.replace( + /ElMessage\.warning\("仅管理员模块支持上传图片"\)/g, + 'ElMessage.warning("当前模块不支持上传")' + ); + c = c.replace( + /import \{managerApiUrl\} from "@\/libs\/axios";/, + 'import {sellerUrl} from "@/libs/axios";' + ); } return c; diff --git a/seller/src/libs/routerJson.js b/seller/src/libs/routerJson.js index 188cdc5e..c7cd02e6 100644 --- a/seller/src/libs/routerJson.js +++ b/seller/src/libs/routerJson.js @@ -499,6 +499,21 @@ export const result = [{ children: null }, + { + name: "ossManage", + level: 2, + type: 0, + title: "素材管理", + path: "ossManage", + component: "sys/oss-manage/ossManage", + /** + * 运行时菜单来自 li_store_menu,此处仅为静态参考。 + * 平台后台「店铺菜单」配置: + * frontRoute = sys/oss-manage/ossManage + * permission = /store/common/file*,/store/common/fileDirectory*,/store/common/upload* + */ + children: null + }, // { // name: "shopAddress", // level: 2, diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 94a15feb..ec94a0ae 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -508,6 +508,7 @@ :isComponent="true" :initialize="picModelFlag" :max-select="selectedFormBtnName === 'goodsGalleryFiles' ? 1 : 0" + :hide-select-footer="true" @callback="callbackSelected" @selected="(list) => { selectedImage = list }" /> @@ -530,8 +531,7 @@ import tinymec from "@/views/lili-components/editor/index.vue"; import { uploadFile } from "@/libs/axios"; import { regular } from "@/utils"; import DPlayer from 'dplayer'; -// import ossManage from "@/views/sys/oss-manage/ossManage"; -import ossManage from "@/views/shop/ossManages"; +import ossManage from "@/views/sys/oss-manage/ossManage"; export default { diff --git a/seller/src/views/lili-components/editor/upload-image.vue b/seller/src/views/lili-components/editor/upload-image.vue index aea4150c..23278032 100644 --- a/seller/src/views/lili-components/editor/upload-image.vue +++ b/seller/src/views/lili-components/editor/upload-image.vue @@ -67,6 +67,7 @@ ref="ossManage" :is-component="true" :initialize="showOssManager" + :hide-select-footer="true" @selected="handleOssSelected" />