tools.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <script setup lang="ts">
  2. import { ref } from 'vue'
  3. import { options } from '@/entrypoints/sidepanel/mock'
  4. import { Reading, Upload, Paperclip, Scissor, AlarmClock, CirclePlus } from '@element-plus/icons-vue'
  5. const value = ref(options[0].value)
  6. const emit = defineEmits(['readClick', 'uploadFile', 'handleCapture', 'addNewDialogue', 'hisRecords'])
  7. </script>
  8. <template>
  9. <div class="px-3 py-2 flex justify-between items-center">
  10. <div class="flex items-center">
  11. <el-select v-model="value" placeholder="Select" style="width: 120px">
  12. <el-option-group v-for="group in options" :key="group.label" :label="group.label">
  13. <el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value" />
  14. </el-option-group>
  15. </el-select>
  16. <span class="mr-2"></span>
  17. <el-tooltip effect="dark" content="阅读此页,开启后将会根据左侧网页中的内容做出回答" placement="top">
  18. <el-button style="font-size:18px" link :icon="Reading" circle @click="emit('readClick')" />
  19. </el-tooltip>
  20. <span class="mr-2"></span>
  21. <el-upload style="display:inline-block" :before-upload="(file: any) => emit('uploadFile', file)" :multiple="false"
  22. name="file" :show-file-list="false" :accept="'.xlsx,.pdf,.doc,.docx'">
  23. <el-tooltip effect="dark" content="文件上传" placement="top">
  24. <el-button style="font-size:18px" link :icon="Paperclip" circle />
  25. </el-tooltip>
  26. </el-upload>
  27. <span class="mr-2"></span>
  28. <el-tooltip effect="dark" content="截屏" placement="top">
  29. <el-button style="font-size:14px" :icon="Scissor" circle @click="emit('handleCapture')" />
  30. </el-tooltip>
  31. </div>
  32. <div class="flex items-center">
  33. <el-tooltip effect="dark" content="历史记录" placement="top">
  34. <el-button style="font-size:18px" link :icon="AlarmClock" circle @click="emit('hisRecords')" />
  35. </el-tooltip>
  36. <span class="mr-2"></span>
  37. <el-tooltip effect="dark" content="新对话" placement="top">
  38. <el-button style="font-size:18px" link :icon="CirclePlus" circle @click="emit('addNewDialogue')" />
  39. </el-tooltip>
  40. </div>
  41. </div>
  42. </template>
  43. <style lang="scss" scoped>
  44. </style>