matrix_components 2.0.385 → 2.0.387
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 copy 2.vue +635 -0
- package/dist/ComponentDemo/FormDemo copy.vue +631 -0
- package/dist/ComponentDemo/FormDemo.vue +194 -13
- package/dist/ComponentDemo/VideoDemo.vue +2 -2
- package/dist/matrix_components.css +1 -1
- package/dist/matrix_components.js +137 -12
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -52,13 +52,27 @@
|
|
|
52
52
|
gapV="10px"
|
|
53
53
|
></NsForm>
|
|
54
54
|
</NsFormTitle>
|
|
55
|
+
<NsFormTitle title="级联选择器测试">
|
|
56
|
+
<NsForm
|
|
57
|
+
ref="row4Ref"
|
|
58
|
+
:readOnly="state.readOnly"
|
|
59
|
+
backgroundColor="#fff"
|
|
60
|
+
:model="state.model"
|
|
61
|
+
:rows="state.rows4"
|
|
62
|
+
formPropKey="rows4"
|
|
63
|
+
labelColor="#606266"
|
|
64
|
+
labelWidth="150"
|
|
65
|
+
gapH="20px"
|
|
66
|
+
gapV="10px"
|
|
67
|
+
></NsForm>
|
|
68
|
+
</NsFormTitle>
|
|
55
69
|
</el-form>
|
|
56
70
|
</div>
|
|
57
71
|
</div>
|
|
58
72
|
</template>
|
|
59
73
|
|
|
60
74
|
<script setup lang="ts">
|
|
61
|
-
import { ElInput, ElMessage, ElRadioGroup } from 'element-plus'
|
|
75
|
+
import { ElInput, ElMessage, ElRadioGroup, ElCascader, ElSwitch } from 'element-plus'
|
|
62
76
|
import { h, onMounted, reactive, ref } from 'vue'
|
|
63
77
|
import { cloneDeep } from 'lodash-es'
|
|
64
78
|
import { nextTick } from 'vue'
|
|
@@ -66,7 +80,7 @@
|
|
|
66
80
|
const props = defineProps({
|
|
67
81
|
readOnly: {
|
|
68
82
|
type: Boolean,
|
|
69
|
-
default:
|
|
83
|
+
default: true
|
|
70
84
|
},
|
|
71
85
|
row: {
|
|
72
86
|
type: Object,
|
|
@@ -74,16 +88,37 @@
|
|
|
74
88
|
},
|
|
75
89
|
})
|
|
76
90
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
const formRef = ref()
|
|
92
|
+
const row1Ref = ref()
|
|
93
|
+
const row2Ref = ref()
|
|
94
|
+
const row3Ref = ref()
|
|
95
|
+
const row4Ref = ref()
|
|
81
96
|
|
|
82
97
|
const state = reactive({
|
|
83
98
|
formData: {},
|
|
84
99
|
readOnly: props.readOnly,
|
|
85
100
|
model: props.readOnly ? '' : 'vertical',
|
|
86
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
|
+
],
|
|
87
122
|
[
|
|
88
123
|
{
|
|
89
124
|
key: 'confidence',
|
|
@@ -191,7 +226,7 @@
|
|
|
191
226
|
{
|
|
192
227
|
key: 'save_video',
|
|
193
228
|
label: '是否保存视频',
|
|
194
|
-
value:
|
|
229
|
+
value: false,
|
|
195
230
|
component: ElRadioGroup,
|
|
196
231
|
params: {
|
|
197
232
|
rules: [
|
|
@@ -203,11 +238,11 @@
|
|
|
203
238
|
],
|
|
204
239
|
options: [
|
|
205
240
|
{
|
|
206
|
-
value:
|
|
241
|
+
value: true,
|
|
207
242
|
label: '是',
|
|
208
243
|
},
|
|
209
244
|
{
|
|
210
|
-
value:
|
|
245
|
+
value: false,
|
|
211
246
|
label: '否',
|
|
212
247
|
},
|
|
213
248
|
],
|
|
@@ -264,6 +299,132 @@
|
|
|
264
299
|
},
|
|
265
300
|
],
|
|
266
301
|
],
|
|
302
|
+
rows4: [
|
|
303
|
+
[
|
|
304
|
+
{
|
|
305
|
+
key: 'region',
|
|
306
|
+
label: '地区选择',
|
|
307
|
+
value: ['beijing', 'chaoyang'],
|
|
308
|
+
component: ElCascader,
|
|
309
|
+
params: {
|
|
310
|
+
rules: [
|
|
311
|
+
{
|
|
312
|
+
required: true,
|
|
313
|
+
message: '请选择地区',
|
|
314
|
+
trigger: 'change',
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
props: {
|
|
318
|
+
showPrefix: false,
|
|
319
|
+
checkStrictly: true,
|
|
320
|
+
checkOnClickNode: true,
|
|
321
|
+
},
|
|
322
|
+
options: [
|
|
323
|
+
{
|
|
324
|
+
value: 'beijing',
|
|
325
|
+
label: '北京市',
|
|
326
|
+
children: [
|
|
327
|
+
{
|
|
328
|
+
value: 'chaoyang',
|
|
329
|
+
label: '朝阳区',
|
|
330
|
+
children: [
|
|
331
|
+
{
|
|
332
|
+
value: 'chaoyangmen',
|
|
333
|
+
label: '朝阳门街道',
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
value: 'haidian',
|
|
339
|
+
label: '海淀区',
|
|
340
|
+
},
|
|
341
|
+
],
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
value: 'shanghai',
|
|
345
|
+
label: '上海市',
|
|
346
|
+
children: [
|
|
347
|
+
{
|
|
348
|
+
value: 'pudong',
|
|
349
|
+
label: '浦东新区',
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
key: 'department',
|
|
358
|
+
label: '部门选择',
|
|
359
|
+
value: ['company'],
|
|
360
|
+
component: ElCascader,
|
|
361
|
+
params: {
|
|
362
|
+
props: {
|
|
363
|
+
value: 'code',
|
|
364
|
+
label: 'name',
|
|
365
|
+
children: 'subDepartments',
|
|
366
|
+
showPrefix: false,
|
|
367
|
+
checkStrictly: true,
|
|
368
|
+
checkOnClickNode: true,
|
|
369
|
+
},
|
|
370
|
+
separator: ',',
|
|
371
|
+
options: [
|
|
372
|
+
{
|
|
373
|
+
code: 'company',
|
|
374
|
+
name: '公司总部',
|
|
375
|
+
subDepartments: [
|
|
376
|
+
{
|
|
377
|
+
code: 'tech',
|
|
378
|
+
name: '技术部',
|
|
379
|
+
subDepartments: [
|
|
380
|
+
{
|
|
381
|
+
code: 'frontend',
|
|
382
|
+
name: '前端组',
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
code: 'backend',
|
|
386
|
+
name: '后端组',
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
code: 'sales',
|
|
392
|
+
name: '销售部',
|
|
393
|
+
},
|
|
394
|
+
],
|
|
395
|
+
},
|
|
396
|
+
],
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
],
|
|
400
|
+
[
|
|
401
|
+
{
|
|
402
|
+
key: 'single_level_cascader',
|
|
403
|
+
label: '单层级联',
|
|
404
|
+
value: 'beijing',
|
|
405
|
+
component: ElCascader,
|
|
406
|
+
params: {
|
|
407
|
+
options: [
|
|
408
|
+
{
|
|
409
|
+
value: 'beijing',
|
|
410
|
+
label: '北京市',
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
value: 'shanghai',
|
|
414
|
+
label: '上海市',
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
value: 'guangzhou',
|
|
418
|
+
label: '广州市',
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
value: ' ',
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
],
|
|
267
428
|
})
|
|
268
429
|
|
|
269
430
|
function detAreaModeChange(value: any) {
|
|
@@ -322,7 +483,8 @@
|
|
|
322
483
|
const data1 = row1Ref.value?.getFormKvData?.()
|
|
323
484
|
const data2 = row2Ref.value?.getFormKvData?.()
|
|
324
485
|
const data3 = row3Ref.value?.getFormKvData?.()
|
|
325
|
-
const
|
|
486
|
+
const data4 = row4Ref.value?.getFormKvData?.()
|
|
487
|
+
const data = { ...data1, ...data2, ...data3, ...data4 }
|
|
326
488
|
state.formData = data
|
|
327
489
|
ElMessage.success('表单校验成功')
|
|
328
490
|
return data
|
|
@@ -336,6 +498,7 @@
|
|
|
336
498
|
row1Ref.value?.resetForm?.()
|
|
337
499
|
row2Ref.value?.resetForm?.()
|
|
338
500
|
row3Ref.value?.resetForm?.()
|
|
501
|
+
row4Ref.value?.resetForm?.()
|
|
339
502
|
setTimeout(()=>{
|
|
340
503
|
// 重置表单验证状态
|
|
341
504
|
formRef.value?.clearValidate?.()
|
|
@@ -345,11 +508,25 @@
|
|
|
345
508
|
}, 0)
|
|
346
509
|
}
|
|
347
510
|
|
|
348
|
-
|
|
349
511
|
async function getDetail() {
|
|
512
|
+
debugger
|
|
513
|
+
return
|
|
350
514
|
// 模拟获取详情数据
|
|
351
515
|
setTimeout(()=>{
|
|
352
|
-
const res = {
|
|
516
|
+
const res = {
|
|
517
|
+
"confidence": "aaa1",
|
|
518
|
+
"iou": "1",
|
|
519
|
+
"timeInterval": "2",
|
|
520
|
+
"stuck_threshold": "3",
|
|
521
|
+
"max_retries": "4",
|
|
522
|
+
"save_video": true,
|
|
523
|
+
"pre_buffer_second": "5",
|
|
524
|
+
"det_area_mode": "abnormal",
|
|
525
|
+
"det_area_json": "6",
|
|
526
|
+
"region": ["beijing", "haidian"],
|
|
527
|
+
"department": ["company","tech","frontend"],
|
|
528
|
+
"single_level_cascader": "shanghai"
|
|
529
|
+
}
|
|
353
530
|
for (const [k, v] of Object.entries(res)) {
|
|
354
531
|
let rows1 = getAllFormNodeByKey(state.rows,k);
|
|
355
532
|
if(rows1) {
|
|
@@ -366,8 +543,12 @@
|
|
|
366
543
|
detAreaModeChange(v)
|
|
367
544
|
}
|
|
368
545
|
}
|
|
546
|
+
let rows4 = getAllFormNodeByKey(state.rows4,k);
|
|
547
|
+
if(rows4) {
|
|
548
|
+
rows4.value = v;
|
|
549
|
+
}
|
|
369
550
|
}
|
|
370
|
-
},
|
|
551
|
+
}, 2000)
|
|
371
552
|
}
|
|
372
553
|
|
|
373
554
|
onMounted(() => {
|
|
@@ -27,7 +27,7 @@ const videoData = reactive({
|
|
|
27
27
|
videoModel: 'easyplayer',
|
|
28
28
|
id: '111',
|
|
29
29
|
label: '视频A--1视频A--1视频A--1',
|
|
30
|
-
url: '
|
|
30
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000003.live.flv',
|
|
31
31
|
deviceId: 'a1',
|
|
32
32
|
channelId: 'a11',
|
|
33
33
|
icontype: 'on',
|
|
@@ -35,7 +35,7 @@ const videoData = reactive({
|
|
|
35
35
|
{
|
|
36
36
|
id: 'D',
|
|
37
37
|
label: '视频A--2',
|
|
38
|
-
url: 'ws://199.10.9.192:30200/rtp/
|
|
38
|
+
url: 'ws://199.10.9.192:30200/rtp/34020000001110000001_34020000001320000010.live.flv',
|
|
39
39
|
deviceId: 'b1',
|
|
40
40
|
channelId: 'b11',
|
|
41
41
|
icontype: 'off',
|