Commit a029f3f1 authored by chenqikuai's avatar chenqikuai

fix

parent 387bbb32
......@@ -17,22 +17,38 @@
</template>
<script lang="ts" setup>
import { router } from "@/router";
import { globalState } from "@/store/state";
import { sySideBar, syBusinessHeader } from "cqk-sy-ui"
import { reactive } from "vue";
import { reactive, watch } from "vue";
import { useRoute } from "vue-router";
const route = useRoute()
const sideBarState = reactive({
menuList: [
{
name: "存证",
icon: "&#xe62b;",
path: '/categoryManage',
navigate: () => {
router.push('/categoryManage')
},
},
{
name: "溯源",
icon: "&#xe629;",
path: '',
navigate: () => {
window.open(globalState.urlList.chain_browser_url)
}
},
{
name: "管理",
icon: "&#xe62a;",
path: '/userCenter',
navigate: () => {
router.push('/userCenter')
},
},
],
current: 0,
......@@ -43,10 +59,16 @@ const sideBarState = reactive({
selectedMenuBgColor: '#39393e',
selectedIconColor: "rgba(255, 255, 255, 0.6)",
selectCurrent: (v: number) => {
sideBarState.current = v;
sideBarState.menuList[v].navigate()
if (sideBarState.menuList[v].name !== '溯源') {
sideBarState.current = v;
}
},
})
const menuIndex = sideBarState.menuList.findIndex(i => i.path === route.path)
sideBarState.current = menuIndex
const handleLogout = () => {
sessionStorage.removeItem("user");
router.push("/");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment