diff --git a/src/pages/match/add/set.vue b/src/pages/match/add/set.vue index 3ab5a88..2679895 100644 --- a/src/pages/match/add/set.vue +++ b/src/pages/match/add/set.vue @@ -296,14 +296,17 @@ export default { // 根据系统查询项目 if (this.courseSystem) { const { data } = await this.$get(this.api.getProjectListOfSystem, { + pageNum: this.page, + pageSize: this.pageSize, systemId: this.systemId }) if (this.isTheory) { - data.forEach(e => { + data.records.forEach(e => { e.name = e.projectName }) } - this.projects = data + this.projects = data.records + this.total = data.total } else { // 理论查询试卷 if (this.isTheory) { diff --git a/src/pages/match/manage/index.vue b/src/pages/match/manage/index.vue index 7749fef..9a38832 100644 --- a/src/pages/match/manage/index.vue +++ b/src/pages/match/manage/index.vue @@ -74,7 +74,11 @@ export default { ]) }, mounted () { - Setting.dynamicRoute && this.initTabs() + if (Setting.dynamicRoute) { + this.initTabs() + } else { + this.active = 'tab1' + } }, // beforeRouteLeave (to, from, next) { // const { detail } = this.$refs diff --git a/src/pages/product/show/index.vue b/src/pages/product/show/index.vue index 111ee0a..e6a4ed3 100644 --- a/src/pages/product/show/index.vue +++ b/src/pages/product/show/index.vue @@ -319,7 +319,7 @@ export default { back () { const { query } = this.$route query.active ? - this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}`) : + this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}&typeActive=${query.typeActive || 0}&page=${query.page || 1}`) : this.$router.push('list') }, } diff --git a/src/pages/resourse/list/index.vue b/src/pages/resourse/list/index.vue index d9b1373..e4efc5f 100644 --- a/src/pages/resourse/list/index.vue +++ b/src/pages/resourse/list/index.vue @@ -447,32 +447,30 @@ export default { this.pdfSrc = row.fileUrl; this.pdfVisible = true; } else { - this.$get(`${this.api.curriculumGetSubsection}/${row.id}`).then(res => { - this.previewing = true; - this.loadIns = Loading.service(); - this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file"); - if (row.fileType == "pptx") { - this.isPPT = true; - this.isWord = false; - this.isExcel = false; - } else if (row.fileType == "doc" || row.fileType == "docx") { - this.isPPT = false; - this.isWord = true; - this.isExcel = false; - } else if (row.fileType == "xls" || row.fileType == "xlsx") { - this.isExcel = true; - this.isPPT = false; - this.isWord = false; - } else { - this.isPPT = false; - this.isWord = false; - this.isExcel = false; - } - this.iframeSrc = res.previewUrl; - this.$nextTick(() => { - this.iframeOnload(); - }); - }).catch(err => { }) + this.previewing = true + this.loadIns = Loading.service() + this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file") + if (row.fileType == "pptx") { + this.isPPT = true + this.isWord = false + this.isExcel = false + } else if (row.fileType == "doc" || row.fileType == "docx") { + this.isPPT = false + this.isWord = true + this.isExcel = false + } else if (row.fileType == "xls" || row.fileType == "xlsx") { + this.isExcel = true + this.isPPT = false + this.isWord = false + } else { + this.isPPT = false + this.isWord = false + this.isExcel = false + } + this.iframeSrc = 'https://view.officeapps.live.com/op/view.aspx?src=' + row.fileUrl + this.$nextTick(() => { + this.iframeOnload() + }) } }, iframeOnload () { diff --git a/src/pages/resourse/upload.vue b/src/pages/resourse/upload.vue index 75e9db7..ded5f29 100644 --- a/src/pages/resourse/upload.vue +++ b/src/pages/resourse/upload.vue @@ -94,6 +94,7 @@ export default { // 判断文件类型 async handleType (ext) { const res = await this.$post(`${this.api.getFileType}?fileType=${ext}`) + this.form.resourceType = 1 this.form.displayFileType = res.data }, // 自定义上传 diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index dbedcf3..baeaa58 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -22,8 +22,8 @@ @click="tab1Change(item)">{{ item.classificationName }} -
- +
+
+ +

暂无数据

@@ -65,7 +69,7 @@ export default { isSq: Setting.isSq, keyword: this.$route.query.keyword || '', typeActive: +this.$route.query.typeActive || 0, - active: +this.$route.query.active || '', + active: this.$route.query.active ? +this.$route.query.active : '', searchTimer: null, types: [ { @@ -90,6 +94,9 @@ export default { }, ], tabs: [], + page: +this.$route.query.page || 1, + pageSize: 12, + total: 0, products: [], loading: false, @@ -100,7 +107,7 @@ export default { watch: { keyword: function () { clearTimeout(this.searchTimer) - this.searchTimer = setTimeout(this.getList, 500) + this.searchTimer = setTimeout(this.initData, 500) }, }, mounted () { @@ -114,7 +121,7 @@ export default { this.selfBuildCourseType = res.selfBuildCourseType this.tabs = [ ...this.defaultTabs, - ...res.data, + ...this[this.typeActive ? 'selfBuildCourseType' : 'defaultTypes'], ] this.getList() }, @@ -124,37 +131,54 @@ export default { // 最近使用 if (this.active === -1) { const { list } = await this.$post(this.api.recentUse, { + pageNum: this.page, + pageSize: this.pageSize, courseType: this.typeActive, goodsName: this.keyword, }) - this.products = list + this.products = list.records + this.total = list.total this.loading = false } else { if (this.typeActive) { // 我的课程 const res = await this.$post(this.api.selfBuildCourse, { + pageNum: this.page, + pageSize: this.pageSize, curriculumType: this.active, curriculumName: this.keyword, }) - this.products = res.courses + this.products = res.courses.records + this.total = res.courses.total this.loading = false } else { // 校本课程 - const { data } = await this.$get(this.api.schoolCourse, { + const { data } = await this.$post(this.api.schoolCourse, { + pageNum: this.page, + pageSize: this.pageSize, authority: this.active, goodsName: this.keyword, }) - this.products = data + this.products = data.records + this.total = data.total this.loading = false } } }, + handleCurrentChange (val) { + this.page = val + this.getList() + }, + initData () { + this.page = 1 + this.getList() + }, // 记录最近使用 async addRecord (mallId) { await this.$post(`${this.api.recordRecentUsage}?mallId=${mallId}`) }, toProduct (item) { - const params = `&keyword=${this.keyword}&active=${this.active}&typeActive=${this.typeActive}` + const params = `&keyword=${this.keyword}&active=${this.active}&typeActive=${this.typeActive}&page=${this.page}` if (this.typeActive) { this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.goodsName || item.curriculumName)}&mallId=${item.mallId || ''}${params}`) } else { @@ -190,12 +214,12 @@ export default { ...this[id ? 'selfBuildCourseType' : 'defaultTypes'], ] if (this.active !== '' && this.active !== -1) this.active = '' - this.getList() + this.initData() }, // tab切换 tab1Change (item) { this.active = item.classificationId - this.getList() + this.initData() }, } }; diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 7a17e8f..c4a4cff 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -450,7 +450,7 @@ export default { const { query } = this.$route this.fromAdmin ? this.$router.back() : - (this.mallId || query.typeActive) ? this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}&typeActive=${query.typeActive || 0}`) : this.$router.back() + (this.mallId || query.typeActive) ? this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}&typeActive=${query.typeActive || 0}&page=${query.page || 1}`) : this.$router.back() }, init () { this.insertScript()