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,7 +436,9 @@ export default {
} }
}, },
getDataList () { getDataList () {
console.log(this.activeName)
this.loading = true this.loading = true
if (this.activeName === 'combination') {
this.$dataRoomAxios.get('/bigScreen/design/page', { this.$dataRoomAxios.get('/bigScreen/design/page', {
parentCode: this.code || null, parentCode: this.code || null,
current: this.current, current: this.current,
@ -441,13 +447,14 @@ export default {
type: 'component' type: 'component'
}) })
.then((data) => { .then((data) => {
console.log('1', data)
this.list = data.list this.list = data.list
this.totalCount = data.totalCount this.totalCount = data.totalCount
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
} else if (this.activeName === 'bizComponent') {
getBizComponentPage({ getBizComponentPage({
parentCode: this.code || null, parentCode: this.code || null,
current: this.current, current: this.current,
@ -455,10 +462,12 @@ export default {
searchKey: this.searchKey, searchKey: this.searchKey,
name: this.name name: this.name
}).then((data) => { }).then((data) => {
console.log('2', data)
this.bizComponentList = data.list this.bizComponentList = data.list
this.totalCount = data.totalCount this.bizComponenTotalCount = data.totalCount
this.loading = false this.loading = false
}) })
}
}, },
// //
getCatalogList () { getCatalogList () {

Loading…
Cancel
Save