|
@@ -1,8 +1,5 @@
|
|
|
<template>
|
|
|
<div class="bank-container" ref="bankContainer">
|
|
|
- <!-- <div class="back-to-top flex-col-center" :title="$t('evaluation.backToTop')" @click="onBackToTop">
|
|
|
- <Icon type="ios-arrow-up" />
|
|
|
- </div> -->
|
|
|
<Tabs :value="tabName" name="listTab" @on-click="onTabClick" :animated="false" style="position: relative;">
|
|
|
<button class="editOnExternalBtn" @click="editOnExternal">
|
|
|
<Icon type="md-create" size="20" color="#42a9f0"/>
|
|
@@ -68,46 +65,6 @@
|
|
|
onItemCheckChange(arr) {
|
|
|
this.checkItemArr = arr;
|
|
|
},
|
|
|
- /* 批量删除 */
|
|
|
- doBatchDelete() {
|
|
|
- let exListVm = this.$refs.exList;
|
|
|
-
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t("evaluation.newExercise.modalTip"),
|
|
|
- content: this.$t("stuAccount.tips2Content3"),
|
|
|
- onOk: () => {
|
|
|
- let ids = this.checkItemArr.map((i) => i.id);
|
|
|
- let item = this.checkItemArr[0];
|
|
|
- exListVm.dataLoading = true;
|
|
|
- this.$api.newEvaluation
|
|
|
- .DeleteExamItem({
|
|
|
- ids: ids,
|
|
|
- code: item.code,
|
|
|
- scope: item.scope
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- exListVm.isSelectAll = false;
|
|
|
- exListVm.selectedArr = [];
|
|
|
- exListVm.doFilter();
|
|
|
- this.checkItemArr = [];
|
|
|
- this.$Message.success(this.$t("evaluation.deleteSuc"));
|
|
|
- } else {
|
|
|
- this.$Message.warning(this.$t("evaluation.deleteFail"));
|
|
|
- exListVm.dataLoading = false;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.log(err);
|
|
|
- this.$Message.warning(this.$t("evaluation.deleteFail"));
|
|
|
- exListVm.dataLoading = false;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- onBackToTop() {
|
|
|
- // this.$refs.bankContainer.scrollIntoView();
|
|
|
- },
|
|
|
onTabClick(val) {
|
|
|
this.currentTab = val;
|
|
|
this.$router.replace({
|
|
@@ -127,145 +84,7 @@
|
|
|
this.isShowBackList = false;
|
|
|
this.$refs.bankContainer.scrollIntoView();
|
|
|
},
|
|
|
- /* 编辑当前预览的试卷 */
|
|
|
- onEditPaper() {
|
|
|
- this.$refs.paperList.goToPaper(this.$refs.paperList.curPaper);
|
|
|
- },
|
|
|
-
|
|
|
- /** 切换全部展开与折叠 */
|
|
|
- onHandleToggle() {
|
|
|
- this.$refs.exList.onHandleToggle(this.isAllOpen);
|
|
|
- this.isAllOpen = !this.isAllOpen;
|
|
|
- },
|
|
|
-
|
|
|
- /* 跳转到分享页面 */
|
|
|
- goShare() {
|
|
|
- this.$router.push({
|
|
|
- name: "shareCenter",
|
|
|
- params: {
|
|
|
- tabName: this.currentTab
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /* 确认是否允许携带手机号进行注册 */
|
|
|
- doConfirmAgree() {
|
|
|
- return new Promise((r, j) => {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: "授权提示",
|
|
|
- content: "检测到您暂未绑定学科网账号,是否允许以醍摩豆云平台关联手机号进行认证?",
|
|
|
- okText: "允许",
|
|
|
- cancelText: "拒绝",
|
|
|
- onOk: () => {
|
|
|
- r(1);
|
|
|
- },
|
|
|
- onCancel: () => {
|
|
|
- r(0);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- /* 跳转学科网 */
|
|
|
- doXkwAuth() {
|
|
|
- this.$api.auth.checkBind({}).then(async (res) => {
|
|
|
- // 判断是否已经绑定学科网
|
|
|
- let isBind = res.auth.find((i) => i.type === "xkw");
|
|
|
- // 如果没有绑定 则询问用户是否允许携带手机号进行注册
|
|
|
- let agree = isBind ? 1 : await this.doConfirmAgree();
|
|
|
- // 判断资源类型
|
|
|
- let module = this.currentTab === "exercise" ? "item" : "paper";
|
|
|
- // 存到本地
|
|
|
- localStorage.setItem("xkw_module", module);
|
|
|
- // 发送授权请求
|
|
|
- this.$api.auth
|
|
|
- .xkwOauth({
|
|
|
- module: module,
|
|
|
- agree: agree
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- window.open(res.redirect);
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- // 跳转页面,进行多分题库挑选
|
|
|
- dodfAuth() {
|
|
|
- this.$router.push({
|
|
|
- name: this.isSchool ? 'schoolDf' : 'privateDf',
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
- /**
|
|
|
- * exList的collapseList变化
|
|
|
- * @param list
|
|
|
- */
|
|
|
- onToggleChange(list) {
|
|
|
- this.isAllOpen = list.length !== 0;
|
|
|
- },
|
|
|
-
|
|
|
- /** 返回创建试题页面 */
|
|
|
- goCreateExercise() {
|
|
|
- this.$router.push({
|
|
|
- name: this.$route.name === "personalBank" ? "newPrivateExercise" : "newSchoolExercise",
|
|
|
- params: {
|
|
|
- scope: this.$route.name === "personalBank" ? "private" : "school"
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /* 快速组卷纸本测验 */
|
|
|
- goPaperExam() {
|
|
|
- this.paperExamModal = true;
|
|
|
- this.fullPaperJson = null
|
|
|
- },
|
|
|
-
|
|
|
- goXkwPick() {
|
|
|
- this.$api.auth
|
|
|
- .xkwOauth({
|
|
|
- module: "ezj",
|
|
|
- agree: 1
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.$router.push({
|
|
|
- name: "xkwPage",
|
|
|
- params: {
|
|
|
- iframeSrc: res.redirect
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- /** 前往组卷页面 */
|
|
|
- goCreatePaper(type, isXkwMode) {
|
|
|
- if (isXkwMode) {
|
|
|
- // 发送授权请求
|
|
|
- this.$api.auth
|
|
|
- .xkwOauth({
|
|
|
- module: "ezj",
|
|
|
- agree: 1
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.$router.push({
|
|
|
- name: this.$route.name === "personalBank" ? "newPrivatePaper" : "newSchoolPaper",
|
|
|
- params: {
|
|
|
- scope: this.$route.name === "personalBank" ? "private" : "school",
|
|
|
- type: type,
|
|
|
- isXkwMode: true,
|
|
|
- iframeSrc: res.redirect,
|
|
|
- isFromItemBank: this.currentTab === "exercise"
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$router.push({
|
|
|
- name: this.$route.name === "personalBank" ? "newPrivatePaper" : "newSchoolPaper",
|
|
|
- params: {
|
|
|
- scope: this.$route.name === "personalBank" ? "private" : "school",
|
|
|
- type: type,
|
|
|
- isXkwMode: isXkwMode,
|
|
|
- isFromItemBank: this.currentTab === "exercise"
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
editOnExternal() {
|
|
|
const isSchool = this.$route.path.includes('school');
|
|
|
const path = `/home/evaluation/${isSchool ? 'schoolBank' : 'personalBank'}`;
|
|
@@ -281,7 +100,6 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
if (this.$route.params.tabName) {
|
|
|
this.currentTab = this.$route.params.tabName;
|
|
|
this.tabName = this.$route.params.tabName;
|
|
@@ -303,29 +121,6 @@
|
|
|
isSchool() {
|
|
|
return this.$route.name === "schoolBank";
|
|
|
},
|
|
|
- hasSchool() {
|
|
|
- return this.$store.state.userInfo.hasSchool;
|
|
|
- },
|
|
|
- paperScrollTop() {
|
|
|
- return this.$store.state.totalAnalysis.paperScrollTop;
|
|
|
- },
|
|
|
- /* 判断是否为国际站 */
|
|
|
- inGlobalSite() {
|
|
|
- // return localStorage.getItem("location") === "Global";
|
|
|
- return this.$store.state.config.srvAdr === 'Global'
|
|
|
- },
|
|
|
- hasXkwAuth() {
|
|
|
- // if (localStorage.school_profile) {
|
|
|
- // let schoolProfile = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8"))
|
|
|
- // return schoolProfile.schoolShows && schoolProfile.schoolShows.find(i => i.type === 'xkw')
|
|
|
- // } else {
|
|
|
- // return false
|
|
|
- // }
|
|
|
- return true;
|
|
|
- },
|
|
|
- isTestSite() {
|
|
|
- return (this.$store.state.config.srvAdrType === "test" && this.$store.state.config.srvAdr === 'China') || ((this.$store.state.config.srvAdrType === "product" || this.$store.state.config.srvAdrType === "rc") && (this.$store.state.userInfo.schoolCode === "habook" || this.$store.state.userInfo.schoolCode === "hbcn") && this.$store.state.config.srvAdr === 'China')
|
|
|
- }
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
// 如果是从试卷库预览跳转到生成答题卡 则需要保留试卷库页面的缓存状态
|