Skip to content

Commit

Permalink
feat(frontend): 单据管理迭代_1205 TencentBlueKing#7190
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 25949
  • Loading branch information
JustaCattt committed Dec 5, 2024
1 parent 31f4244 commit 2950347
Show file tree
Hide file tree
Showing 23 changed files with 234 additions and 416 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
pasteFn?: (value: string) => string;
}

type ValueType = string | number;
export type ValueType = string | number;

interface Emits {
(e: 'blur', value: ValueType): void;
Expand Down
3 changes: 3 additions & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3747,5 +3747,8 @@
"不一致时间范围:": "不一致时间范围:",
"变更信息:": "变更信息:",
"是否强制切换:": "是否强制切换:",
"替换类型:": "替换类型:",
"目标Proxy实例": "目标 Proxy 实例",
"全局超时时间:": "全局超时时间:",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import type { DetailBase, DetailClusters } from '../common';
export interface HaFullBackup extends DetailBase {
clusters: DetailClusters;
infos: {
backup_type: string;
clusters: {
backup_local: string;
cluster_id: number;
}[];
file_tag: string;
};
cluster_id: number;
backup_local: 'master' | 'slave';
}[];
file_tag: 'DBFILE1M' | 'DBFILE6M' | 'DBFILE1Y' | 'DBFILE3Y';
backup_type: 'logical' | 'physical';
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export interface ProxySwitch extends DetailBase {
force: boolean;
infos: {
cluster_ids: number[];
display_info: {
type: 'INSTANCE_REPLACE' | 'HOST_REPLACE';
related_clusters: string[];
related_instances: string[];
};
origin_proxy: {
bk_biz_id: number;
bk_cloud_id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { DetailBase, DetailClusters } from '../common';
*/

export interface RestoreLocalSlave extends DetailBase {
backup_source: string;
backup_source: 'local' | 'remote';
clusters: DetailClusters;
force: boolean;
infos: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import type { DetailBase, DetailClusters } from '../common';
/**
* TenDB Cluster Slave重建
*/

export interface RestoreSlave extends DetailBase {
backup_source: string;
backup_source: 'local' | 'remote';
clusters: DetailClusters;
infos: {
cluster_id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,12 @@

await createTicket({
bk_biz_id: currentBizId,
ticket_type: 'MYSQL_HA_FULL_BACKUP',
ticket_type: TicketTypes.MYSQL_HA_FULL_BACKUP,
remark: formData.remark,
details: {
infos: {
...formData,
clusters: infos,
},
backup_type: formData.backup_type,
file_tag: formData.file_tag,
infos,
},
}).then((data) => {
window.changeConfirm = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
}

interface Exposes {
getValue: () => Promise<Record<string, string>>;
getValue: () => Promise<{
backup_local: string;
}>;
}

const props = defineProps<Props>();
Expand Down Expand Up @@ -97,7 +99,7 @@
() => {
if (props.clusterData) {
fetchClusterList({
cluster_ids: props.clusterData.id,
cluster_ids: [props.clusterData.id],
});
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
}

interface Exposes {
getValue: () => Array<number>;
getValue: () => Promise<{
cluster_id: number;
}>;
}

const props = defineProps<Props>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@
});
</script>
<script setup lang="ts">
import { type Mysql } from '@services/model/ticket/ticket';

import RenderBackupLocal from './RenderBackupLocal.vue';
import RenderCluster from './RenderCluster.vue';

interface Props {
data: IDataRow;
removeable: boolean;
}

interface Emits {
(e: 'add', params: Array<IDataRow>): void;
(e: 'remove'): void;
Expand All @@ -71,7 +74,7 @@
}

interface Exposes {
getValue: () => Promise<any>;
getValue: () => Promise<Mysql.HaFullBackup['infos'][number]>;
}

const props = defineProps<Props>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
:min-width="200"
:required="false"
:width="240">
{{ t('同机关联实例') }}
{{ t('关联实例') }}
</RenderTableHeadColumn>
<RenderTableHeadColumn
:min-width="200"
:required="false"
:width="240">
{{ t('同机关联集群') }}
{{ t('关联集群') }}
</RenderTableHeadColumn>
<RenderTableHeadColumn
:min-width="200"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
fixed="left"
:min-width="200"
:width="240">
{{ t('目标实例') }}
{{ t('目标Proxy实例') }}
<template #append>
<span
v-bk-tooltips="t('批量选择')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,12 @@
<BkTable
:data="tableData"
show-overflow-tooltip>
<BkTableColumn
field="cluster_ids"
:label="t('集群ID')">
<BkTableColumn :label="t('集群')">
<template #default="{ data }: { data: RowData }">
{{ data.id }}
{{ ticketDetails.details.clusters[data.id].immute_domain }}
</template>
</BkTableColumn>
<BkTableColumn
field="immute_domain"
:label="t('集群名称')">
<template #default="{ data }: { data: RowData }">
<div
v-bk-tooltips="{
content: `${t('域名')}:${ticketDetails.details.clusters[data.id].immute_domain}
${ticketDetails.details.clusters[data.id].name ? `${'集群别名'}:${ticketDetails.details.clusters[data.id].name}` : null}
`,
allowHTML: true,
}"
class="cluster-name">
<span>{{ ticketDetails.details.clusters[data.id].immute_domain }}</span>
<br />
<span
v-if="ticketDetails.details.clusters[data.id].name"
class="cluster-name-alias">
{{ ticketDetails.details.clusters[data.id].name }}
</span>
</div>
</template>
</BkTableColumn>
<BkTableColumn
field="cluster_type_name"
:label="t('集群类型')">
<BkTableColumn :label="t('集群类型')">
<template #default="{ data }: { data: RowData }">
{{ ticketDetails.details.clusters[data.id].cluster_type_name }}
</template>
Expand Down Expand Up @@ -76,14 +50,3 @@

type RowData = UnwrapRef<typeof tableData>[number];
</script>

<style lang="less" scoped>
.cluster-name {
padding: 8px 0;
line-height: 16px;

.cluster-name-alias {
color: @light-gray;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,12 @@
<BkTable
:data="tableData"
show-overflow-tooltip>
<BkTableColumn
field="cluster_ids"
:label="t('集群ID')">
<BkTableColumn :label="t('集群')">
<template #default="{ data }: { data: RowData }">
{{ data.id }}
{{ ticketDetails.details.clusters[data.id].immute_domain }}
</template>
</BkTableColumn>
<BkTableColumn
field="immute_domain"
:label="t('集群名称')">
<template #default="{ data }: { data: RowData }">
<div
v-bk-tooltips="{
content: `${t('域名')}:${ticketDetails.details.clusters[data.id].immute_domain}
${ticketDetails.details.clusters[data.id].name ? `${'集群别名'}:${ticketDetails.details.clusters[data.id].name}` : null}
`,
allowHTML: true,
}"
class="cluster-name">
<span>{{ ticketDetails.details.clusters[data.id].immute_domain }}</span>
<br />
<span
v-if="ticketDetails.details.clusters[data.id].name"
class="cluster-name-alias">
{{ ticketDetails.details.clusters[data.id].name }}
</span>
</div>
</template>
</BkTableColumn>
<BkTableColumn
field="cluster_type_name"
:label="t('集群类型')">
<BkTableColumn :label="t('集群类型')">
<template #default="{ data }: { data: RowData }">
{{ ticketDetails.details.clusters[data.id].cluster_type_name }}
</template>
Expand Down Expand Up @@ -80,14 +54,3 @@

type RowData = UnwrapRef<typeof tableData>[number];
</script>

<style lang="less" scoped>
.cluster-name {
padding: 8px 0;
line-height: 16px;

.cluster-name-alias {
color: @light-gray;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BkTable
:data="ticketDetails.details.infos"
show-overflow-tooltip>
<BkTableColumn :label="t('集群名称')">
<BkTableColumn :label="t('集群')">
<template #default="{ data }: { data: RowData }">
{{ ticketDetails.details.clusters[data.cluster_id].immute_domain }}
</template>
Expand Down
Loading

0 comments on commit 2950347

Please sign in to comment.