举报管理页调整

dev
truthhun 1 year ago
parent db3880a9bc
commit 0c247d98ea

@ -100,12 +100,26 @@ export default {
return []
},
},
defaultSearch: {
type: Object,
default: () => {
return {}
},
},
},
data() {
return {
search: {},
}
},
watch: {
defaultSearch: {
handler(val) {
this.search = { ...val }
},
immediate: true,
},
},
methods: {
onSearch() {
this.$emit('onSearch', this.search)

@ -7,6 +7,7 @@
:show-create="false"
:show-delete="true"
:disabled-delete="selectedRow.length === 0"
:default-search="search"
@onSearch="onSearch"
@onCreate="onCreate"
@onDelete="batchDelete"
@ -98,7 +99,27 @@ export default {
async created() {
this.initSearchForm()
this.initTableListFields()
await this.listReport()
// await this.listReport()
},
watch: {
'$route.query': {
handler() {
this.search.page = parseInt(this.$route.query.page) || 1
this.search.size = parseInt(this.$route.query.size) || 10
this.search.wd = this.$route.query.wd || ''
// this.$route.query.status
if (typeof this.$route.query.status === 'object') {
this.search.status = (this.$route.query.status || []).map((item) =>
parseInt(item)
)
} else if (this.$route.query.status) {
this.search.status = [parseInt(this.$route.query.status) || 0]
}
this.listReport()
},
immediate: true,
},
},
methods: {
async listReport() {
@ -114,15 +135,24 @@ export default {
},
handleSizeChange(val) {
this.search.size = val
this.listReport()
this.$router.push({
query: this.search,
})
// this.listReport()
},
handlePageChange(val) {
this.search.page = val
this.listReport()
this.$router.push({
query: this.search,
})
// this.listReport()
},
onSearch(search) {
this.search = { ...this.search, page: 1, ...search }
this.listReport()
// this.listReport()
this.$router.push({
query: this.search,
})
},
onCreate() {
this.report = { id: 0 }
@ -196,12 +226,12 @@ export default {
{
type: 'select',
label: '状态',
name: 'enable',
name: 'status',
placeholder: '请选择状态',
multiple: true,
options: [
{ label: '启用', value: 1 },
{ label: '禁用', value: 0 },
{ label: '已处理', value: 1 },
{ label: '未处理', value: 0 },
],
},
]

Loading…
Cancel
Save