From 0861dae12d172b68f7b7e35ab27973a005f3faa2 Mon Sep 17 00:00:00 2001 From: yangchunlong <292345300@qq.com> Date: Mon, 20 Oct 2025 11:50:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A7=A9=20=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- .../Header/components/Breadcrumb.vue | 13 +++++- src/layouts/components/Tabs/index.vue | 1 + src/stores/interface/tabs.ts | 1 + src/stores/modules/tabs.ts | 5 ++ src/views/foundation/subscribe/list/add.vue | 46 ++++++++++++------- 6 files changed, 48 insertions(+), 20 deletions(-) diff --git a/.env.production b/.env.production index 77769eb..f0c633d 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,6 @@ ENV = 'production' VITE_APP_API_VERSION = "" #版本号 -VITE_APP_API_BASEURL = https://opsscmapi.f2b211.com/api/ #请求地址 +VITE_APP_API_BASEURL = https://newwms.api.f2b211.com/ #请求地址 VITE_APP_SSO_LOGINURL = https://uc.v3.f2b211.com/uc/login VITE_APP_SSO_APPID = 100664627590856707 diff --git a/src/layouts/components/Header/components/Breadcrumb.vue b/src/layouts/components/Header/components/Breadcrumb.vue index caf1619..fadb4d1 100644 --- a/src/layouts/components/Header/components/Breadcrumb.vue +++ b/src/layouts/components/Header/components/Breadcrumb.vue @@ -7,7 +7,7 @@ - + {{ item.meta.title }} @@ -28,13 +28,22 @@ const route = useRoute(); const router = useRouter(); const authStore = useAuthStore(); const globalStore = useGlobalStore(); - +// const routeName: any = ref(router.currentRoute.value.name); const breadcrumbList = computed(() => { let breadcrumbData = authStore.breadcrumbListGet[route.matched[route.matched.length - 1].path] ?? []; // 🙅‍♀️不需要首页面包屑可删除以下判断 if (breadcrumbData[0].path !== HOME_URL) { breadcrumbData = [{ path: HOME_URL, meta: { icon: "HomeFilled", title: "首页" } }, ...breadcrumbData]; } + if (route.query.title === "新增订阅" || "编辑订阅") { + breadcrumbData.forEach((item: any) => { + if (item.name === "foundationSubscribeListAdd") { + item.meta.title = route.query.title; + } + }); + console.log(""); + } + return breadcrumbData; }); diff --git a/src/layouts/components/Tabs/index.vue b/src/layouts/components/Tabs/index.vue index 01bc1de..0eeab15 100644 --- a/src/layouts/components/Tabs/index.vue +++ b/src/layouts/components/Tabs/index.vue @@ -55,6 +55,7 @@ watch( () => { if (route.meta.isFull) return; tabsMenuValue.value = route.fullPath; + let title: any = route.query.title ? route.query.title : route.meta.title; const tabsParams = { diff --git a/src/stores/interface/tabs.ts b/src/stores/interface/tabs.ts index aefaf6b..8edb3f5 100644 --- a/src/stores/interface/tabs.ts +++ b/src/stores/interface/tabs.ts @@ -10,4 +10,5 @@ export interface TabsMenuProps { /* TabsState */ export interface TabsState { tabsMenuList: TabsMenuProps[]; + isSubscribeAdd: Boolean; } diff --git a/src/stores/modules/tabs.ts b/src/stores/modules/tabs.ts index fecf151..79b654f 100644 --- a/src/stores/modules/tabs.ts +++ b/src/stores/modules/tabs.ts @@ -6,6 +6,7 @@ import piniaPersistConfig from "@/config/piniaPersist"; export const useTabsStore = defineStore({ id: "wms-tabs", state: (): TabsState => ({ + isSubscribeAdd: false, tabsMenuList: [ { icon: "", // 首页的icon,按实际路由meta.icon填写(如"Home") @@ -133,6 +134,10 @@ export const useTabsStore = defineStore({ this.tabsMenuList.forEach(item => { if (item.path == nowFullPath) item.title = title; }); + }, + async setSIsSubscribeAdd(is: any) { + console.log(is, "==========is========"); + this.isSubscribeAdd = is; } }, persist: piniaPersistConfig("wms-tabs") diff --git a/src/views/foundation/subscribe/list/add.vue b/src/views/foundation/subscribe/list/add.vue index a966282..91bf365 100644 --- a/src/views/foundation/subscribe/list/add.vue +++ b/src/views/foundation/subscribe/list/add.vue @@ -31,6 +31,8 @@ import { BUTTON } from "./constant/add/button"; import { useUserStore } from "@/stores/modules/user"; import { cloneDeep } from "lodash-es"; import $Bus from "@/utils/mittBus"; +// import { useTabsStore } from "@/stores/modules/tabs"; +// const tabStore = useTabsStore(); const dataStore = reactive({ formData: cloneDeep(FORM_DATA), ruleForm: cloneDeep(RULE_FORM), @@ -53,24 +55,34 @@ const init = () => { init(); //新增 const handleAdd = () => { - if ( - dataStore.ruleForm?.customer_number?.length || - dataStore.ruleForm?.org_number || - dataStore.ruleForm?.product_lines || - dataStore.ruleForm?.subscriber_dduid - ) { - ElMessageBox.confirm("当前数据未提交, 确认放弃新增数据?", "温馨提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(async () => { - dataStore.ruleForm = cloneDeep(RULE_FORM); - dataStore.ruleForm.org_number = ["101"]; - dataStore.isAdd = true; - detailsRef?.value?.formElement?.resetFields(); + if ($route.query.title === "编辑订阅") { + $router.replace({ + path: "/foundation/subscribe/list/add", + query: { + title: "新增订阅" + } + }); + } + if ($route.query.title === "新增订阅") { + if ( + dataStore.ruleForm?.customer_number?.length || + dataStore.ruleForm?.org_number || + dataStore.ruleForm?.product_lines || + dataStore.ruleForm?.subscriber_dduid + ) { + ElMessageBox.confirm("当前数据未提交, 确认放弃新增数据?", "温馨提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" }) - .catch(() => {}); + .then(async () => { + dataStore.ruleForm = cloneDeep(RULE_FORM); + dataStore.ruleForm.org_number = ["101"]; + dataStore.isAdd = true; + detailsRef?.value?.formElement?.resetFields(); + }) + .catch(() => {}); + } } }; const handleGoList = () => {