zydx-plus 1.35.585 → 1.35.586

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.585",
3
+ "version": "1.35.586",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1128,10 +1128,20 @@ export default {
1128
1128
  const selection = state.selection.$from.parent.attrs
1129
1129
  const ids = selection?.lineHeightId?.split(' ')
1130
1130
  if (ids && img) {
1131
- this.imageStyle.width = view.dom.children[0].children[0].offsetWidth - 5 + 'px'
1132
- this.imageStyle.height = view.dom.children[0].children[0].offsetHeight - 5 + 'px'
1133
- this.imageStyle.top = view.dom.offsetTop + 2 + 'px'
1134
- this.imageStyle.left = view.dom.offsetLeft + 2 + view.dom.children[0].children[0].offsetLeft + 'px'
1131
+ if(!state.selection.node) {
1132
+ this.imageStyle.width = '0px'
1133
+ this.imageStyle.height = '0px'
1134
+ this.imageStyle.top = '0px'
1135
+ this.imageStyle.left = '0px'
1136
+ _this.imgMenuShow = false
1137
+ return false
1138
+ }
1139
+ const imgSrc = state.selection.node.attrs.src;
1140
+ const imgDom = editor.view.dom.querySelector(`img[src="${imgSrc}"]`);
1141
+ this.imageStyle.width = imgDom.offsetWidth + 'px'
1142
+ this.imageStyle.height = imgDom.offsetHeight + 'px'
1143
+ this.imageStyle.top = view.dom.offsetTop + imgDom.offsetTop + 'px'
1144
+ this.imageStyle.left = view.dom.offsetLeft + imgDom.offsetLeft + 'px'
1135
1145
  // 获取图片宽度百分比
1136
1146
  const attWidth = state.selection.node? state.selection.node.attrs.width : 100
1137
1147
  const width = attWidth ? parseInt(attWidth) : 100
@@ -2490,15 +2500,6 @@ export default {
2490
2500
  if (this.signMenuShow) {
2491
2501
  data.sign = sign
2492
2502
  }
2493
- // data.push(this.editor.getJSON())
2494
- // if (this.signMenuShow) {
2495
- // data.unshift({
2496
- // node: 'element',
2497
- // tag: 'sign',
2498
- // child: []
2499
- // })
2500
- // }
2501
- // data.push({type: 'interpositionData', data: [...this.interpositionData]})
2502
2503
  this.$emit('confirm', data)
2503
2504
  },
2504
2505
  getConfirm() {
@@ -2515,19 +2516,6 @@ export default {
2515
2516
  if (this.signMenuShow) {
2516
2517
  data.sign = sign
2517
2518
  }
2518
- // let data = []
2519
- // data.push(this.editor.getJSON())
2520
- // if (this.signMenuShow) {
2521
- // data.unshift({
2522
- // node: 'element',
2523
- // tag: 'sign',
2524
- // child: []
2525
- // })
2526
- // }
2527
- // data.push({
2528
- // type: 'interpositionData',
2529
- // data: this.interpositionData
2530
- // })
2531
2519
  return data
2532
2520
  },
2533
2521
  changeOutlineMenu() {
@@ -2689,7 +2677,7 @@ export default {
2689
2677
  up.customInsert(res, (data) => {
2690
2678
  setTimeout(() => {
2691
2679
  const cla = this.randomId()
2692
- const html = `<p contenteditable="false" class="imgCont ${cla}"><img src="${data}" alt="" /></p>`
2680
+ const html = `<p class="imgCont ${cla}"><img src="${data}" alt="" /></p>`
2693
2681
  this.editor.chain().focus().insertContentAt(this.selection(), html).run()
2694
2682
  if (this.selection() <= 6 && this.selection() > 2) this.selectionClass2(cla)
2695
2683
  if (this.selectionClass(cla)) {
@@ -2785,7 +2773,7 @@ export default {
2785
2773
  if (this.imgUrl === '') return
2786
2774
  if (this.imgPopType === 'insertImage') {
2787
2775
  const cla = this.randomId()
2788
- const html = `<p contenteditable="false" class="imgCont ${cla}"><img src="${this.imgUrl}" alt="" /></p>`
2776
+ const html = `<p class="imgCont ${cla}"><img src="${this.imgUrl}" alt="" /></p>`
2789
2777
  this.editor.chain().focus().insertContentAt(this.selection(), html).run()
2790
2778
  if (this.selection() <= 6 && this.selection() > 2) this.selectionClass2(cla)
2791
2779
  if (this.selectionClass(cla)) {
@@ -4587,7 +4575,7 @@ label {
4587
4575
  }
4588
4576
 
4589
4577
  .editing-cont :deep(img) {
4590
- padding: 5px;
4578
+ padding: 3px;
4591
4579
  }
4592
4580
 
4593
4581
  li {
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.585',
92
+ version: '1.35.586',
93
93
  install,
94
94
  Calendar,
95
95
  Message,