- -
+ -
+ {{ iCount }}
@@ -35,7 +35,7 @@ export default {
},
count: {
type: [Number, String, Promise],
- default: 0
+ default: null
},
route: {
type: [String, Object],
diff --git a/src/components/Table/ListTable/TableAction/QuickFilter.vue b/src/components/Table/ListTable/TableAction/QuickFilter.vue
index fe8fa7caf..4869b2d40 100644
--- a/src/components/Table/ListTable/TableAction/QuickFilter.vue
+++ b/src/components/Table/ListTable/TableAction/QuickFilter.vue
@@ -20,7 +20,7 @@
>
{{ option.label }}
- (-)
+ ({{ option.count }})
@@ -32,19 +32,13 @@
-
@@ -76,10 +70,11 @@ export default {
},
data() {
return {
- iFilters: this.cleanFilters(),
- iSummary: this.cleanSummary(),
+ iFilters: [],
+ iSummary: [],
filtered: {},
- activeFilters: []
+ activeFilters: [],
+ reCount: false
}
},
computed: {
@@ -92,7 +87,32 @@ export default {
}
}
},
+ watch: {
+ tableUrl() {
+ this.generateCount()
+ }
+ },
+ mounted() {
+ this.iFilters = this.cleanFilters()
+ this.iSummary = this.cleanSummary()
+ this.generateCount()
+ },
methods: {
+ async generateCount() {
+ this.iFilters.forEach(category => {
+ category.options.forEach(option => {
+ if (option.hasCount) {
+ option.count = null
+ this.getCount(option)
+ }
+ })
+ })
+
+ this.iSummary.forEach(item => {
+ item.count = null
+ this.getCount(item)
+ })
+ },
async getCount(item) {
if (item.count || item.count === 0) {
return item.count
@@ -117,6 +137,7 @@ export default {
category: 'summary',
label: item.title,
...item,
+ count: null,
filter: item.filter || {},
active: false
}
@@ -170,138 +191,138 @@ export default {
}
diff --git a/src/components/Table/TreeTable/index.vue b/src/components/Table/TreeTable/index.vue
index e97879b1b..63458212b 100644
--- a/src/components/Table/TreeTable/index.vue
+++ b/src/components/Table/TreeTable/index.vue
@@ -7,7 +7,9 @@
:style="{width: treeWidth}"
class="left"
>
-