Skip to content

Commit

Permalink
Revert "feat(frontend): mysql和tendbCluster 备份单据优化 #6731"
Browse files Browse the repository at this point in the history
This reverts commit 3290685.
  • Loading branch information
jinquantianxia authored Dec 2, 2024
1 parent 3290685 commit 4486400
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
}).then((data) => {
if (data.length > 0) {
localClusterId.value = data[0].id;
emits('idChange', localClusterId.value);
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
:removeable="tableData.length < 2"
@add="(payload: Array<IDataRow>) => handleAppend(index, payload)"
@clone="(payload: IDataRow) => handleClone(index, payload)"
@id-change="(clusterId: number) => handleChangeCluster(index, clusterId)"
@remove="handleRemove(index)" />
</RenderData>
<TicketRemark v-model="remark" />
Expand Down Expand Up @@ -67,7 +66,6 @@
import { useRouter } from 'vue-router';

import TendbClusterModel from '@services/model/tendbcluster/tendbcluster';
import { getTendbClusterList } from '@services/source/tendbcluster';
import { createTicket } from '@services/source/ticket';

import { useTicketCloneInfo } from '@hooks';
Expand Down Expand Up @@ -165,31 +163,6 @@
window.changeConfirm = true;
};

// 输入集群后查询集群信息并填充到table
const handleChangeCluster = async (index: number, clusterId: number) => {
if (tableData.value[index].clusterData?.id === clusterId) {
return;
}

const resultList = await getTendbClusterList({
cluster_ids: [clusterId],
});
if (resultList.results.length < 1) {
return;
}
const item = resultList.results[0];
const domain = item.master_domain;
const row = createRowData({
clusterData: {
id: item.id,
domain: item.master_domain,
},
});
tableData.value[index] = row;
domainMemo[domain] = true;
selectedClusters.value[item.cluster_type].push(item);
};

// 追加一个集群
const handleAppend = (index: number, appendList: Array<IDataRow>) => {
const dataList = [...tableData.value];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
multi-input
:placeholder="t('请输入集群_使用换行分割一次可输入多个')"
:rules="rules"
@focus="handleFocus"
@multi-input="handleMultiInput" />
</div>
</template>
Expand Down Expand Up @@ -48,7 +47,7 @@
}

interface Exposes {
getValue: (isSubmit?: boolean) => Record<string, number>;
getValue: () => Record<string, number>;
}

const props = defineProps<Props>();
Expand All @@ -61,8 +60,6 @@

const { currentBizId } = useGlobalBizs();

let isSkipInputFinish = false;

const editRef = ref();

const localClusterId = ref(0);
Expand All @@ -75,7 +72,7 @@
if (value) {
return true;
}
// emits('idChange', 0);
emits('idChange', 0);
return false;
},
message: t('目标集群不能为空'),
Expand All @@ -92,9 +89,6 @@
}).then((data) => {
if (data.length > 0) {
localClusterId.value = data[0].id;
if (!isSkipInputFinish) {
emits('idChange', localClusterId.value);
}
return true;
}
return false;
Expand Down Expand Up @@ -164,17 +158,12 @@
emits('inputCreate', list);
};

const handleFocus = () => {
isSkipInputFinish = false;
};

// onBeforeUnmount(() => {
// delete clusterIdMemo[instanceKey];
// });

defineExpose<Exposes>({
getValue(isSubmit = false) {
isSkipInputFinish = isSubmit;
getValue() {
return editRef.value
.getValue()
.then(() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
(e: 'add', params: Array<IDataRow>): void;
(e: 'remove'): void;
(e: 'clone', value: IDataRow): void;
(e: 'idChange', value: number): void;
}

interface Exposes {
Expand Down Expand Up @@ -142,7 +141,7 @@
);

const handleClusterIdChange = (clusterId: number) => {
emits('idChange', clusterId);
localClusterId.value = clusterId;
};

const handleCreate = (list: Array<string>) => {
Expand Down Expand Up @@ -171,7 +170,7 @@
};

const getRowData = () => [
clusterRef.value!.getValue(true),
clusterRef.value!.getValue(),
backupLocalRef.value!.getValue(),
dbPatternsRef.value!.getValue('db_patterns'),
tablePatternsRef.value!.getValue('table_patterns'),
Expand Down

0 comments on commit 4486400

Please sign in to comment.