feat(ui): tree views - add page initialization loading

This commit is contained in:
LH_R
2025-08-19 18:34:44 +08:00
parent 0603783574
commit 6112dc83ef

View File

@@ -1,6 +1,9 @@
<template> <template>
<div :style="{ marginBottom: '-24px' }"> <div :style="{ marginBottom: '-24px' }">
<div v-if="!subscribeTreeViewCiTypesLoading && subscribeTreeViewCiTypes.length === 0"> <div v-if="subscribeTreeViewCiTypesLoading" class="page-loading">
<a-spin size="large" />
</div>
<div v-else-if="subscribeTreeViewCiTypes.length === 0">
<a-alert banner> <a-alert banner>
<template #message> <template #message>
<span>{{ $t('cmdb.preference.tips1') }}</span> <span>{{ $t('cmdb.preference.tips1') }}</span>
@@ -638,7 +641,11 @@ export default {
}, },
columnDrop() { columnDrop() {
this.$nextTick(() => { this.$nextTick(() => {
const xTable = this.$refs.xTable.getVxetableRef() const xTable = this.$refs?.xTable?.getVxetableRef?.()
if (!xTable) {
return
}
this.sortable = Sortable.create( this.sortable = Sortable.create(
xTable.$el.querySelector('.body--wrapper>.vxe-table--header .vxe-header--row'), xTable.$el.querySelector('.body--wrapper>.vxe-table--header .vxe-header--row'),
{ {
@@ -1015,6 +1022,11 @@ export default {
<style lang="less"> <style lang="less">
@import '../index.less'; @import '../index.less';
.page-loading {
text-align: center;
padding-top: 150px;
}
.tree-views { .tree-views {
width: 100%; width: 100%;
height: calc(100% - 32px); height: calc(100% - 32px);