|
|
@@ -8,6 +8,7 @@ const ButtonConfig = {
|
|
|
|
|
|
// {
|
|
|
// keepalive?: false,
|
|
|
+// nonPagination?: false,
|
|
|
// singlePage?: false,
|
|
|
// pagination?: Object,
|
|
|
// condition?: Object,
|
|
|
@@ -78,6 +79,9 @@ export default {
|
|
|
isManualPagination () {
|
|
|
return this.schema.singlePage
|
|
|
},
|
|
|
+ isNeedPagination () {
|
|
|
+ return !this.schema.nonPagination
|
|
|
+ },
|
|
|
paginationConfig () {
|
|
|
return this.schema.pagination
|
|
|
}
|
|
|
@@ -141,7 +145,7 @@ export default {
|
|
|
options.loading = false
|
|
|
options.error = false
|
|
|
options.totalCount = totalCount || data.length
|
|
|
- if (this.isManualPagination) {
|
|
|
+ if (this.isNeedPagination && this.isManualPagination) {
|
|
|
const { pageNum, pageSize } = options.params
|
|
|
data = data.slice((pageNum - 1) * pageSize, pageNum * pageSize)
|
|
|
}
|
|
|
@@ -201,18 +205,18 @@ export default {
|
|
|
resetCondition (condition) {
|
|
|
const params = this.options.params
|
|
|
condition && Object.keys(condition).forEach(key => {
|
|
|
- const paramValue = params[key]
|
|
|
- if (paramValue != null && paramValue !== '') {
|
|
|
+ const paramValue = params[key] ?? ''
|
|
|
+ if (paramValue !== '') {
|
|
|
const value = condition[key]
|
|
|
const filter = this.filterMap[key]
|
|
|
- switch (filter?.key) {
|
|
|
+ switch (filter?.type) {
|
|
|
case 'select':
|
|
|
if (paramValue !== value) {
|
|
|
params[key] = filter.placeholder ? void 0 : value
|
|
|
}
|
|
|
break
|
|
|
case 'search':
|
|
|
- if (new RegExp(paramValue).test(value)) {
|
|
|
+ if (!new RegExp(paramValue).test(value)) {
|
|
|
params[key] = ''
|
|
|
}
|
|
|
break
|