mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
feat: document
This commit is contained in:
parent
636f96178c
commit
2fe1803f19
|
|
@ -0,0 +1,39 @@
|
|||
<template>
|
||||
<el-tooltip
|
||||
v-bind="$attrs"
|
||||
:disabled="!(containerWeight > contentWeight)"
|
||||
effect="dark"
|
||||
placement="bottom"
|
||||
popper-class="auto-tooltip-popper"
|
||||
>
|
||||
<div ref="tagLabel" :class="['auto-tooltip', className]" :style="style">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, nextTick } from 'vue'
|
||||
defineOptions({ name: 'AutoTooltip' })
|
||||
const props = defineProps({ className: String, style: Object })
|
||||
const tagLabel = ref()
|
||||
const containerWeight = ref(0)
|
||||
const contentWeight = ref(0)
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
containerWeight.value = tagLabel.value?.scrollWidth
|
||||
contentWeight.value = tagLabel.value?.clientWidth
|
||||
})
|
||||
window.addEventListener('resize', function () {
|
||||
containerWeight.value = tagLabel.value?.scrollWidth
|
||||
contentWeight.value = tagLabel.value?.clientWidth
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.auto-tooltip {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="$t('views.document.generateQuestion.title')"
|
||||
v-model="dialogVisible"
|
||||
width="650"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<div class="content-height">
|
||||
<el-form
|
||||
ref="FormRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-position="top"
|
||||
require-asterisk-position="right"
|
||||
>
|
||||
<div class="update-info flex border-r-4 mb-16 p-8-12">
|
||||
<div class="mt-4">
|
||||
<AppIcon iconName="app-warning-colorful" style="font-size: 16px"></AppIcon>
|
||||
</div>
|
||||
<div class="ml-12 lighter">
|
||||
<p>{{ $t('views.document.generateQuestion.tip1', { data: '{data}' }) }}</p>
|
||||
<p>
|
||||
{{ $t('views.document.generateQuestion.tip2')+ '<question></question>' +
|
||||
$t('views.document.generateQuestion.tip3') }}
|
||||
</p>
|
||||
<p>{{ $t('views.document.generateQuestion.tip4') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item
|
||||
:label="$t('views.application.form.aiModel.label')"
|
||||
prop="model_id"
|
||||
>
|
||||
<ModelSelect
|
||||
v-model="form.model_id"
|
||||
:placeholder="$t('views.application.form.aiModel.placeholder')"
|
||||
:options="modelOptions"
|
||||
showFooter
|
||||
:model-type="'LLM'"
|
||||
></ModelSelect>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.form.prompt.label')"
|
||||
prop="prompt"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.prompt"
|
||||
:placeholder="$t('views.application.form.prompt.placeholder')"
|
||||
:rows="7"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="['document', 'dataset'].includes(apiType)"
|
||||
:label="$t('components.selectParagraph.title')"
|
||||
prop="state"
|
||||
>
|
||||
<el-radio-group v-model="state" class="radio-block">
|
||||
<el-radio value="error" size="large">{{
|
||||
$t('components.selectParagraph.error')
|
||||
}}</el-radio>
|
||||
<el-radio value="all" size="large">{{ $t('components.selectParagraph.all') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click.prevent="dialogVisible = false"> {{ $t('common.cancel') }} </el-button>
|
||||
<el-button type="primary" @click="submitHandle(FormRef)" :disabled="!model || loading">
|
||||
{{ $t('common.confirm') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import documentApi from '@/api/knowledge/document'
|
||||
import paragraphApi from '@/api/knowledge/paragraph'
|
||||
import knowledgeApi from '@/api/knowledge/knowledge'
|
||||
import useStore from '@/stores'
|
||||
import { groupBy } from 'lodash'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
import { t } from '@/locales'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
|
||||
const route = useRoute()
|
||||
const {
|
||||
params: { id, documentId } // id为datasetID
|
||||
} = route as any
|
||||
|
||||
const { model, prompt, user } = useStore()
|
||||
|
||||
const emit = defineEmits(['refresh'])
|
||||
|
||||
const loading = ref<boolean>(false)
|
||||
|
||||
const dialogVisible = ref<boolean>(false)
|
||||
const modelOptions = ref<any>(null)
|
||||
const idList = ref<string[]>([])
|
||||
const apiType = ref('') // 文档document或段落paragraph
|
||||
const state = ref<'all' | 'error'>('error')
|
||||
const stateMap = {
|
||||
all: ['0', '1', '2', '3', '4', '5', 'n'],
|
||||
error: ['0', '1', '3', '4', '5', 'n']
|
||||
}
|
||||
const FormRef = ref()
|
||||
const datasetId = ref<string>()
|
||||
const userId = user.userInfo?.id as string
|
||||
const form = ref(prompt.get(userId))
|
||||
const rules = reactive({
|
||||
model_id: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.application.form.aiModel.placeholder'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
prompt: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.application.form.prompt.placeholder'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
watch(dialogVisible, (bool) => {
|
||||
if (!bool) {
|
||||
form.value = prompt.get(userId)
|
||||
FormRef.value?.clearValidate()
|
||||
}
|
||||
})
|
||||
|
||||
const open = (ids: string[], type: string, _datasetId?: string) => {
|
||||
datasetId.value = _datasetId
|
||||
getModel()
|
||||
idList.value = ids
|
||||
apiType.value = type
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const submitHandle = async (formEl: FormInstance) => {
|
||||
if (!formEl) {
|
||||
return
|
||||
}
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
// 保存提示词
|
||||
prompt.save(user.userInfo?.id as string, form.value)
|
||||
if (apiType.value === 'paragraph') {
|
||||
const data = {
|
||||
...form.value,
|
||||
paragraph_id_list: idList.value
|
||||
}
|
||||
paragraphApi.batchGenerateRelated(id, documentId, data, loading).then(() => {
|
||||
MsgSuccess(t('views.document.generateQuestion.successMessage'))
|
||||
emit('refresh')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
} else if (apiType.value === 'document') {
|
||||
const data = {
|
||||
...form.value,
|
||||
document_id_list: idList.value,
|
||||
state_list: stateMap[state.value]
|
||||
}
|
||||
documentApi.batchGenerateRelated(id, data, loading).then(() => {
|
||||
MsgSuccess(t('views.document.generateQuestion.successMessage'))
|
||||
emit('refresh')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
} else if (apiType.value === 'dataset') {
|
||||
const data = {
|
||||
...form.value,
|
||||
state_list: stateMap[state.value]
|
||||
}
|
||||
datasetApi.generateRelated(id ? id : datasetId.value, data, loading).then(() => {
|
||||
MsgSuccess(t('views.document.generateQuestion.successMessage'))
|
||||
dialogVisible.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getModel() {
|
||||
loading.value = true
|
||||
datasetApi
|
||||
.getDatasetModel(id ? id : datasetId.value)
|
||||
.then((res: any) => {
|
||||
modelOptions.value = groupBy(res?.data, 'provider')
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -15,6 +15,7 @@ import CodemirrorEditor from './codemirror-editor/index.vue'
|
|||
import InfiniteScroll from './infinite-scroll/index.vue'
|
||||
import ModelSelect from './model-select/index.vue'
|
||||
import ReadWrite from './read-write/index.vue'
|
||||
import AutoTooltip from './auto-tooltip/index.vue'
|
||||
export default {
|
||||
install(app: App) {
|
||||
app.component('LogoFull', LogoFull)
|
||||
|
|
@ -33,5 +34,6 @@ export default {
|
|||
app.component('InfiniteScroll', InfiniteScroll)
|
||||
app.component('ModelSelect', ModelSelect)
|
||||
app.component('ReadWrite', ReadWrite)
|
||||
app.component('AutoTooltip', AutoTooltip)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,15 +81,15 @@
|
|||
shape="square"
|
||||
:size="24"
|
||||
/>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-else-if="isDataset && item.type === '1'"
|
||||
class="mr-12 avatar-purple"
|
||||
shape="square"
|
||||
:size="24"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="isDataset && item.type === '2'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
|
|
@ -97,10 +97,10 @@
|
|||
style="background: none"
|
||||
>
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar v-else class="mr-12 avatar-blue" shape="square" :size="24">
|
||||
</el-avatar>
|
||||
<el-avatar v-else class="mr-12 avatar-blue" shape="square" :size="24">
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
<span class="ellipsis" :title="item?.name"> {{ item?.name }}</span>
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import useFolderStore from './modules/folder'
|
|||
import useThemeStore from './modules/theme'
|
||||
import useKnowledgeStore from './modules/knowledge'
|
||||
import useModelStore from './modules/model'
|
||||
import usePromptStore from './modules/prompt'
|
||||
|
||||
const useStore = () => ({
|
||||
common: useCommonStore(),
|
||||
|
|
@ -14,6 +15,7 @@ const useStore = () => ({
|
|||
theme: useThemeStore(),
|
||||
knowledge: useKnowledgeStore(),
|
||||
model: useModelStore(),
|
||||
prompt: usePromptStore(),
|
||||
})
|
||||
|
||||
export default useStore
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import { t } from '@/locales'
|
||||
export interface promptTypes {
|
||||
user: string
|
||||
formValue: { model_id: string; prompt: string }
|
||||
}
|
||||
|
||||
const usePromptStore = defineStore('prompt', {
|
||||
state: (): promptTypes[] => JSON.parse(localStorage.getItem('PROMPT_CACHE') || '[]'),
|
||||
actions: {
|
||||
save(user: string, formValue: any) {
|
||||
this.$state.forEach((item: any, index: number) => {
|
||||
if (item.user === user) {
|
||||
this.$state.splice(index, 1)
|
||||
}
|
||||
})
|
||||
this.$state.push({ user, formValue })
|
||||
localStorage.setItem('PROMPT_CACHE', JSON.stringify(this.$state))
|
||||
},
|
||||
get(user: string) {
|
||||
for (let i = 0; i < this.$state.length; i++) {
|
||||
if (this.$state[i].user === user) {
|
||||
return this.$state[i].formValue
|
||||
}
|
||||
}
|
||||
return {
|
||||
model_id: '',
|
||||
prompt:
|
||||
t('views.document.generateQuestion.prompt1', { data: '{data}' }) +
|
||||
'<question></question>' +
|
||||
t('views.document.generateQuestion.prompt2'),
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
export default usePromptStore
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<el-radio-group v-model="radioType" class="radio-block mb-16">
|
||||
<el-radio value="default">
|
||||
<p>{{ $t('views.applicationOverview.appInfo.EditAvatarDialog.default') }}</p>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="detail?.name"
|
||||
:name="detail?.name"
|
||||
pinyinColor
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<el-radio value="custom">
|
||||
<p>{{ $t('views.applicationOverview.appInfo.EditAvatarDialog.customizeUpload') }}</p>
|
||||
<div class="flex mt-8">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="fileURL"
|
||||
shape="square"
|
||||
:size="32"
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
class="mr-16"
|
||||
>
|
||||
<img :src="fileURL" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
action="#"
|
||||
|
|
|
|||
|
|
@ -33,15 +33,15 @@
|
|||
<div class="flex-between">
|
||||
<div class="flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(detail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="detail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="detail?.name"
|
||||
:name="detail?.name"
|
||||
pinyinColor
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
|
||||
<h4 class="ellipsis">
|
||||
{{ detail?.name || $t('views.application.applicationForm.form.appName.label') }}
|
||||
{{ detail?.name || $t('views.application.form.appName.label') }}
|
||||
</h4>
|
||||
</div>
|
||||
<div class="mr-16">
|
||||
|
|
@ -133,9 +133,9 @@
|
|||
fit="cover"
|
||||
style="width: 28px; height: 28px; display: block"
|
||||
/>
|
||||
<AppAvatar v-else>
|
||||
<el-avatar v-else>
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,22 +12,22 @@
|
|||
@mouseenter="showEditIcon = true"
|
||||
@mouseleave="showEditIcon = false"
|
||||
>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(detail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="detail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="detail?.name"
|
||||
:name="detail?.name"
|
||||
pinyinColor
|
||||
shape="square"
|
||||
:size="32"
|
||||
/>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="showEditIcon"
|
||||
shape="square"
|
||||
class="edit-mask"
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
@click="openEditAvatar"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</div>
|
||||
|
||||
<h4>{{ detail?.name }}</h4>
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
}}</el-tag>
|
||||
</h5>
|
||||
<el-text type="info" class="color-secondary flex mt-8">
|
||||
<AppAvatar :size="20" class="avatar-grey mr-4">
|
||||
<el-avatar :size="20" class="avatar-grey mr-4">
|
||||
<el-icon><UserFilled /></el-icon>
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
{{ row.publish_user_name }}
|
||||
</el-text>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -84,15 +84,15 @@
|
|||
<div class="flex-between">
|
||||
<div class="flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(detail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="detail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="detail?.name"
|
||||
:name="detail?.name"
|
||||
pinyinColor
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
</div>
|
||||
|
||||
<h4>
|
||||
{{ detail?.name || $t('views.application.applicationForm.form.appName.label') }}
|
||||
{{ detail?.name || $t('views.application.form.appName.label') }}
|
||||
</h4>
|
||||
</div>
|
||||
<div class="mr-16">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span
|
||||
>{{ $t('views.application.applicationForm.form.appName.label') }}
|
||||
>{{ $t('views.application.form.appName.label') }}
|
||||
<span class="danger">*</span></span
|
||||
>
|
||||
</div>
|
||||
|
|
@ -41,19 +41,19 @@
|
|||
<el-input
|
||||
v-model="applicationForm.name"
|
||||
maxlength="64"
|
||||
:placeholder="$t('views.application.applicationForm.form.appName.placeholder')"
|
||||
:placeholder="$t('views.application.form.appName.placeholder')"
|
||||
show-word-limit
|
||||
@blur="applicationForm.name = applicationForm.name?.trim()"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.appDescription.label')"
|
||||
:label="$t('views.application.form.appDescription.label')"
|
||||
>
|
||||
<el-input
|
||||
v-model="applicationForm.desc"
|
||||
type="textarea"
|
||||
:placeholder="
|
||||
$t('views.application.applicationForm.form.appDescription.placeholder')
|
||||
$t('views.application.form.appDescription.placeholder')
|
||||
"
|
||||
:rows="3"
|
||||
maxlength="256"
|
||||
|
|
@ -61,10 +61,10 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.aiModel.label')">
|
||||
<el-form-item :label="$t('views.application.form.aiModel.label')">
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span>{{ $t('views.application.applicationForm.form.aiModel.label') }}</span>
|
||||
<span>{{ $t('views.application.form.aiModel.label') }}</span>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
</template>
|
||||
<ModelSelect
|
||||
v-model="applicationForm.model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.aiModel.placeholder')"
|
||||
:placeholder="$t('views.application.form.aiModel.placeholder')"
|
||||
:options="modelOptions"
|
||||
@change="model_change"
|
||||
@submitModel="getModel"
|
||||
|
|
@ -87,15 +87,15 @@
|
|||
></ModelSelect>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:label="$t('views.application.form.roleSettings.label')"
|
||||
>
|
||||
<MdEditorMagnify
|
||||
:title="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:title="$t('views.application.form.roleSettings.label')"
|
||||
v-model="applicationForm.model_setting.system"
|
||||
style="height: 120px"
|
||||
@submitDialog="submitSystemDialog"
|
||||
:placeholder="
|
||||
$t('views.application.applicationForm.form.roleSettings.placeholder')
|
||||
$t('views.application.form.roleSettings.placeholder')
|
||||
"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
prop="model_setting.no_references_prompt"
|
||||
:rules="{
|
||||
required: applicationForm.model_id,
|
||||
message: $t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: $t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
|
|
@ -111,14 +111,14 @@
|
|||
<div class="flex align-center">
|
||||
<span class="mr-4"
|
||||
>{{
|
||||
$t('views.application.applicationForm.form.prompt.label') +
|
||||
$t('views.application.applicationForm.form.prompt.noReferences')
|
||||
$t('views.application.form.prompt.label') +
|
||||
$t('views.application.form.prompt.noReferences')
|
||||
}}
|
||||
</span>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="
|
||||
$t('views.application.applicationForm.form.prompt.noReferencesTooltip', {
|
||||
$t('views.application.form.prompt.noReferencesTooltip', {
|
||||
question: '{question}'
|
||||
})
|
||||
"
|
||||
|
|
@ -133,8 +133,8 @@
|
|||
|
||||
<MdEditorMagnify
|
||||
:title="
|
||||
$t('views.application.applicationForm.form.prompt.label') +
|
||||
$t('views.application.applicationForm.form.prompt.noReferences')
|
||||
$t('views.application.form.prompt.label') +
|
||||
$t('views.application.form.prompt.noReferences')
|
||||
"
|
||||
v-model="applicationForm.model_setting.no_references_prompt"
|
||||
style="height: 120px"
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.historyRecord.label')"
|
||||
:label="$t('views.application.form.historyRecord.label')"
|
||||
@click.prevent
|
||||
>
|
||||
<el-input-number
|
||||
|
|
@ -157,12 +157,12 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="$t('views.application.applicationForm.form.relatedKnowledgeBase')"
|
||||
label="$t('views.application.form.relatedKnowledgeBase')"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span>{{
|
||||
$t('views.application.applicationForm.form.relatedKnowledge.label')
|
||||
$t('views.application.form.relatedKnowledge.label')
|
||||
}}</span>
|
||||
<div>
|
||||
<el-button type="primary" link @click="openParamSettingDialog">
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
</template>
|
||||
<div class="w-full">
|
||||
<el-text type="info" v-if="applicationForm.dataset_id_list?.length === 0"
|
||||
>{{ $t('views.application.applicationForm.form.relatedKnowledge.placeholder') }}
|
||||
>{{ $t('views.application.form.relatedKnowledge.placeholder') }}
|
||||
</el-text>
|
||||
<el-row :gutter="12" v-else>
|
||||
<el-col
|
||||
|
|
@ -196,15 +196,15 @@
|
|||
<el-card class="relate-dataset-card border-r-4" shadow="never">
|
||||
<div class="flex-between">
|
||||
<div class="flex align-center" style="width: 80%">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="relatedObject(datasetList, item, 'id')?.type === '1'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
:size="32"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="relatedObject(datasetList, item, 'id')?.type === '2'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
|
|
@ -212,10 +212,10 @@
|
|||
style="background: none"
|
||||
>
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar v-else class="mr-8 avatar-blue" shape="square" :size="32">
|
||||
</el-avatar>
|
||||
<el-avatar v-else class="mr-8 avatar-blue" shape="square" :size="32">
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
|
||||
<span
|
||||
class="ellipsis cursor"
|
||||
|
|
@ -236,24 +236,24 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:label="$t('views.application.form.prompt.label')"
|
||||
prop="model_setting.prompt"
|
||||
:rules="{
|
||||
required: applicationForm.model_id,
|
||||
message: $t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: $t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex align-center">
|
||||
<span class="mr-4">
|
||||
{{ $t('views.application.applicationForm.form.prompt.label') }}
|
||||
{{ $t('views.application.applicationForm.form.prompt.references') }}
|
||||
{{ $t('views.application.form.prompt.label') }}
|
||||
{{ $t('views.application.form.prompt.references') }}
|
||||
</span>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="
|
||||
$t('views.application.applicationForm.form.prompt.referencesTooltip', {
|
||||
$t('views.application.form.prompt.referencesTooltip', {
|
||||
data: '{data}',
|
||||
question: '{question}'
|
||||
})
|
||||
|
|
@ -269,8 +269,8 @@
|
|||
|
||||
<MdEditorMagnify
|
||||
:title="
|
||||
$t('views.application.applicationForm.form.prompt.label') +
|
||||
$t('views.application.applicationForm.form.prompt.references')
|
||||
$t('views.application.form.prompt.label') +
|
||||
$t('views.application.form.prompt.references')
|
||||
"
|
||||
v-model="applicationForm.model_setting.prompt"
|
||||
style="height: 150px"
|
||||
|
|
@ -278,9 +278,9 @@
|
|||
:placeholder="defaultPrompt"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.prologue')">
|
||||
<el-form-item :label="$t('views.application.form.prologue')">
|
||||
<MdEditorMagnify
|
||||
:title="$t('views.application.applicationForm.form.prologue')"
|
||||
:title="$t('views.application.form.prologue')"
|
||||
v-model="applicationForm.prologue"
|
||||
style="height: 150px"
|
||||
@submitDialog="submitPrologueDialog"
|
||||
|
|
@ -290,7 +290,7 @@
|
|||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span class="mr-4">
|
||||
{{ $t('views.application.applicationForm.form.reasoningContent.label') }}
|
||||
{{ $t('views.application.form.reasoningContent.label') }}
|
||||
</span>
|
||||
|
||||
<div class="flex">
|
||||
|
|
@ -312,14 +312,14 @@
|
|||
prop="stt_model_id"
|
||||
:rules="{
|
||||
required: applicationForm.stt_model_enable,
|
||||
message: $t('views.application.applicationForm.form.voiceInput.requiredMessage'),
|
||||
message: $t('views.application.form.voiceInput.requiredMessage'),
|
||||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span class="mr-4">
|
||||
{{ $t('views.application.applicationForm.form.voiceInput.label') }}
|
||||
{{ $t('views.application.form.voiceInput.label') }}
|
||||
<span class="danger" v-if="applicationForm.stt_model_enable">*</span>
|
||||
</span>
|
||||
|
||||
|
|
@ -328,7 +328,7 @@
|
|||
v-if="applicationForm.stt_model_enable"
|
||||
v-model="applicationForm.stt_autosend"
|
||||
>{{
|
||||
$t('views.application.applicationForm.form.voiceInput.autoSend')
|
||||
$t('views.application.form.voiceInput.autoSend')
|
||||
}}</el-checkbox
|
||||
>
|
||||
<el-switch
|
||||
|
|
@ -343,7 +343,7 @@
|
|||
<ModelSelect
|
||||
v-show="applicationForm.stt_model_enable"
|
||||
v-model="applicationForm.stt_model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.voiceInput.placeholder')"
|
||||
:placeholder="$t('views.application.form.voiceInput.placeholder')"
|
||||
:options="sttModelOptions"
|
||||
:model-type="'STT'"
|
||||
></ModelSelect>
|
||||
|
|
@ -352,14 +352,14 @@
|
|||
prop="tts_model_id"
|
||||
:rules="{
|
||||
required: applicationForm.tts_type === 'TTS' && applicationForm.tts_model_enable,
|
||||
message: $t('views.application.applicationForm.form.voicePlay.requiredMessage'),
|
||||
message: $t('views.application.form.voicePlay.requiredMessage'),
|
||||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span class="mr-4"
|
||||
>{{ $t('views.application.applicationForm.form.voicePlay.label') }}
|
||||
>{{ $t('views.application.form.voicePlay.label') }}
|
||||
<span
|
||||
class="danger"
|
||||
v-if="
|
||||
|
|
@ -373,7 +373,7 @@
|
|||
v-if="applicationForm.tts_model_enable"
|
||||
v-model="applicationForm.tts_autoplay"
|
||||
>{{
|
||||
$t('views.application.applicationForm.form.voicePlay.autoPlay')
|
||||
$t('views.application.form.voicePlay.autoPlay')
|
||||
}}</el-checkbox
|
||||
>
|
||||
<el-switch
|
||||
|
|
@ -392,10 +392,10 @@
|
|||
class="mb-8"
|
||||
>
|
||||
<el-radio value="BROWSER">{{
|
||||
$t('views.application.applicationForm.form.voicePlay.browser')
|
||||
$t('views.application.form.voicePlay.browser')
|
||||
}}</el-radio>
|
||||
<el-radio value="TTS">{{
|
||||
$t('views.application.applicationForm.form.voicePlay.tts')
|
||||
$t('views.application.form.voicePlay.tts')
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
|
@ -404,7 +404,7 @@
|
|||
v-if="applicationForm.tts_type === 'TTS' && applicationForm.tts_model_enable"
|
||||
v-model="applicationForm.tts_model_id"
|
||||
:placeholder="
|
||||
$t('views.application.applicationForm.form.voicePlay.placeholder')
|
||||
$t('views.application.form.voicePlay.placeholder')
|
||||
"
|
||||
:options="ttsModelOptions"
|
||||
@change="ttsModelChange()"
|
||||
|
|
@ -436,22 +436,22 @@
|
|||
@mouseenter="showEditIcon = true"
|
||||
@mouseleave="showEditIcon = false"
|
||||
>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(applicationForm?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="applicationForm?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="applicationForm?.name"
|
||||
:name="applicationForm?.name"
|
||||
pinyinColor
|
||||
shape="square"
|
||||
:size="32"
|
||||
/>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="showEditIcon"
|
||||
shape="square"
|
||||
class="edit-mask"
|
||||
|
|
@ -459,11 +459,11 @@
|
|||
@click="openEditAvatar"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</div>
|
||||
<h4>
|
||||
{{
|
||||
applicationForm?.name || $t('views.application.applicationForm.form.appName.label')
|
||||
applicationForm?.name || $t('views.application.form.appName.label')
|
||||
}}
|
||||
</h4>
|
||||
</div>
|
||||
|
|
@ -518,7 +518,7 @@ const {
|
|||
params: { id }
|
||||
} = route as any
|
||||
// @ts-ignore
|
||||
const defaultPrompt = t('views.application.applicationForm.form.prompt.defaultPrompt', {
|
||||
const defaultPrompt = t('views.application.form.prompt.defaultPrompt', {
|
||||
data: '{data}',
|
||||
question: '{question}'
|
||||
})
|
||||
|
|
@ -546,7 +546,7 @@ const applicationForm = ref<ApplicationFormType>({
|
|||
desc: '',
|
||||
model_id: '',
|
||||
dialogue_number: 1,
|
||||
prologue: t('views.application.applicationForm.form.defaultPrologue'),
|
||||
prologue: t('views.application.form.defaultPrologue'),
|
||||
dataset_id_list: [],
|
||||
dataset_setting: {
|
||||
top_n: 3,
|
||||
|
|
@ -560,7 +560,7 @@ const applicationForm = ref<ApplicationFormType>({
|
|||
},
|
||||
model_setting: {
|
||||
prompt: defaultPrompt,
|
||||
system: t('views.application.applicationForm.form.roleSettings.placeholder'),
|
||||
system: t('views.application.form.roleSettings.placeholder'),
|
||||
no_references_prompt: '{question}',
|
||||
reasoning_content_enable: false
|
||||
},
|
||||
|
|
@ -579,7 +579,7 @@ const rules = reactive<FormRules<ApplicationFormType>>({
|
|||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.application.applicationForm.form.appName.placeholder'),
|
||||
message: t('views.application.form.appName.placeholder'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -14,19 +14,19 @@
|
|||
label-position="top"
|
||||
require-asterisk-position="right"
|
||||
>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.appName.label')" prop="name">
|
||||
<el-form-item :label="$t('views.application.form.appName.label')" prop="name">
|
||||
<el-input
|
||||
v-model="applicationForm.name"
|
||||
maxlength="64"
|
||||
:placeholder="$t('views.application.applicationForm.form.appName.placeholder')"
|
||||
:placeholder="$t('views.application.form.appName.placeholder')"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.appDescription.label')">
|
||||
<el-form-item :label="$t('views.application.form.appDescription.label')">
|
||||
<el-input
|
||||
v-model="applicationForm.desc"
|
||||
type="textarea"
|
||||
:placeholder="$t('views.application.applicationForm.form.appDescription.placeholder')"
|
||||
:placeholder="$t('views.application.form.appDescription.placeholder')"
|
||||
:rows="3"
|
||||
maxlength="256"
|
||||
show-word-limit
|
||||
|
|
@ -61,7 +61,7 @@ const router = useRouter()
|
|||
const { common, user } = useStore()
|
||||
|
||||
// @ts-ignore
|
||||
const defaultPrompt = t('views.application.applicationForm.form.prompt.defaultPrompt', {
|
||||
const defaultPrompt = t('views.application.form.prompt.defaultPrompt', {
|
||||
data: '{data}',
|
||||
question: '{question}'
|
||||
})
|
||||
|
|
@ -75,7 +75,7 @@ const applicationForm = ref<ApplicationFormType>({
|
|||
desc: '',
|
||||
model_id: '',
|
||||
dialogue_number: 0,
|
||||
prologue: t('views.application.applicationForm.form.defaultPrologue'),
|
||||
prologue: t('views.application.form.defaultPrologue'),
|
||||
dataset_id_list: [],
|
||||
dataset_setting: {
|
||||
top_n: 3,
|
||||
|
|
@ -98,7 +98,7 @@ const rules = reactive<FormRules<ApplicationFormType>>({
|
|||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.application.applicationForm.form.appName.placeholder'),
|
||||
message: t('views.application.form.appName.placeholder'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
|
|
@ -111,7 +111,7 @@ watch(dialogVisible, (bool) => {
|
|||
desc: '',
|
||||
model_id: '',
|
||||
dialogue_number: 0,
|
||||
prologue: t('views.application.applicationForm.form.defaultPrologue'),
|
||||
prologue: t('views.application.form.defaultPrologue'),
|
||||
dataset_id_list: [],
|
||||
dataset_setting: {
|
||||
top_n: 3,
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@
|
|||
<template #label>
|
||||
<div class="flex align-center">
|
||||
<span class="mr-4">{{
|
||||
$t('views.application.applicationForm.form.problemOptimization.label')
|
||||
$t('views.application.form.problemOptimization.label')
|
||||
}}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="form.problem_optimization"
|
||||
:label="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:label="$t('views.application.form.prompt.label')"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.problem_optimization_prompt"
|
||||
|
|
@ -239,14 +239,14 @@ const noReferencesRules = reactive<FormRules<any>>({
|
|||
ai_questioning: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.application.applicationForm.form.aiModel.placeholder'),
|
||||
message: t('views.application.form.aiModel.placeholder'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
designated_answer: [
|
||||
{
|
||||
required: true,
|
||||
message: t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@
|
|||
>
|
||||
<el-form label-position="top" ref="paramFormRef" :model="form" class="p-12-16">
|
||||
<el-text type="info" class="color-secondary">{{
|
||||
$t('views.application.applicationForm.form.reasoningContent.tooltip')
|
||||
$t('views.application.form.reasoningContent.tooltip')
|
||||
}}</el-text>
|
||||
<el-row class="mt-16" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.reasoningContent.start')"
|
||||
:label="$t('views.application.form.reasoningContent.start')"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.reasoningContent.end')">
|
||||
<el-form-item :label="$t('views.application.form.reasoningContent.end')">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="form.reasoning_content_end"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<div class="flex-between">
|
||||
<el-button @click="testPlay" :loading="playLoading">
|
||||
<AppIcon iconName="app-video-play" class="mr-4"></AppIcon>
|
||||
{{ $t('views.application.applicationForm.form.voicePlay.listeningTest') }}
|
||||
{{ $t('views.application.form.voicePlay.listeningTest') }}
|
||||
</el-button>
|
||||
|
||||
<span class="dialog-footer">
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
<div class="chat-pc__header" :style="customStyle">
|
||||
<div class="flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(application_profile?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="application_profile?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="application_profile?.name"
|
||||
:name="application_profile?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
<div class="chat__header" :class="!isDefaultTheme ? 'custom-header' : ''">
|
||||
<div class="chat-width flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(applicationDetail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="applicationDetail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="applicationDetail?.name"
|
||||
:name="applicationDetail?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -11,15 +11,15 @@
|
|||
<div class="chat-embed__header" :style="customStyle">
|
||||
<div class="flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(applicationDetail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="applicationDetail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="applicationDetail?.name"
|
||||
:name="applicationDetail?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
<div class="chat-embed__header" :style="customStyle">
|
||||
<div class="flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(applicationDetail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="applicationDetail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="applicationDetail?.name"
|
||||
:name="applicationDetail?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -11,15 +11,15 @@
|
|||
<div class="chat-pc__header" :style="customStyle">
|
||||
<div class="flex align-center">
|
||||
<div class="mr-12 ml-24 flex">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(applicationDetail?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
style="background: none"
|
||||
>
|
||||
<img :src="applicationDetail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="applicationDetail?.name"
|
||||
:name="applicationDetail?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ import { useRoute } from 'vue-router'
|
|||
import type { FormInstance } from 'element-plus'
|
||||
import documentApi from '@/api/knowledge/document'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
// import { hitHandlingMethod } from '@/enums/document'
|
||||
import { hitHandlingMethod } from '@/enums/document'
|
||||
import { t } from '@/locales'
|
||||
const route = useRoute()
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -24,23 +24,23 @@
|
|||
<el-card shadow="never" :class="item.id === selectDataset ? 'active' : ''">
|
||||
<el-radio :value="item.id" size="large">
|
||||
<div class="flex align-center">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="item?.type === '0'"
|
||||
class="mr-8 avatar-blue"
|
||||
shape="square"
|
||||
:size="32"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-if="item?.type === '1'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
:size="32"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-if="item?.type === '2'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
style="background: none"
|
||||
>
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
<span class="ellipsis" :title="item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ const startedMap = {
|
|||
[TaskType.SYNC]: t('views.document.fileStatus.SYNC')
|
||||
}
|
||||
const taskTypeMap = {
|
||||
[TaskType.EMBEDDING]: t('views.dataset.setting.vectorization'),
|
||||
[TaskType.EMBEDDING]: t('views.knowledge.setting.vectorization'),
|
||||
[TaskType.GENERATE_PROBLEM]: t('views.document.generateQuestion.title'),
|
||||
[TaskType.SYNC]: t('views.dataset.setting.sync')
|
||||
[TaskType.SYNC]: t('views.knowledge.setting.sync')
|
||||
}
|
||||
const stateMap: any = {
|
||||
[State.PENDING]: (type: number) => t('views.document.fileStatus.PENDING'),
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ import { hitHandlingMethod } from '@/enums/document'
|
|||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||
import useStore from '@/stores'
|
||||
import StatusValue from '@/views/document/component/Status.vue'
|
||||
// import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
|
||||
import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
|
||||
import EmbeddingContentDialog from '@/views/document/component/EmbeddingContentDialog.vue'
|
||||
import { TaskType, State } from '@/utils/status'
|
||||
import { t } from '@/locales'
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
<div class="hit-test__main p-16" v-loading="loading">
|
||||
<div class="question-title" :style="{ visibility: questionTitle ? 'visible' : 'hidden' }">
|
||||
<div class="avatar">
|
||||
<AppAvatar>
|
||||
<el-avatar>
|
||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h4 class="text break-all">{{ questionTitle }}</h4>
|
||||
|
|
@ -54,8 +54,8 @@
|
|||
@click="editParagraph(item)"
|
||||
>
|
||||
<template #icon>
|
||||
<AppAvatar class="mr-12 avatar-light" :size="22">
|
||||
{{ index + 1 + '' }}</AppAvatar
|
||||
<el-avatar class="mr-12 avatar-light" :size="22">
|
||||
{{ index + 1 + '' }}</el-avatar
|
||||
>
|
||||
</template>
|
||||
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="$t('views.dataset.syncWeb.title')"
|
||||
:title="$t('views.knowledge.syncWeb.title')"
|
||||
v-model="dialogVisible"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<p class="mb-8">{{ $t('views.dataset.syncWeb.syncMethod') }}</p>
|
||||
<p class="mb-8">{{ $t('views.knowledge.syncWeb.syncMethod') }}</p>
|
||||
<el-radio-group v-model="method" class="card__radio">
|
||||
<el-card shadow="never" class="mb-16" :class="method === 'replace' ? 'active' : ''">
|
||||
<el-radio value="replace" size="large">
|
||||
<p class="mb-4">{{ $t('views.dataset.syncWeb.replace') }}</p>
|
||||
<el-text type="info">{{ $t('views.dataset.syncWeb.replaceText') }}</el-text>
|
||||
<p class="mb-4">{{ $t('views.knowledge.syncWeb.replace') }}</p>
|
||||
<el-text type="info">{{ $t('views.knowledge.syncWeb.replaceText') }}</el-text>
|
||||
</el-radio>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mb-16" :class="method === 'complete' ? 'active' : ''">
|
||||
<el-radio value="complete" size="large">
|
||||
<p class="mb-4">{{ $t('views.dataset.syncWeb.complete') }}</p>
|
||||
<el-text type="info">{{ $t('views.dataset.syncWeb.completeText') }}</el-text>
|
||||
<p class="mb-4">{{ $t('views.knowledge.syncWeb.complete') }}</p>
|
||||
<el-text type="info">{{ $t('views.knowledge.syncWeb.completeText') }}</el-text>
|
||||
</el-radio>
|
||||
</el-card>
|
||||
</el-radio-group>
|
||||
<p class="danger">{{ $t('views.dataset.syncWeb.tip') }}</p>
|
||||
<p class="danger">{{ $t('views.knowledge.syncWeb.tip') }}</p>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click.prevent="dialogVisible = false"> {{ $t('common.cancel') }} </el-button>
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@
|
|||
>
|
||||
<el-option v-for="item in datasetList" :key="item.id" :label="item.name" :value="item.id">
|
||||
<span class="flex align-center">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="!item.dataset_id && item.type === '1'"
|
||||
class="mr-12 avatar-purple"
|
||||
shape="square"
|
||||
:size="24"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="!item.dataset_id && item.type === '2'"
|
||||
class="mr-12 avatar-purple"
|
||||
shape="square"
|
||||
|
|
@ -40,15 +40,15 @@
|
|||
style="background: none"
|
||||
>
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="!item.dataset_id && item.type === '0'"
|
||||
class="mr-12 avatar-blue"
|
||||
shape="square"
|
||||
:size="24"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</el-option>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<el-radio-group v-model="radioType" class="radio-block mb-16">
|
||||
<el-radio value="default">
|
||||
<p>{{ $t('common.EditAvatarDialog.default') }}</p>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="detail?.name"
|
||||
:name="detail?.name"
|
||||
pinyinColor
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<el-radio value="custom">
|
||||
<p>{{ $t('common.EditAvatarDialog.customizeUpload') }}</p>
|
||||
<div class="flex mt-8">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="fileURL"
|
||||
shape="square"
|
||||
:size="32"
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
class="mr-16"
|
||||
>
|
||||
<img :src="fileURL" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
action="#"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="card-header">
|
||||
<div class="flex-between">
|
||||
<div class="title flex align-center">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(functionDetail?.icon)"
|
||||
shape="square"
|
||||
:size="64"
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
class="mr-8"
|
||||
>
|
||||
<img :src="functionDetail?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="functionDetail?.name"
|
||||
:name="functionDetail?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export const startNode = {
|
|||
globalFields: [
|
||||
{ label: t('views.applicationWorkflow.nodes.startNode.currentTime'), value: 'time' },
|
||||
{
|
||||
label: t('views.application.applicationForm.form.historyRecord.label'),
|
||||
label: t('views.application.form.historyRecord.label'),
|
||||
value: 'history_context'
|
||||
},
|
||||
{
|
||||
|
|
@ -49,7 +49,7 @@ export const baseNode = {
|
|||
name: '',
|
||||
desc: '',
|
||||
// @ts-ignore
|
||||
prologue: t('views.application.applicationForm.form.defaultPrologue'),
|
||||
prologue: t('views.application.form.defaultPrologue'),
|
||||
tts_type: 'BROWSER'
|
||||
},
|
||||
config: {},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar class="avatar-gradient" shape="square">
|
||||
<el-avatar class="avatar-gradient" shape="square">
|
||||
<img src="@/assets/icon_robot.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(item?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
class="mr-8"
|
||||
>
|
||||
<img :src="item?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="item?.name"
|
||||
:name="item?.name"
|
||||
pinyinColor
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #FF8800;">
|
||||
<el-avatar shape="square" style="background: #FF8800;">
|
||||
<img src="@/assets/icon_hi.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #14C0FF;">
|
||||
<el-avatar shape="square" style="background: #14C0FF;">
|
||||
<img src="@/assets/icon_condition.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" class="avatar-blue">
|
||||
<el-avatar shape="square" class="avatar-blue">
|
||||
<img src="@/assets/icon_docs.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #34c724">
|
||||
<el-avatar shape="square" style="background: #34c724">
|
||||
<img src="@/assets/icon_form.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="isAppIcon(item?.icon)"
|
||||
shape="square"
|
||||
:size="32"
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
class="mr-8"
|
||||
>
|
||||
<img :src="item?.icon" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar v-else shape="square" style="background: #34c724">
|
||||
</el-avatar>
|
||||
<el-avatar v-else shape="square" style="background: #34c724">
|
||||
<img src="@/assets/icon_function_outlined.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { isAppIcon } from '@/utils/common'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #34c724">
|
||||
<el-avatar shape="square" style="background: #34c724">
|
||||
<img src="@/assets/icon_function_outlined.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #FF8800;">
|
||||
<el-avatar shape="square" style="background: #FF8800;">
|
||||
<img src="@/assets/icon_text-image.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #14C0FF;">
|
||||
<el-avatar shape="square" style="background: #14C0FF;">
|
||||
<img src="@/assets/icon_image.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #34c724">
|
||||
<el-avatar shape="square" style="background: #34c724">
|
||||
<img src="@/assets/icon_mcp.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #34C724">
|
||||
<el-avatar shape="square" style="background: #34C724">
|
||||
<img src="@/assets/icon_setting.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #FF8800">
|
||||
<el-avatar shape="square" style="background: #FF8800">
|
||||
<img src="@/assets/icon_reply.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #7F3BF5">
|
||||
<el-avatar shape="square" style="background: #7F3BF5">
|
||||
<img src="@/assets/icon_reranker.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" class="avatar-blue">
|
||||
<el-avatar shape="square" class="avatar-blue">
|
||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #ff8800">
|
||||
<el-avatar shape="square" style="background: #ff8800">
|
||||
<img src="@/assets/icon_speech_to_text.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #D136D1;">
|
||||
<el-avatar shape="square" style="background: #D136D1;">
|
||||
<img src="@/assets/icon_start.svg" style="width: 75%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" style="background: #14c0ff">
|
||||
<el-avatar shape="square" style="background: #14c0ff">
|
||||
<img src="@/assets/icon_text_to_speech.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<AppAvatar shape="square" class="avatar-blue">
|
||||
<el-avatar shape="square" class="avatar-blue">
|
||||
<img src="@/assets/icon_assigner.svg" style="width: 65%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
</template>
|
||||
<script setup lang="ts"></script>
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
hide-required-asterisk
|
||||
>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.aiModel.label')"
|
||||
:label="$t('views.application.form.aiModel.label')"
|
||||
prop="model_id"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.aiModel.placeholder'),
|
||||
message: $t('views.application.form.aiModel.placeholder'),
|
||||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="flex-between w-full">
|
||||
<div>
|
||||
<span
|
||||
>{{ $t('views.application.applicationForm.form.aiModel.label')
|
||||
>{{ $t('views.application.form.aiModel.label')
|
||||
}}<span class="danger">*</span></span
|
||||
>
|
||||
</div>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
@wheel="wheel"
|
||||
:teleported="false"
|
||||
v-model="chat_data.model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.aiModel.placeholder')"
|
||||
:placeholder="$t('views.application.form.aiModel.placeholder')"
|
||||
:options="modelOptions"
|
||||
@submitModel="getModel"
|
||||
showFooter
|
||||
|
|
@ -53,21 +53,21 @@
|
|||
></ModelSelect>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.roleSettings.label')">
|
||||
<el-form-item :label="$t('views.application.form.roleSettings.label')">
|
||||
<MdEditorMagnify
|
||||
:title="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:title="$t('views.application.form.roleSettings.label')"
|
||||
v-model="chat_data.system"
|
||||
style="height: 100px"
|
||||
@submitDialog="submitSystemDialog"
|
||||
:placeholder="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:placeholder="$t('views.application.form.roleSettings.label')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:label="$t('views.application.form.prompt.label')"
|
||||
prop="prompt"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: $t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
|
|
@ -75,13 +75,13 @@
|
|||
<div class="flex align-center">
|
||||
<div class="mr-4">
|
||||
<span
|
||||
>{{ $t('views.application.applicationForm.form.prompt.label')
|
||||
>{{ $t('views.application.form.prompt.label')
|
||||
}}<span class="danger">*</span></span
|
||||
>
|
||||
</div>
|
||||
<el-tooltip effect="dark" placement="right" popper-class="max-w-200">
|
||||
<template #content
|
||||
>{{ $t('views.application.applicationForm.form.prompt.tooltip') }}
|
||||
>{{ $t('views.application.form.prompt.tooltip') }}
|
||||
</template>
|
||||
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
||||
</el-tooltip>
|
||||
|
|
@ -89,16 +89,16 @@
|
|||
</template>
|
||||
<MdEditorMagnify
|
||||
@wheel="wheel"
|
||||
:title="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:title="$t('views.application.form.prompt.label')"
|
||||
v-model="chat_data.prompt"
|
||||
style="height: 150px"
|
||||
@submitDialog="submitDialog"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.historyRecord.label')">
|
||||
<el-form-item :label="$t('views.application.form.historyRecord.label')">
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<div>{{ $t('views.application.applicationForm.form.historyRecord.label') }}</div>
|
||||
<div>{{ $t('views.application.form.historyRecord.label') }}</div>
|
||||
<el-select v-model="chat_data.dialogue_type" type="small" style="width: 100px">
|
||||
<el-option :label="$t('views.applicationWorkflow.node')" value="NODE" />
|
||||
<el-option :label="$t('views.applicationWorkflow.workflow')" value="WORKFLOW" />
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
<div class="flex-between w-full">
|
||||
<div>
|
||||
<span>{{
|
||||
$t('views.application.applicationForm.form.reasoningContent.label')
|
||||
$t('views.application.form.reasoningContent.label')
|
||||
}}</span>
|
||||
</div>
|
||||
<el-button
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
:label="$t('views.applicationWorkflow.nodes.baseNode.appName.label')"
|
||||
prop="name"
|
||||
:rules="{
|
||||
message: t('views.application.applicationForm.form.appName.requiredMessage'),
|
||||
message: t('views.application.form.appName.requiredMessage'),
|
||||
trigger: 'blur',
|
||||
required: true
|
||||
}"
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<el-input
|
||||
v-model="form_data.name"
|
||||
maxlength="64"
|
||||
:placeholder="t('views.application.applicationForm.form.appName.placeholder')"
|
||||
:placeholder="t('views.application.form.appName.placeholder')"
|
||||
show-word-limit
|
||||
@blur="form_data.name = form_data.name?.trim()"
|
||||
/>
|
||||
|
|
@ -29,17 +29,17 @@
|
|||
<el-form-item :label="$t('views.applicationWorkflow.nodes.baseNode.appDescription.label')">
|
||||
<el-input
|
||||
v-model="form_data.desc"
|
||||
:placeholder="$t('views.application.applicationForm.form.appDescription.placeholder')"
|
||||
:placeholder="$t('views.application.form.appDescription.placeholder')"
|
||||
:rows="3"
|
||||
type="textarea"
|
||||
maxlength="256"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.prologue')">
|
||||
<el-form-item :label="$t('views.application.form.prologue')">
|
||||
<MdEditorMagnify
|
||||
@wheel="wheel"
|
||||
:title="$t('views.application.applicationForm.form.prologue')"
|
||||
:title="$t('views.application.form.prologue')"
|
||||
v-model="form_data.prologue"
|
||||
style="height: 150px"
|
||||
@submitDialog="submitDialog"
|
||||
|
|
@ -87,11 +87,11 @@
|
|||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span class="mr-4">{{
|
||||
$t('views.application.applicationForm.form.voiceInput.label')
|
||||
$t('views.application.form.voiceInput.label')
|
||||
}}</span>
|
||||
<div class="flex">
|
||||
<el-checkbox v-if="form_data.stt_model_enable" v-model="form_data.stt_autosend">{{
|
||||
$t('views.application.applicationForm.form.voiceInput.autoSend')
|
||||
$t('views.application.form.voiceInput.autoSend')
|
||||
}}</el-checkbox>
|
||||
<el-switch
|
||||
class="ml-8"
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
@wheel="wheel"
|
||||
v-show="form_data.stt_model_enable"
|
||||
v-model="form_data.stt_model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.voiceInput.placeholder')"
|
||||
:placeholder="$t('views.application.form.voiceInput.placeholder')"
|
||||
:options="sttModelOptions"
|
||||
showFooter
|
||||
:model-type="'STT'"
|
||||
|
|
@ -116,11 +116,11 @@
|
|||
<template #label>
|
||||
<div class="flex-between">
|
||||
<span class="mr-4">{{
|
||||
$t('views.application.applicationForm.form.voicePlay.label')
|
||||
$t('views.application.form.voicePlay.label')
|
||||
}}</span>
|
||||
<div class="flex">
|
||||
<el-checkbox v-if="form_data.tts_model_enable" v-model="form_data.tts_autoplay">{{
|
||||
$t('views.application.applicationForm.form.voicePlay.autoPlay')
|
||||
$t('views.application.form.voicePlay.autoPlay')
|
||||
}}</el-checkbox>
|
||||
<el-switch
|
||||
class="ml-8"
|
||||
|
|
@ -134,11 +134,11 @@
|
|||
<div class="w-full">
|
||||
<el-radio-group v-model="form_data.tts_type" v-show="form_data.tts_model_enable">
|
||||
<el-radio
|
||||
:label="$t('views.application.applicationForm.form.voicePlay.browser')"
|
||||
:label="$t('views.application.form.voicePlay.browser')"
|
||||
value="BROWSER"
|
||||
/>
|
||||
<el-radio
|
||||
:label="$t('views.application.applicationForm.form.voicePlay.tts')"
|
||||
:label="$t('views.application.form.voicePlay.tts')"
|
||||
value="TTS"
|
||||
/>
|
||||
</el-radio-group>
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
@wheel="wheel"
|
||||
v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable"
|
||||
v-model="form_data.tts_model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.voicePlay.placeholder')"
|
||||
:placeholder="$t('views.application.form.voicePlay.placeholder')"
|
||||
:options="ttsModelOptions"
|
||||
@change="ttsModelChange()"
|
||||
showFooter
|
||||
|
|
@ -206,7 +206,7 @@ const FileUploadSettingDialogRef = ref<InstanceType<typeof FileUploadSettingDial
|
|||
const form = {
|
||||
name: '',
|
||||
desc: '',
|
||||
prologue: t('views.application.applicationForm.form.defaultPrologue')
|
||||
prologue: t('views.application.form.defaultPrologue')
|
||||
}
|
||||
|
||||
const wheel = (e: any) => {
|
||||
|
|
@ -247,13 +247,13 @@ const validate = () => {
|
|||
) {
|
||||
return Promise.reject({
|
||||
node: props.nodeModel,
|
||||
errMessage: t('views.application.applicationForm.form.voicePlay.requiredMessage')
|
||||
errMessage: t('views.application.form.voicePlay.requiredMessage')
|
||||
})
|
||||
}
|
||||
if (form_data.value.stt_model_enable && !form_data.value.stt_model_id) {
|
||||
return Promise.reject({
|
||||
node: props.nodeModel,
|
||||
errMessage: t('views.application.applicationForm.form.voiceInput.requiredMessage')
|
||||
errMessage: t('views.application.form.voiceInput.requiredMessage')
|
||||
})
|
||||
}
|
||||
return baseNodeFormRef.value?.validate().catch((err) => {
|
||||
|
|
@ -297,7 +297,7 @@ function sttModelEnableChange() {
|
|||
const openTTSParamSettingDialog = () => {
|
||||
const model_id = form_data.value.tts_model_id
|
||||
if (!model_id) {
|
||||
MsgSuccess(t('views.application.applicationForm.form.voicePlay.requiredMessage'))
|
||||
MsgSuccess(t('views.application.form.voicePlay.requiredMessage'))
|
||||
return
|
||||
}
|
||||
TTSModeParamSettingDialogRef.value?.open(model_id, id, form_data.value.tts_model_params_setting)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
prop="prompt"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: $t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
prop="prompt"
|
||||
:rules="{
|
||||
required: false,
|
||||
message: $t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: $t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -55,21 +55,21 @@
|
|||
></ModelSelect>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.roleSettings.label')">
|
||||
<el-form-item :label="$t('views.application.form.roleSettings.label')">
|
||||
<MdEditorMagnify
|
||||
:title="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:title="$t('views.application.form.roleSettings.label')"
|
||||
v-model="form_data.system"
|
||||
style="height: 100px"
|
||||
@submitDialog="submitSystemDialog"
|
||||
:placeholder="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:placeholder="$t('views.application.form.roleSettings.label')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:label="$t('views.application.form.prompt.label')"
|
||||
prop="prompt"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.prompt.requiredMessage'),
|
||||
message: $t('views.application.form.prompt.requiredMessage'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
|
|
@ -77,13 +77,13 @@
|
|||
<div class="flex align-center">
|
||||
<div class="mr-4">
|
||||
<span
|
||||
>{{ $t('views.application.applicationForm.form.prompt.label')
|
||||
>{{ $t('views.application.form.prompt.label')
|
||||
}}<span class="danger">*</span></span
|
||||
>
|
||||
</div>
|
||||
<el-tooltip effect="dark" placement="right" popper-class="max-w-200">
|
||||
<template #content
|
||||
>{{ $t('views.application.applicationForm.form.prompt.tooltip') }}
|
||||
>{{ $t('views.application.form.prompt.tooltip') }}
|
||||
</template>
|
||||
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
||||
</el-tooltip>
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
</template>
|
||||
<MdEditorMagnify
|
||||
@wheel="wheel"
|
||||
:title="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:title="$t('views.application.form.prompt.label')"
|
||||
v-model="form_data.prompt"
|
||||
style="height: 150px"
|
||||
@submitDialog="submitDialog"
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
<el-form-item>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<div>{{ $t('views.application.applicationForm.form.historyRecord.label') }}</div>
|
||||
<div>{{ $t('views.application.form.historyRecord.label') }}</div>
|
||||
<el-select v-model="form_data.dialogue_type" type="small" style="width: 100px">
|
||||
<el-option :label="$t('views.applicationWorkflow.node')" value="NODE" />
|
||||
<el-option :label="$t('views.applicationWorkflow.workflow')" value="WORKFLOW" />
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
hide-required-asterisk
|
||||
>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.aiModel.label')"
|
||||
:label="$t('views.application.form.aiModel.label')"
|
||||
prop="model_id"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.aiModel.placeholder'),
|
||||
message: $t('views.application.form.aiModel.placeholder'),
|
||||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="flex-between">
|
||||
<div>
|
||||
<span
|
||||
>{{ $t('views.application.applicationForm.form.aiModel.label')
|
||||
>{{ $t('views.application.form.aiModel.label')
|
||||
}}<span class="danger">*</span></span
|
||||
>
|
||||
</div>
|
||||
|
|
@ -45,28 +45,28 @@
|
|||
@wheel="wheel"
|
||||
:teleported="false"
|
||||
v-model="form_data.model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.aiModel.placeholder')"
|
||||
:placeholder="$t('views.application.form.aiModel.placeholder')"
|
||||
:options="modelOptions"
|
||||
@submitModel="getModel"
|
||||
showFooter
|
||||
:model-type="'LLM'"
|
||||
></ModelSelect>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.roleSettings.label')">
|
||||
<el-form-item :label="$t('views.application.form.roleSettings.label')">
|
||||
<MdEditorMagnify
|
||||
:title="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:title="$t('views.application.form.roleSettings.label')"
|
||||
v-model="form_data.system"
|
||||
style="height: 100px"
|
||||
@submitDialog="submitSystemDialog"
|
||||
:placeholder="$t('views.application.applicationForm.form.roleSettings.label')"
|
||||
:placeholder="$t('views.application.form.roleSettings.label')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:label="$t('views.application.form.prompt.label')"
|
||||
prop="prompt"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.prompt.tooltip'),
|
||||
message: $t('views.application.form.prompt.tooltip'),
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
|
|
@ -74,13 +74,13 @@
|
|||
<div class="flex align-center">
|
||||
<div class="mr-4">
|
||||
<span
|
||||
>{{ $t('views.application.applicationForm.form.prompt.label')
|
||||
>{{ $t('views.application.form.prompt.label')
|
||||
}}<span class="danger">*</span></span
|
||||
>
|
||||
</div>
|
||||
<el-tooltip effect="dark" placement="right" popper-class="max-w-200">
|
||||
<template #content>{{
|
||||
$t('views.application.applicationForm.form.prompt.tooltip')
|
||||
$t('views.application.form.prompt.tooltip')
|
||||
}}</template>
|
||||
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
|
||||
<el-icon><EditPen /></el-icon>
|
||||
|
|
@ -89,13 +89,13 @@
|
|||
</template>
|
||||
<MdEditorMagnify
|
||||
@wheel="wheel"
|
||||
:title="$t('views.application.applicationForm.form.prompt.label')"
|
||||
:title="$t('views.application.form.prompt.label')"
|
||||
v-model="form_data.prompt"
|
||||
style="height: 150px"
|
||||
@submitDialog="submitDialog"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('views.application.applicationForm.form.historyRecord.label')">
|
||||
<el-form-item :label="$t('views.application.form.historyRecord.label')">
|
||||
<el-input-number
|
||||
v-model="form_data.dialogue_number"
|
||||
:min="0"
|
||||
|
|
|
|||
|
|
@ -21,20 +21,20 @@
|
|||
</template>
|
||||
<div class="w-full">
|
||||
<el-text type="info" v-if="form_data.dataset_id_list?.length === 0">
|
||||
{{ $t('views.application.applicationForm.form.relatedKnowledge.placeholder') }}
|
||||
{{ $t('views.application.form.relatedKnowledge.placeholder') }}
|
||||
</el-text>
|
||||
<template v-for="(item, index) in form_data.dataset_id_list" :key="index" v-else>
|
||||
<div class="flex-between border border-r-4 white-bg mb-4" style="padding: 5px 8px">
|
||||
<div class="flex align-center" style="line-height: 20px">
|
||||
<AppAvatar
|
||||
<el-avatar
|
||||
v-if="relatedObject(datasetList, item, 'id')?.type === '1'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
:size="20"
|
||||
>
|
||||
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar
|
||||
</el-avatar>
|
||||
<el-avatar
|
||||
v-else-if="relatedObject(datasetList, item, 'id')?.type === '2'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
|
|
@ -42,10 +42,10 @@
|
|||
style="background: none"
|
||||
>
|
||||
<img src="@/assets/knowledge/logo_lark.svg" style="width: 100%" alt="" />
|
||||
</AppAvatar>
|
||||
<AppAvatar v-else class="mr-8 avatar-blue" shape="square" :size="20">
|
||||
</el-avatar>
|
||||
<el-avatar v-else class="mr-8 avatar-blue" shape="square" :size="20">
|
||||
<img src="@/assets/knowledge/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</el-avatar>
|
||||
|
||||
<div class="ellipsis" :title="relatedObject(datasetList, item, 'id')?.name">
|
||||
{{ relatedObject(datasetList, item, 'id')?.name }}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
prop="stt_model_id"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.voiceInput.placeholder'),
|
||||
message: $t('views.application.form.voiceInput.placeholder'),
|
||||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
@wheel="wheel"
|
||||
:teleported="false"
|
||||
v-model="form_data.stt_model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.voiceInput.placeholder')"
|
||||
:placeholder="$t('views.application.form.voiceInput.placeholder')"
|
||||
:options="modelOptions"
|
||||
showFooter
|
||||
:model-type="'STT'"
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const showicon = ref(false)
|
|||
const globalFields = [
|
||||
{ label: t('views.applicationWorkflow.nodes.startNode.currentTime'), value: 'time' },
|
||||
{
|
||||
label: t('views.application.applicationForm.form.historyRecord.label'),
|
||||
label: t('views.application.form.historyRecord.label'),
|
||||
value: 'history_context'
|
||||
},
|
||||
{ label: t('chat.chatId'), value: 'chat_id' }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
prop="tts_model_id"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: $t('views.application.applicationForm.form.voicePlay.placeholder'),
|
||||
message: $t('views.application.form.voicePlay.placeholder'),
|
||||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
@wheel="wheel"
|
||||
:teleported="false"
|
||||
v-model="form_data.tts_model_id"
|
||||
:placeholder="$t('views.application.applicationForm.form.voicePlay.placeholder')"
|
||||
:placeholder="$t('views.application.form.voicePlay.placeholder')"
|
||||
:options="modelOptions"
|
||||
showFooter
|
||||
:model-type="'TTS'"
|
||||
|
|
@ -184,7 +184,7 @@ function getModel() {
|
|||
const openTTSParamSettingDialog = () => {
|
||||
const model_id = form_data.value.tts_model_id
|
||||
if (!model_id) {
|
||||
MsgSuccess(t('views.application.applicationForm.form.voicePlay.requiredMessage'))
|
||||
MsgSuccess(t('views.application.form.voicePlay.requiredMessage'))
|
||||
return
|
||||
}
|
||||
TTSModeParamSettingDialogRef.value?.open(model_id, id, form_data.value.model_params_setting)
|
||||
|
|
|
|||
Loading…
Reference in New Issue