2025-01-25 02:48:00 +00:00
|
|
|
<!--
|
|
|
|
* @Description:
|
|
|
|
* @Author: zenghua.wang
|
|
|
|
* @Date: 2024-01-24 18:54:01
|
|
|
|
* @LastEditors: zenghua.wang
|
2025-04-14 02:39:31 +01:00
|
|
|
* @LastEditTime: 2025-02-28 11:31:12
|
2025-01-25 02:48:00 +00:00
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<el-config-provider :size="size" :locale="zhCn">
|
|
|
|
<router-view />
|
|
|
|
</el-config-provider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="app">
|
2025-08-28 10:39:34 +08:00
|
|
|
import { computed, onMounted, ref } from 'vue';
|
2025-01-25 02:48:00 +00:00
|
|
|
import { useSettingStore } from '@/store/modules/setting';
|
|
|
|
// 配置element中文
|
|
|
|
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
|
|
|
|
|
|
const SettingStore = useSettingStore();
|
|
|
|
// 配置全局组件大小
|
|
|
|
const size = computed(() => SettingStore.themeConfig.globalComSize);
|
2025-08-28 10:39:34 +08:00
|
|
|
|
|
|
|
const meuns = ref([
|
|
|
|
{
|
|
|
|
label: '智慧种植',
|
|
|
|
path: '/sub-operation-service/smartFarm',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '电商交易',
|
|
|
|
path: '/sub-operation-service/ecommerce',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '农事服务',
|
|
|
|
path: '/sub-operation-service/farmService',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '分拣包装',
|
|
|
|
path: '/sub-operation-service/packaging',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '仓储物流',
|
|
|
|
path: '/sub-operation-service/warehouseLogistics',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '涉农金融',
|
|
|
|
path: '/sub-operation-service/finance',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '公共品牌',
|
|
|
|
path: '/sub-operation-service/brand',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '综合看板',
|
|
|
|
path: '/sub-operation-service/dashboard',
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
import { useMenuStore } from '@/store/modules/menuStore';
|
|
|
|
const route = useRoute();
|
|
|
|
const menuStore = useMenuStore();
|
|
|
|
onMounted(() => {
|
|
|
|
let item = meuns.value.find((item) => route.path.indexOf(item.path) > -1);
|
|
|
|
console.log('item', item);
|
|
|
|
if (item) {
|
|
|
|
menuStore.setMenuLabel(item.label);
|
|
|
|
menuStore.setMenuPath(item.path);
|
|
|
|
} else {
|
|
|
|
menuStore.setMenuLabel('智慧种植');
|
|
|
|
menuStore.setMenuPath('/sub-operation-service/smartFarm');
|
|
|
|
}
|
|
|
|
console.log(menuStore.activeMenuLabel);
|
|
|
|
console.log(menuStore.activeMenuPath);
|
|
|
|
});
|
2025-01-25 02:48:00 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2025-04-14 02:39:31 +01:00
|
|
|
@import './styles/style';
|
2025-01-25 02:48:00 +00:00
|
|
|
</style>
|