From 5324fa1090efa044dea4ba5b94f85697dd33b4cc Mon Sep 17 00:00:00 2001 From: chenwenchang <479999519@qq.com> Date: Fri, 17 Jan 2025 18:17:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E5=B7=A5=E5=85=B7=E7=AE=B1?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B5=84=E6=BA=90=E6=B1=A0=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=5Ftable=E5=85=A8=E5=B1=80=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9Eticket-payload=E7=BB=84=E4=BB=B6=20#?= =?UTF-8?q?8076=20#=20Reviewed,=20transaction=20id:=2029590?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/common/importComps.ts | 24 ++++++++++ dbm-ui/frontend/src/hooks/useCreateTicket.tsx | 5 ++- dbm-ui/frontend/src/types/biz-components.d.ts | 12 +++++ .../column/hybrid-host-column/Index.vue | 13 +++--- .../column/multiple-host-column/Index.vue | 13 +++--- .../column/single-host-column/Index.vue | 13 +++--- .../form-item/ticket-payload/Index.vue | 24 ++++++++++ .../mysql/MYSQL_ADD_SLAVE/Create.vue | 15 +++---- .../components/ClusterColumn.vue | 7 ++- .../components/ClusterMigrateTable.vue | 7 +-- .../components/HostColumnGroup.vue | 19 ++++---- .../components/HostMigrateTable.vue | 7 +-- .../mysql/MYSQL_PROXY_ADD/Create.vue | 15 +++---- .../components/HostColumnGroup.vue | 19 ++++---- .../components/HostTable.vue | 7 +-- .../components/InstanceColumnGroup.vue | 13 +++--- .../components/InstanceTable.vue | 7 +-- .../components/local-restore/Index.vue | 21 +++++---- .../local-restore/SlaveInstanceColumn.vue | 7 ++- .../components/restore/Index.vue | 15 +++---- .../restore/SlaveHostColumnGroup.vue | 13 +++--- .../WithRelatedClustersColumn.vue | 7 ++- .../redis/REDIS_CLUSTER_CUTOFF/Create.vue | 27 ++++++----- .../components/HostColumn.vue | 8 ++-- .../components/SpecColumn.vue | 9 ++-- .../redis/REDIS_PROXY_SCALE_DOWN/Create.vue | 45 ++++++++----------- .../components/ClusterColumn.vue | 7 ++- .../redis/REDIS_SCALE_UPDOWN/Create.vue | 27 ++++++----- .../components/ClusterColumn.vue | 7 ++- .../components/CurrentCapacityColumn.vue | 7 ++- .../components/RedisVersionColumn.vue | 10 ++--- .../target-capacity-column/Index.vue | 9 ++-- .../sqlserver/SQLSERVER_ADD_SLAVE/Create.vue | 15 +++---- .../components/ClusterColumn.vue | 7 ++- .../components/local-restore/Index.vue | 21 +++++---- .../local-restore/SlaveInstanceColumn.vue | 7 ++- .../components/restore/Index.vue | 15 +++---- .../restore/SlaveHostColumnGroup.vue | 13 +++--- .../TENDBCLUSTER_MIGRATE_CLUSTER/Create.vue | 21 +++++---- .../components/MasterHostColumnGroup.vue | 13 +++--- .../components/SlaveHostColumnGroup.vue | 14 +++--- .../components/local-restore/Index.vue | 21 +++++---- .../local-restore/SlaveInstanceColumn.vue | 7 ++- .../components/restore/Index.vue | 27 ++++++----- .../components/restore/NewSlaveHostColumn.vue | 6 +-- .../restore/SlaveHostColumnGroup.vue | 13 +++--- .../TENDBCLUSTER_SPIDER_MNT_APPLY/Create.vue | 21 +++++---- .../components/ClusterColumn.vue | 7 ++- .../Create.vue | 27 ++++++----- .../components/ClusterColumn.vue | 7 ++- 50 files changed, 349 insertions(+), 352 deletions(-) create mode 100644 dbm-ui/frontend/src/views/db-manage/common/toolbox-field/form-item/ticket-payload/Index.vue diff --git a/dbm-ui/frontend/src/common/importComps.ts b/dbm-ui/frontend/src/common/importComps.ts index 61d2d3fb86..4f3da5761a 100644 --- a/dbm-ui/frontend/src/common/importComps.ts +++ b/dbm-ui/frontend/src/common/importComps.ts @@ -30,6 +30,17 @@ import DbStatus from '@components/db-status/index.vue'; import DbTable from '@components/db-table/index.vue'; import DbOriginalTable from '@components/db-table/OriginalTable.vue'; import DbTextarea from '@components/db-textarea/DbTextarea.vue'; +import EditableTable, { + Block as EditableBlock, + Column as EditableColumn, + DatePicker as EditableDatePicker, + Input as EditableInput, + Row as EditableRow, + Select as EditableSelect, + TagInput as EditableTagInput, + Textarea as EditableTextarea, + TimePicker as EditableTimePicker, +} from '@components/editable-table/Index.vue'; import FunController from '@components/function-controller/FunController.vue'; import MoreActionExtend from '@components/more-action-extend/Index.vue'; import ScrollFaker from '@components/scroll-faker/Index.vue'; @@ -37,12 +48,25 @@ import SkeletonLoading from '@components/skeleton-loading/Index.vue'; import SmartAction from '@components/smart-action/Index.vue'; import { ipSelector } from '@components/vue2/ip-selector'; +import OperationColumn from '@views/db-manage/common/toolbox-field/column/operation-column/Index.vue'; + import { Table, TableColumn } from '@blueking/table'; import UserSelector from '@patch/user-selector/selector.vue'; import('@blueking/table/vue3/vue3.css'); export const setGlobalComps = (app: App) => { + app.component('EditableTable', EditableTable); + app.component('EditableBlock', EditableBlock); + app.component('EditableColumn', EditableColumn); + app.component('EditableDatePicker', EditableDatePicker); + app.component('EditableInput', EditableInput); + app.component('EditableRow', EditableRow); + app.component('EditableSelect', EditableSelect); + app.component('EditableTagInput', EditableTagInput); + app.component('EditableTextarea', EditableTextarea); + app.component('EditableTimePicker', EditableTimePicker); + app.component('OperationColumn', OperationColumn); app.component('DbCard', DbCard); app.component('DbForm', DbForm); app.component('DbFormItem', DbFormItem); diff --git a/dbm-ui/frontend/src/hooks/useCreateTicket.tsx b/dbm-ui/frontend/src/hooks/useCreateTicket.tsx index 1496f1c342..d3635f406d 100644 --- a/dbm-ui/frontend/src/hooks/useCreateTicket.tsx +++ b/dbm-ui/frontend/src/hooks/useCreateTicket.tsx @@ -13,11 +13,12 @@ export function useCreateTicket(ticketType: TicketTypes, options?: { onSucces const router = useRouter(); const { t, locale } = useI18n(); - const run = async (formData: { details: T; remark: string; ignore_duplication?: boolean }) => { + const run = async (formData: { details: T; remark?: string; ignore_duplication?: boolean }) => { const params = { ticket_type: ticketType, bk_biz_id: window.PROJECT_CONFIG.BIZ_ID, - ...formData, + details: formData.details, + remark: formData.remark || '', }; try { loading.value = true; diff --git a/dbm-ui/frontend/src/types/biz-components.d.ts b/dbm-ui/frontend/src/types/biz-components.d.ts index 9753c30ecd..9d68db706e 100644 --- a/dbm-ui/frontend/src/types/biz-components.d.ts +++ b/dbm-ui/frontend/src/types/biz-components.d.ts @@ -14,6 +14,18 @@ declare module 'vue' { DbStatus: typeof import('@components/db-status/index.vue').default; DbTable: typeof import('@blueking/table/typings/BkTable.vue'); DbTable: typeof import('@blueking/table/typings/BkTableColumn.vue'); + EditableTable: typeof import('@components/editable-table/Index.vue').default; + EditableBlock: typeof import('@components/editable-table/Index.vue').Block; + EditableColumn: typeof import('@components/editable-table/Index.vue').Column; + EditableDatePicker: typeof import('@components/editable-table/Index.vue').DatePicker; + EditableInput: typeof import('@components/editable-table/Index.vue').Input; + EditableRow: typeof import('@components/editable-table/Index.vue').Row; + EditableSelect: typeof import('@components/editable-table/Index.vue').Select; + EditableTagInput: typeof import('@components/editable-table/Index.vue').TagInput; + EditableTextarea: typeof import('@components/editable-table/Index.vue').Textarea; + EditableTimePicker: typeof import('@components/editable-table/Index.vue').TimePicker; + OperationColumn: typeof import('@views/db-manage/common/toolbox-field/column/operation-column/Index.vue').default; + OperationRow: typeof import('@views/db-manage/common/toolbox-field/row/operation-row/Index.vue').default; FunController: typeof import('@components/function-controller/FunController.vue').default; MoreActionExtend: typeof import('@components/more-action-extend/Index.vue').default; ScrollFaker: typeof import('@components/scroll-faker/Index.vue').default; diff --git a/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/column/hybrid-host-column/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/column/hybrid-host-column/Index.vue index 1ddf2e8215..149409eb25 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/column/hybrid-host-column/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/toolbox-field/column/hybrid-host-column/Index.vue @@ -12,13 +12,13 @@ --> - +
@@ -55,8 +55,8 @@ {{ t(placeholder) }}
- - + + - - + @@ -49,8 +49,8 @@ type="host-select" @click="handleShowSelector" /> - - + + - - + @@ -43,8 +43,8 @@ type="host-select" @click="handleShowSelector" /> - - + + + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue index cac1f165fe..aed310b81e 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/MYSQL_ADD_SLAVE/Create.vue @@ -26,7 +26,7 @@ class="mb-20" :model="formData.tableData" :rules="rules"> - - + - +