实验台加分页

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) {
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) {

@ -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

@ -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')
},
}

@ -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 () {

@ -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
},
//

@ -22,8 +22,8 @@
@click="tab1Change(item)">{{ item.classificationName }}</a>
</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-if="isZj || isSq" class="cover" :style="{ backgroundImage: 'url(/images/' + i + '.png)' }"></div>
<div v-else class="cover" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"></div>
@ -33,12 +33,16 @@
<a v-else>进入实验</a>
</div>
</div>
</template>
<div class="empty flex-1" v-else>
<div>
<img src="@/assets/img/none.png" alt="">
<p>暂无数据</p>
</div>
</div>
<div class="pagination">
<el-pagination background :current-page="page" layout="total, prev, pager, next" :total="total"
:page-size="pageSize" @current-change="handleCurrentChange"></el-pagination>
</div>
</template>
<div class="empty flex-1" v-else>
<div>
<img src="@/assets/img/none.png" alt="">
<p>暂无数据</p>
</div>
</div>
</div>
@ -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()
},
}
};

@ -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()

Loading…
Cancel
Save