|
@@ -74,6 +74,18 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div v-if="showTkTips" class="tips-markedness">
|
|
|
+ <p class="tips-info">
|
|
|
+ 请在题库-试卷列表点击生成试卷,检查试卷,确定试卷无误后点击顶部确定按钮
|
|
|
+ <el-button
|
|
|
+ v-if="tkAuth.hasAuth"
|
|
|
+ type="text"
|
|
|
+ class="btn-primary btn-link ml-2"
|
|
|
+ @click="toTk"
|
|
|
+ >点击跳转题库</el-button
|
|
|
+ >
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
<div slot="footer">
|
|
|
<el-button @click="cancel">关闭</el-button>
|
|
|
</div>
|
|
@@ -83,6 +95,7 @@
|
|
|
<script>
|
|
|
import json5 from "json5";
|
|
|
import { tikuPaperListQuery, tikuPaperDetail } from "../../api";
|
|
|
+import { tikuAuth } from "../../../stmms/api";
|
|
|
|
|
|
export default {
|
|
|
name: "select-tiku-paper-dialog",
|
|
@@ -107,6 +120,12 @@ export default {
|
|
|
size: this.GLOBAL.pageSize,
|
|
|
total: 0,
|
|
|
loading: false,
|
|
|
+ // tiku
|
|
|
+ showTkTips: false,
|
|
|
+ tkAuth: {
|
|
|
+ hasAuth: false,
|
|
|
+ role: null,
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -200,6 +219,41 @@ export default {
|
|
|
this.$emit("confirm", row);
|
|
|
this.cancel();
|
|
|
},
|
|
|
+ checkTkAuth() {
|
|
|
+ const user = this.$ls.get("user");
|
|
|
+ const userRoles = user.roleSource.filter(
|
|
|
+ (item) => item.roleSource === "QUESTION_LIBRARY"
|
|
|
+ );
|
|
|
+ if (!userRoles.length) {
|
|
|
+ this.tkAuth.hasAuth = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.tkAuth.hasAuth = true;
|
|
|
+
|
|
|
+ const stRole = userRoles.find(
|
|
|
+ (item) => item.roleCode === "SUBJECT_TEACHER"
|
|
|
+ );
|
|
|
+ this.tkAuth.role = {
|
|
|
+ ...(stRole ? stRole : userRoles[0]),
|
|
|
+ loginName: user.loginName,
|
|
|
+ realName: user.realName,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async toTk() {
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+ const data = await tikuAuth({
|
|
|
+ loginName: this.tkAuth.role.loginName,
|
|
|
+ realName: this.tkAuth.role.realName,
|
|
|
+ role: this.tkAuth.role.roleCode,
|
|
|
+ returnUrl: encodeURIComponent(window.location.href),
|
|
|
+ }).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
+ if (!data) return;
|
|
|
+ window.open(data.redirectUrl);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|