|
|
@@ -5,8 +5,21 @@
|
|
|
<div class="dialog-main question-main">
|
|
|
<div class="dialog-content question-content">
|
|
|
<div class="question-main-content">
|
|
|
- <DialogContent :content="question.content" :show_think="false" class="question-content-core-text">
|
|
|
- </DialogContent>
|
|
|
+ <div class="question-main-content-top">
|
|
|
+ <DialogQuestionActions
|
|
|
+ class="question-action"
|
|
|
+ @copy="handleCopy"
|
|
|
+ @edit="handleEdit"
|
|
|
+ ></DialogQuestionActions>
|
|
|
+ <DialogContent :content="question.content" :show_think="false" class="question-content-core-text">
|
|
|
+ </DialogContent>
|
|
|
+ <ReEditQuestion
|
|
|
+ v-if="show_edit_modal"
|
|
|
+ :content="question.content"
|
|
|
+ @close="handleClose"
|
|
|
+ @send="handleSend"
|
|
|
+ ></ReEditQuestion>
|
|
|
+ </div>
|
|
|
|
|
|
<FileUploadPreviewV2
|
|
|
v-if="question_attached_files.length !== 0"
|
|
|
@@ -24,12 +37,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { computed } from 'vue';
|
|
|
+import { computed, ref } from 'vue';
|
|
|
+import { Message } from '../../3rd-libs/arco-vue-libs';
|
|
|
import BtnSelectItem from './BtnSelectItem.vue';
|
|
|
import DialogContent from '../conversation-content/DialogContent.vue';
|
|
|
+import DialogQuestionActions from './DialogQuestionActions.vue';
|
|
|
+import ReEditQuestion from './ReEditQuestion.vue';
|
|
|
|
|
|
import FileUploadPreviewV2 from '../file-preview/FileUploadPreviewV2.vue';
|
|
|
-
|
|
|
+import copyText from '../../3rd-libs/clipboard';
|
|
|
const props = defineProps({
|
|
|
show_select: true,
|
|
|
|
|
|
@@ -53,9 +69,29 @@ const question_attached_files = computed(() => {
|
|
|
|
|
|
const emit = defineEmits(['select']);
|
|
|
|
|
|
+const show_edit_modal = ref(false);
|
|
|
const handleSelectChange = () => {
|
|
|
emit('select');
|
|
|
};
|
|
|
+const handleCopy = () => {
|
|
|
+ copyText(props.question.content);
|
|
|
+ Message.success('已复制');
|
|
|
+};
|
|
|
+const handleEdit = () => {
|
|
|
+ show_edit_modal.value = true;
|
|
|
+};
|
|
|
+const handleClose = () => {
|
|
|
+ show_edit_modal.value = false;
|
|
|
+};
|
|
|
+const handleSend = (text) => {
|
|
|
+ console.log(props.question);
|
|
|
+ const question = {
|
|
|
+ ...props.question,
|
|
|
+ content: text
|
|
|
+ };
|
|
|
+ emit('send', question);
|
|
|
+ handleClose();
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style src="./dialog-item-common.css" />
|
|
|
@@ -92,4 +128,15 @@ const handleSelectChange = () => {
|
|
|
flex-direction: column;
|
|
|
align-items: flex-end;
|
|
|
}
|
|
|
+.question-main-content-top {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.question-main-content-top:hover .question-action {
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.question-action {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
</style>
|