实验台加分页

dev_202412
yujialong 2 months ago
parent 894d5fbe9e
commit adaf3b1c13
  1. 7
      src/pages/match/add/set.vue
  2. 6
      src/pages/match/manage/index.vue
  3. 2
      src/pages/product/show/index.vue
  4. 50
      src/pages/resourse/list/index.vue
  5. 1
      src/pages/resourse/upload.vue
  6. 60
      src/pages/station/list/index.vue
  7. 2
      src/pages/station/preview/index.vue

@ -296,14 +296,17 @@ export default {
// //
if (this.courseSystem) { if (this.courseSystem) {
const { data } = await this.$get(this.api.getProjectListOfSystem, { const { data } = await this.$get(this.api.getProjectListOfSystem, {
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId systemId: this.systemId
}) })
if (this.isTheory) { if (this.isTheory) {
data.forEach(e => { data.records.forEach(e => {
e.name = e.projectName e.name = e.projectName
}) })
} }
this.projects = data this.projects = data.records
this.total = data.total
} else { } else {
// //
if (this.isTheory) { if (this.isTheory) {

@ -74,7 +74,11 @@ export default {
]) ])
}, },
mounted () { mounted () {
Setting.dynamicRoute && this.initTabs() if (Setting.dynamicRoute) {
this.initTabs()
} else {
this.active = 'tab1'
}
}, },
// beforeRouteLeave (to, from, next) { // beforeRouteLeave (to, from, next) {
// const { detail } = this.$refs // const { detail } = this.$refs

@ -319,7 +319,7 @@ export default {
back () { back () {
const { query } = this.$route const { query } = this.$route
query.active ? 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') this.$router.push('list')
}, },
} }

