88 <div >
99 <!-- 语音播放 -->
1010 <span v-if =" tts" >
11- <el-tooltip
12- effect =" dark"
13- :content =" $t('chat.operation.play')"
14- placement =" top"
15- v-if =" !audioPlayerStatus"
16- >
11+ <el-tooltip effect =" dark" :content =" $t('chat.operation.play')" placement =" top" v-if =" !audioPlayerStatus" >
1712 <el-button text @click =" playAnswerText(data?.answer_text)" >
1813 <AppIcon iconName =" app-video-play" ></AppIcon >
1914 </el-button >
3126 </el-button >
3227 </el-tooltip >
3328 <el-divider direction =" vertical" />
34- <el-tooltip
35- v-if =" buttonData.improve_paragraph_id_list.length === 0"
36- effect =" dark"
37- :content =" $t('views.chatLog.editContent')"
38- placement =" top"
39- >
40- <el-button text @click =" editContent(data)" >
41- <AppIcon iconName =" app-edit" ></AppIcon >
42- </el-button >
43- </el-tooltip >
29+ <template v-if =" permissionPrecise .chat_log_add_knowledge (id )" >
30+ <el-tooltip v-if =" buttonData.improve_paragraph_id_list.length === 0" effect =" dark"
31+ :content =" $t('views.chatLog.editContent')" placement =" top" >
32+ <el-button text @click =" editContent(data)" >
33+ <AppIcon iconName =" app-edit" ></AppIcon >
34+ </el-button >
35+ </el-tooltip >
4436
45- <el-tooltip v-else effect =" dark" :content =" $t('views.chatLog.editMark')" placement =" top" >
46- <el-button text @click =" editMark(data)" >
47- <AppIcon iconName =" app-document-active" class =" primary" ></AppIcon >
48- </el-button >
49- </el-tooltip >
37+ <el-tooltip v-else effect =" dark" :content =" $t('views.chatLog.editMark')" placement =" top" >
38+ <el-button text @click =" editMark(data)" >
39+ <AppIcon iconName =" app-document-active" class =" primary" ></AppIcon >
40+ </el-button >
41+ </el-tooltip >
42+ </template >
5043
5144 <el-divider direction =" vertical" v-if =" buttonData?.vote_status !== '-1'" />
5245 <el-button text disabled v-if =" buttonData?.vote_status === '0'" >
5952 <EditContentDialog ref =" EditContentDialogRef" @refresh =" refreshContent" />
6053 <EditMarkDialog ref =" EditMarkDialogRef" @refresh =" refreshMark" />
6154 <!-- 先渲染,不然不能播放 -->
62- <audio
63- ref =" audioPlayer"
64- v-for =" item in audioList"
65- :key =" item"
66- controls
67- hidden =" hidden"
68- ></audio >
55+ <audio ref =" audioPlayer" v-for =" item in audioList" :key =" item" controls hidden =" hidden" ></audio >
6956 </div >
7057 </div >
7158</template >
7259<script setup lang="ts">
73- import { onMounted , ref } from ' vue'
60+ import { computed , onMounted , ref } from ' vue'
7461import { copyClick } from ' @/utils/clipboard'
7562import EditContentDialog from ' @/views/chat-log/component/EditContentDialog.vue'
7663import EditMarkDialog from ' @/views/chat-log/component/EditMarkDialog.vue'
7764import { datetimeFormat } from ' @/utils/time'
7865import applicationApi from ' @/api/application/application'
7966import { useRoute } from ' vue-router'
67+ import permissionMap from ' @/permission'
8068import { MsgError } from ' @/utils/message'
8169import { t } from ' @/locales'
8270const route = useRoute ()
8371const {
8472 params : { id },
8573} = route as any
8674
75+
8776const props = defineProps ({
8877 data: {
8978 type: Object ,
90- default : () => {},
79+ default : () => { },
9180 },
9281 applicationId: {
9382 type: String ,
@@ -97,6 +86,17 @@ const props = defineProps({
9786 tts_type: String ,
9887})
9988
89+ const apiType = computed (() => {
90+ if (route .path .includes (' resource-management' )) {
91+ return ' systemManage'
92+ } else {
93+ return ' workspace'
94+ }
95+ })
96+ const permissionPrecise = computed (() => {
97+ return permissionMap [' application' ][apiType .value ]
98+ })
99+
100100const emit = defineEmits ([' update:data' ])
101101
102102const audioPlayer = ref <HTMLAudioElement [] | null >(null )
0 commit comments