|
@@ -9,13 +9,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref } from 'vue';
|
|
|
|
|
-import { getThirdMenuData } from '@/common/setup/table/button';
|
|
|
|
|
-import { TabList } from '@/common/components/description/interface';
|
|
|
|
|
|
|
+import { defineComponent } from 'vue';
|
|
|
import ThridMenu from '@/common/components/thirdMenu/index.vue';
|
|
import ThridMenu from '@/common/components/thirdMenu/index.vue';
|
|
|
-import { useRoute, useRouter } from 'vue-router';
|
|
|
|
|
-import { initData } from '@/common/methods';
|
|
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
|
|
+import { handleMartketThirdRouter } from '@/common/setup/matket/router';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: EnumRouterName.warehouse_receipt_trade,
|
|
name: EnumRouterName.warehouse_receipt_trade,
|
|
@@ -23,34 +20,7 @@ export default defineComponent({
|
|
|
ThridMenu,
|
|
ThridMenu,
|
|
|
},
|
|
},
|
|
|
setup() {
|
|
setup() {
|
|
|
- const list = getThirdMenuData();
|
|
|
|
|
- const item = list.find((e) => e.code === EnumRouterName.warehouse_receipt_trade);
|
|
|
|
|
- const tabList = item
|
|
|
|
|
- ? item.children.map((e) => {
|
|
|
|
|
- return { lable: e.title, code: e.code };
|
|
|
|
|
- })
|
|
|
|
|
- : [];
|
|
|
|
|
- const router = useRouter();
|
|
|
|
|
- const route = useRoute();
|
|
|
|
|
- const index = ref<string>('0');
|
|
|
|
|
- initData(() => {
|
|
|
|
|
- if (tabList.length) {
|
|
|
|
|
- const name = route.name as string;
|
|
|
|
|
- const result = tabList.findIndex((e) => e.code === name);
|
|
|
|
|
- // 处理页面刷新
|
|
|
|
|
- if (result !== -1) {
|
|
|
|
|
- router.push({ name });
|
|
|
|
|
- index.value = result.toString();
|
|
|
|
|
- } else {
|
|
|
|
|
- router.push({ name: tabList[0].code });
|
|
|
|
|
- index.value = '0';
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- function changeTab(index: number, current: TabList) {
|
|
|
|
|
- router.push({ name: current.code });
|
|
|
|
|
- }
|
|
|
|
|
- return { tabList, changeTab, index };
|
|
|
|
|
|
|
+ return { ...handleMartketThirdRouter(EnumRouterName.warehouse_receipt_trade) };
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|