Skip to content

Commit

Permalink
fix(frontend): 开区执行成功后跳转单据详情链接错误 #7404
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx authored and iSecloud committed Oct 17, 2024
1 parent e1cd3c1 commit 3f69815
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/hooks/useTicketMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useRouter } from 'vue-router';
export const useTicketMessage = () => {
const { t } = useI18n();
const router = useRouter();
return (id: number) => {
return (id: number | string) => {
const route = router.resolve({
name: 'bizTicketManage',
query: {
Expand Down
8 changes: 5 additions & 3 deletions dbm-ui/frontend/src/services/source/partitionManage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ export const dryRun = function (params: { config_id: number; cluster_id: number;

// 分区策略执行
export const execute = function (params: { cluster_id: number; partition_objects: Record<any, unknown> }) {
return http.post<{
id: number;
}>('/apis/partition/execute_partition/', params);
return http.post<
{
id: number;
}[]
>('/apis/partition/execute_partition/', params);
};

// 查询分区策略日志
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@
cluster_id: props.clusterId,
partition_objects: dryRunData.value,
})
.then((data) => {
ticketMessage(data.id);
.then((result) => {
ticketMessage(result.map(item => item.id).join(','));
modelValue.value = false;
})
.finally(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@
cluster_id: props.clusterId,
partition_objects: dryRunData.value,
})
.then((data) => {
ticketMessage(data.id);
.then((result) => {
ticketMessage(result.map(item => item.id).join(','));
modelValue.value = false;
})
.finally(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { computed, shallowRef } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';
Expand Down Expand Up @@ -50,7 +51,14 @@ export default () => {
},
]);

const formatSearchValue = computed(() => getSearchSelectorParams(value.value));
const formatSearchValue = computed(() => {
const result = getSearchSelectorParams(value.value);
if (_.has(result, 'id')) {
result.ids = result.id;
delete result.id;
}
return result;
});

useRequest(getTicketTypes, {
onSuccess(data) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { computed, shallowRef } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';
Expand Down Expand Up @@ -65,7 +66,14 @@ export default () => {
},
]);

const formatSearchValue = computed(() => getSearchSelectorParams(value.value));
const formatSearchValue = computed(() => {
const result = getSearchSelectorParams(value.value);
if (_.has(result, 'id')) {
result.ids = result.id;
delete result.id;
}
return result;
});

useRequest(getTicketTypes, {
onSuccess(data) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { computed, shallowRef } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';
Expand Down Expand Up @@ -65,7 +66,14 @@ export default () => {
},
]);

const formatSearchValue = computed(() => getSearchSelectorParams(value.value));
const formatSearchValue = computed(() => {
const result = getSearchSelectorParams(value.value);
if (_.has(result, 'id')) {
result.ids = result.id;
delete result.id;
}
return result;
});

useRequest(getTicketTypes, {
onSuccess(data) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { computed, shallowRef } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRequest } from 'vue-request';
Expand Down Expand Up @@ -64,7 +65,14 @@ export default () => {
},
]);

const formatSearchValue = computed(() => getSearchSelectorParams(value.value));
const formatSearchValue = computed(() => {
const result = getSearchSelectorParams(value.value);
if (_.has(result, 'id')) {
result.ids = result.id;
delete result.id;
}
return result;
});

useRequest(getTicketTypes, {
onSuccess(data) {
Expand Down

0 comments on commit 3f69815

Please sign in to comment.