zydx-plus 1.35.566 → 1.35.567

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.566",
3
+ "version": "1.35.567",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -176,6 +176,15 @@ export default {
176
176
  sessionStorage.setItem('messages', JSON.stringify(e)) // 保存聊天记录
177
177
  },
178
178
  deep: true
179
+ },
180
+ modelValue: {
181
+ handler: async function (e) {
182
+ if(e) {
183
+ const token = await this.getAccessToken('ai')
184
+ this.token = token.data.data
185
+ }
186
+ },
187
+ deep: true
179
188
  }
180
189
  },
181
190
  methods: {
@@ -333,34 +342,6 @@ export default {
333
342
  sampleRate: 16000, // 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
334
343
  numChannels: 1, // 声道,支持 1 或 2, 默认是1
335
344
  })
336
- const ais = this.getCookie('aiToken');
337
- if(ais) {
338
- this.token = ais
339
- }else {
340
- const token = await this.getAccessToken('ai')
341
- this.setCookie('aiToken', token.data.data, 60)
342
- this.token = token.data.data
343
- }
344
- },
345
- setCookie(name, value, minutes) {
346
- let now = new Date();
347
- now.setMinutes(now.getMinutes() + minutes);
348
- document.cookie = name + '=' + value + ';expires=' + now.toUTCString();
349
- },
350
- getCookie(cname) {
351
- let name = cname + "=";
352
- let decodedCookie = decodeURIComponent(document.cookie);
353
- let ca = decodedCookie.split(';');
354
- for(let i = 0; i < ca.length; i++) {
355
- let c = ca[i];
356
- while (c.charAt(0) === ' ') {
357
- c = c.substring(1);
358
- }
359
- if (c.indexOf(name) === 0) {
360
- return c.substring(name.length, c.length);
361
- }
362
- }
363
- return "";
364
345
  },
365
346
  async getAccessToken(v) {
366
347
  return axios({
@@ -353,7 +353,7 @@ export default {
353
353
  default: []
354
354
  }
355
355
  },
356
- emits: ['see', 'del', 'complete', 'update:data', 'enclosureSuccess', 'download', 'updateData', 'syncDel'],
356
+ emits: ['see', 'del', 'complete', 'update:data', 'enclosureSuccess', 'download', 'updateData', 'syncDel','assets'],
357
357
  watch: {
358
358
  // 强制监听data变化
359
359
  data: {
@@ -482,6 +482,9 @@ export default {
482
482
  this.lastSelectedText = selectedText
483
483
  console.log('selectedText', selectedText)
484
484
  },
485
+ showAssets() {
486
+ this.$emit('assets')
487
+ },
485
488
  showAi() {
486
489
  this.isShowAi = !this.isShowAi
487
490
  },
@@ -553,8 +556,16 @@ export default {
553
556
  // 删除选中的文本
554
557
  this.editor.chain().focus().deleteSelection().run()
555
558
  const text = event.clipboardData.getData('text/plain');
556
- const text2 = text.replace(/[\r\n]/g, '').replace(/\s*/g, '')
557
- this.editor.chain().focus().insertContentAt(this.selection(), text2).run()
559
+ // const text2 = text.replace(/[\r\n]/g, '').replace(/\s*/g, '')
560
+ // this.editor.chain().focus().insertContentAt(this.selection(), text2).run()
561
+ const textArr = text.split(/[\r\n]/g)
562
+ textArr.forEach((item,index) => {
563
+ if(index === 0) {
564
+ this.editor.chain().focus().insertContentAt(this.selection(), item).run()
565
+ }else {
566
+ this.editor.chain().focus().insertContentAt(this.selection(), `<p>${item}</p>`).run()
567
+ }
568
+ })
558
569
  },
559
570
  addContent(text) {
560
571
  const text2 = text.replace(/[\r\n]/g, '').replace(/\s*/g, '')
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.566',
92
+ version: '1.35.567',
93
93
  install,
94
94
  Calendar,
95
95
  Message,