quanyawei
2023-09-28 2d445a7f255343099b4647ea5ce51d2980768003
src/views/toCarryOutLegislativeReforms/components/workOrderInformation.vue
@@ -1,6 +1,6 @@
<template>
  <div>
    <el-dialog :title="dialogData.title" :visible.sync="visible" width="900px" center :before-close="close">
    <el-dialog :title="dialogData.title" top="30px" :visible.sync="visible" width="900px" center :before-close="close">
      <div slot="title" class="titBox">
        <div>{{ parentFormData.allocationNum }}</div>
        <div>{{ dialogData.title }}</div>
@@ -36,7 +36,7 @@
                    v-if="file.fileType ===1"
                    style="width: 100px; height: 100px"
                    :src="file.url"
                    :preview-src-list="fileBaseList"
                    :preview-src-list="getPreviewImages(file.id,fileBaseList)"
                    :initial-index="index"
                  />
                  <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)">
@@ -101,7 +101,7 @@
                        v-if="file.fileType ===1"
                        style="width: 100px; height: 100px"
                        :src="file.url"
                        :preview-src-list="fileChangeList"
                        :preview-src-list="getPreviewImages(file.id,fileChangeList)"
                        :initial-index="index"
                      />
                      <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)">
@@ -136,7 +136,7 @@
                          v-if="file.fileType ===1"
                          style="width: 100px; height: 100px"
                          :src="file.url"
                          :preview-src-list="fileApproveList"
                          :preview-src-list="getPreviewImages(file.id,fileApproveList)"
                          :initial-index="index"
                        />
                        <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)">
@@ -169,7 +169,7 @@
                        v-if="file.fileType ===1"
                        style="width: 100px; height: 100px"
                        :src="file.url"
                        :preview-src-list="fileDelayList"
                        :preview-src-list="getPreviewImages(file.id,fileDelayList)"
                        :initial-index="index"
                      />
                      <video v-else :src="file.url" style="width: 100px; height: 100px" @click="openVideo(file)">
@@ -260,7 +260,7 @@
    return {
      centerDialogVisible: true,
      workForme: {
        isChange: '',
        isChange: 0,
        changeName: '',
        changeDescribe: ''
      },
@@ -372,6 +372,22 @@
    })
  },
  methods: {
    getPreviewImages(index, list) {
      let startIndex = 0
      const chechList = _.cloneDeep(list)
      chechList.forEach((item, i) => {
        const str = item.substring(item.lastIndexOf('/') + 1)
        if (Number(str) === Number(index)) {
          startIndex = i
        }
      })
      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