zydx-plus 1.32.268 → 1.32.269

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.32.268",
3
+ "version": "1.32.269",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -647,7 +647,7 @@ let buttonNames = {
647
647
  lowLevel: {
648
648
  default: "setTask",
649
649
  setTask: '布置任务',
650
- groupStudy: '小组学习',
650
+ // groupStudy: '小组学习',
651
651
  duplicate: '违纪查重',
652
652
  teacherReview: '教师评价',
653
653
  studentReview: '同学互评',
@@ -18,6 +18,9 @@
18
18
  </div>
19
19
  </div>
20
20
  </div>
21
+ <div class="tool-list" @click.stop="mouse">
22
+ <img src="./img/shubiao.png" alt=""/>
23
+ </div>
21
24
  <div class="tool-list" @click.stop="brush">
22
25
  <img src="./img/huabi.png" alt=""/>
23
26
  </div>
@@ -31,9 +34,9 @@
31
34
  <span>字号</span>
32
35
  <em style="font-size: 13px;" v-for="(item,index) in textData" @click.stop="sizeTap(item)">{{ item }}</em>
33
36
  </div>
34
- <div class="set-list">
37
+ <div class="set-list" @click.stop="textInputTap">
35
38
  <span>内容</span>
36
- <input type="text" v-model="text" @click.stop="false"/>
39
+ <input ref="textInput" type="text" v-model="text"/>
37
40
  </div>
38
41
  <div class="set-list set-right">
39
42
  <button class="but" @click="textBox">确认</button>
@@ -123,8 +126,10 @@ export default {
123
126
  this.init()
124
127
  }, 0)
125
128
  window.addEventListener('keydown', this.handleKeyEvent)
126
- this.offLeft = this.$refs.sketchpad.offsetLeft
127
- this.offTop = this.$refs.sketchpad.offsetTop
129
+ const ids = this.$refs.sketchpad.getBoundingClientRect()
130
+ const bodyWidth = (document.documentElement.clientWidth - this.$refs.sketchpad.offsetLeft - ids.width) / 2
131
+ this.offLeft = this.$refs.sketchpad.offsetLeft + bodyWidth
132
+ this.offTop = ids.top
128
133
  // 监听滚动
129
134
  this.throttleHandleScroll()
130
135
  window.addEventListener('scroll', this.throttleHandleScroll);
@@ -141,6 +146,13 @@ export default {
141
146
  window.removeEventListener('keydown', this.handleKeyEvent)
142
147
  },
143
148
  methods: {
149
+ mouse() {
150
+ this.state = null
151
+ this.canvas.isDrawingMode = false
152
+ },
153
+ textInputTap() {
154
+ this.$refs.textInput.focus()
155
+ },
144
156
  throttleHandleScroll() {
145
157
  this.scrollTop = document.documentElement.scrollTop || document.body.scrollTop
146
158
  },
@@ -221,7 +233,7 @@ export default {
221
233
 
222
234
  this.canvas.on('mouse:up', (o) => {
223
235
  this.isDown = false
224
- this.line.setCoords()
236
+ this.line?.setCoords()
225
237
  })
226
238
  },
227
239
  // 矩形
@@ -269,7 +281,7 @@ export default {
269
281
  })
270
282
  this.canvas.on('mouse:up', (o) => {
271
283
  this.isDown = false
272
- this.rect.setCoords()
284
+ this.rect?.setCoords()
273
285
  })
274
286
  },
275
287
  // 圆形
@@ -325,7 +337,7 @@ export default {
325
337
  })
326
338
  this.canvas.on('mouse:up', () => {
327
339
  this.isDown = false
328
- this.circle.setCoords()
340
+ this.circle?.setCoords()
329
341
  })
330
342
  },
331
343
  // 箭头
@@ -377,7 +389,6 @@ export default {
377
389
  this.canvas.add(this.textbox)
378
390
  },
379
391
  save() {
380
- console.log(this.canvas.toJSON())
381
392
  this.$emit('save', this.canvas.toJSON())
382
393
  },
383
394
  clear() {
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.268',
82
+ version: '1.32.269',
83
83
  install,
84
84
  Calendar,
85
85
  Message,