|
|
@ -50,16 +50,12 @@ |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<label>课程</label> |
|
|
|
<label>课程</label> |
|
|
|
<el-select v-model="curriculumId" |
|
|
|
<el-cascader v-model="mallIds" |
|
|
|
placeholder="请选择" |
|
|
|
:options="curs" |
|
|
|
@change="initData"> |
|
|
|
:props="{ checkStrictly: true, value: 'id' }" |
|
|
|
<el-option label="不限" |
|
|
|
popper-class="course-cas" |
|
|
|
value=""></el-option> |
|
|
|
@expand-change="curChange" |
|
|
|
<el-option v-for="item in curriculumList" |
|
|
|
@change="curChange"></el-cascader> |
|
|
|
:key="item.cid" |
|
|
|
|
|
|
|
:label="item.goodsName" |
|
|
|
|
|
|
|
:value="item.cid"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -272,12 +268,15 @@ export default { |
|
|
|
curriculumId: "", |
|
|
|
curriculumId: "", |
|
|
|
keyWord: "", // 搜索框筛选条件 |
|
|
|
keyWord: "", // 搜索框筛选条件 |
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
|
|
|
|
mallIds: [], |
|
|
|
|
|
|
|
curs: [], |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
type: "", |
|
|
|
type: "", |
|
|
|
status: "", |
|
|
|
status: "", |
|
|
|
startTime: "", |
|
|
|
startTime: "", |
|
|
|
endTime: "", |
|
|
|
endTime: "", |
|
|
|
month: "" |
|
|
|
month: "", |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
pageNum: +this.$route.query.page || 1, // 当前页数 |
|
|
|
pageNum: +this.$route.query.page || 1, // 当前页数 |
|
|
|
pageSize: 10, // 每页10条 |
|
|
|
pageSize: 10, // 每页10条 |
|
|
@ -326,8 +325,7 @@ export default { |
|
|
|
clearInterval(this.ticker); |
|
|
|
clearInterval(this.ticker); |
|
|
|
this.ticker = null; |
|
|
|
this.ticker = null; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.getData(1); |
|
|
|
this.getCourse(); |
|
|
|
this.getschoolCourse(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
pickerInput () { |
|
|
|
pickerInput () { |
|
|
@ -368,12 +366,16 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
getData (counddown) { |
|
|
|
getData (counddown) { |
|
|
|
this.listLoading = true; |
|
|
|
this.listLoading = true; |
|
|
|
|
|
|
|
const { mallIds } = this |
|
|
|
|
|
|
|
const cur = this.curs.find(e => e.mallId == mallIds[0]) |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
...this.form, |
|
|
|
...this.form, |
|
|
|
keyWord: this.keyWord, |
|
|
|
keyWord: this.keyWord, |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
curriculumId: this.curriculumId |
|
|
|
cid: cur.cid, |
|
|
|
|
|
|
|
mallId: mallIds[0], |
|
|
|
|
|
|
|
systemId: mallIds[1] |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.$post(this.api.pageByCondition, data).then(res => { |
|
|
|
this.$post(this.api.pageByCondition, data).then(res => { |
|
|
|
this.listData = res.list; |
|
|
|
this.listData = res.list; |
|
|
@ -409,16 +411,37 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData () { |
|
|
|
initData () { |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.pageNum = 1; |
|
|
|
this.pageNum = 1 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getschoolCourse () { // 获取课程下拉框数据 |
|
|
|
|
|
|
|
this.$get(this.api.schoolCourse).then(res => { |
|
|
|
// 获取课程 |
|
|
|
this.curriculumList = res.data; |
|
|
|
async getCourse () { |
|
|
|
}).catch(err => { |
|
|
|
const { data } = await this.$get(this.api.getSystemIdBySchool) |
|
|
|
console.log(err); |
|
|
|
const res = await this.$get(this.api.getSchoolEffectiveCourse) |
|
|
|
}); |
|
|
|
if (res.data.length) { |
|
|
|
|
|
|
|
res.data.map(e => { |
|
|
|
|
|
|
|
e.id = e.mallId |
|
|
|
|
|
|
|
e.label = e.curriculumName |
|
|
|
|
|
|
|
e.children = data.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.curs = res.data |
|
|
|
|
|
|
|
this.mallIds = [res.data[0].mallId, data[0].id] |
|
|
|
|
|
|
|
this.pageNum = 1 |
|
|
|
|
|
|
|
this.getData(1) |
|
|
|
|
|
|
|
console.log("🚀 ~ file: index.vue:431 ~ getSystemData ~ res.data:", this.mallIds) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 课程选择回调 |
|
|
|
|
|
|
|
curChange (val) { |
|
|
|
|
|
|
|
const id = val[0] |
|
|
|
|
|
|
|
if (val.length === 1) { |
|
|
|
|
|
|
|
// 如果选择的是课程,则默认选中下面第一个系统 |
|
|
|
|
|
|
|
this.mallIds = [id, this.curs.find(e => e.id == id).children[0].id] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.initData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
add () { |
|
|
|
add () { |
|
|
|
this.$router.push("add"); |
|
|
|
this.$router.push("add"); |
|
|
|
}, |
|
|
|
}, |
|
|
|