教学大纲新增显示排序问题

This commit is contained in:
2026-09-16 09:24:10 +08:00
parent b30e39f91a
commit b05c4d33db
2 changed files with 18 additions and 11 deletions
@@ -77,7 +77,7 @@ public class ZYJXJHBServiceImpl implements ZYJXJHBService {
if (ty != null) {
wrapper.eq(ZYJXJHB::getTy, ty);
}
wrapper.orderByAsc(ZYJXJHB::getZydh);
wrapper.orderByDesc(ZYJXJHB::getQysj).orderByAsc(ZYJXJHB::getZydh);
Page<ZYJXJHB> result = zyjxjhbMapper.selectPage(page, wrapper);
return new PageResult<>(result.getRecords(), result.getTotal(),
query.getPageNum(), query.getPageSize());
@@ -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()
},
/* ---------- 工具 ---------- */