Procházet zdrojové kódy

增加报修图片和处理图片的展示

seimin před 1 rokem
rodič
revize
e2e211eb84

+ 106 - 0
src/custom/ShowPicture.vue

@@ -0,0 +1,106 @@
1
+<template>
2
+  <div class="ShowPicture">
3
+    <div class="label">报修图片</div>
4
+    <div class="imgs-container" v-if="repairImgs.length">
5
+      <img :src="img.previewUrl" v-for="(img, index) in repairImgs" :key="index" class="imgs" @click="showImgs(repairImgs)" />
6
+    </div>
7
+    <div class="label">处理图片</div>
8
+    <div class="imgs-container" v-if="handlerImgs.length">
9
+      <img :src="img.previewUrl" v-for="(img, index) in handlerImgs" :key="index" class="imgs" @click="showImgs(handlerImgs)" />
10
+    </div>
11
+  </div>
12
+</template>
13
+
14
+<script>
15
+export default {
16
+  name: 'ShowPicture',
17
+  data(){
18
+    return {
19
+      repairImgs: [], //报修图片
20
+      handlerImgs: [], //处理图片
21
+    }
22
+  },
23
+  props:['processInstanceId'],
24
+  methods:{
25
+    // 获取报修图片
26
+    getRepairImgs() {
27
+      var that = this;
28
+      that.$http
29
+        .get(
30
+          "service/common/common/listAttachment/wechatRequesterIncident/" +
31
+            that.processInstanceId,
32
+          {}
33
+        )
34
+        .then(function (res) {
35
+          console.log(res.data);
36
+          res.data.data = res.data.data || [];
37
+          res.data.data.forEach(v => {
38
+            v.previewUrl = location.origin + "/file" + v.relativeFilePath;
39
+          })
40
+          that.repairImgs = res.data.data;
41
+        });
42
+    },
43
+    // 获取处理图片
44
+    getHandlerImgs() {
45
+      var that = this;
46
+      that.$http
47
+        .get(
48
+          "service/common/common/listAttachment/incident/" +
49
+            that.processInstanceId,
50
+          {}
51
+        )
52
+        .then(function (res) {
53
+          console.log(res.data);
54
+          res.data.data = res.data.data || [];
55
+          res.data.data.forEach(v => {
56
+            v.previewUrl = location.origin + "/file" + v.relativeFilePath;
57
+          })
58
+          that.handlerImgs = res.data.data;
59
+        });
60
+    },
61
+    //展示图片
62
+    showImgs(imgs){
63
+      this.$createImagePreview({
64
+        imgs:imgs.map(v=>v.previewUrl)
65
+      }).show()
66
+    },
67
+  },
68
+  created(){
69
+    this.getRepairImgs();
70
+    this.getHandlerImgs();
71
+  }
72
+}
73
+</script>
74
+
75
+<style lang="less" scoped>
76
+.ShowPicture{
77
+  .label {
78
+    background-color: #eeeeee;
79
+    height: 0.6rem;
80
+    line-height: 0.58rem;
81
+    padding-left: 0.2rem;
82
+    font-size: 0.24rem;
83
+    color: #666666;
84
+    span {
85
+      font-size: 0.2rem;
86
+      display: inline-block;
87
+      margin-left: 0.08rem;
88
+      color: #999999;
89
+    }
90
+    &.formLabel {
91
+      background-color: #fff;
92
+    }
93
+  }
94
+
95
+  .imgs-container {
96
+    display: flex;
97
+    flex-wrap: wrap;
98
+    img {
99
+      width: 1.5rem;
100
+      height: 1.5rem;
101
+      margin: 1%;
102
+      border: 1px dotted #ccc;
103
+    }
104
+  }
105
+}
106
+</style>

+ 3 - 59
src/views/againAssign.vue

@@ -41,26 +41,7 @@
41 41
               >隐藏详情<<</span
42 42
             >
43 43
           </p>
