This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nezha-nezha-fronted/nezha-fronted/src/components/common/mixin/detailViewMixin.js

48 lines
1.2 KiB
JavaScript
Raw Normal View History

export default {
props: {},
data () {
return {
detailType: 'list',
detailViewRightObj: '',
2021-10-12 16:53:59 +08:00
detailViewLoading: false,
detailTimer: ''
}
},
created () {
this.detailType = localStorage.getItem('detail-view-' + this.tableId) || 'list'
},
methods: {
changeDetailType (flag) {
if (this.detailType === flag) {
return
}
this.detailType = flag
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
this.pageObj.pageNo = 1
setTimeout(() => {
this.detailViewLoading = false
this.$refs.clickSearch && this.$refs.clickSearch.needMore()
}, 100)
},
2021-10-12 16:53:59 +08:00
searchDetailTop () {
if (!this.detailTimer) {
this.detailTimer = setTimeout(() => {
this.getTableData()
2021-10-12 16:53:59 +08:00
clearTimeout(this.detailTimer)
this.detailTimer = ''
}, 1000)
} else {
clearTimeout(this.detailTimer)
this.detailTimer = setTimeout(() => {
this.getTableData()
2021-10-12 16:53:59 +08:00
clearTimeout(this.detailTimer)
this.detailTimer = ''
}, 1000)
}
},
detailViewRightShow (item) {
this.detailViewRightObj = item
}
}
}