|
|
@@ -10,43 +10,17 @@
|
|
|
>
|
|
|
<div class="description-box">
|
|
|
<div class="title">问题描述</div>
|
|
|
- <p>{{ description }}</p>
|
|
|
+ <p>{{ detailDescription }}</p>
|
|
|
</div>
|
|
|
<div>
|
|
|
<div class="title">问题图片/视频</div>
|
|
|
- <div class="media-box">
|
|
|
- <div class="video-box" v-if="videoPaths && videoPaths.length != 0">
|
|
|
- <img
|
|
|
- src="@/assets/images/alert/video-play.png"
|
|
|
- @click="handleOpenVideo"
|
|
|
- style="
|
|
|
- object-fit: contain;
|
|
|
- width: 200px;
|
|
|
- height: 200px;
|
|
|
- border: solid 1px #ccc;
|
|
|
- cursor: pointer;
|
|
|
- "
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="img-box" v-for="(imagePath, index) in imagePaths" :key="index">
|
|
|
- <el-image
|
|
|
- style="width: 200px; height: 200px; border: solid 1px #ccc"
|
|
|
- :src="imagePath"
|
|
|
- :preview-src-list="imagePaths"
|
|
|
- :zoom-rate="1.2"
|
|
|
- :max-scale="7"
|
|
|
- :min-scale="0.2"
|
|
|
- :initial-index="index"
|
|
|
- fit="cover"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <SwiperThumbsGallery v-if="updateSwiper" />
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<span class="footer-tip">提示:可切换查看问题列表当前分页内数据</span>
|
|
|
- <el-button @click="handlePrevious" :disabled="!hasPrevious">上一个</el-button>
|
|
|
- <el-button type="primary" @click="handleNext" :disabled="!hasNext">下一个</el-button>
|
|
|
+ <el-button @click="handlePrevious" :disabled="!hasPreviousRow">上一个</el-button>
|
|
|
+ <el-button type="primary" @click="handleNext" :disabled="!hasNextRow">下一个</el-button>
|
|
|
<el-checkbox
|
|
|
class="footer-checkbox"
|
|
|
v-model="curHasBeenChosen"
|
|
|
@@ -56,48 +30,27 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
- <el-dialog v-model="videoDialogVisible" class="video-dialog" align-center destroy-on-close>
|
|
|
- <video
|
|
|
- type="video/mp4"
|
|
|
- muted="true"
|
|
|
- preload="auto"
|
|
|
- :controls="true"
|
|
|
- autoplay
|
|
|
- style="object-fit: contain"
|
|
|
- >
|
|
|
- <source :src="tempVideoUrl" />
|
|
|
- </video>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { computed, ref } from 'vue';
|
|
|
-
|
|
|
- const props = defineProps({
|
|
|
- hasBeenChosen: Boolean,
|
|
|
- description: String,
|
|
|
- imagePaths: Array<string>,
|
|
|
- videoPaths: Array<string>,
|
|
|
- hasPrevious: Boolean,
|
|
|
- hasNext: Boolean,
|
|
|
- });
|
|
|
+ import { computed, nextTick, ref } from 'vue';
|
|
|
+ import { storeToRefs } from 'pinia';
|
|
|
+ import { useCurImgVideoUrlStore } from '../../store/useCurImgVideoUrl';
|
|
|
+ import SwiperThumbsGallery from './SwiperThumbsGallery.vue';
|
|
|
+
|
|
|
+ const curImgVideoUrl = useCurImgVideoUrlStore();
|
|
|
+ const { detailRowChosen, hasPreviousRow, hasNextRow, detailDescription } = storeToRefs(curImgVideoUrl);
|
|
|
|
|
|
const emits = defineEmits(['close', 'update:previous', 'update:next', 'update:choose']);
|
|
|
+
|
|
|
const visible = ref(true);
|
|
|
- const videoDialogVisible = ref(false);
|
|
|
+ const updateSwiper = ref(true);
|
|
|
|
|
|
const curHasBeenChosen = computed(() => {
|
|
|
- return props.hasBeenChosen;
|
|
|
+ return detailRowChosen.value;
|
|
|
});
|
|
|
|
|
|
- const tempVideoUrl = ref('');
|
|
|
- const handleOpenVideo = () => {
|
|
|
- videoDialogVisible.value = true;
|
|
|
- if (props.videoPaths) tempVideoUrl.value = props.videoPaths[0];
|
|
|
- };
|
|
|
-
|
|
|
const handleClose = () => {
|
|
|
emits('close');
|
|
|
};
|
|
|
@@ -108,10 +61,18 @@
|
|
|
|
|
|
const handleNext = () => {
|
|
|
emits('update:next');
|
|
|
+ updateSwiper.value = false;
|
|
|
+ nextTick(() => {
|
|
|
+ updateSwiper.value = true;
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleChooseStatus = () => {
|
|
|
emits('update:choose', curHasBeenChosen.value);
|
|
|
+ updateSwiper.value = false;
|
|
|
+ nextTick(() => {
|
|
|
+ updateSwiper.value = true;
|
|
|
+ });
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -142,8 +103,8 @@
|
|
|
}
|
|
|
|
|
|
.el-dialog__body {
|
|
|
- height: 472px;
|
|
|
- padding: 40px;
|
|
|
+ height: 690px;
|
|
|
+ padding: 20px 40px 0 40px;
|
|
|
overflow: auto;
|
|
|
}
|
|
|
|
|
|
@@ -182,50 +143,4 @@
|
|
|
color: #606266;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .media-box {
|
|
|
- display: grid;
|
|
|
- grid-template-columns: repeat(auto-fill, 200px);
|
|
|
- column-gap: 10px;
|
|
|
- row-gap: 10px;
|
|
|
-
|
|
|
- .video-box {
|
|
|
- width: 200px;
|
|
|
- height: 200px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- .img-box {
|
|
|
- position: relative;
|
|
|
- width: 200px;
|
|
|
- height: 200px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- .cover-box {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- width: 200px;
|
|
|
- height: 200px;
|
|
|
- background-color: rgba(0, 0, 0, 0.5);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- :deep(.video-dialog) {
|
|
|
- .el-dialog__header,
|
|
|
- .el-dialog__footer {
|
|
|
- display: none;
|
|
|
- }
|
|
|
-
|
|
|
- .el-dialog__body {
|
|
|
- // height: 100%;
|
|
|
- padding: 0;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- background-color: #000;
|
|
|
- }
|
|
|
- }
|
|
|
</style>
|