Commit 7b436e4b by qinjianhui

fix: 打版管理小图加hover查看大图

parent f0b880d1
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
v-for="(val, index) in imageList" v-for="(val, index) in imageList"
:key="index" :key="index"
class="color-image-item" class="color-image-item"
@mouseover="setMainImage(val.imagePath)"
> >
<!-- <button class="remove" type="button"> <!-- <button class="remove" type="button">
<i class="el-icon-close"></i> <i class="el-icon-close"></i>
...@@ -26,10 +27,11 @@ ...@@ -26,10 +27,11 @@
</li> --> </li> -->
</ul> </ul>
<div class="main-image"> <div class="main-image">
<img :src="row?.mainImage" /> <img :src="mainImageUrl || row?.mainImage" />
</div> </div>
</div> </div>
<div class="review-from"> <div class="review-from">
<div>
<ElForm <ElForm
ref="reviewFormRef" ref="reviewFormRef"
:model="reviewForm" :model="reviewForm"
...@@ -116,13 +118,10 @@ ...@@ -116,13 +118,10 @@
placeholder="承诺完成日期" placeholder="承诺完成日期"
></ElDatePicker> ></ElDatePicker>
</ElFormItem> </ElFormItem>
<p
v-dompurify-html="reviewForm.requirement"
style="height: 470px"
class="requirement"
></p>
</ElForm> </ElForm>
</div> </div>
<p v-dompurify-html="reviewForm.requirement" class="requirement"></p>
</div>
</div> </div>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
...@@ -136,7 +135,11 @@ ...@@ -136,7 +135,11 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { TypesettingListData, EmergencyLevel,ImageListData } from '@/types/api/typesetting' import {
TypesettingListData,
EmergencyLevel,
ImageListData,
} from '@/types/api/typesetting'
import { import {
computed, computed,
defineEmits, defineEmits,
...@@ -144,6 +147,7 @@ import { ...@@ -144,6 +147,7 @@ import {
PropType, PropType,
ref, ref,
onMounted, onMounted,
watch,
} from 'vue' } from 'vue'
import { saveTypesettingReviewApi } from '@/api/typesetting' import { saveTypesettingReviewApi } from '@/api/typesetting'
import { getUserListApi } from '@/api/common' import { getUserListApi } from '@/api/common'
...@@ -167,6 +171,11 @@ const visible = computed({ ...@@ -167,6 +171,11 @@ const visible = computed({
emit('update:modelValue', val) emit('update:modelValue', val)
}, },
}) })
watch(visible, (val) => {
if (val) {
mainImageUrl.value = reviewForm.value?.mainImage || ''
}
})
const reviewForm = computed({ const reviewForm = computed({
get() { get() {
return props.row return props.row
...@@ -175,6 +184,7 @@ const reviewForm = computed({ ...@@ -175,6 +184,7 @@ const reviewForm = computed({
emit('update:modelValue', val) emit('update:modelValue', val)
}, },
}) })
const mainImageUrl = ref('')
const emergencyLevel = ref<EmergencyLevel[]>([]) const emergencyLevel = ref<EmergencyLevel[]>([])
emergencyLevel.value = [ emergencyLevel.value = [
{ {
...@@ -251,6 +261,9 @@ const getUserList = async () => { ...@@ -251,6 +261,9 @@ const getUserList = async () => {
console.error(e) console.error(e)
} }
} }
const setMainImage = (url: string | undefined) => {
mainImageUrl.value = url || ''
}
onMounted(() => { onMounted(() => {
getUserList() getUserList()
}) })
...@@ -265,7 +278,8 @@ const imageList = computed<ImageListData[]>(() => { ...@@ -265,7 +278,8 @@ const imageList = computed<ImageListData[]>(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
ul,li { ul,
li {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
...@@ -284,6 +298,7 @@ ul,li { ...@@ -284,6 +298,7 @@ ul,li {
.detail-info { .detail-info {
display: flex; display: flex;
gap: 10px; gap: 10px;
height: 600px;
} }
.review-image { .review-image {
width: 40%; width: 40%;
...@@ -292,10 +307,15 @@ ul,li { ...@@ -292,10 +307,15 @@ ul,li {
} }
.review-from { .review-from {
width: 60%; width: 60%;
display: flex;
flex-direction: column;
} }
.requirement { .requirement {
border: 1px solid #ddd; border: 1px solid #ddd;
overflow: auto;
flex: 1;
margin: 0;
} }
.main-image { .main-image {
......
...@@ -19,12 +19,13 @@ ...@@ -19,12 +19,13 @@
v-for="(item, index) of row?.imageList" v-for="(item, index) of row?.imageList"
:key="index" :key="index"
class="color-image-item" class="color-image-item"
@mouseover="onMouseover(item.imagePath)"
> >
<img :src="item.imagePath" alt="" class="img-sign" /> <img :src="item.imagePath" alt="" class="img-sign" />
</div> </div>
</div> </div>
<div class="modals-image-big"> <div class="modals-image-big">
<img :src="row?.mainImage" alt="" class="img-sign" /> <img :src="mainImageUrl || row?.imageList[0]?.imagePath" alt="" class="img-sign" />
</div> </div>
</div> </div>
</div> </div>
...@@ -91,6 +92,7 @@ ...@@ -91,6 +92,7 @@
v-for="(item, index) of versionImageList" v-for="(item, index) of versionImageList"
:key="index" :key="index"
class="color-image-item" class="color-image-item"
@mousemove="onRightMouseover(item?.imagePath)"
> >
<img :src="item.imagePath" alt="" class="img-sign" /> <img :src="item.imagePath" alt="" class="img-sign" />
<span <span
...@@ -407,6 +409,7 @@ watch(visible, (val) => { ...@@ -407,6 +409,7 @@ watch(visible, (val) => {
} else { } else {
activeName.value = 'first' activeName.value = 'first'
} }
mainImageUrl.value = props.row?.mainImage
} }
}) })
const opinion = ref('') const opinion = ref('')
...@@ -631,6 +634,13 @@ const getPriceDetail = async (data: TypesettingListData) => { ...@@ -631,6 +634,13 @@ const getPriceDetail = async (data: TypesettingListData) => {
console.error(e) console.error(e)
} }
} }
const mainImageUrl = ref<string>('')
const onMouseover = (url: string) => {
mainImageUrl.value = url
}
const onRightMouseover = (url: string | undefined) => {
versionImageUrl.value = url || ''
}
defineExpose({ getExamineInfo, reset, getPriceDetail }) defineExpose({ getExamineInfo, reset, getPriceDetail })
</script> </script>
...@@ -651,6 +661,8 @@ defineExpose({ getExamineInfo, reset, getPriceDetail }) ...@@ -651,6 +661,8 @@ defineExpose({ getExamineInfo, reset, getPriceDetail })
width: 60px; width: 60px;
height: 60px; height: 60px;
border: 1px solid #eee; border: 1px solid #eee;
margin-bottom: 5px;
cursor: pointer;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment