From de38003fe769cdc3ba0697a9b407bb1b7e9bdf15 Mon Sep 17 00:00:00 2001 From: hailinxiao Date: Tue, 24 Sep 2024 18:21:30 +0800 Subject: [PATCH] =?UTF-8?q?chore(frontend):=20=E7=A7=BB=E9=99=A4=E5=86=97?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=20#7120?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/.vscode/settings.json | 2 +- dbm-ui/frontend/babel.config.js | 27 ------- dbm-ui/frontend/bkuiVueResolver.ts | 72 ----------------- dbm-ui/frontend/components.d.ts | 29 ------- dbm-ui/frontend/env.d.ts | 43 +++++++---- .../src/components/db-table/index.vue | 26 +++---- .../components/host-preview/HostPreview.vue | 26 +++---- .../src/components/ip-selector/IpSelector.vue | 30 ++++---- .../src/components/router-back/Index.vue | 2 +- dbm-ui/frontend/src/hooks/useBeforeClose.ts | 2 +- dbm-ui/frontend/src/main.ts | 4 - .../src/services/model/ticket/ticket.ts | 4 +- .../frontend/src/services/source/ipchooser.ts | 12 ++- .../src/services/types/hostDetails.ts | 26 ++++--- dbm-ui/frontend/src/services/types/ticket.ts | 41 +++++----- .../types/auto-import-global-component.d.ts | 7 -- dbm-ui/frontend/src/types/bkui-vue.ts | 43 ----------- dbm-ui/frontend/src/types/global.d.ts | 7 -- dbm-ui/frontend/src/types/index.d.ts | 15 ---- dbm-ui/frontend/src/types/vite-env.d.ts | 16 ---- .../frontend/src/utils/getMenuListSearch.ts | 10 +-- .../db-configure/components/PublishRecord.vue | 16 ++-- .../db-configure/components/ReadonlyTable.vue | 45 ++++++----- .../diff-compare/components/ValueDiff.vue | 33 +++++--- .../src/views/db-configure/hooks/useDiff.ts | 10 +-- .../big-data-host-table/HdfsHostTable.vue | 40 ++++------ .../big-data-host-table/RenderHostTable.vue | 46 +++++------ .../es-host-table/index.vue | 20 ++--- .../cluster-event-change/EventChange.vue | 46 ++++------- .../db-manage/elastic-search/apply/Index.vue | 11 +-- .../elastic-search/common/expansion/Index.vue | 4 +- .../list/components/list/Index.vue | 10 +-- .../src/views/db-manage/hdfs/apply/Index.vue | 15 ++-- .../db-manage/hdfs/common/expansion/Index.vue | 4 +- .../hdfs/list/components/list/Index.vue | 10 +-- .../src/views/db-manage/kafka/apply/Index.vue | 11 +-- .../kafka/common/expansion/Index.vue | 4 +- .../kafka/list/components/list/Index.vue | 10 +-- .../components/list/Index.vue | 10 +-- .../components/list/Index.vue | 10 +-- .../mysql/apply/components/PreviewTable.vue | 3 +- .../components/detail/components/Config.vue | 77 +++++++++++-------- .../pulsar/common/expansion/Index.vue | 4 +- .../pulsar/list/components/list/Index.vue | 10 +-- .../redis/common/cluster-oprations/Backup.vue | 24 +++--- .../page1/components/RenderTargetCluster.vue | 11 ++- .../components/RenderManualHost.vue | 4 +- .../components/RenderManualInput.vue | 5 +- .../components/RenderRedis.vue | 6 +- .../components/RenderRedisHost.vue | 5 +- .../components/detail/components/Config.vue | 49 ++++++------ .../components/detail/components/Config.vue | 4 +- .../redis/list/components/list/Index.vue | 14 ++-- .../detail/components/EventChange.vue | 22 +----- .../apply/components/PreviewTable.vue | 3 +- .../ha-cluster-list/components/List.vue | 10 +-- .../single-cluster/components/List.vue | 10 +-- .../detail/components/ParamsConfig.vue | 70 +++++++++-------- .../tendb-cluster/permission-list/Index.vue | 3 +- .../src/views/task-history/common/types.ts | 6 +- .../task-history/components/PreviewHost.vue | 46 +++++------ .../components/RedisResultFiles.vue | 44 ++++++----- .../src/views/task-history/pages/index.vue | 6 +- dbm-ui/frontend/tsconfig.json | 2 +- dbm-ui/frontend/vite.config.mts | 6 +- 65 files changed, 485 insertions(+), 758 deletions(-) delete mode 100644 dbm-ui/frontend/babel.config.js delete mode 100644 dbm-ui/frontend/bkuiVueResolver.ts delete mode 100644 dbm-ui/frontend/components.d.ts delete mode 100644 dbm-ui/frontend/src/types/auto-import-global-component.d.ts delete mode 100644 dbm-ui/frontend/src/types/bkui-vue.ts delete mode 100644 dbm-ui/frontend/src/types/global.d.ts delete mode 100644 dbm-ui/frontend/src/types/vite-env.d.ts diff --git a/dbm-ui/frontend/.vscode/settings.json b/dbm-ui/frontend/.vscode/settings.json index 283c4db563..1f2666a091 100644 --- a/dbm-ui/frontend/.vscode/settings.json +++ b/dbm-ui/frontend/.vscode/settings.json @@ -57,4 +57,4 @@ "titleBar.inactiveForeground": "#15202b99" }, "typescript.tsdk": "node_modules/typescript/lib" -} +} \ No newline at end of file diff --git a/dbm-ui/frontend/babel.config.js b/dbm-ui/frontend/babel.config.js deleted file mode 100644 index e9cae0e843..0000000000 --- a/dbm-ui/frontend/babel.config.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. -*/ - -module.exports = { - plugins: [ - [ - 'import', - { - libraryName: 'bkui-vue', - style: (name) => { - const index = name.lastIndexOf('/'); - return `${name}${name.slice(index)}.css`; - }, - }, - ], - ], -}; diff --git a/dbm-ui/frontend/bkuiVueResolver.ts b/dbm-ui/frontend/bkuiVueResolver.ts deleted file mode 100644 index 279035bc33..0000000000 --- a/dbm-ui/frontend/bkuiVueResolver.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. -*/ - -// import type { ComponentResolver, SideEffectsInfo } from '../../types' -// import { kebabCase } from '../utils' -// type ComponentResolver = {}; -// type SideEffectsInfo = {}; -export function kebabCase(key: string) { - const result = key.replace(/([A-Z])/g, ' $1').trim(); - return result.split(' ').join('-') - .toLowerCase(); -} - -export interface BkuiVueResolverOptions { - /** - * import style along with components - * @default 'css' - */ - importStyle?: boolean | 'css' | 'less' - /** - * resolve `bkui-vue' icons - * @default false - */ - resolveIcons?: boolean -} - -function getSideEffects(importName: string, options: BkuiVueResolverOptions): string | undefined { - const { importStyle = 'css' } = options; - - if (!importStyle) return; - - const compName = kebabCase(importName); - let fileName = kebabCase(importName); - - if (['menu-item', 'menu-group'].includes(compName)) return; - - if (compName === 'submenu') { - fileName = 'menu'; - } - - if (importStyle === 'less') { - return `bkui-vue/lib/${fileName}/${compName}.less`; - } - - return `bkui-vue/lib/${fileName}/${compName}.css`; -} - -export function BkuiVueResolver(options: BkuiVueResolverOptions = {}) { - return { - type: 'component', - resolve: (name: string) => { - if (name.match(/^Bk/)) { - const importName = name.slice(2); - return { - name: importName, - from: 'bkui-vue/lib', - sideEffects: getSideEffects(importName, options), - }; - } - }, - }; -} diff --git a/dbm-ui/frontend/components.d.ts b/dbm-ui/frontend/components.d.ts deleted file mode 100644 index e72d317e84..0000000000 --- a/dbm-ui/frontend/components.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. -*/ - -// generated by unplugin-vue-components -// We suggest you to commit this file into source control -// Read more: https://github.com/vuejs/vue-next/pull/3399 -import '@vue/runtime-core'; - -declare module '@vue/runtime-core' { - export interface GlobalComponents { - BkMenu: typeof import('bkui-vue/lib')['Menu'] - BkMenuItem: typeof import('bkui-vue/lib')['MenuItem'] - BkNavigation: typeof import('bkui-vue/lib')['Navigation'] - RouterLink: typeof import('vue-router')['RouterLink'] - RouterView: typeof import('vue-router')['RouterView'] - } -} - -export {}; diff --git a/dbm-ui/frontend/env.d.ts b/dbm-ui/frontend/env.d.ts index dd46ec8c18..1abc28a478 100644 --- a/dbm-ui/frontend/env.d.ts +++ b/dbm-ui/frontend/env.d.ts @@ -36,21 +36,19 @@ declare module '*.css' { export default css; } -declare interface Window { - changeConfirm: boolean | 'popover'; - clipboardData: { - getData: (params: string) => string; - }; - PROJECT_ENV: { - VITE_PUBLIC_PATH: string; - VITE_AJAX_URL_PREFIX: string; - VITE_ROUTER_PERFIX: string; - }; - PROJECT_CONFIG: { - BIZ_ID: number; - TICKET_DETAIL_REQUEST_CONTROLLER: AbortController; +declare module 'vite-plugin-monaco-editor' { + interface MonacoEditorOptions { + // 根据实际插件文档填写选项 + language?: string; + theme?: string; + // 其他可能的选项... + } + + const monacoEditorPlugin: (options: MonacoEditorOptions) => any; + + export default { + default: monacoEditorPlugin, }; - BKApp: App; } declare module 'js-cookie'; @@ -86,3 +84,20 @@ type KeyExpand = { }; type LeftIsExtendsRightReturnValue = L extends R ? never : V; + +declare interface Window { + changeConfirm: boolean | 'popover'; + clipboardData: { + getData: (params: string) => string; + }; + PROJECT_ENV: { + VITE_PUBLIC_PATH: string; + VITE_AJAX_URL_PREFIX: string; + VITE_ROUTER_PERFIX: string; + }; + PROJECT_CONFIG: { + BIZ_ID: number; + TICKET_DETAIL_REQUEST_CONTROLLER: AbortController; + }; + BKApp: App; +} diff --git a/dbm-ui/frontend/src/components/db-table/index.vue b/dbm-ui/frontend/src/components/db-table/index.vue index ac35730505..f93d11c627 100644 --- a/dbm-ui/frontend/src/components/db-table/index.vue +++ b/dbm-ui/frontend/src/components/db-table/index.vue @@ -67,19 +67,6 @@ - @@ -312,14 +310,12 @@ fetchTopologyHostCount: (node: any) => getHostTopo({ mode: props.serviceMode, all_scope: true, - // scope_list: !node ? [] : [node.meta], scope_list: [scope.value], }), fetchHostsDetails: (params: any) => { const firstHost = params.host_list[0]; return getHostDetails({ mode: props.serviceMode, - // scope_list: [firstHost.meta], scope_list: [scope.value], ...params, }); @@ -406,56 +402,56 @@ { label: t('管控区域'), field: 'cloud_area', - render: ({ cell }: any) => {cell?.name || '--'}, + render: ({data}: {data: HostDetails}) => data.cloud_area || '--', }, { label: t('Agent状态'), field: 'alive', - render: ({ cell }: { cell: number }) => { - const info = cell === 1 ? { theme: 'success', text: t('正常') } : { theme: 'danger', text: t('异常') }; + render: ({data}: {data: HostDetails}) => { + const info = data.alive === 1 ? { theme: 'success', text: t('正常') } : { theme: 'danger', text: t('异常') }; return {info.text}; }, }, { label: t('主机名称'), field: 'host_name', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.host_name || '--', }, { label: t('OS名称'), field: 'os_name', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.os_name || '--', }, { label: t('所属云厂商'), field: 'cloud_vendor', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.cloud_vendor || '--', }, { label: t('OS类型'), field: 'os_type', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.os_type || '--', }, { label: t('主机ID'), field: 'host_id', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.host_id || '--', }, { label: 'Agent ID', field: 'agent_id', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.agent_id || '--', }, { label: 'IPv6', field: 'ipv6', - render: ({ cell }: TableColumnRender) => {cell || '--'}, + render: ({data}: {data: HostDetails}) => data.ipv6 || '--', }, { label: t('操作'), field: 'operation', width: 100, - render: ({ index }: TableColumnRender) => ( + render: ({ index }: {index: number}) => ( {}; - let timer = 0; + let timer: ReturnType; watch(route, () => { clearTimeout(timer); diff --git a/dbm-ui/frontend/src/hooks/useBeforeClose.ts b/dbm-ui/frontend/src/hooks/useBeforeClose.ts index fe618afeca..b93aa98bed 100644 --- a/dbm-ui/frontend/src/hooks/useBeforeClose.ts +++ b/dbm-ui/frontend/src/hooks/useBeforeClose.ts @@ -22,7 +22,7 @@ export const useBeforeClose = () => function sideSilderbeforeClose(flag?: boolean) { const closable = flag ?? window.changeConfirm; if (closable) { - return new Promise((resolve) => { + return new Promise((resolve) => { InfoBox({ title: t('确认离开当前页'), content: t('离开将会导致未保存信息丢失'), diff --git a/dbm-ui/frontend/src/main.ts b/dbm-ui/frontend/src/main.ts index df5a79e2b8..d621e8f7dc 100644 --- a/dbm-ui/frontend/src/main.ts +++ b/dbm-ui/frontend/src/main.ts @@ -80,9 +80,5 @@ window.addEventListener('beforeunload', (event) => { if (e) { e.returnValue = '离开将会导致未保存信息丢失'; } - // 如果是通过登录触发提示,则关闭登录 dialog - if (window.login.isShow) { - window.login.hideLogin(); - } return '离开将会导致未保存信息丢失'; }); diff --git a/dbm-ui/frontend/src/services/model/ticket/ticket.ts b/dbm-ui/frontend/src/services/model/ticket/ticket.ts index e45189756f..2d07927929 100644 --- a/dbm-ui/frontend/src/services/model/ticket/ticket.ts +++ b/dbm-ui/frontend/src/services/model/ticket/ticket.ts @@ -32,7 +32,7 @@ export default class Ticket { REVOKED: 'danger', TERMINATED: 'danger', ALL: undefined, - }; + } as const; static statusTextMap = { ALL: t('全部'), PENDING: t('审批中'), @@ -90,7 +90,7 @@ export default class Ticket { // 获取状态对应文案 get tagTheme() { - return Ticket.themeMap[this.status] as BKTagTheme; + return Ticket.themeMap[this.status] as (typeof Ticket.themeMap)[keyof typeof Ticket.themeMap]; } get statusText() { diff --git a/dbm-ui/frontend/src/services/source/ipchooser.ts b/dbm-ui/frontend/src/services/source/ipchooser.ts index d03977967c..ce760ed576 100644 --- a/dbm-ui/frontend/src/services/source/ipchooser.ts +++ b/dbm-ui/frontend/src/services/source/ipchooser.ts @@ -38,11 +38,17 @@ export function checkHost(params: { */ export function getHostDetails(params: { mode?: string; - host_list: Array>; + host_list: { + host_id: number; + meta?: { + bk_biz_id: number; + scope_id: string; + scope_type: string; + }; + }[]; scope_list: { - scope_id: number; + scope_id: string; scope_type: string; - bk_cloud_id?: number | string; }[]; }) { return http.post(`${path}/host/details/`, params); diff --git a/dbm-ui/frontend/src/services/types/hostDetails.ts b/dbm-ui/frontend/src/services/types/hostDetails.ts index 629fec6c50..b3d36c7302 100644 --- a/dbm-ui/frontend/src/services/types/hostDetails.ts +++ b/dbm-ui/frontend/src/services/types/hostDetails.ts @@ -15,28 +15,32 @@ * 主机详情 */ export interface HostDetails { + agent_id: number; alive: number; - biz: { id: number; name: string }; + biz: { + id: number; + name: string; + }; + bk_cpu?: number; + bk_cpu_architecture: string; + bk_cpu_module: string; + bk_disk: number; + bk_host_outerip: string; + bk_idc_id?: number; + bk_idc_name?: string; + bk_mem: number; cloud_area: { id: number; name: string }; cloud_id: number; + cloud_vendor: string; host_id: number; host_name?: string; ip: string; ipv6: string; meta: { bk_biz_id: number; - scope_id: number; + scope_id: string; scope_type: string; }; - scope_id: string; - scope_type: string; os_name: string; - bk_cpu?: number; - bk_disk?: number; - bk_mem?: number; os_type: string; - agent_id: number; - cpu: string; - cloud_vendor: string; - bk_idc_name?: string; } diff --git a/dbm-ui/frontend/src/services/types/ticket.ts b/dbm-ui/frontend/src/services/types/ticket.ts index 565547ec8c..4de585faa7 100644 --- a/dbm-ui/frontend/src/services/types/ticket.ts +++ b/dbm-ui/frontend/src/services/types/ticket.ts @@ -11,11 +11,10 @@ * the specific language governing permissions and limitations under the License. */ import type { MySQLImportSQLFileDetails } from '@services/model/ticket/details/mysql'; +import type { HostDetails } from '@services/types'; import { TicketTypes } from '@common/const'; -import type { IHostTableData } from '@views/db-manage/common/big-data-host-table/HdfsHostTable.vue'; - /** * 单据详情 */ @@ -108,10 +107,10 @@ export interface TicketDetailsES { http_port: number; ip_source: string; nodes: { - client: IHostTableData[]; - master: IHostTableData[]; - hot: IHostTableData[]; - cold: IHostTableData[]; + client: HostDetails[]; + master: HostDetails[]; + hot: HostDetails[]; + cold: HostDetails[]; }; } @@ -126,9 +125,9 @@ export interface TicketDetailsHDFS { db_version: string; ip_source: string; nodes: { - datanode: IHostTableData[]; - namenode: IHostTableData[]; - zookeeper: IHostTableData[]; + datanode: HostDetails[]; + namenode: HostDetails[]; + zookeeper: HostDetails[]; }; } @@ -143,8 +142,8 @@ export interface TicketDetailsKafka { db_version: string; ip_source: string; nodes: { - broker: IHostTableData[]; - zookeeper: IHostTableData[]; + broker: HostDetails[]; + zookeeper: HostDetails[]; }; partition_num: number; port: number; @@ -156,16 +155,16 @@ export interface TicketDetailsKafka { * 节点类型 */ export interface NodesType { - datanode: IHostTableData[]; - hot: IHostTableData[]; - cold: IHostTableData[]; - master: IHostTableData[]; - client: IHostTableData[]; - namenode: IHostTableData[]; - zookeeper: IHostTableData[]; - broker: IHostTableData[]; - proxy: IHostTableData[]; - slave: IHostTableData[]; + datanode: HostDetails[]; + hot: HostDetails[]; + cold: HostDetails[]; + master: HostDetails[]; + client: HostDetails[]; + namenode: HostDetails[]; + zookeeper: HostDetails[]; + broker: HostDetails[]; + proxy: HostDetails[]; + slave: HostDetails[]; } /** diff --git a/dbm-ui/frontend/src/types/auto-import-global-component.d.ts b/dbm-ui/frontend/src/types/auto-import-global-component.d.ts deleted file mode 100644 index f4f8de6cd7..0000000000 --- a/dbm-ui/frontend/src/types/auto-import-global-component.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export {}; -declare global { - const AuthButton: typeof import('../components/auth-component/button.vue').default; - const AuthOption: typeof import('../components/auth-component/option.vue').default; - const AuthRouterLink: typeof import('../components/auth-component/router-link.vue').default; - const AuthSwitch: typeof import('../components/auth-component/switch.vue').default; -} diff --git a/dbm-ui/frontend/src/types/bkui-vue.ts b/dbm-ui/frontend/src/types/bkui-vue.ts deleted file mode 100644 index 08d19160f8..0000000000 --- a/dbm-ui/frontend/src/types/bkui-vue.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ - -import type { DatePicker, Table } from 'bkui-vue'; -import type { ISearchItem, ISearchValue } from 'bkui-vue/lib/search-select/utils'; - -export type { FormItemProps } from 'bkui-vue/lib/form/form-item'; - -export type DatePickerValues = Array['$props']['modelValue']>; -export type TableProps = InstanceType['$props']; - -// search-select 组件 types -export type SearchSelectValues = Array; -export type SearchSelectValue = ISearchValue; -export type SearchSelectData = Array; -export type SearchSelectItem = ISearchItem; - -export interface TableColumnRender { - cell: string; - data: any; - row: any; - column: any; - index: number; - rows: any[]; -} - -export interface TableSelectionData { - checked: boolean; - data: T[]; - index: number; - isAll: boolean; - row: T; -} diff --git a/dbm-ui/frontend/src/types/global.d.ts b/dbm-ui/frontend/src/types/global.d.ts deleted file mode 100644 index fea3b76011..0000000000 --- a/dbm-ui/frontend/src/types/global.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from 'tippy.js'; - -declare module 'tippy.js' { - export interface ReferenceElement { - _bk_overflow_tips_: any; - } -} diff --git a/dbm-ui/frontend/src/types/index.d.ts b/dbm-ui/frontend/src/types/index.d.ts index 6f7becffba..a4bd2864d9 100644 --- a/dbm-ui/frontend/src/types/index.d.ts +++ b/dbm-ui/frontend/src/types/index.d.ts @@ -11,18 +11,9 @@ * the specific language governing permissions and limitations under the License. */ -import type { TablePropTypes } from 'bkui-vue/lib/table/props'; import type { Router } from 'vue-router'; declare global { - interface Window { - changeConfirm: boolean | 'popover'; - login: { - showLogin: ({ src, width, height }) => void; - hideLogin: () => void; - isShow: boolean; - }; - } interface Element { _bk_overflow_tips_: any; _tippy: any; @@ -40,12 +31,6 @@ declare global { innerText: string; } | null; } - - type ClusterTableProps = { - -readonly [K in keyof TablePropTypes]: TablePropTypes[K]; - }; - - type BKTagTheme = 'success' | 'info' | 'warning' | 'danger' | undefined; } declare module 'pinia' { diff --git a/dbm-ui/frontend/src/types/vite-env.d.ts b/dbm-ui/frontend/src/types/vite-env.d.ts deleted file mode 100644 index 3999e8b544..0000000000 --- a/dbm-ui/frontend/src/types/vite-env.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. - * - * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at https://opensource.org/licenses/MIT - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ - -// / - -/* eslint-disable-next-line */ diff --git a/dbm-ui/frontend/src/utils/getMenuListSearch.ts b/dbm-ui/frontend/src/utils/getMenuListSearch.ts index 4311603932..74dcd1dd36 100644 --- a/dbm-ui/frontend/src/utils/getMenuListSearch.ts +++ b/dbm-ui/frontend/src/utils/getMenuListSearch.ts @@ -11,9 +11,9 @@ * the specific language governing permissions and limitations under the License. */ -import { generateId } from './generateId'; +import type { ISearchItem, ISearchValue } from 'bkui-vue/lib/search-select/utils'; -import type { SearchSelectData, SearchSelectItem, SearchSelectValues } from '@/types/bkui-vue'; +import { generateId } from './generateId'; /** * search-select 组件搜索功能函数 @@ -25,10 +25,10 @@ import type { SearchSelectData, SearchSelectItem, SearchSelectValues } from '@/t * @returns menu list */ export function getMenuListSearch( - searchItem: SearchSelectItem | undefined, + searchItem: ISearchItem | undefined, keyword: string, - data: SearchSelectData, - values: SearchSelectValues, + data: ISearchItem[], + values: ISearchValue[], uniqueSelect = true, ) { const lowerCaseKeyword = keyword.toLocaleLowerCase(); diff --git a/dbm-ui/frontend/src/views/db-configure/components/PublishRecord.vue b/dbm-ui/frontend/src/views/db-configure/components/PublishRecord.vue index 9a0bf00313..45ba9ed7cf 100644 --- a/dbm-ui/frontend/src/views/db-configure/components/PublishRecord.vue +++ b/dbm-ui/frontend/src/views/db-configure/components/PublishRecord.vue @@ -25,7 +25,7 @@ @@ -70,7 +70,6 @@ diff --git a/dbm-ui/frontend/src/views/db-manage/elastic-search/apply/Index.vue b/dbm-ui/frontend/src/views/db-manage/elastic-search/apply/Index.vue index 1289300fc8..f1e03734ff 100644 --- a/dbm-ui/frontend/src/views/db-manage/elastic-search/apply/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/elastic-search/apply/Index.vue @@ -345,7 +345,6 @@ import IpSelector from '@components/ip-selector/IpSelector.vue'; - // import AffinityItem from '@views/db-manage/common/apply-items/AffinityItem.vue'; import BusinessItems from '@views/db-manage/common/apply-items/BusinessItems.vue'; import CloudItem from '@views/db-manage/common/apply-items/CloudItem.vue'; import ClusterAlias from '@views/db-manage/common/apply-items/ClusterAlias.vue'; @@ -356,9 +355,7 @@ import WithInstanceHostTable, { type IHostTableDataWithInstance, } from '@views/db-manage/common/big-data-host-table/es-host-table/index.vue'; - import RenderHostTable, { - type IHostTableData, - } from '@views/db-manage/common/big-data-host-table/RenderHostTable.vue'; + import RenderHostTable from '@views/db-manage/common/big-data-host-table/RenderHostTable.vue'; const route = useRoute(); const router = useRouter(); @@ -387,8 +384,8 @@ ip_source: 'resource_pool', disaster_tolerance_level: 'NONE', // 同 affinity nodes: { - master: [] as Array, - client: [] as Array, + master: [] as Array, + client: [] as Array, hot: [] as Array, cold: [] as Array, }, @@ -636,7 +633,7 @@ } baseState.isSubmitting = true; - const mapIpField = (ipList: Array) => + const mapIpField = (ipList: Array) => ipList.map((item) => ({ bk_host_id: item.host_id, ip: item.ip, diff --git a/dbm-ui/frontend/src/views/db-manage/elastic-search/common/expansion/Index.vue b/dbm-ui/frontend/src/views/db-manage/elastic-search/common/expansion/Index.vue index ed8dd1910f..a4ed685331 100644 --- a/dbm-ui/frontend/src/views/db-manage/elastic-search/common/expansion/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/elastic-search/common/expansion/Index.vue @@ -202,7 +202,7 @@ host_id: item.bk_host_id, meta: { bk_biz_id: item.bk_biz_id, - scope_id: item.bk_biz_id, + scope_id: `${item.bk_biz_id}`, scope_type: 'biz', }, })); @@ -211,7 +211,7 @@ getHostDetails({ host_list: hostIdList, scope_list: [{ - scope_id: bizId, + scope_id: `${bizId}`, scope_type: 'biz', }], }).then((data) => { diff --git a/dbm-ui/frontend/src/views/db-manage/elastic-search/list/components/list/Index.vue b/dbm-ui/frontend/src/views/db-manage/elastic-search/list/components/list/Index.vue index b872818247..b4f468d2d5 100644 --- a/dbm-ui/frontend/src/views/db-manage/elastic-search/list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/elastic-search/list/components/list/Index.vue @@ -100,6 +100,7 @@