adtec-core-package 2.9.2 → 2.9.4
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
|
@@ -26,7 +26,7 @@ enum WatchType {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const watchHandlers = ref<Partial<Record<WatchType, WatchStopHandle>>>({})
|
|
29
|
-
|
|
29
|
+
const emit = defineEmits(['onBlur', 'onChange'])
|
|
30
30
|
const divRef = ref()
|
|
31
31
|
let aiEditor: AiEditor | null
|
|
32
32
|
const props = withDefaults(
|
|
@@ -57,17 +57,17 @@ const props = withDefaults(
|
|
|
57
57
|
showToolbar: true,
|
|
58
58
|
borderWidth: '1px',
|
|
59
59
|
editorConfig: {},
|
|
60
|
-
isEdit: true
|
|
61
|
-
}
|
|
60
|
+
isEdit: true,
|
|
61
|
+
},
|
|
62
62
|
)
|
|
63
63
|
const model = defineModel({
|
|
64
64
|
type: [String, null, undefined],
|
|
65
65
|
required: false,
|
|
66
|
-
default: null
|
|
66
|
+
default: null,
|
|
67
67
|
})
|
|
68
68
|
const text = defineModel('text', {
|
|
69
69
|
type: String,
|
|
70
|
-
required: false
|
|
70
|
+
required: false,
|
|
71
71
|
})
|
|
72
72
|
//字体对照表
|
|
73
73
|
const fontSizes = [
|
|
@@ -86,7 +86,7 @@ const fontSizes = [
|
|
|
86
86
|
{ name: '小一', pt: 24, px: 28 },
|
|
87
87
|
{ name: '一号', pt: 26, px: 30 },
|
|
88
88
|
{ name: '小初', pt: 36, px: 42 },
|
|
89
|
-
{ name: '初号', pt: 42, px: 49 }
|
|
89
|
+
{ name: '初号', pt: 42, px: 49 },
|
|
90
90
|
]
|
|
91
91
|
|
|
92
92
|
function setDefaultPx(html: string) {
|
|
@@ -145,11 +145,11 @@ const defaultConfig = {
|
|
|
145
145
|
'video',
|
|
146
146
|
'ai',
|
|
147
147
|
'quote',
|
|
148
|
-
'emoji'
|
|
148
|
+
'emoji',
|
|
149
149
|
],
|
|
150
150
|
textSelectionBubbleMenu: {
|
|
151
151
|
enable: true,
|
|
152
|
-
items: ['Bold', 'Italic', 'Underline', 'Strike', 'code', 'comment']
|
|
152
|
+
items: ['Bold', 'Italic', 'Underline', 'Strike', 'code', 'comment'],
|
|
153
153
|
},
|
|
154
154
|
image: {
|
|
155
155
|
uploaderEvent: {
|
|
@@ -158,18 +158,18 @@ const defaultConfig = {
|
|
|
158
158
|
ElMessage.warning('图片大小不能超过2M')
|
|
159
159
|
return false
|
|
160
160
|
}
|
|
161
|
-
}
|
|
161
|
+
},
|
|
162
162
|
// onSuccess: (file, response) => {
|
|
163
163
|
// console.log('onSuccess', file, response)
|
|
164
164
|
// }
|
|
165
|
-
}
|
|
165
|
+
},
|
|
166
166
|
},
|
|
167
167
|
htmlPasteConfig: {
|
|
168
168
|
pasteProcessor: (html) => {
|
|
169
169
|
// return html;
|
|
170
170
|
// console.log('html:', html, 'xxxxxx', removeAllFontFamilyStyles(html))
|
|
171
171
|
return removeAllFontFamilyStyles(html)
|
|
172
|
-
}
|
|
172
|
+
},
|
|
173
173
|
},
|
|
174
174
|
fontSize: {
|
|
175
175
|
defaultValue: ' ',
|
|
@@ -190,17 +190,21 @@ const defaultConfig = {
|
|
|
190
190
|
{ name: '六号', value: 9 },
|
|
191
191
|
{ name: '小六', value: 8 },
|
|
192
192
|
{ name: '七号', value: 6 },
|
|
193
|
-
{ name: '八号', value: 5 }
|
|
194
|
-
]
|
|
193
|
+
{ name: '八号', value: 5 },
|
|
194
|
+
],
|
|
195
195
|
},
|
|
196
196
|
onChange: (editor: AiEditor) => {
|
|
197
|
+
emit('onChange', { html: editor.getHtml(), text: editor.getText() })
|
|
197
198
|
setFooter()
|
|
198
199
|
model.value = editor.getHtml()
|
|
199
200
|
text.value = editor.getText()
|
|
200
201
|
setTimeout(() => {
|
|
201
202
|
setContent()
|
|
202
203
|
}, 200)
|
|
203
|
-
}
|
|
204
|
+
},
|
|
205
|
+
onBlur: (editor: AiEditor) => {
|
|
206
|
+
emit('onBlur', { html: editor.getHtml(), text: editor.getText() })
|
|
207
|
+
},
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
/**
|
|
@@ -229,7 +233,7 @@ function removeAllFontFamilyStyles(html: string): string {
|
|
|
229
233
|
// 使用简化的正则表达式移除字体相关属性(现在可以安全地假设每个属性后都有分号)
|
|
230
234
|
style = style.replace(
|
|
231
235
|
/(?:font-family|mso-(?:ascii|hansi|bidi|fareast|east-asian|font)-font-family)\s*:\s*[^;]+;/gi,
|
|
232
|
-
''
|
|
236
|
+
'',
|
|
233
237
|
)
|
|
234
238
|
// 清理空样式
|
|
235
239
|
style = style.trim()
|
|
@@ -249,7 +253,7 @@ function removeAllFontFamilyStyles(html: string): string {
|
|
|
249
253
|
'mso-ascii-font-family',
|
|
250
254
|
'mso-fareast-font-family',
|
|
251
255
|
'mso-east-asian-font-family',
|
|
252
|
-
'mso-font-font-family'
|
|
256
|
+
'mso-font-font-family',
|
|
253
257
|
]
|
|
254
258
|
fontFamilyAttrs.forEach((attr) => element.removeAttribute(attr))
|
|
255
259
|
|
|
@@ -290,7 +294,7 @@ function calcImagesHeight(html: string) {
|
|
|
290
294
|
if (width > 1 && height > 1) {
|
|
291
295
|
map.set(
|
|
292
296
|
imageElement.src.length > 100 ? imageElement.src.substring(0, 100) : imageElement.src,
|
|
293
|
-
height
|
|
297
|
+
height,
|
|
294
298
|
)
|
|
295
299
|
}
|
|
296
300
|
})
|
|
@@ -306,7 +310,7 @@ function customStringReplacement(
|
|
|
306
310
|
startMarker: string,
|
|
307
311
|
endMarker: string,
|
|
308
312
|
target: string,
|
|
309
|
-
replacement: string
|
|
313
|
+
replacement: string,
|
|
310
314
|
): string {
|
|
311
315
|
let result = ''
|
|
312
316
|
let currentIndex = 0
|
|
@@ -362,8 +366,8 @@ onMounted(() => {
|
|
|
362
366
|
{ name: '微软雅黑', value: 'Microsoft YaHei' },
|
|
363
367
|
{ name: '方正仿宋简体_GBK', value: 'FangSong_GB2312' },
|
|
364
368
|
{ name: 'Arial', value: 'Arial' },
|
|
365
|
-
{ name: 'Times New Roman', value: 'Times New Roman' }
|
|
366
|
-
]
|
|
369
|
+
{ name: 'Times New Roman', value: 'Times New Roman' },
|
|
370
|
+
],
|
|
367
371
|
},
|
|
368
372
|
onCreated: (editor: AiEditor) => {
|
|
369
373
|
setFooter()
|
|
@@ -391,9 +395,9 @@ onMounted(() => {
|
|
|
391
395
|
}
|
|
392
396
|
}
|
|
393
397
|
},
|
|
394
|
-
{ immediate: true }
|
|
398
|
+
{ immediate: true },
|
|
395
399
|
)
|
|
396
|
-
}
|
|
400
|
+
},
|
|
397
401
|
}
|
|
398
402
|
// 隐藏工具栏
|
|
399
403
|
if (!props.showToolbar) {
|
|
@@ -403,7 +407,7 @@ onMounted(() => {
|
|
|
403
407
|
aiEditor = new AiEditor(config)
|
|
404
408
|
}, 100)
|
|
405
409
|
})
|
|
406
|
-
onActivated(()=>{
|
|
410
|
+
onActivated(() => {
|
|
407
411
|
const header = divRef.value?.querySelector('aie-header') as HTMLElement
|
|
408
412
|
if (header) {
|
|
409
413
|
const div = header.querySelector('div') as HTMLElement
|
|
@@ -423,7 +427,7 @@ const setFooter = () => {
|
|
|
423
427
|
if (footerSpan && footerSpan.textContent) {
|
|
424
428
|
footerSpan.textContent = footerSpan.textContent.replace(
|
|
425
429
|
'Powered by AiEditor, Characters',
|
|
426
|
-
'字数'
|
|
430
|
+
'字数',
|
|
427
431
|
)
|
|
428
432
|
}
|
|
429
433
|
}
|
|
@@ -452,7 +456,7 @@ defineExpose({
|
|
|
452
456
|
if (aiEditor) {
|
|
453
457
|
aiEditor.setContent(initHtml(html), focus)
|
|
454
458
|
}
|
|
455
|
-
}
|
|
459
|
+
},
|
|
456
460
|
})
|
|
457
461
|
</script>
|
|
458
462
|
<style scoped lang="scss">
|
|
@@ -79,6 +79,37 @@
|
|
|
79
79
|
overflow-x: scroll;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/* 仅显示外层滚动条:鼠标进入表格显示,移出隐藏 */
|
|
83
|
+
.vxe-table--scroll-x-handle,
|
|
84
|
+
.vxe-table--scroll-y-handle {
|
|
85
|
+
scrollbar-width: none;
|
|
86
|
+
-ms-overflow-style: none;
|
|
87
|
+
&::-webkit-scrollbar {
|
|
88
|
+
width: 8px;
|
|
89
|
+
height: 8px;
|
|
90
|
+
background: transparent;
|
|
91
|
+
}
|
|
92
|
+
&::-webkit-scrollbar-thumb {
|
|
93
|
+
background: transparent;
|
|
94
|
+
border-radius: 4px;
|
|
95
|
+
}
|
|
96
|
+
&::-webkit-scrollbar-track {
|
|
97
|
+
background: transparent;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.vxe-table:hover {
|
|
102
|
+
.vxe-table--scroll-x-handle,
|
|
103
|
+
.vxe-table--scroll-y-handle {
|
|
104
|
+
scrollbar-width: thin;
|
|
105
|
+
scrollbar-color: #DDDEE0 transparent;
|
|
106
|
+
}
|
|
107
|
+
.vxe-table--scroll-x-handle::-webkit-scrollbar-thumb,
|
|
108
|
+
.vxe-table--scroll-y-handle::-webkit-scrollbar-thumb {
|
|
109
|
+
background: #DDDEE0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
82
113
|
.vxe-loading--custom-wrapper {
|
|
83
114
|
display: none;
|
|
84
115
|
position: absolute;
|
|
@@ -573,10 +604,10 @@
|
|
|
573
604
|
}
|
|
574
605
|
}
|
|
575
606
|
.vxe-table--scroll-x-virtual {
|
|
576
|
-
height: 0;
|
|
607
|
+
height: 0 !important;
|
|
577
608
|
}
|
|
578
609
|
.vxe-table--scroll-y-virtual {
|
|
579
|
-
width:
|
|
610
|
+
width: 0px !important;
|
|
580
611
|
}
|
|
581
612
|
.vxe-table--scroll-x-virtual,
|
|
582
613
|
.vxe-table--scroll-y-virtual {
|
|
@@ -604,10 +635,10 @@
|
|
|
604
635
|
.vxe-table--scroll-x-handle {
|
|
605
636
|
overflow-y: hidden;
|
|
606
637
|
overflow-x: scroll;
|
|
607
|
-
height:
|
|
638
|
+
height: 8px;
|
|
608
639
|
}
|
|
609
640
|
.vxe-table--scroll-x-wrapper {
|
|
610
|
-
height:
|
|
641
|
+
height: 8px;
|
|
611
642
|
}
|
|
612
643
|
.vxe-table--scroll-y-handle,
|
|
613
644
|
.vxe-table--scroll-y-wrapper {
|
|
@@ -619,7 +650,7 @@
|
|
|
619
650
|
.vxe-table--scroll-y-handle {
|
|
620
651
|
overflow-y: scroll;
|
|
621
652
|
overflow-x: hidden;
|
|
622
|
-
width:
|
|
653
|
+
width: 8px;
|
|
623
654
|
height: 100%;
|
|
624
655
|
}
|
|
625
656
|
.vxe-table--scroll-x-space {
|
|
@@ -873,6 +904,7 @@
|
|
|
873
904
|
|
|
874
905
|
/*table*/
|
|
875
906
|
.vxe-table--render-default {
|
|
907
|
+
height:100%;
|
|
876
908
|
position: relative;
|
|
877
909
|
font-size: var(--vxe-ui-font-size-default);
|
|
878
910
|
color: var(--vxe-ui-font-color);
|
|
@@ -893,6 +925,12 @@
|
|
|
893
925
|
border-collapse: separate;
|
|
894
926
|
table-layout: fixed;
|
|
895
927
|
}
|
|
928
|
+
.vxe-table--render-wrapper{
|
|
929
|
+
height:100%;
|
|
930
|
+
.vxe-table--layout-wrapper {
|
|
931
|
+
height:100%
|
|
932
|
+
}
|
|
933
|
+
}
|
|
896
934
|
&:not(.is--empty) {
|
|
897
935
|
&.is--footer {
|
|
898
936
|
&.is--scroll-x {
|
|
@@ -1173,7 +1211,7 @@
|
|
|
1173
1211
|
&::after {
|
|
1174
1212
|
bottom: 0;
|
|
1175
1213
|
height: calc(100% + var(--vxe-ui-table-border-width));
|
|
1176
|
-
border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1214
|
+
//border-top: var(--vxe-ui-table-border-width) solid var(--vxe-ui-table-border-color);
|
|
1177
1215
|
}
|
|
1178
1216
|
}
|
|
1179
1217
|
}
|
package/src/utils/commonUtils.ts
CHANGED
|
@@ -316,7 +316,17 @@ export default {
|
|
|
316
316
|
return x >= a && x < b;
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
if (rule.includes('≤x≤')) {
|
|
320
|
+
const match = rule.match(/^([+-]?\d+(\.\d+)?)≤x≤([+-]?\d+(\.\d+)?)$/);
|
|
321
|
+
if (match) {
|
|
322
|
+
const a = parseFloat(match[1]);
|
|
323
|
+
const b = parseFloat(match[3]);
|
|
324
|
+
if (isNaN(a) || isNaN(b)) {
|
|
325
|
+
throw new Error(`Invalid rule values: ${match[1]} or ${match[3]}`);
|
|
326
|
+
}
|
|
327
|
+
return x >= a && x <= b;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
320
330
|
} catch (error) {
|
|
321
331
|
throw new Error(`Rule parsing error: ${(error as Error).message}`);
|
|
322
332
|
}
|