diff --git a/ui/src/views/document/tag/MulAddTagDialog.vue b/ui/src/views/document/tag/MulAddTagDialog.vue index dd7abda34..c0028db23 100644 --- a/ui/src/views/document/tag/MulAddTagDialog.vue +++ b/ui/src/views/document/tag/MulAddTagDialog.vue @@ -62,7 +62,7 @@ :placeholder="$t('views.document.tag.requiredMessage2')" > { } function tagKeyChange(tag: any) { - const currentKeyOption = keyOptions.value.find((op: any) => op.key === tag.key) - tag.valueOptions = currentKeyOption ? currentKeyOption.values : [] tag.value = null } +function getValueOptions(tag?: any) { + let currentKeyOption = null + if (tag && tag.key) { + currentKeyOption = keyOptions.value.find((op: any) => op.key === tag.key) + } + return currentKeyOption ? currentKeyOption.values : [] +} + const submit = () => { FormRef.value.validate((valid: boolean) => { if (!valid) return @@ -162,12 +168,7 @@ function getTags(Key?: string) { loadSharedApi({ type: 'knowledge', systemType: props.apiType, isShared: isShared.value }) .getTags(id, {}, optionLoading) .then((res: any) => { - if (Key) { - const index = res.data.findIndex((op: any) => op.key === Key) - tagList.value[index].valueOptions = res.data[index].values - } else { - keyOptions.value = res.data - } + keyOptions.value = res.data }) } diff --git a/ui/src/views/document/tag/TagDrawer.vue b/ui/src/views/document/tag/TagDrawer.vue index cb39d75e2..a67d3293a 100644 --- a/ui/src/views/document/tag/TagDrawer.vue +++ b/ui/src/views/document/tag/TagDrawer.vue @@ -5,11 +5,15 @@
- {{ $t('views.document.tag.create') }} + >{{ $t('views.document.tag.create') }} - {{ $t('common.delete') }} @@ -32,7 +36,7 @@ @cell-mouse-enter="cellMouseEnter" @cell-mouse-leave="cellMouseLeave" > - +