fix: 🧩 修复bug
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<!-- <el-icon v-show="item.meta.icon && globalStore.breadcrumbIcon" class="breadcrumb-icon">
|
||||
<component :is="item.meta.icon"></component>
|
||||
</el-icon> -->
|
||||
|
||||
<!-- {{ breadcrumbList }} -->
|
||||
<span class="breadcrumb-title">{{ item.meta.title }}</span>
|
||||
</div>
|
||||
</el-breadcrumb-item>
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -10,4 +10,5 @@ export interface TabsMenuProps {
|
||||
/* TabsState */
|
||||
export interface TabsState {
|
||||
tabsMenuList: TabsMenuProps[];
|
||||
isSubscribeAdd: Boolean;
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user