@quansitech/antd-admin 1.1.42 → 1.1.43
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/dist/components/Column/Cascader.js +24 -11
- package/dist/components/Column/File.js +29 -15
- package/dist/components/Column/Readonly/Cascader.js +19 -11
- package/dist/components/Column/Readonly/File.js +19 -10
- package/dist/components/Form.scss +11 -7
- package/dist/components/Table.js +12 -14
- package/dist/lib/FormList/index.d.ts +5 -0
- package/dist/lib/FormList/index.js +15 -0
- package/dist/lib/schemaHandler.js +4 -18
- package/package.json +1 -1
|
@@ -23,6 +23,7 @@ import React, { useContext, useEffect, useState } from "react";
|
|
|
23
23
|
import http from "../../lib/http";
|
|
24
24
|
import { FormContext } from "../FormContext";
|
|
25
25
|
import { TableContext } from "../TableContext";
|
|
26
|
+
import { ItemContext } from "../../lib/FormList";
|
|
26
27
|
export default function (props) {
|
|
27
28
|
var _useState = useState(),
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -34,6 +35,7 @@ export default function (props) {
|
|
|
34
35
|
setValues = _useState4[1];
|
|
35
36
|
var formContext = useContext(FormContext);
|
|
36
37
|
var tableContext = useContext(TableContext);
|
|
38
|
+
var itemContext = useContext(ItemContext);
|
|
37
39
|
var findValue = function findValue(options, value) {
|
|
38
40
|
for (var i = 0; i < options.length; i++) {
|
|
39
41
|
var _option$children;
|
|
@@ -50,6 +52,7 @@ export default function (props) {
|
|
|
50
52
|
return [];
|
|
51
53
|
};
|
|
52
54
|
useEffect(function () {
|
|
55
|
+
var _props$fieldProps, _props$fieldProps2;
|
|
53
56
|
var value = props.fieldProps.value;
|
|
54
57
|
setOptions(props.fieldProps.options || []);
|
|
55
58
|
if (value && props.fieldProps.options) {
|
|
@@ -67,12 +70,22 @@ export default function (props) {
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
var extraData;
|
|
70
|
-
if (
|
|
71
|
-
extraData =
|
|
73
|
+
if ((_props$fieldProps = props.fieldProps) !== null && _props$fieldProps !== void 0 && _props$fieldProps.extraRenderValue) {
|
|
74
|
+
extraData = props.fieldProps.extraRenderValue;
|
|
72
75
|
}
|
|
73
|
-
if (
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
+
if ((_props$fieldProps2 = props.fieldProps) !== null && _props$fieldProps2 !== void 0 && _props$fieldProps2.extraRenderValues) {
|
|
77
|
+
var _props$fieldProps$ext;
|
|
78
|
+
var index = -1;
|
|
79
|
+
if (tableContext && tableContext !== null && tableContext !== void 0 && tableContext.dataSource) {
|
|
80
|
+
var key = tableContext.getTableProps().rowKey;
|
|
81
|
+
index = tableContext.dataSource.findIndex(function (item) {
|
|
82
|
+
return item[key] === props.record[key];
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (itemContext && (itemContext === null || itemContext === void 0 ? void 0 : itemContext.index) !== undefined) {
|
|
86
|
+
index = itemContext.index;
|
|
87
|
+
}
|
|
88
|
+
extraData = (_props$fieldProps$ext = props.fieldProps.extraRenderValues[index]) !== null && _props$fieldProps$ext !== void 0 ? _props$fieldProps$ext : [];
|
|
76
89
|
}
|
|
77
90
|
if (extraData) {
|
|
78
91
|
setOptions(extraData.options);
|
|
@@ -134,22 +147,22 @@ export default function (props) {
|
|
|
134
147
|
};
|
|
135
148
|
}();
|
|
136
149
|
var onChange = function onChange(values) {
|
|
137
|
-
var _props$
|
|
150
|
+
var _props$fieldProps5;
|
|
138
151
|
setValues(values);
|
|
139
152
|
if (!(values !== null && values !== void 0 && values.length)) {
|
|
140
|
-
var _props$
|
|
141
|
-
(_props$
|
|
153
|
+
var _props$fieldProps3;
|
|
154
|
+
(_props$fieldProps3 = props.fieldProps) === null || _props$fieldProps3 === void 0 || _props$fieldProps3.onChange(props.fieldProps['data-field'], undefined);
|
|
142
155
|
return;
|
|
143
156
|
}
|
|
144
157
|
if (props.fieldProps.multiple) {
|
|
145
|
-
var _props$
|
|
146
|
-
(_props$
|
|
158
|
+
var _props$fieldProps4;
|
|
159
|
+
(_props$fieldProps4 = props.fieldProps) === null || _props$fieldProps4 === void 0 || _props$fieldProps4.onChange(values.map(function (v) {
|
|
147
160
|
return v[v.length - 1];
|
|
148
161
|
}));
|
|
149
162
|
return;
|
|
150
163
|
}
|
|
151
164
|
var value = values[values.length - 1];
|
|
152
|
-
(_props$
|
|
165
|
+
(_props$fieldProps5 = props.fieldProps) === null || _props$fieldProps5 === void 0 || _props$fieldProps5.onChange(value);
|
|
153
166
|
};
|
|
154
167
|
var fieldProps = _objectSpread({}, props.fieldProps);
|
|
155
168
|
delete fieldProps.loadDataUrl;
|
|
@@ -22,6 +22,7 @@ import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy }
|
|
|
22
22
|
import { CSS } from '@dnd-kit/utilities';
|
|
23
23
|
import { FormContext } from "../FormContext";
|
|
24
24
|
import { TableContext } from "../TableContext";
|
|
25
|
+
import { ItemContext } from "../../lib/FormList";
|
|
25
26
|
var DraggableUploadListItem = function DraggableUploadListItem(_ref) {
|
|
26
27
|
var originNode = _ref.originNode,
|
|
27
28
|
file = _ref.file;
|
|
@@ -49,7 +50,7 @@ var DraggableUploadListItem = function DraggableUploadListItem(_ref) {
|
|
|
49
50
|
}, attributes, listeners), file.status === 'error' && isDragging ? originNode.props.children : originNode);
|
|
50
51
|
};
|
|
51
52
|
export default function (props) {
|
|
52
|
-
var _props$
|
|
53
|
+
var _props$fieldProps4, _props$fieldProps5, _props$fieldProps6, _props$fieldProps7;
|
|
53
54
|
var _useState = useState(true),
|
|
54
55
|
_useState2 = _slicedToArray(_useState, 2),
|
|
55
56
|
loading = _useState2[0],
|
|
@@ -60,6 +61,7 @@ export default function (props) {
|
|
|
60
61
|
setFileList = _useState4[1];
|
|
61
62
|
var formContext = useContext(FormContext);
|
|
62
63
|
var tableContext = useContext(TableContext);
|
|
64
|
+
var itemContext = useContext(ItemContext);
|
|
63
65
|
var handlePreview = /*#__PURE__*/function () {
|
|
64
66
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
65
67
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -90,20 +92,32 @@ export default function (props) {
|
|
|
90
92
|
}
|
|
91
93
|
return file;
|
|
92
94
|
});
|
|
93
|
-
(_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 || _props$fieldProps.onChange(values)
|
|
95
|
+
(_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 || _props$fieldProps.onChange(values.filter(function (file) {
|
|
96
|
+
return file.status === 'done';
|
|
97
|
+
}).map(function (file) {
|
|
98
|
+
var _file$response;
|
|
99
|
+
return (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.file_id;
|
|
100
|
+
}).join(','));
|
|
94
101
|
}, [fileList]);
|
|
95
102
|
useEffect(function () {
|
|
103
|
+
var _props$fieldProps2, _props$fieldProps3;
|
|
96
104
|
var extraRenderValue = [];
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
if ((_props$fieldProps2 = props.fieldProps) !== null && _props$fieldProps2 !== void 0 && _props$fieldProps2.extraRenderValue) {
|
|
106
|
+
extraRenderValue = props.fieldProps.extraRenderValue;
|
|
107
|
+
}
|
|
108
|
+
if ((_props$fieldProps3 = props.fieldProps) !== null && _props$fieldProps3 !== void 0 && _props$fieldProps3.extraRenderValues) {
|
|
109
|
+
var _props$fieldProps$ext;
|
|
110
|
+
var index = -1;
|
|
111
|
+
if (tableContext && tableContext !== null && tableContext !== void 0 && tableContext.dataSource) {
|
|
112
|
+
var key = tableContext.getTableProps().rowKey;
|
|
113
|
+
index = tableContext.dataSource.findIndex(function (item) {
|
|
114
|
+
return item[key] === props.record[key];
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (itemContext && (itemContext === null || itemContext === void 0 ? void 0 : itemContext.index) !== undefined) {
|
|
118
|
+
index = itemContext.index;
|
|
119
|
+
}
|
|
120
|
+
extraRenderValue = (_props$fieldProps$ext = props.fieldProps.extraRenderValues[index]) !== null && _props$fieldProps$ext !== void 0 ? _props$fieldProps$ext : [];
|
|
107
121
|
}
|
|
108
122
|
if (!extraRenderValue.length) {
|
|
109
123
|
setLoading(false);
|
|
@@ -125,9 +139,9 @@ export default function (props) {
|
|
|
125
139
|
setLoading(false);
|
|
126
140
|
}, []);
|
|
127
141
|
var uploadButton = /*#__PURE__*/React.createElement(Tooltip, {
|
|
128
|
-
title: fileList.length >= (((_props$
|
|
142
|
+
title: fileList.length >= (((_props$fieldProps4 = props.fieldProps) === null || _props$fieldProps4 === void 0 ? void 0 : _props$fieldProps4.maxCount) || 1) ? '最多只能上传' + (((_props$fieldProps5 = props.fieldProps) === null || _props$fieldProps5 === void 0 ? void 0 : _props$fieldProps5.maxCount) || 1) + '个文件' : ''
|
|
129
143
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
130
|
-
disabled: fileList.length >= (((_props$
|
|
144
|
+
disabled: fileList.length >= (((_props$fieldProps6 = props.fieldProps) === null || _props$fieldProps6 === void 0 ? void 0 : _props$fieldProps6.maxCount) || 1)
|
|
131
145
|
}, "\u4E0A\u4F20\u6587\u4EF6"));
|
|
132
146
|
var sensor = useSensor(PointerSensor, {
|
|
133
147
|
activationConstraint: {
|
|
@@ -171,7 +185,7 @@ export default function (props) {
|
|
|
171
185
|
},
|
|
172
186
|
customRequest: customRequest
|
|
173
187
|
}), props.uploadButton ? props.uploadButton(fileList) : uploadButton);
|
|
174
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, (_props$
|
|
188
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (_props$fieldProps7 = props.fieldProps) !== null && _props$fieldProps7 !== void 0 && _props$fieldProps7.uploadRequest ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spin, {
|
|
175
189
|
spinning: loading
|
|
176
190
|
}, /*#__PURE__*/React.createElement(DndContext, {
|
|
177
191
|
sensors: [sensor],
|
|
@@ -12,6 +12,7 @@ import React, { useContext, useEffect, useState } from "react";
|
|
|
12
12
|
import http from "../../../lib/http";
|
|
13
13
|
import { FormContext } from "../../FormContext";
|
|
14
14
|
import { TableContext } from "../../TableContext";
|
|
15
|
+
import { ItemContext } from "../../../lib/FormList";
|
|
15
16
|
export default function (props) {
|
|
16
17
|
var _useState = useState('-'),
|
|
17
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19,6 +20,7 @@ export default function (props) {
|
|
|
19
20
|
setText = _useState2[1];
|
|
20
21
|
var formContext = useContext(FormContext);
|
|
21
22
|
var tableContext = useContext(TableContext);
|
|
23
|
+
var itemContext = useContext(ItemContext || null);
|
|
22
24
|
var findValue = function findValue(options, value) {
|
|
23
25
|
for (var i = 0; i < options.length; i++) {
|
|
24
26
|
var option = options[i];
|
|
@@ -30,20 +32,26 @@ export default function (props) {
|
|
|
30
32
|
}
|
|
31
33
|
};
|
|
32
34
|
useEffect(function () {
|
|
33
|
-
var _props$fieldProps;
|
|
35
|
+
var _props$fieldProps, _props$fieldProps2, _props$fieldProps3;
|
|
34
36
|
setText(props.fieldProps.value);
|
|
35
37
|
var value = props.fieldProps.value;
|
|
36
38
|
var extraData;
|
|
37
|
-
if (
|
|
38
|
-
extraData =
|
|
39
|
+
if ((_props$fieldProps = props.fieldProps) !== null && _props$fieldProps !== void 0 && _props$fieldProps.extraRenderValue) {
|
|
40
|
+
extraData = props.fieldProps.extraRenderValue;
|
|
39
41
|
}
|
|
40
|
-
if (
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
if ((_props$fieldProps2 = props.fieldProps) !== null && _props$fieldProps2 !== void 0 && _props$fieldProps2.extraRenderValues) {
|
|
43
|
+
var _props$fieldProps$ext;
|
|
44
|
+
var index = -1;
|
|
45
|
+
if (tableContext && tableContext !== null && tableContext !== void 0 && tableContext.dataSource) {
|
|
46
|
+
var key = tableContext.getTableProps().rowKey;
|
|
47
|
+
index = tableContext.dataSource.findIndex(function (item) {
|
|
48
|
+
return item[key] === props.record[key];
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (itemContext && (itemContext === null || itemContext === void 0 ? void 0 : itemContext.index) !== undefined) {
|
|
52
|
+
index = itemContext.index;
|
|
53
|
+
}
|
|
54
|
+
extraData = (_props$fieldProps$ext = props.fieldProps.extraRenderValues[index]) !== null && _props$fieldProps$ext !== void 0 ? _props$fieldProps$ext : [];
|
|
47
55
|
}
|
|
48
56
|
if (extraData) {
|
|
49
57
|
setText(findValue(extraData.options, value).join(' / '));
|
|
@@ -51,7 +59,7 @@ export default function (props) {
|
|
|
51
59
|
}
|
|
52
60
|
|
|
53
61
|
// 远程获取数据
|
|
54
|
-
if (!((_props$
|
|
62
|
+
if (!((_props$fieldProps3 = props.fieldProps) !== null && _props$fieldProps3 !== void 0 && _props$fieldProps3.loadDataUrl)) {
|
|
55
63
|
return;
|
|
56
64
|
}
|
|
57
65
|
http({
|
|
@@ -8,6 +8,7 @@ import { Spin, Upload } from "antd";
|
|
|
8
8
|
import React, { useContext, useEffect, useState } from "react";
|
|
9
9
|
import { FormContext } from "../../FormContext";
|
|
10
10
|
import { TableContext } from "../../TableContext";
|
|
11
|
+
import { ItemContext } from "../../../lib/FormList";
|
|
11
12
|
export default function (props) {
|
|
12
13
|
var _useState = useState(true),
|
|
13
14
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19,18 +20,26 @@ export default function (props) {
|
|
|
19
20
|
setFileList = _useState4[1];
|
|
20
21
|
var formContext = useContext(FormContext);
|
|
21
22
|
var tableContext = useContext(TableContext);
|
|
23
|
+
var itemContext = useContext(ItemContext);
|
|
22
24
|
useEffect(function () {
|
|
25
|
+
var _props$fieldProps, _props$fieldProps2;
|
|
23
26
|
var extraRenderValue = [];
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
if ((_props$fieldProps = props.fieldProps) !== null && _props$fieldProps !== void 0 && _props$fieldProps.extraRenderValue) {
|
|
28
|
+
extraRenderValue = props.fieldProps.extraRenderValue;
|
|
29
|
+
}
|
|
30
|
+
if ((_props$fieldProps2 = props.fieldProps) !== null && _props$fieldProps2 !== void 0 && _props$fieldProps2.extraRenderValues) {
|
|
31
|
+
var _props$fieldProps$ext;
|
|
32
|
+
var index = -1;
|
|
33
|
+
if (tableContext && tableContext !== null && tableContext !== void 0 && tableContext.dataSource) {
|
|
34
|
+
var key = tableContext.getTableProps().rowKey;
|
|
35
|
+
index = tableContext.dataSource.findIndex(function (item) {
|
|
36
|
+
return item[key] === props.record[key];
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (itemContext && (itemContext === null || itemContext === void 0 ? void 0 : itemContext.index) !== undefined) {
|
|
40
|
+
index = itemContext.index;
|
|
41
|
+
}
|
|
42
|
+
extraRenderValue = (_props$fieldProps$ext = props.fieldProps.extraRenderValues[index]) !== null && _props$fieldProps$ext !== void 0 ? _props$fieldProps$ext : [];
|
|
34
43
|
}
|
|
35
44
|
setFileList(extraRenderValue.map(function (item) {
|
|
36
45
|
return {
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
.qs-form-container {
|
|
2
|
-
.qs-form-list-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
.qs-form-list-item{
|
|
3
|
+
display: flex;
|
|
4
|
+
border: 1px dashed #cccccc;
|
|
5
|
+
margin-top: 10px;
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
padding: 10px;
|
|
8
|
+
align-items: flex-end;
|
|
9
|
+
.dom{
|
|
10
|
+
flex: 1;
|
|
9
11
|
.ant-pro-form-list-container {
|
|
10
12
|
display: flex;
|
|
11
13
|
flex-wrap: wrap;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
16
|
+
.action{
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
19
|
}
|
package/dist/components/Table.js
CHANGED
|
@@ -33,7 +33,7 @@ import { TabsContext } from "./TabsContext";
|
|
|
33
33
|
export default function (props) {
|
|
34
34
|
var request = /*#__PURE__*/function () {
|
|
35
35
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, sort, filter) {
|
|
36
|
-
var data, res;
|
|
36
|
+
var data, res, _props;
|
|
37
37
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38
38
|
while (1) switch (_context.prev = _context.next) {
|
|
39
39
|
case 0:
|
|
@@ -87,28 +87,26 @@ export default function (props) {
|
|
|
87
87
|
});
|
|
88
88
|
case 11:
|
|
89
89
|
res = _context.sent;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
if (res.data.extraRenderValues) {
|
|
96
|
-
setExtraRenderValues(res.data.extraRenderValues);
|
|
97
|
-
}
|
|
90
|
+
_props = res.data;
|
|
91
|
+
setToolActions(_props.actions);
|
|
92
|
+
setColumns(_props.columns);
|
|
98
93
|
setLastQuery(data);
|
|
94
|
+
setDataSource(postData(_props.dataSource));
|
|
95
|
+
setExtraRenderValues(_props.extraRenderValues);
|
|
96
|
+
setPagination(_props.pagination);
|
|
99
97
|
return _context.abrupt("return", {
|
|
100
98
|
data: res.data.dataSource || [],
|
|
101
99
|
success: true
|
|
102
100
|
});
|
|
103
|
-
case
|
|
104
|
-
_context.prev =
|
|
101
|
+
case 20:
|
|
102
|
+
_context.prev = 20;
|
|
105
103
|
setLoading(false);
|
|
106
|
-
return _context.finish(
|
|
107
|
-
case
|
|
104
|
+
return _context.finish(20);
|
|
105
|
+
case 23:
|
|
108
106
|
case "end":
|
|
109
107
|
return _context.stop();
|
|
110
108
|
}
|
|
111
|
-
}, _callee, null, [[8,,
|
|
109
|
+
}, _callee, null, [[8,, 20, 23]]);
|
|
112
110
|
}));
|
|
113
111
|
return function request(_x, _x2, _x3) {
|
|
114
112
|
return _ref.apply(this, arguments);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export var ItemContext = /*#__PURE__*/React.createContext({});
|
|
3
|
+
export function itemRender(doms, listMeta) {
|
|
4
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemContext.Provider, {
|
|
5
|
+
value: {
|
|
6
|
+
index: listMeta.index
|
|
7
|
+
}
|
|
8
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "qs-form-list-item"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "dom"
|
|
12
|
+
}, doms.listDom), /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "action"
|
|
14
|
+
}, doms.action))));
|
|
15
|
+
}
|
|
@@ -10,6 +10,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
10
10
|
import http from "./http";
|
|
11
11
|
import { deepSet, handleCondition } from "./helpers";
|
|
12
12
|
import container from "./container";
|
|
13
|
+
import { itemRender } from "./FormList";
|
|
13
14
|
var uploadValidator = function uploadValidator(_, value) {
|
|
14
15
|
return new Promise(function (resolve, reject) {
|
|
15
16
|
if (!value) {
|
|
@@ -29,17 +30,6 @@ var uploadValidator = function uploadValidator(_, value) {
|
|
|
29
30
|
resolve(true);
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
|
-
var uploadTransform = function uploadTransform(value, _name) {
|
|
33
|
-
if (value instanceof Array) {
|
|
34
|
-
return value.filter(function (file) {
|
|
35
|
-
return file.status === 'done';
|
|
36
|
-
}).map(function (file) {
|
|
37
|
-
var _file$response;
|
|
38
|
-
return (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.file_id;
|
|
39
|
-
}).join(',');
|
|
40
|
-
}
|
|
41
|
-
return value;
|
|
42
|
-
};
|
|
43
33
|
export var commonHandler = function commonHandler(schema) {
|
|
44
34
|
if (schema.valueEnum) {
|
|
45
35
|
var _schema$valueEnum;
|
|
@@ -94,17 +84,13 @@ export var schemaHandler = {
|
|
|
94
84
|
schema.formItemProps.rules.push({
|
|
95
85
|
validator: uploadValidator
|
|
96
86
|
});
|
|
97
|
-
return _objectSpread(
|
|
98
|
-
transform: uploadTransform
|
|
99
|
-
});
|
|
87
|
+
return _objectSpread({}, schema);
|
|
100
88
|
},
|
|
101
89
|
file: function file(schema) {
|
|
102
90
|
schema.formItemProps.rules.push({
|
|
103
91
|
validator: uploadValidator
|
|
104
92
|
});
|
|
105
|
-
return _objectSpread(
|
|
106
|
-
transform: uploadTransform
|
|
107
|
-
});
|
|
93
|
+
return _objectSpread({}, schema);
|
|
108
94
|
},
|
|
109
95
|
action: function action(schema) {
|
|
110
96
|
schema.fieldProps = {
|
|
@@ -221,12 +207,12 @@ export var schemaHandler = {
|
|
|
221
207
|
return c;
|
|
222
208
|
});
|
|
223
209
|
deepSet(schema, 'fieldProps.className', "qs-form-list-".concat(schema.mode));
|
|
210
|
+
deepSet(schema, 'fieldProps.itemRender', itemRender);
|
|
224
211
|
switch (schema.mode) {
|
|
225
212
|
case 'form_list':
|
|
226
213
|
deepSet(schema, 'fieldProps.alwaysShowItemLabel', true);
|
|
227
214
|
break;
|
|
228
215
|
}
|
|
229
|
-
console.log(schema);
|
|
230
216
|
return schema;
|
|
231
217
|
}
|
|
232
218
|
};
|