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)">
@@ -80,7 +80,7 @@
          </div>
        </div>
        <!-- 整改信息 -->
        <div v-if="dialogData.pageType ==='detail' && parentFormData.state >=30">
        <div v-if="(dialogData.pageType ==='detail'||dialogData.pageType ==='approve' )&& parentFormData.state >=30">
          <el-row class="rectificationContent">
            <el-col :span="12"><div class="grid-content bg-purple" />
              <el-descriptions title="整改信息" :column="parseInt('2')">
@@ -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
@@ -384,8 +400,10 @@
    searchthisFileList(newVal) {
      if (newVal.fileBaseList && newVal.fileBaseList.length > 0) {
        newVal.fileBaseList.forEach(item => {
          // const srcApi = item.fileType === 1 ? api + 'preview/' : api + 'preview/cover/'
          this.fileBaseList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          if (item.fileType === 1) {
            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}`,
            fileType: item.fileType,
@@ -396,7 +414,9 @@
      }
      if (newVal.fileChangeList && newVal.fileChangeList.length > 0) {
        newVal.fileChangeList.forEach(item => {
          this.fileChangeList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          if (item.fileType === 1) {
            this.fileChangeList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          }
          this.fileChangeListCover.push({
            url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`,
            fileType: item.fileType,
@@ -406,6 +426,9 @@
      }
      if (newVal.fileApproveList && newVal.fileApproveList.length > 0) {
        newVal.fileApproveList.forEach(item => {
          if (item.fileType === 1) {
            this.fileApproveList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          }
          this.fileApproveList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          this.fileApproveListCover.push({
            url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`,
@@ -416,6 +439,9 @@
      }
      if (newVal.fileList && newVal.fileList.length > 0) {
        newVal.fileList.forEach(item => {
          if (item.fileType === 1) {
            this.fileDelayList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          }
          this.fileDelayList.push(`${requestObj.baseUrl}/file/preview/${item.fileId}`) // 原图
          this.fileDelayListCover.push({
            url: item.fileType === 1 ? `${requestObj.baseUrl}/file/preview/cover/${item.fileId}` : `${requestObj.baseUrl}/file/preview/${item.fileId}`,