Skip to content
Closed
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 @@ -21,7 +21,9 @@
height: 32px;
"
>
<span style="font-size: 13px; color: #606266; white-space: nowrap" :title="switchLabel">{{ switchLabel }}</span>
<span style="font-size: 13px; color: #606266; white-space: nowrap" :title="switchLabel">{{
switchLabel
}}</span>
<component
ref="componentFormRef"
:view="view"
Expand Down Expand Up @@ -90,7 +92,18 @@ const itemValue = computed({
},
})

const attrs = computed(() => props.formfield.attrs || {})
const attrs = computed(() => {
const base = props.formfield.attrs || {}
if (props.formfield.input_type === 'MultiSelect') {
return {
...base,
'collapse-tags': true,
'collapse-tags-tooltip': true,
'max-collapse-tags': 1,
}
}
return base
})

const switchLabel = computed(() => {
const label =
Expand Down
5 changes: 5 additions & 0 deletions ui/src/locales/lang/en-US/ai-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,10 @@ export default {
share: 'Share',
copyLinkText: 'Copy Link',
userInputSetting: 'External Parameter Setting (up to 3 can be displayed)',
<<<<<<< Updated upstream
executing: 'Executing',
=======
userInputSettingTip:
'Only Model, Knowledge, Switch, Date, TreeSelect, Single Select, and Multi Select component types are supported',
>>>>>>> Stashed changes
}
4 changes: 4 additions & 0 deletions ui/src/locales/lang/zh-CN/ai-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,9 @@ export default {
share: '分享',
copyLinkText: '复制链接',
userInputSetting: '外置参数设置(最多可显示3个)',
<<<<<<< Updated upstream
executing: '正在执行',
=======
userInputSettingTip: '仅支持模型、知识库、开关、日期、树形选项卡、单选框、多选框组件类型',
>>>>>>> Stashed changes
}
4 changes: 4 additions & 0 deletions ui/src/locales/lang/zh-Hant/ai-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,9 @@ export default {
share: '分享',
copyLinkText: '複製連結',
userInputSetting: '外置參數設定(最多可顯示3個)',
<<<<<<< Updated upstream
executing: '正在執行',
=======
userInputSettingTip: '僅支援模型、知識庫、開關、日期、樹形選項卡、單選框、多選框元件類型',
>>>>>>> Stashed changes
}
26 changes: 19 additions & 7 deletions ui/src/workflow/nodes/base-node/component/UserInputTitleDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,25 @@
require-asterisk-position="right"
@submit.prevent
>
<el-form-item :label="$t('aiChat.userInputSetting')">
<el-form-item>
<template #label>
<div class="flex align-center">
<div class="mr-4">
<span>{{ $t('aiChat.userInputSetting') }}</span>
</div>
<el-tooltip effect="dark" placement="right" popper-class="max-w-200">
<template #content>{{ $t('aiChat.userInputSettingTip') }}</template>
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
</el-tooltip>
</div>
</template>
<el-select v-model="form.exposed_fields" multiple style="width: 100%">
<el-option
v-for="item in fieldOptions"
v-for="item in selectableFieldOptions"
:key="item.field"
:label="getFieldLabel(item)"
:value="item.field"
:disabled="
!ALLOWED_EXPOSED_TYPES.includes(item.input_type) ||
(form.exposed_fields.length >= 3 && !form.exposed_fields.includes(item.field))
"
:disabled="form.exposed_fields.length >= 3 && !form.exposed_fields.includes(item.field)"
/>
</el-select>
</el-form-item>
Expand All @@ -50,7 +58,7 @@
</el-dialog>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { reactive, ref, computed } from 'vue'
import type { FormInstance } from 'element-plus'
import { t } from '@/locales'
import { ALLOWED_EXPOSED_TYPES } from '@/components/ai-chat/component/inline-params/constants'
Expand All @@ -60,6 +68,10 @@ const fieldFormRef = ref()
const loading = ref<boolean>(false)
const fieldOptions = ref<any[]>([])

const selectableFieldOptions = computed(() =>
fieldOptions.value.filter((item) => ALLOWED_EXPOSED_TYPES.includes(item.input_type)),
)

const form = ref<any>({
exposed_fields: [],
menu_title: t('common.moreSettings'),
Expand Down
Loading