DataSourceManage.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <a-dropdown position="top" class="my_custom_drop">
  3. <a-button class="btn" @click="toOpenDataSource">
  4. <img :src="icon_table" alt="" />
  5. <span>数据源管理</span>
  6. <icon-down />
  7. </a-button>
  8. </a-dropdown>
  9. </template>
  10. <script setup>
  11. import { ref, onMounted, computed } from 'vue';
  12. import icon_file_a from '../../../assets/chat-report/drafy_icon_1.svg';
  13. import icon_file_b from '../../../assets/chat-report/drafy_icon_2.svg';
  14. import icon_file_c from '../../../assets/chat-report/drafy_icon_3.svg';
  15. import { useThemeStore } from '../../../base/store/use-theme';
  16. import { THEME_LIGHT, THEME_DARK, THEME_GREEN, THEME_PARTY } from '../../../base/variables';
  17. const themeStore = useThemeStore();
  18. const emit = defineEmits(['open_data_source']);
  19. const icon_table = computed(() => {
  20. if (themeStore.value == THEME_GREEN) {
  21. return icon_file_a;
  22. } else if (themeStore.value == THEME_PARTY) {
  23. return icon_file_b;
  24. } else if (themeStore.value == THEME_LIGHT) {
  25. return icon_file_c;
  26. } else {
  27. return icon_file_a;
  28. }
  29. });
  30. const toOpenDataSource = () => {
  31. // console.log('toTemplateManage');
  32. emit('open_data_source');
  33. };
  34. onMounted(() => {});
  35. </script>
  36. <style scoped lang="css">
  37. .icon {
  38. cursor: pointer;
  39. width: 24px;
  40. }
  41. .btn {
  42. background: var(--bg-title);
  43. border-radius: 20px;
  44. font-weight: 500;
  45. font-size: 14px;
  46. color: var(--primary-default);
  47. display: flex;
  48. align-items: center;
  49. gap: 5px;
  50. }
  51. .btn:hover {
  52. background: var(--bg-title);
  53. color: var(--primary-default);
  54. opacity: 0.8;
  55. }
  56. .dopt-item {
  57. padding: 0px 20px;
  58. }
  59. .arco-dropdown-open .arco-icon-down {
  60. transform: rotate(180deg);
  61. }
  62. .dop {
  63. width: 160px;
  64. display: flex;
  65. justify-content: space-between;
  66. padding: 5px;
  67. border-bottom: 1px solid #e5e5e5;
  68. }
  69. .dop .dop-item {
  70. display: flex;
  71. flex-direction: column;
  72. }
  73. .dop-item .item-title {
  74. font-family: 思源黑体;
  75. font-weight: 600;
  76. line-height: normal;
  77. letter-spacing: 0px;
  78. color: #2c2c2c;
  79. }
  80. .dop-item .item-desc {
  81. font-family: 思源黑体;
  82. font-size: 12px;
  83. font-weight: normal;
  84. line-height: normal;
  85. letter-spacing: 0px;
  86. color: #687272;
  87. }
  88. .dop-item-selected {
  89. display: flex;
  90. align-items: center;
  91. justify-content: center;
  92. }
  93. .dop-item-selected img {
  94. width: 16px;
  95. }
  96. .dop-bottom {
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. gap: 5px;
  101. cursor: pointer;
  102. padding: 15px 0px 5px 0px;
  103. }
  104. .dop-bottom .icon {
  105. width: 16px;
  106. }
  107. </style>
  108. <style>
  109. .my_custom_drop .arco-dropdown {
  110. padding: 10px 0;
  111. border-radius: 12px;
  112. }
  113. </style>