Skip to content
Merged
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 @@ -68,6 +68,7 @@
</span>
</template>
<VoteReasonContent
v-if="props.data.record_id"
vote-type="0"
:chat-id="props.chatId"
:record-id="props.data.record_id"
Expand Down Expand Up @@ -104,6 +105,7 @@
</span>
</template>
<VoteReasonContent
v-if="props.data.record_id"
vote-type="1"
:chat-id="props.chatId"
:record-id="props.data.record_id"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,91 +1,94 @@
<template>
<div class="flex-between mt-8">
<div>
<el-text type="info">
<span class="ml-4">{{ datetimeFormat(data.create_time) }}</span>
</el-text>
</div>
<div>
<!-- 语音播放 -->
<span v-if="tts">
<el-tooltip
effect="dark"
:content="$t('chat.operation.play')"
placement="top"
v-if="!audioPlayerStatus"
>
<el-button text @click="playAnswerText(data?.answer_text)">
<AppIcon iconName="app-video-play"></AppIcon>
</el-button>
</el-tooltip>
<el-tooltip v-else effect="dark" :content="$t('chat.operation.pause')" placement="top">
<el-button type="primary" text @click="pausePlayAnswerText()">
<AppIcon iconName="app-video-pause"></AppIcon>
<div>
<div class="flex-between mt-8">
<div>
<el-text type="info">
<span class="ml-4">{{ datetimeFormat(data.create_time) }}</span>
</el-text>
</div>
<div>
<!-- 语音播放 -->
<span v-if="tts">
<el-tooltip
effect="dark"
:content="$t('chat.operation.play')"
placement="top"
v-if="!audioPlayerStatus"
>
<el-button text @click="playAnswerText(data?.answer_text)">
<AppIcon iconName="app-video-play"></AppIcon>
</el-button>
</el-tooltip>
<el-tooltip v-else effect="dark" :content="$t('chat.operation.pause')" placement="top">
<el-button type="primary" text @click="pausePlayAnswerText()">
<AppIcon iconName="app-video-pause"></AppIcon>
</el-button>
</el-tooltip>
<el-divider direction="vertical" />
</span>
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
<el-button text @click="copyClick(data?.answer_text)">
<AppIcon iconName="app-copy"></AppIcon>
</el-button>
</el-tooltip>
<el-divider direction="vertical" />
</span>
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
<el-button text @click="copyClick(data?.answer_text)">
<AppIcon iconName="app-copy"></AppIcon>
</el-button>
</el-tooltip>
<el-divider direction="vertical" />
<template v-if="permissionPrecise.chat_log_add_knowledge(id)">
<el-tooltip
v-if="buttonData.improve_paragraph_id_list.length === 0"
effect="dark"
:content="$t('views.chatLog.editContent')"
placement="top"
>
<el-button text @click="editContent(data)">
<AppIcon iconName="app-edit"></AppIcon>
</el-button>
</el-tooltip>
<template v-if="permissionPrecise.chat_log_add_knowledge(id)">
<el-tooltip
v-if="buttonData.improve_paragraph_id_list.length === 0"
effect="dark"
:content="$t('views.chatLog.editContent')"
placement="top"
>
<el-button text @click="editContent(data)">
<AppIcon iconName="app-edit"></AppIcon>
</el-button>
</el-tooltip>

<el-tooltip v-else effect="dark" :content="$t('views.chatLog.editMark')" placement="top">
<el-button text @click="editMark(data)">
<AppIcon iconName="app-document-active" class="primary"></AppIcon>
</el-button>
</el-tooltip>
</template>
<el-tooltip v-else effect="dark" :content="$t('views.chatLog.editMark')" placement="top">
<el-button text @click="editMark(data)">
<AppIcon iconName="app-document-active" class="primary"></AppIcon>
</el-button>
</el-tooltip>
</template>

<el-divider direction="vertical" v-if="buttonData?.vote_status !== '-1'" />
<el-button text disabled v-if="buttonData?.vote_status === '0'">
<AppIcon iconName="app-like-color"></AppIcon>
</el-button>
<el-divider direction="vertical" v-if="buttonData?.vote_status !== '-1'" />
<el-button text disabled v-if="buttonData?.vote_status === '0'">
<AppIcon iconName="app-like-color"></AppIcon>
</el-button>