44
-          <div class="imgs-container" v-if="imgs.length">
45
-            <div class="imgs-cont" @click="showImgs(imgs)">
46
-              <img
47
-                v-if="
48
-                  img.suffix == 'jpeg' ||
49
-                  img.suffix == 'jpg' ||
50
-                  img.suffix == 'gif' ||
51
-                  img.suffix == 'png' ||
52
-                  img.suffix == 'svg' ||
53
-                  img.suffix == 'pdf'
54
-                "
55
-                :src="img.previewUrl"
56
-                v-for="(img, index) in imgs"
57
-                class="imgs"
58
-              />
59
-              <p v-else>
60
-                <a :href="[img.previewUrl]">{{ img.name }}</a>
61
-              </p>
62
-            </div>
63
-          </div>
44
+          <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
64 45
           <div class="label" id="assignee">重新指派</div>
65 46
           <div class="info">
66 47
             <p>
@@ -155,6 +136,7 @@
155 136
 import LoadIng from "./../views/loading.vue";
156 137
 import PrompTing from "./../views/prompting.vue";
157 138
 import EventInformation from './../components/EventInformation/index.vue'
139
+import ShowPicture from './../custom/ShowPicture.vue'
158 140
 export default {
159 141
   data() {
160 142
     return {
@@ -166,7 +148,6 @@ export default {
166 148
       actives: "info",
167 149
       processInstanceId: "",
168 150
       progressInfo: [], //处理进度
169
-      imgs: [], //图片
170 151
       model: {}, //提交数据
171 152
       handleUserOrGroup: false, //处理人/处理组
172 153
       handlerUserArr: [], //处理人
@@ -180,6 +161,7 @@ export default {
180 161
     LoadIng,
181 162
     PrompTing,
182 163
     EventInformation,
164
+    ShowPicture,
183 165
   },
184 166
   methods: {
185 167
     //   获取事件数据
@@ -201,27 +183,6 @@ export default {
201 183
           that.getProgressInfo();
202 184
         });
203 185
     },
204
-    //展示图片
205
-    showImgs(imgs){
206
-      this.$createImagePreview({
207
-        imgs:imgs.map(v=>v.previewUrl)
208
-      }).show()
209
-    },
210
-    // 获取图片
211
-    getImgs() {
212
-      var that = this;
213
-      that.$http
214
-        .get(
215
-          "service/common/common/listAttachment/incident/" +
216
-            that.processInstanceId,
217
-          {}
218
-        )
219
-        .then(function (res) {
220
-          console.log(res.data);
221
-          that.imgs = res.data.data.splice(0, 3);
222
-          console.log(that.imgs);
223
-        });
224
-    },
225 186
     // 获取处理进度
226 187
     getProgressInfo() {
227 188
       var that = this;
@@ -394,7 +355,6 @@ export default {
394 355
     this.processInstanceId = this.$route.params.data.processInstanceId;
395 356
     this.id = this.$route.params.data.id;
396 357
     this.getParamsData();
397
-    this.getImgs();
398 358
     this.getHandlerUser();
399 359
     this.getCandidateGroups();
400 360
   },
@@ -530,22 +490,6 @@ i.iconfont.blue {
530 490
             color: #00559d;
531 491
           }
532 492
         }
533
-        .imgs-container {
534
-          a {
535
-            color: #03c !important;
536
-            &:visited {
537
-              color: #551a8b !important;
538
-            }
539
-          }
540
-          img {
541
-            width: 1.5rem;
542
-            height: 1.5rem;
543
-            margin-right: 0.7rem;
544
-            &:nth-child(1) {
545
-              margin-left: 0.75rem;
546
-            }
547
-          }
548
-        }
549 493
         .progress {
550 494
           padding: 0.2rem 0.2rem;
551 495
           overflow: hidden;

+ 3 - 59
src/views/closed.vue

@@ -49,26 +49,7 @@
49 49
               >隐藏详情<<</span
50 50
             >
51 51
           </p>
52
-          <div class="imgs-container" v-if="imgs.length">
53
-            <div class="imgs-cont" @click="showImgs(imgs)">
54
-              <img
55
-                v-if="
56
-                  img.suffix == 'jpeg' ||
57
-                  img.suffix == 'jpg' ||
58
-                  img.suffix == 'gif' ||
59
-                  img.suffix == 'png' ||
60
-                  img.suffix == 'svg' ||
61
-                  img.suffix == 'pdf'
62
-                "
63
-                :src="img.previewUrl"
64
-                v-for="(img, index) in imgs"
65
-                class="imgs"
66
-              />
67
-              <p v-else>
68
-                <a :href="[img.previewUrl]">{{ img.name }}</a>
69
-              </p>
70
-            </div>
71
-          </div>
52
+          <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
72 53
 
73 54
           <div class="label" id="handlerInfo">处理信息</div>
74 55
           <!-- <p>
@@ -187,6 +168,7 @@
187 168
 <script>
188 169
 import LoadIng from "./../views/loading.vue";
189 170
 import EventInformation from './../components/EventInformation/index.vue'
171
+import ShowPicture from './../custom/ShowPicture.vue'
190 172
 export default {
191 173
   data() {
192 174
     return {
@@ -209,7 +191,6 @@ export default {
209 191
       actives: "info",
210 192
       processInstanceId: "",
211 193
       progressInfo: [], //处理进度
212
-      imgs: [], //图片
213 194
       model: {}, //提交数据
214 195
       pro_hides: false, //展开/收起处理进度
215 196
     };
@@ -217,6 +198,7 @@ export default {
217 198
   components: {
218 199
     LoadIng,
219 200
     EventInformation,
201
+    ShowPicture,
220 202
   },
221 203
   methods: {
222 204
     // 查看汇总单
@@ -254,27 +236,6 @@ export default {
254 236
           that.getProgressInfo();
255 237
         });
256 238
     },
257
-    //展示图片
258
-    showImgs(imgs){
259
-      this.$createImagePreview({
260
-        imgs:imgs.map(v=>v.previewUrl)
261
-      }).show()
262
-    },
263
-    // 获取图片
264
-    getImgs() {
265
-      var that = this;
266
-      that.$http
267
-        .get(
268
-          "service/common/common/listAttachment/incident/" +
269
-            that.processInstanceId,
270
-          {}
271
-        )
272
-        .then(function (res) {
273
-          console.log(res.data);
274
-          that.imgs = res.data.data.splice(0, 3);
275
-          console.log(that.imgs);
276
-        });
277
-    },
278 239
     // 获取处理进度
279 240
     getProgressInfo() {
280 241
       var that = this;
@@ -364,7 +325,6 @@ export default {
364 325
       ? this.$route.params.data.id
365 326
       : JSON.parse(localStorage.getItem("modelData")).incident.id;
366 327
     this.getParamsData();
367
-    this.getImgs();
368 328
   },
369 329
 };
370 330
 </script>
@@ -507,22 +467,6 @@ i.iconfont {
507 467
             color: #00559d;
508 468
           }
509 469
         }
510
-        .imgs-container {
511
-          a {
512
-            color: #03c !important;
513
-            &:visited {
514
-              color: #551a8b !important;
515
-            }
516
-          }
517
-          img {
518
-            width: 1.5rem;
519
-            height: 1.5rem;
520
-            margin-right: 0.7rem;
521
-            &:nth-child(1) {
522
-              margin-left: 0.75rem;
523
-            }
524
-          }
525
-        }
526 470
         .progress {
527 471
           padding: 0.2rem 0.2rem;
528 472
           overflow: hidden;

+ 3 - 59
src/views/grabSheet.vue

@@ -34,26 +34,7 @@
34 34
                 >隐藏详情<<</span
35 35
               >
36 36
             </p>
37
-            <div class="imgs-container" v-if="imgs.length">
38
-              <div class="imgs-cont" @click="showImgs(imgs)">
39
-                <img
40
-                  v-if="
41
-                    img.suffix == 'jpeg' ||
42
-                    img.suffix == 'jpg' ||
43
-                    img.suffix == 'gif' ||
44
-                    img.suffix == 'png' ||
45
-                    img.suffix == 'svg' ||
46
-                    img.suffix == 'pdf'
47
-                  "
48
-                  :src="img.previewUrl"
49
-                  v-for="(img, index) in imgs"
50
-                  class="imgs"
51
-                />
52
-                <p v-else>
53
-                  <a :href="[img.previewUrl]">{{ img.name }}</a>
54
-                </p>
55
-              </div>
56
-            </div>
37
+            <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
57 38
 
58 39
             <div class="label" id="progress">处理进度</div>
59 40
             <div
@@ -103,6 +84,7 @@
103 84
 <script>
104 85
 import LoadIng from "./../views/loading.vue";
105 86
 import EventInformation from './../components/EventInformation/index.vue'
87
+import ShowPicture from './../custom/ShowPicture.vue'
106 88
 export default {
107 89
   data() {
108 90
     return {
@@ -126,7 +108,6 @@ export default {
126 108
       actives: "info",
127 109
       processInstanceId: "",
128 110
       progressInfo: [], //处理进度
129
-      imgs: [], //图片
130 111
       model: {}, //提交数据
131 112
       jurisdiction: false, //是否有抢单权限
132 113
       pro_hides: false, //展开/收起处理进度
@@ -164,27 +145,6 @@ export default {
164 145
           that.getProgressInfo();
165 146
         });
166 147
     },
167
-    //展示图片
168
-    showImgs(imgs){
169
-      this.$createImagePreview({
170
-        imgs:imgs.map(v=>v.previewUrl)
171
-      }).show()
172
-    },
173
-    // 获取图片
174
-    getImgs() {
175
-      var that = this;
176
-      that.$http
177
-        .get(
178
-          "service/common/common/listAttachment/incident/" +
179
-            that.processInstanceId,
180
-          {}
181
-        )
182
-        .then(function (res) {
183
-          console.log(res.data);
184
-          that.imgs = res.data.data.splice(0, 3);
185
-          console.log(that.imgs);
186
-        });
187
-    },
188 148
     // 获取处理进度
189 149
     getProgressInfo() {
190 150
       var that = this;
@@ -316,6 +276,7 @@ export default {
316 276
   components: {
317 277
     LoadIng,
318 278
     EventInformation,
279
+    ShowPicture,
319 280
   },
320 281
   created() {
321 282
     if(this.menu){
@@ -330,7 +291,6 @@ export default {
330 291
       ? this.$route.params.data.id
331 292
       : JSON.parse(localStorage.getItem("modelData")).incident.id;
332 293
     this.getParamsData();
333
-    this.getImgs();
334 294
   },
335 295
 };
336 296
 </script>
@@ -469,22 +429,6 @@ export default {
469 429
             color: #00559d;
470 430
           }
471 431
         }
472
-        .imgs-container {
473
-          a {
474
-            color: #03c !important;
475
-            &:visited {
476
-              color: #551a8b !important;
477
-            }
478
-          }
479
-          img {
480
-            width: 1.5rem;
481
-            height: 1.5rem;
482
-            margin-right: 0.7rem;
483
-            &:nth-child(1) {
484
-              margin-left: 0.75rem;
485
-            }
486
-          }
487
-        }
488 432
         .progress {
489 433
           padding: 0.2rem 0.2rem;
490 434
           overflow: hidden;

+ 1 - 1
src/views/newIncident.vue

@@ -275,7 +275,7 @@ export default {
275 275
       valid: undefined,
276 276
       action: {
277 277
         target:
278
-          this.$host + "/service/common/common/uploadAttachment/incident/",
278
+          this.$host + "/service/common/common/uploadAttachment/wechatRequesterIncident/",
279 279
         data: {}
280 280
       },
281 281
       isUploading: false,

+ 3 - 59
src/views/order.vue

@@ -58,26 +58,7 @@
58 58
                 >隐藏详情 <<</span
59 59
               >
60 60
             </p>
61
-            <div class="imgs-container" v-if="imgs.length">
62
-              <div class="imgs-cont" @click="showImgs(imgs)">
63
-                <img
64
-                  v-if="
65
-                    img.suffix == 'jpeg' ||
66
-                    img.suffix == 'jpg' ||
67
-                    img.suffix == 'gif' ||
68
-                    img.suffix == 'png' ||
69
-                    img.suffix == 'svg' ||
70
-                    img.suffix == 'pdf'
71
-                  "
72
-                  :src="img.previewUrl"
73
-                  v-for="(img, index) in imgs"
74
-                  class="imgs"
75
-                />
76
-                <p v-else>
77
-                  <a :href="[img.previewUrl]">{{ img.name }}</a>
78
-                </p>
79
-              </div>
80
-            </div>
61
+            <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
81 62
             <!-- <HandlerLog :data="model.incident.handlerLogs" id="handlerLog"></HandlerLog> -->
82 63
             <div class="label" id="progress">处理进度</div>
83 64
             <div
@@ -153,6 +134,7 @@
153 134
 import LoadIng from "./../views/loading.vue";
154 135
 import PrompTing from "./../views/prompting.vue";
155 136
 import EventInformation from './../components/EventInformation/index.vue'
137
+import ShowPicture from './../custom/ShowPicture.vue'
156 138
 export default {
157 139
   data() {
158 140
     return {
@@ -176,7 +158,6 @@ export default {
176 158
       actives: "info",
177 159
       processInstanceId: "",
178 160
       progressInfo: [], //处理进度
179
-      imgs: [], //图片
180 161
       model: {}, //提交数据
181 162
       pro_hides: false, //展开/收起处理进度
182 163
     };
@@ -185,6 +166,7 @@ export default {
185 166
     LoadIng,
186 167
     PrompTing,
187 168
     EventInformation,
169
+    ShowPicture,
188 170
   },
189 171
   methods: {
190 172
     //   获取事件数据
@@ -208,27 +190,6 @@ export default {
208 190
           that.getProgressInfo();
209 191
         });
210 192
     },
211
-    //展示图片
212
-    showImgs(imgs){
213
-      this.$createImagePreview({
214
-        imgs:imgs.map(v=>v.previewUrl)
215
-      }).show()
216
-    },
217
-    // 获取图片
218
-    getImgs() {
219
-      var that = this;
220
-      that.$http
221
-        .get(
222
-          "service/common/common/listAttachment/incident/" +
223
-            that.processInstanceId,
224
-          {}
225
-        )
226
-        .then(function (res) {
227
-          console.log(res.data);
228
-          that.imgs = res.data.data.splice(0, 3);
229
-          console.log(that.imgs);
230
-        });
231
-    },
232 193
     // 获取处理进度
233 194
     getProgressInfo() {
234 195
       var that = this;
@@ -371,7 +332,6 @@ export default {
371 332
       ? this.$route.params.data.id
372 333
       : JSON.parse(localStorage.getItem("modelData")).incident.id;
373 334
     this.getParamsData();
374
-    this.getImgs();
375 335
   },
376 336
 };
377 337
 </script>
@@ -509,22 +469,6 @@ i.iconfont.blue {
509 469
             color: #00559d;
510 470
           }
511 471
         }
512
-        .imgs-container {
513
-          a {
514
-            color: #03c !important;
515
-            &:visited {
516
-              color: #551a8b !important;
517
-            }
518
-          }
519
-          img {
520
-            width: 1.5rem;
521
-            height: 1.5rem;
522
-            margin-right: 0.7rem;
523
-            &:nth-child(1) {
524
-              margin-left: 0.75rem;
525
-            }
526
-          }
527
-        }
528 472
         .progress {
529 473
           padding: 0.2rem 0.2rem;
530 474
           overflow: hidden;

+ 5 - 59
src/views/processing.vue

@@ -61,26 +61,7 @@
61 61
               >隐藏详情<<</span
62 62
             >
63 63
           </p>
64
-          <div class="imgs-container" v-if="imgs.length">
65
-            <div class="imgs-cont" @click="showImgs(imgs)">
66
-              <img
67
-                v-if="
68
-                  img.suffix == 'jpeg' ||
69
-                    img.suffix == 'jpg' ||
70
-                    img.suffix == 'gif' ||
71
-                    img.suffix == 'png' ||
72
-                    img.suffix == 'svg' ||
73
-                    img.suffix == 'pdf'
74
-                "
75
-                :src="img.previewUrl"
76
-                v-for="(img, index) in imgs"
77
-                class="imgs"
78
-              />
79
-              <p v-else>
80
-                <a :href="[img.previewUrl]">{{ img.name }}</a>
81
-              </p>
82
-            </div>
83
-          </div>
64
+          <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
84 65
           <!-- <HandlerLog :data="modelData.incident.handlerLogs" id="handlerLog"></HandlerLog> -->
85 66
           <div class="label" id="progress">处理进度</div>
86 67
           <div
@@ -218,7 +199,7 @@
218 199
                   </cube-form-item>
219 200
 
220 201
                   <div class="label formLabel" v-if="order == 1">
221
-                    报修图片
202
+                    处理图片
222 203
                     <span>(最多可上传3张JPG或PNG,每张不能超过10M)</span>
223 204
                   </div>
224 205
                   <div class="uplod" v-if="order == 1">
@@ -333,6 +314,7 @@ import CubeExtendPopup from "./../components/extend-popup.vue";
333 314
 import LoadIng from "./../views/loading.vue";
334 315
 import PrompTing from "./../views/prompting.vue";
335 316
 import EventInformation from "./../components/EventInformation/index.vue";
317
+import ShowPicture from './../custom/ShowPicture.vue'
336 318
 // import HandlerLog from "./../views/handlerLog.vue";
337 319
 // import host from '../request/host'
338 320
 
@@ -453,7 +435,6 @@ export default {
453 435
       actives: "info",
454 436
       processInstanceId: "",
455 437
       progressInfo: [], //处理进度
456
-      imgs: [], //图片
457 438
       model: {}, //提交数据
458 439
       validity: {},
459 440
       valid: undefined,
@@ -989,25 +970,6 @@ export default {
989 970
           this.model.description = this.modelData.incident.description;
990 971
         });
991 972
     },
992
-    //展示图片
993
-    showImgs(imgs) {
994
-      this.$createImagePreview({
995
-        imgs: imgs.map(v => v.previewUrl)
996
-      }).show();
997
-    },
998
-    // 获取图片
999
-    getImgs() {
1000
-      var that = this;
1001
-      that.$http
1002
-        .get(
1003
-          "service/common/common/listAttachment/incident/" +
1004
-            that.processInstanceId,
1005
-          {}
1006
-        )
1007
-        .then(function(res) {
1008
-          that.imgs = res.data.data.splice(0, 3);
1009
-        });
1010
-    },
1011 973
     // 故障现象回显
1012 974
     setCategory() {
1013 975
       let that = this;
@@ -2020,7 +1982,6 @@ export default {
2020 1982
     this.action.target += this.processInstanceId;
2021 1983
     this.getParamsData();
2022 1984
     this.getHcs();
2023
-    this.getImgs();
2024 1985
     // 处理方式
2025 1986
     this.getHandleCategory();
2026 1987
     // 关闭代码
@@ -2069,7 +2030,8 @@ export default {
2069 2030
     CubeExtendPopup,
2070 2031
     LoadIng,
2071 2032
     PrompTing,
2072
-    EventInformation
2033
+    EventInformation,
2034
+    ShowPicture,
2073 2035
     // HandlerLog
2074 2036
   }
2075 2037
 };
@@ -2368,22 +2330,6 @@ i.iconfont.blue {
2368 2330
             color: #00559d;
2369 2331
           }
2370 2332
         }
2371
-        .imgs-container {
2372
-          a {
2373
-            color: #03c !important;
2374
-            &:visited {
2375
-              color: #551a8b !important;
2376
-            }
2377
-          }
2378
-          img {
2379
-            width: 1.5rem;
2380
-            height: 1.5rem;
2381
-            margin-right: 0.7rem;
2382
-            &:nth-child(1) {
2383
-              margin-left: 0.75rem;
2384
-            }
2385
-          }
2386
-        }
2387 2333
         .progress {
2388 2334
           padding: 0.2rem 0.2rem;
2389 2335
           overflow: hidden;

+ 3 - 59
src/views/solved.vue

@@ -49,26 +49,7 @@
49 49
               >隐藏详情<<</span
50 50
             >
51 51
           </p>
52
-          <div class="imgs-container" v-if="imgs.length">
53
-            <div class="imgs-cont" @click="showImgs(imgs)">
54
-              <img
55
-                v-if="
56
-                  img.suffix == 'jpeg' ||
57
-                  img.suffix == 'jpg' ||
58
-                  img.suffix == 'gif' ||
59
-                  img.suffix == 'png' ||
60
-                  img.suffix == 'svg' ||
61
-                  img.suffix == 'pdf'
62
-                "
63
-                :src="img.previewUrl"
64
-                v-for="(img, index) in imgs"
65
-                class="imgs"
66
-              />
67
-              <p v-else>
68
-                <a :href="[img.previewUrl]">{{ img.name }}</a>
69
-              </p>
70
-            </div>
71
-          </div>
52
+          <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
72 53
 
73 54
           <div class="label" id="handlerInfo">处理信息</div>
74 55
           <p>
@@ -212,6 +193,7 @@
212 193
 <script>
213 194
 import LoadIng from "./../views/loading.vue";
214 195
 import EventInformation from './../components/EventInformation/index.vue'
196
+import ShowPicture from './../custom/ShowPicture.vue'
215 197
 // import HandlerLog from "./../views/handlerLog.vue";
216 198
 export default {
217 199
   data() {
@@ -241,13 +223,13 @@ export default {
241 223
       actives: "info",
242 224
       processInstanceId: "",
243 225
       progressInfo: [], //处理进度
244
-      imgs: [], //图片
245 226
       model: {}, //提交数据
246 227
     };
247 228
   },
248 229
   components: {
249 230
     LoadIng,
250 231
     EventInformation,
232
+    ShowPicture,
251 233
     // HandlerLog
252 234
   },
253 235
   methods: {
@@ -287,27 +269,6 @@ export default {
287 269
           that.getProgressInfo();
288 270
         });
289 271
     },
290
-    //展示图片
291
-    showImgs(imgs){
292
-      this.$createImagePreview({
293
-        imgs:imgs.map(v=>v.previewUrl)
294
-      }).show()
295
-    },
296
-    // 获取图片
297
-    getImgs() {
298
-      var that = this;
299
-      that.$http
300
-        .get(
301
-          "service/common/common/listAttachment/incident/" +
302
-            that.processInstanceId,
303
-          {}
304
-        )
305
-        .then(function (res) {
306
-          console.log(res.data);
307
-          that.imgs = res.data.data.splice(0, 3);
308
-          console.log(that.imgs);
309
-        });
310
-    },
311 272
     // 获取处理进度
312 273
     getProgressInfo() {
313 274
       var that = this;
@@ -493,7 +454,6 @@ export default {
493 454
       : JSON.parse(localStorage.getItem("modelData")).incident.id;
494 455
     this.getParamsData();
495 456
 
496
-    this.getImgs();
497 457
     this.getHandlerRes();
498 458
     this.getDegree();
499 459
   },
@@ -656,22 +616,6 @@ i.iconfont {
656 616
             color: #00559d;
657 617
           }
658 618
         }
659
-        .imgs-container {
660
-          a {
661
-            color: #03c !important;
662
-            &:visited {
663
-              color: #551a8b !important;
664
-            }
665
-          }
666
-          img {
667
-            width: 1.5rem;
668
-            height: 1.5rem;
669
-            margin-right: 0.7rem;
670
-            &:nth-child(1) {
671
-              margin-left: 0.75rem;
672
-            }
673
-          }
674
-        }
675 619
 
676 620
         .progress {
677 621
           padding: 0.2rem 0.2rem;

+ 5 - 59
src/views/waitConfirm.vue

@@ -157,26 +157,7 @@
157 157
               >隐藏详情<<</span
158 158
             >
159 159
           </p>
160
-          <div class="imgs-container" v-if="imgs.length">
161
-            <div class="imgs-cont" @click="showImgs(imgs)">
162
-              <img
163
-                v-if="
164
-                  img.suffix == 'jpeg' ||
165
-                    img.suffix == 'jpg' ||
166
-                    img.suffix == 'gif' ||
167
-                    img.suffix == 'png' ||
168
-                    img.suffix == 'svg' ||
169
-                    img.suffix == 'pdf'
170
-                "
171
-                :src="img.previewUrl"
172
-                v-for="(img, index) in imgs"
173
-                class="imgs"
174
-              />
175
-              <p v-else>
176
-                <a :href="[img.previewUrl]">{{ img.name }}</a>
177
-              </p>
178
-            </div>
179
-          </div>
160
+          <ShowPicture :processInstanceId="processInstanceId"></ShowPicture>
180 161
 
181 162
           <div class="label" id="handlerInfo">处理信息</div>
182 163
           <p>
@@ -247,6 +228,7 @@
247 228
   </div>
248 229
 </template>
249 230
 <script>
231
+import ShowPicture from './../custom/ShowPicture.vue'
250 232
 export default {
251 233
   data() {
252 234
     return {
@@ -269,7 +251,6 @@ export default {
269 251
       actives: "info",
270 252
       processInstanceId: "",
271 253
       progressInfo: [], //处理进度
272
-      imgs: [], //图片
273 254
       model: {} //提交数据
274 255
     };
275 256
   },
@@ -290,27 +271,6 @@ export default {
290 271
           that.model = res.data.model;
291 272
         });
292 273
     },
293
-    //展示图片
294
-    showImgs(imgs){
295
-      this.$createImagePreview({
296
-        imgs:imgs.map(v=>v.previewUrl)
297
-      }).show()
298
-    },
299
-    // 获取图片
300
-    getImgs() {
301
-      var that = this;
302
-      that.$http
303
-        .get(
304
-          "service/common/common/listAttachment/incident/" +
305
-            that.processInstanceId,
306
-          {}
307
-        )
308
-        .then(function(res) {
309
-          console.log(res.data);
310
-          that.imgs = res.data.data.splice(0, 3);
311
-          console.log(that.imgs);
312
-        });
313
-    },
314 274
     // 获取处理进度
315 275
     getHandlerInfo() {
316 276
       var that = this;
@@ -353,7 +313,9 @@ export default {
353 313
     this.processInstanceId = this.$route.params.data.processInstanceId;
354 314
     this.getParamsData();
355 315
     this.getHandlerInfo();
356
-    this.getImgs();
316
+  },
317
+  components:{
318
+    ShowPicture,
357 319
   }
358 320
 };
359 321
 </script>
@@ -496,22 +458,6 @@ i.iconfont {
496 458
             color: #00559d;
497 459
           }
498 460
         }
499
-        .imgs-container {
500
-          a {
501
-            color: #03c !important;
502
-            &:visited {
503
-              color: #551a8b !important;
504
-            }
505
-          }
506
-          img {
507
-            width: 1.5rem;
508
-            height: 1.5rem;
509
-            margin-right: 0.7rem;
510
-            &:nth-child(1) {
511
-              margin-left: 0.75rem;
512
-            }
513
-          }
514
-        }
515 461
         .progress {
516 462
           padding: 0.2rem 0.2rem;
517 463
           overflow: hidden;