zydx-plus 1.33.438 → 1.33.440
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 +1 -1
- package/src/components/paint/src/paint.vue +41 -9
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
<script>
|
|
112
112
|
import Sketchpad from '../../sketchpad/src/sketchpad'
|
|
113
113
|
import dragPopup from '../../dragPopup/src/dragPopup'
|
|
114
|
+
import Mess from '../../tipBox/index'
|
|
114
115
|
|
|
115
116
|
let stayTime = 0
|
|
116
117
|
let timer = null
|
|
@@ -240,9 +241,17 @@ export default {
|
|
|
240
241
|
},
|
|
241
242
|
methods: {
|
|
242
243
|
exportTap() {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
Mess({
|
|
245
|
+
type: 'text',
|
|
246
|
+
cancelShow: false,
|
|
247
|
+
promptContent: '保存白板后,白板内容将无法再做修改'
|
|
248
|
+
}).then((res) => {
|
|
249
|
+
this.$refs.sketchpad.exportImg().then(res => {
|
|
250
|
+
document.body.style.overflow = 'visible'
|
|
251
|
+
this.$emit('exportImg', res)
|
|
252
|
+
})
|
|
253
|
+
}).catch(() => {
|
|
254
|
+
console.log('取消')
|
|
246
255
|
})
|
|
247
256
|
},
|
|
248
257
|
// 添加公式图片
|
|
@@ -400,21 +409,44 @@ export default {
|
|
|
400
409
|
const xhr = new XMLHttpRequest()
|
|
401
410
|
let formData = new FormData();
|
|
402
411
|
formData.append('file', file);
|
|
403
|
-
// xhr.open('POST', '
|
|
404
|
-
// xhr.setRequestHeader('Authorization', '
|
|
412
|
+
// xhr.open('POST', 'http://192.168.15.124:8888/zydx/latex/get')
|
|
413
|
+
// xhr.setRequestHeader('Authorization', '35463cf0-bdd6-4884-b9ff-89d8376f0c96')
|
|
405
414
|
xhr.open('POST', '/zydx/latex/get')
|
|
406
415
|
xhr.setRequestHeader('Authorization', token)
|
|
407
416
|
this.error = true
|
|
408
417
|
xhr.onreadystatechange = () => {
|
|
409
418
|
if (xhr.readyState === 4) {
|
|
410
419
|
if (xhr.status === 200) {
|
|
411
|
-
|
|
412
|
-
|
|
420
|
+
const data = JSON.parse(xhr.responseText)
|
|
421
|
+
if(data.code === '200') {
|
|
422
|
+
if(this.url) {
|
|
423
|
+
rl(`${this.url}${data.data}`)
|
|
424
|
+
}else {
|
|
425
|
+
this.uploadImage.customInsert(data, (r) => {
|
|
426
|
+
rl(r)
|
|
427
|
+
})
|
|
428
|
+
}
|
|
413
429
|
}else {
|
|
414
|
-
|
|
415
|
-
|
|
430
|
+
Mess({
|
|
431
|
+
type: 'text',
|
|
432
|
+
cancelShow: false,
|
|
433
|
+
promptContent: '识别失败'
|
|
434
|
+
}).then((res) => {
|
|
435
|
+
console.log('确认')
|
|
436
|
+
}).catch(() => {
|
|
437
|
+
console.log('取消')
|
|
416
438
|
})
|
|
417
439
|
}
|
|
440
|
+
}else {
|
|
441
|
+
Mess({
|
|
442
|
+
type: 'text',
|
|
443
|
+
cancelShow: false,
|
|
444
|
+
promptContent: '识别失败'
|
|
445
|
+
}).then((res) => {
|
|
446
|
+
console.log('确认')
|
|
447
|
+
}).catch(() => {
|
|
448
|
+
console.log('取消')
|
|
449
|
+
})
|
|
418
450
|
}
|
|
419
451
|
}
|
|
420
452
|
}
|