emacroh5lib 1.0.30 → 1.0.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emacroh5lib",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -106,4 +106,4 @@
106
106
  "xlsx": "^0.18.5",
107
107
  "xlsx-style": "^0.8.13"
108
108
  }
109
- }
109
+ }
@@ -6,7 +6,7 @@ import createTaskQueue from 'sync-task-queue'
6
6
 
7
7
  export namespace EMacro {
8
8
 
9
- export const version = "1.0"
9
+ export const version = "1.1"
10
10
 
11
11
  export class File {
12
12
 
@@ -59,9 +59,7 @@ export namespace EMacro {
59
59
  }
60
60
 
61
61
  // 文件上传
62
- public static async uploadFiles(files, postFunc, chunkSize: number = 1024 * 1024 * 1, errFunc = (err) => {
63
- console.error(err);
64
- }) {
62
+ public static async uploadFiles(files, chunkFileHandle, fileComplete = (file) => { }, completeHandle = (files) => { }, chunkSize: number = 1024 * 1024 * 1) {
65
63
 
66
64
  if (files[0].fileName == "" || files[0].fileSize == "" || files[0].fileSize == 0) {
67
65
  throw new Error("文件异常")
@@ -76,7 +74,7 @@ export namespace EMacro {
76
74
  for (let index in fileChunks) {
77
75
  let chunk = fileChunks[Number(index)]
78
76
  const base64 = await File.getBase64(chunk) as string
79
- let data = {
77
+ let chunkFile = {
80
78
  'chunkIndex': Number(index), // 分片位置
81
79
  'chunksLength': chunksLength, // 分片长度
82
80
  'sliceSize': sliceSize, // 分片大小
@@ -86,12 +84,14 @@ export namespace EMacro {
86
84
  'data': base64.split(';base64,')[1], // 文件数据
87
85
  'lastModifiedDate': file.lastModifiedDate, // 最后修改时间
88
86
  'md5': md5,
87
+ 'index': i,
89
88
  'dataType': 'base64' // 数据的类型
90
89
  }
91
- await postFunc(data)
90
+ await chunkFileHandle(chunkFile)
92
91
  }
93
-
92
+ fileComplete(file);
94
93
  }
94
+ completeHandle(files)
95
95
  }
96
96
 
97
97
  public static selectFile(options: any = { multiple: true, accept: "*/*" }): Promise<FileList | null> {
@@ -137,6 +137,23 @@ export namespace EMacro {
137
137
 
138
138
  }
139
139
 
140
+ export const fullScreen = (docElm: any = null) => {
141
+ if (docElm === null) {
142
+ docElm = document.documentElement
143
+ }
144
+ if (docElm.requestFullscreen) {
145
+ docElm.requestFullscreen();
146
+ } else if (docElm.mozRequestFullScreen) {
147
+ docElm.mozRequestFullScreen();
148
+ } else if (docElm.msRequestFullscreen) {
149
+ docElm.msRequestFullscreen();
150
+ } else if (docElm.oRequestFullscreen) {
151
+ docElm.oRequestFullscreen();
152
+ } else if (docElm.webkitRequestFullScreen) {
153
+ docElm.webkitRequestFullScreen();
154
+ }
155
+ }
156
+
140
157
  }
141
158
 
142
159
 
@@ -10,8 +10,6 @@
10
10
  :currentIndex="currentIndex" />
11
11
 
12
12
 
13
-
14
-
15
13
  <div class="list" id="list">
16
14
 
17
15
  <DragResizeView v-for="(rect, index) in rects" :key="index" :isStorage="true" :name="rect.name" :w="rect.width"