zydx-plus 1.35.494 → 1.35.495

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.494",
3
+ "version": "1.35.495",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -86,7 +86,11 @@ export default {
86
86
  top: {
87
87
  type: Boolean,
88
88
  default: true
89
- }
89
+ },
90
+ readOnly: {
91
+ type: Boolean,
92
+ default: false
93
+ },
90
94
  },
91
95
  mounted() {
92
96
  // 鼠标移入
@@ -108,8 +112,8 @@ export default {
108
112
  },
109
113
  methods: {
110
114
  exportImg() {
111
- return new Promise((rl,ri) => {
112
- editorAPP.getSvg([...editorAPP.getCurrentPageShapeIds()],{}).then(r => {
115
+ return new Promise((rl, ri) => {
116
+ editorAPP.getSvg([...editorAPP.getCurrentPageShapeIds()], {}).then(r => {
113
117
  const s = new XMLSerializer().serializeToString(r);
114
118
  const src = `data:image/svg+xml;base64,${Buffer.from(s).toString('base64')}`;
115
119
  const img = new Image(); // 创建图片容器承载过渡
@@ -142,13 +146,19 @@ export default {
142
146
  },
143
147
  handleMountedEditor(editor) {
144
148
  editorAPP = editor
145
- if(this.top) {
149
+ if (this.top) {
146
150
  setTimeout(() => {
147
151
  document.documentElement.scrollTop = 0
148
152
  }, 0)
149
153
  }
154
+ if (this.readOnly) {
155
+ setTimeout(() => {
156
+ editorAPP.updateInstanceState({isReadonly: true})
157
+ this.hand()
158
+ }, 0)
159
+ }
150
160
  },
151
- setOpacityForNextShapes(opacity){
161
+ setOpacityForNextShapes(opacity) {
152
162
  editorAPP.setOpacityForNextShapes(opacity)
153
163
  },
154
164
  // 清空
@@ -198,10 +208,10 @@ export default {
198
208
  },
199
209
  note(v) {
200
210
  let verticalAlign = ['middle-legacy', 'start-legacy', 'end-legacy']
201
- if(verticalAlign.indexOf(v?.align) !== -1){
211
+ if (verticalAlign.indexOf(v?.align) !== -1) {
202
212
  let align = ['middle', 'start', 'end']
203
213
  this.styleProps('note', 'verticalAlign').defaultValue = align[verticalAlign.indexOf(v?.align)] ?? 'middle'
204
- }else {
214
+ } else {
205
215
  this.styleProps('note', 'align').defaultValue = v?.align ?? 'start'
206
216
  }
207
217
  this.styleProps('note', 'color').defaultValue = v?.color ?? 'black'
@@ -353,7 +363,7 @@ export default {
353
363
  this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
354
364
  editorAPP.setCurrentTool('highlight')
355
365
  },
356
- insertPicture(img){
366
+ insertPicture(img) {
357
367
  const assetId = AssetRecordType.createId()
358
368
  editorAPP.createAssets([{
359
369
  id: assetId,
@@ -363,7 +373,7 @@ export default {
363
373
  props: {
364
374
  w: img.width,
365
375
  h: img.height,
366
- name:'image',
376
+ name: 'image',
367
377
  src: img.src,
368
378
  mimeType: 'image/*',
369
379
  isAnimated: false,
@@ -415,7 +425,7 @@ export default {
415
425
  width: 100%;
416
426
  height: 100%;
417
427
  }
418
- #canvas{
428
+ #canvas {
419
429
  position: fixed;
420
430
  top: -99999px;
421
431
  left: 0;
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.494',
90
+ version: '1.35.495',
91
91
  install,
92
92
  Calendar,
93
93
  Message,