zydx-plus 1.35.546 → 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.546",
3
+ "version": "1.35.548",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -39,8 +39,8 @@
39
39
  <div class="magnifier-head">
40
40
  <div class="magnifier-title">拓展阅读</div>
41
41
  <div class="magnifier-icon">
42
- <img @click.stop="annotationTap(item,'add')" src="../img/qubiezhen.svg" alt="" />
43
- <img @click.stop="annEmpty(item.list)" src="../img/shanchu.svg" alt="" />
42
+ <img v-if="rightClick&&!readOnly" @click.stop="annotationTap(item,'add')" src="../img/qubiezhen.svg" alt="" />
43
+ <img v-if="!readOnly" @click.stop="annEmpty(item.list)" src="../img/shanchu.svg" alt="" />
44
44
  <img @click.stop="extendRightDel" src="../img/guanbi.svg" alt="" />
45
45
  </div>
46
46
  </div>
@@ -93,8 +93,8 @@
93
93
  <div class="magnifier-head">
94
94
  <div class="magnifier-title">拓展阅读</div>
95
95
  <div class="magnifier-icon">
96
- <img @click.stop="annotationTap(item,'add')" src="../img/qubiezhen.svg" alt="" />
97
- <img @click.stop="annEmpty(item.list)" src="../img/shanchu.svg" alt="" />
96
+ <img v-if="rightClick&&!readOnly" @click.stop="annotationTap(item,'add')" src="../img/qubiezhen.svg" alt="" />
97
+ <img v-if="!readOnly" @click.stop="annEmpty(item.list)" src="../img/shanchu.svg" alt="" />
98
98
  <img @click.stop="extendRightDel" src="../img/guanbi.svg" alt="" />
99
99
  </div>
100
100
  </div>
@@ -302,6 +302,10 @@ export default {
302
302
  rightClick: {
303
303
  type: Boolean,
304
304
  default: true
305
+ },
306
+ readOnly: {
307
+ type: Boolean,
308
+ default: true
305
309
  }
306
310
  },
307
311
  watch: {
@@ -333,7 +337,9 @@ export default {
333
337
  handler: function (val) {
334
338
  if (!val) return
335
339
  this.points = val
340
+ this.processing()
336
341
  },
342
+ deep:true,
337
343
  immediate: true
338
344
  },
339
345
  isDoublePage: {
@@ -473,6 +479,7 @@ export default {
473
479
  // 右键菜单
474
480
  rightMenu(e) {
475
481
  e.preventDefault()
482
+ if(this.readOnly) return;
476
483
  if(!this.rightClick) return;
477
484
  if(this.doublePage) return;
478
485
  if(e.target.nodeName === 'SPAN') {
@@ -671,6 +678,7 @@ export default {
671
678
  this.setShow = false
672
679
  this.points = []
673
680
  this.clearRect(true)
681
+ this.$emit('drawEnd', this.points,'empty')
674
682
  },
675
683
  preserve() {
676
684
  this.setShow = false
@@ -691,6 +699,7 @@ export default {
691
699
  } else {
692
700
  this.points.pop()
693
701
  }
702
+ this.$emit('drawEnd', this.points,'backward')
694
703
  this.clearRect()
695
704
  },
696
705
  // 鼠标
@@ -1003,6 +1012,7 @@ export default {
1003
1012
  i--
1004
1013
  }
1005
1014
  }
1015
+ this.$emit('drawEnd', this.points,'del')
1006
1016
  this.clearRect()
1007
1017
  },
1008
1018
  // 绘制
@@ -1138,6 +1148,7 @@ export default {
1138
1148
  color: obj.color,
1139
1149
  size: obj.size,
1140
1150
  })
1151
+ this.$emit('drawEnd', this.points)
1141
1152
  },
1142
1153
  // 画箭头
1143
1154
  arrow(obj, type) {
@@ -1183,6 +1194,7 @@ export default {
1183
1194
  color: obj.color,
1184
1195
  border: obj.border,
1185
1196
  })
1197
+ this.$emit('drawEnd', this.points)
1186
1198
  }
1187
1199
  },
1188
1200
  // 画直线
@@ -1214,6 +1226,7 @@ export default {
1214
1226
  color: obj.color,
1215
1227
  border: obj.border,
1216
1228
  })
1229
+ this.$emit('drawEnd', this.points)
1217
1230
  }
1218
1231
  },
1219
1232
  // 画圆
@@ -1245,6 +1258,7 @@ export default {
1245
1258
  color: obj.color,
1246
1259
  border: obj.border,
1247
1260
  })
1261
+ this.$emit('drawEnd', this.points)
1248
1262
  }
1249
1263
  },
1250
1264
  // 画矩形
@@ -1275,6 +1289,7 @@ export default {
1275
1289
  color: obj.color,
1276
1290
  border: obj.border,
1277
1291
  })
1292
+ this.$emit('drawEnd', this.points)
1278
1293
  }
1279
1294
  },
1280
1295
  // 画线
@@ -1295,6 +1310,7 @@ export default {
1295
1310
  this.ctx.stroke()
1296
1311
  this.ctx.closePath()
1297
1312
  this.points.push(obj)
1313
+ this.$emit('drawEnd', obj,'line')
1298
1314
  },
1299
1315
  clearRect(v) {
1300
1316
  const width = this.canvasStyle.widthCanvas
@@ -1307,7 +1323,7 @@ export default {
1307
1323
  this.ctx.beginPath()
1308
1324
  this.ctx.moveTo(data.x * this.scales / data.scale + v.x, data.y * this.scales / data.scale + v.y)
1309
1325
  if (data.start !== 'end') {
1310
- 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)
1311
1327
  }
1312
1328
  this.ctx.strokeStyle = data.color
1313
1329
  this.ctx.lineCap = 'round'
@@ -1427,6 +1443,7 @@ export default {
1427
1443
  }
1428
1444
  },
1429
1445
  flipLeft(e, v) {
1446
+ this.extendRightDel()
1430
1447
  if (e > this.pdfPages) {
1431
1448
  this.pageIndex = this.pdfPages
1432
1449
  return
@@ -1447,6 +1464,7 @@ export default {
1447
1464
  }
1448
1465
  },
1449
1466
  flipRight(e, v) {
1467
+ this.extendRightDel()
1450
1468
  if (e < 1) {
1451
1469
  this.pageIndex = 1
1452
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.546',
92
+ version: '1.35.548',
93
93
  install,
94
94
  Calendar,
95
95
  Message,