zydx-plus 1.30.155 → 1.30.157

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.30.155",
3
+ "version": "1.30.157",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <we-toolbar v-show="!readOnly && toolbar.length > 0" class="toolbar" :handle="handle"/>
3
- <we-editable v-show="!readOnly" class="editable" :style="{'min-height': height + 'px'}" :handle="handle" v-model:json="formData.html" />
3
+ <we-editable v-show="!editableShow" class="editable" :style="{'min-height': height + 'px'}" :handle="handle" v-model:json="formData.html" />
4
4
  <div class="but" v-if="!readOnly && toolbar.length > 0">
5
5
  <button class="def-but" v-if="butShow" @click="confirm">完成</button>
6
6
  </div>
@@ -31,7 +31,8 @@ export default defineComponent({
31
31
  components: {WeEditable, WeToolbar},
32
32
  data() {
33
33
  return {
34
- htmlArr: []
34
+ htmlArr: [],
35
+ editableShow: false
35
36
  }
36
37
  },
37
38
  props: {
@@ -77,48 +78,55 @@ export default defineComponent({
77
78
  html: {
78
79
  handler: function (e, oldVal) {
79
80
  this.formData.html = e
80
- if(this.readOnly) this.readOnlyPage()
81
+ if(this.readOnly) {
82
+ this.editableShow = false
83
+ setTimeout(() => {
84
+ this.editableShow = true
85
+ if(this.readOnly) this.readOnlyPage()
86
+ },0)
87
+ }
81
88
  },
82
- deep: true
89
+ deep: true,
90
+ immediate: true
83
91
  },
84
92
  readOnly: {
85
93
  handler: function (e, oldVal) {
86
94
  this.opts.editable.config.readOnly = e
95
+ this.editableShow = e
87
96
  if(e) this.readOnlyPage()
88
97
  },
89
98
  deep: true
90
99
  },
91
100
  },
92
101
  mounted() {
93
- this.$nextTick(() => {
94
- if(this.readOnly) this.readOnlyPage()
95
- })
102
+ // this.$nextTick(() => {
103
+ // if(this.readOnly) this.readOnlyPage()
104
+ // })
96
105
  window.closeMaker = this.closeMaker
97
-
98
106
  },
99
107
  methods: {
100
108
  readOnlyPage() {
101
109
  this.htmlArr = []
102
- this.syncContent() //强制同步数据
103
110
  const data = document.querySelectorAll('.w-e-scroll')[0].childNodes[0].childNodes
104
111
  let pHeight = 0
105
112
  let html = ''
106
113
  for (let i = 0; i < data.length; i++) {
107
114
  let text = data[i].offsetHeight
108
- if(i === data.length - 1) {
115
+ if((pHeight + text) > 930) {
109
116
  this.htmlArr.push(html)
110
117
  pHeight = 0
111
118
  html = ''
112
- break
113
119
  }
114
- if((pHeight + text) > 930) {
120
+ pHeight += text
121
+ html += data[i].outerHTML
122
+ if(i === data.length - 1) {
115
123
  this.htmlArr.push(html)
116
124
  pHeight = 0
117
125
  html = ''
126
+ break
118
127
  }
119
- pHeight += text
120
- html += data[i].outerHTML
121
128
  }
129
+ console.log(this.htmlArr)
122
130
  },
123
131
  closeMaker(data) {
124
132
  this.$emit('enclosure',data)
package/src/index.js CHANGED
@@ -71,7 +71,7 @@ function install(app) {
71
71
  }
72
72
 
73
73
  export default {
74
- version: '1.30.155',
74
+ version: '1.30.157',
75
75
  install,
76
76
  Calendar,
77
77
  Message,