<el-button text disabled v-if="buttonData?.vote_status === '1'">
<AppIcon iconName="app-oppose-color"></AppIcon>
</el-button>
<EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" />
<EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" />
<!-- 先渲染,不然不能播放 -->
<audio
ref="audioPlayer"
v-for="item in audioList"
:key="item"
controls
hidden="hidden"
></audio>
<el-button text disabled v-if="buttonData?.vote_status === '1'">
<AppIcon iconName="app-oppose-color"></AppIcon>
</el-button>
<EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" />
<EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" />
<!-- 先渲染,不然不能播放 -->
<audio
ref="audioPlayer"
v-for="item in audioList"
:key="item"
controls
hidden="hidden"
></audio>
</div>
</div>
</div>
<div>
<el-card
class="mt-16"
shadow="always"
v-if="buttonData?.vote_status !== '-1' && data.vote_reason"
>
<VoteReasonContent
:vote-type="buttonData?.vote_status"
:chat-id="buttonData?.chat_id"
:record-id="buttonData?.id"
readonly
:default-reason="data.vote_reason"
:default-other-content="data.vote_other_content"
<div>
<el-card
class="mt-16"
shadow="always"
v-if="buttonData?.vote_status !== '-1' && data.vote_reason"
>
</VoteReasonContent>
</el-card>
<VoteReasonContent
v-if="buttonData?.id"
:vote-type="buttonData?.vote_status"
:chat-id="buttonData?.chat_id"
:record-id="buttonData?.id"
readonly
:default-reason="data.vote_reason"
:default-other-content="data.vote_other_content"
>
</VoteReasonContent>
</el-card>
</div>
</div>
</template>
<script setup lang="ts">
Expand Down
13 changes: 11 additions & 2 deletions ui/src/components/ai-chat/component/question-content/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@
<el-button class="flex mr-8" text @click="cancelReQuestion"
><el-icon><Close /></el-icon
></el-button>
<el-button :disabled="!editText.trim()" text @click="sendReQuestionMessage(chatRecord)">
<el-button
:disabled="!editText.trim() || editText.trim() === chatRecord.problem_text.trim()"
text
@click="sendReQuestionMessage(chatRecord)"
>
<el-icon><Comment /></el-icon>
</el-button>
</el-button-group>
Expand Down Expand Up @@ -130,7 +134,12 @@
v-if="!isReQuestion"
>
<div class="text-right">
<el-tooltip effect="dark" :content="$t('common.edit')" placement="top" v-if="props.isLast">
<el-tooltip
effect="dark"
:content="$t('common.edit')"
placement="top"
v-if="props.isLast && props.type !== 'log'"
>
<el-button text @click="handleEdit(chatRecord)">
<AppIcon iconName="app-edit"></AppIcon>
</el-button>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ai-chat/component/user-form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ watch(
function handleInputFieldList() {
dynamicsFormRefresh.value++
const default_value: any = {}
props.application.work_flow?.nodes
props.application?.work_flow?.nodes
?.filter((v: any) => v.id === 'base-node')
.map((v: any) => {
inputFieldList.value = v.properties.user_input_field_list
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const initialApiFormData = ref({})

const isUserInput = computed(
() =>
props.applicationDetails.work_flow?.nodes?.filter((v: any) => v.id === 'base-node')[0]
props.applicationDetails?.work_flow?.nodes?.filter((v: any) => v.id === 'base-node')[0]
?.properties.user_input_field_list.length > 0,
)

Expand Down
1 change: 0 additions & 1 deletion ui/src/stores/modules/chat-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const useChatUserStore = defineStore('chat-user', {
},
applicationProfile() {
return ChatAPI.applicationProfile().then((ok) => {
console.log('applicationProfile', ok.data)
this.application = ok.data
localStorage.setItem(`${this.accessToken}-locale`, ok.data?.language || this.getLanguage())
})
Expand Down
Loading