@ -447,32 +447,30 @@ export default {
this.pdfSrc = row.fileUrl; this.pdfSrc = row.fileUrl;
this.pdfVisible = true; this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.curriculumGetSubsection}/${row.id}`).then(res => { this.previewing = true
this.previewing = true; this.loadIns = Loading.service()
this.loadIns = Loading.service(); this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file")
this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file"); if (row.fileType == "pptx") {
if (row.fileType == "pptx") { this.isPPT = true
this.isPPT = true; this.isWord = false
this.isWord = false; this.isExcel = false
this.isExcel = false; } else if (row.fileType == "doc" || row.fileType == "docx") {
} else if (row.fileType == "doc" || row.fileType == "docx") { this.isPPT = false
this.isPPT = false; this.isWord = true
this.isWord = true; this.isExcel = false
this.isExcel = false; } else if (row.fileType == "xls" || row.fileType == "xlsx") {
} else if (row.fileType == "xls" || row.fileType == "xlsx") { this.isExcel = true
this.isExcel = true; this.isPPT = false
this.isPPT = false; this.isWord = false
this.isWord = false; } else {
} else { this.isPPT = false
this.isPPT = false; this.isWord = false
this.isWord = false; this.isExcel = false
this.isExcel = false; }
} this.iframeSrc = 'https://view.officeapps.live.com/op/view.aspx?src=' + row.fileUrl
this.iframeSrc = res.previewUrl; this.$nextTick(() => {
this.$nextTick(() => { this.iframeOnload()
this.iframeOnload(); })
});
}).catch(err => { })
} }
}, },
iframeOnload () { iframeOnload () {

@ -94,6 +94,7 @@ export default {
// //
async handleType (ext) { async handleType (ext) {
const res = await this.$post(`${this.api.getFileType}?fileType=${ext}`) const res = await this.$post(`${this.api.getFileType}?fileType=${ext}`)
this.form.resourceType = 1
this.form.displayFileType = res.data this.form.displayFileType = res.data
}, },
// //

@ -22,8 +22,8 @@
@click="tab1Change(item)">{{ item.classificationName }}</a> @click="tab1Change(item)">{{ item.classificationName }}</a>
</div> </div>
</div> </div>
<div class="curs"> <template v-if="products.length">
<template v-if="products.length"> <div class="curs">
<div v-for="(item, i) in products" class="item" :title="item.goodsName" @click="toProduct(item)" :key="i"> <div v-for="(item, i) in products" class="item" :title="item.goodsName" @click="toProduct(item)" :key="i">
<div v-if="isZj || isSq" class="cover" :style="{ backgroundImage: 'url(/images/' + i + '.png)' }"></div> <div v-if="isZj || isSq" class="cover" :style="{ backgroundImage: 'url(/images/' + i + '.png)' }"></div>
<div v-else class="cover" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"></div> <div v-else class="cover" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"></div>
@ -33,12 +33,16 @@
<a v-else>进入实验</a> <a v-else>进入实验</a>
</div> </div>
</div> </div>
</template> </div>
<div class="empty flex-1" v-else> <div class="pagination">
<div> <el-pagination background :current-page="page" layout="total, prev, pager, next" :total="total"
<img src="@/assets/img/none.png" alt=""> :page-size="pageSize" @current-change="handleCurrentChange"></el-pagination>
<p>暂无数据</p> </div>
</div> </template>
<div class="empty flex-1" v-else>
<div>
<img src="@/assets/img/none.png" alt="">
<p>暂无数据</p>
</div> </div>
</div> </div>
</div> </div>
@ -65,7 +69,7 @@ export default {
isSq: Setting.isSq, isSq: Setting.isSq,
keyword: this.$route.query.keyword || '', keyword: this.$route.query.keyword || '',
typeActive: +this.$route.query.typeActive || 0, typeActive: +this.$route.query.typeActive || 0,
active: +this.$route.query.active || '', active: this.$route.query.active ? +this.$route.query.active : '',
searchTimer: null, searchTimer: null,
types: [ types: [
{ {
@ -90,6 +94,9 @@ export default {
}, },
], ],
tabs: [], tabs: [],
page: +this.$route.query.page || 1,
pageSize: 12,
total: 0,
products: [], products: [],
loading: false, loading: false,
@ -100,7 +107,7 @@ export default {
watch: { watch: {
keyword: function () { keyword: function () {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.getList, 500) this.searchTimer = setTimeout(this.initData, 500)
}, },
}, },
mounted () { mounted () {
@ -114,7 +121,7 @@ export default {
this.selfBuildCourseType = res.selfBuildCourseType this.selfBuildCourseType = res.selfBuildCourseType
this.tabs = [ this.tabs = [
...this.defaultTabs, ...this.defaultTabs,
...res.data, ...this[this.typeActive ? 'selfBuildCourseType' : 'defaultTypes'],
] ]
this.getList() this.getList()
}, },
@ -124,37 +131,54 @@ export default {
// 使 // 使
if (this.active === -1) { if (this.active === -1) {
const { list } = await this.$post(this.api.recentUse, { const { list } = await this.$post(this.api.recentUse, {
pageNum: this.page,
pageSize: this.pageSize,
courseType: this.typeActive, courseType: this.typeActive,
goodsName: this.keyword, goodsName: this.keyword,
}) })
this.products = list this.products = list.records
this.total = list.total
this.loading = false this.loading = false
} else { } else {
if (this.typeActive) { if (this.typeActive) {
// //
const res = await this.$post(this.api.selfBuildCourse, { const res = await this.$post(this.api.selfBuildCourse, {
pageNum: this.page,
pageSize: this.pageSize,
curriculumType: this.active, curriculumType: this.active,
curriculumName: this.keyword, curriculumName: this.keyword,
}) })
this.products = res.courses this.products = res.courses.records
this.total = res.courses.total
this.loading = false this.loading = false
} else { } 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, authority: this.active,
goodsName: this.keyword, goodsName: this.keyword,
}) })
this.products = data this.products = data.records
this.total = data.total
this.loading = false this.loading = false
} }
} }
}, },
handleCurrentChange (val) {
this.page = val
this.getList()
},
initData () {
this.page = 1
this.getList()
},
// 使 // 使
async addRecord (mallId) { async addRecord (mallId) {
await this.$post(`${this.api.recordRecentUsage}?mallId=${mallId}`) await this.$post(`${this.api.recordRecentUsage}?mallId=${mallId}`)
}, },
toProduct (item) { 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) { if (this.typeActive) {
this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.goodsName || item.curriculumName)}&mallId=${item.mallId || ''}${params}`) this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.goodsName || item.curriculumName)}&mallId=${item.mallId || ''}${params}`)
} else { } else {
@ -190,12 +214,12 @@ export default {
...this[id ? 'selfBuildCourseType' : 'defaultTypes'], ...this[id ? 'selfBuildCourseType' : 'defaultTypes'],
] ]
if (this.active !== '' && this.active !== -1) this.active = '' if (this.active !== '' && this.active !== -1) this.active = ''
this.getList() this.initData()
}, },
// tab // tab
tab1Change (item) { tab1Change (item) {
this.active = item.classificationId this.active = item.classificationId
this.getList() this.initData()
}, },
} }
}; };

@ -450,7 +450,7 @@ export default {
const { query } = this.$route const { query } = this.$route
this.fromAdmin ? this.fromAdmin ?
this.$router.back() : 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 () { init () {
this.insertScript() this.insertScript()

Loading…
Cancel
Save