|
@@ -12,8 +12,9 @@
|
|
|
<span :class="['mytitle', {'no-show-title': MyNo === '1' || windowWidth < 852}]">{{ MyName }}</span>
|
|
|
</div>
|
|
|
<div class="selectClass" v-if="MyNo != '11'">
|
|
|
- <template v-if="userInfo.scope === 'student' && semesterLists.length && showSemester">
|
|
|
- <Select v-model="selectSemester" style="width: 150px; margin-right: 10px;" filterable :placeholder="$t('cusMgt.sltCusTips')" @on-change="getClassList">
|
|
|
+ <!-- 调整为所有页面显示学年期,除首页外,其他页面切换时需弹出框提示会刷新课程列表,回到首页重新选择课程 -->
|
|
|
+ <template v-if="userInfo.scope === 'student' && semesterLists.length">
|
|
|
+ <Select v-model="selectSemester" style="width: 150px; margin-right: 10px;" filterable :placeholder="$t('cusMgt.sltCusTips')" @on-change="semesterChange">
|
|
|
<Option v-for="(item, cIndex) in semesterLists" :style="{'color': item.color}" :value="cIndex" :label="item.showName" :key="cIndex">
|
|
|
</Option>
|
|
|
</Select>
|
|
@@ -352,6 +353,7 @@ export default {
|
|
|
fontChange: 'Hm',
|
|
|
semesterLists: [],
|
|
|
selectSemester: null,
|
|
|
+ selectSemesterOld: null,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -562,6 +564,25 @@ export default {
|
|
|
this.$router.push(isMobile ? path + '2' : path)
|
|
|
}
|
|
|
},
|
|
|
+ semesterChange(key, keyWord) {
|
|
|
+ if(this.$route.path != '/studentWeb/homeView') {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ content: `${this.$t('studentWeb.courseType.semester')}${this.semesterLists[key].showName}?`,
|
|
|
+ onOk: () => {
|
|
|
+ this.selectSemesterOld = this.selectSemester
|
|
|
+ this.$router.push('/studentWeb/homeView')
|
|
|
+ this.getClassList()
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ this.selectSemester = this.selectSemesterOld
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.selectSemesterOld = this.selectSemester
|
|
|
+ console.log(this.selectSemesterOld, this.selectSemester);
|
|
|
+ this.getClassList()
|
|
|
+ }
|
|
|
+ },
|
|
|
getClassList() {
|
|
|
this.selectClass = 0
|
|
|
let Semester = {...this.semesterLists[this.selectSemester]}
|
|
@@ -811,6 +832,7 @@ export default {
|
|
|
}
|
|
|
this.semesterLists = arr
|
|
|
this.selectSemester = this.semesterLists.length - 1
|
|
|
+ this.selectSemesterOld = this.selectSemester
|
|
|
this.getClassList()
|
|
|
},
|
|
|
},
|