centaline-data-driven 1.3.5 → 1.3.8
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 +2 -1
- package/package.json +1 -1
- package/src/centaline/browseIframe/src/browseIframe.vue +49 -3
- package/src/centaline/dialogList/src/dialog.vue +2 -3
- package/src/centaline/dialogList/src/dialogList.vue +0 -22
- package/src/centaline/dynamicFile/src/dynamicFile.vue +4 -4
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +4 -1
- package/src/centaline/dynamicViewerFile/src/dynamicViewerFile.vue +25 -18
- package/src/centaline/dynamicViewerFile/src/dynamicViewerImage.vue +6 -2
- package/src/centaline/dynamicViewerFile/src/dynamicViewerPDF.vue +9 -11
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
- package/wwwroot/static/centaline/6032ad6e6e5a3ca138d5.worker.js +0 -8
- package/wwwroot/static/centaline/6032ad6e6e5a3ca138d5.worker.js.map +0 -1
|
@@ -45,7 +45,8 @@ const paths = {
|
|
|
45
45
|
"dynamicContact": "./src/centaline/dynamicContact/index.js",//联系人电话
|
|
46
46
|
"dynamicLayout": "./src/centaline/dynamicLayout/index.js",//Layout组件
|
|
47
47
|
"browseVideo": "./src/centaline/browseVideo/index.js",//确认框组件
|
|
48
|
-
|
|
48
|
+
"browseIframe": "./src/centaline/browseIframe/index.js",//URL弹层
|
|
49
|
+
"dynamicViewerFile": "./src/centaline/dynamicViewerFile/index.js",//图片预览框组件
|
|
49
50
|
},
|
|
50
51
|
"plugs": {
|
|
51
52
|
"api": "./src/centaline/api/index.js",//调用API插件
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div style="width:100%;height:100%;">
|
|
3
|
-
<iframe :src="src" ref="iframe"
|
|
3
|
+
<iframe :src="src" ref="iframe" style="width:100%;height:99%;" frameborder="0" @load="sendMessage()"></iframe>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
<script>
|
|
@@ -11,12 +11,58 @@
|
|
|
11
11
|
},
|
|
12
12
|
data() {
|
|
13
13
|
return {
|
|
14
|
-
|
|
15
14
|
};
|
|
16
15
|
},
|
|
17
|
-
mounted () {
|
|
16
|
+
mounted () {
|
|
17
|
+
window.addEventListener('message', this.handleMessage);
|
|
18
18
|
},
|
|
19
19
|
methods: {
|
|
20
|
+
sendMessage () {
|
|
21
|
+
let deviceID= this.getCookie("DeviceID");
|
|
22
|
+
this.$refs.iframe.contentWindow.postMessage({
|
|
23
|
+
functionName: 'cookie',
|
|
24
|
+
params: {
|
|
25
|
+
success: true,
|
|
26
|
+
data: deviceID || 'XXXXXXXXXXX',
|
|
27
|
+
}
|
|
28
|
+
}, '*');
|
|
29
|
+
},
|
|
30
|
+
handleMessage (event) {
|
|
31
|
+
var self=this;
|
|
32
|
+
var data = event.data;
|
|
33
|
+
switch (data.functionName) {
|
|
34
|
+
case 'new':
|
|
35
|
+
self.$emit('new',data.params.data);
|
|
36
|
+
break
|
|
37
|
+
case 'update':
|
|
38
|
+
self.$emit('update');
|
|
39
|
+
break
|
|
40
|
+
case 'delete':
|
|
41
|
+
self.$emit('delete');
|
|
42
|
+
break
|
|
43
|
+
case 'refresh':
|
|
44
|
+
self.$emit('refreshParent');
|
|
45
|
+
break
|
|
46
|
+
case 'close':
|
|
47
|
+
self.$emit('closeDialog');
|
|
48
|
+
break
|
|
49
|
+
case 'title':
|
|
50
|
+
self.$parent.vmodel.title=data.params.data;
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
getCookie(c_name){
|
|
55
|
+
if (document.cookie.length>0){
|
|
56
|
+
let c_start=document.cookie.indexOf(c_name + "=")
|
|
57
|
+
if (c_start!=-1){
|
|
58
|
+
c_start=c_start + c_name.length+1
|
|
59
|
+
let c_end=document.cookie.indexOf(";",c_start)
|
|
60
|
+
if (c_end==-1) c_end=document.cookie.length
|
|
61
|
+
return unescape(document.cookie.substring(c_start,c_end))
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return ""
|
|
65
|
+
},
|
|
20
66
|
}
|
|
21
67
|
}
|
|
22
68
|
</script>
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
methods: {
|
|
17
17
|
close() {
|
|
18
|
-
//this.dialogTableVisible = false;
|
|
19
18
|
this.$emit('close', this);
|
|
20
19
|
if (this.vmodel.content[0].on && typeof this.vmodel.content[0].on["closeDialog"] === "function") {
|
|
21
20
|
this.vmodel.content[0].on["closeDialog"]();
|
|
@@ -25,7 +24,7 @@
|
|
|
25
24
|
//ev.cancelBubble = true;
|
|
26
25
|
//ev.stopPropagation();
|
|
27
26
|
//ev.preventDefault();
|
|
28
|
-
}
|
|
27
|
+
},
|
|
29
28
|
},
|
|
30
29
|
mounted() {
|
|
31
30
|
//this.$el.parentNode.removeChild(this.$el);
|
|
@@ -206,7 +205,7 @@
|
|
|
206
205
|
]
|
|
207
206
|
)
|
|
208
207
|
])
|
|
209
|
-
}
|
|
208
|
+
},
|
|
210
209
|
}
|
|
211
210
|
</script>
|
|
212
211
|
<style scoped>
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
mounted() {
|
|
23
23
|
this.$common.dialogList = this;
|
|
24
24
|
this.overflow = document.body.style.overflow;
|
|
25
|
-
window.addEventListener('message', this.handleMessage)
|
|
26
25
|
},
|
|
27
26
|
computed: {
|
|
28
27
|
zindex: function () {
|
|
@@ -61,27 +60,6 @@
|
|
|
61
60
|
document.removeEventListener("touchmove", mo, false);
|
|
62
61
|
}
|
|
63
62
|
},
|
|
64
|
-
handleMessage (event) {
|
|
65
|
-
var self=this;
|
|
66
|
-
var data = event.data;
|
|
67
|
-
switch (data.functionName) {
|
|
68
|
-
case 'new':
|
|
69
|
-
self.$children[0].vmodel.content[0].on.new(data.params.data);
|
|
70
|
-
break
|
|
71
|
-
case 'update':
|
|
72
|
-
self.$children[0].vmodel.content[0].on.update();
|
|
73
|
-
break
|
|
74
|
-
case 'delete':
|
|
75
|
-
self.$children[0].vmodel.content[0].on.delete();
|
|
76
|
-
break
|
|
77
|
-
case 'refresh':
|
|
78
|
-
self.$children[0].vmodel.content[0].on.refreshParent();
|
|
79
|
-
break
|
|
80
|
-
case 'close':
|
|
81
|
-
self.$children[0].vmodel.content[0].on.closeDialog();
|
|
82
|
-
break
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
63
|
}
|
|
86
64
|
}
|
|
87
65
|
</script>
|
|
@@ -184,11 +184,13 @@ export default {
|
|
|
184
184
|
var index = MediaAlbum[0].medias.findIndex(
|
|
185
185
|
(v) => v.mediaID === file.source.mediaID
|
|
186
186
|
);
|
|
187
|
+
debugger;
|
|
187
188
|
var width = parseInt(window.document.body.clientWidth * 0.8);
|
|
189
|
+
var height = parseInt(window.document.body.clientHeight * 0.8);
|
|
188
190
|
width = width > 1160 ? 1160 : width;
|
|
189
191
|
var dialogOption = {
|
|
190
192
|
title: this.model.label || "预览媒体",
|
|
191
|
-
pane: self.$common.getParentPane(self),
|
|
193
|
+
//pane: self.$common.getParentPane(self),
|
|
192
194
|
content: [
|
|
193
195
|
{
|
|
194
196
|
component: "ct-viewerfile",
|
|
@@ -200,9 +202,7 @@ export default {
|
|
|
200
202
|
// width: self.modelPhotoselect.router.pageWidth + 'px',
|
|
201
203
|
// height: self.modelPhotoselect.router.pageHeight+'px',
|
|
202
204
|
width: width + "px",
|
|
203
|
-
height:
|
|
204
|
-
parseInt(window.document.body.clientHeight * 0.8).toString() +
|
|
205
|
-
"px",
|
|
205
|
+
height: height + "px",
|
|
206
206
|
},
|
|
207
207
|
on: {
|
|
208
208
|
handlePhoto(photoList) {},
|
|
@@ -769,6 +769,7 @@
|
|
|
769
769
|
title: field.pageTitle,
|
|
770
770
|
pane: self.$common.getParentPane(self),
|
|
771
771
|
content: [{
|
|
772
|
+
component: 'ct-iframe',
|
|
772
773
|
attrs: {
|
|
773
774
|
src: submitData[field.submitListField],
|
|
774
775
|
width: field.dialogWidth + 'px',
|
|
@@ -777,6 +778,7 @@
|
|
|
777
778
|
on: {
|
|
778
779
|
new(id) {
|
|
779
780
|
field.flagAddRowAfterAction=true;
|
|
781
|
+
field.flagFreshCurrentRow=false;
|
|
780
782
|
var res={responseData:{content:id}};
|
|
781
783
|
self.updateCurrentRow(field, res);
|
|
782
784
|
self.$forceUpdate();
|
|
@@ -784,6 +786,7 @@
|
|
|
784
786
|
self.$common.closeDialog(dialogOption.dialog);
|
|
785
787
|
},
|
|
786
788
|
update() {
|
|
789
|
+
field.flagAddRowAfterAction=false;
|
|
787
790
|
field.flagFreshCurrentRow=true;
|
|
788
791
|
self.updateCurrentRow(field, null);
|
|
789
792
|
self.$common.closeDialog(dialogOption.dialog);
|
|
@@ -801,7 +804,7 @@
|
|
|
801
804
|
},
|
|
802
805
|
closeDialog() {
|
|
803
806
|
self.$common.closeDialog(dialogOption.dialog);
|
|
804
|
-
}
|
|
807
|
+
},
|
|
805
808
|
}
|
|
806
809
|
}]
|
|
807
810
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
style="height: 100%"
|
|
4
|
+
id="viewer-file"
|
|
5
|
+
ref="viewerfile"
|
|
6
|
+
@contextmenu="handleMouse"
|
|
7
|
+
>
|
|
3
8
|
<el-container style="height: 100%; border: 1px solid #eee">
|
|
4
9
|
<el-aside style="background-color: rgb(238, 241, 246)"
|
|
5
10
|
><div style="height: 100%" class="viewerMenu">
|
|
@@ -40,18 +45,18 @@
|
|
|
40
45
|
</el-aside>
|
|
41
46
|
<el-main ref="displayArea">
|
|
42
47
|
<div
|
|
43
|
-
style="position: relative; width: 100
|
|
48
|
+
style="position: relative; width: 100%"
|
|
49
|
+
:style="{ height: displayAreaHeight - 78 + 'px' }"
|
|
44
50
|
v-if="resultObject"
|
|
45
51
|
>
|
|
46
52
|
<!--VR-->
|
|
47
53
|
<template v-if="itemFile.mediaTypeID == '1'">
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
54
|
+
<iframe
|
|
55
|
+
:src="resultObject"
|
|
56
|
+
:height="displayAreaHeight - 80 + 'px'"
|
|
57
|
+
:width="displayAreaWidth + 'px'"
|
|
58
|
+
>
|
|
59
|
+
</iframe>
|
|
55
60
|
</template>
|
|
56
61
|
<!--Photo-->
|
|
57
62
|
<template v-else-if="itemFile.mediaTypeID == '2'">
|
|
@@ -100,13 +105,13 @@
|
|
|
100
105
|
<template v-else-if="itemFile.mediaTypeID == '6'">
|
|
101
106
|
<template
|
|
102
107
|
v-if="
|
|
103
|
-
'doc,docx,xlsx'.search(
|
|
108
|
+
'doc,docx,xlsx'.search(itemFile.fileExtension.toLowerCase()) >
|
|
104
109
|
-1
|
|
105
110
|
"
|
|
106
111
|
>
|
|
107
112
|
<div
|
|
108
113
|
class="viewerContent"
|
|
109
|
-
style="
|
|
114
|
+
style="max-height: 200px; text-align: center"
|
|
110
115
|
>
|
|
111
116
|
<a :href="resultObject">
|
|
112
117
|
<img :src="itemFile.thumbnailUrl" /><br />{{
|
|
@@ -120,9 +125,12 @@
|
|
|
120
125
|
'pdf'.search(itemFile.fileExtension.toLowerCase()) > -1
|
|
121
126
|
"
|
|
122
127
|
>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
<ct-viewerPDF
|
|
129
|
+
:pdfUrl="resultObject"
|
|
130
|
+
:displayAreaHeight="displayAreaHeight"
|
|
131
|
+
:displayAreaWidth="displayAreaWidth"
|
|
132
|
+
>
|
|
133
|
+
</ct-viewerPDF>
|
|
126
134
|
</template>
|
|
127
135
|
</template>
|
|
128
136
|
<template v-else> 不支持此类型:{{ itemFile.mediaTypeID }} </template>
|
|
@@ -248,12 +256,12 @@ export default {
|
|
|
248
256
|
self.displayAreaWidth = this.DomWidth();
|
|
249
257
|
self.displayArealeft = self.DomLeft();
|
|
250
258
|
self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
|
|
251
|
-
self.displayAreaHeight =self.$refs.displayArea.$el.offsetHeight;
|
|
259
|
+
self.displayAreaHeight = self.$refs.displayArea.$el.offsetHeight;
|
|
252
260
|
window.onresize = () => {
|
|
253
261
|
self.displayAreaWidth = self.DomWidth();
|
|
254
262
|
self.displayArealeft = self.DomLeft();
|
|
255
263
|
self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
|
|
256
|
-
|
|
264
|
+
self.displayAreaHeight = self.$refs.displayArea.$el.offsetHeight;
|
|
257
265
|
};
|
|
258
266
|
|
|
259
267
|
if (
|
|
@@ -267,7 +275,6 @@ export default {
|
|
|
267
275
|
}
|
|
268
276
|
},
|
|
269
277
|
methods: {
|
|
270
|
-
|
|
271
278
|
handleMouse(e) {
|
|
272
279
|
e.preventDefault();
|
|
273
280
|
},
|
|
@@ -404,7 +411,7 @@ export default {
|
|
|
404
411
|
this.$refs.viewerImage.zoom(n);
|
|
405
412
|
},
|
|
406
413
|
},
|
|
407
|
-
};
|
|
414
|
+
};
|
|
408
415
|
</script>
|
|
409
416
|
|
|
410
417
|
<style>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
<template>
|
|
3
|
-
<div class="Imagebox" @mousewheel="bagimg($event)">
|
|
3
|
+
<div class="Imagebox" @mousewheel="bagimg($event)" v-loading="loading">
|
|
4
4
|
<img
|
|
5
|
-
v-loading="loading"
|
|
6
5
|
id="ViewerImage"
|
|
7
6
|
class="scaleimg"
|
|
8
7
|
border="0"
|
|
@@ -44,6 +43,11 @@ export default {
|
|
|
44
43
|
document.getElementById("ViewerImage"),
|
|
45
44
|
document.getElementById("ViewerImage")
|
|
46
45
|
);
|
|
46
|
+
},
|
|
47
|
+
watch: {
|
|
48
|
+
imgUrl(newValue, oldValue) {
|
|
49
|
+
this.loading = true;
|
|
50
|
+
},
|
|
47
51
|
},
|
|
48
52
|
methods: {
|
|
49
53
|
complete() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
<template>
|
|
3
|
-
<div>
|
|
4
|
-
<iframe
|
|
3
|
+
<div v-loading="loading">
|
|
4
|
+
<iframe
|
|
5
5
|
ref="previewPdf"
|
|
6
6
|
id="previewPdf"
|
|
7
7
|
:src="'/static/pdf/web/viewer.html?' + fileUrl"
|
|
8
8
|
:height="displayAreaHeight - 78 + 'px'"
|
|
9
9
|
:width="displayAreaWidth + 'px'"
|
|
10
|
-
@load="
|
|
10
|
+
@load="complete()"
|
|
11
11
|
>
|
|
12
12
|
</iframe>
|
|
13
13
|
</div>
|
|
@@ -21,6 +21,7 @@ export default {
|
|
|
21
21
|
},
|
|
22
22
|
data() {
|
|
23
23
|
return {
|
|
24
|
+
loading: true,
|
|
24
25
|
numPages: 1,
|
|
25
26
|
fileUrl: "",
|
|
26
27
|
};
|
|
@@ -28,19 +29,15 @@ export default {
|
|
|
28
29
|
mounted() {
|
|
29
30
|
this.init(this.pdfUrl);
|
|
30
31
|
},
|
|
31
|
-
created() {
|
|
32
|
-
this.$nextTick(() => {
|
|
33
|
-
// 可以使用回调函数的写法
|
|
34
|
-
// 这个函数中DOM必定渲染完成
|
|
35
|
-
//this.loadFrame();
|
|
36
|
-
});
|
|
32
|
+
created() {
|
|
37
33
|
},
|
|
38
|
-
methods: {
|
|
34
|
+
methods: {
|
|
39
35
|
init(pdfUrl) {
|
|
40
36
|
var self = this;
|
|
41
37
|
self.fileUrl = 'r='+Math.random()+'&file='+encodeURIComponent(pdfUrl);
|
|
42
38
|
},
|
|
43
|
-
|
|
39
|
+
complete() {
|
|
40
|
+
this.loading = false;
|
|
44
41
|
var doc = document.getElementById("previewPdf").contentWindow.document;
|
|
45
42
|
doc.getElementById("download").style.display = "none";
|
|
46
43
|
doc.getElementById("openFile").style.display = "none";
|
|
@@ -50,6 +47,7 @@ export default {
|
|
|
50
47
|
},
|
|
51
48
|
watch: {
|
|
52
49
|
pdfUrl(newValue, oldValue) {
|
|
50
|
+
this.loading = true;
|
|
53
51
|
this.init(newValue);
|
|
54
52
|
},
|
|
55
53
|
},
|