|
@@ -61,7 +61,8 @@
|
|
|
:row-key="(record) => record.id"
|
|
:row-key="(record) => record.id"
|
|
|
:custom-row="customRow"
|
|
:custom-row="customRow"
|
|
|
:pagination="false"
|
|
:pagination="false"
|
|
|
- style="width: 100%;"
|
|
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :loading="tableLoading"
|
|
|
>
|
|
>
|
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.dataIndex === 'postTitle'">
|
|
<template v-if="column.dataIndex === 'postTitle'">
|
|
@@ -95,6 +96,7 @@
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
|
|
|
+ const tableLoading = ref(false)
|
|
|
let searchFormState = reactive({
|
|
let searchFormState = reactive({
|
|
|
sortOrder: 0,
|
|
sortOrder: 0,
|
|
|
postTitle: '',
|
|
postTitle: '',
|
|
@@ -252,33 +254,44 @@
|
|
|
loadData(pagination.value)
|
|
loadData(pagination.value)
|
|
|
}
|
|
}
|
|
|
const loadData = (parameter, a) => {
|
|
const loadData = (parameter, a) => {
|
|
|
|
|
+ tableLoading.value = true
|
|
|
if (exType.value == 2) {
|
|
if (exType.value == 2) {
|
|
|
let postExtend = moduleTypeList.value.find((r) => r.id == searchFormState.sortOrder).state
|
|
let postExtend = moduleTypeList.value.find((r) => r.id == searchFormState.sortOrder).state
|
|
|
- return forumApi.moreList(Object.assign(parameter, searchFormState, { postExtend: postExtend })).then((data) => {
|
|
|
|
|
- tableTotal.value = data.total
|
|
|
|
|
- if (a) {
|
|
|
|
|
- tableData.value = Object.assign(tableData.value, data.records)
|
|
|
|
|
- } else {
|
|
|
|
|
- if (data) {
|
|
|
|
|
- tableData.value = data.records
|
|
|
|
|
|
|
+ return forumApi
|
|
|
|
|
+ .moreList(Object.assign(parameter, searchFormState, { postExtend: postExtend }))
|
|
|
|
|
+ .then((data) => {
|
|
|
|
|
+ tableTotal.value = data.total
|
|
|
|
|
+ if (a) {
|
|
|
|
|
+ tableData.value = Object.assign(tableData.value, data.records)
|
|
|
} else {
|
|
} else {
|
|
|
- tableData.value = []
|
|
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ tableData.value = data.records
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tableData.value = []
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ tableLoading.value = false
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- return forumApi.forumList(Object.assign(parameter, searchFormState)).then((data) => {
|
|
|
|
|
- tableTotal.value = data.total
|
|
|
|
|
- if (a) {
|
|
|
|
|
- tableData.value = tableData.value.concat(data.records)
|
|
|
|
|
- } else {
|
|
|
|
|
- if (data) {
|
|
|
|
|
- tableData.value = data.records
|
|
|
|
|
|
|
+ return forumApi
|
|
|
|
|
+ .forumList(Object.assign(parameter, searchFormState))
|
|
|
|
|
+ .then((data) => {
|
|
|
|
|
+ tableTotal.value = data.total
|
|
|
|
|
+ if (a) {
|
|
|
|
|
+ tableData.value = tableData.value.concat(data.records)
|
|
|
} else {
|
|
} else {
|
|
|
- tableData.value = []
|
|
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ tableData.value = data.records
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tableData.value = []
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ tableLoading.value = false
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|