zydx-plus 1.35.610 → 1.35.612

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.610",
3
+ "version": "1.35.612",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1002,13 +1002,12 @@ export default {
1002
1002
  // if (v === 'h1') this.editor.chain().focus().setFontSize('18px').setBold().run()
1003
1003
  // if (v === 'h2') this.editor.chain().focus().setFontSize('16px').setBold().run()
1004
1004
  // if (v === 'h3') this.editor.chain().focus().setFontSize('14px').setBold().run()
1005
- if(v === 'h1') this.editor.chain().focus().toggleHeading({ level: 1 }).setFontSize('18px').run()
1006
- if(v === 'h2') this.editor.chain().focus().toggleHeading({ level: 2 }).setFontSize('16px').run()
1007
- if(v === 'h3') this.editor.chain().focus().toggleHeading({ level: 3 }).setFontSize('14px').run()
1005
+ if(v === 'h1') this.editor.chain().focus().setBold().setFontSize('18px').run()
1006
+ if(v === 'h2') this.editor.chain().focus().setBold().setFontSize('16px').run()
1007
+ if(v === 'h3') this.editor.chain().focus().setBold().setFontSize('14px').run()
1008
1008
 
1009
1009
  if (v === 'p') {
1010
- this.editor.chain().focus().setFontSize('14px').run()
1011
- this.editor.chain().focus().unsetBold().run()
1010
+ this.editor.chain().focus().setFontSize('14px').unsetBold().run()
1012
1011
  }
1013
1012
  if (v === 'bold') this.editor.chain().focus().toggleBold().run()
1014
1013
  if (v === 'center' || v === 'left' || v === 'right') this.editor.chain().focus().setTextAlign(v).run()
@@ -1247,7 +1246,7 @@ export default {
1247
1246
 
1248
1247
  .ed-cont {
1249
1248
  padding-top: 4px;
1250
- margin-bottom: 14px;
1249
+ padding-bottom: 14px;
1251
1250
  position: relative;
1252
1251
  }
1253
1252
 
@@ -196,7 +196,7 @@
196
196
  border: 1px solid #ccc;
197
197
  cursor: pointer;
198
198
  font-size: 14px;
199
- height: 28px;
199
+ height: 30px;
200
200
  line-height: 28px;
201
201
  flex: 1;
202
202
  position: relative;
@@ -9,18 +9,32 @@
9
9
  :readonly="true"
10
10
  @click.stop="toggleDropDown"
11
11
  :class="{'select-css-focus': isOpen}"
12
- class="select-css" />
12
+ class="select-css"/>
13
13
 
14
- <span class="custom-select-icons" v-if="!readonly" @click.stop="toggleDropDown">
15
- <svg xmlns="http://www.w3.org/2000/svg"
16
- width="16"
14
+ <span v-if="!readonly" class="custom-select-icons">
15
+ <svg v-if="!selected"
16
+ @click.stop="toggleDropDown"
17
17
  height="16"
18
- viewBox="0 0 24 24">
19
- <g :transform="transform" >
20
- <path fill="#c0c4cc"
21
- d="M15.125 21.1L6.7 12.7q-.15-.15-.213-.325T6.425 12q0-.2.062-.375T6.7 11.3l8.425-8.425q.35-.35.875-.35t.9.375q.375.375.375.875t-.375.875L9.55 12l7.35 7.35q.35.35.35.863t-.375.887q-.375.375-.875.375t-.875-.375Z" />
18
+ viewBox="0 0 24 24"
19
+ width="16"
20
+ xmlns="http://www.w3.org/2000/svg">
21
+ <g :transform="transform">
22
+ <path
23
+ d="M15.125 21.1L6.7 12.7q-.15-.15-.213-.325T6.425 12q0-.2.062-.375T6.7 11.3l8.425-8.425q.35-.35.875-.35t.9.375q.375.375.375.875t-.375.875L9.55 12l7.35 7.35q.35.35.35.863t-.375.887q-.375.375-.875.375t-.875-.375Z"
24
+ fill="#c0c4cc"/>
22
25
  </g>
23
26
  </svg>
27
+ <svg v-else
28
+ @click.stop="clearSelected"
29
+ height="16"
30
+ viewBox="0 0 1024 1024"
31
+ width="16"
32
+ xmlns="http://www.w3.org/2000/svg">
33
+ <path
34
+ d="M512 14.8973037A497.1026963 497.1026963 0 1 0 1009.1026963 512 497.1026963 497.1026963 0 0 0 512 14.8973037z m219.96794311 628.83491082a62.13783703 62.13783703 0 0 1-88.23572859 88.23572859L512 599.61435022 380.26778548 731.96794311a62.13783703 62.13783703 0 0 1-88.23572859-88.23572859L424.38564978 512 292.03205689 380.26778548a62.13783703 62.13783703 0 0 1 88.23572859-88.23572859L512 424.38564978l131.73221452-132.35359289a62.13783703 62.13783703 0 0 1 88.23572859 88.23572859L599.61435022 512z"
35
+ fill="#c0c4cc"></path>
36
+ </svg>
37
+
24
38
  </span>
25
39
  <teleport to="body">
26
40
  <template v-if="!readonly">
@@ -35,7 +49,7 @@
35
49
  :class="option.disable ? 'disable': ''"
36
50
  @click.stop="handleClick(option)">
37
51
  <div class="countersign-image" v-if="multiple">
38
- <img v-if="option.active" :src="countersign" alt=""/>
52
+ <img v-if="option.active" :src="countersign" alt=""/>
39
53
  </div>
40
54
  <span>{{ option.label }}</span>
41
55
  </li>
@@ -48,15 +62,17 @@
48
62
  </onClickOutSide>
49
63
  </template>
50
64
  <script setup>
51
- import { ref } from 'vue'
65
+ import {ref} from 'vue'
66
+
52
67
  let dropdown = ref(null)
53
68
  </script>
54
69
  <script>
55
70
  import onClickOutSide from './onClickOutSide.vue'
56
- import { defineComponent } from 'vue'
71
+ import {defineComponent} from 'vue'
72
+
57
73
  export default defineComponent({
58
74
  name: 'zydx-select',
59
- components: { onClickOutSide },
75
+ components: {onClickOutSide},
60
76
  props: {
61
77
  options: {
62
78
  type: Array,
@@ -102,7 +118,7 @@ export default defineComponent({
102
118
  countersign: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACQ9JREFUeF7tnX1SGzkQRzXevUfITZyTZEhtUtxi4RYspMzcBG6yzkFiL1/ZfIEttbo1mu6X/1KWWur361eDwQVD4h8EIPAqgQE2EIDA6wQQhOmAwAECCMJ4QABBmAEIyAjwBJFxY1cQAggSJGjalBFAEBk3dgUhgCBBgqZNGQEEkXFjVxACCBIkaNqUEUAQGTd2BSGAIEGCpk0ZAQSRcWNXEAIIEiRo2pQRQBAZN3YFIYAgQYKmTRkBBJFxY1cQAggSJGjalBFAEBk3dgUhgCBBgqZNGQE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iRBDsMxtisdQpDZJUEOuwk2rhxGkNkkQQ7jEbYtH0qQ5pIgh+30NqgeTpBmkiBHg/G1PyKkIOaSIIf95DY6IawgZpIgR6PRbXNMaEHUJUGONlPb8JTwgqhJghwNx7bdUQjyzHocz07Sancr+kg7crSb2MYnIcgPwEWSIEfjkW17HIL8wvtRkuHrTRqGdUYU59Pm6iJjHUsWSgBBXgju+Uny/v6l81dy3abV6nT6fHm30Ny5diYBBDkA6lGUP9NJ2n09SWl4k9L+y7S5njLZsswBAQRxECIt2BFAEDu2VHZAAEEchEgLdgQQxI4tlR0QQBAHIdKCHQEEsWNLZQcEEMRBiLRgRwBB7NhS2QEBBHEQIi3YEUAQO7ZUdkAAQRyESAt2BBDEji2VHRBAEAch0oIdAQSxY0tlBwQQxEGItGBHAEHs2FLZAQEEcRAiLdgRQBA7tlR2QABBHIRIC3YEEMSOLZUdEEAQByHSgh0BBLFjS2UHBBDEQYi0YEcAQezYUtkBAQRxECIt2BFAEDu2VHZAAEEchEgLdgQQxI4tlR0QQBAHIdKCHQEEsWNLZQcEEMRBiLRgRwBB7NhS2QEBBHEQIi3YEUAQO7ZUdkAAQRyESAt2BBDEji2VHRBAEAch0oIdAQSxY0tlBwQQxEGItGBH4D+fO44FzoWiMAAAAABJRU5ErkJggg=='
103
119
  }
104
120
  },
105
- emits: ['update:value', 'select'],
121
+ emits: ['update:value', 'select', 'clear'],
106
122
  methods: {
107
123
  mouseleave() {
108
124
  this.isOpen = false
@@ -110,29 +126,39 @@ export default defineComponent({
110
126
  },
111
127
  toggleDropDown: function () {
112
128
  const winHeight = window.innerHeight
113
- const { x, y, width, height } = this.$refs.selectRef.getBoundingClientRect()
129
+ const {x, y, width, height} = this.$refs.selectRef.getBoundingClientRect()
114
130
  this.x = x
115
131
  this.y = y + height
116
132
  this.width = width
117
133
  this.height = (winHeight - this.y) - 50
118
134
  this.isOpen = !this.isOpen
119
- if(this.isOpen) {
135
+ if (this.isOpen) {
120
136
  window.addEventListener('scroll', this.handler)
121
- }else {
137
+ } else {
122
138
  window.removeEventListener('scroll', this.handler)
123
139
  }
124
140
  },
141
+ clearSelected: function () {
142
+ this.selected = ''
143
+ if (this.multiple) {
144
+ this.options.forEach(x => {
145
+ x.active = false
146
+ })
147
+ }
148
+ this.$emit('update:value', this.selected)
149
+ this.$emit('clear', 'clear')
150
+ },
125
151
  handleClick: function (option) {
126
- if(option.disable) return
127
- if(this.multiple) {
152
+ if (option.disable) return
153
+ if (this.multiple) {
128
154
  option.active = !option.active
129
155
  let value = ''
130
156
  this.options.forEach(x => {
131
- if(x.active) value += `${x.value},`
157
+ if (x.active) value += `${x.value},`
132
158
  })
133
159
  this.$emit('update:value', value.slice(0, -1))
134
- this.$emit('select', option)
135
- }else {
160
+ this.$emit('select', {label: option.label, value: option.value})
161
+ } else {
136
162
  this.$emit('update:value', option.value)
137
163
  this.$emit('select', option)
138
164
  this.isOpen = false
@@ -157,17 +183,18 @@ export default defineComponent({
157
183
  watch: {
158
184
  value: {
159
185
  handler: function (v) {
186
+ v = String(v)
160
187
  if (!v || !this.options.length) {
161
188
  this.selected = ''
162
189
  return
163
190
  }
164
- const data = this.multiple? v.split(',') : v.split(',')[0]
191
+ const data = v.split(',')
165
192
  let label = ''
166
193
  this.options.forEach(x => {
167
- if(data.includes(x.value)) {
194
+ if (data.includes(String(x.value))) {
168
195
  x.active = true
169
196
  label += `${x.label}、`
170
- }else {
197
+ } else {
171
198
  x.active = false
172
199
  }
173
200
  })
@@ -180,7 +207,7 @@ export default defineComponent({
180
207
  })
181
208
 
182
209
  </script>
183
- <style scoped>
210
+ <style scoped>
184
211
  .v-enter-active,
185
212
  .v-leave-active {
186
213
  transition: opacity 0.5s ease;
@@ -203,7 +230,7 @@ export default defineComponent({
203
230
  margin-bottom: 1em;
204
231
  }
205
232
 
206
- .countersign-image{
233
+ .countersign-image {
207
234
  width: 14px;
208
235
  height: 14px;
209
236
  margin-right: 5px;
@@ -211,7 +238,8 @@ export default defineComponent({
211
238
  top: 2px;
212
239
  display: inline-block;
213
240
  }
214
- .countersign-image>img{
241
+
242
+ .countersign-image > img {
215
243
  width: 100%;
216
244
  height: 100%;
217
245
  }
@@ -296,14 +324,17 @@ export default defineComponent({
296
324
  .custom-select-options::-webkit-scrollbar {
297
325
  display: none;
298
326
  }
327
+
299
328
  .custom-select-options {
300
329
  scrollbar-width: none;
301
330
  }
331
+
302
332
  /** IE 与微软浏览器 **/
303
333
  .custom-select-options {
304
334
  -ms-overflow-style: none;
305
335
  overflow: -moz-scrollbars-none;
306
336
  }
337
+
307
338
  .custom-select-options li {
308
339
  padding: 0 10px;
309
340
  font-size: 14px;
@@ -235,6 +235,9 @@ export default {
235
235
  },
236
236
  // 添加快照
237
237
  setSnapshot(v) {
238
+ if(this.isEmpty(v)){
239
+ v = clearJson
240
+ }
238
241
  editorAPP.store?.loadSnapshot(v)
239
242
  this.isFocused()
240
243
  },
@@ -542,6 +545,16 @@ export default {
542
545
  editorAPP?.updateInstanceState({isFocused: true})
543
546
  document.documentElement.scrollTop = top
544
547
  }, 10)
548
+ },
549
+ isEmpty(v) {
550
+ if (Array.isArray(v)) {
551
+ return v.length === 0
552
+ }
553
+ if (v === undefined || v === null || v === '' || v === '0' || v === 0 || v === 'null') {
554
+ return true
555
+ } else {
556
+ return typeof v === 'object' && Object.keys(v).length === 0;
557
+ }
545
558
  }
546
559
  }
547
560
  }
@@ -44,7 +44,7 @@
44
44
  <div v-if="item.type === 'file'" class="file-cont">
45
45
  <em>{{ fileName }}</em>
46
46
  <label>
47
- <span class="but">上传</span>
47
+ <span class="but">选择文件</span>
48
48
  <input class="file" :accept="item.accept" @change="fileTap($event,index)" type="file"/>
49
49
  </label>
50
50
  </div>
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.610',
90
+ version: '1.35.612',
91
91
  install,
92
92
  Calendar,
93
93
  Message,