zhanghua
2023-12-13 2d7206bc7028a40c836108669c611fd93a571742
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<template>
  <div class="file-picture">
    <div class="file-tell">
      <div class="tell-title">上报</div>
      <div class="tell-show" v-for="item in imgSource" :key="item.id">
        <div v-if="item.type == '01'" style="display: flex">
          <div class="my-demo" v-for="childer in item.url">
            <img class="img" :src="childer" alt="" />
            <div class="tip">
              <div>【图片类型】上报</div>
              <div>【上传时间】{{ changeTime(item.createTime) }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="file-deal">
      <div class="tell-title">处置</div>
      <div class="tell-show" v-for="item in imgSource" :key="item.id">
        <div v-if="item.type == '02'" class="tell-demo">
          <div class="my-demo" v-for="childer in item.url">
            <img class="img" :src="childer" alt="" />
            <div class="tip">
              <!-- <div>【图片类型】处置</div> -->
              <div>【上传时间】{{ changeTime(item.createTime) }}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { parseTime, FILE_ORIGINAL_URL } from "@/utils/index";
export default {
  data() {
    return {
      imgSource: [],
    };
  },
  props: ["filesPictureVo", "mycode"],
  created() {
    const {
      filesPictureVo: { imageResources: imgList },
    } = this;
 
    let pic = this.filesPictureVo.imageResources;
    pic.forEach((item) => {
      let urls = item.url.split(",");
      item.url = [];
      urls.forEach((o) => {
        o = o.replace("[", "").replace("]", "");
        item.url.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${o}`);
      });
    });
    debugger;
    this.imgSource = pic;
    // this.getEventInfo(this.mycode);
  },
  methods: {
    // 获取token
    getToken() {
      const token = sessionStorage.getItem("token");
      const tokenHead = sessionStorage.getItem("tokenHead");
      if (token && tokenHead) {
        return { Authorization: tokenHead + token };
      }
    },
    changeTime(time) {
      if (time) {
        return parseTime(time);
      }
    },
    getEventInfo(mycode) {
      this.$axios({
        method: "get",
        url: `sccg/base_case/baseCaseDetail/${mycode}`,
      }).then((res) => {
        this.info = res.data;
        this.dialogView = true;
        let pic = res.data.filesPictureVo.imageResources;
        pic.forEach((item) => {
          let urls = item.url.split(",");
          item.url = [];
          urls.forEach((o) => {
            o = o.replace("[", "").replace("]", "");
            item.url.push(`${FILE_ORIGINAL_URL}sccg/API/img?fileUrl=${o}`);
          });
        });
        debugger;
        this.imgSource = pic;
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.file-picture {
  padding-top: 50px;
 
  .file-tell,
  .file-deal {
    .tell-title {
      line-height: 40px;
    }
 
    .tell-show {
      .tell-demo {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
      }
    }
  }
 
  .my-demo {
    position: relative;
    height: 159px;
    margin: 10px;
  }
 
  .tip {
    div {
      line-height: 20px;
    }
 
    text-align: left;
    position: absolute;
    bottom: 0px;
  }
 
  .img {
    width: 226px;
    height: 159px;
  }
}
</style>