fix: 修复组件库,分页数据被自定义组件、业务组件两个tab 共用的问题

main
wu.jian2 2 years ago
parent 36f6a2fd54
commit 757ad6f3a5

@ -247,7 +247,7 @@
:page-size="size" :page-size="size"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
:total="totalCount" :total="bizComponenTotalCount"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:current-page="current" :current-page="current"
@current-change="currentChangeHandle" @current-change="currentChangeHandle"
@ -368,7 +368,8 @@ export default {
activeName: 'combination', activeName: 'combination',
remoteComponentlist: [], remoteComponentlist: [],
// //
bizComponentList: [] bizComponentList: [],
bizComponenTotalCount: 0
} }
}, },
computed: { computed: {
@ -385,6 +386,9 @@ export default {
watch: { watch: {
activeName () { activeName () {
this.getCatalogList() this.getCatalogList()
this.current = 1
this.size = 10
this.getDataList()
} }
}, },
mounted () { mounted () {
@ -432,33 +436,38 @@ export default {
} }
}, },
getDataList () { getDataList () {
console.log(this.activeName)
this.loading = true this.loading = true
this.$dataRoomAxios.get('/bigScreen/design/page', { if (this.activeName === 'combination') {
parentCode: this.code || null, this.$dataRoomAxios.get('/bigScreen/design/page', {
current: this.current, parentCode: this.code || null,
size: this.size, current: this.current,
searchKey: this.searchKey, size: this.size,
type: 'component' searchKey: this.searchKey,
}) type: 'component'
.then((data) => {
this.list = data.list
this.totalCount = data.totalCount
}) })
.finally(() => { .then((data) => {
console.log('1', data)
this.list = data.list
this.totalCount = data.totalCount
})
.finally(() => {
this.loading = false
})
} else if (this.activeName === 'bizComponent') {
getBizComponentPage({
parentCode: this.code || null,
current: this.current,
size: this.size,
searchKey: this.searchKey,
name: this.name
}).then((data) => {
console.log('2', data)
this.bizComponentList = data.list
this.bizComponenTotalCount = data.totalCount
this.loading = false this.loading = false
}) })
}
getBizComponentPage({
parentCode: this.code || null,
current: this.current,
size: this.size,
searchKey: this.searchKey,
name: this.name
}).then((data) => {
this.bizComponentList = data.list
this.totalCount = data.totalCount
this.loading = false
})
}, },
// //
getCatalogList () { getCatalogList () {

Loading…
Cancel
Save