|
@@ -17,7 +17,7 @@ import NavBar from "./components/NavBar.vue";
|
|
import { sysMenu } from "@/api/system-user";
|
|
import { sysMenu } from "@/api/system-user";
|
|
import localMenu from "./components/menu";
|
|
import localMenu from "./components/menu";
|
|
import { deepCopy } from "@/utils/utils";
|
|
import { deepCopy } from "@/utils/utils";
|
|
-import { mapActions } from "vuex";
|
|
|
|
|
|
+import { mapState, mapActions } from "vuex";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Layout",
|
|
name: "Layout",
|
|
@@ -38,6 +38,9 @@ export default {
|
|
loopRunning: false,
|
|
loopRunning: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState("invigilation", ["cacheExamActivity"]),
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
// 禁止通过非session共享的方式打开系统页面
|
|
// 禁止通过非session共享的方式打开系统页面
|
|
if (!this.$store.state.user || !this.$store.state.user["id"]) {
|
|
if (!this.$store.state.user || !this.$store.state.user["id"]) {
|
|
@@ -152,10 +155,22 @@ export default {
|
|
this.clearLoopSetTs();
|
|
this.clearLoopSetTs();
|
|
if (!this.loopRunning) return;
|
|
if (!this.loopRunning) return;
|
|
|
|
|
|
|
|
+ if (
|
|
|
|
+ !this.cacheExamActivity.examId ||
|
|
|
|
+ !this.cacheExamActivity.examActivityId
|
|
|
|
+ ) {
|
|
|
|
+ this.loopSetTs.push(
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.timerUpdatePage();
|
|
|
|
+ }, 10 * 1000)
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
const user = this.$store.state.user;
|
|
const user = this.$store.state.user;
|
|
- const datas = user.roleCodes.includes("INVIGILATE")
|
|
|
|
|
|
+ let datas = user.roleCodes.includes("INVIGILATE")
|
|
? { userId: user.id }
|
|
? { userId: user.id }
|
|
: {};
|
|
: {};
|
|
|
|
+ datas = { ...datas, ...this.cacheExamActivity };
|
|
|
|
|
|
const fetchAll = this.loopFuncList.map((item) => item.call(this, datas));
|
|
const fetchAll = this.loopFuncList.map((item) => item.call(this, datas));
|
|
await Promise.all(fetchAll).catch(() => {});
|
|
await Promise.all(fetchAll).catch(() => {});
|