zydx-plus 1.33.331 → 1.33.333

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.33.331",
3
+ "version": "1.33.333",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -26,22 +26,28 @@
26
26
  "katex": "^0.15.6",
27
27
  "simple-mind-map": "^0.9.6",
28
28
  "html2json": "^1.0.2",
29
- "@tiptap/extension-image": "^2.0.3",
30
29
  "@tiptap/starter-kit": "^2.0.3",
31
30
  "@tiptap/vue-3": "^2.0.3",
31
+ "@tiptap/extension-bubble-menu": "^2.1.0",
32
32
  "@tiptap/extension-color": "^2.0.3",
33
+ "@tiptap/extension-focus": "^2.1.13",
33
34
  "@tiptap/extension-font-family": "^2.0.3",
35
+ "@tiptap/extension-heading": "^2.0.4",
34
36
  "@tiptap/extension-horizontal-rule": "^2.0.3",
37
+ "@tiptap/extension-image": "^2.0.3",
38
+ "@tiptap/extension-link": "^2.0.3",
35
39
  "@tiptap/extension-paragraph": "^2.0.3",
36
40
  "@tiptap/extension-placeholder": "^2.0.3",
37
41
  "@tiptap/extension-superscript": "^2.0.3",
38
42
  "@tiptap/extension-text-align": "^2.0.3",
39
43
  "@tiptap/extension-text-style": "^2.0.3",
40
- "@tiptap/extension-link": "^2.0.3",
41
44
  "@vue-office/docx": "^1.1.3",
42
45
  "@vue-office/excel": "^1.1.3",
43
46
  "js-export-word": "^1.0.5",
44
- "js-audio-recorder": "^1.0.7"
47
+ "js-audio-recorder": "^1.0.7",
48
+ "react": "^18.2.0",
49
+ "react-dom": "^18.2.0",
50
+ "tldraw": "^2.0.2"
45
51
  },
46
52
  "peerDependencies": {
47
53
  "vue": "^3.2.13"
@@ -226,8 +226,9 @@ export default {
226
226
  // 判断两个日期的大小
227
227
  let start = (this.rangeStart_ === undefined)? null:this.rangeStart_.replace(/-/g, '')
228
228
  let end = (this.rangeEnd_ === undefined)? null:this.rangeEnd_.replace(/-/g, '')
229
- if(start > end) {
230
- date = {end: this.rangeStart_, start: this.rangeEnd_}
229
+ date = {start: this.rangeStart_, end: this.rangeEnd_}
230
+ if(Number(start) > Number(end)) {
231
+ date = {start: this.rangeEnd_, end: this.rangeStart_}
231
232
  }else {
232
233
  date = {start: this.rangeStart_, end: this.rangeEnd_}
233
234
  }
@@ -54,12 +54,12 @@
54
54
  <div class="complete" v-if="!readOnly && toolbar.length > 0">
55
55
  <button class="but" v-if="butShow" @click="confirm">完成</button>
56
56
  </div>
57
+ <div class="menus" v-if="menus&&readOnly" :style="menusStyle">
58
+ <button class="but" @click="enlSee" v-if="readOnly">查看</button>
59
+ <button class="but" @click="enlDownload" v-if="readOnly">下载</button>
60
+ <button class="but" @click="enlDel" v-if="!readOnly">删除</button>
61
+ </div>
57
62
  <div class="read-only" v-if="page&&readOnly" :style="{width: (wit + 20) + 'px'}">
58
- <div class="menus" v-if="menus&&readOnly" :style="menusStyle">
59
- <button class="but" @click="enlSee" v-if="readOnly">查看</button>
60
- <button class="but" @click="enlDownload" v-if="readOnly">下载</button>
61
- <button class="but" @click="enlDel" v-if="!readOnly">删除</button>
62
- </div>
63
63
  <div class="editing-header" v-if="signMenuShow">
64
64
  <img :src="menusData('signMenu')?.ico" alt=""/>
65
65
  <span>{{ menusData('signMenu')?.text }}</span>
@@ -704,12 +704,12 @@ export default {
704
704
  const last = this.editor.state.selection.$anchor.path[0].content.size
705
705
  if (t === -1) this.editor.chain().focus().insertContentAt(last, html).run()
706
706
  const num = this.upSort(this.editor, 'enclosure')
707
- const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}"><span class="mu">${num.num}. ${name}</span></p>`
707
+ const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="mu"><span>${num.num}. ${name}</span></p>`
708
708
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
709
709
  } else {
710
710
  if (t === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('paragraph', b - 1), html).run()
711
711
  const num = this.upSort(this.editor, 'enclosure')
712
- const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}"><span class="mu">${num.num}. ${name}</span></p>`
712
+ const html2 = `<p contenteditable="false" data-signId="u-${num.num}" data-url="${url}" class="mu"><span>${num.num}. ${name}</span></p>`
713
713
  this.editor.chain().focus().insertContentAt(num.len, html2).run()
714
714
  }
715
715
  })
