|
@@ -237,21 +237,27 @@ export default {
|
|
|
return ret
|
|
|
},
|
|
|
searchTable (queryParam) {
|
|
|
- this.dataSource = []
|
|
|
- this.list = []
|
|
|
- this.disabled = true
|
|
|
- this.spinning = true
|
|
|
- // 品类列表
|
|
|
- dealerUpsList(queryParam).then(res => {
|
|
|
- this.$emit('loaded', res.data || [])
|
|
|
- this.dataSource = res.data || []
|
|
|
- // 处理数据
|
|
|
+ if (this.dataSource.length) {
|
|
|
+ this.$emit('loaded', this.dataSource)
|
|
|
this.list = this.formatData(this.dataSource, queryParam)
|
|
|
this.showEmpty = this.list.length <= 0
|
|
|
- this.tableHeight = (this.showEmpty ? 0 : this.maxHeight) + 'px'
|
|
|
- this.spinning = false
|
|
|
- this.disabled = false
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ this.dataSource = []
|
|
|
+ this.list = []
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ // 品类列表
|
|
|
+ dealerUpsList(queryParam).then(res => {
|
|
|
+ this.$emit('loaded', res.data || [])
|
|
|
+ this.dataSource = res.data || []
|
|
|
+ // 处理数据
|
|
|
+ this.list = this.formatData(this.dataSource, queryParam)
|
|
|
+ this.showEmpty = this.list.length <= 0
|
|
|
+ this.tableHeight = (this.showEmpty ? 0 : this.maxHeight) + 'px'
|
|
|
+ this.spinning = false
|
|
|
+ this.disabled = false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
handleEdit (record, e) {
|
|
|
console.log(e)
|