Skip to content

Commit

Permalink
fix: 修复版本对比中插件差异高亮问题 (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlmac authored Sep 26, 2024
1 parent fd12ca3 commit 6a52c88
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/dashboard-front/src/components/resource-detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,14 @@
</bk-container>

<!-- 插件 -->
<div
v-if="props.diffData?.plugins && Object.keys(props.diffData.plugins).length"
:class="{ 'container-diff': checkPluginsDiff() }"
>
<template v-for="plugin in props.diffData.plugins" :key="plugin.id">
<p class="title mt15" :class="{ 'ag-diff': checkPluginsDiff() }">
{{ $t('插件:{name}', { name: plugin.name }) }}
</p>
<ConfigDisplayTable :plugin="plugin" first-col-width="auto" />
<div v-if="localData.plugins?.length">
<template v-for="plugin in localData.plugins" :key="plugin.id">
<div :class="{ 'container-diff': checkPluginDiff(plugin) }">
<p class="title mt15">
{{ $t('插件:{name}', { name: plugin.name }) }}
</p>
<ConfigDisplayTable :plugin="plugin" first-col-width="auto" />
</div>
</template>
</div>
</div>
Expand Down Expand Up @@ -882,9 +881,11 @@ const checkDiff = (path: any) => {
// );
// };
const checkPluginsDiff = () => {
const checkPluginDiff = (plugin: any) => {
// 检查传入的 plugin 是否记录在 diffMap 中
const diffMapPluginKey = `localData.plugins.${plugin.code || plugin.type}`;
const keys = Object.keys(diffMap.value);
return keys.some(item => item.startsWith('localData.plugins'));
return keys.some(item => item.startsWith(diffMapPluginKey));
};
// 网关标签
Expand Down

0 comments on commit 6a52c88

Please sign in to comment.