From 4b3013217cbad53dcd7b9949142f37c267658b4f Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Wed, 18 Dec 2024 18:40:51 +0800 Subject: [PATCH] =?UTF-8?q?perf(frontend):=20mongodb=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=AE=B1=E9=87=8D=E6=9E=84=5F=E6=B8=85=E6=A1=A3=20#8498?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolbox-field/operation-column/Index.vue | 2 +- .../mongodb/MONGODB_REMOVE_NS/Index.vue | 49 +++ .../MONGODB_REMOVE_NS/pages/page1/Index.vue | 375 ++++++++++++++++++ .../pages/page1/components/DropTypeColumn.vue | 50 +++ .../pages/page1/components/DropTypeIndex.vue | 50 +++ .../MONGODB_REMOVE_NS/pages/page2/Index.vue | 89 +++++ .../src/views/db-manage/mongodb/routes.ts | 19 +- .../views/db-manage/mongodb/toolbox-menu.ts | 2 +- .../ticket-center/common/TicketClone.vue | 1 + 9 files changed, 627 insertions(+), 10 deletions(-) create mode 100644 dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/Index.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeColumn.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeIndex.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page2/Index.vue diff --git a/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/operation-column/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/operation-column/Index.vue index 85fc745c2c..4f1bd79f3d 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/operation-column/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/operation-column/Index.vue @@ -89,7 +89,7 @@ const newRowIndex = rowIndex + 1; - if (rowIndex > 0) { + if (newRowIndex > 0) { tableData.value.splice(newRowIndex, 0, _.cloneDeep(tableData.value[rowIndex])); editTableContext!.validateByRowIndex(newRowIndex); } diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/Index.vue new file mode 100644 index 0000000000..a699b45363 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/Index.vue @@ -0,0 +1,49 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/Index.vue new file mode 100644 index 0000000000..071ed4797b --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/Index.vue @@ -0,0 +1,375 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeColumn.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeColumn.vue new file mode 100644 index 0000000000..ee11d8f42b --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeColumn.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeIndex.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeIndex.vue new file mode 100644 index 0000000000..4880dc576c --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page1/components/DropTypeIndex.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page2/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page2/Index.vue new file mode 100644 index 0000000000..fac98c1e99 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/MONGODB_REMOVE_NS/pages/page2/Index.vue @@ -0,0 +1,89 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/routes.ts b/dbm-ui/frontend/src/views/db-manage/mongodb/routes.ts index 5941ff0e49..85137554c7 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/routes.ts +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/routes.ts @@ -119,14 +119,17 @@ export const mongoToolboxChildrenRoutes: RouteRecordRaw[] = [ // }, // component: () => import('@views/db-manage/mongodb/db-backup/Index.vue'), // }, - { - path: 'db-clear/:page?', - name: 'MongoDbClear', - meta: { - navName: t('清档'), - }, - component: () => import('@views/db-manage/mongodb/db-clear/Index.vue'), - }, + createRouteItem(TicketTypes.MONGODB_REMOVE_NS, { + navName: t('清档'), + }), + // { + // path: 'db-clear/:page?', + // name: 'MongoDbClear', + // meta: { + // navName: t('清档'), + // }, + // component: () => import('@views/db-manage/mongodb/db-clear/Index.vue'), + // }, ]; const routes: RouteRecordRaw[] = [ diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/toolbox-menu.ts b/dbm-ui/frontend/src/views/db-manage/mongodb/toolbox-menu.ts index fb44f43400..876acf6e45 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/toolbox-menu.ts +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/toolbox-menu.ts @@ -111,7 +111,7 @@ export default [ children: [ { name: t('清档'), - id: 'MongoDbClear', + id: TicketTypes.MONGODB_REMOVE_NS, parentId: 'mongo_data', }, ], diff --git a/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue b/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue index 197db7e1a4..9f4ddefcce 100644 --- a/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/TicketClone.vue @@ -150,6 +150,7 @@ [TicketTypes.TENDBCLUSTER_RESTORE_SLAVE]: 'spiderSlaveRebuild', // spider 重建从库-新机重建 [TicketTypes.MONGODB_FULL_BACKUP]: TicketTypes.MONGODB_FULL_BACKUP, // mongodb 全库备份 [TicketTypes.MONGODB_BACKUP]: TicketTypes.MONGODB_BACKUP, // mongodb 库表备份 + [TicketTypes.MONGODB_REMOVE_NS]: TicketTypes.MONGODB_REMOVE_NS, // mongodb 清档 }; const isSupported = computed(() => !!ticketTypeRouteNameMap[props.data.ticket_type]);