@zhijiancloud/bpm 0.0.7 → 0.0.9
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/dist/bpmArea.umd.js +1 -0
- package/dist/bpmAudit.umd.js +1 -1
- package/dist/bpmField.umd.js +6 -6
- package/dist/bpmFormField.umd.js +6 -6
- package/dist/bpmSelect.umd.js +1 -1
- package/dist/bpmSelectCheckItem.umd.js +1 -1
- package/dist/bpmSelectEntranceForm.umd.js +3 -3
- package/dist/bpmSelectFromField.umd.js +1 -1
- package/dist/bpmSubForm.umd.js +1 -1
- package/dist/bpmText.umd.js +1 -1
- package/dist/css/bpmSelectCheckItem.css +1 -1
- package/dist/css/bpmSubForm.css +1 -0
- package/dist/css/index.css +1 -1
- package/dist/index.umd.js +6 -6
- package/package.json +3 -4
- package/components/.DS_Store +0 -0
- package/components/api/batch-loader.js +0 -61
- package/components/api/index.js +0 -108
- package/components/css/bpmAudit.less +0 -13
- package/components/css/bpmMulFile.less +0 -62
- package/components/css/bpmSelectCheckItem.less +0 -4
- package/components/css/bpmSelectEntranceForm.less +0 -62
- package/components/css/bpmSelectFromForm.less +0 -10
- package/components/css/bpmSelectFromId.less +0 -33
- package/components/css/bpmSelectHouseOwner.less +0 -30
- package/components/css/bpmSignature.less +0 -40
- package/components/css/bpmText.less +0 -39
- package/components/css/common.less +0 -43
- package/components/css/demo.less +0 -3
- package/components/css/demo2.less +0 -3
- package/components/css/index.less +0 -8
- package/components/lib/bpmAudit/index.js +0 -7
- package/components/lib/bpmAudit/src/main.vue +0 -117
- package/components/lib/bpmAudit/src/part/auditor/audit-new.vue +0 -534
- package/components/lib/bpmAudit/src/part/auditor/audit-select.vue +0 -127
- package/components/lib/bpmAudit/src/part/auditor/audit-with-others.vue +0 -634
- package/components/lib/bpmAudit/src/part/auditor.vue +0 -54
- package/components/lib/bpmAudit/src/part/editor.vue +0 -318
- package/components/lib/bpmAudit/src/part/reader.vue +0 -218
- package/components/lib/bpmDateTime/index.js +0 -7
- package/components/lib/bpmDateTime/src/main.vue +0 -82
- package/components/lib/bpmDateTime/src/part/editor.vue +0 -126
- package/components/lib/bpmDateTime/src/part/reader.vue +0 -55
- package/components/lib/bpmField/index.js +0 -7
- package/components/lib/bpmField/src/main.vue +0 -31
- package/components/lib/bpmFieldsFilter/index.js +0 -7
- package/components/lib/bpmFieldsFilter/src/main.vue +0 -324
- package/components/lib/bpmFormField/index.js +0 -7
- package/components/lib/bpmFormField/src/lib/form_mixin.js +0 -818
- package/components/lib/bpmFormField/src/lib/mixin.js +0 -245
- package/components/lib/bpmFormField/src/main.vue +0 -35
- package/components/lib/bpmMulFile/index.js +0 -7
- package/components/lib/bpmMulFile/src/main.vue +0 -85
- package/components/lib/bpmMulFile/src/part/editor.vue +0 -433
- package/components/lib/bpmMulFile/src/part/lib/compressImageUtils.js +0 -226
- package/components/lib/bpmMulFile/src/part/lib/utils.js +0 -281
- package/components/lib/bpmMulFile/src/part/reader.vue +0 -282
- package/components/lib/bpmMulImage/index.js +0 -7
- package/components/lib/bpmMulImage/src/main.vue +0 -86
- package/components/lib/bpmMulImage/src/part/editor.vue +0 -449
- package/components/lib/bpmMulImage/src/part/lib/compressImageUtils.js +0 -226
- package/components/lib/bpmMulImage/src/part/lib/utils.js +0 -281
- package/components/lib/bpmMulImage/src/part/reader.vue +0 -181
- package/components/lib/bpmNumber/index.js +0 -7
- package/components/lib/bpmNumber/src/main.vue +0 -83
- package/components/lib/bpmNumber/src/part/editor.vue +0 -47
- package/components/lib/bpmNumber/src/part/reader.vue +0 -7
- package/components/lib/bpmSelect/index.js +0 -7
- package/components/lib/bpmSelect/src/main.vue +0 -90
- package/components/lib/bpmSelect/src/part/editor.vue +0 -75
- package/components/lib/bpmSelect/src/part/reader.vue +0 -53
- package/components/lib/bpmSelectCheckItem/index.js +0 -7
- package/components/lib/bpmSelectCheckItem/src/main.vue +0 -101
- package/components/lib/bpmSelectCheckItem/src/part/editor.vue +0 -103
- package/components/lib/bpmSelectCheckItem/src/part/reader.vue +0 -7
- package/components/lib/bpmSelectEntranceForm/index.js +0 -7
- package/components/lib/bpmSelectEntranceForm/src/main.vue +0 -529
- package/components/lib/bpmSelectFromField/index.js +0 -7
- package/components/lib/bpmSelectFromField/src/main.vue +0 -98
- package/components/lib/bpmSelectFromField/src/part/editor.vue +0 -96
- package/components/lib/bpmSelectFromField/src/part/reader.vue +0 -7
- package/components/lib/bpmSelectFromForm/index.js +0 -7
- package/components/lib/bpmSelectFromForm/src/main.vue +0 -103
- package/components/lib/bpmSelectFromForm/src/part/editor.vue +0 -178
- package/components/lib/bpmSelectFromForm/src/part/reader.vue +0 -7
- package/components/lib/bpmSelectFromId/index.js +0 -7
- package/components/lib/bpmSelectFromId/src/main.vue +0 -102
- package/components/lib/bpmSelectFromId/src/part/editor.vue +0 -260
- package/components/lib/bpmSelectFromId/src/part/reader.vue +0 -7
- package/components/lib/bpmSelectHouseOwner/index.js +0 -7
- package/components/lib/bpmSelectHouseOwner/src/main.vue +0 -102
- package/components/lib/bpmSelectHouseOwner/src/part/editor.vue +0 -101
- package/components/lib/bpmSelectHouseOwner/src/part/reader.vue +0 -17
- package/components/lib/bpmSelectIssue/index.js +0 -7
- package/components/lib/bpmSelectIssue/src/main.vue +0 -180
- package/components/lib/bpmSignature/index.js +0 -7
- package/components/lib/bpmSignature/src/main.vue +0 -248
- package/components/lib/bpmSubForm/index.js +0 -7
- package/components/lib/bpmSubForm/src/main.vue +0 -203
- package/components/lib/bpmText/index.ts +0 -13
- package/components/lib/bpmText/src/main.vue +0 -87
- package/components/lib/bpmText/src/part/editor.vue +0 -104
- package/components/lib/bpmText/src/part/reader.vue +0 -7
- package/components/lib/bpmTime/index.js +0 -7
- package/components/lib/bpmTime/src/main.vue +0 -83
- package/components/lib/bpmTime/src/part/editor.vue +0 -55
- package/components/lib/bpmTime/src/part/reader.vue +0 -24
- package/components/lib/demo/index.js +0 -7
- package/components/lib/demo/src/main.vue +0 -11
- package/components/lib/demo2/index.js +0 -7
- package/components/lib/demo2/src/main.vue +0 -11
- package/components/lib/field-const.js +0 -472
- package/components/lib/index.ts +0 -102
- package/components/lib/mixins/RemoteSelectReader.vue +0 -55
- package/components/lib/mixins/TextReader.vue +0 -22
- package/components/lib/net.js +0 -21
- package/components/lib/utils.js +0 -89
- package/components/mixins/field_base_mixin.vue +0 -188
- package/components/sfc.d.ts +0 -27
- package/components/vendor/draw.js +0 -240
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import _ from "lodash"
|
|
2
|
-
import $ from "jquery"
|
|
3
|
-
import Exif from 'exif-js'
|
|
4
|
-
|
|
5
|
-
export function isImageFile(item) {
|
|
6
|
-
return _.startsWith(item.type, "image");
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function fillFont(font) {
|
|
10
|
-
let tmpl = "";
|
|
11
|
-
if ($(".viewer-in .address").length) {
|
|
12
|
-
if (font) tmpl = '<i class="fa fa-map-marker"></i>' + font;
|
|
13
|
-
$(".viewer-in .address").html(tmpl);
|
|
14
|
-
} else {
|
|
15
|
-
if (font)
|
|
16
|
-
tmpl =
|
|
17
|
-
'<div class="address"><i class="fa fa-map-marker"></i>' +
|
|
18
|
-
font +
|
|
19
|
-
"</div>";
|
|
20
|
-
$(".viewer-in .viewer-footer").append(tmpl);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export async function showGPSInfo(item) {
|
|
24
|
-
fillFont("")
|
|
25
|
-
if (!isImageFile(item)) return;
|
|
26
|
-
let res = await zj.net.w.noapi({
|
|
27
|
-
url: `/platform/v1/papi/app_file/download/?file_md5=${item.md5}&webp=0`
|
|
28
|
-
});
|
|
29
|
-
let preview_url = _.get(res, "url_list.0.path.0");
|
|
30
|
-
|
|
31
|
-
fillFont("定位信息加载中...")
|
|
32
|
-
let img = document.createElement('img')
|
|
33
|
-
img.src = preview_url
|
|
34
|
-
let that = this
|
|
35
|
-
setTimeout(() => {
|
|
36
|
-
try {
|
|
37
|
-
$.ajax({
|
|
38
|
-
url: `${preview_url}?exif`,
|
|
39
|
-
success: data => {
|
|
40
|
-
if (data && data.GPSLatitude) {
|
|
41
|
-
that.setPs(data)
|
|
42
|
-
} else {
|
|
43
|
-
Exif.getData(img, function () {
|
|
44
|
-
var info = Exif.getAllTags(this)
|
|
45
|
-
console.log("info", info)
|
|
46
|
-
that.setPs(info)
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
error: () => {
|
|
53
|
-
Exif.getData(img, function () {
|
|
54
|
-
var info = Exif.getAllTags(this)
|
|
55
|
-
console.log("info", info)
|
|
56
|
-
that.setPs(info)
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
} catch (error) {
|
|
62
|
-
Exif.getData(img, function () {
|
|
63
|
-
var info = Exif.getAllTags(this)
|
|
64
|
-
that.setPs(info)
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
}, 600)
|
|
68
|
-
// 获取七牛的图片信息
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export function getFileType(filePath) {
|
|
75
|
-
console.log("filePath", filePath)
|
|
76
|
-
var startIndex = filePath.lastIndexOf(".");
|
|
77
|
-
if (startIndex != -1)
|
|
78
|
-
return filePath
|
|
79
|
-
.substring(startIndex + 1, filePath.length)
|
|
80
|
-
.toLowerCase();
|
|
81
|
-
else return "";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function gethashcode() {
|
|
85
|
-
//定义一个时间戳,计算与1970年相差的毫秒数 用来获得唯一时间
|
|
86
|
-
let timestamp = new Date().valueOf();
|
|
87
|
-
let myRandom = randomWord(false, 6);
|
|
88
|
-
let hashcode = hashCode(myRandom + timestamp.toString());
|
|
89
|
-
return hashcode;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
function randomWord(randomFlag, min, max) {
|
|
94
|
-
let str = "",
|
|
95
|
-
range = min,
|
|
96
|
-
arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
|
|
97
|
-
// 随机产生
|
|
98
|
-
if (randomFlag) {
|
|
99
|
-
range = Math.round(Math.random() * (max - min)) + min;
|
|
100
|
-
}
|
|
101
|
-
for (let i = 0; i < range; i++) {
|
|
102
|
-
let pos = Math.round(Math.random() * (arr.length - 1));
|
|
103
|
-
str += arr[pos];
|
|
104
|
-
}
|
|
105
|
-
return str;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function hashCode(str) {
|
|
109
|
-
let h = 0;
|
|
110
|
-
let len = str.length;
|
|
111
|
-
let t = 2147483648;
|
|
112
|
-
for (let i = 0; i < len; i++) {
|
|
113
|
-
h = 31 * h + str.charCodeAt(i);
|
|
114
|
-
if (h > 2147483647) h %= t; //java int溢出则取模
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return h;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/*
|
|
122
|
-
浏览器和APP间的操作代理
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
class NoopAgent {
|
|
126
|
-
constructor() {
|
|
127
|
-
this.bridge = null;
|
|
128
|
-
this._vm = null;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
register(){
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
invoke(){
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
registerHandler(){
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
class AndroidAgent extends NoopAgent{
|
|
145
|
-
register(){
|
|
146
|
-
let init = (bridge)=>{
|
|
147
|
-
this.bridge = bridge
|
|
148
|
-
bridge.init()
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if(window.WebViewJavascriptBridge){
|
|
152
|
-
init(window.WebViewJavascriptBridge)
|
|
153
|
-
}else{
|
|
154
|
-
document.addEventListener(
|
|
155
|
-
'WebViewJavascriptBridgeReady',
|
|
156
|
-
function() {
|
|
157
|
-
init(window.WebViewJavascriptBridge)
|
|
158
|
-
},
|
|
159
|
-
false
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
invoke(action, data={}, resolve=_.noop){
|
|
165
|
-
if(this.bridge){
|
|
166
|
-
this.bridge.callHandler(
|
|
167
|
-
'jsCallNative',
|
|
168
|
-
{ action, data},
|
|
169
|
-
resolve
|
|
170
|
-
)
|
|
171
|
-
}else{
|
|
172
|
-
resolve()
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
//action 执行函数,resolve,app回调函数
|
|
177
|
-
registerHandler(action,resolve=_.noop,vm_flag=_.noop){
|
|
178
|
-
let action_name = action;
|
|
179
|
-
this._vm = vm_flag
|
|
180
|
-
|
|
181
|
-
window[action] = (res) => {
|
|
182
|
-
if( this._vm[action_name]){
|
|
183
|
-
this._vm[action_name](res)
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
console.log("Android this.bridge",this.bridge)
|
|
188
|
-
|
|
189
|
-
if(this.bridge){
|
|
190
|
-
this.bridge.registerHandler(
|
|
191
|
-
action_name,
|
|
192
|
-
function(data,resolve){
|
|
193
|
-
window[action](data);
|
|
194
|
-
resolve()
|
|
195
|
-
}
|
|
196
|
-
)
|
|
197
|
-
}else{
|
|
198
|
-
resolve()
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
class IosAgent extends NoopAgent{
|
|
204
|
-
register(){
|
|
205
|
-
let init = (bridge)=>{
|
|
206
|
-
this.bridge = bridge
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
console.log("window.WebViewJavascriptBridge",window.WebViewJavascriptBridge)
|
|
210
|
-
|
|
211
|
-
if (window.WebViewJavascriptBridge) { return init(window.WebViewJavascriptBridge); }
|
|
212
|
-
|
|
213
|
-
console.log("window.WVJBCallbacks",window.WVJBCallbacks)
|
|
214
|
-
if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(init); }
|
|
215
|
-
window.WVJBCallbacks = [init];
|
|
216
|
-
var WVJBIframe = document.createElement('iframe');
|
|
217
|
-
WVJBIframe.style.display = 'none';
|
|
218
|
-
WVJBIframe.src = 'https://__bridge_loaded__';
|
|
219
|
-
document.documentElement.appendChild(WVJBIframe);
|
|
220
|
-
setTimeout(function() { document.documentElement.removeChild(WVJBIframe)
|
|
221
|
-
if (window.WebViewJavascriptBridge) { return init(window.WebViewJavascriptBridge); }
|
|
222
|
-
}, 0)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
invoke(action, data={}, resolve=_.noop){
|
|
226
|
-
console.error("agent invoke", action, data)
|
|
227
|
-
if(this.bridge){
|
|
228
|
-
this.bridge.callHandler(
|
|
229
|
-
'jsCallNative',
|
|
230
|
-
{ action, data},
|
|
231
|
-
resolve
|
|
232
|
-
)
|
|
233
|
-
}else{
|
|
234
|
-
resolve()
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
//action 执行函数,resolve,app回调函数
|
|
239
|
-
registerHandler(action,resolve=_.noop,vm_flag=_.noop){
|
|
240
|
-
let action_name = action;
|
|
241
|
-
this._vm = vm_flag
|
|
242
|
-
|
|
243
|
-
window[action] = (res) => {
|
|
244
|
-
if( this._vm[action_name]){
|
|
245
|
-
this._vm[action_name](res)
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
console.log("IOS this.bridge",this.bridge)
|
|
250
|
-
|
|
251
|
-
if(this.bridge){
|
|
252
|
-
console.log("action_name",action_name)
|
|
253
|
-
this.bridge.registerHandler(
|
|
254
|
-
action_name,
|
|
255
|
-
function(data,resolve){
|
|
256
|
-
console.log('OC調用JS方法成功', data)
|
|
257
|
-
window[action](data);
|
|
258
|
-
resolve()
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
}else{
|
|
262
|
-
resolve()
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
export function getAgent() {
|
|
269
|
-
let u = navigator.userAgent
|
|
270
|
-
|
|
271
|
-
if(/Mac\s+OS\s+X/.test(u)){
|
|
272
|
-
return new IosAgent()
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if(/Android/.test(u)){
|
|
276
|
-
return new AndroidAgent()
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return new NoopAgent()
|
|
280
|
-
}
|
|
281
|
-
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="bpm-mul-file-reader">
|
|
4
|
-
<div v-show="!value || value.length == 0">
|
|
5
|
-
暂无文件或图片
|
|
6
|
-
</div>
|
|
7
|
-
<viewer :images="photo" rebuild @inited="inited" ref="viewer">
|
|
8
|
-
<span v-for="item in value" :key="item.md5">
|
|
9
|
-
<div class="file-box" v-if="isImageFile(item)">
|
|
10
|
-
<div class="file-icon" style="height: 20px;border: 1px dashed #ececec;">
|
|
11
|
-
<img :src="fileLink(item, 600)" alt />
|
|
12
|
-
</div>
|
|
13
|
-
<div
|
|
14
|
-
class="relative-position tc file-link ellipsis"
|
|
15
|
-
:title="item.name"
|
|
16
|
-
>
|
|
17
|
-
{{ item.name }}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
<span
|
|
21
|
-
target="_blank"
|
|
22
|
-
v-else
|
|
23
|
-
class="file-box"
|
|
24
|
-
@click="reviewOnMobile(item)"
|
|
25
|
-
>
|
|
26
|
-
<div class="text-center text-faded file-icon" @click="preview(item)">
|
|
27
|
-
<i
|
|
28
|
-
aria-hidden="true"
|
|
29
|
-
class="q-icon fa fa-file-pdf-o"
|
|
30
|
-
:class="getFileTypeClass(item)"
|
|
31
|
-
></i>
|
|
32
|
-
</div>
|
|
33
|
-
<div
|
|
34
|
-
class="relative-position tc file-link ellipsis"
|
|
35
|
-
:title="item.name"
|
|
36
|
-
@click="preview(item)"
|
|
37
|
-
>
|
|
38
|
-
{{ item.name }}
|
|
39
|
-
</div>
|
|
40
|
-
<div class="operation-box">
|
|
41
|
-
<a href="javascript:;" class="operation-btn" v-if="!isDwg(item)" @click="preview(item)"
|
|
42
|
-
>预览</a
|
|
43
|
-
>
|
|
44
|
-
<span v-if="!isDwg(item)">|</span>
|
|
45
|
-
<a
|
|
46
|
-
href="javascript:;"
|
|
47
|
-
class="operation-btn"
|
|
48
|
-
@click="download(item)"
|
|
49
|
-
>下载</a
|
|
50
|
-
>
|
|
51
|
-
|
|
52
|
-
</div>
|
|
53
|
-
</span>
|
|
54
|
-
</span>
|
|
55
|
-
</viewer>
|
|
56
|
-
<el-dialog
|
|
57
|
-
:visible.sync="opened"
|
|
58
|
-
class="file-modal"
|
|
59
|
-
:before-close="onHide"
|
|
60
|
-
@open="onOpen"
|
|
61
|
-
title="文件预览"
|
|
62
|
-
:fullscreen="true"
|
|
63
|
-
v-bind="$attrs"
|
|
64
|
-
v-on="$listeners"
|
|
65
|
-
>
|
|
66
|
-
<iframe :src="officeUrl" width="99%" :height="windowH"></iframe>
|
|
67
|
-
</el-dialog>
|
|
68
|
-
<img id="image" src="" style="display: none" />
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<script>
|
|
74
|
-
import Vue from "vue";
|
|
75
|
-
import _ from "lodash";
|
|
76
|
-
import Viewer from "v-viewer";
|
|
77
|
-
import {Dialog} from "element-ui";
|
|
78
|
-
Vue.use(Dialog);
|
|
79
|
-
|
|
80
|
-
import "viewerjs/dist/viewer.css";
|
|
81
|
-
// import {wvAgent} from "./lib/utils"
|
|
82
|
-
import {urlAppendParam} from "../../../utils"
|
|
83
|
-
import { showGPSInfo, getFileType, gethashcode } from "./lib/utils";
|
|
84
|
-
|
|
85
|
-
Vue.use(Viewer);
|
|
86
|
-
Viewer.setDefaults({
|
|
87
|
-
Options: {
|
|
88
|
-
inline: true,
|
|
89
|
-
button: true,
|
|
90
|
-
navbar: true,
|
|
91
|
-
title: true,
|
|
92
|
-
toolbar: true,
|
|
93
|
-
tooltip: true,
|
|
94
|
-
movable: true,
|
|
95
|
-
zoomable: true,
|
|
96
|
-
rotatable: true,
|
|
97
|
-
scalable: true,
|
|
98
|
-
transition: false,
|
|
99
|
-
fullscreen: false,
|
|
100
|
-
keyboard: true,
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
Vue.use(Dialog);
|
|
104
|
-
|
|
105
|
-
export default {
|
|
106
|
-
props: ["value", "fieldConf", "row"],
|
|
107
|
-
data() {
|
|
108
|
-
return {
|
|
109
|
-
vueLightId1: null,
|
|
110
|
-
photo: [],
|
|
111
|
-
officeUrl: "",
|
|
112
|
-
opened: false,
|
|
113
|
-
windowH: 0,
|
|
114
|
-
type: "small"
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
computed: {
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
watch: {
|
|
121
|
-
value() {
|
|
122
|
-
this.setPhoto();
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
created () {
|
|
126
|
-
// wvAgent.register()
|
|
127
|
-
},
|
|
128
|
-
mounted() {
|
|
129
|
-
let time = new Date().getTime();
|
|
130
|
-
this.vueLightId1 = time + 1;
|
|
131
|
-
this.setPhoto();
|
|
132
|
-
this.windowH = (document.body.clientHeight / 100) * 99 - 50;
|
|
133
|
-
},
|
|
134
|
-
methods: {
|
|
135
|
-
isDwg(item) {
|
|
136
|
-
return _.endsWith(item.name, ".dwg");
|
|
137
|
-
},
|
|
138
|
-
inited(viewer) {
|
|
139
|
-
viewer.options.view = this.view;
|
|
140
|
-
this.$viewer = viewer;
|
|
141
|
-
},
|
|
142
|
-
view(e) {
|
|
143
|
-
let index = e.detail.index;
|
|
144
|
-
let value = _.filter(this.value, (item) => {
|
|
145
|
-
return this.isImageFile(item);
|
|
146
|
-
});
|
|
147
|
-
let item = _.get(value, index);
|
|
148
|
-
showGPSInfo(item);
|
|
149
|
-
},
|
|
150
|
-
setPhoto() {
|
|
151
|
-
let value = [];
|
|
152
|
-
_.each(this.value, (item) => {
|
|
153
|
-
if (this.isImageFile(item)) {
|
|
154
|
-
let link = this.fileLink(item, 600);
|
|
155
|
-
value.push(link);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
this.photo = value;
|
|
159
|
-
},
|
|
160
|
-
getFileTypeClass(item) {
|
|
161
|
-
let fileSuffix = getFileType(item.type);
|
|
162
|
-
if (item.type == "application/pdf") fileSuffix = "fa-file-pdf-o";
|
|
163
|
-
let typeMap = {
|
|
164
|
-
document: "fa-file-word-o",
|
|
165
|
-
sheet: "fa-file-excel-o",
|
|
166
|
-
doc: "fa-file-word-o",
|
|
167
|
-
docx: "fa-file-word-o",
|
|
168
|
-
xlsx: "fa-file-excel-o",
|
|
169
|
-
"ms-excel": "fa-file-excel-o",
|
|
170
|
-
dwg: "fa-file-image-o",
|
|
171
|
-
png: "fa-file-image-o",
|
|
172
|
-
jpg: "fa-file-image-o",
|
|
173
|
-
};
|
|
174
|
-
return _.get(typeMap, fileSuffix);
|
|
175
|
-
},
|
|
176
|
-
isImageFile(item) {
|
|
177
|
-
return _.startsWith(item.type, "image");
|
|
178
|
-
},
|
|
179
|
-
fileLink(item) {
|
|
180
|
-
if (!item || !item.md5) return;
|
|
181
|
-
let isImg = this.isImageFile(item);
|
|
182
|
-
let args = {
|
|
183
|
-
file_md5: item.md5,
|
|
184
|
-
};
|
|
185
|
-
// let token = zj.utils.pageParam().token;
|
|
186
|
-
// if (token) {
|
|
187
|
-
// args.token = token;
|
|
188
|
-
// }
|
|
189
|
-
|
|
190
|
-
if (!isImg) {
|
|
191
|
-
args.is_file = 1;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
let result = urlAppendParam(
|
|
195
|
-
"/platform/v1/papi/web_file/image_view/",
|
|
196
|
-
args
|
|
197
|
-
);
|
|
198
|
-
return result;
|
|
199
|
-
},
|
|
200
|
-
reviewOnMobile(item) {
|
|
201
|
-
// if (this.is_mobile) {
|
|
202
|
-
// this.preview(item);
|
|
203
|
-
// }
|
|
204
|
-
},
|
|
205
|
-
async preview(item) {
|
|
206
|
-
let res = await zj.net.w.noapi({
|
|
207
|
-
url: `/platform/v1/papi/app_file/download/?file_md5=${item.md5}&webp=0`,
|
|
208
|
-
});
|
|
209
|
-
let preview_url = _.get(res, "url_list.0.path.0");
|
|
210
|
-
let fileSuffix = getFileType(preview_url);
|
|
211
|
-
if (item.type == "application/pdf") fileSuffix = "pdf";
|
|
212
|
-
if (item.type == "application/vnd.ms-excel") fileSuffix = "ms-excel";
|
|
213
|
-
let typeMap = {
|
|
214
|
-
document: "Word.Document",
|
|
215
|
-
docx: "Word.Document",
|
|
216
|
-
doc: "Word.Document",
|
|
217
|
-
sheet: "Excel.Sheet",
|
|
218
|
-
pdf: "pdf",
|
|
219
|
-
xlsx: "Excel.Sheet",
|
|
220
|
-
"ms-excel": "Excel.Sheet",
|
|
221
|
-
};
|
|
222
|
-
let hash = gethashcode();
|
|
223
|
-
let url = `https://${window.location.host}/zj_of/v1/papi/file/read_only/?md5=${item.md5}&type=${typeMap[fileSuffix]}&sign=${hash}`;
|
|
224
|
-
let result = await zj.net.w.noapi({
|
|
225
|
-
url: `/zj_of/v1/papi/file/using_engine/`,
|
|
226
|
-
});
|
|
227
|
-
if (result.engine != "wps")
|
|
228
|
-
url =
|
|
229
|
-
"https://view.officeapps.live.com/op/embed.aspx?src=" +
|
|
230
|
-
encodeURIComponent(preview_url);
|
|
231
|
-
console.log("url", url)
|
|
232
|
-
if (fileSuffix == "pdf") {
|
|
233
|
-
let index = preview_url.lastIndexOf(".com");
|
|
234
|
-
preview_url = preview_url.substring(index + 4, preview_url.length);
|
|
235
|
-
preview_url = encodeURIComponent(preview_url);
|
|
236
|
-
url = `/public/bpm/app/view_pdf.html?url=${preview_url}`;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
this.officeUrl = url;
|
|
240
|
-
this.opened = true;
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
//分享
|
|
244
|
-
async share(item) {
|
|
245
|
-
let res = await zj.net.w.noapi({
|
|
246
|
-
url: `/platform/v1/papi/app_file/download/?file_md5=${item.md5}&webp=0`,
|
|
247
|
-
});
|
|
248
|
-
return res
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
//打开预览页
|
|
252
|
-
async toShare(fileInfo) {
|
|
253
|
-
console.log("fileInfo",fileInfo)
|
|
254
|
-
// wvAgent.invoke("sharePage", {
|
|
255
|
-
// page_url: fileInfo.share_url,
|
|
256
|
-
// title: fileInfo.title || "",
|
|
257
|
-
// logo_url: fileInfo.logo_url || "",
|
|
258
|
-
// context: fileInfo.context || "",
|
|
259
|
-
// });
|
|
260
|
-
},
|
|
261
|
-
async download(item) {
|
|
262
|
-
window.open(
|
|
263
|
-
`/platform/v1/papi/web_file/web_download/?file_md5=${item.md5}`
|
|
264
|
-
);
|
|
265
|
-
},
|
|
266
|
-
getFileType(filePath) {
|
|
267
|
-
var startIndex = filePath.lastIndexOf(".");
|
|
268
|
-
if (startIndex != -1)
|
|
269
|
-
return filePath
|
|
270
|
-
.substring(startIndex + 1, filePath.length)
|
|
271
|
-
.toLowerCase();
|
|
272
|
-
else return "";
|
|
273
|
-
},
|
|
274
|
-
onHide() {
|
|
275
|
-
this.opened = false;
|
|
276
|
-
},
|
|
277
|
-
onOpen() {
|
|
278
|
-
this.opened = true;
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
};
|
|
282
|
-
</script>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
class="bpm-mul-image"
|
|
4
|
-
v-model="curVal"
|
|
5
|
-
:is="curComponent"
|
|
6
|
-
:fieldConf="fieldConf"
|
|
7
|
-
:row="row"
|
|
8
|
-
:mode="mode"
|
|
9
|
-
:uiType="uiType"
|
|
10
|
-
v-bind="$attrs"
|
|
11
|
-
v-on="$listeners"
|
|
12
|
-
>
|
|
13
|
-
</component>
|
|
14
|
-
</template>
|
|
15
|
-
<script>
|
|
16
|
-
import editorComponent from "./part/editor.vue";
|
|
17
|
-
import readerComponent from "./part/reader.vue";
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
name: "BpmMulImage",
|
|
21
|
-
components: {
|
|
22
|
-
editorComponent,
|
|
23
|
-
readerComponent
|
|
24
|
-
},
|
|
25
|
-
props: {
|
|
26
|
-
value: {
|
|
27
|
-
type: [String, Array],
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
fieldConf: {
|
|
31
|
-
type: Object,
|
|
32
|
-
default() {
|
|
33
|
-
return {};
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
row: {
|
|
37
|
-
type: Object,
|
|
38
|
-
default() {
|
|
39
|
-
return {};
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
mode: {
|
|
43
|
-
type: String,
|
|
44
|
-
default() {
|
|
45
|
-
return "view";
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
uiType: {
|
|
49
|
-
type: String,
|
|
50
|
-
default() {
|
|
51
|
-
return "default";
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
data () {
|
|
56
|
-
return {
|
|
57
|
-
curVal: ""
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
computed: {
|
|
61
|
-
curComponent() {
|
|
62
|
-
if (this.mode == "view") {
|
|
63
|
-
return readerComponent;
|
|
64
|
-
} else {
|
|
65
|
-
return editorComponent;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
watch: {
|
|
70
|
-
curVal(val){
|
|
71
|
-
this.$emit("input", val)
|
|
72
|
-
this.$emit("change", val);
|
|
73
|
-
},
|
|
74
|
-
value(){
|
|
75
|
-
this.curVal = this.value
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
mounted () {
|
|
80
|
-
this.curVal = this.value
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
</script>
|
|
84
|
-
|
|
85
|
-
<style>
|
|
86
|
-
</style>
|