@@ -4,7 +4,7 @@
4
4
  'min-height': height + 'px',
5
5
  border: (readable)? '1px solid #ccc': 'none',
6
6
  'background-color': (readable)? '#fff': 'transparent'
7
- }" @input="event => checkLength(event, maxLength)" :placeholder="placeholder" :contenteditable="readable"
7
+ }" @input="event => checkLength(event, maxLength)" @keydown.enter="handleEnterKey" :placeholder="placeholder" :contenteditable="readable"
8
8
  ref="textarea"></div>
9
9
  <span class="num" v-if="maxLength !== 0&&readable">{{ num }}/{{ maxLength }}</span>
10
10
  </div>
@@ -16,7 +16,8 @@ export default {
16
16
  data() {
17
17
  return {
18
18
  num: 0,
19
- placeholder: ''
19
+ placeholder: '',
20
+ length: 0
20
21
  }
21
22
  },
22
23
  props: {
@@ -39,6 +40,10 @@ export default {
39
40
  placeholder: {
40
41
  type: String,
41
42
  default: ''
43
+ },
44
+ lineNum: {
45
+ type: Number,
46
+ default: 5
42
47
  }
43
48
  },
44
49
  watch: {
@@ -64,16 +69,30 @@ export default {
64
69
  methods: {
65
70
  splitHtml(v) {
66
71
  if(v === '' || v === null) return ''
67
- const arr = v.split('<br>')
72
+ const arr = v.split('\n')
68
73
  let html = ''
69
74
  arr.forEach(item => {
75
+ item = item.replace(/ /g, '&nbsp;')
70
76
  html += `<p>${item}</p>`
71
77
  })
72
78
  return html
73
79
  },
80
+ // 添加限制行数(回车监听)
81
+ handleEnterKey(e) {
82
+ if(e.keyCode === 13) {
83
+ if(this.length + 1 >= this.lineNum) {
84
+ e.preventDefault();
85
+ return false;
86
+ }
87
+ }
88
+ },
74
89
  checkLength(event, maxLength) {
75
90
  if (maxLength === 0) return
76
- const text = event.target.innerText;
91
+ let text = event.target.innerText;
92
+ let html = event.target.innerHTML;
93
+ const regex = /<\/div>/g
94
+ const result = html.match(regex)
95
+ this.length = result ? result.length : 0 // 添加限制行数
77
96
  this.num = text.length
78
97
  if (text.length >= maxLength) {
79
98
  event.preventDefault();
@@ -83,16 +102,24 @@ export default {
83
102
  },
84
103
  getContent() {
85
104
  const html = this.$refs.textarea.innerHTML
86
- const br = html.replace(/<div>/g, '<br>').replace(/<\/div>/g, '').replace(/<p>/g, '<br>').replace(/<\/p>/g, '')
105
+ console.log(html)
106
+ const br = html
107
+ .replace(/<div>/g, '\n')
108
+ .replace(/<\/div>/g, '')
109
+ .replace(/<p>/g, '\n')
110
+ .replace(/<\/p>/g, '')
111
+ .replace(/<span style="text-indent: 2em;">/g, '')
112
+ .replace(/<\/span>/g, '')
113
+ .replace(/&nbsp;/g, ' ')
87
114
  // 如果br后边没有内容,就去掉br
88
- if (br.indexOf('<br>') !== -1) {
89
- const arr = br.split('<br>')
115
+ if (br.indexOf('\n') !== -1) {
116
+ const arr = br.split('\n')
90
117
  arr.forEach((item, index) => {
91
118
  if (item === '') {
92
119
  arr.splice(index, 1)
93
120
  }
94
121
  })
95
- return arr.join('<br>')
122
+ return arr.join('\n')
96
123
  }else {
97
124
  return br
98
125
  }
@@ -120,6 +147,7 @@ export default {
120
147
  box-sizing: border-box;
121
148
  text-indent: 2em;
122
149
  background-color: #fff;
150
+ word-wrap: break-word;
123
151
  }
124
152
 
125
153
  .text[contenteditable]:empty:before {
package/src/index.js CHANGED
@@ -81,7 +81,7 @@ function install(app) {
81
81
  }
82
82
 
83
83
  export default {
84
- version: '1.33.331',
84
+ version: '1.33.333',
85
85
  install,
86
86
  Calendar,
87
87
  Message,