<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>
|