@cniot/mdd-editor 0.2.0-beta.3 → 0.2.0-beta.5
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 +6 -0
- package/build/index.cjs.js +16 -16
- package/build/index.es.js +228 -49
- package/package.json +2 -2
- package/src/template/const.js +5 -0
package/build/index.es.js
CHANGED
|
@@ -17481,7 +17481,9 @@ const formilySchema = ({ moduleDataSource = {} }) => {
|
|
|
17481
17481
|
"x-decorator": "CnFormItem",
|
|
17482
17482
|
"x-component": "Input",
|
|
17483
17483
|
"x-validator": [],
|
|
17484
|
-
"x-component-props": {
|
|
17484
|
+
"x-component-props": {
|
|
17485
|
+
hasClear: true
|
|
17486
|
+
},
|
|
17485
17487
|
"x-decorator-props": {},
|
|
17486
17488
|
name: "width",
|
|
17487
17489
|
default: "50%",
|
|
@@ -17508,7 +17510,9 @@ const formilySchema = ({ moduleDataSource = {} }) => {
|
|
|
17508
17510
|
"x-decorator": "CnFormItem",
|
|
17509
17511
|
"x-component": "Input",
|
|
17510
17512
|
"x-validator": [],
|
|
17511
|
-
"x-component-props": {
|
|
17513
|
+
"x-component-props": {
|
|
17514
|
+
hasClear: true
|
|
17515
|
+
},
|
|
17512
17516
|
"x-decorator-props": {},
|
|
17513
17517
|
name: "height",
|
|
17514
17518
|
"x-reactions": {
|
|
@@ -18105,8 +18109,12 @@ var PrimaryKey = {
|
|
|
18105
18109
|
"x-designable-id": "c1f6xiczrp8"
|
|
18106
18110
|
}
|
|
18107
18111
|
};
|
|
18108
|
-
var commonColumnProps = () => {
|
|
18112
|
+
var commonColumnProps = ({ listSchema = [] }) => {
|
|
18109
18113
|
var _a2;
|
|
18114
|
+
const columnsOpts = (listSchema == null ? void 0 : listSchema.map((item) => ({
|
|
18115
|
+
...item,
|
|
18116
|
+
value: item.name || item.label
|
|
18117
|
+
}))) || [];
|
|
18110
18118
|
return {
|
|
18111
18119
|
width: {
|
|
18112
18120
|
type: "number",
|
|
@@ -18284,6 +18292,25 @@ var commonColumnProps = () => {
|
|
|
18284
18292
|
},
|
|
18285
18293
|
name: "tooltip",
|
|
18286
18294
|
"x-designable-id": "sxbti21112zmzk"
|
|
18295
|
+
},
|
|
18296
|
+
parentHeaderColumn: {
|
|
18297
|
+
type: "string",
|
|
18298
|
+
title: "\u8868\u5934\u5206\u7EC4\u7236\u7EA7\u5217",
|
|
18299
|
+
"x-decorator": "CnFormItem",
|
|
18300
|
+
"x-component": "FormilySelect.AutoComplete",
|
|
18301
|
+
"x-validator": [],
|
|
18302
|
+
"x-component-props": {
|
|
18303
|
+
style: {
|
|
18304
|
+
width: "200px"
|
|
18305
|
+
},
|
|
18306
|
+
size: "small"
|
|
18307
|
+
},
|
|
18308
|
+
"x-decorator-props": {
|
|
18309
|
+
tip: "\u8BBE\u7F6E\u7236\u7EA7\u540E\uFF0C\u5F53\u524D\u5217\u8868\u5934\u4F1A\u663E\u793A\u5728\u7236\u7EA7\u5217\u7684\u4E0B\u9762"
|
|
18310
|
+
},
|
|
18311
|
+
enum: columnsOpts,
|
|
18312
|
+
name: "parentHeaderColumn",
|
|
18313
|
+
"x-designable-id": "sxbti11221112zmzk"
|
|
18287
18314
|
}
|
|
18288
18315
|
};
|
|
18289
18316
|
};
|
|
@@ -18302,7 +18329,7 @@ const shouldCopyClipboard = {
|
|
|
18302
18329
|
"x-designable-id": "sxbti22331112zmzk"
|
|
18303
18330
|
}
|
|
18304
18331
|
};
|
|
18305
|
-
var TextSchema = () => {
|
|
18332
|
+
var TextSchema = (params) => {
|
|
18306
18333
|
return {
|
|
18307
18334
|
form: {
|
|
18308
18335
|
labelCol: 6,
|
|
@@ -18311,14 +18338,14 @@ var TextSchema = () => {
|
|
|
18311
18338
|
schema: {
|
|
18312
18339
|
type: "object",
|
|
18313
18340
|
properties: {
|
|
18314
|
-
...commonColumnProps(),
|
|
18341
|
+
...commonColumnProps(params),
|
|
18315
18342
|
...shouldCopyClipboard
|
|
18316
18343
|
},
|
|
18317
18344
|
"x-designable-id": "j744a1rk494"
|
|
18318
18345
|
}
|
|
18319
18346
|
};
|
|
18320
18347
|
};
|
|
18321
|
-
var TplSchema = () => {
|
|
18348
|
+
var TplSchema = (params) => {
|
|
18322
18349
|
return {
|
|
18323
18350
|
form: {
|
|
18324
18351
|
labelCol: 6,
|
|
@@ -18327,7 +18354,7 @@ var TplSchema = () => {
|
|
|
18327
18354
|
schema: {
|
|
18328
18355
|
type: "object",
|
|
18329
18356
|
properties: {
|
|
18330
|
-
...commonColumnProps(),
|
|
18357
|
+
...commonColumnProps(params),
|
|
18331
18358
|
tpl: {
|
|
18332
18359
|
type: "string",
|
|
18333
18360
|
title: "\u6A21\u677F\u8868\u8FBE\u5F0F",
|
|
@@ -18353,7 +18380,7 @@ var TplSchema = () => {
|
|
|
18353
18380
|
}
|
|
18354
18381
|
};
|
|
18355
18382
|
};
|
|
18356
|
-
var TagSchema = () => {
|
|
18383
|
+
var TagSchema = (params) => {
|
|
18357
18384
|
return {
|
|
18358
18385
|
form: {
|
|
18359
18386
|
labelCol: 4,
|
|
@@ -18362,7 +18389,7 @@ var TagSchema = () => {
|
|
|
18362
18389
|
schema: {
|
|
18363
18390
|
type: "object",
|
|
18364
18391
|
properties: {
|
|
18365
|
-
...commonColumnProps(),
|
|
18392
|
+
...commonColumnProps(params),
|
|
18366
18393
|
dataSource: {
|
|
18367
18394
|
type: "array",
|
|
18368
18395
|
title: "\u6807\u7B7E\u9879",
|
|
@@ -18566,7 +18593,7 @@ var TagSchema = () => {
|
|
|
18566
18593
|
}
|
|
18567
18594
|
};
|
|
18568
18595
|
};
|
|
18569
|
-
var DateSchema = () => {
|
|
18596
|
+
var DateSchema = (params) => {
|
|
18570
18597
|
return {
|
|
18571
18598
|
form: {
|
|
18572
18599
|
labelCol: 6,
|
|
@@ -18575,7 +18602,7 @@ var DateSchema = () => {
|
|
|
18575
18602
|
schema: {
|
|
18576
18603
|
type: "object",
|
|
18577
18604
|
properties: {
|
|
18578
|
-
...commonColumnProps(),
|
|
18605
|
+
...commonColumnProps(params),
|
|
18579
18606
|
format: {
|
|
18580
18607
|
type: "string",
|
|
18581
18608
|
title: "\u65E5\u671F\u663E\u793A\u683C\u5F0F",
|
|
@@ -18617,7 +18644,8 @@ var DateSchema = () => {
|
|
|
18617
18644
|
}
|
|
18618
18645
|
};
|
|
18619
18646
|
};
|
|
18620
|
-
var CustomSchema = (
|
|
18647
|
+
var CustomSchema = (params) => {
|
|
18648
|
+
const { moduleDataSource = {} } = params || {};
|
|
18621
18649
|
return {
|
|
18622
18650
|
form: {
|
|
18623
18651
|
labelCol: 6,
|
|
@@ -18626,7 +18654,7 @@ var CustomSchema = ({ moduleDataSource = {} }) => {
|
|
|
18626
18654
|
schema: {
|
|
18627
18655
|
type: "object",
|
|
18628
18656
|
properties: {
|
|
18629
|
-
...commonColumnProps(),
|
|
18657
|
+
...commonColumnProps(params),
|
|
18630
18658
|
customType: {
|
|
18631
18659
|
title: "\u81EA\u5B9A\u4E49\u7C7B\u578B",
|
|
18632
18660
|
"x-decorator": "CnFormItem",
|
|
@@ -18689,7 +18717,7 @@ var CustomSchema = ({ moduleDataSource = {} }) => {
|
|
|
18689
18717
|
}
|
|
18690
18718
|
};
|
|
18691
18719
|
};
|
|
18692
|
-
var EnumSchema = () => {
|
|
18720
|
+
var EnumSchema = (params) => {
|
|
18693
18721
|
return {
|
|
18694
18722
|
form: {
|
|
18695
18723
|
labelCol: 4,
|
|
@@ -18698,7 +18726,7 @@ var EnumSchema = () => {
|
|
|
18698
18726
|
schema: {
|
|
18699
18727
|
type: "object",
|
|
18700
18728
|
properties: {
|
|
18701
|
-
...commonColumnProps(),
|
|
18729
|
+
...commonColumnProps(params),
|
|
18702
18730
|
dataSource: {
|
|
18703
18731
|
type: "array",
|
|
18704
18732
|
title: "\u679A\u4E3E\u9879",
|
|
@@ -18815,7 +18843,7 @@ var EnumSchema = () => {
|
|
|
18815
18843
|
}
|
|
18816
18844
|
};
|
|
18817
18845
|
};
|
|
18818
|
-
var NumSchema = () => {
|
|
18846
|
+
var NumSchema = (params) => {
|
|
18819
18847
|
return {
|
|
18820
18848
|
form: {
|
|
18821
18849
|
labelCol: 6,
|
|
@@ -18824,7 +18852,7 @@ var NumSchema = () => {
|
|
|
18824
18852
|
schema: {
|
|
18825
18853
|
type: "object",
|
|
18826
18854
|
properties: {
|
|
18827
|
-
...commonColumnProps(),
|
|
18855
|
+
...commonColumnProps(params),
|
|
18828
18856
|
format: {
|
|
18829
18857
|
title: "\u6570\u503C\u683C\u5F0F",
|
|
18830
18858
|
"x-decorator": "CnFormItem",
|
|
@@ -18863,7 +18891,7 @@ var NumSchema = () => {
|
|
|
18863
18891
|
}
|
|
18864
18892
|
};
|
|
18865
18893
|
};
|
|
18866
|
-
var ClipboardSchema = () => {
|
|
18894
|
+
var ClipboardSchema = (params) => {
|
|
18867
18895
|
return {
|
|
18868
18896
|
form: {
|
|
18869
18897
|
labelCol: 6,
|
|
@@ -18872,13 +18900,13 @@ var ClipboardSchema = () => {
|
|
|
18872
18900
|
schema: {
|
|
18873
18901
|
type: "object",
|
|
18874
18902
|
properties: {
|
|
18875
|
-
...commonColumnProps()
|
|
18903
|
+
...commonColumnProps(params)
|
|
18876
18904
|
},
|
|
18877
18905
|
"x-designable-id": "j741121rk494"
|
|
18878
18906
|
}
|
|
18879
18907
|
};
|
|
18880
18908
|
};
|
|
18881
|
-
var ListSchema = () => {
|
|
18909
|
+
var ListSchema = (params) => {
|
|
18882
18910
|
return {
|
|
18883
18911
|
form: {
|
|
18884
18912
|
labelCol: 6,
|
|
@@ -18887,7 +18915,7 @@ var ListSchema = () => {
|
|
|
18887
18915
|
schema: {
|
|
18888
18916
|
type: "object",
|
|
18889
18917
|
properties: {
|
|
18890
|
-
...commonColumnProps(),
|
|
18918
|
+
...commonColumnProps(params),
|
|
18891
18919
|
showNum: {
|
|
18892
18920
|
type: "number",
|
|
18893
18921
|
title: "\u663E\u793A\u5728\u8868\u683C\u5217\u7684\u6761\u6570",
|
|
@@ -18948,7 +18976,7 @@ var ListSchema = () => {
|
|
|
18948
18976
|
}
|
|
18949
18977
|
};
|
|
18950
18978
|
};
|
|
18951
|
-
var TooltipText = () => {
|
|
18979
|
+
var TooltipText = (params) => {
|
|
18952
18980
|
return {
|
|
18953
18981
|
form: {
|
|
18954
18982
|
labelCol: 6,
|
|
@@ -18957,7 +18985,7 @@ var TooltipText = () => {
|
|
|
18957
18985
|
schema: {
|
|
18958
18986
|
type: "object",
|
|
18959
18987
|
properties: {
|
|
18960
|
-
...commonColumnProps(),
|
|
18988
|
+
...commonColumnProps(params),
|
|
18961
18989
|
align: {
|
|
18962
18990
|
title: "\u6D6E\u5C42\u65B9\u5411",
|
|
18963
18991
|
"x-decorator": "CnFormItem",
|
|
@@ -18998,7 +19026,7 @@ var TooltipText = () => {
|
|
|
18998
19026
|
}
|
|
18999
19027
|
};
|
|
19000
19028
|
};
|
|
19001
|
-
var Images = () => {
|
|
19029
|
+
var Images = (params) => {
|
|
19002
19030
|
return {
|
|
19003
19031
|
form: {
|
|
19004
19032
|
labelCol: 6,
|
|
@@ -19007,7 +19035,7 @@ var Images = () => {
|
|
|
19007
19035
|
schema: {
|
|
19008
19036
|
type: "object",
|
|
19009
19037
|
properties: {
|
|
19010
|
-
...commonColumnProps(),
|
|
19038
|
+
...commonColumnProps(params),
|
|
19011
19039
|
isFile: {
|
|
19012
19040
|
type: "boolean",
|
|
19013
19041
|
title: "\u662F\u5426\u662F\u9644\u4EF6",
|
|
@@ -19105,7 +19133,7 @@ var Images = () => {
|
|
|
19105
19133
|
}
|
|
19106
19134
|
};
|
|
19107
19135
|
};
|
|
19108
|
-
var CnTag = () => {
|
|
19136
|
+
var CnTag = (params) => {
|
|
19109
19137
|
return {
|
|
19110
19138
|
form: {
|
|
19111
19139
|
labelCol: 6,
|
|
@@ -19114,13 +19142,13 @@ var CnTag = () => {
|
|
|
19114
19142
|
schema: {
|
|
19115
19143
|
type: "object",
|
|
19116
19144
|
properties: {
|
|
19117
|
-
...commonColumnProps()
|
|
19145
|
+
...commonColumnProps(params)
|
|
19118
19146
|
},
|
|
19119
19147
|
"x-designable-id": "kv084cg1qw7"
|
|
19120
19148
|
}
|
|
19121
19149
|
};
|
|
19122
19150
|
};
|
|
19123
|
-
var CnNumber = () => {
|
|
19151
|
+
var CnNumber = (params) => {
|
|
19124
19152
|
return {
|
|
19125
19153
|
form: {
|
|
19126
19154
|
labelCol: 6,
|
|
@@ -19129,13 +19157,13 @@ var CnNumber = () => {
|
|
|
19129
19157
|
schema: {
|
|
19130
19158
|
type: "object",
|
|
19131
19159
|
properties: {
|
|
19132
|
-
...commonColumnProps()
|
|
19160
|
+
...commonColumnProps(params)
|
|
19133
19161
|
},
|
|
19134
19162
|
"x-designable-id": "kv084cg1qw7"
|
|
19135
19163
|
}
|
|
19136
19164
|
};
|
|
19137
19165
|
};
|
|
19138
|
-
var CnBank = () => {
|
|
19166
|
+
var CnBank = (params) => {
|
|
19139
19167
|
return {
|
|
19140
19168
|
form: {
|
|
19141
19169
|
labelCol: 6,
|
|
@@ -19144,13 +19172,13 @@ var CnBank = () => {
|
|
|
19144
19172
|
schema: {
|
|
19145
19173
|
type: "object",
|
|
19146
19174
|
properties: {
|
|
19147
|
-
...commonColumnProps()
|
|
19175
|
+
...commonColumnProps(params)
|
|
19148
19176
|
},
|
|
19149
19177
|
"x-designable-id": "kv084cg1qw7"
|
|
19150
19178
|
}
|
|
19151
19179
|
};
|
|
19152
19180
|
};
|
|
19153
|
-
var CnImageText = () => {
|
|
19181
|
+
var CnImageText = (params) => {
|
|
19154
19182
|
return {
|
|
19155
19183
|
form: {
|
|
19156
19184
|
labelCol: 6,
|
|
@@ -19159,13 +19187,13 @@ var CnImageText = () => {
|
|
|
19159
19187
|
schema: {
|
|
19160
19188
|
type: "object",
|
|
19161
19189
|
properties: {
|
|
19162
|
-
...commonColumnProps()
|
|
19190
|
+
...commonColumnProps(params)
|
|
19163
19191
|
},
|
|
19164
19192
|
"x-designable-id": "kv084cg1qw7"
|
|
19165
19193
|
}
|
|
19166
19194
|
};
|
|
19167
19195
|
};
|
|
19168
|
-
var CnProgress = () => {
|
|
19196
|
+
var CnProgress = (params) => {
|
|
19169
19197
|
return {
|
|
19170
19198
|
form: {
|
|
19171
19199
|
labelCol: 6,
|
|
@@ -19174,13 +19202,13 @@ var CnProgress = () => {
|
|
|
19174
19202
|
schema: {
|
|
19175
19203
|
type: "object",
|
|
19176
19204
|
properties: {
|
|
19177
|
-
...commonColumnProps()
|
|
19205
|
+
...commonColumnProps(params)
|
|
19178
19206
|
},
|
|
19179
19207
|
"x-designable-id": "kv084cg1qw7"
|
|
19180
19208
|
}
|
|
19181
19209
|
};
|
|
19182
19210
|
};
|
|
19183
|
-
var cnGraphicsPercent = () => {
|
|
19211
|
+
var cnGraphicsPercent = (params) => {
|
|
19184
19212
|
return {
|
|
19185
19213
|
form: {
|
|
19186
19214
|
labelCol: 6,
|
|
@@ -19189,7 +19217,7 @@ var cnGraphicsPercent = () => {
|
|
|
19189
19217
|
schema: {
|
|
19190
19218
|
type: "object",
|
|
19191
19219
|
properties: {
|
|
19192
|
-
...commonColumnProps()
|
|
19220
|
+
...commonColumnProps(params)
|
|
19193
19221
|
},
|
|
19194
19222
|
"x-designable-id": "kv084cg3331qw7"
|
|
19195
19223
|
}
|
|
@@ -19461,19 +19489,39 @@ const formValidator$1 = {
|
|
|
19461
19489
|
enum: [
|
|
19462
19490
|
{
|
|
19463
19491
|
label: "\u90AE\u7BB1",
|
|
19464
|
-
value: "
|
|
19492
|
+
value: "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"
|
|
19465
19493
|
},
|
|
19466
19494
|
{
|
|
19467
|
-
label: "\
|
|
19468
|
-
value: "
|
|
19495
|
+
label: "\u6570\u5B57",
|
|
19496
|
+
value: "^[+-]?\\d+(\\.\\d+)?$"
|
|
19469
19497
|
},
|
|
19470
19498
|
{
|
|
19471
|
-
label: "\
|
|
19472
|
-
value: "
|
|
19499
|
+
label: "\u6574\u6570",
|
|
19500
|
+
value: "^[+-]?\\d+$"
|
|
19473
19501
|
},
|
|
19474
19502
|
{
|
|
19475
19503
|
label: "QQ",
|
|
19476
|
-
value: "
|
|
19504
|
+
value: "^(\\+?[1-9]\\d*|0)$"
|
|
19505
|
+
},
|
|
19506
|
+
{
|
|
19507
|
+
label: "\u624B\u673A\u53F7",
|
|
19508
|
+
value: "^\\d{3}-\\d{8}$|^\\d{4}-\\d{7}$|^\\d{11}$"
|
|
19509
|
+
},
|
|
19510
|
+
{
|
|
19511
|
+
label: "\u8EAB\u4EFD\u8BC1\u53F7",
|
|
19512
|
+
value: "^\\d{15}$|^\\d{17}(\\d|x|X)$"
|
|
19513
|
+
},
|
|
19514
|
+
{
|
|
19515
|
+
label: "\u91D1\u989D",
|
|
19516
|
+
value: "^([\\u0024\\u00A2\\u00A3\\u00A4\\u20AC\\u00A5\\u20B1\\u20B9\\uFFE5]\\s*)(\\d+,?)+\\.?\\d*\\s*$"
|
|
19517
|
+
},
|
|
19518
|
+
{
|
|
19519
|
+
label: "\u4E2D\u6587",
|
|
19520
|
+
value: "^[\\u4e00-\\u9fa5]+$"
|
|
19521
|
+
},
|
|
19522
|
+
{
|
|
19523
|
+
label: "\u65E5\u671F",
|
|
19524
|
+
value: "^[0-9]+[./-][0-9]+[./-][0-9]+\\s*(?:[0-9]+\\s*:\\s*[0-9]+\\s*:\\s*[0-9]+)?$"
|
|
19477
19525
|
}
|
|
19478
19526
|
],
|
|
19479
19527
|
"x-designable-id": "df97o0zfqde"
|
|
@@ -19801,7 +19849,7 @@ var EditNumberPickerSchema = {
|
|
|
19801
19849
|
"x-designable-id": "edit-table-j744a1rk494"
|
|
19802
19850
|
}
|
|
19803
19851
|
};
|
|
19804
|
-
const selectSchema$
|
|
19852
|
+
const selectSchema$3 = {
|
|
19805
19853
|
...editCommonItem,
|
|
19806
19854
|
mode: {
|
|
19807
19855
|
type: "string | number",
|
|
@@ -19997,7 +20045,7 @@ var EditSelectSchema = {
|
|
|
19997
20045
|
title: "\u7F16\u8F91\u5668\u5C5E\u6027",
|
|
19998
20046
|
"x-designable-id": "xoirvxpflgk",
|
|
19999
20047
|
properties: {
|
|
20000
|
-
...selectSchema$
|
|
20048
|
+
...selectSchema$3
|
|
20001
20049
|
}
|
|
20002
20050
|
}
|
|
20003
20051
|
},
|
|
@@ -20629,6 +20677,112 @@ var EditAddressSelectSchema = {
|
|
|
20629
20677
|
"x-designable-id": "yk7opli2cp8"
|
|
20630
20678
|
}
|
|
20631
20679
|
};
|
|
20680
|
+
const selectSchema$2 = {
|
|
20681
|
+
...editCommonItem,
|
|
20682
|
+
mode: {
|
|
20683
|
+
type: "string | number",
|
|
20684
|
+
title: "\u9009\u62E9\u6A21\u5F0F",
|
|
20685
|
+
"x-decorator": "CnFormItem",
|
|
20686
|
+
"x-component": "CnRadioGroup",
|
|
20687
|
+
default: "single",
|
|
20688
|
+
enum: [
|
|
20689
|
+
{
|
|
20690
|
+
label: "\u5355\u9009",
|
|
20691
|
+
value: "single"
|
|
20692
|
+
},
|
|
20693
|
+
{
|
|
20694
|
+
label: "\u591A\u9009",
|
|
20695
|
+
value: "multiple"
|
|
20696
|
+
}
|
|
20697
|
+
],
|
|
20698
|
+
"x-validator": [],
|
|
20699
|
+
"x-component-props": {},
|
|
20700
|
+
"x-decorator-props": {},
|
|
20701
|
+
name: "mode",
|
|
20702
|
+
"x-designable-id": "y5mtbwr162t"
|
|
20703
|
+
},
|
|
20704
|
+
source: {
|
|
20705
|
+
type: "string",
|
|
20706
|
+
title: "\u6570\u636E\u6E90",
|
|
20707
|
+
"x-decorator": "CnFormItem",
|
|
20708
|
+
"x-component": "FormilyAjaxSchemaForm",
|
|
20709
|
+
"x-validator": [],
|
|
20710
|
+
"x-component-props": {},
|
|
20711
|
+
default: {
|
|
20712
|
+
type: "json",
|
|
20713
|
+
content: [
|
|
20714
|
+
{
|
|
20715
|
+
label: "\u9009\u98791",
|
|
20716
|
+
value: "1"
|
|
20717
|
+
},
|
|
20718
|
+
{
|
|
20719
|
+
label: "\u9009\u98792",
|
|
20720
|
+
value: "2"
|
|
20721
|
+
}
|
|
20722
|
+
]
|
|
20723
|
+
},
|
|
20724
|
+
"x-decorator-props": {},
|
|
20725
|
+
name: "dataSource",
|
|
20726
|
+
"x-designable-id": "t0uv4o8e9ds"
|
|
20727
|
+
},
|
|
20728
|
+
optionLabelKey: {
|
|
20729
|
+
title: "\u9009\u9879\u6807\u9898Key",
|
|
20730
|
+
"x-decorator": "CnFormItem",
|
|
20731
|
+
"x-component": "Input",
|
|
20732
|
+
"x-validator": [],
|
|
20733
|
+
"x-component-props": {},
|
|
20734
|
+
"x-decorator-props": {},
|
|
20735
|
+
name: "optionLabelKey",
|
|
20736
|
+
default: "label",
|
|
20737
|
+
"x-designable-id": "511333ac9k"
|
|
20738
|
+
},
|
|
20739
|
+
optionValueKey: {
|
|
20740
|
+
title: "\u9009\u9879\u503CKey",
|
|
20741
|
+
"x-decorator": "CnFormItem",
|
|
20742
|
+
"x-component": "Input",
|
|
20743
|
+
"x-validator": [],
|
|
20744
|
+
"x-component-props": {},
|
|
20745
|
+
"x-decorator-props": {},
|
|
20746
|
+
name: "optionLabelKey",
|
|
20747
|
+
default: "value",
|
|
20748
|
+
"x-designable-id": "5112229k"
|
|
20749
|
+
},
|
|
20750
|
+
changeOnSelect: {
|
|
20751
|
+
type: "string",
|
|
20752
|
+
title: "\u9009\u62E9\u5373\u6539\u53D8",
|
|
20753
|
+
"x-decorator": "CnFormItem",
|
|
20754
|
+
"x-component": "Switch",
|
|
20755
|
+
"x-validator": [],
|
|
20756
|
+
"x-component-props": {},
|
|
20757
|
+
"x-decorator-props": {},
|
|
20758
|
+
name: "changeOnSelect",
|
|
20759
|
+
default: false,
|
|
20760
|
+
"x-designable-id": "bt66221112xl3px"
|
|
20761
|
+
}
|
|
20762
|
+
};
|
|
20763
|
+
var EditCascaderSelectSchema = {
|
|
20764
|
+
form: {
|
|
20765
|
+
labelCol: 6,
|
|
20766
|
+
wrapperCol: 16
|
|
20767
|
+
},
|
|
20768
|
+
schema: {
|
|
20769
|
+
type: "object",
|
|
20770
|
+
properties: {
|
|
20771
|
+
...getEditCommonColumnProps(),
|
|
20772
|
+
decoratorProps: {
|
|
20773
|
+
type: "object",
|
|
20774
|
+
"x-validator": [],
|
|
20775
|
+
name: "decoratorProps",
|
|
20776
|
+
title: "\u7F16\u8F91\u5668\u5C5E\u6027",
|
|
20777
|
+
"x-designable-id": "xoirvxpflgk",
|
|
20778
|
+
properties: {
|
|
20779
|
+
...selectSchema$2
|
|
20780
|
+
}
|
|
20781
|
+
}
|
|
20782
|
+
},
|
|
20783
|
+
"x-designable-id": "edit-table-j744a1rk494"
|
|
20784
|
+
}
|
|
20785
|
+
};
|
|
20632
20786
|
var EditColumns = {
|
|
20633
20787
|
"edit-custom": EditCustomSchema,
|
|
20634
20788
|
"edit-input": EditInputSchema,
|
|
@@ -20637,7 +20791,8 @@ var EditColumns = {
|
|
|
20637
20791
|
"edit-select": EditSelectSchema,
|
|
20638
20792
|
"edit-date-picker": EditDatePickerSchema,
|
|
20639
20793
|
"edit-time-picker": EditTimePickerSchema,
|
|
20640
|
-
"edit-address-select": EditAddressSelectSchema
|
|
20794
|
+
"edit-address-select": EditAddressSelectSchema,
|
|
20795
|
+
"edit-cascader-select": EditCascaderSelectSchema
|
|
20641
20796
|
};
|
|
20642
20797
|
var ModuleImport = {
|
|
20643
20798
|
form: {
|
|
@@ -23732,16 +23887,29 @@ const TitleRender$2 = (props) => {
|
|
|
23732
23887
|
onClick: onRemove
|
|
23733
23888
|
}));
|
|
23734
23889
|
};
|
|
23890
|
+
const watchFields = (listSchema) => {
|
|
23891
|
+
const fieldStringArray = listSchema.map((item) => {
|
|
23892
|
+
return `${item.label}_${item.name}`;
|
|
23893
|
+
});
|
|
23894
|
+
return fieldStringArray.join(",");
|
|
23895
|
+
};
|
|
23735
23896
|
const ContentRender$1 = (props) => {
|
|
23736
|
-
const { values, effects, onChange, schema, index: index2, extraFieldSchema: extraFieldSchema2, updateForceFLag } = props;
|
|
23897
|
+
const { values, effects, onChange, schema, index: index2, extraFieldSchema: extraFieldSchema2, updateForceFLag, listSchema } = props;
|
|
23737
23898
|
const { type, label, name } = values;
|
|
23738
23899
|
const { formilySchema: formilySchema2, dataAdaptor: dataAdaptor2 } = schema || {};
|
|
23900
|
+
const [uuid, setUuid] = useState(uuidv4());
|
|
23739
23901
|
const { dataMap, getModule } = useModule$1();
|
|
23740
23902
|
const moduleDataSource = getModule("$ModuleDataSource");
|
|
23903
|
+
React$1.useEffect(
|
|
23904
|
+
debounce_1(() => {
|
|
23905
|
+
setUuid(uuidv4());
|
|
23906
|
+
}, 500),
|
|
23907
|
+
[watchFields(listSchema)]
|
|
23908
|
+
);
|
|
23741
23909
|
const realSchema = useMemo(() => {
|
|
23742
|
-
const srcSchema = getRealSchema(formilySchema2 || schema, { moduleDataSource });
|
|
23910
|
+
const srcSchema = getRealSchema(formilySchema2 || schema, { moduleDataSource, listSchema });
|
|
23743
23911
|
return getRealCompSchema(srcSchema, extraFieldSchema2);
|
|
23744
|
-
}, [formilySchema2, schema, extraFieldSchema2, moduleDataSource]);
|
|
23912
|
+
}, [formilySchema2, schema, extraFieldSchema2, moduleDataSource, uuid, listSchema]);
|
|
23745
23913
|
const formilyForm = useMemo(() => {
|
|
23746
23914
|
const realValues = dataAdaptor2 ? dataAdaptor2(values, true) : values;
|
|
23747
23915
|
return {
|
|
@@ -23885,6 +24053,7 @@ function MddTableForm(props, ref) {
|
|
|
23885
24053
|
schema: CompSchemaMap[item.type],
|
|
23886
24054
|
extraFieldSchema: extraFieldSchema2,
|
|
23887
24055
|
effects,
|
|
24056
|
+
listSchema: dataRef.current,
|
|
23888
24057
|
onChange: ({ record }) => {
|
|
23889
24058
|
const { type, name, label, groupKey, ...otherProps } = dataRef.current[idx];
|
|
23890
24059
|
const newRecord = { ...record, label, name, groupKey };
|
|
@@ -23919,6 +24088,12 @@ function getRealCompSchema(srcSchema, extraFieldSchema2) {
|
|
|
23919
24088
|
}
|
|
23920
24089
|
return srcSchema;
|
|
23921
24090
|
}
|
|
24091
|
+
function uuidv4() {
|
|
24092
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
24093
|
+
var r = Math.random() * 16 | 0, v2 = c == "x" ? r : r & 3 | 8;
|
|
24094
|
+
return v2.toString(16);
|
|
24095
|
+
});
|
|
24096
|
+
}
|
|
23922
24097
|
const PenetrateTypes = {
|
|
23923
24098
|
FILTER: "filter",
|
|
23924
24099
|
FORM: "form"
|
|
@@ -24175,6 +24350,10 @@ const columnsTypeOptionsWithEditCnTable = [
|
|
|
24175
24350
|
value: "edit-address-select",
|
|
24176
24351
|
label: "\u5730\u5740\u9009\u62E9"
|
|
24177
24352
|
},
|
|
24353
|
+
{
|
|
24354
|
+
value: "edit-cascader-select",
|
|
24355
|
+
label: "\u7EA7\u8054\u9009\u62E9\u5668"
|
|
24356
|
+
},
|
|
24178
24357
|
{
|
|
24179
24358
|
value: "edit-custom",
|
|
24180
24359
|
label: "\u81EA\u5B9A\u4E49"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cniot/mdd-editor",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.5",
|
|
4
4
|
"description": "模型驱动编辑器",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build"
|
|
@@ -39,4 +39,4 @@
|
|
|
39
39
|
"@monaco-editor/react": "*"
|
|
40
40
|
},
|
|
41
41
|
"repository": "git@gitlab.alibaba-inc.com:one-code/mdd.git"
|
|
42
|
-
}
|
|
42
|
+
}
|
package/src/template/const.js
CHANGED