|
@@ -94,27 +94,27 @@ export default {
|
|
CourseList: null, //课程列表
|
|
CourseList: null, //课程列表
|
|
TextList: null, //教材列表
|
|
TextList: null, //教材列表
|
|
dataList: null, //展示列表
|
|
dataList: null, //展示列表
|
|
- seekContent: "", //搜索内容
|
|
|
|
- gotoPage: "",
|
|
|
|
- keycode: "",
|
|
|
|
|
|
+ seekContent: '', //搜索内容
|
|
|
|
+ gotoPage: '',
|
|
|
|
+ keycode: '',
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 8,
|
|
pageSize: 8,
|
|
targetPage: 1,
|
|
targetPage: 1,
|
|
loading: false,
|
|
loading: false,
|
|
- classilfyList: ["学习", "教材"],
|
|
|
|
|
|
+ classilfyList: ['课程', '教材'],
|
|
classilfyIndex: 0,
|
|
classilfyIndex: 0,
|
|
classilfyID: null,
|
|
classilfyID: null,
|
|
- };
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
getCurrentQuestionView() {
|
|
getCurrentQuestionView() {
|
|
switch (this.classilfyIndex) {
|
|
switch (this.classilfyIndex) {
|
|
case 0:
|
|
case 0:
|
|
- return Course;
|
|
|
|
|
|
+ return Course
|
|
case 1:
|
|
case 1:
|
|
- return Textbook;
|
|
|
|
|
|
+ return Textbook
|
|
default:
|
|
default:
|
|
- return null;
|
|
|
|
|
|
+ return null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -122,11 +122,11 @@ export default {
|
|
classilfyIndex(newval, oldval) {
|
|
classilfyIndex(newval, oldval) {
|
|
if (newval != oldval) {
|
|
if (newval != oldval) {
|
|
if (newval == 0) {
|
|
if (newval == 0) {
|
|
- this.pageNum = 1;
|
|
|
|
- this.getData("课程");
|
|
|
|
|
|
+ this.pageNum = 1
|
|
|
|
+ this.getData('课程')
|
|
} else if (newval == 1) {
|
|
} else if (newval == 1) {
|
|
- this.pageNum = 1;
|
|
|
|
- this.getData("教材");
|
|
|
|
|
|
+ this.pageNum = 1
|
|
|
|
+ this.getData('教材')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -135,90 +135,90 @@ export default {
|
|
handleSizeChange(val) {},
|
|
handleSizeChange(val) {},
|
|
// 跳页
|
|
// 跳页
|
|
handleCurrentChange(val) {
|
|
handleCurrentChange(val) {
|
|
- this.pageNum = val;
|
|
|
|
|
|
+ this.pageNum = val
|
|
if (this.classilfyIndex == 0) {
|
|
if (this.classilfyIndex == 0) {
|
|
- this.getData("课程");
|
|
|
|
|
|
+ this.getData('课程')
|
|
} else if (this.classilfyIndex == 1) {
|
|
} else if (this.classilfyIndex == 1) {
|
|
- this.getData("教材");
|
|
|
|
|
|
+ this.getData('教材')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 切换分类
|
|
// 切换分类
|
|
cutClassilfy(item, i) {
|
|
cutClassilfy(item, i) {
|
|
- this.classilfyIndex = i;
|
|
|
|
|
|
+ this.classilfyIndex = i
|
|
},
|
|
},
|
|
// 获取子组件传过来的keycode进行查询
|
|
// 获取子组件传过来的keycode进行查询
|
|
changeKeycode(val) {
|
|
changeKeycode(val) {
|
|
- this.keycode = val;
|
|
|
|
|
|
+ this.keycode = val
|
|
if (this.classilfyIndex == 0) {
|
|
if (this.classilfyIndex == 0) {
|
|
- this.getData("课程");
|
|
|
|
|
|
+ this.getData('课程')
|
|
} else if (this.classilfyIndex == 1) {
|
|
} else if (this.classilfyIndex == 1) {
|
|
- this.getData("教材");
|
|
|
|
|
|
+ this.getData('教材')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 输入目标页 并跳到目标页
|
|
// 输入目标页 并跳到目标页
|
|
toPageChange() {
|
|
toPageChange() {
|
|
- this.gotoPage = this.gotoPage.replace(/[^\d]/g, ""); //使用空字符串去替换非数字的字符
|
|
|
|
|
|
+ this.gotoPage = this.gotoPage.replace(/[^\d]/g, '') //使用空字符串去替换非数字的字符
|
|
if (this.gotoPage > Math.ceil(this.CourseList.total / 8)) {
|
|
if (this.gotoPage > Math.ceil(this.CourseList.total / 8)) {
|
|
- return;
|
|
|
|
|
|
+ return
|
|
} else if (this.gotoPage != this.targetPage) {
|
|
} else if (this.gotoPage != this.targetPage) {
|
|
- this.targetPage = this.gotoPage * 1;
|
|
|
|
- this.pageNum = this.gotoPage * 1;
|
|
|
|
|
|
+ this.targetPage = this.gotoPage * 1
|
|
|
|
+ this.pageNum = this.gotoPage * 1
|
|
if (this.classilfyIndex == 0) {
|
|
if (this.classilfyIndex == 0) {
|
|
- this.getData("课程");
|
|
|
|
|
|
+ this.getData('课程')
|
|
} else if (this.classilfyIndex == 1) {
|
|
} else if (this.classilfyIndex == 1) {
|
|
- this.getData("教材");
|
|
|
|
|
|
+ this.getData('教材')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 获取数据
|
|
// 获取数据
|
|
getData(val) {
|
|
getData(val) {
|
|
- this.loading = true;
|
|
|
|
- if (val == "课程") {
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
+ if (val == '课程') {
|
|
// 获取课程列表
|
|
// 获取课程列表
|
|
- cousrseAPI("page_query-PageQueryCourseList", {
|
|
|
|
|
|
+ cousrseAPI('page_query-PageQueryCourseList', {
|
|
page_capacity: this.pageSize,
|
|
page_capacity: this.pageSize,
|
|
cur_page: this.pageNum,
|
|
cur_page: this.pageNum,
|
|
finish_status: 53,
|
|
finish_status: 53,
|
|
release_status: 1,
|
|
release_status: 1,
|
|
name: this.keycode,
|
|
name: this.keycode,
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
- this.dataList = res;
|
|
|
|
- this.CourseList = res;
|
|
|
|
- this.loading = false;
|
|
|
|
- });
|
|
|
|
|
|
+ this.dataList = res
|
|
|
|
+ this.CourseList = res
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- TextbookAPI("book-book_manager-PageQueryBookList", {
|
|
|
|
|
|
+ TextbookAPI('book-book_manager-PageQueryBookList', {
|
|
cur_page: this.pageNum,
|
|
cur_page: this.pageNum,
|
|
page_capacity: this.pageSize,
|
|
page_capacity: this.pageSize,
|
|
name: this.keycode,
|
|
name: this.keycode,
|
|
publish_status: 1,
|
|
publish_status: 1,
|
|
- is_control_publish_scope: "true",
|
|
|
|
|
|
+ is_control_publish_scope: 'true',
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
- this.TextList = res;
|
|
|
|
- if (val == "教材") {
|
|
|
|
- this.dataList = null;
|
|
|
|
- this.dataList = this.TextList;
|
|
|
|
- this.loading = false;
|
|
|
|
|
|
+ this.TextList = res
|
|
|
|
+ if (val == '教材') {
|
|
|
|
+ this.dataList = null
|
|
|
|
+ this.dataList = this.TextList
|
|
|
|
+ this.loading = false
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.keycode = this.$route.query.keycode;
|
|
|
|
- this.classilfyID = this.$route.query.id;
|
|
|
|
|
|
+ this.keycode = this.$route.query.keycode
|
|
|
|
+ this.classilfyID = this.$route.query.id
|
|
// classilfyIndex
|
|
// classilfyIndex
|
|
// if (this.$route.query.id == "COURSE") {
|
|
// if (this.$route.query.id == "COURSE") {
|
|
- this.classilfyIndex = 0;
|
|
|
|
- this.getData("课程");
|
|
|
|
|
|
+ this.classilfyIndex = 0
|
|
|
|
+ this.getData('课程')
|
|
// } else {
|
|
// } else {
|
|
// this.getData("教材");
|
|
// this.getData("教材");
|
|
// this.classilfyIndex = 1;
|
|
// this.classilfyIndex = 1;
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
-};
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
.SeekResult {
|
|
.SeekResult {
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|
|
background: #f6f6f6;
|
|
background: #f6f6f6;
|
|
@@ -324,4 +324,4 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|