<template>
  <!-- ChatGPT 悬浮按钮 -->
  <div class="chat-float-btn" @click="showChat = true" v-if="!showChat">
    <el-icon><ChatRound /></el-icon>
  </div>

  <!-- ChatGPT 对话框 -->
  <el-drawer
    v-model="showChat"
    direction="rtl"
    size="60%"
    :with-header="false"
    class="chat-drawer"
  >
    <chatgpt :menu="false"/>
  </el-drawer>
</template>

<script>
import { ChatRound } from '@element-plus/icons-vue'
import chatgpt from '@/page/list/chatgpt.vue'

export default {
  name: 'ChatGPTButton',
  components: {
    ChatRound,
    chatgpt
  },
  data() {
    return {
      showChat: false
    }
  }
} 
</script>

<style lang="scss">
.chat-float-btn {
  position: fixed;
  right: 20px;
  bottom: 60px;
  width: 50px;
  height: 50px;
  background: #2681ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
  z-index: 2000;

  &:hover {
    transform: scale(1.1);
  }

  .el-icon {
    font-size: 24px;
    color: #fff;
  }
}

.chat-drawer {
  .el-drawer__body {
    padding: 0;
    height: 100%;
  }
}
</style> 