zydx-plus 1.35.547 → 1.35.548

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": "zydx-plus",
3
- "version": "1.35.547",
3
+ "version": "1.35.548",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -305,7 +305,7 @@ export default {
305
305
  },
306
306
  readOnly: {
307
307
  type: Boolean,
308
- default: false
308
+ default: true
309
309
  }
310
310
  },
311
311
  watch: {
@@ -337,7 +337,9 @@ export default {
337
337
  handler: function (val) {
338
338
  if (!val) return
339
339
  this.points = val
340
+ this.processing()
340
341
  },
342
+ deep:true,
341
343
  immediate: true
342
344
  },
343
345
  isDoublePage: {
@@ -477,6 +479,7 @@ export default {
477
479
  // 右键菜单
478
480
  rightMenu(e) {
479
481
  e.preventDefault()
482
+ if(this.readOnly) return;
480
483
  if(!this.rightClick) return;
481
484
  if(this.doublePage) return;
482
485
  if(e.target.nodeName === 'SPAN') {
@@ -675,6 +678,7 @@ export default {
675
678
  this.setShow = false
676
679
  this.points = []
677
680
  this.clearRect(true)
681
+ this.$emit('drawEnd', this.points,'empty')
678
682
  },
679
683
  preserve() {
680
684
  this.setShow = false
@@ -695,6 +699,7 @@ export default {
695
699
  } else {
696
700
  this.points.pop()
697
701
  }
702
+ this.$emit('drawEnd', this.points,'backward')
698
703
  this.clearRect()
699
704
  },
700
705
  // 鼠标
@@ -1007,6 +1012,7 @@ export default {
1007
1012
  i--
1008
1013
  }
1009
1014
  }
1015
+ this.$emit('drawEnd', this.points,'del')
1010
1016
  this.clearRect()
1011
1017
  },
1012
1018
  // 绘制
@@ -1142,6 +1148,7 @@ export default {
1142
1148
  color: obj.color,
1143
1149
  size: obj.size,
1144
1150
  })
1151
+ this.$emit('drawEnd', this.points)
1145
1152
  },
1146
1153
  // 画箭头
1147
1154
  arrow(obj, type) {
@@ -1187,6 +1194,7 @@ export default {
1187
1194
  color: obj.color,
1188
1195
  border: obj.border,
1189
1196
  })
1197
+ this.$emit('drawEnd', this.points)
1190
1198
  }
1191
1199
  },
1192
1200
  // 画直线
@@ -1218,6 +1226,7 @@ export default {
1218
1226
  color: obj.color,
1219
1227
  border: obj.border,
1220
1228
  })
1229
+ this.$emit('drawEnd', this.points)
1221
1230
  }
1222
1231
  },
1223
1232
  // 画圆
@@ -1249,6 +1258,7 @@ export default {
1249
1258
  color: obj.color,
1250
1259
  border: obj.border,
1251
1260
  })
1261
+ this.$emit('drawEnd', this.points)
1252
1262
  }
1253
1263
  },
1254
1264
  // 画矩形
@@ -1279,6 +1289,7 @@ export default {
1279
1289
  color: obj.color,
1280
1290
  border: obj.border,
1281
1291
  })
1292
+ this.$emit('drawEnd', this.points)
1282
1293
  }
1283
1294
  },
1284
1295
  // 画线
@@ -1299,6 +1310,7 @@ export default {
1299
1310
  this.ctx.stroke()
1300
1311
  this.ctx.closePath()
1301
1312
  this.points.push(obj)
1313
+ this.$emit('drawEnd', obj,'line')
1302
1314
  },
1303
1315
  clearRect(v) {
1304
1316
  const width = this.canvasStyle.widthCanvas
@@ -1311,7 +1323,7 @@ export default {
1311
1323
  this.ctx.beginPath()
1312
1324
  this.ctx.moveTo(data.x * this.scales / data.scale + v.x, data.y * this.scales / data.scale + v.y)
1313
1325
  if (data.start !== 'end') {
1314
- this.ctx.lineTo(data2.x * this.scales / data2.scale + v.x, data2.y * this.scales / data2.scale + v.y)
1326
+ this.ctx.lineTo(data2?.x * this.scales / data2?.scale + v.x, data2?.y * this.scales / data2?.scale + v.y)
1315
1327
  }
1316
1328
  this.ctx.strokeStyle = data.color
1317
1329
  this.ctx.lineCap = 'round'
@@ -1431,6 +1443,7 @@ export default {
1431
1443
  }
1432
1444
  },
1433
1445
  flipLeft(e, v) {
1446
+ this.extendRightDel()
1434
1447
  if (e > this.pdfPages) {
1435
1448
  this.pageIndex = this.pdfPages
1436
1449
  return
@@ -1451,6 +1464,7 @@ export default {
1451
1464
  }
1452
1465
  },
1453
1466
  flipRight(e, v) {
1467
+ this.extendRightDel()
1454
1468
  if (e < 1) {
1455
1469
  this.pageIndex = 1
1456
1470
  return
@@ -154,12 +154,15 @@ export default {
154
154
  },
155
155
  handleMountedEditor(editor) {
156
156
  editorAPP = editor
157
- editorAPP.sideEffects.registerAfterChangeHandler('shape', debounce((next)=> {
157
+ editorAPP.sideEffects.registerAfterChangeHandler('shape', (prev, next)=> {
158
158
  // there can only be one red shape at a time:
159
- this.$emit('shapeChangeHandler', next);
160
- },300))
159
+ console.log('shapeChangeHandler prev',prev)
160
+ // console.log('shapeChangeHandler next',next)
161
+ this.$emit('shapeChangeHandler', prev);
162
+ })
161
163
  editorAPP.sideEffects.registerAfterDeleteHandler('shape', (shape) => {
162
164
  // if the last shape in a frame is deleted, delete the frame too:
165
+ console.log('shapeDeleteHandler',shape)
163
166
  this.$emit('shapeDeleteHandler', shape);
164
167
  })
165
168
  editorAPP.setCameraOptions({ isLocked: this.cameraIsLocked })
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.547',
92
+ version: '1.35.548',
93
93
  install,
94
94
  Calendar,
95
95
  Message,