Conversation-chat-mind-tools.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <!-- <div class="mind-map-tools"> -->
  3. <a-tooltip :content="$t('conversation.zoom_in')" position="top" mini>
  4. <icon-plus class="icon" @click="zoomIn" />
  5. </a-tooltip>
  6. <a-tooltip :content="$t('conversation.zoom_out')" position="top" mini>
  7. <icon-minus class="icon" @click="zoomOut" />
  8. </a-tooltip>
  9. <a-tooltip :content="$t('conversation.fit')" position="top" mini>
  10. <icon-scan class="icon" @click="zoomReset" />
  11. </a-tooltip>
  12. <a-tooltip :content="$t('conversation.full_screen')" position="top" mini>
  13. <icon-fullscreen v-if="!props.isFullScreen" class="icon" @click="fullScreen" />
  14. <icon-fullscreen-exit v-else class="icon" @click="exitFullScreen" />
  15. </a-tooltip>
  16. <a-tooltip :content="$t('conversation.download')" position="top" mini>
  17. <icon-download class="icon" @click="download" />
  18. </a-tooltip>
  19. <!-- </div> -->
  20. </template>
  21. <script setup>
  22. const props = defineProps({
  23. isFullScreen: Boolean
  24. });
  25. const emit = defineEmits(['toZoomIn', 'toZoomOut', 'toZoomReset', 'toFullScreen', 'toDownload', 'toExitFullScreen']);
  26. const zoomIn = () => {
  27. emit('toZoomIn');
  28. };
  29. const zoomOut = () => {
  30. emit('toZoomOut');
  31. };
  32. const zoomReset = () => {
  33. emit('toZoomReset');
  34. };
  35. const fullScreen = () => {
  36. emit('toFullScreen');
  37. };
  38. const exitFullScreen = () => {
  39. emit('toExitFullScreen');
  40. };
  41. const download = () => {
  42. emit('toDownload');
  43. };
  44. </script>
  45. <style scoped>
  46. /* .mind-map-tools {
  47. display: flex;
  48. } */
  49. .icon {
  50. cursor: pointer;
  51. background-color: var(--color-fill-4);
  52. color: var(--color-bg-1);
  53. margin-right: 10px;
  54. padding: 5px;
  55. border-radius: 2px;
  56. }
  57. .icon:hover {
  58. background-color: var(--color-fill-3);
  59. color: var(--color-text-2);
  60. }
  61. </style>