centaline-data-driven 1.3.49 → 1.3.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,87 +1,68 @@
1
1
  <template>
2
- <div
3
- style="height: 100%"
4
- id="viewer-file"
5
- ref="viewerfile"
6
- @contextmenu="handleMouse"
7
- >
2
+ <div style="height: 100%"
3
+ id="viewer-file"
4
+ ref="viewerfile"
5
+ @contextmenu="handleMouse">
8
6
  <el-container style="height: 100%; border: 1px solid #eee">
9
- <el-aside style="background-color: rgb(238, 241, 246)"
10
- ><div style="height: 100%" class="viewerMenu">
11
- <el-menu
12
- :default-openeds="openeds"
13
- :default-active="activeitem"
14
- style="height: 100%"
15
- >
16
- <el-submenu
17
- :key="groupIndex"
18
- :index="groupIndex.toString()"
19
- v-for="(group, groupIndex) in MediaAlbum"
20
- >
7
+ <el-aside style="background-color: rgb(238, 241, 246)">
8
+ <div style="height: 100%" class="viewerMenu">
9
+ <el-menu :default-openeds="openeds"
10
+ :default-active="activeitem"
11
+ style="height: 100%">
12
+ <el-submenu :key="groupIndex"
13
+ :index="groupIndex.toString()"
14
+ v-for="(group, groupIndex) in MediaAlbum">
21
15
  <template slot="title">
22
16
  <i></i>
23
- <div
24
- style="
17
+ <div style="
25
18
  padding: 0 10px !important;
26
19
  height: 30px !important;
27
20
  line-height: 30px !important;
28
- "
29
- >
21
+ ">
30
22
  {{ group.albumName }}
31
23
  </div>
32
24
  </template>
33
25
  <el-menu-item-group>
34
- <el-menu-item
35
- @click="handleClick(item, groupIndex, index)"
36
- :key="index"
37
- :index="groupIndex.toString() + '-' + index.toString()"
38
- v-for="(item, index) in group.medias"
39
- >{{ item.mediaLabelName || item.fileName }}</el-menu-item
40
- >
26
+ <el-menu-item @click="handleClick(item, groupIndex, index)"
27
+ :key="index"
28
+ :index="groupIndex.toString() + '-' + index.toString()"
29
+ v-for="(item, index) in group.medias">{{ item.mediaLabelName || item.fileName }}</el-menu-item>
41
30
  </el-menu-item-group>
42
31
  </el-submenu>
43
32
  </el-menu>
44
33
  </div>
45
34
  </el-aside>
46
35
  <el-main ref="displayArea">
47
- <div
48
- style="position: relative; width: 100%"
49
- :style="{ height: displayAreaHeight - 78 + 'px' }"
50
- v-if="resultObject"
51
- >
36
+ <div style="position: relative; width: 100%"
37
+ :style="{ height: displayAreaHeight - 78 + 'px' }"
38
+ v-if="resultObject">
52
39
  <!--VR-->
53
40
  <template v-if="itemFile.mediaTypeID == '1'">
54
- <iframe
55
- :src="resultObject"
56
- :height="displayAreaHeight - 80 + 'px'"
57
- :width="displayAreaWidth + 'px'"
58
- >
41
+ <iframe :src="resultObject"
42
+ :height="displayAreaHeight - 80 + 'px'"
43
+ :width="displayAreaWidth + 'px'">
59
44
  </iframe>
60
45
  </template>
61
46
  <!--Photo-->
62
47
  <template v-else-if="itemFile.mediaTypeID == '2'">
63
- <ct-viewerImage
64
- ref="viewerImage"
65
- :imgUrl="resultObject"
66
- :rotate="rotate"
67
- ></ct-viewerImage>
48
+ <ct-viewerImage ref="viewerImage"
49
+ :imgUrl="resultObject"
50
+ :rotate="rotate"></ct-viewerImage>
68
51
  </template>
69
52
  <!--ThreeDimensional-->
70
- <template v-else-if="itemFile.mediaTypeID == '3'"
71
- >暂不支持ThreeDimensional
53
+ <template v-else-if="itemFile.mediaTypeID == '3'">
54
+ 暂不支持ThreeDimensional
72
55
  </template>
73
56
  <!--Video-->
74
57
  <template v-else-if="itemFile.mediaTypeID == '4'">
75
58
  <div class="viewerContent">
76
- <video
77
- preload="none"
78
- :src="resultObject"
79
- controls="controls"
80
- class="viewerContent"
81
- controlslist="nodownload"
82
- :height="500"
83
- :width="800"
84
- >
59
+ <video preload="none"
60
+ :src="resultObject"
61
+ controls="controls"
62
+ class="viewerContent"
63
+ controlslist="nodownload"
64
+ :height="500"
65
+ :width="800">
85
66
  您的浏览器不支持 video 标签。
86
67
  </video>
87
68
  </div>
@@ -89,113 +70,82 @@
89
70
  <!--Audio-->
90
71
  <template v-else-if="itemFile.mediaTypeID == '5'">
91
72
  <div class="viewerContent">
92
- <audio
93
- preload="none"
94
- :src="resultObject"
95
- controls="controls"
96
- class="viewerContent"
97
- controlslist="nodownload"
98
- style="width: 50%"
99
- >
73
+ <audio preload="none"
74
+ :src="resultObject"
75
+ controls="controls"
76
+ class="viewerContent"
77
+ controlslist="nodownload"
78
+ style="width: 50%">
100
79
  您的浏览器不支持 audio 标签。
101
80
  </audio>
102
81
  </div>
103
82
  </template>
104
83
  <!--File-->
105
84
  <template v-else-if="itemFile.mediaTypeID == '6'">
106
- <template
107
- v-if="
108
- 'doc,docx,xlsx'.search(itemFile.fileExtension.toLowerCase()) >
109
- -1
110
- "
111
- >
112
- <div
113
- class="viewerContent"
114
- style="max-height: 200px; text-align: center"
115
- >
85
+ <template v-if="'doc,docx,xlsx' .search(itemFile.fileExtension.toLowerCase())>-1">
86
+ <div class="viewerContent"
87
+ style="max-height: 200px; text-align: center">
116
88
  <a :href="resultObject">
117
89
  <img :src="itemFile.thumbnailUrl" /><br />{{
118
90
  itemFile.mediaLabelName || itemFile.fileName
119
- }}</a
120
- >
91
+ }}
92
+ </a>
121
93
  </div>
122
94
  </template>
123
- <template
124
- v-else-if="
125
- 'pdf'.search(itemFile.fileExtension.toLowerCase()) > -1
126
- "
127
- >
128
- <ct-viewerPDF
129
- :pdfUrl="resultObject"
130
- :displayAreaHeight="displayAreaHeight"
131
- :displayAreaWidth="displayAreaWidth"
132
- >
95
+ <template v-else-if="'pdf' .search(itemFile.fileExtension.toLowerCase())>-1 ">
96
+ <ct-viewerPDF :pdfUrl="resultObject"
97
+ :displayAreaHeight="displayAreaHeight"
98
+ :displayAreaWidth="displayAreaWidth">
133
99
  </ct-viewerPDF>
134
100
  </template>
135
101
  </template>
136
- <template v-else> 不支持此类型:{{ itemFile.mediaTypeID }} </template>
102
+ <template v-else>
103
+ 不支持此类型:{{ itemFile.mediaTypeID }}
104
+ </template>
137
105
 
138
106
  <template v-if="resultObject != ''">
139
- <div
140
- class="magnify-footer"
141
- :style="{
107
+ <div class="magnify-footer"
108
+ :style="{
142
109
  width: displayAreaWidth + 'px',
143
110
  bottom: displayAreabtm + 10 + 'px',
144
- }"
145
- >
146
- <div
147
- class="magnify-toolbar"
148
- :style="{ 'margin-left': displayArealeft + 'px' }"
149
- >
150
- <a
151
- href="javascript:void(0)"
152
- class="magnify-btn el-icon-back"
153
- title="上一个"
154
- @click="jump(-1)"
155
- ></a
156
- ><a
157
- href="javascript:void(0)"
158
- class="magnify-btn el-icon-right"
159
- title="下一个"
160
- @click="jump(1)"
161
- ></a>
111
+ }">
112
+ <div class="magnify-toolbar"
113
+ :style="{ 'margin-left': displayArealeft + 'px' }">
114
+ <a href="javascript:void(0)"
115
+ class="magnify-btn el-icon-back"
116
+ title="上一个"
117
+ @click="jump(-1)"></a><a href="javascript:void(0)"
118
+ class="magnify-btn el-icon-right"
119
+ title="下一个"
120
+ @click="jump(1)"></a>
162
121
  <template v-if="itemFile.mediaTypeID == '2'">
163
- <a
164
- href="javascript:void(0)"
165
- class="magnify-btn el-icon-refresh-left"
166
- title="左旋转"
167
- @click="rotateImg('L')"
168
- ></a
169
- ><a
170
- href="javascript:void(0)"
171
- class="magnify-btn el-icon-refresh-right"
172
- title="右旋转"
173
- @click="rotateImg('R')"
174
- ></a
175
- ><a
176
- href="javascript:void(0)"
177
- class="magnify-btn el-icon-zoom-in"
178
- title="放大"
179
- @click="zoom(0.2)"
180
- ></a
181
- ><a
182
- href="javascript:void(0)"
183
- class="magnify-btn el-icon-refresh"
184
- title="实际尺寸"
185
- @click="actualSize()"
186
- ></a
187
- ><a
188
- href="javascript:void(0)"
189
- class="magnify-btn el-icon-zoom-out"
190
- title="缩小"
191
- @click="zoom(-0.2)"
192
- >
193
- </a> </template
194
- ><a
195
- href="javascript:void(0)"
196
- class="magnify-btn el-icon-download"
197
- title="下载"
198
- ></a>
122
+ <a href="javascript:void(0)"
123
+ class="magnify-btn el-icon-refresh-left"
124
+ title="左旋转"
125
+ @click="rotateImg('L')"></a>
126
+ <a href="javascript:void(0)"
127
+ class="magnify-btn el-icon-refresh-right"
128
+ title="右旋转"
129
+ @click="rotateImg('R')"></a>
130
+ <a href="javascript:void(0)"
131
+ class="magnify-btn el-icon-zoom-in"
132
+ title="放大"
133
+ @click="zoom(0.2)"></a>
134
+ <a href="javascript:void(0)"
135
+ class="magnify-btn el-icon-refresh"
136
+ title="实际尺寸"
137
+ @click="actualSize()"></a>
138
+ <a href="javascript:void(0)"
139
+ class="magnify-btn el-icon-zoom-out"
140
+ title="缩小"
141
+ @click="zoom(-0.2)">
142
+ </a>
143
+ </template>
144
+ <a v-if="itemFile.rightDownload"
145
+ :href="resultObject.replace(/\/preview$/,'')" target="_blank"
146
+ class="magnify-btn el-icon-download"
147
+ title="下载"
148
+ :download="(itemFile.mediaLabelName || itemFile.fileName)"></a>
199
149
  </div>
200
150
  </div>
201
151
  </template>
@@ -204,276 +154,283 @@
204
154
  </el-container>
205
155
  </div>
206
156
  </template>
207
-
157
+
208
158
 
209
159
  <script>
210
- import dynamicElement from "../../mixins/dynamicElement";
211
- import dynamicViewerImage from "./dynamicViewerImage.vue";
212
- import dynamicViewerPDF from "./dynamicViewerPDF.vue";
213
- //import dynamicViewerVR from "./dynamicViewerVR.vue";
214
- export default {
215
- name: "ct-viewerfile",
216
- mixins: [dynamicElement],
217
- components: {
218
- "ct-viewerImage": dynamicViewerImage,
219
- "ct-viewerPDF": dynamicViewerPDF,
220
- // "ct-viewerVR": dynamicViewerVR,
221
- },
222
- props: {
223
- MediaAlbum: Array,
224
- groupIndex: Number,
225
- index: Number,
226
- },
227
- data() {
228
- return {
229
- rotate: 0,
230
- activeIndex: -1,
231
- activeGroup: -1,
232
- resultObject: "",
233
- itemFile: {},
234
- groupCountLen: 0,
235
- activeitem: "",
236
- openeds: [],
237
- displayAreaWidth: 0,
238
- displayAreabtm: 0,
239
- displayArealeft: 0,
240
- displayAreaHeight: 0,
241
- };
242
- },
243
- created() {
244
- var self = this;
245
- this.groupCountLen = 0;
246
- this.MediaAlbum.forEach((item, n) => {
247
- self.openeds.push(n.toString());
248
- item.medias.forEach((v) => {
249
- this.groupCountLen++;
160
+ import dynamicElement from "../../mixins/dynamicElement";
161
+ import dynamicViewerImage from "./dynamicViewerImage.vue";
162
+ import dynamicViewerPDF from "./dynamicViewerPDF.vue";
163
+ //import dynamicViewerVR from "./dynamicViewerVR.vue";
164
+ export default {
165
+ name: "ct-viewerfile",
166
+ mixins: [dynamicElement],
167
+ components: {
168
+ "ct-viewerImage": dynamicViewerImage,
169
+ "ct-viewerPDF": dynamicViewerPDF,
170
+ // "ct-viewerVR": dynamicViewerVR,
171
+ },
172
+ props: {
173
+ MediaAlbum: Array,
174
+ groupIndex: Number,
175
+ index: Number,
176
+ },
177
+ data() {
178
+ return {
179
+ rotate: 0,
180
+ activeIndex: -1,
181
+ activeGroup: -1,
182
+ resultObject: "",
183
+ itemFile: {},
184
+ groupCountLen: 0,
185
+ activeitem: "",
186
+ openeds: [],
187
+ displayAreaWidth: 0,
188
+ displayAreabtm: 0,
189
+ displayArealeft: 0,
190
+ displayAreaHeight: 0,
191
+ };
192
+ },
193
+ created() {
194
+ var self = this;
195
+ this.groupCountLen = 0;
196
+ this.MediaAlbum.forEach((item, n) => {
197
+ self.openeds.push(n.toString());
198
+ item.medias.forEach((v) => {
199
+ this.groupCountLen++;
200
+ });
250
201
  });
251
- });
252
- },
202
+ },
253
203
 
254
- mounted() {
255
- var self = this;
256
- self.displayAreaWidth = this.DomWidth();
257
- self.displayArealeft = self.DomLeft();
258
- self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
259
- self.displayAreaHeight = self.$refs.displayArea.$el.offsetHeight;
260
- window.onresize = () => {
261
- self.displayAreaWidth = self.DomWidth();
204
+ mounted() {
205
+ var self = this;
206
+ self.displayAreaWidth = this.DomWidth();
262
207
  self.displayArealeft = self.DomLeft();
263
208
  self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
264
209
  self.displayAreaHeight = self.$refs.displayArea.$el.offsetHeight;
265
- };
210
+ window.onresize = () => {
211
+ self.displayAreaWidth = self.DomWidth();
212
+ self.displayArealeft = self.DomLeft();
213
+ self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
214
+ self.displayAreaHeight = self.$refs.displayArea.$el.offsetHeight;
215
+ };
266
216
 
267
- if (
268
- this.groupIndex != undefined &&
269
- this.index != undefined &&
270
- this.groupIndex > -1 &&
271
- this.index > -1
272
- ) {
273
- var item = this.MediaAlbum[this.groupIndex].medias[this.index];
274
- this.handleClick(item, this.groupIndex, this.index);
275
- }
276
- },
277
- methods: {
278
- handleMouse(e) {
279
- e.preventDefault();
217
+ if (
218
+ this.groupIndex != undefined &&
219
+ this.index != undefined &&
220
+ this.groupIndex > -1 &&
221
+ this.index > -1
222
+ ) {
223
+ var item = this.MediaAlbum[this.groupIndex].medias[this.index];
224
+ this.handleClick(item, this.groupIndex, this.index);
225
+ }
280
226
  },
281
- DomWidth() {
282
- let arrLength = window.innerWidth - this.$refs.viewerfile.offsetWidth;
283
- arrLength = arrLength > 0 ? arrLength : 0;
284
- var Width =
285
- window.innerWidth -
286
- arrLength -
287
- this.$refs.displayArea.$el.offsetLeft -
288
- 40;
227
+ methods: {
228
+ handleMouse(e) {
229
+ e.preventDefault();
230
+ },
231
+ DomWidth() {
232
+ let arrLength = window.innerWidth - this.$refs.viewerfile.offsetWidth;
233
+ arrLength = arrLength > 0 ? arrLength : 0;
234
+ var Width =
235
+ window.innerWidth -
236
+ arrLength -
237
+ this.$refs.displayArea.$el.offsetLeft -
238
+ 40;
289
239
 
290
- return Width;
291
- },
292
- DomLeft() {
293
- let arrLength = window.innerWidth - this.$refs.viewerfile.offsetWidth;
294
- arrLength = arrLength > 0 ? arrLength : 0;
295
- var Width =
296
- window.innerWidth -
297
- arrLength -
298
- this.$refs.displayArea.$el.offsetLeft -
299
- 40;
240
+ return Width;
241
+ },
242
+ DomLeft() {
243
+ let arrLength = window.innerWidth - this.$refs.viewerfile.offsetWidth;
244
+ arrLength = arrLength > 0 ? arrLength : 0;
245
+ var Width =
246
+ window.innerWidth -
247
+ arrLength -
248
+ this.$refs.displayArea.$el.offsetLeft -
249
+ 40;
300
250
 
301
- return Width / 2 - 524 + this.$refs.displayArea.$el.offsetLeft - 40;
302
- },
303
- DomTop() {
304
- const height = window.innerHeight; //可视区窗口高度
305
- const curDomHeight = this.$refs.viewerfile.offsetHeight;
306
- // const curDomHeight = dom.getBoundingClientRect().height
307
- const curDomY = this.$refs.viewerfile.getBoundingClientRect().y;
308
- let curDomBottom = height - curDomHeight - curDomY;
309
- curDomBottom = curDomBottom > 0 ? curDomBottom : 0;
310
- return curDomBottom;
311
- },
312
- FileExtension(item) {
313
- return item.savedFileName.replace(/.+\./, "").toLowerCase();
314
- },
315
- offsetLeft(elements) {
316
- var left = elements.offsetLeft;
317
- var parent = elements.offsetParent;
318
- while (parent != null) {
319
- left += parent.offsetLeft;
320
- parent = parent.offsetParent;
321
- }
251
+ return Width / 2 - 524 + this.$refs.displayArea.$el.offsetLeft - 40;
252
+ },
253
+ DomTop() {
254
+ const height = window.innerHeight; //可视区窗口高度
255
+ const curDomHeight = this.$refs.viewerfile.offsetHeight;
256
+ // const curDomHeight = dom.getBoundingClientRect().height
257
+ const curDomY = this.$refs.viewerfile.getBoundingClientRect().y;
258
+ let curDomBottom = height - curDomHeight - curDomY;
259
+ curDomBottom = curDomBottom > 0 ? curDomBottom : 0;
260
+ return curDomBottom;
261
+ },
262
+ FileExtension(item) {
263
+ return item.savedFileName.replace(/.+\./, "").toLowerCase();
264
+ },
265
+ offsetLeft(elements) {
266
+ var left = elements.offsetLeft;
267
+ var parent = elements.offsetParent;
268
+ while (parent != null) {
269
+ left += parent.offsetLeft;
270
+ parent = parent.offsetParent;
271
+ }
322
272
 
323
- return left;
324
- },
325
- handleClick(item, groupIndex, index) {
326
- if (index == this.activeIndex && groupIndex == this.activeGroup) return;
327
- this.activeIndex = index;
328
- this.activeGroup = groupIndex;
329
- this.itemFile = item;
273
+ return left;
274
+ },
275
+ handleClick(item, groupIndex, index) {
276
+ if (index == this.activeIndex && groupIndex == this.activeGroup) return;
277
+ this.activeIndex = index;
278
+ this.activeGroup = groupIndex;
279
+ this.itemFile = item;
330
280
 
331
- this.activeitem = groupIndex + "-" + index;
281
+ this.activeitem = groupIndex + "-" + index;
332
282
 
333
- this.resultObject = this.itemFile.mediaUrl;
283
+ this.resultObject = this.itemFile.mediaUrl;
334
284
 
335
- this.$forceUpdate();
336
- },
337
- jump(n) {
338
- var item = {};
339
- var groupIndex = this.activeGroup;
340
- var index = -1;
341
- if (n > 0) {
342
- if (
343
- this.activeGroup * 1 + this.activeIndex + 1 + n >
344
- this.groupCountLen
345
- ) {
346
- groupIndex = 0;
347
- index = 0;
348
- } else {
349
- if (this.MediaAlbum[this.activeGroup].medias[this.activeIndex + n]) {
350
- index = this.activeIndex + n;
285
+ this.$forceUpdate();
286
+ },
287
+ jump(n) {
288
+ var item = {};
289
+ var groupIndex = this.activeGroup;
290
+ var index = -1;
291
+ if (n > 0) {
292
+ if (
293
+ this.activeGroup * 1 + this.activeIndex + 1 + n >
294
+ this.groupCountLen
295
+ ) {
296
+ groupIndex = 0;
297
+ index = 0;
351
298
  } else {
352
- if (
353
- this.MediaAlbum[this.activeGroup + n] &&
354
- this.MediaAlbum[this.activeGroup + n].medias[0]
355
- ) {
356
- index = 0;
357
- groupIndex = this.activeGroup + n;
299
+ if (this.MediaAlbum[this.activeGroup].medias[this.activeIndex + n]) {
300
+ index = this.activeIndex + n;
358
301
  } else {
359
- groupIndex = 0;
360
- index = 0;
302
+ if (
303
+ this.MediaAlbum[this.activeGroup + n] &&
304
+ this.MediaAlbum[this.activeGroup + n].medias[0]
305
+ ) {
306
+ index = 0;
307
+ groupIndex = this.activeGroup + n;
308
+ } else {
309
+ groupIndex = 0;
310
+ index = 0;
311
+ }
361
312
  }
362
313
  }
363
- }
364
- } else if (n < 0) {
365
- if (this.activeGroup * 1 + this.activeIndex + n < 0) {
366
- groupIndex = this.MediaAlbum.length - 1;
367
- index = this.MediaAlbum[groupIndex].medias.length - 1;
368
- } else {
369
- if (this.MediaAlbum[this.activeGroup].medias[this.activeIndex + n]) {
370
- index = this.activeIndex + n;
314
+ } else if (n < 0) {
315
+ if (this.activeGroup * 1 + this.activeIndex + n < 0) {
316
+ groupIndex = this.MediaAlbum.length - 1;
317
+ index = this.MediaAlbum[groupIndex].medias.length - 1;
371
318
  } else {
372
- if (
373
- this.MediaAlbum[this.activeGroup + n].medias[
374
- this.MediaAlbum[this.activeGroup + n].medias.length - 1
375
- ]
376
- ) {
377
- index = this.MediaAlbum[this.activeGroup + n].medias.length - 1;
378
- groupIndex = this.activeGroup + n;
319
+ if (this.MediaAlbum[this.activeGroup].medias[this.activeIndex + n]) {
320
+ index = this.activeIndex + n;
379
321
  } else {
380
- groupIndex = this.MediaAlbum.length - 1;
381
- index = this.MediaAlbum[groupIndex].medias.length - 1;
322
+ if (
323
+ this.MediaAlbum[this.activeGroup + n].medias[
324
+ this.MediaAlbum[this.activeGroup + n].medias.length - 1
325
+ ]
326
+ ) {
327
+ index = this.MediaAlbum[this.activeGroup + n].medias.length - 1;
328
+ groupIndex = this.activeGroup + n;
329
+ } else {
330
+ groupIndex = this.MediaAlbum.length - 1;
331
+ index = this.MediaAlbum[groupIndex].medias.length - 1;
332
+ }
382
333
  }
383
334
  }
384
335
  }
385
- }
386
- item = this.MediaAlbum[groupIndex].medias[index];
387
- this.handleClick(item, groupIndex, index);
388
- },
336
+ item = this.MediaAlbum[groupIndex].medias[index];
337
+ this.handleClick(item, groupIndex, index);
338
+ },
389
339
 
390
- //旋转图片
391
- rotateImg(type) {
392
- var currentDeg = this.rotate || 0;
340
+ //旋转图片
341
+ rotateImg(type) {
342
+ var currentDeg = this.rotate || 0;
393
343
 
394
- if (type == "L") {
395
- currentDeg = currentDeg - 90;
396
- } else if (type == "R") {
397
- currentDeg = currentDeg + 90;
398
- }
399
- if (Math.abs(currentDeg) >= 360) {
400
- currentDeg = currentDeg % 360;
401
- }
402
- this.rotate = currentDeg;
403
- this.$forceUpdate();
404
- },
344
+ if (type == "L") {
345
+ currentDeg = currentDeg - 90;
346
+ } else if (type == "R") {
347
+ currentDeg = currentDeg + 90;
348
+ }
349
+ if (Math.abs(currentDeg) >= 360) {
350
+ currentDeg = currentDeg % 360;
351
+ }
352
+ this.rotate = currentDeg;
353
+ this.$forceUpdate();
354
+ },
405
355
 
406
- actualSize() {
407
- this.rotate = 0;
408
- this.$refs.viewerImage.actualSize();
409
- },
410
- zoom(n) {
411
- this.$refs.viewerImage.zoom(n);
356
+ actualSize() {
357
+ this.rotate = 0;
358
+ this.$refs.viewerImage.actualSize();
359
+ },
360
+ zoom(n) {
361
+ this.$refs.viewerImage.zoom(n);
362
+ }
412
363
  },
413
- },
414
- };
364
+ };
415
365
  </script>
416
366
 
417
367
  <style>
418
- body,
419
- html {
420
- height: 100%;
421
- }
422
- #viewer-file .el-container {
423
- margin-bottom: 40px;
424
- height: 100%;
425
- }
368
+ body,
369
+ html {
370
+ height: 100%;
371
+ }
372
+
373
+ #viewer-file .el-container {
374
+ margin-bottom: 40px;
375
+ height: 100%;
376
+ }
377
+
378
+ .viewerContent {
379
+ cursor: move;
380
+ position: absolute !important;
381
+ top: 0;
382
+ bottom: 0;
383
+ left: 0;
384
+ right: 0;
385
+ margin: auto;
386
+ }
426
387
 
427
- .viewerContent {
428
- cursor: move;
429
- position: absolute !important;
430
- top: 0;
431
- bottom: 0;
432
- left: 0;
433
- right: 0;
434
- margin: auto;
435
- }
388
+ .magnify-footer {
389
+ position: fixed;
390
+ height: 50px;
391
+ bottom: 0px;
392
+ /* text-align: center; */
393
+ color: #fff;
394
+ z-index: 9;
395
+ }
436
396
 
437
- .magnify-footer {
438
- position: fixed;
439
- height: 50px;
440
- bottom: 0px;
441
- /* text-align: center; */
442
- color: #fff;
443
- z-index: 9;
444
- }
397
+ .magnify-toolbar {
398
+ display: inline-block;
399
+ background-color: rgba(0, 0, 0, 0.5);
400
+ -webkit-border-radius: 5px;
401
+ -moz-border-radius: 5px;
402
+ border-radius: 5px;
403
+ }
445
404
 
446
- .magnify-toolbar {
447
- display: inline-block;
448
- background-color: rgba(0, 0, 0, 0.5);
449
- -webkit-border-radius: 5px;
450
- -moz-border-radius: 5px;
451
- border-radius: 5px;
452
- }
453
- .magnify-toolbar .magnify-btn {
454
- margin: 15px 20px;
455
- color: #999;
456
- font-size: 25px;
457
- font-weight: 800;
458
- }
459
- .magnify-toolbar .magnify-btn:hover,
460
- .magnify-btn-close:hover {
461
- color: #fff;
462
- }
463
- .viewerMenu {
464
- border-right: solid 2px #e6e6e6 !important;
465
- }
466
- .viewerMenu .el-submenu__title,
467
- .viewerMenu .el-menu-item {
468
- height: 30px !important;
469
- line-height: 30px !important;
470
- }
471
- .viewerMenu .el-menu-item-group__title {
472
- line-height: 1px;
473
- height: 1px;
474
- display: none;
475
- }
476
- .viewerMenu .el-submenu__title .el-submenu__icon-arrow {
477
- display: inline-block;
478
- }
405
+ .magnify-toolbar .magnify-btn {
406
+ margin: 15px 20px;
407
+ color: #999;
408
+ font-size: 25px;
409
+ font-weight: 800;
410
+ }
411
+
412
+ .magnify-toolbar .magnify-btn:hover,
413
+ .magnify-btn-close:hover {
414
+ color: #fff;
415
+ }
416
+
417
+ .viewerMenu {
418
+ border-right: solid 2px #e6e6e6 !important;
419
+ }
420
+
421
+ .viewerMenu .el-submenu__title,
422
+ .viewerMenu .el-menu-item {
423
+ height: 30px !important;
424
+ line-height: 30px !important;
425
+ }
426
+
427
+ .viewerMenu .el-menu-item-group__title {
428
+ line-height: 1px;
429
+ height: 1px;
430
+ display: none;
431
+ }
432
+
433
+ .viewerMenu .el-submenu__title .el-submenu__icon-arrow {
434
+ display: inline-block;
435
+ }
479
436
  </style>