|
@@ -53,51 +53,27 @@ export default defineComponent({
|
|
|
const isBottom = getHasBottom();
|
|
const isBottom = getHasBottom();
|
|
|
// 选中菜单
|
|
// 选中菜单
|
|
|
function chooseMenu(value: OperationTabMenu) {
|
|
function chooseMenu(value: OperationTabMenu) {
|
|
|
- const matched = route.matched;
|
|
|
|
|
- const len = matched.length;
|
|
|
|
|
- let temp = 'home';
|
|
|
|
|
- if (matched.length > 2) {
|
|
|
|
|
- temp = matched[2].name as string;
|
|
|
|
|
- } else {
|
|
|
|
|
- temp = matched[len - 1].name as string;
|
|
|
|
|
- }
|
|
|
|
|
- let name = temp;
|
|
|
|
|
-
|
|
|
|
|
- if (temp === 'home') {
|
|
|
|
|
- // 第一次进入项目
|
|
|
|
|
- if (value?.code === 'market_spot') {
|
|
|
|
|
- // 现货市场
|
|
|
|
|
- router.push({ name: 'marketSpot' });
|
|
|
|
|
- return
|
|
|
|
|
- } else if (value?.children.length) {
|
|
|
|
|
- // 默认第一个tab页
|
|
|
|
|
|
|
+ let name = 'home';
|
|
|
|
|
+ if (value.children && value.children.length) {
|
|
|
|
|
+ if (route.name === 'home') {
|
|
|
name = value.children[0].code;
|
|
name = value.children[0].code;
|
|
|
index.value = ['0'];
|
|
index.value = ['0'];
|
|
|
} else {
|
|
} else {
|
|
|
- router.push({ name: '404' });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // 这里处理页面刷新,还原 导航栏数据
|
|
|
|
|
- const i = value.children.findIndex((e) => e.code === temp);
|
|
|
|
|
- if (i === -1) {
|
|
|
|
|
- if (value?.code === 'market_spot') {
|
|
|
|
|
- // 现货市场
|
|
|
|
|
- router.push({ name: 'marketSpot' });
|
|
|
|
|
- return
|
|
|
|
|
- } else if (value?.children.length) {
|
|
|
|
|
|
|
+ const i = value.children.findIndex((e) => e.code === route.name);
|
|
|
|
|
+ if (i === -1) {
|
|
|
// 切换左边菜单栏
|
|
// 切换左边菜单栏
|
|
|
// 默认第一个tab页
|
|
// 默认第一个tab页
|
|
|
name = value.children[0].code;
|
|
name = value.children[0].code;
|
|
|
index.value = ['0'];
|
|
index.value = ['0'];
|
|
|
} else {
|
|
} else {
|
|
|
- router.push({ name: '404' });
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ // 切换右边上面tab 栏
|
|
|
|
|
+ name = value.children[i].code;
|
|
|
|
|
+ index.value = [i.toString()];
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- // 切换右边上面tab 栏
|
|
|
|
|
- index.value = [`${i}`];
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ name = value.code;
|
|
|
|
|
+ index.value = ['0'];
|
|
|
}
|
|
}
|
|
|
list.value = value.children;
|
|
list.value = value.children;
|
|
|
setShowBottomPart(value.code);
|
|
setShowBottomPart(value.code);
|