|
@@ -28,7 +28,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
- import { computed } from 'vue';
|
|
|
|
|
|
|
+ import { computed, ref, onMounted } from 'vue';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
import UpdatePwd from '@/components/UpdatePwd.vue';
|
|
import UpdatePwd from '@/components/UpdatePwd.vue';
|
|
|
import UserInfo from '@/components/UserInfo.vue';
|
|
import UserInfo from '@/components/UserInfo.vue';
|
|
@@ -42,6 +42,10 @@
|
|
|
import logo from 'assets/images/home/comac-logo@1X.png';
|
|
import logo from 'assets/images/home/comac-logo@1X.png';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
import { storeToRefs } from 'pinia';
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
|
+ // import { generatorDynamicRouter } from '@/router/generator-routers';
|
|
|
|
|
+ import { useAsyncRouteStore } from '@/store/modules/asyncRoute';
|
|
|
|
|
+
|
|
|
|
|
+ const asyncRouteStore = useAsyncRouteStore();
|
|
|
// import searchIcon from 'assets/svg/search.svg';
|
|
// import searchIcon from 'assets/svg/search.svg';
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
@@ -60,8 +64,19 @@
|
|
|
|
|
|
|
|
const currentRoute = useRoute();
|
|
const currentRoute = useRoute();
|
|
|
const { title } = useGlobSetting();
|
|
const { title } = useGlobSetting();
|
|
|
|
|
+// const accessedRouters = ref('')
|
|
|
|
|
+// const getRouter = async ()=>{
|
|
|
|
|
+// console.log(asyncRouteStore, 'asyncRouteStore')
|
|
|
|
|
+// console.log(asyncRouteStore.$state.menus[1], 'asyncRouteStore1')
|
|
|
|
|
+// // accessedRouters.value = asyncRouteStore.$state.menus[1].path
|
|
|
|
|
+// };
|
|
|
|
|
+
|
|
|
|
|
+// onMounted(()=>{
|
|
|
|
|
+// getRouter()
|
|
|
|
|
+// })
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- const handleNavClick = (item: { name: string; path: string; meta?: any }) => {
|
|
|
|
|
|
|
+ const handleNavClick = async (item: { name: string; path: string; meta?: any }) => {
|
|
|
if (item.meta?.isExternalLink) {
|
|
if (item.meta?.isExternalLink) {
|
|
|
if (item.path === '403') {
|
|
if (item.path === '403') {
|
|
|
router.replace(item.path);
|
|
router.replace(item.path);
|
|
@@ -70,6 +85,15 @@
|
|
|
window.open(item.path, '_blank');
|
|
window.open(item.path, '_blank');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 生产安全路由跳转
|
|
|
|
|
+ // if(item.name==="WorkSafety"){
|
|
|
|
|
+
|
|
|
|
|
+ // console.log('accessedRouters1111', asyncRouteStore.$state.menus);
|
|
|
|
|
+ // console.log('accessedRouters1111', asyncRouteStore.$state.menus[1].children[0].redirect);
|
|
|
|
|
+ // router.push(asyncRouteStore.$state.menus[1].children[0].redirect)
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
router.push(item.path);
|
|
router.push(item.path);
|
|
|
};
|
|
};
|
|
|
|
|
|