DetailDialog.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div>
  3. <el-dialog
  4. v-model="visible"
  5. title="问题详情"
  6. width="80%"
  7. align-center
  8. :close-on-click-modal="false"
  9. @close="handleClose"
  10. >
  11. <div class="description-box">
  12. <div class="title">问题描述</div>
  13. <p>{{ detailDescription }}</p>
  14. </div>
  15. <div>
  16. <div class="title">问题图片/视频</div>
  17. <SwiperThumbsGallery v-if="updateSwiper" />
  18. </div>
  19. <template #footer>
  20. <div class="dialog-footer">
  21. <span class="footer-tip">提示:可切换查看问题列表当前分页内数据</span>
  22. <el-button @click="handlePrevious" :disabled="!hasPreviousRow">上一个</el-button>
  23. <el-button type="primary" @click="handleNext" :disabled="!hasNextRow">下一个</el-button>
  24. <el-checkbox
  25. class="footer-checkbox"
  26. v-model="curHasBeenChosen"
  27. label="是否选中"
  28. @change="handleChooseStatus"
  29. />
  30. </div>
  31. </template>
  32. </el-dialog>
  33. </div>
  34. </template>
  35. <script setup lang="ts">
  36. import { computed, nextTick, ref } from 'vue';
  37. import { storeToRefs } from 'pinia';
  38. import { useCurImgVideoUrlStore } from '../../store/useCurImgVideoUrl';
  39. import SwiperThumbsGallery from './SwiperThumbsGallery.vue';
  40. const curImgVideoUrl = useCurImgVideoUrlStore();
  41. const { detailRowChosen, hasPreviousRow, hasNextRow, detailDescription } = storeToRefs(curImgVideoUrl);
  42. const emits = defineEmits(['close', 'update:previous', 'update:next', 'update:choose']);
  43. const visible = ref(true);
  44. const updateSwiper = ref(true);
  45. const curHasBeenChosen = computed(() => {
  46. return detailRowChosen.value;
  47. });
  48. const handleClose = () => {
  49. emits('close');
  50. };
  51. const handlePrevious = () => {
  52. emits('update:previous');
  53. };
  54. const handleNext = () => {
  55. emits('update:next');
  56. updateSwiper.value = false;
  57. nextTick(() => {
  58. updateSwiper.value = true;
  59. });
  60. };
  61. const handleChooseStatus = () => {
  62. emits('update:choose', curHasBeenChosen.value);
  63. updateSwiper.value = false;
  64. nextTick(() => {
  65. updateSwiper.value = true;
  66. });
  67. };
  68. </script>
  69. <style scoped lang="less">
  70. :deep(.el-dialog) {
  71. padding: 0;
  72. background: #ffffff;
  73. box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08),
  74. 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
  75. .el-dialog__header {
  76. display: flex;
  77. align-items: center;
  78. height: 56px;
  79. padding-left: 24px;
  80. padding-bottom: 0;
  81. border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  82. }
  83. .el-dialog__title {
  84. color: rgba(0, 0, 0, 0.88);
  85. font-size: 16px;
  86. font-weight: 500;
  87. }
  88. .el-dialog__headerbtn .el-dialog__close {
  89. color: #000;
  90. }
  91. .el-dialog__body {
  92. height: 690px;
  93. padding: 20px 40px 0 40px;
  94. overflow: auto;
  95. }
  96. .el-dialog__footer {
  97. height: 92px;
  98. padding: 28px 48px;
  99. .footer-tip {
  100. margin-right: 40px;
  101. color: rgba(0, 0, 0, 0.3);
  102. }
  103. .footer-checkbox {
  104. margin-left: 40px;
  105. }
  106. }
  107. }
  108. .title {
  109. margin-bottom: 20px;
  110. color: #303133;
  111. font-size: 16px;
  112. font-weight: 500;
  113. }
  114. .title:before {
  115. margin-right: 8px;
  116. content: '';
  117. border-left: 3px solid #1777ff;
  118. }
  119. .description-box {
  120. margin-bottom: 20px;
  121. p {
  122. color: #606266;
  123. }
  124. }
  125. </style>