fix: 处理user列表状态开关的问题
This commit is contained in:
@@ -63,6 +63,7 @@ import dataListMixin from '@/mixins/data-list'
|
||||
import userTable from '@/components/table/administration/UserTable'
|
||||
import userBox from '@/components/rightBox/settings/UserBox'
|
||||
import { api } from '@/utils/api'
|
||||
import {get} from '@/utils/http'
|
||||
|
||||
export default {
|
||||
name: 'User',
|
||||
@@ -88,6 +89,43 @@ export default {
|
||||
},
|
||||
tableId: 'userTable'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTableData (params, isAll, isClearType) {
|
||||
if (isAll) {
|
||||
this.searchLabel = null
|
||||
} else if (isClearType) {
|
||||
// this.searchLabel.tagType = ''
|
||||
this.searchLabel.type = ''// 换新接口需要修改的属性名称
|
||||
}
|
||||
if (params) {
|
||||
this.searchLabel = { ...this.searchLabel, ...params }
|
||||
}
|
||||
this.searchLabel = { ...this.searchLabel, ...this.pageObj }
|
||||
this.tools.loading = true
|
||||
delete this.searchLabel.total
|
||||
let listUrl = this.url
|
||||
if (this.listUrl) {
|
||||
listUrl = this.listUrl
|
||||
}
|
||||
get(listUrl, this.searchLabel).then(response => {
|
||||
this.tools.loading = false
|
||||
if (response.code === 200) {
|
||||
for (let i = 0; i < response.data.list.length; i++) {
|
||||
response.data.list[i].status = response.data.list[i].status + ''
|
||||
}
|
||||
this.tableData = response.data.list
|
||||
this.pageObj.total = response.data.total
|
||||
} else {
|
||||
console.error(response)
|
||||
if (response.message) {
|
||||
this.$message.error(response.message)
|
||||
} else {
|
||||
this.$message.error('Something went wrong...')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -157,9 +157,9 @@ export default {
|
||||
mounted () {
|
||||
this.timeoutFunc = setTimeout(() => {
|
||||
this.handleDynamicChartHeight()
|
||||
}, 400)
|
||||
}, 500)
|
||||
this.handleDynamicChartHeight()
|
||||
this.debounceFunc = _.debounce(this.handleDynamicChartHeight, 400)
|
||||
this.debounceFunc = _.debounce(this.handleDynamicChartHeight, 500)
|
||||
window.addEventListener('resize', this.debounceFunc)
|
||||
},
|
||||
beforeUnmount () {
|
||||
|
||||
Reference in New Issue
Block a user