Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 配置文件打包下载按钮禁用 #3498

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@
if (service) {
configStore.$patch((state) => {
state.conflictFileCount = 0;
state.allConfigCount = 0;
state.allExistConfigCount = 0;
});
let name = route.name as string;
if (route.name === 'init-script' && service.spec.config_type === 'kv') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
if (props.format === 'text') {
handleValidateEditor();
} else {
console.log(codeEditorRef.value.validate(val), 'c', props.format, val);
nextTick(() => emits('hasError', !codeEditorRef.value.validate(val)));
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@
const tableRef = ref();
const collapseHeader = ref();
const selectedConfigItems = ref<IConfigItem[]>([]);
const conflictCount = ref(0);

// 是否为未命名版本
const isUnNamedVersion = computed(() => versionData.value.id === 0);
Expand Down Expand Up @@ -514,18 +515,6 @@
},
);

watch(
[() => configList.value, () => templatesCount.value],
() => {
const existConfigCount = configList.value.filter((item) => item.file_state !== 'DELETE').length;
configStore.$patch((state) => {
state.allConfigCount = configsCount.value + templatesCount.value;
state.allExistConfigCount = existConfigCount + templatesCount.value;
});
},
{ immediate: true, deep: true },
);

onMounted(async () => {
tableRef.value.addEventListener('scroll', handleScroll);
await getBindingId();
Expand All @@ -545,6 +534,12 @@
const currentSearchStr = props.searchStr;
loading.value = true;
await Promise.all([getCommonConfigList(createConfig), getBoundTemplateList()]);
const existConfigCount = configList.value.filter((item) => item.file_state !== 'DELETE').length;
configStore.$patch((state) => {
state.conflictFileCount = conflictCount.value;
state.allConfigCount = configsCount.value + templatesCount.value;
state.allExistConfigCount = existConfigCount + templatesCount.value;
});
loading.value = false;
// 处理文件数量过多 导致上一次搜索结果返回比这一次慢 导入搜索结果错误 取消数据处理
if (currentSearchStr !== props.searchStr) return;
Expand Down Expand Up @@ -586,9 +581,7 @@
return 0;
});
configsCount.value = res.count;
configStore.$patch((state) => {
state.conflictFileCount = res.conflict_number || 0;
});
conflictCount.value = res.conflict_number || 0;
} catch (e) {
console.error(e);
} finally {
Expand Down
Loading