Skip to content

Commit

Permalink
fix: 修复资源版本对比显示异常的问题
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 19528
  • Loading branch information
Carlmac committed Sep 27, 2024
1 parent 6a52c88 commit ed3fd8e
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/dashboard-front/src/components/version-diff/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,12 @@ const handleClear = () => {
searchKeyword.value = '';
};

const handleSwitch = () => {
const handleSwitch = async () => {
[localSourceId.value, localTargetId.value] = [
localTargetId.value,
localSourceId.value,
];
getDiffData();
await getDiffData();
};

const checkMatch = (item: any, type: any) => {
Expand Down Expand Up @@ -606,31 +606,27 @@ const updateTableEmptyConfig = () => {
tableEmptyConf.value.keyword = '';
};

const handleClearFilterKey = () => {
const handleClearFilterKey = async () => {
searchParams.keyword = '';
searchParams.diffType = '';
searchKeyword.value = '';
getDiffData();
await getDiffData();
updateTableEmptyConfig();
};

const handleVersionChange = () => {
const handleVersionChange = async () => {
searchParams.keyword = '';
searchParams.diffType = '';
searchParams.onlyUpdated = false;

searchKeyword.value = '';
getDiffData();
await getDiffData();
};

const getDiffData = async () => {
// if (!localSourceId.value) {
// return false;
// }

if (isDataLoading.value) {
if (isDataLoading.value || !localSourceId.value) {
return false;
}

isDataLoading.value = true;

diffData.add = [];
Expand Down Expand Up @@ -763,12 +759,12 @@ const localTargetTriggerLabel = computed(() => {

watch(
() => [props.sourceId, props.targetId],
(newArr) => {
async (newArr) => {
const [sourceId, targetId] = newArr;
localSourceId.value = sourceId;
localTargetId.value = targetId || 'current';
isDataLoading.value = false;
getDiffData();
await getDiffData();
},
);

Expand Down

0 comments on commit ed3fd8e

Please sign in to comment.