fix: Chat log add knowledge
parent
59efb68bb5
commit
a8e8a0580f
|
|
@ -8,12 +8,7 @@
|
||||||
<div>
|
<div>
|
||||||
<!-- 语音播放 -->
|
<!-- 语音播放 -->
|
||||||
<span v-if="tts">
|
<span v-if="tts">
|
||||||
<el-tooltip
|
<el-tooltip effect="dark" :content="$t('chat.operation.play')" placement="top" v-if="!audioPlayerStatus">
|
||||||
effect="dark"
|
|
||||||
:content="$t('chat.operation.play')"
|
|
||||||
placement="top"
|
|
||||||
v-if="!audioPlayerStatus"
|
|
||||||
>
|
|
||||||
<el-button text @click="playAnswerText(data?.answer_text)">
|
<el-button text @click="playAnswerText(data?.answer_text)">
|
||||||
<AppIcon iconName="app-video-play"></AppIcon>
|
<AppIcon iconName="app-video-play"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -31,22 +26,20 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-tooltip
|
<template v-if="permissionPrecise.chat_log_add_knowledge(id)">
|
||||||
v-if="buttonData.improve_paragraph_id_list.length === 0"
|
<el-tooltip v-if="buttonData.improve_paragraph_id_list.length === 0" effect="dark"
|
||||||
effect="dark"
|
:content="$t('views.chatLog.editContent')" placement="top">
|
||||||
:content="$t('views.chatLog.editContent')"
|
<el-button text @click="editContent(data)">
|
||||||
placement="top"
|
<AppIcon iconName="app-edit"></AppIcon>
|
||||||
>
|
</el-button>
|
||||||
<el-button text @click="editContent(data)">
|
</el-tooltip>
|
||||||
<AppIcon iconName="app-edit"></AppIcon>
|
|
||||||
</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
|
|
||||||
<el-tooltip v-else effect="dark" :content="$t('views.chatLog.editMark')" placement="top">
|
<el-tooltip v-else effect="dark" :content="$t('views.chatLog.editMark')" placement="top">
|
||||||
<el-button text @click="editMark(data)">
|
<el-button text @click="editMark(data)">
|
||||||
<AppIcon iconName="app-document-active" class="primary"></AppIcon>
|
<AppIcon iconName="app-document-active" class="primary"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
<el-divider direction="vertical" v-if="buttonData?.vote_status !== '-1'" />
|
<el-divider direction="vertical" v-if="buttonData?.vote_status !== '-1'" />
|
||||||
<el-button text disabled v-if="buttonData?.vote_status === '0'">
|
<el-button text disabled v-if="buttonData?.vote_status === '0'">
|
||||||
|
|
@ -59,24 +52,19 @@
|
||||||
<EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" />
|
<EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" />
|
||||||
<EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" />
|
<EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" />
|
||||||
<!-- 先渲染,不然不能播放 -->
|
<!-- 先渲染,不然不能播放 -->
|
||||||
<audio
|
<audio ref="audioPlayer" v-for="item in audioList" :key="item" controls hidden="hidden"></audio>
|
||||||
ref="audioPlayer"
|
|
||||||
v-for="item in audioList"
|
|
||||||
:key="item"
|
|
||||||
controls
|
|
||||||
hidden="hidden"
|
|
||||||
></audio>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { copyClick } from '@/utils/clipboard'
|
import { copyClick } from '@/utils/clipboard'
|
||||||
import EditContentDialog from '@/views/chat-log/component/EditContentDialog.vue'
|
import EditContentDialog from '@/views/chat-log/component/EditContentDialog.vue'
|
||||||
import EditMarkDialog from '@/views/chat-log/component/EditMarkDialog.vue'
|
import EditMarkDialog from '@/views/chat-log/component/EditMarkDialog.vue'
|
||||||
import { datetimeFormat } from '@/utils/time'
|
import { datetimeFormat } from '@/utils/time'
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
import permissionMap from '@/permission'
|
||||||
import { MsgError } from '@/utils/message'
|
import { MsgError } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
@ -84,10 +72,11 @@ const {
|
||||||
params: { id },
|
params: { id },
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => { },
|
||||||
},
|
},
|
||||||
applicationId: {
|
applicationId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -97,6 +86,17 @@ const props = defineProps({
|
||||||
tts_type: String,
|
tts_type: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const apiType = computed(() => {
|
||||||
|
if (route.path.includes('resource-management')) {
|
||||||
|
return 'systemManage'
|
||||||
|
} else {
|
||||||
|
return 'workspace'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const permissionPrecise = computed(() => {
|
||||||
|
return permissionMap['application'][apiType.value]
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:data'])
|
const emit = defineEmits(['update:data'])
|
||||||
|
|
||||||
const audioPlayer = ref<HTMLAudioElement[] | null>(null)
|
const audioPlayer = ref<HTMLAudioElement[] | null>(null)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue