|
1 | 1 | <template> |
2 | | - <div class="flex-between mt-8"> |
3 | | - <div> |
4 | | - <el-text type="info"> |
5 | | - <span class="ml-4">{{ datetimeFormat(data.create_time) }}</span> |
6 | | - </el-text> |
7 | | - </div> |
8 | | - <div> |
9 | | - <!-- 语音播放 --> |
10 | | - <span v-if="tts"> |
11 | | - <el-tooltip |
12 | | - effect="dark" |
13 | | - :content="$t('chat.operation.play')" |
14 | | - placement="top" |
15 | | - v-if="!audioPlayerStatus" |
16 | | - > |
17 | | - <el-button text @click="playAnswerText(data?.answer_text)"> |
18 | | - <AppIcon iconName="app-video-play"></AppIcon> |
19 | | - </el-button> |
20 | | - </el-tooltip> |
21 | | - <el-tooltip v-else effect="dark" :content="$t('chat.operation.pause')" placement="top"> |
22 | | - <el-button type="primary" text @click="pausePlayAnswerText()"> |
23 | | - <AppIcon iconName="app-video-pause"></AppIcon> |
| 2 | + <div> |
| 3 | + <div class="flex-between mt-8"> |
| 4 | + <div> |
| 5 | + <el-text type="info"> |
| 6 | + <span class="ml-4">{{ datetimeFormat(data.create_time) }}</span> |
| 7 | + </el-text> |
| 8 | + </div> |
| 9 | + <div> |
| 10 | + <!-- 语音播放 --> |
| 11 | + <span v-if="tts"> |
| 12 | + <el-tooltip |
| 13 | + effect="dark" |
| 14 | + :content="$t('chat.operation.play')" |
| 15 | + placement="top" |
| 16 | + v-if="!audioPlayerStatus" |
| 17 | + > |
| 18 | + <el-button text @click="playAnswerText(data?.answer_text)"> |
| 19 | + <AppIcon iconName="app-video-play"></AppIcon> |
| 20 | + </el-button> |
| 21 | + </el-tooltip> |
| 22 | + <el-tooltip v-else effect="dark" :content="$t('chat.operation.pause')" placement="top"> |
| 23 | + <el-button type="primary" text @click="pausePlayAnswerText()"> |
| 24 | + <AppIcon iconName="app-video-pause"></AppIcon> |
| 25 | + </el-button> |
| 26 | + </el-tooltip> |
| 27 | + <el-divider direction="vertical" /> |
| 28 | + </span> |
| 29 | + <el-tooltip effect="dark" :content="$t('common.copy')" placement="top"> |
| 30 | + <el-button text @click="copyClick(data?.answer_text)"> |
| 31 | + <AppIcon iconName="app-copy"></AppIcon> |
24 | 32 | </el-button> |
25 | 33 | </el-tooltip> |
26 | 34 | <el-divider direction="vertical" /> |
27 | | - </span> |
28 | | - <el-tooltip effect="dark" :content="$t('common.copy')" placement="top"> |
29 | | - <el-button text @click="copyClick(data?.answer_text)"> |
30 | | - <AppIcon iconName="app-copy"></AppIcon> |
31 | | - </el-button> |
32 | | - </el-tooltip> |
33 | | - <el-divider direction="vertical" /> |
34 | | - <template v-if="permissionPrecise.chat_log_add_knowledge(id)"> |
35 | | - <el-tooltip |
36 | | - v-if="buttonData.improve_paragraph_id_list.length === 0" |
37 | | - effect="dark" |
38 | | - :content="$t('views.chatLog.editContent')" |
39 | | - placement="top" |
40 | | - > |
41 | | - <el-button text @click="editContent(data)"> |
42 | | - <AppIcon iconName="app-edit"></AppIcon> |
43 | | - </el-button> |
44 | | - </el-tooltip> |
| 35 | + <template v-if="permissionPrecise.chat_log_add_knowledge(id)"> |
| 36 | + <el-tooltip |
| 37 | + v-if="buttonData.improve_paragraph_id_list.length === 0" |
| 38 | + effect="dark" |
| 39 | + :content="$t('views.chatLog.editContent')" |
| 40 | + placement="top" |
| 41 | + > |
| 42 | + <el-button text @click="editContent(data)"> |
| 43 | + <AppIcon iconName="app-edit"></AppIcon> |
| 44 | + </el-button> |
| 45 | + </el-tooltip> |
45 | 46 |
|
46 | | - <el-tooltip v-else effect="dark" :content="$t('views.chatLog.editMark')" placement="top"> |
47 | | - <el-button text @click="editMark(data)"> |
48 | | - <AppIcon iconName="app-document-active" class="primary"></AppIcon> |
49 | | - </el-button> |
50 | | - </el-tooltip> |
51 | | - </template> |
| 47 | + <el-tooltip v-else effect="dark" :content="$t('views.chatLog.editMark')" placement="top"> |
| 48 | + <el-button text @click="editMark(data)"> |
| 49 | + <AppIcon iconName="app-document-active" class="primary"></AppIcon> |
| 50 | + </el-button> |
| 51 | + </el-tooltip> |
| 52 | + </template> |
52 | 53 |
|
53 | | - <el-divider direction="vertical" v-if="buttonData?.vote_status !== '-1'" /> |
54 | | - <el-button text disabled v-if="buttonData?.vote_status === '0'"> |
55 | | - <AppIcon iconName="app-like-color"></AppIcon> |
56 | | - </el-button> |
| 54 | + <el-divider direction="vertical" v-if="buttonData?.vote_status !== '-1'" /> |
| 55 | + <el-button text disabled v-if="buttonData?.vote_status === '0'"> |
| 56 | + <AppIcon iconName="app-like-color"></AppIcon> |
| 57 | + </el-button> |
57 | 58 |
|
58 | | - <el-button text disabled v-if="buttonData?.vote_status === '1'"> |
59 | | - <AppIcon iconName="app-oppose-color"></AppIcon> |
60 | | - </el-button> |
61 | | - <EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" /> |
62 | | - <EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" /> |
63 | | - <!-- 先渲染,不然不能播放 --> |
64 | | - <audio |
65 | | - ref="audioPlayer" |
66 | | - v-for="item in audioList" |
67 | | - :key="item" |
68 | | - controls |
69 | | - hidden="hidden" |
70 | | - ></audio> |
| 59 | + <el-button text disabled v-if="buttonData?.vote_status === '1'"> |
| 60 | + <AppIcon iconName="app-oppose-color"></AppIcon> |
| 61 | + </el-button> |
| 62 | + <EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" /> |
| 63 | + <EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" /> |
| 64 | + <!-- 先渲染,不然不能播放 --> |
| 65 | + <audio |
| 66 | + ref="audioPlayer" |
| 67 | + v-for="item in audioList" |
| 68 | + :key="item" |
| 69 | + controls |
| 70 | + hidden="hidden" |
| 71 | + ></audio> |
| 72 | + </div> |
71 | 73 | </div> |
72 | | - </div> |
73 | | - <div> |
74 | | - <el-card |
75 | | - class="mt-16" |
76 | | - shadow="always" |
77 | | - v-if="buttonData?.vote_status !== '-1' && data.vote_reason" |
78 | | - > |
79 | | - <VoteReasonContent |
80 | | - :vote-type="buttonData?.vote_status" |
81 | | - :chat-id="buttonData?.chat_id" |
82 | | - :record-id="buttonData?.id" |
83 | | - readonly |
84 | | - :default-reason="data.vote_reason" |
85 | | - :default-other-content="data.vote_other_content" |
| 74 | + <div> |
| 75 | + <el-card |
| 76 | + class="mt-16" |
| 77 | + shadow="always" |
| 78 | + v-if="buttonData?.vote_status !== '-1' && data.vote_reason" |
86 | 79 | > |
87 | | - </VoteReasonContent> |
88 | | - </el-card> |
| 80 | + <VoteReasonContent |
| 81 | + v-if="buttonData?.id" |
| 82 | + :vote-type="buttonData?.vote_status" |
| 83 | + :chat-id="buttonData?.chat_id" |
| 84 | + :record-id="buttonData?.id" |
| 85 | + readonly |
| 86 | + :default-reason="data.vote_reason" |
| 87 | + :default-other-content="data.vote_other_content" |
| 88 | + > |
| 89 | + </VoteReasonContent> |
| 90 | + </el-card> |
| 91 | + </div> |
89 | 92 | </div> |
90 | 93 | </template> |
91 | 94 | <script setup lang="ts"> |
|
0 commit comments