forked from liweijie/education
教学大纲新增显示排序问题
This commit is contained in:
@@ -406,11 +406,19 @@ export default {
|
||||
/* ---------- 列表加载 ---------- */
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
listByZydhAndTy({ zydh: this.searchForm.zydh, ty: this.searchForm.ty }).then(response => {
|
||||
const data = response.data || []
|
||||
this.localPaging = false
|
||||
const query = {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
ty: this.searchForm.ty
|
||||
}
|
||||
if (this.searchForm.zydh) {
|
||||
query.zydh = this.searchForm.zydh
|
||||
}
|
||||
listByZydhAndTy(query).then(response => {
|
||||
const data = response.data || {}
|
||||
this.tableData = Array.isArray(data) ? data : (data.records || [])
|
||||
this.total = this.tableData.length
|
||||
this.localPaging = true
|
||||
this.total = Array.isArray(data) ? data.length : Number(data.total || 0)
|
||||
}).catch(() => {
|
||||
this.tableData = []
|
||||
this.total = 0
|
||||
@@ -458,6 +466,9 @@ export default {
|
||||
req.then(() => {
|
||||
this.$message.success(isEdit ? '修改成功' : '新增成功')
|
||||
this.dialog.visible = false
|
||||
if (!isEdit) {
|
||||
this.pageNum = 1
|
||||
}
|
||||
this.fetchList()
|
||||
}).finally(() => {
|
||||
this.dialog.submitting = false
|
||||
@@ -517,15 +528,11 @@ export default {
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size
|
||||
this.pageNum = 1
|
||||
if (!this.localPaging) {
|
||||
this.fetchList()
|
||||
}
|
||||
this.fetchList()
|
||||
},
|
||||
handlePageChange(page) {
|
||||
this.pageNum = page
|
||||
if (!this.localPaging) {
|
||||
this.fetchList()
|
||||
}
|
||||
this.fetchList()
|
||||
},
|
||||
|
||||
/* ---------- 工具 ---------- */
|
||||
|
||||
Reference in New Issue
Block a user