- 产品标签
@@ -220,62 +235,9 @@ export default {
professionalCategoryId: '',
professionalId: '',
category: [],
- // 学科动态加载
- props: {
- checkStrictly: true,
- lazy: true,
- lazyLoad (node, resolve) {
- const { level, value } = node
- // 学科类别
- if (!level) {
- that.$get(that.api.courseDiscipline).then(({ list }) => {
- list = list.slice(1).filter(e => e.level > 1)
- list.map(e => {
- e.value = e.disciplineId
- e.label = e.disciplineName
- e.children = []
- })
- that.category = [list[0].disciplineId]
- resolve(list)
- }).catch(err => { })
- } else if (level === 1) {
- // 专业类
- that.$get(that.api.courseProfessionalClass, {
- disciplineId: value
- }).then(({ list }) => {
- list = list.filter(e => e.level > 1)
- list.map(e => {
- e.value = e.professionalClassId
- e.label = e.professionalClassName
- e.children = []
- })
- resolve(list)
- }).catch(err => { })
- } else if (level === 2) {
- // 专业
- that.$get(that.api.courseProfessional, {
- professionalClassId: value
- }).then(({ list }) => {
- list = list.filter(e => e.level > 1)
- list.map(e => {
- e.value = e.professionalId
- e.label = e.professionalName
- e.leaf = true
- })
- resolve(list)
- }).catch(err => { })
- } else {
- resolve([])
- }
- }
- },
+ professionalClasses: [],
+ professionals: [],
labels: [],
- subjectList: [], //专业学科
- professionalClassList: [], //专业类
- professionalList: [], //专业
- categoryName: '',
- professionalCategoryName: '',
- professionalName: '',
classifications: [],
status: [
{
@@ -379,109 +341,41 @@ export default {
async getSubject () {
// 学科类别
this.$get(this.api.subjectCategoryCited).then(({ list }) => {
- const result = []
- const promises = []
list = list.filter(e => e.disciplineId != 1)
list.map((e, i) => {
+ e.id = e.disciplineId
+ e.name = e.disciplineName
// 专业类
e.professionalClasses.map(e => {
- e.value = e.professionalClassId
- e.label = e.professionalClassName
+ e.id = e.professionalClassId
+ e.name = e.professionalClassName
// 专业
e.professionals.map(e => {
- e.value = e.professionalId
- e.label = e.professionalName
+ e.id = e.professionalId
+ e.name = e.professionalName
})
e.children = e.professionals
})
- result.push({
- val: [],
- disciplineId: e.disciplineId,
- name: e.disciplineName,
- categoryName: e.disciplineName,
- list: e.professionalClasses
- })
- })
-
- Promise.all(promises).then(_ => {
- console.log("🚀 ~ file: index.vue:378 ~ this.$get ~ result:", result)
- this.category = result
+ e.children = e.professionalClasses
})
+ this.category = list
}).catch(err => { })
},
- nameClick (item, i) {
- this.categoryId = item.disciplineId
- this.professionalCategoryId = ''
- this.professionalId = ''
- this.$refs['category' + i][0].toggleDropDownVisible()
- this.clearCategory()
- this.initData()
- },
- // 清除所有学科所选
- clearCategory () {
- const list = this.category
- list.map(e => {
- e.val = []
- })
- },
- categoryChange (val, item, i) {
- const name = this.$refs['category' + i][0].getCheckedNodes()[0].pathLabels
- console.log("🚀 ~ file: index.vue:431 ~ categoryChange ~ val, item:", val, item, name)
- item.name = item.categoryName + '/' + name.join('/')
- this.clearCategory()
- item.val = val
- this.categoryId = item.disciplineId
- this.professionalCategoryId = val[0] || ''
- this.professionalId = val[1] || ''
- this.initData()
- },
- // 返回学科name
- handleCategoryName () {
- if (this.subjectList.length) {
- const id = this.categoryId
- const list = this.subjectList
- if (list.length) {
- if (id === '' || id === 1) {
- this.categoryName = list[0].disciplineName
- } else {
- const item = list.find(e => e.disciplineId == id)
- this.categoryName = item ? item.disciplineName : ''
- }
- }
- }
-
- if (this.professionalClassList.length) {
- const id = this.professionalCategoryId
- const list = this.professionalClassList
- if (list.length) {
- if (id === '' || id === 1) {
- this.professionalCategoryName = list[0].professionalClassName
- } else {
- const item = list.find(e => e.professionalClassId == id)
- this.professionalCategoryName = item ? item.professionalClassName : ''
- }
- }
- }
- if (this.professionalList.length) {
- const id = this.professionalId
- const list = this.professionalList
- if (list.length) {
- if (id === '' || id === 1) {
- this.professionalName = list[0].professionalName
- } else {
- const item = list.find(e => e.professionalId == id)
- this.professionalName = item ? item.professionalName : ''
- }
- }
- }
- },
// 学科点击回调
- catetoryClick (id) {
- this.categoryId = id
- this.professionalCategoryId = id
- this.professionalId = id
- this.clearCategory()
+ categoryClick (item, i) {
+ const { id, children } = item
+ this[i === 1 ? 'categoryId' : i === 2 ? 'professionalCategoryId' : 'professionalId'] = id
+ // 学科类别
+ if (i === 1) {
+ this.professionalCategoryId = ''
+ this.professionalId = ''
+ if (children) this.professionalClasses = children
+ this.professionals = []
+ } else if (i === 2) { // 专业类
+ this.professionalId = ''
+ if (children) this.professionals = children
+ }
this.initData()
},
// 获取产品类型
diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue
index 54f9146..73a8751 100644
--- a/src/pages/station/preview/index.vue
+++ b/src/pages/station/preview/index.vue
@@ -602,7 +602,7 @@ export default {
},
// 获取最高分列表
async getMaximumScore () {
- let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000`);
+ let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000&mallId=${this.mallId}&cid=${this.courseId}`);
const list = message.records
list.forEach(e => {
if (!e.userAvatars) e.userAvatars = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'