matrix_components 2.0.389 → 2.0.391
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 +1 -1
- package/dist/ComponentDemo/FormDemo copy 2.vue +56 -33
- package/dist/ComponentDemo/FormDemo copy.vue +65 -40
- package/dist/ComponentDemo/FormDemo.vue +46 -43
- package/dist/matrix_components.css +1 -1
- package/dist/matrix_components.js +10 -10
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
</template>
|
|
73
73
|
|
|
74
74
|
<script setup lang="ts">
|
|
75
|
-
import { ElInput, ElMessage, ElRadioGroup, ElCascader } from 'element-plus'
|
|
75
|
+
import { ElInput, ElMessage, ElRadioGroup, ElCascader, ElSwitch } from 'element-plus'
|
|
76
76
|
import { h, onMounted, reactive, ref } from 'vue'
|
|
77
77
|
import { cloneDeep } from 'lodash-es'
|
|
78
78
|
import { nextTick } from 'vue'
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
const props = defineProps({
|
|
81
81
|
readOnly: {
|
|
82
82
|
type: Boolean,
|
|
83
|
-
default:
|
|
83
|
+
default: false
|
|
84
84
|
},
|
|
85
85
|
row: {
|
|
86
86
|
type: Object,
|
|
@@ -99,6 +99,26 @@ const row4Ref = ref()
|
|
|
99
99
|
readOnly: props.readOnly,
|
|
100
100
|
model: props.readOnly ? '' : 'vertical',
|
|
101
101
|
rows: [
|
|
102
|
+
[
|
|
103
|
+
{
|
|
104
|
+
key: "isEnable",
|
|
105
|
+
label: "是否启用",
|
|
106
|
+
value: false,
|
|
107
|
+
component: ElSwitch,
|
|
108
|
+
params: {
|
|
109
|
+
rules: [
|
|
110
|
+
{
|
|
111
|
+
required: true,
|
|
112
|
+
message: "请选择",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
width: 60,
|
|
116
|
+
'inline-prompt': true,
|
|
117
|
+
'active-text':"启用",
|
|
118
|
+
'inactive-text':"禁用",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
102
122
|
[
|
|
103
123
|
{
|
|
104
124
|
key: 'confidence',
|
|
@@ -206,7 +226,7 @@ const row4Ref = ref()
|
|
|
206
226
|
{
|
|
207
227
|
key: 'save_video',
|
|
208
228
|
label: '是否保存视频',
|
|
209
|
-
value:
|
|
229
|
+
value: false,
|
|
210
230
|
component: ElRadioGroup,
|
|
211
231
|
params: {
|
|
212
232
|
rules: [
|
|
@@ -423,15 +443,6 @@ const row4Ref = ref()
|
|
|
423
443
|
events: {
|
|
424
444
|
change: (value) => getAreasHandler(value),
|
|
425
445
|
},
|
|
426
|
-
params: {
|
|
427
|
-
rules: [
|
|
428
|
-
{
|
|
429
|
-
required: true,
|
|
430
|
-
message: '请输入',
|
|
431
|
-
trigger: 'change',
|
|
432
|
-
},
|
|
433
|
-
],
|
|
434
|
-
},
|
|
435
446
|
},
|
|
436
447
|
{ value: ' ' },
|
|
437
448
|
])
|
|
@@ -489,9 +500,9 @@ const row4Ref = ref()
|
|
|
489
500
|
}
|
|
490
501
|
|
|
491
502
|
async function getDetail() {
|
|
492
|
-
// 模拟获取详情数据
|
|
493
503
|
setTimeout(()=>{
|
|
494
504
|
const res = {
|
|
505
|
+
"isEnable": true,
|
|
495
506
|
"confidence": "aaa1",
|
|
496
507
|
"iou": "1",
|
|
497
508
|
"timeInterval": "2",
|
|
@@ -505,27 +516,39 @@ const row4Ref = ref()
|
|
|
505
516
|
"department": ["company","tech","frontend"],
|
|
506
517
|
"single_level_cascader": "shanghai"
|
|
507
518
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
519
|
+
|
|
520
|
+
row1Ref.value?.setFormData?.(res,true)
|
|
521
|
+
row2Ref.value?.setFormData?.(res,true)
|
|
522
|
+
row3Ref.value?.setFormData?.(res,true)
|
|
523
|
+
row4Ref.value?.setFormData?.(res,true)
|
|
524
|
+
// 特殊处理
|
|
525
|
+
// if (res.det_area_mode === 'abnormal') {
|
|
526
|
+
// detAreaModeChange('abnormal')
|
|
527
|
+
// }
|
|
528
|
+
|
|
529
|
+
setTimeout(()=>{
|
|
530
|
+
const res = {
|
|
531
|
+
"isEnable": true,
|
|
532
|
+
"confidence": "aaa1",
|
|
533
|
+
"iou": "1",
|
|
534
|
+
"timeInterval": "2",
|
|
535
|
+
"stuck_threshold": "3",
|
|
536
|
+
"max_retries": "4",
|
|
537
|
+
"save_video": true,
|
|
538
|
+
"pre_buffer_second": "5",
|
|
539
|
+
"det_area_mode": "normal",
|
|
540
|
+
"det_area_json": "6",
|
|
541
|
+
"region": ["beijing", "haidian"],
|
|
542
|
+
"department": ["company","tech","frontend"],
|
|
543
|
+
"single_level_cascader": "shanghai"
|
|
527
544
|
}
|
|
528
|
-
|
|
545
|
+
|
|
546
|
+
row1Ref.value?.setFormData?.(res,true)
|
|
547
|
+
row2Ref.value?.setFormData?.(res,true)
|
|
548
|
+
row3Ref.value?.setFormData?.(res,true)
|
|
549
|
+
row4Ref.value?.setFormData?.(res,true)
|
|
550
|
+
// 特殊处理
|
|
551
|
+
}, 2000)
|
|
529
552
|
}, 2000)
|
|
530
553
|
}
|
|
531
554
|
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
</template>
|
|
73
73
|
|
|
74
74
|
<script setup lang="ts">
|
|
75
|
-
import { ElInput, ElMessage, ElRadioGroup, ElCascader } from 'element-plus'
|
|
75
|
+
import { ElInput, ElMessage, ElRadioGroup, ElCascader, ElSwitch } from 'element-plus'
|
|
76
76
|
import { h, onMounted, reactive, ref } from 'vue'
|
|
77
77
|
import { cloneDeep } from 'lodash-es'
|
|
78
78
|
import { nextTick } from 'vue'
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
const props = defineProps({
|
|
81
81
|
readOnly: {
|
|
82
82
|
type: Boolean,
|
|
83
|
-
default: false
|
|
83
|
+
default: false
|
|
84
84
|
},
|
|
85
85
|
row: {
|
|
86
86
|
type: Object,
|
|
@@ -99,6 +99,26 @@ const row4Ref = ref()
|
|
|
99
99
|
readOnly: props.readOnly,
|
|
100
100
|
model: props.readOnly ? '' : 'vertical',
|
|
101
101
|
rows: [
|
|
102
|
+
[
|
|
103
|
+
{
|
|
104
|
+
key: "isEnable",
|
|
105
|
+
label: "是否启用",
|
|
106
|
+
value: false,
|
|
107
|
+
component: ElSwitch,
|
|
108
|
+
params: {
|
|
109
|
+
rules: [
|
|
110
|
+
{
|
|
111
|
+
required: true,
|
|
112
|
+
message: "请选择",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
width: 60,
|
|
116
|
+
'inline-prompt': true,
|
|
117
|
+
'active-text':"启用",
|
|
118
|
+
'inactive-text':"禁用",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
102
122
|
[
|
|
103
123
|
{
|
|
104
124
|
key: 'confidence',
|
|
@@ -206,7 +226,7 @@ const row4Ref = ref()
|
|
|
206
226
|
{
|
|
207
227
|
key: 'save_video',
|
|
208
228
|
label: '是否保存视频',
|
|
209
|
-
value:
|
|
229
|
+
value: false,
|
|
210
230
|
component: ElRadioGroup,
|
|
211
231
|
params: {
|
|
212
232
|
rules: [
|
|
@@ -336,14 +356,18 @@ const row4Ref = ref()
|
|
|
336
356
|
{
|
|
337
357
|
key: 'department',
|
|
338
358
|
label: '部门选择',
|
|
339
|
-
value: '
|
|
359
|
+
value: ['company'],
|
|
340
360
|
component: ElCascader,
|
|
341
361
|
params: {
|
|
342
362
|
props: {
|
|
343
363
|
value: 'code',
|
|
344
364
|
label: 'name',
|
|
345
365
|
children: 'subDepartments',
|
|
366
|
+
showPrefix: false,
|
|
367
|
+
checkStrictly: true,
|
|
368
|
+
checkOnClickNode: true,
|
|
346
369
|
},
|
|
370
|
+
separator: ',',
|
|
347
371
|
options: [
|
|
348
372
|
{
|
|
349
373
|
code: 'company',
|
|
@@ -404,10 +428,11 @@ const row4Ref = ref()
|
|
|
404
428
|
})
|
|
405
429
|
|
|
406
430
|
function detAreaModeChange(value: any) {
|
|
431
|
+
debugger
|
|
432
|
+
if (state.rows3?.length && state.rows3[state.rows3.length - 1]?.[0]?.key === 'det_area_json') {
|
|
433
|
+
state.rows3.pop()
|
|
434
|
+
}
|
|
407
435
|
if (value === 'abnormal') {
|
|
408
|
-
if (state.rows3?.length && state.rows3[state.rows3.length - 1]?.[0]?.key === 'det_area_json') {
|
|
409
|
-
state.rows3.pop()
|
|
410
|
-
}
|
|
411
436
|
state.rows3.push([
|
|
412
437
|
{
|
|
413
438
|
key: 'det_area_json',
|
|
@@ -419,20 +444,9 @@ const row4Ref = ref()
|
|
|
419
444
|
events: {
|
|
420
445
|
change: (value) => getAreasHandler(value),
|
|
421
446
|
},
|
|
422
|
-
params: {
|
|
423
|
-
rules: [
|
|
424
|
-
{
|
|
425
|
-
required: true,
|
|
426
|
-
message: '请输入',
|
|
427
|
-
trigger: 'change',
|
|
428
|
-
},
|
|
429
|
-
],
|
|
430
|
-
},
|
|
431
447
|
},
|
|
432
448
|
{ value: ' ' },
|
|
433
449
|
])
|
|
434
|
-
} else {
|
|
435
|
-
state.rows3.pop()
|
|
436
450
|
}
|
|
437
451
|
}
|
|
438
452
|
|
|
@@ -485,9 +499,9 @@ const row4Ref = ref()
|
|
|
485
499
|
}
|
|
486
500
|
|
|
487
501
|
async function getDetail() {
|
|
488
|
-
// 模拟获取详情数据
|
|
489
502
|
setTimeout(()=>{
|
|
490
503
|
const res = {
|
|
504
|
+
"isEnable": true,
|
|
491
505
|
"confidence": "aaa1",
|
|
492
506
|
"iou": "1",
|
|
493
507
|
"timeInterval": "2",
|
|
@@ -498,30 +512,41 @@ const row4Ref = ref()
|
|
|
498
512
|
"det_area_mode": "abnormal",
|
|
499
513
|
"det_area_json": "6",
|
|
500
514
|
"region": ["beijing", "haidian"],
|
|
501
|
-
"department": "tech",
|
|
515
|
+
"department": ["company","tech","frontend"],
|
|
502
516
|
"single_level_cascader": "shanghai"
|
|
503
517
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
518
|
+
|
|
519
|
+
row1Ref.value?.setFormData?.(res,false)
|
|
520
|
+
row2Ref.value?.setFormData?.(res,false)
|
|
521
|
+
row3Ref.value?.setFormData?.(res,false)
|
|
522
|
+
row4Ref.value?.setFormData?.(res,false)
|
|
523
|
+
// 特殊处理
|
|
524
|
+
detAreaModeChange('abnormal')
|
|
525
|
+
|
|
526
|
+
setTimeout(()=>{
|
|
527
|
+
const res = {
|
|
528
|
+
"isEnable": true,
|
|
529
|
+
"confidence": "aaa1",
|
|
530
|
+
"iou": "1",
|
|
531
|
+
"timeInterval": "2",
|
|
532
|
+
"stuck_threshold": "3",
|
|
533
|
+
"max_retries": "4",
|
|
534
|
+
"save_video": true,
|
|
535
|
+
"pre_buffer_second": "5",
|
|
536
|
+
"det_area_mode": "normal",
|
|
537
|
+
"det_area_json": "6",
|
|
538
|
+
"region": ["beijing", "haidian"],
|
|
539
|
+
"department": ["company","tech","frontend"],
|
|
540
|
+
"single_level_cascader": "shanghai"
|
|
523
541
|
}
|
|
524
|
-
|
|
542
|
+
|
|
543
|
+
row1Ref.value?.setFormData?.(res,false)
|
|
544
|
+
row2Ref.value?.setFormData?.(res,false)
|
|
545
|
+
row3Ref.value?.setFormData?.(res,false)
|
|
546
|
+
row4Ref.value?.setFormData?.(res,false)
|
|
547
|
+
detAreaModeChange('normal')
|
|
548
|
+
|
|
549
|
+
}, 2000)
|
|
525
550
|
}, 2000)
|
|
526
551
|
}
|
|
527
552
|
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
const props = defineProps({
|
|
81
81
|
readOnly: {
|
|
82
82
|
type: Boolean,
|
|
83
|
-
default:
|
|
83
|
+
default: false
|
|
84
84
|
},
|
|
85
85
|
row: {
|
|
86
86
|
type: Object,
|
|
@@ -428,11 +428,17 @@ const row4Ref = ref()
|
|
|
428
428
|
})
|
|
429
429
|
|
|
430
430
|
function detAreaModeChange(value: any) {
|
|
431
|
+
// 使用深拷贝创建新的数组,确保响应式更新
|
|
432
|
+
const newRows3 = cloneDeep(state.rows3)
|
|
433
|
+
|
|
434
|
+
// 检查最后一项是否是 det_area_json
|
|
435
|
+
const lastItem = newRows3[newRows3.length - 1]?.[0]
|
|
436
|
+
if (lastItem?.key === 'det_area_json') {
|
|
437
|
+
newRows3.pop()
|
|
438
|
+
}
|
|
439
|
+
|
|
431
440
|
if (value === 'abnormal') {
|
|
432
|
-
|
|
433
|
-
state.rows3.pop()
|
|
434
|
-
}
|
|
435
|
-
state.rows3.push([
|
|
441
|
+
newRows3.push([
|
|
436
442
|
{
|
|
437
443
|
key: 'det_area_json',
|
|
438
444
|
label: '感兴趣区域',
|
|
@@ -440,33 +446,19 @@ const row4Ref = ref()
|
|
|
440
446
|
readOnlyUseComponent: true,
|
|
441
447
|
component: CustomUIs,
|
|
442
448
|
span: 6,
|
|
443
|
-
events: {
|
|
444
|
-
change: (value) => getAreasHandler(value),
|
|
445
|
-
},
|
|
446
|
-
params: {
|
|
447
|
-
rules: [
|
|
448
|
-
{
|
|
449
|
-
required: true,
|
|
450
|
-
message: '请输入',
|
|
451
|
-
trigger: 'change',
|
|
452
|
-
},
|
|
453
|
-
],
|
|
454
|
-
},
|
|
455
449
|
},
|
|
456
450
|
{ value: ' ' },
|
|
457
451
|
])
|
|
458
|
-
} else {
|
|
459
|
-
state.rows3.pop()
|
|
460
452
|
}
|
|
453
|
+
|
|
454
|
+
// 使用赋值操作触发响应式更新
|
|
455
|
+
state.rows3 = newRows3
|
|
461
456
|
}
|
|
462
457
|
|
|
463
458
|
function CustomUIs() {
|
|
464
459
|
return h('div', {style:'color: red', class:"xx"}, 'xxx')
|
|
465
460
|
}
|
|
466
461
|
|
|
467
|
-
function getAreasHandler(value: any) {
|
|
468
|
-
state.rows3[state.rows3.length - 1][0].value = value
|
|
469
|
-
}
|
|
470
462
|
|
|
471
463
|
/**
|
|
472
464
|
* 保存
|
|
@@ -509,7 +501,6 @@ const row4Ref = ref()
|
|
|
509
501
|
}
|
|
510
502
|
|
|
511
503
|
async function getDetail() {
|
|
512
|
-
// 模拟获取详情数据
|
|
513
504
|
setTimeout(()=>{
|
|
514
505
|
const res = {
|
|
515
506
|
"isEnable": true,
|
|
@@ -526,27 +517,39 @@ const row4Ref = ref()
|
|
|
526
517
|
"department": ["company","tech","frontend"],
|
|
527
518
|
"single_level_cascader": "shanghai"
|
|
528
519
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
520
|
+
|
|
521
|
+
row1Ref.value?.setFormData?.(res,true)
|
|
522
|
+
row2Ref.value?.setFormData?.(res,true)
|
|
523
|
+
row3Ref.value?.setFormData?.(res,true)
|
|
524
|
+
row4Ref.value?.setFormData?.(res,true)
|
|
525
|
+
// 特殊处理
|
|
526
|
+
// if (res.det_area_mode === 'abnormal') {
|
|
527
|
+
// detAreaModeChange('abnormal')
|
|
528
|
+
// }
|
|
529
|
+
|
|
530
|
+
setTimeout(()=>{
|
|
531
|
+
const res = {
|
|
532
|
+
"isEnable": true,
|
|
533
|
+
"confidence": "aaa1",
|
|
534
|
+
"iou": "1",
|
|
535
|
+
"timeInterval": "2",
|
|
536
|
+
"stuck_threshold": "3",
|
|
537
|
+
"max_retries": "4",
|
|
538
|
+
"save_video": true,
|
|
539
|
+
"pre_buffer_second": "5",
|
|
540
|
+
"det_area_mode": "normal",
|
|
541
|
+
"det_area_json": "6",
|
|
542
|
+
"region": ["beijing", "haidian"],
|
|
543
|
+
"department": ["company","tech","frontend"],
|
|
544
|
+
"single_level_cascader": "shanghai"
|
|
548
545
|
}
|
|
549
|
-
|
|
546
|
+
|
|
547
|
+
row1Ref.value?.setFormData?.(res,true)
|
|
548
|
+
row2Ref.value?.setFormData?.(res,true)
|
|
549
|
+
row3Ref.value?.setFormData?.(res,true)
|
|
550
|
+
row4Ref.value?.setFormData?.(res,true)
|
|
551
|
+
// 特殊处理
|
|
552
|
+
}, 2000)
|
|
550
553
|
}, 2000)
|
|
551
554
|
}
|
|
552
555
|
|