|
@@ -1,55 +1,22 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <evaluation-title class="mt10 box-card"
|
|
|
- navBackButton
|
|
|
- title="由专业选科目"
|
|
|
- :navAction="back"
|
|
|
- ></evaluation-title>
|
|
|
- <div class="content-box">
|
|
|
- <div class="xkcx-input-box">
|
|
|
- <div v-if="false">
|
|
|
- <el-select
|
|
|
- v-model="selected.selectNian"
|
|
|
- @change="onChangeYear"
|
|
|
- placeholder="全部年份"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in selected.yearList"
|
|
|
- :key="index"
|
|
|
- :label="item"
|
|
|
- :value="item"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-button plain @click="onChangeSchoolPopup">
|
|
|
- 学校
|
|
|
- <i class="el-icon-my-button"></i>
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <!--div class="button-major">
|
|
|
- <el-button plain @click="onChangeMajorPopup">
|
|
|
- 专业<i class="el-icon-my-button"></i
|
|
|
- ></el-button>
|
|
|
- </div-->
|
|
|
- <div class="search_header">
|
|
|
- <input
|
|
|
- placeholder="搜索专业"
|
|
|
- v-model="keyword"
|
|
|
- @keyup.enter="httpGetXkcxList()"
|
|
|
- />
|
|
|
- <img
|
|
|
- src="@/assets/images/icon_search2.png"
|
|
|
- alt=""
|
|
|
- @click="httpGetXkcxList()"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <major-choice-dialog :isShowSchoolPopup="isShowSchoolPopup" v-on:onMajorChoiced="onMajorChoiced"
|
|
|
- ></major-choice-dialog>
|
|
|
-
|
|
|
+ <div class="bg-page fx-column fx-cen-cen">
|
|
|
+ <index-card title="由专业选科目" class="index-block">
|
|
|
+ <el-button slot="more" v-has-history size="small" round @click="$router.back()">返回</el-button>
|
|
|
+ <mx-search-group v-model="keyword" placeholder="请输入院校或专业" @search="pageNum=1,httpGetXkcxList()">
|
|
|
+ <el-col :span="16">
|
|
|
+ <div class="fx-row">
|
|
|
+ <el-select v-model="selected.selectNian" placeholder="全部年份" @change="onChangeYear">
|
|
|
+ <el-option v-for="(item, index) in selected.yearList" :key="index" :label="item" :value="item" />
|
|
|
+ </el-select>
|
|
|
+ <el-button plain class="ml5" @click="onChangeSchoolPopup">
|
|
|
+ 学校
|
|
|
+ <svg-icon class="ml3" icon-class="filter" />
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </mx-search-group>
|
|
|
+ <el-divider />
|
|
|
+ <major-choice-dialog :is-show-school-popup="isShowSchoolPopup" @onMajorChoiced="onMajorChoiced" />
|
|
|
<div class="popup-box major-box">
|
|
|
<div class="popup-select">
|
|
|
<div
|
|
@@ -70,9 +37,9 @@
|
|
|
<div class="choice-box">
|
|
|
<div class="choice-item">
|
|
|
<div
|
|
|
- class="choice-item-menv"
|
|
|
v-for="(item, index) in selected.marjorsList.one"
|
|
|
:key="index"
|
|
|
+ class="choice-item-menv"
|
|
|
:class="selected.curMarjors.one.code == item.code ? 'active' : ''"
|
|
|
@click="changeMajor(item)"
|
|
|
>
|
|
@@ -81,9 +48,9 @@
|
|
|
</div>
|
|
|
<div class="choice-item">
|
|
|
<div
|
|
|
- class="choice-item-menv"
|
|
|
v-for="(item, index) in selected.marjorsList.two"
|
|
|
:key="index"
|
|
|
+ class="choice-item-menv"
|
|
|
:class="selected.curMarjors.two.code == item.code ? 'active' : ''"
|
|
|
@click="changeMajor(item)"
|
|
|
>
|
|
@@ -91,30 +58,40 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="choice-item">
|
|
|
- <el-checkbox-group v-model="selected.curMarjors.three" @change="httpGetXkcxList">
|
|
|
+ <el-checkbox-group v-model="selected.curMarjors.three" @change="pageNum=1,httpGetXkcxList()">
|
|
|
<el-checkbox
|
|
|
class="choice-item-checkbox"
|
|
|
label="全选"
|
|
|
@change="onSelectMarjorsAll"
|
|
|
- ></el-checkbox>
|
|
|
+ />
|
|
|
<el-checkbox
|
|
|
- class="choice-item-checkbox"
|
|
|
- :label="item.name"
|
|
|
v-for="(item, index) in selected.marjorsList.three"
|
|
|
:key="index"
|
|
|
- ></el-checkbox>
|
|
|
+ class="choice-item-checkbox"
|
|
|
+ :label="item.name"
|
|
|
+ />
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="concerned-college-container">
|
|
|
- <mx-table v-loading="loading" :rows="dataList" :propDefines="propDefines">
|
|
|
+ <mx-table :rows="dataList" :prop-defines="propDefines">
|
|
|
<template #collect="{ row }">
|
|
|
- <major-collect-cell :row="row" :loading.sync="loading" />
|
|
|
+ <svg-icon
|
|
|
+ class="pointer-no-hover f16"
|
|
|
+ :class="{'f-active':row.collect, 'f-999':!row.collect}"
|
|
|
+ icon-class="heart"
|
|
|
+ @click="toggleCollect(row)"
|
|
|
+ />
|
|
|
</template>
|
|
|
<template #isSelectCourse="{ row }">
|
|
|
- <subject-select-cell :row="row" :loading.sync="loading" />
|
|
|
+ <svg-icon
|
|
|
+ class="pointer-no-hover f16"
|
|
|
+ :class="{'f-active':row.isSelectCourse, 'f-999':!row.isSelectCourse}"
|
|
|
+ icon-class="check-circle"
|
|
|
+ @click="saveCourseCollect(row)"
|
|
|
+ />
|
|
|
</template>
|
|
|
</mx-table>
|
|
|
<pagination
|
|
@@ -126,26 +103,22 @@
|
|
|
@pagination="onChangePage"
|
|
|
/>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </index-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- marjorsList,
|
|
|
- xkcxlistByMarjors,
|
|
|
- xkcxYears
|
|
|
-} from '@/api/webApi/webQue'
|
|
|
-
|
|
|
+import { collectAdd, collectRemove, saveSelectCourse, xkcxlistByMarjors, xkcxYears } from '@/api/webApi/webQue'
|
|
|
+import config from '@/common/MxConfig'
|
|
|
import MajorChoiceDialog from '../components/MajorChoiceDialog.vue'
|
|
|
-import MajorCollectCell from "@/views/career/subject/components/MajorCollectCell.vue";
|
|
|
-import SubjectSelectCell from "@/views/career/subject/components/SubjectSelectCell.vue";
|
|
|
+import IndexCard from '@/views/login/components/modules/shared/IndexCard'
|
|
|
+import MxSearchGroup from '@/components/MxSearch/mx-search-group'
|
|
|
+import { allMajor } from '@/api/webApi/professlib'
|
|
|
|
|
|
export default {
|
|
|
- components: {SubjectSelectCell, MajorCollectCell, MajorChoiceDialog },
|
|
|
+ components: { MxSearchGroup, IndexCard, MajorChoiceDialog },
|
|
|
data() {
|
|
|
return {
|
|
|
- loading: false,
|
|
|
selected: {
|
|
|
yearList: [],
|
|
|
selectNian: '',
|
|
@@ -174,10 +147,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- // this.httpGetXkcxYears() // Cancelled year condition, use student's grade year instead.
|
|
|
+ this.httpGetXkcxYears()
|
|
|
this.httpGetMarjorsList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ saveCourseCollect(row) {
|
|
|
+ saveSelectCourse({
|
|
|
+ refId: row.id,
|
|
|
+ isSelectCourse: !row.isSelectCourse
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ row.isSelectCourse = !row.isSelectCourse
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
back() {
|
|
|
this.$router.go(-1)
|
|
|
},
|
|
@@ -188,8 +172,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
onChangeYear(res) {
|
|
|
- //切换学年时,取第1页
|
|
|
- this.pageNum = 1
|
|
|
+ // 切换学年时,取第1页
|
|
|
this.httpGetMarjorsList()
|
|
|
},
|
|
|
onChangeSchoolPopup() {
|
|
@@ -199,13 +182,13 @@ export default {
|
|
|
this.isShowMajorPopup = !this.isShowMajorPopup
|
|
|
},
|
|
|
onMajorChoiced(choice) {
|
|
|
- console.log(choice)
|
|
|
this.isShowSchoolPopup = false
|
|
|
|
|
|
this.selected.locations = choice.locations
|
|
|
this.selected.features = choice.features
|
|
|
this.selected.types = choice.types
|
|
|
|
|
|
+ this.pageNum = 1
|
|
|
this.httpGetXkcxList()
|
|
|
},
|
|
|
|
|
@@ -218,10 +201,10 @@ export default {
|
|
|
onSelectMarjorsAll(res) {
|
|
|
if (res) {
|
|
|
this.selected.curMarjors.three.push('全选')
|
|
|
- let len = this.selected.marjorsList.three.length
|
|
|
+ const len = this.selected.marjorsList.three.length
|
|
|
for (let i = 0; i < len; i++) {
|
|
|
- let name = this.selected.marjorsList.three[i]['name']
|
|
|
- let index = this.selected.curMarjors.three.indexOf(name)
|
|
|
+ const name = this.selected.marjorsList.three[i]['name']
|
|
|
+ const index = this.selected.curMarjors.three.indexOf(name)
|
|
|
if (index < 0) {
|
|
|
this.selected.curMarjors.three.push(name)
|
|
|
}
|
|
@@ -233,49 +216,48 @@ export default {
|
|
|
changeMajor(res) {
|
|
|
this.selected.curMarjors.three = []
|
|
|
switch (res.level) {
|
|
|
- case 1:
|
|
|
- this.selected.curMarjors.one = res
|
|
|
- break
|
|
|
- case 2:
|
|
|
- this.selected.curMarjors.two = res
|
|
|
- break
|
|
|
+ case 1:
|
|
|
+ this.selected.curMarjors.one = res
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ this.selected.curMarjors.two = res
|
|
|
+ break
|
|
|
}
|
|
|
this.selected.marjorsCode = res.code
|
|
|
this.selected.marjorsLevel = res.level + 1
|
|
|
this.httpGetMarjorsList()
|
|
|
},
|
|
|
httpGetMarjorsList() {
|
|
|
- marjorsList({
|
|
|
+ allMajor({
|
|
|
type: this.selected.marjorsType,
|
|
|
level: this.selected.marjorsLevel,
|
|
|
- code: this.selected.marjorsCode
|
|
|
+ parentCode: this.selected.marjorsCode
|
|
|
}).then((res) => {
|
|
|
switch (this.selected.marjorsLevel) {
|
|
|
- case 2:
|
|
|
- this.selected.marjorsList.two = res.rows
|
|
|
- this.changeMajor(res.rows[0])
|
|
|
- break
|
|
|
- case 3:
|
|
|
- this.selected.marjorsList.three = res.rows
|
|
|
- this.onSelectMarjorsAll(res.rows)
|
|
|
- this.httpGetXkcxList()
|
|
|
- break
|
|
|
- default:
|
|
|
- this.selected.marjorsList.one = res.rows
|
|
|
- this.changeMajor(res.rows[0])
|
|
|
- break
|
|
|
+ case 2:
|
|
|
+ this.selected.marjorsList.two = res.data
|
|
|
+ this.changeMajor(res.data[0])
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ this.selected.marjorsList.three = res.data
|
|
|
+ this.onSelectMarjorsAll(res.data)
|
|
|
+ this.pageNum = 1
|
|
|
+ this.httpGetXkcxList()
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ this.selected.marjorsList.one = res.data
|
|
|
+ this.changeMajor(res.data[0])
|
|
|
+ break
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 查询结果
|
|
|
httpGetXkcxList() {
|
|
|
if (this.selected.curMarjors.three.length < 1) return
|
|
|
- console.log(this.selected)
|
|
|
- //console.log(this.selected);return;
|
|
|
xkcxlistByMarjors({
|
|
|
level: this.selected.marjorsType.toString(),
|
|
|
keyword: this.keyword,
|
|
|
- isMajor:true,
|
|
|
+ isMajor: true,
|
|
|
year: this.selected.selectNian.toString(),
|
|
|
marjors: this.selected.curMarjors.one.name + ',' + this.selected.curMarjors.two.name + ',' + this.selected.curMarjors.three.join(','),
|
|
|
location: this.selected.locations.toString(),
|
|
@@ -285,60 +267,49 @@ export default {
|
|
|
pageSize: this.pageSize
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- let propDefines = {}
|
|
|
+ const propDefines = {}
|
|
|
this.dataList = res.rows
|
|
|
this.total = res.total
|
|
|
Object.keys(res.header).forEach(item => {
|
|
|
- propDefines[item] = {label:res.header[item],slot:item}
|
|
|
+ if (item === 'isSelectCourse' && !config.enableElective) return
|
|
|
+ propDefines[item] = { label: res.header[item], slot: item }
|
|
|
})
|
|
|
this.propDefines = propDefines
|
|
|
this.isShowTable = true
|
|
|
-
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- console.log('请求出错!')
|
|
|
+ console.log('请求出错!', err)
|
|
|
this.cleanSchoolSelect()
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
onChangePage(page) {
|
|
|
this.pageSize = page.limit
|
|
|
this.pageNum = page.page
|
|
|
this.httpGetXkcxList()
|
|
|
+ },
|
|
|
+ // 收藏 / 取消收藏
|
|
|
+ toggleCollect(row) {
|
|
|
+ if (this.loading) return
|
|
|
+ this.loading = true
|
|
|
+ const api = row.collect ? collectRemove : collectAdd
|
|
|
+ row.collect = !row.collect
|
|
|
+ api({ refId: row.id }).finally(() => this.loading = false)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.content-box {
|
|
|
- padding: 10px 40px 10px 50px;
|
|
|
-}
|
|
|
-
|
|
|
-.major-list-title span {
|
|
|
- color: #d28140;
|
|
|
+<style lang="scss" scoped>
|
|
|
+.el-button.is-plain:hover .svg-icon {
|
|
|
+ color: var(--themeColor);
|
|
|
}
|
|
|
|
|
|
-el-button {
|
|
|
- padding: 9px 20px;
|
|
|
+.el-divider {
|
|
|
+ height: 2px;
|
|
|
+ background-color: var(--themeColor);
|
|
|
}
|
|
|
|
|
|
-.button-school {
|
|
|
- margin: 0 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.el-icon-my-button {
|
|
|
- background: url(../../../assets/images/subject/icon_shaixuan.png) center no-repeat;
|
|
|
- background-size: cover;
|
|
|
-}
|
|
|
-
|
|
|
-.el-icon-my-button:before {
|
|
|
- content: "替";
|
|
|
- font-size: 16px;
|
|
|
- visibility: hidden;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
.major-box {
|
|
|
display: flex;
|
|
|
margin-bottom: 30px;
|
|
@@ -356,8 +327,8 @@ el-button {
|
|
|
}
|
|
|
|
|
|
.popup-select-item.active {
|
|
|
- color: #47c6a2;
|
|
|
- border-right: 2px solid #47c6a2;
|
|
|
+ color: var(--themeColor);
|
|
|
+ border-right: 2px solid var(--themeColor);
|
|
|
}
|
|
|
|
|
|
.choice-box {
|
|
@@ -379,7 +350,7 @@ el-button {
|
|
|
}
|
|
|
|
|
|
.choice-item-menv.active {
|
|
|
- color: #47c6a2;
|
|
|
+ color: var(--themeColor);
|
|
|
}
|
|
|
|
|
|
.choice-item-checkbox {
|
|
@@ -388,14 +359,6 @@ el-button {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-.xkcx-input-box {
|
|
|
- padding: 20px 0 0;
|
|
|
- display: flex;
|
|
|
- margin-bottom: 20px;
|
|
|
- border-bottom: 2px solid #47c6a2;
|
|
|
-}
|
|
|
-
|
|
|
.search_header {
|
|
|
margin-left: auto;
|
|
|
display: flex;
|