emacroh5lib 1.0.35 → 1.0.38

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.35",
3
+ "version": "1.0.38",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -88,12 +88,6 @@
88
88
  alt: {
89
89
  type: String,
90
90
  default: "加载失败...",
91
- },
92
- loadComplete: {
93
- type: Function,
94
- default: function () {
95
- console.log("loadComplete");
96
- }
97
91
  }
98
92
  },
99
93
  computed: {
@@ -161,12 +155,12 @@
161
155
  height: `${imageObject.height}px`,
162
156
  };
163
157
 
164
- resolve(event);
158
+ resolve("");
165
159
  imageObject.onload = null
166
160
  };
167
161
 
168
162
  imageObject.onerror = function (event) {
169
- resolve(event);
163
+ resolve("");
170
164
  imageObject.onerror = null
171
165
  };
172
166
 
@@ -175,18 +169,27 @@
175
169
  );
176
170
  });
177
171
 
178
- // Promise.all(promises).then((data) => {
179
- // this.image = this.$refs["duoViewerImage"];
180
- // this.initDrag();
181
- // const { width, height } = $this.listDataCache[index];
182
- // $this.setStyleByName($this.image, "width", width);
183
- // $this.setStyleByName($this.image, "height", height);
184
- // })
172
+ Promise.all(promises).then((data) => {
173
+ // this.image = this.$refs["duoViewerImage"];
174
+ // this.initDrag();
175
+ // const { width, height } = $this.listDataCache[index];
176
+ // $this.setStyleByName($this.image, "width", width);
177
+ // $this.setStyleByName($this.image, "height", height);
178
+
179
+ $this.image = $this.$refs["duoViewerImage"];
180
+ console.log("Promise.all", $this.image);
181
+ $this.initDrag();
182
+ this.$emit("loadComplete");
183
+ const { width, height } = $this.listDataCache[index];
184
+ $this.setStyleByName($this.image, "width", width);
185
+ $this.setStyleByName($this.image, "height", height);
186
+ })
185
187
 
186
188
  Promise.race(promises).then((data) => {
187
- $this.image = this.$refs["duoViewerImage"];
189
+ $this.image = $this.$refs["duoViewerImage"];
190
+ console.log("Promise.race", $this.image);
188
191
  $this.initDrag();
189
- $this.loadComplete()
192
+ this.$emit("loadComplete");
190
193
  const { width, height } = $this.listDataCache[index];
191
194
  $this.setStyleByName($this.image, "width", width);
192
195
  $this.setStyleByName($this.image, "height", height);
@@ -356,9 +359,10 @@
356
359
 
357
360
  // Zoom action
358
361
  zoom(type) {
359
- let image = this.image,
360
- w = +this.getStyleByName(image, "width").split("px")[0],
361
- h = +this.getStyleByName(image, "height").split("px")[0];
362
+ let image = this.image;
363
+ console.log("zoom缩放", image);
364
+ let w = +this.getStyleByName(image, "width").split("px")[0];
365
+ let h = +this.getStyleByName(image, "height").split("px")[0];
362
366
 
363
367
  if (h <= 20 && type === "out") return;
364
368
 
@@ -63,12 +63,12 @@ export default class TestView extends Vue {
63
63
 
64
64
  public currentIndex: Number = 0; // 打开图片查看器时,需要定位到的图片的索引
65
65
  public srcList: Array<String> = [
66
- "http://172.16.1.83:18019/EMacroApi/GetFile?type=0&path=C:\\MES\\EMacroAndroidServer_Windows_v1.1\\EMacroAssets\\file\\%E6%97%A0%E6%A0%87%E9%A2%98.png",
67
- "https://scpic.chinaz.net/files/pic/pic9/202203/apic39703.jpg",
68
- "https://scpic.chinaz.net/files/pic/pic9/202005/zzpic24899.jpg",
69
- "https://scpic.chinaz.net/files/pic/pic9/202109/bpic24244.jpg",
70
- "https://scpic.chinaz.net/files/pic/pic9/202110/hpic4529.jpg",
71
- "https://scpic.chinaz.net/files/pic/pic9/201912/zzpic22106.jpg",
66
+ // "http://172.16.1.83:18019/EMacroApi/GetFile?type=0&path=C:\\MES\\EMacroAndroidServer_Windows_v1.1\\EMacroAssets\\file\\%E6%97%A0%E6%A0%87%E9%A2%98.png",
67
+ // "https://scpic.chinaz.net/files/pic/pic9/202203/apic39703.jpg",
68
+ // "https://scpic.chinaz.net/files/pic/pic9/202005/zzpic24899.jpg",
69
+ // "https://scpic.chinaz.net/files/pic/pic9/202109/bpic24244.jpg",
70
+ // "https://scpic.chinaz.net/files/pic/pic9/202110/hpic4529.jpg",
71
+ // "https://scpic.chinaz.net/files/pic/pic9/201912/zzpic22106.jpg",
72
72
  "https://scpic.chinaz.net/files/pic/pic9/202202/apic38580.jpg",
73
73
  ] // 图片查看器数据集
74
74
  public showViewer: Boolean = false // 是否打开图片查看器