zydx-plus 1.30.167 → 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.167",
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(() => {
@@ -167,8 +167,13 @@ export default {
167
167
  },
168
168
  mounted() {
169
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
+ }
170
175
  _this.editor = new Editor({
171
- content: json2html({node: "root",child: (_this.html === undefined)? [] : _this.html}),
176
+ content: dataHtml,
172
177
  editable: !_this.readOnly,
173
178
  extensions: [
174
179
  signId, // 签名
@@ -332,7 +337,7 @@ export default {
332
337
  uploadFile(file,data) {
333
338
  let _this = this
334
339
  return new Promise((rl,re) => {
335
- const meta = Object.keys(data.meta)
340
+ const meta = data.meta? Object.keys(data.meta): []
336
341
  const param = new FormData()
337
342
  param.append('file', file)
338
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.167',
74
+ version: '1.30.168',
75
75
  install,
76
76
  Calendar,
77
77
  Message,