matrix_components 2.0.478 → 2.0.500
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/README.md +7 -0
- package/dist/ComponentDemo/FormDemo.vue +118 -1
- package/dist/ComponentDemo/ImageDemo.vue +4 -3
- package/dist/ComponentDemo/MDDemo.vue +7 -2
- package/dist/matrix_components.css +1 -1
- package/dist/matrix_components.js +35 -23
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -33,6 +33,13 @@ Matrix Components 是一个功能丰富的 Vue 3 企业级组件库,提供办
|
|
|
33
33
|
### 浸润线:
|
|
34
34
|

|
|
35
35
|
|
|
36
|
+
```
|
|
37
|
+
version:2.0.500
|
|
38
|
+
2026-01-23
|
|
39
|
+
更新日志:
|
|
40
|
+
1.修改NsSaturationLine文字字体
|
|
41
|
+
```
|
|
42
|
+
|
|
36
43
|
```
|
|
37
44
|
version:2.0.478
|
|
38
45
|
2026-01-13
|
|
@@ -66,6 +66,20 @@
|
|
|
66
66
|
gapV="10px"
|
|
67
67
|
></NsForm>
|
|
68
68
|
</NsFormTitle>
|
|
69
|
+
<NsFormTitle title="一维数组配置(新功能)">
|
|
70
|
+
<NsForm
|
|
71
|
+
ref="row5Ref"
|
|
72
|
+
:readOnly="state.readOnly"
|
|
73
|
+
backgroundColor="#fff"
|
|
74
|
+
:model="state.model"
|
|
75
|
+
:rows="state.rows5"
|
|
76
|
+
formPropKey="rows5"
|
|
77
|
+
labelColor="#606266"
|
|
78
|
+
labelWidth="150"
|
|
79
|
+
gapH="300px"
|
|
80
|
+
gapV="10px"
|
|
81
|
+
></NsForm>
|
|
82
|
+
</NsFormTitle>
|
|
69
83
|
</el-form>
|
|
70
84
|
</div>
|
|
71
85
|
</div>
|
|
@@ -115,6 +129,7 @@ const row1Ref = ref()
|
|
|
115
129
|
const row2Ref = ref()
|
|
116
130
|
const row3Ref = ref()
|
|
117
131
|
const row4Ref = ref()
|
|
132
|
+
const row5Ref = ref()
|
|
118
133
|
|
|
119
134
|
const state = reactive({
|
|
120
135
|
formData: {},
|
|
@@ -481,6 +496,104 @@ const state = reactive({
|
|
|
481
496
|
},
|
|
482
497
|
],
|
|
483
498
|
],
|
|
499
|
+
// 一维数组配置示例 - 使用span属性控制布局,支持自动换行
|
|
500
|
+
// 说明:当一行中的span总和达到24时,会自动换到下一行
|
|
501
|
+
// 第一行:field1(6) + field2(6) + field3(6) + field4(6) = 24(满行)
|
|
502
|
+
// 第二行:field5(12) + field6(12) = 24(满行)
|
|
503
|
+
// 第三行:field7(8) + field8(8) + field9(8) = 24(满行)
|
|
504
|
+
// 第四行:field10(40%≈10) + field11(60%≈14) = 24(满行)
|
|
505
|
+
// 第五行:field12和field13未配置span,自动平分剩余空间
|
|
506
|
+
rows5: [
|
|
507
|
+
{
|
|
508
|
+
key: 'field1',
|
|
509
|
+
label: '字段1(25%)',
|
|
510
|
+
value: '',
|
|
511
|
+
component: 'ElInput',
|
|
512
|
+
span: 6,
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
key: 'field2',
|
|
516
|
+
label: '字段2(25%)',
|
|
517
|
+
value: '',
|
|
518
|
+
component: 'ElInput',
|
|
519
|
+
span: 6,
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
key: 'field3',
|
|
523
|
+
label: '字段3(25%)',
|
|
524
|
+
value: '',
|
|
525
|
+
component: 'ElInput',
|
|
526
|
+
span: 6,
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
key: 'field4',
|
|
530
|
+
label: '字段4(25%)',
|
|
531
|
+
value: '',
|
|
532
|
+
component: 'ElInput',
|
|
533
|
+
span: 6,
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
key: 'field5',
|
|
537
|
+
label: '字段5(50%)',
|
|
538
|
+
value: '',
|
|
539
|
+
component: 'ElInput',
|
|
540
|
+
span: 12,
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
key: 'field6',
|
|
544
|
+
label: '字段6(50%)',
|
|
545
|
+
value: '',
|
|
546
|
+
component: 'ElInput',
|
|
547
|
+
span: 12,
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
key: 'field7',
|
|
551
|
+
label: '字段7(33.33%)',
|
|
552
|
+
value: '',
|
|
553
|
+
component: 'ElInput',
|
|
554
|
+
span: 8,
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
key: 'field8',
|
|
558
|
+
label: '字段8(33.33%)',
|
|
559
|
+
value: '',
|
|
560
|
+
component: 'ElInput',
|
|
561
|
+
span: 8,
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
key: 'field9',
|
|
565
|
+
label: '字段9(33.33%)',
|
|
566
|
+
value: '',
|
|
567
|
+
component: 'ElInput',
|
|
568
|
+
span: 8,
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
key: 'field10',
|
|
572
|
+
label: '字段10(使用百分比40%)',
|
|
573
|
+
value: '',
|
|
574
|
+
component: 'ElInput',
|
|
575
|
+
span: '40%',
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
key: 'field11',
|
|
579
|
+
label: '字段11(使用百分比60%)',
|
|
580
|
+
value: '',
|
|
581
|
+
component: 'ElInput',
|
|
582
|
+
span: '60%',
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
key: 'field12',
|
|
586
|
+
label: '字段12(自动平分)',
|
|
587
|
+
value: '',
|
|
588
|
+
component: 'ElInput',
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
key: 'field13',
|
|
592
|
+
label: '字段13(自动平分)',
|
|
593
|
+
value: '',
|
|
594
|
+
component: 'ElInput',
|
|
595
|
+
},
|
|
596
|
+
],
|
|
484
597
|
})
|
|
485
598
|
|
|
486
599
|
function changeHandler(v) {
|
|
@@ -527,7 +640,8 @@ async function getFormData() {
|
|
|
527
640
|
const data2 = row2Ref.value?.getFormKvData?.()
|
|
528
641
|
const data3 = row3Ref.value?.getFormKvData?.()
|
|
529
642
|
const data4 = row4Ref.value?.getFormKvData?.()
|
|
530
|
-
const
|
|
643
|
+
const data5 = row5Ref.value?.getFormKvData?.()
|
|
644
|
+
const data = { ...data1, ...data2, ...data3, ...data4, ...data5 }
|
|
531
645
|
state.formData = data
|
|
532
646
|
ElMessage.success('表单校验成功')
|
|
533
647
|
return data
|
|
@@ -542,6 +656,7 @@ async function resetFormData() {
|
|
|
542
656
|
row2Ref.value?.resetForm?.()
|
|
543
657
|
row3Ref.value?.resetForm?.()
|
|
544
658
|
row4Ref.value?.resetForm?.()
|
|
659
|
+
row5Ref.value?.resetForm?.()
|
|
545
660
|
setTimeout(() => {
|
|
546
661
|
// 重置表单验证状态
|
|
547
662
|
formRef.value?.clearValidate?.()
|
|
@@ -572,11 +687,13 @@ async function getDetail() {
|
|
|
572
687
|
row2Ref.value?.resetForm()
|
|
573
688
|
row3Ref.value?.resetForm()
|
|
574
689
|
row4Ref.value?.resetForm()
|
|
690
|
+
row5Ref.value?.resetForm()
|
|
575
691
|
setTimeout(() => {
|
|
576
692
|
row1Ref.value?.setFormData?.(res)
|
|
577
693
|
row2Ref.value?.setFormData?.(res)
|
|
578
694
|
row3Ref.value?.setFormData?.(res)
|
|
579
695
|
row4Ref.value?.setFormData?.(res)
|
|
696
|
+
row5Ref.value?.setFormData?.(res)
|
|
580
697
|
}, 10)
|
|
581
698
|
return
|
|
582
699
|
// 特殊处理
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<NsImage :src="src" :apiUrl="apiUrl" :hasPreview="hasPreview">
|
|
3
3
|
<img
|
|
4
|
-
:src="
|
|
4
|
+
:src="errorSrc"
|
|
5
5
|
style="width: 100%; height: 100%"
|
|
6
6
|
@click.stop
|
|
7
7
|
/>
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
12
|
import { reactive, ref } from 'vue';
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import src from '@/assets/b.jpg'
|
|
14
|
+
import errorSrc from '@/assets/a.png'
|
|
15
15
|
const hasPreview = ref(true)
|
|
16
16
|
const apiUrl = reactive( {
|
|
17
17
|
type: Object,
|
|
@@ -22,6 +22,7 @@ const apiUrl = reactive( {
|
|
|
22
22
|
params: {},
|
|
23
23
|
}),
|
|
24
24
|
})
|
|
25
|
+
|
|
25
26
|
</script>
|
|
26
27
|
<style lang="scss" scoped>
|
|
27
28
|
</style>
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
<script setup lang="ts" name="">
|
|
7
|
-
import { ref } from 'vue';
|
|
7
|
+
import { onMounted, ref } from 'vue';
|
|
8
|
+
const msg = ref()
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
onMounted(async () => {
|
|
11
|
+
const readme = await fetch(`${import.meta.env.VITE_BASE_URL}README.md`)
|
|
12
|
+
const txt = await readme.text();
|
|
13
|
+
msg.value = txt
|
|
14
|
+
})
|
|
10
15
|
</script>
|
|
11
16
|
<style lang="scss" scoped>
|
|
12
17
|
.dm {
|