Commit 7ceb4ee8 authored by chenqikuai's avatar chenqikuai

修复模板管理中点击模板后,再点击返回,没有回到之前的页面中的问题

parent 9dd81b18
import { getLoginCode } from "cqk-sy-ui";
import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
......@@ -120,7 +121,21 @@ const routes = [
},
];
export const router = createRouter({
const router = createRouter({
history: createWebHashHistory(),
routes,
});
router.beforeEach((to, from, next) => {
const urls = ["/", "/signIn"];
if (to.path === `/signIn` && getLoginCode()) {
next();
}
if (!urls.includes(to.path) && !getLoginCode()) {
return next({ path: "/signIn" });
} else {
next();
}
});
export { router };
......@@ -4,7 +4,7 @@ export const globalState = reactive({
businessType: 0, //0设置 1忘记
goodsNum: 0, // 存证数量
deletedNum: 0, // 回收站数据总量
selectedStatus: 1, // 默认显示存证
selectedStatus: 0, // 默认显示存证
depositCertificate: {
base_id: 0,
base_hash: "",
......
......@@ -26,7 +26,7 @@ import { $ajax } from "@/service";
import { setuserInfos } from "@/store/mutations";
import { globalState } from "@/store/state";
import { sySideBar, syBusinessHeader, GO_URLS } from "cqk-sy-ui";
import { onMounted, reactive, watch } from "vue";
import { onMounted, reactive } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();
......
......@@ -45,6 +45,14 @@
v-show="menuState.current === 1"
:navigate="navigate"
:setTemplateNum="setTemplateNum"
:TemplateType="globalState.templateType"
:setTemplateType="(v: number) => (globalState.templateType = v)"
:templateData="globalState.templateData"
:setTemplateData="
(v: any) => {
globalState.templateData = v;
}
"
></syTraceTemplateManage>
<Deleted v-show="menuState.current === 2" :ToUpdate="toUpdate" />
</div>
......@@ -83,8 +91,11 @@ const setTemplateNum = (n: number) => {
};
const menuState = reactive({
current: 0,
setCurrent: (v: number) => (menuState.current = v),
current: globalState.selectedStatus,
setCurrent: (v: number) => {
menuState.current = v;
globalState.selectedStatus = v;
},
});
const numList = computed(() => {
......
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