zydx-plus 1.30.166 → 1.30.168

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.166",
3
+ "version": "1.30.168",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -139,7 +139,7 @@ export default {
139
139
  this.signMenuShow = true
140
140
  e.shift()
141
141
  }
142
- this.editor?.commands.setContent(json2html({node: "root",child: (e === undefined)? [] : e}))
142
+ this.editor?.commands.setContent(json2html({node: "root",child: (e === undefined || null)? [] : e}))
143
143
  if(this.readOnly) {
144
144
  if(this.page) this.editableShow = true
145
145
  setTimeout(() => {
@@ -151,7 +151,6 @@ export default {
151
151
  }
152
152
  },
153
153
  deep: true,
154
- immediate: true
155
154
  },
156
155
  readOnly: {
157
156
  handler: function (e, oldVal) {
@@ -168,8 +167,13 @@ export default {
168
167
  },
169
168
  mounted() {
170
169
  const _this = this
170
+ let dataHtml = json2html({node: "root",child: (_this.html === undefined || null)? [] : _this.html})
171
+ if(dataHtml[0]?.tag === 'sign') {
172
+ this.signMenuShow = true
173
+ dataHtml.shift()
174
+ }
171
175
  _this.editor = new Editor({
172
- content: '',
176
+ content: dataHtml,
173
177
  editable: !_this.readOnly,
174
178
  extensions: [
175
179
  signId, // 签名
@@ -333,7 +337,7 @@ export default {
333
337
  uploadFile(file,data) {
334
338
  let _this = this
335
339
  return new Promise((rl,re) => {
336
- const meta = Object.keys(data.meta)
340
+ const meta = data.meta? Object.keys(data.meta): []
337
341
  const param = new FormData()
338
342
  param.append('file', file)
339
343
  for(let i = 0; i < meta.length; i++) {
@@ -191,7 +191,7 @@ export default {
191
191
  // 强制监听data变化
192
192
  data: {
193
193
  handler: function (e, oldVal) {
194
- this.editor.commands.setContent(json2html({node: "root",child: (e.html === undefined)? [] : e.html}))
194
+ this.editor.commands.setContent(json2html({node: "root",child: (e.html === undefined || null)? [] : e.html}))
195
195
  this.uploadAttData = (e.enclosure === undefined)? [] : this.enclosureAction(e.enclosure)
196
196
  },
197
197
  deep: true
@@ -212,7 +212,7 @@ export default {
212
212
  const height = this.height.split('px')[0] - 44
213
213
  this.heightStyleCont = (this.height === '100%')? {height: 'calc(100% - 44px)'} : {'min-height': `${height}px`}
214
214
  this.editor = new Editor({
215
- content: json2html({node: "root",child: (this.data.html === undefined)? [] : this.data.html}),
215
+ content: json2html({node: "root",child: (this.data.html === undefined || null)? [] : this.data.html}),
216
216
  editable: this.readOnly,
217
217
  extensions: [
218
218
  sid,
@@ -283,7 +283,7 @@ export default {
283
283
  },
284
284
  uploadFile(file,data) {
285
285
  return new Promise((rl,re) => {
286
- const meta = Object.keys(data.meta)
286
+ const meta = data.meta? Object.keys(data.meta): []
287
287
  const param = new FormData()
288
288
  param.append('file', file)
289
289
  for(let i = 0; i < meta.length; i++) {
package/src/index.js CHANGED
@@ -71,7 +71,7 @@ function install(app) {
71
71
  }
72
72
 
73
73
  export default {
74
- version: '1.30.166',
74
+ version: '1.30.168',
75
75
  install,
76
76
  Calendar,
77
77
  Message,