From b3ac30a5a5540b6e376fac7de98f5670a98e785e Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Wed, 25 Oct 2023 17:27:11 +0800 Subject: [PATCH] fix:实时风场图点击弹窗修改 --- src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue b/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue index e8784e7..3a5489f 100644 --- a/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue +++ b/src/views/toCarryOutLegislativeReforms/components/newWorkOrder.vue @@ -1,6 +1,10 @@ <template> <div> - <el-dialog :title="title" :visible.sync="visible" width="900px" center :before-close="close"> + <el-dialog :title="title" :visible.sync="visible" top="30px" width="900px" center :before-close="close"> + <div slot="title" class="titBox"> + <div>{{ parentFormData.allocationNum }}</div> + <div>{{ title }}</div> + </div> <div> <el-form ref="ruleForm" :disabled="pageState==='detail'" label-width="100px" :model="formData" class="demo-form-inline" :rules="rules"> <el-row> @@ -109,7 +113,7 @@ v-if="file.fileType ===1" style="width: 100px; height: 100px" :src="file.url" - :preview-src-list="fileBaseList" + :preview-src-list="getPreviewImages(file.fileId,fileBaseList)" :initial-index="index" /> <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)"> @@ -147,6 +151,7 @@ import uploadFile from '@/components/UploadExcel/index' import bus from '@/Bus' import requestObj from '@/utils/request' +import _ from 'lodash' export default { components: { uploadFile }, props: { @@ -216,10 +221,13 @@ if (this.pageState === 'edit') { if (this.parentFormData.fileBaseList && this.parentFormData.fileBaseList.length > 0) { this.parentFormData.fileBaseList.forEach(item => { + if (item.fileType === 1) { + this.fileBaseList.push(`${requestObj.baseUrl}file/preview/${item.fileId}`) // ������ + } // const srcApi = item.fileType === 1 ? api + 'preview/' : api + 'preview/cover/' - this.fileBaseList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // ������ + // this.fileBaseList.push(`${requestObj.baseUrl}file/preview/${item.fileId}`) // ������ this.fileBaseListCover.push({ - url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`, + url: item.fileType === 1 ? `${requestObj.baseUrl}file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}file/preview/${item.fileId}`, fileType: item.fileType, fileId: item.fileId, fileName: item.fileName @@ -258,6 +266,25 @@ }) }, methods: { + getPreviewImages(index, list) { + let startIndex = 0 + const chechList = _.cloneDeep(list) + chechList.forEach((item, i) => { + const str = item.substring(item.lastIndexOf('/') + 1) + console.log('str', str) + if (Number(str) === Number(index)) { + startIndex = i + } + }) + + console.log('index', index) + console.log('startIndex', startIndex) + var imgList = [...list] + if (index === 0) return imgList + var start = imgList.splice(startIndex) + var remain = imgList.splice(0, startIndex) + return start.concat(remain) + }, openVideo(item) { console.log('item', item) this.dialogImageUrl = item.url @@ -320,6 +347,17 @@ </script> <style lang="scss" scoped> +.titBox{ + position: relative; + font-size: 18px; + div:first-child{ + position: absolute; + left: 10px; + } + div{ + display: inline-block; + } +} .block { display: inline-block !important; margin-right: 10px; -- Gitblit v1.8.0