perf: 调整
This commit is contained in:
@ -9,12 +9,12 @@
|
|||||||
@cancel="onClose"
|
@cancel="onClose"
|
||||||
centered
|
centered
|
||||||
>
|
>
|
||||||
<Tabs :activeKey="activeTab" @change="handleTabClick">
|
<Tabs v-model:activeKey="activeTab" @change="handleTabClick">
|
||||||
<TabPane key="0" tab="导入"> </TabPane>
|
<TabPane key="1" tab="导入"> </TabPane>
|
||||||
<TabPane key="1" tab="导出"> </TabPane>
|
<TabPane key="2" tab="导出"> </TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<component :is="activeTab === '0' ? ImportTask : ExportTask" ref="componentRef" />
|
<component :is="activeTab === '1' ? ImportTask : ExportTask" ref="componentRef" />
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
@ -28,12 +28,12 @@ import ImportTask from './components/import-task';
|
|||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const componentRef = ref(null);
|
const componentRef = ref(null);
|
||||||
const activeTab = ref('0');
|
const activeTab = ref('1');
|
||||||
|
|
||||||
let timer = null;
|
let timer = null;
|
||||||
|
|
||||||
const handleTabClick = (key) => {
|
const handleTabClick = (key) => {
|
||||||
activeTab.value = key;
|
// activeTab.value = key;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
@ -44,13 +44,14 @@ const getData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
getData();
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
getData();
|
||||||
|
});
|
||||||
|
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
getData();
|
getData();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
visible.value = true;
|
|
||||||
};
|
};
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
activeTab.value = '0';
|
activeTab.value = '0';
|
||||||
|
|||||||
Reference in New Issue
Block a user