wujingjing
2024-12-14 1476d27514874e9c95002451a81878bd9bec8382
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
    <div
        class="w-64 bg-white absolute p-4 rounded-md border-[1.5px] border-solid border-gray-300 z-10"
        :style="{ left: position.x + 'px', top: position.y + 'px' }"
    >
        <div class="flex justify-between">
            <h3 class="text-base">你的反馈将<br />帮助 WI 水务优化进步</h3>
            <i class="ywifont ywicon-guanbi right-0 top-0 !text-[20px] text-gray-500 cursor-pointer" @click="closeClick"></i>
        </div>
        <div class="mt-4 flex-col flex">
            <el-input v-model="content" resize="none" class="" type="textarea" :rows="3"></el-input>
            <el-button :disabled="!content" color="#1d86ff" class="m-auto mt-3" type="primary" @click="submitFeedback">提 交</el-button>
        </div>
    </div>
</template>
 
<script setup lang="ts">
import { ref, type PropType, nextTick } from 'vue';
import { reportHistoryProblem } from '/@/api/ai/chat';
import { ElMessage } from 'element-plus';
 
const props = defineProps({
    position: {
        type: Object as PropType<any>,
    },
    chatItem: {
        type: Object as PropType<any>,
    },
});
const isShow = defineModel('isShow', {
    type: Boolean,
});
const content = defineModel('content', {
    type: String,
});
const submitFeedback = async () => {
    const res = await reportHistoryProblem({
        history_id: props.chatItem.historyId,
        report_note: content.value,
    });
    ElMessage.success('感谢您的反馈');
    nextTick(() => {
        closeClick();
    });
};
 
const closeClick = () => {
    isShow.value = false;
    content.value = '';
};
</script>
<style scoped lang="scss"></style>