ronds-metadata 1.2.3 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/es/comps/Editable/index.js +5 -1
- package/es/comps/FormGenerator/comps/Canvas/index.js +1 -1
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdView/index.less +1 -1
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataForm/DataCell/Array.js +2 -2
- package/es/comps/MetadataForm/DataCell/Input.js +10 -2
- package/es/comps/MetadataForm/DataCell/Number.js +18 -2
- package/es/comps/MetadataForm/DataCell/Ref.js +9 -0
- package/es/comps/MetadataForm/DataCell/Select.js +17 -0
- package/es/comps/MetadataForm/DataCell/Switch.js +17 -0
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +11 -1
- package/es/comps/MetadataForm/hooks/index.js +8 -2
- package/es/framework/metadata/types.d.ts +98 -98
- package/es/theme.less +77 -77
- package/package.json +93 -93
- package/es/framework/libs/iconfont/iconfont.json +0 -380
@@ -337,6 +337,10 @@ var Editable = function Editable(props) {
|
|
337
337
|
}
|
338
338
|
}, /*#__PURE__*/React.createElement(DndProvider, {
|
339
339
|
backend: HTML5Backend
|
340
|
+
}, /*#__PURE__*/React.createElement("div", {
|
341
|
+
style: {
|
342
|
+
height: "".concat((type === 'multiple' || type === 'freedom') && !readonly && isAddRow && defaultValue ? 'calc(100% - 40px)' : '100%')
|
343
|
+
}
|
340
344
|
}, /*#__PURE__*/React.createElement(_Table, _extends({
|
341
345
|
key: _columns.length,
|
342
346
|
className: "ronds-edit-table",
|
@@ -367,7 +371,7 @@ var Editable = function Editable(props) {
|
|
367
371
|
onMove: onMove
|
368
372
|
};
|
369
373
|
}
|
370
|
-
}))), (type === 'multiple' || type === 'freedom') && !readonly && isAddRow && defaultValue && /*#__PURE__*/React.createElement(_Button, {
|
374
|
+
})))), (type === 'multiple' || type === 'freedom') && !readonly && isAddRow && defaultValue && /*#__PURE__*/React.createElement(_Button, {
|
371
375
|
block: true,
|
372
376
|
type: "dashed",
|
373
377
|
style: {
|
@@ -193,7 +193,7 @@ var Canvas = function Canvas() {
|
|
193
193
|
style: {
|
194
194
|
width: '100%',
|
195
195
|
height: 'calc(100% - 40px)',
|
196
|
-
background: 'var(--ronds-metadata-color-bg-
|
196
|
+
background: 'var(--ronds-metadata-color-bg-4)',
|
197
197
|
padding: '8px',
|
198
198
|
border: '1px solid var(--ronds-metadata-color-border-1)',
|
199
199
|
overflowY: 'auto'
|
@@ -1,41 +1,41 @@
|
|
1
|
-
pre {
|
2
|
-
margin: 0;
|
3
|
-
font-weight: 900;
|
4
|
-
font-size: 14px;
|
5
|
-
}
|
6
|
-
.string {
|
7
|
-
color: #3ab54a;
|
8
|
-
}
|
9
|
-
.number {
|
10
|
-
color: #25aae2;
|
11
|
-
}
|
12
|
-
.boolean {
|
13
|
-
color: #f98280;
|
14
|
-
}
|
15
|
-
.null {
|
16
|
-
color: #f1592a;
|
17
|
-
}
|
18
|
-
.width-10 {
|
19
|
-
width: 10px;
|
20
|
-
}
|
21
|
-
.key {
|
22
|
-
color: #92278f;
|
23
|
-
}
|
24
|
-
.open {
|
25
|
-
display: inline-block;
|
26
|
-
width: 12px;
|
27
|
-
height: 12px;
|
28
|
-
background: url('./icon/close.png') no-repeat;
|
29
|
-
background-size: 100% 100%;
|
30
|
-
vertical-align: middle;
|
31
|
-
cursor: pointer;
|
32
|
-
}
|
33
|
-
.close {
|
34
|
-
display: inline-block;
|
35
|
-
width: 12px;
|
36
|
-
height: 12px;
|
37
|
-
background: url('./icon/open.png') no-repeat;
|
38
|
-
background-size: 100% 100%;
|
39
|
-
vertical-align: middle;
|
40
|
-
cursor: pointer;
|
41
|
-
}
|
1
|
+
pre {
|
2
|
+
margin: 0;
|
3
|
+
font-weight: 900;
|
4
|
+
font-size: 14px;
|
5
|
+
}
|
6
|
+
.string {
|
7
|
+
color: #3ab54a;
|
8
|
+
}
|
9
|
+
.number {
|
10
|
+
color: #25aae2;
|
11
|
+
}
|
12
|
+
.boolean {
|
13
|
+
color: #f98280;
|
14
|
+
}
|
15
|
+
.null {
|
16
|
+
color: #f1592a;
|
17
|
+
}
|
18
|
+
.width-10 {
|
19
|
+
width: 10px;
|
20
|
+
}
|
21
|
+
.key {
|
22
|
+
color: #92278f;
|
23
|
+
}
|
24
|
+
.open {
|
25
|
+
display: inline-block;
|
26
|
+
width: 12px;
|
27
|
+
height: 12px;
|
28
|
+
background: url('./icon/close.png') no-repeat;
|
29
|
+
background-size: 100% 100%;
|
30
|
+
vertical-align: middle;
|
31
|
+
cursor: pointer;
|
32
|
+
}
|
33
|
+
.close {
|
34
|
+
display: inline-block;
|
35
|
+
width: 12px;
|
36
|
+
height: 12px;
|
37
|
+
background: url('./icon/open.png') no-repeat;
|
38
|
+
background-size: 100% 100%;
|
39
|
+
vertical-align: middle;
|
40
|
+
cursor: pointer;
|
41
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
.metadata-edit {
|
2
|
-
height: 100%;
|
3
|
-
width: 100%;
|
4
|
-
.ant-row {
|
5
|
-
display: block;
|
6
|
-
}
|
7
|
-
.pr-10 {
|
8
|
-
padding-right: 10px;
|
9
|
-
}
|
10
|
-
}
|
1
|
+
.metadata-edit {
|
2
|
+
height: 100%;
|
3
|
+
width: 100%;
|
4
|
+
.ant-row {
|
5
|
+
display: block;
|
6
|
+
}
|
7
|
+
.pr-10 {
|
8
|
+
padding-right: 10px;
|
9
|
+
}
|
10
|
+
}
|
@@ -1,20 +1,20 @@
|
|
1
|
-
export interface IMetaFileds {
|
2
|
-
id: string;
|
3
|
-
type: 'object';
|
4
|
-
properties: any[];
|
5
|
-
value: any;
|
6
|
-
}
|
7
|
-
|
8
|
-
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
-
|
10
|
-
export type IMetaProperty = {
|
11
|
-
/**
|
12
|
-
* 属性的名称
|
13
|
-
*/
|
14
|
-
id: string;
|
15
|
-
/**
|
16
|
-
* 类型
|
17
|
-
*/
|
18
|
-
type: string;
|
19
|
-
enum?: any[];
|
20
|
-
};
|
1
|
+
export interface IMetaFileds {
|
2
|
+
id: string;
|
3
|
+
type: 'object';
|
4
|
+
properties: any[];
|
5
|
+
value: any;
|
6
|
+
}
|
7
|
+
|
8
|
+
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
+
|
10
|
+
export type IMetaProperty = {
|
11
|
+
/**
|
12
|
+
* 属性的名称
|
13
|
+
*/
|
14
|
+
id: string;
|
15
|
+
/**
|
16
|
+
* 类型
|
17
|
+
*/
|
18
|
+
type: string;
|
19
|
+
enum?: any[];
|
20
|
+
};
|
@@ -12,7 +12,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
12
|
/*
|
13
13
|
* @Author: wangxian
|
14
14
|
* @Date: 2021-09-18 14:15:04
|
15
|
-
* @LastEditTime: 2023-02-
|
15
|
+
* @LastEditTime: 2023-02-23 15:42:40
|
16
16
|
*/
|
17
17
|
import React from 'react';
|
18
18
|
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
@@ -136,7 +136,7 @@ function Index(props) {
|
|
136
136
|
isRefForm: isRefForm,
|
137
137
|
isShowTypeInfo: formContext.isShowTypeInfo,
|
138
138
|
field: field
|
139
|
-
},
|
139
|
+
}, 23), /*#__PURE__*/React.createElement(MinusCircleOutlined, {
|
140
140
|
style: {
|
141
141
|
marginLeft: '10px'
|
142
142
|
},
|
@@ -17,7 +17,7 @@ import _Input from "antd/es/input";
|
|
17
17
|
/*
|
18
18
|
* @Author: wangxian
|
19
19
|
* @Date: 2021-09-18 14:15:04
|
20
|
-
* @LastEditTime: 2023-02-
|
20
|
+
* @LastEditTime: 2023-02-23 16:30:57
|
21
21
|
*/
|
22
22
|
import React from 'react';
|
23
23
|
import { UploadOutlined } from '@ant-design/icons';
|
@@ -73,7 +73,7 @@ function Index(props) {
|
|
73
73
|
|
74
74
|
case 'textarea':
|
75
75
|
return /*#__PURE__*/React.createElement(TextArea, {
|
76
|
-
rows: 4,
|
76
|
+
rows: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.textareaRows) || 4,
|
77
77
|
disabled: (_extraInfo$disabled2 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled2 !== void 0 ? _extraInfo$disabled2 : disabled,
|
78
78
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder
|
79
79
|
});
|
@@ -134,6 +134,14 @@ function Index(props) {
|
|
134
134
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
135
135
|
} : {}
|
136
136
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
137
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
138
|
+
span: labelSpan,
|
139
|
+
offset: 0
|
140
|
+
} : undefined,
|
141
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
142
|
+
span: 24 - labelSpan,
|
143
|
+
offset: 0
|
144
|
+
} : undefined,
|
137
145
|
name: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$addonAfter5 = extraInfo.addonAfter) === null || _extraInfo$addonAfter5 === void 0 ? void 0 : _extraInfo$addonAfter5.key) ? [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name), ['value']) : [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
|
138
146
|
rules: [{
|
139
147
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
@@ -9,7 +9,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
9
|
/*
|
10
10
|
* @Author: wangxian
|
11
11
|
* @Date: 2021-09-18 14:15:04
|
12
|
-
* @LastEditTime: 2023-02-
|
12
|
+
* @LastEditTime: 2023-02-23 16:31:33
|
13
13
|
*/
|
14
14
|
import React from 'react';
|
15
15
|
import { MetadataFormContext, MetadataRefContext } from '../interface';
|
@@ -22,6 +22,7 @@ function Index(props) {
|
|
22
22
|
name = props.name,
|
23
23
|
isRefForm = props.isRefForm,
|
24
24
|
disabled = props.disabled,
|
25
|
+
labelSpan = props.labelSpan,
|
25
26
|
field = props.field,
|
26
27
|
isObj = props.isObj;
|
27
28
|
var formContext = React.useContext(MetadataFormContext) || {};
|
@@ -62,6 +63,14 @@ function Index(props) {
|
|
62
63
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
63
64
|
} : {}
|
64
65
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
66
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
67
|
+
span: labelSpan,
|
68
|
+
offset: 0
|
69
|
+
} : undefined,
|
70
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
71
|
+
span: 24 - labelSpan,
|
72
|
+
offset: 0
|
73
|
+
} : undefined,
|
65
74
|
rules: [{
|
66
75
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
67
76
|
}].concat(_toConsumableArray(rules)),
|
@@ -84,6 +93,14 @@ function Index(props) {
|
|
84
93
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
85
94
|
} : {}
|
86
95
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
96
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
97
|
+
span: labelSpan,
|
98
|
+
offset: 0
|
99
|
+
} : undefined,
|
100
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
101
|
+
span: 24 - labelSpan,
|
102
|
+
offset: 0
|
103
|
+
} : undefined,
|
87
104
|
name: name,
|
88
105
|
rules: [{
|
89
106
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
@@ -99,7 +116,6 @@ function Index(props) {
|
|
99
116
|
paddingRight: '10px'
|
100
117
|
},
|
101
118
|
name: [field === null || field === void 0 ? void 0 : field.name],
|
102
|
-
fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
|
103
119
|
rules: [{
|
104
120
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
105
121
|
}].concat(_toConsumableArray(rules)),
|
@@ -30,6 +30,7 @@ function Index(props) {
|
|
30
30
|
disabled = props.disabled,
|
31
31
|
isRefForm = props.isRefForm,
|
32
32
|
fieldRule = props.fields,
|
33
|
+
labelSpan = props.labelSpan,
|
33
34
|
initEnumValue = props.initEnumValue,
|
34
35
|
field = props.field,
|
35
36
|
name = props.name;
|
@@ -263,6 +264,14 @@ function Index(props) {
|
|
263
264
|
return !field ? /*#__PURE__*/React.createElement(_Form.Item, {
|
264
265
|
key: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
265
266
|
label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
|
267
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
268
|
+
span: labelSpan,
|
269
|
+
offset: 0
|
270
|
+
} : undefined,
|
271
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
272
|
+
span: 24 - labelSpan,
|
273
|
+
offset: 0
|
274
|
+
} : undefined,
|
266
275
|
initialValue: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
267
276
|
style: {
|
268
277
|
display: "".concat(extraInfo.hidden ? 'none' : 'block')
|
@@ -53,6 +53,7 @@ function Index(props) {
|
|
53
53
|
initEnumValue = _props$initEnumValue === void 0 ? {} : _props$initEnumValue,
|
54
54
|
disabled = props.disabled,
|
55
55
|
field = props.field,
|
56
|
+
labelSpan = props.labelSpan,
|
56
57
|
isObj = props.isObj,
|
57
58
|
_props$enum = props.enum,
|
58
59
|
myEnum = _props$enum === void 0 ? [] : _props$enum;
|
@@ -457,6 +458,14 @@ function Index(props) {
|
|
457
458
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
458
459
|
} : {}
|
459
460
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
461
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
462
|
+
span: labelSpan,
|
463
|
+
offset: 0
|
464
|
+
} : undefined,
|
465
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
466
|
+
span: 24 - labelSpan,
|
467
|
+
offset: 0
|
468
|
+
} : undefined,
|
460
469
|
name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
|
461
470
|
rules: [{
|
462
471
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
@@ -477,6 +486,14 @@ function Index(props) {
|
|
477
486
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
478
487
|
} : {}
|
479
488
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
489
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
490
|
+
span: labelSpan,
|
491
|
+
offset: 0
|
492
|
+
} : undefined,
|
493
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
494
|
+
span: 24 - labelSpan,
|
495
|
+
offset: 0
|
496
|
+
} : undefined,
|
480
497
|
name: name,
|
481
498
|
rules: [{
|
482
499
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
@@ -21,6 +21,7 @@ function Index(props) {
|
|
21
21
|
name = props.name,
|
22
22
|
isRefForm = props.isRefForm,
|
23
23
|
disabled = props.disabled,
|
24
|
+
labelSpan = props.labelSpan,
|
24
25
|
field = props.field,
|
25
26
|
isObj = props.isObj;
|
26
27
|
var formContext = React.useContext(MetadataFormContext) || {};
|
@@ -40,6 +41,14 @@ function Index(props) {
|
|
40
41
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
41
42
|
} : {}
|
42
43
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
44
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
45
|
+
span: labelSpan,
|
46
|
+
offset: 0
|
47
|
+
} : undefined,
|
48
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
49
|
+
span: 24 - labelSpan,
|
50
|
+
offset: 0
|
51
|
+
} : undefined,
|
43
52
|
name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
|
44
53
|
valuePropName: "checked",
|
45
54
|
rules: [{
|
@@ -60,6 +69,14 @@ function Index(props) {
|
|
60
69
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
61
70
|
} : {}
|
62
71
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
72
|
+
labelCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
73
|
+
span: labelSpan,
|
74
|
+
offset: 0
|
75
|
+
} : undefined,
|
76
|
+
wrapperCol: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? {
|
77
|
+
span: 24 - labelSpan,
|
78
|
+
offset: 0
|
79
|
+
} : undefined,
|
63
80
|
key: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
64
81
|
initialValue: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
65
82
|
style: {
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import "antd/es/form/style";
|
2
|
+
import _Form from "antd/es/form";
|
1
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
2
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
3
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
@@ -321,8 +323,16 @@ var TableArray = function TableArray(props) {
|
|
321
323
|
return /*#__PURE__*/React.createElement("div", {
|
322
324
|
style: {
|
323
325
|
width: '100%',
|
326
|
+
padding: '0 0 8px',
|
324
327
|
height: addButtonHidden || readonly ? "".concat(rowNumber * getCellHeight(readonly) + 45, "px") : "".concat(rowNumber * getCellHeight(readonly) + 45 + 40, "px")
|
325
328
|
}
|
329
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
330
|
+
name: name,
|
331
|
+
noStyle: true,
|
332
|
+
style: {
|
333
|
+
margin: 0,
|
334
|
+
height: '100%'
|
335
|
+
}
|
326
336
|
}, /*#__PURE__*/React.createElement(Editable, {
|
327
337
|
type: "multiple",
|
328
338
|
readonly: readonly,
|
@@ -343,7 +353,7 @@ var TableArray = function TableArray(props) {
|
|
343
353
|
y: addButtonHidden || readonly ? "".concat(rowNumber * getCellHeight(readonly) + 45, "px ") : "".concat(rowNumber * getCellHeight(readonly), "px ")
|
344
354
|
}
|
345
355
|
}
|
346
|
-
}));
|
356
|
+
})));
|
347
357
|
};
|
348
358
|
|
349
359
|
export default TableArray;
|
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
/*
|
6
6
|
* @Author: your name
|
7
7
|
* @Date: 2021-09-18 14:15:04
|
8
|
-
* @LastEditTime: 2023-02-
|
8
|
+
* @LastEditTime: 2023-02-23 14:53:08
|
9
9
|
*/
|
10
10
|
import { getLocale } from '../../../framework/locale';
|
11
11
|
import moment from 'moment';
|
@@ -98,8 +98,14 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$) {
|
|
98
98
|
|
99
99
|
var processDependHiddenOrShow = function processDependHiddenOrShow(depend, changeData, stream$) {
|
100
100
|
try {
|
101
|
-
|
101
|
+
// const regex = /\w+(\.\w+)?[=<>!]{1}/g;
|
102
|
+
var regex = /\w+(\.\w+)?[=<>!]{1}|\w+(\.\w+)?(\.indexOf\('\w+'\)[=<>!]{1})/g;
|
102
103
|
var keys = depend.trim().match(regex);
|
104
|
+
|
105
|
+
if (!keys) {
|
106
|
+
return false;
|
107
|
+
}
|
108
|
+
|
103
109
|
var expression = depend;
|
104
110
|
|
105
111
|
for (var i = 0; i < keys.length; i++) {
|
@@ -1,98 +1,98 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: wangxian
|
3
|
-
* @Date: 2021-09-18 14:15:04
|
4
|
-
* @LastEditTime: 2023-02-09 18:37:15
|
5
|
-
*/
|
6
|
-
export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
|
7
|
-
|
8
|
-
export type IMetaData = {
|
9
|
-
/**
|
10
|
-
* 类名称/属性名称
|
11
|
-
*/
|
12
|
-
id: string;
|
13
|
-
/**
|
14
|
-
* 类型
|
15
|
-
*/
|
16
|
-
type: IMetaType;
|
17
|
-
/**
|
18
|
-
* 属性
|
19
|
-
*/
|
20
|
-
properties?: IMetaProperties[];
|
21
|
-
|
22
|
-
/**
|
23
|
-
* 引用id
|
24
|
-
*/
|
25
|
-
refId?: string;
|
26
|
-
/**
|
27
|
-
* 静态的变量
|
28
|
-
*/
|
29
|
-
fields?: IMetaFileds[];
|
30
|
-
/**
|
31
|
-
* 内部类
|
32
|
-
*/
|
33
|
-
types?: IMetaData[];
|
34
|
-
};
|
35
|
-
|
36
|
-
export type IMetaProperties = {
|
37
|
-
/**
|
38
|
-
* 类规则名称
|
39
|
-
*/
|
40
|
-
id: string;
|
41
|
-
|
42
|
-
/**
|
43
|
-
* 类型
|
44
|
-
*/
|
45
|
-
type: IMetaType;
|
46
|
-
|
47
|
-
/**
|
48
|
-
* 引用id
|
49
|
-
*/
|
50
|
-
refId?: string;
|
51
|
-
/**
|
52
|
-
* 静态的变量
|
53
|
-
*/
|
54
|
-
fields?: IMetaFileds[];
|
55
|
-
/**
|
56
|
-
* 枚举值
|
57
|
-
*/
|
58
|
-
enum?: { value: string }[];
|
59
|
-
/**
|
60
|
-
* 数组类型
|
61
|
-
*/
|
62
|
-
items?: { type: IMetaType; refId?: string };
|
63
|
-
};
|
64
|
-
|
65
|
-
export type IMetaFileds = {
|
66
|
-
/**
|
67
|
-
* 规则名称
|
68
|
-
*/
|
69
|
-
id: string;
|
70
|
-
|
71
|
-
/**
|
72
|
-
* 类型
|
73
|
-
*/
|
74
|
-
type: IMetaType;
|
75
|
-
|
76
|
-
/**
|
77
|
-
* 引用id
|
78
|
-
*/
|
79
|
-
refId?: string;
|
80
|
-
|
81
|
-
/**
|
82
|
-
* 规则值
|
83
|
-
*/
|
84
|
-
value: any;
|
85
|
-
};
|
86
|
-
|
87
|
-
export interface IAPI {
|
88
|
-
// 获取元数据列表
|
89
|
-
GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
|
90
|
-
// 通过元数据Id获取元数据详情
|
91
|
-
GetMetadataDetailById(metadataId: string): Promise<any>;
|
92
|
-
// 新增元数据
|
93
|
-
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
94
|
-
// 获取元数据的值
|
95
|
-
GetMetadataObjList(data: any): Promise<any[]>;
|
96
|
-
/** 通过扩展规则获取枚举类型的值 */
|
97
|
-
GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
|
98
|
-
}
|
1
|
+
/*
|
2
|
+
* @Author: wangxian
|
3
|
+
* @Date: 2021-09-18 14:15:04
|
4
|
+
* @LastEditTime: 2023-02-09 18:37:15
|
5
|
+
*/
|
6
|
+
export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
|
7
|
+
|
8
|
+
export type IMetaData = {
|
9
|
+
/**
|
10
|
+
* 类名称/属性名称
|
11
|
+
*/
|
12
|
+
id: string;
|
13
|
+
/**
|
14
|
+
* 类型
|
15
|
+
*/
|
16
|
+
type: IMetaType;
|
17
|
+
/**
|
18
|
+
* 属性
|
19
|
+
*/
|
20
|
+
properties?: IMetaProperties[];
|
21
|
+
|
22
|
+
/**
|
23
|
+
* 引用id
|
24
|
+
*/
|
25
|
+
refId?: string;
|
26
|
+
/**
|
27
|
+
* 静态的变量
|
28
|
+
*/
|
29
|
+
fields?: IMetaFileds[];
|
30
|
+
/**
|
31
|
+
* 内部类
|
32
|
+
*/
|
33
|
+
types?: IMetaData[];
|
34
|
+
};
|
35
|
+
|
36
|
+
export type IMetaProperties = {
|
37
|
+
/**
|
38
|
+
* 类规则名称
|
39
|
+
*/
|
40
|
+
id: string;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* 类型
|
44
|
+
*/
|
45
|
+
type: IMetaType;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* 引用id
|
49
|
+
*/
|
50
|
+
refId?: string;
|
51
|
+
/**
|
52
|
+
* 静态的变量
|
53
|
+
*/
|
54
|
+
fields?: IMetaFileds[];
|
55
|
+
/**
|
56
|
+
* 枚举值
|
57
|
+
*/
|
58
|
+
enum?: { value: string }[];
|
59
|
+
/**
|
60
|
+
* 数组类型
|
61
|
+
*/
|
62
|
+
items?: { type: IMetaType; refId?: string };
|
63
|
+
};
|
64
|
+
|
65
|
+
export type IMetaFileds = {
|
66
|
+
/**
|
67
|
+
* 规则名称
|
68
|
+
*/
|
69
|
+
id: string;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* 类型
|
73
|
+
*/
|
74
|
+
type: IMetaType;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* 引用id
|
78
|
+
*/
|
79
|
+
refId?: string;
|
80
|
+
|
81
|
+
/**
|
82
|
+
* 规则值
|
83
|
+
*/
|
84
|
+
value: any;
|
85
|
+
};
|
86
|
+
|
87
|
+
export interface IAPI {
|
88
|
+
// 获取元数据列表
|
89
|
+
GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
|
90
|
+
// 通过元数据Id获取元数据详情
|
91
|
+
GetMetadataDetailById(metadataId: string): Promise<any>;
|
92
|
+
// 新增元数据
|
93
|
+
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
94
|
+
// 获取元数据的值
|
95
|
+
GetMetadataObjList(data: any): Promise<any[]>;
|
96
|
+
/** 通过扩展规则获取枚举类型的值 */
|
97
|
+
GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
|
98
|
+
}
|