From 1162bb5b2882f7eed3eaf2f4e3a9baf8041c1746 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 28 Feb 2025 19:42:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E4=B8=BB=E6=9C=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/terminal/index.vue | 37 +------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/src/views/tool/terminal/index.vue b/src/views/tool/terminal/index.vue index 63138d59..7f4c18cb 100644 --- a/src/views/tool/terminal/index.vue +++ b/src/views/tool/terminal/index.vue @@ -2,10 +2,8 @@ import { PageContainer } from 'antdv-pro-layout'; import { Modal } from 'ant-design-vue/es'; import { useFullscreen } from '@vueuse/core'; -import { defineAsyncComponent, reactive, ref, toRaw } from 'vue'; +import { defineAsyncComponent, reactive, ref } from 'vue'; import { parseDuration } from '@/utils/date-utils'; -import { listNeHost } from '@/api/ne/neHost'; -import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import useI18n from '@/hooks/useI18n'; const { t } = useI18n(); const TerminalSSH = defineAsyncComponent( @@ -53,39 +51,6 @@ const hostState: HostStateType = reactive({ data: [], }); -/**查询主机信息列表, pageNum初始页数 */ -function fnGetHostList(pageNum?: number) { - if (hostState.loading) return; - hostState.loading = true; - if (pageNum) { - hostState.params.pageNum = pageNum; - } - // 超过总数不请求 - if (hostState.data.length >= hostState.total && hostState.total !== 0) { - hostState.loading = false; - return; - } - - listNeHost(toRaw(hostState.params)).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - hostState.total = res.total; - hostState.data = hostState.data.concat(res.rows); - // 页数+ - if (hostState.data.length < hostState.total) { - hostState.params.pageNum += 1; - } - } - hostState.loading = false; - }); -} - -/**选择主机 */ -function fnSelectHost() { - if (hostState.loading) return; - hostState.show = true; - fnGetHostList(1); -} - /**连接主机 */ function fnConnectHost(data: Record) { const id = `${Date.now()}`;