SsPanel.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <script setup lang="ts">
  2. import { Loading, Refresh } from '@element-plus/icons-vue'
  3. import {onMounted} from "vue";
  4. const props = defineProps({
  5. title: {
  6. type: String,
  7. default: ''
  8. },
  9. showRefresh: {
  10. type: Boolean,
  11. default: false
  12. },
  13. isRefresh: {
  14. type: Boolean,
  15. default: false
  16. }
  17. });
  18. const emit = defineEmits(['refresh', 'loaded']);
  19. const refresh = () => {
  20. emit('refresh');
  21. }
  22. onMounted(() => {
  23. emit('loaded', 'panel');
  24. })
  25. </script>
  26. <template>
  27. <div class="panel">
  28. <div class="panel-header is-pc">
  29. <div class="title">{{title}}</div>
  30. <el-button v-if="showRefresh" class="refresh hover-scale" :icon="Refresh" :loading="isRefresh" @click="refresh">
  31. 换一换
  32. </el-button>
  33. </div>
  34. <div class="panel-body">
  35. <slot></slot>
  36. </div>
  37. </div>
  38. </template>
  39. <style scoped lang="scss">
  40. .panel {
  41. .panel-header {
  42. display: flex;
  43. justify-content: space-between;
  44. align-items: center;
  45. margin-bottom: 0.75rem;
  46. .title {
  47. color: #101333;
  48. font-size: var(--body-font-size);
  49. font-weight: 600;
  50. }
  51. .refresh {
  52. padding: 0;
  53. font-size: var(--subtitle-font-size);
  54. color: #2943D6;
  55. background-color: transparent;
  56. border: 0;
  57. display: flex;
  58. align-items: center;
  59. height: unset;
  60. min-height: var(--min-touch-target);
  61. .el-icon {
  62. font-size: 1rem;
  63. margin-right: 0.1rem;
  64. }
  65. }
  66. }
  67. }
  68. /* 1080x1920 中等尺寸设备 */
  69. @media screen and (min-width: 751px) and (max-width: 1200px) and (min-height: 1700px) {
  70. .panel {
  71. .panel-header {
  72. margin-bottom: 1rem;
  73. .title {
  74. font-size: 1.5rem; /* 1.25rem → 1.5rem */
  75. }
  76. .refresh {
  77. font-size: 1.125rem; /* 1rem → 1.125rem */
  78. .el-icon {
  79. font-size: 1.375rem; /* 1.25rem → 1.375rem */
  80. }
  81. }
  82. }
  83. }
  84. }
  85. </style>