ronds-metadata 1.1.92 → 1.1.94
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/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +4 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.d.ts +4 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +3 -1
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +10 -6
- package/es/comps/MetadataForm/DataCell/Input.js +30 -9
- package/es/comps/MetadataForm/DataCell/Select.js +30 -14
- package/package.json +1 -1
@@ -2,7 +2,7 @@
|
|
2
2
|
* @Author: uloveits 719310130@qq.com
|
3
3
|
* @Date: 2023-02-06 15:05:42
|
4
4
|
* @LastEditors: uloveits 719310130@qq.com
|
5
|
-
* @LastEditTime: 2023-02-
|
5
|
+
* @LastEditTime: 2023-02-15 16:40:40
|
6
6
|
*/
|
7
7
|
import CanvasCore from '../../index';
|
8
8
|
import { withFieldCellWrapper } from '../HOC';
|
@@ -7,14 +7,15 @@ import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestruct
|
|
7
7
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
8
8
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
9
9
|
import React from 'react';
|
10
|
+
import { useDrag, useDrop } from 'react-dnd';
|
10
11
|
import { DragOutlined, SnippetsOutlined, DeleteOutlined } from '@ant-design/icons';
|
11
12
|
import { FGCtx } from '../../../../../Provider';
|
12
13
|
import { dragItemType, streamEventType } from '../../../../../settings';
|
13
14
|
import useObservable from '../../../../../../../framework/rxjs-hooks/useObservable';
|
14
|
-
import { useDrag, useDrop } from 'react-dnd';
|
15
15
|
export function withFieldCellWrapper(WrappedComponent) {
|
16
16
|
return function (props) {
|
17
17
|
var data = props.data,
|
18
|
+
refId = props.refId,
|
18
19
|
isShowAction = props.isShowAction;
|
19
20
|
var fGCtx = React.useContext(FGCtx) || {};
|
20
21
|
var boxRef = React.useRef(null);
|
@@ -81,7 +82,8 @@ export function withFieldCellWrapper(WrappedComponent) {
|
|
81
82
|
payload: {
|
82
83
|
dragItem: item.dragItem,
|
83
84
|
dropId: data.id,
|
84
|
-
position: position
|
85
|
+
position: position,
|
86
|
+
refId: refId
|
85
87
|
}
|
86
88
|
});
|
87
89
|
},
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* @Author: wangxian
|
3
3
|
* @Date: 2023-02-06 11:35:45
|
4
|
-
* @LastEditTime: 2023-02-
|
4
|
+
* @LastEditTime: 2023-02-15 16:19:46
|
5
5
|
*/
|
6
6
|
import React from 'react';
|
7
7
|
import Input from './Cell/Input';
|
@@ -16,6 +16,7 @@ import List from './Cell/List';
|
|
16
16
|
|
17
17
|
var RenderField = function RenderField(props) {
|
18
18
|
var data = props.data,
|
19
|
+
refId = props.refId,
|
19
20
|
_props$isShowAction = props.isShowAction,
|
20
21
|
isShowAction = _props$isShowAction === void 0 ? false : _props$isShowAction;
|
21
22
|
var FieldContent = React.useMemo(function () {
|
@@ -25,6 +26,7 @@ var RenderField = function RenderField(props) {
|
|
25
26
|
var Comm = DataCellMap[data.type];
|
26
27
|
return /*#__PURE__*/React.createElement(Comm, {
|
27
28
|
data: data,
|
29
|
+
refId: refId,
|
28
30
|
isShowAction: isShowAction
|
29
31
|
});
|
30
32
|
}
|
@@ -97,7 +97,7 @@ var CanvasCore = function CanvasCore(props) {
|
|
97
97
|
listRef.current = _list;
|
98
98
|
}, []);
|
99
99
|
var processFgStreamData = React.useCallback(function (p) {
|
100
|
-
var _p$payload, _p$
|
100
|
+
var _p$payload, _p$payload2, _p$payload4;
|
101
101
|
|
102
102
|
switch (p === null || p === void 0 ? void 0 : p.type) {
|
103
103
|
case streamEventType.onClearCanvas:
|
@@ -106,7 +106,10 @@ var CanvasCore = function CanvasCore(props) {
|
|
106
106
|
break;
|
107
107
|
|
108
108
|
case streamEventType.onDropOver:
|
109
|
-
|
109
|
+
if (refId === ((_p$payload = p.payload) === null || _p$payload === void 0 ? void 0 : _p$payload.refId)) {
|
110
|
+
addNewNode(p.payload.dragItem, p.payload.dropId, p.payload.position);
|
111
|
+
}
|
112
|
+
|
110
113
|
break;
|
111
114
|
|
112
115
|
case streamEventType.onNodeCopy:
|
@@ -132,13 +135,13 @@ var CanvasCore = function CanvasCore(props) {
|
|
132
135
|
break;
|
133
136
|
|
134
137
|
case streamEventType.onSettingValueChange:
|
135
|
-
if (p === null || p === void 0 ? void 0 : (_p$
|
136
|
-
var _p$
|
138
|
+
if (p === null || p === void 0 ? void 0 : (_p$payload2 = p.payload) === null || _p$payload2 === void 0 ? void 0 : _p$payload2.formSetting) {
|
139
|
+
var _p$payload3;
|
137
140
|
|
138
|
-
setFormSetting(_objectSpread({}, p === null || p === void 0 ? void 0 : (_p$
|
141
|
+
setFormSetting(_objectSpread({}, p === null || p === void 0 ? void 0 : (_p$payload3 = p.payload) === null || _p$payload3 === void 0 ? void 0 : _p$payload3.formSetting));
|
139
142
|
}
|
140
143
|
|
141
|
-
setAllSetting(_objectSpread({}, p === null || p === void 0 ? void 0 : (_p$
|
144
|
+
setAllSetting(_objectSpread({}, p === null || p === void 0 ? void 0 : (_p$payload4 = p.payload) === null || _p$payload4 === void 0 ? void 0 : _p$payload4.allSetting));
|
142
145
|
break;
|
143
146
|
}
|
144
147
|
}, []);
|
@@ -242,6 +245,7 @@ var CanvasCore = function CanvasCore(props) {
|
|
242
245
|
onSelect(it);
|
243
246
|
}
|
244
247
|
}, /*#__PURE__*/React.createElement(RenderField, {
|
248
|
+
refId: refId,
|
245
249
|
data: it,
|
246
250
|
isShowAction: curNodeId === it.id
|
247
251
|
})));
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
1
2
|
import "antd/es/form/style";
|
2
3
|
import _Form from "antd/es/form";
|
3
|
-
import
|
4
|
+
import "antd/es/select/style";
|
5
|
+
import _Select from "antd/es/select";
|
4
6
|
import "antd/es/upload/style";
|
5
7
|
import _Upload from "antd/es/upload";
|
6
8
|
import "antd/es/button/style";
|
@@ -15,7 +17,7 @@ import _Input from "antd/es/input";
|
|
15
17
|
/*
|
16
18
|
* @Author: wangxian
|
17
19
|
* @Date: 2021-09-18 14:15:04
|
18
|
-
* @LastEditTime: 2023-02-
|
20
|
+
* @LastEditTime: 2023-02-15 15:54:24
|
19
21
|
*/
|
20
22
|
import React from 'react';
|
21
23
|
import { UploadOutlined } from '@ant-design/icons';
|
@@ -24,7 +26,7 @@ import { useGetExtraInfo, useWatchDepend } from '../hooks';
|
|
24
26
|
var TextArea = _Input.TextArea;
|
25
27
|
|
26
28
|
function Index(props) {
|
27
|
-
var _extraInfo$depend;
|
29
|
+
var _extraInfo$depend, _extraInfo$addonAfter6;
|
28
30
|
|
29
31
|
var id = props.id,
|
30
32
|
isRefForm = props.isRefForm,
|
@@ -57,8 +59,10 @@ function Index(props) {
|
|
57
59
|
}
|
58
60
|
}, [extraInfo]);
|
59
61
|
|
62
|
+
var onChange = function onChange(e) {};
|
63
|
+
|
60
64
|
var processInputType = function processInputType(_type) {
|
61
|
-
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5;
|
65
|
+
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$addonAfter, _extraInfo$addonAfter2, _extraInfo$addonAfter3, _extraInfo$addonAfter4, _extraInfo$disabled5;
|
62
66
|
|
63
67
|
switch (_type) {
|
64
68
|
case 'password':
|
@@ -98,9 +102,20 @@ function Index(props) {
|
|
98
102
|
|
99
103
|
default:
|
100
104
|
return /*#__PURE__*/React.createElement(_Input, {
|
105
|
+
addonAfter: ((_extraInfo$addonAfter = extraInfo.addonAfter) === null || _extraInfo$addonAfter === void 0 ? void 0 : _extraInfo$addonAfter.key) ? /*#__PURE__*/React.createElement(_Form.Item, {
|
106
|
+
name: [].concat(_toConsumableArray(name), [(_extraInfo$addonAfter2 = extraInfo.addonAfter) === null || _extraInfo$addonAfter2 === void 0 ? void 0 : _extraInfo$addonAfter2.key]),
|
107
|
+
noStyle: true,
|
108
|
+
initialValue: (_extraInfo$addonAfter3 = extraInfo.addonAfter) === null || _extraInfo$addonAfter3 === void 0 ? void 0 : _extraInfo$addonAfter3.defaultValue
|
109
|
+
}, /*#__PURE__*/React.createElement(_Select, null, (((_extraInfo$addonAfter4 = extraInfo.addonAfter) === null || _extraInfo$addonAfter4 === void 0 ? void 0 : _extraInfo$addonAfter4.value) || []).map(function (v) {
|
110
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
111
|
+
key: v,
|
112
|
+
value: v
|
113
|
+
}, v);
|
114
|
+
}))) : undefined,
|
101
115
|
disabled: (_extraInfo$disabled5 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled5 !== void 0 ? _extraInfo$disabled5 : disabled,
|
102
116
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
|
103
|
-
allowClear: true
|
117
|
+
allowClear: true,
|
118
|
+
onChange: onChange
|
104
119
|
});
|
105
120
|
}
|
106
121
|
};
|
@@ -111,9 +126,12 @@ function Index(props) {
|
|
111
126
|
|
112
127
|
if ((extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$depend = extraInfo.depend) === null || _extraInfo$depend === void 0 ? void 0 : _extraInfo$depend.show) && !depend.show) {
|
113
128
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
114
|
-
}
|
129
|
+
} // ref引用的 应用类型是否展示成表单
|
130
|
+
|
115
131
|
|
116
132
|
if (isObj && isRefForm && field) {
|
133
|
+
var _extraInfo$addonAfter5;
|
134
|
+
|
117
135
|
return /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
|
118
136
|
style: {
|
119
137
|
flex: 1,
|
@@ -124,7 +142,7 @@ function Index(props) {
|
|
124
142
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
125
143
|
} : {}
|
126
144
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
127
|
-
name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
|
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)),
|
128
146
|
rules: [{
|
129
147
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
130
148
|
}].concat(_toConsumableArray(rules)),
|
@@ -133,7 +151,10 @@ function Index(props) {
|
|
133
151
|
}), processInputType((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type) || ''));
|
134
152
|
}
|
135
153
|
|
136
|
-
return !field ?
|
154
|
+
return !field ?
|
155
|
+
/*#__PURE__*/
|
156
|
+
// 不是引用的
|
157
|
+
React.createElement(_Form.Item, {
|
137
158
|
key: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
138
159
|
initialValue: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
139
160
|
style: {
|
@@ -144,7 +165,7 @@ function Index(props) {
|
|
144
165
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
145
166
|
} : {}
|
146
167
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
147
|
-
name: name,
|
168
|
+
name: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$addonAfter6 = extraInfo.addonAfter) === null || _extraInfo$addonAfter6 === void 0 ? void 0 : _extraInfo$addonAfter6.key) ? [].concat(_toConsumableArray(name), ['value']) : name,
|
148
169
|
rules: [{
|
149
170
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
150
171
|
}].concat(_toConsumableArray(rules)),
|
@@ -31,7 +31,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
31
31
|
/*
|
32
32
|
* @Author:wangxian
|
33
33
|
* @Date: 2021-09-18 14:15:04
|
34
|
-
* @LastEditTime: 2023-02-
|
34
|
+
* @LastEditTime: 2023-02-16 10:52:57
|
35
35
|
*/
|
36
36
|
import React from 'react';
|
37
37
|
import { MetadataFormContext, MetadataRefContext } from '../interface';
|
@@ -41,6 +41,7 @@ import { deepClone } from '../../../utils';
|
|
41
41
|
import { useAsyncMemo } from '../../../framework/hooks/use-async-memo';
|
42
42
|
import { tr } from '../../../framework/locale';
|
43
43
|
import useObservable from '../../../framework/rxjs-hooks/useObservable';
|
44
|
+
import { assign } from '../utils';
|
44
45
|
|
45
46
|
function Index(props) {
|
46
47
|
var _extraInfo$depend, _extraInfo$http6, _extraInfo$http7, _extraInfo$http8, _extraInfo$http9;
|
@@ -91,11 +92,19 @@ function Index(props) {
|
|
91
92
|
var _watchArr = _watch.split(',');
|
92
93
|
|
93
94
|
if (_watchArr.length === 1) {
|
94
|
-
var
|
95
|
+
var evalString = '';
|
95
96
|
|
96
|
-
var
|
97
|
+
for (var i = 0; i < name.length; i++) {
|
98
|
+
if (i < name.length - 1) {
|
99
|
+
evalString = "".concat(evalString, "[name[").concat(i, "]]");
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
var _value = eval("p?.payload?.allVals".concat(evalString, "[_watchArr[0]]"));
|
104
|
+
|
105
|
+
var _changeData = eval("p?.payload?.val".concat(evalString, "[_watchArr[0]]"));
|
97
106
|
|
98
|
-
if (_value &&
|
107
|
+
if (_value && _changeData) {
|
99
108
|
if ((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.http.method) === 'post') {
|
100
109
|
var _wRef = watchValueRef.current || {};
|
101
110
|
|
@@ -108,36 +117,43 @@ function Index(props) {
|
|
108
117
|
}
|
109
118
|
}
|
110
119
|
|
111
|
-
if (
|
120
|
+
if (_changeData) {
|
112
121
|
setTimeout(function () {
|
113
|
-
|
122
|
+
var v = {};
|
123
|
+
assign(name, undefined, v);
|
124
|
+
formContext.form.setFieldsValue(_objectSpread({}, v));
|
114
125
|
}, 100);
|
115
126
|
}
|
116
127
|
} else {
|
117
128
|
var b = false;
|
118
129
|
|
119
|
-
for (var
|
120
|
-
var
|
130
|
+
for (var _i = 0; _i < _watchArr.length; _i++) {
|
131
|
+
var w = _watchArr[_i];
|
132
|
+
var _evalString = '';
|
121
133
|
|
122
|
-
var
|
134
|
+
for (var _i2 = 0; _i2 < name.length; _i2++) {
|
135
|
+
if (_i2 < name.length - 1) {
|
136
|
+
_evalString = "".concat(_evalString, "[name[").concat(_i2, "]]");
|
137
|
+
}
|
138
|
+
}
|
123
139
|
|
124
|
-
var _value2 =
|
140
|
+
var _value2 = eval("p?.payload?.allVals".concat(_evalString, "[w]"));
|
125
141
|
|
126
142
|
if (_value2) {
|
127
|
-
var _p$payload5;
|
128
|
-
|
129
143
|
var _wRef2 = watchValueRef.current || {};
|
130
144
|
|
131
145
|
_wRef2[w] = _value2;
|
132
146
|
watchValueRef.current = _wRef2;
|
133
|
-
b =
|
147
|
+
b = eval("p?.payload?.val".concat(_evalString, "[w]"));
|
134
148
|
}
|
135
149
|
}
|
136
150
|
|
137
151
|
if (b) {
|
138
152
|
setWatchValue(_objectSpread({}, watchValueRef.current));
|
139
153
|
setTimeout(function () {
|
140
|
-
|
154
|
+
var v = {};
|
155
|
+
assign(name, undefined, v);
|
156
|
+
formContext.form.setFieldsValue(_objectSpread({}, v));
|
141
157
|
}, 100);
|
142
158
|
}
|
143
159
|
}
|