Commit b4e76b33 authored by tyyin lan's avatar tyyin lan

fix(插件中心): 应用添加插件失败

parent f77478f9
...@@ -26,7 +26,7 @@ interface ApplicationItemInfoInterface { ...@@ -26,7 +26,7 @@ interface ApplicationItemInfoInterface {
unitIds: string[] unitIds: string[]
} }
defineProps<Props>() const props = defineProps<Props>()
const showModal = defineModel<boolean>('showModal', { default: false }) const showModal = defineModel<boolean>('showModal', { default: false })
const { t } = useI18n() const { t } = useI18n()
...@@ -89,7 +89,7 @@ function handleAppAddPlugin(agentId: string) { ...@@ -89,7 +89,7 @@ function handleAppAddPlugin(agentId: string) {
.then((res) => { .then((res) => {
if (res.code !== 0) return '' if (res.code !== 0) return ''
const payload = { ...res.data, unitIds: [...(res.data.unitIds || []), agentId] } const payload = { ...res.data, unitIds: [...(res.data.unitIds || []), props.currentSelectPluginId] }
fetchSaveAgentApplication(payload) fetchSaveAgentApplication(payload)
.then((SaveRes) => { .then((SaveRes) => {
...@@ -177,7 +177,7 @@ function handleNavigateToAppSetting(agentId: string) { ...@@ -177,7 +177,7 @@ function handleNavigateToAppSetting(agentId: string) {
:disabled="item.unitIds.includes(currentSelectPluginId)" :disabled="item.unitIds.includes(currentSelectPluginId)"
@click.stop="handleAppAddPlugin(item.agentId)" @click.stop="handleAppAddPlugin(item.agentId)"
> >
{{ t('common_module.add') }} {{ item.unitIds.includes(currentSelectPluginId) ? t('common_module.added') : t('common_module.add') }}
</n-button> </n-button>
</div> </div>
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment