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