@quansitech/antd-admin 1.1.5 → 1.1.6
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.
|
@@ -74,6 +74,19 @@ export default function (props) {
|
|
|
74
74
|
return _ref2.apply(this, arguments);
|
|
75
75
|
};
|
|
76
76
|
}();
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
var _props$fieldProps;
|
|
79
|
+
if (loading) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
var values = fileList.map(function (file) {
|
|
83
|
+
if (file.status === 'done') {
|
|
84
|
+
file.url = file.response.url || file.response.file_url;
|
|
85
|
+
}
|
|
86
|
+
return file;
|
|
87
|
+
});
|
|
88
|
+
(_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 || _props$fieldProps.onChange(values);
|
|
89
|
+
}, [fileList]);
|
|
77
90
|
useEffect(function () {
|
|
78
91
|
var extraRenderValue = [];
|
|
79
92
|
if (formContext && formContext.extraRenderValues) {
|
|
@@ -87,6 +100,10 @@ export default function (props) {
|
|
|
87
100
|
});
|
|
88
101
|
extraRenderValue = (_tableContext$extraRe = (_tableContext$extraRe2 = tableContext.extraRenderValues[index]) === null || _tableContext$extraRe2 === void 0 ? void 0 : _tableContext$extraRe2[props.fieldProps.dataIndex]) !== null && _tableContext$extraRe !== void 0 ? _tableContext$extraRe : [];
|
|
89
102
|
}
|
|
103
|
+
if (!extraRenderValue.length) {
|
|
104
|
+
setLoading(false);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
90
107
|
setFileList(extraRenderValue.map(function (item) {
|
|
91
108
|
return {
|
|
92
109
|
uid: item.id,
|
|
@@ -102,16 +119,6 @@ export default function (props) {
|
|
|
102
119
|
}));
|
|
103
120
|
setLoading(false);
|
|
104
121
|
}, []);
|
|
105
|
-
useEffect(function () {
|
|
106
|
-
var _props$fieldProps;
|
|
107
|
-
var values = fileList.map(function (file) {
|
|
108
|
-
if (file.status === 'done') {
|
|
109
|
-
file.url = file.response.url || file.response.file_url;
|
|
110
|
-
}
|
|
111
|
-
return file;
|
|
112
|
-
});
|
|
113
|
-
(_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 || _props$fieldProps.onChange(values);
|
|
114
|
-
}, [fileList]);
|
|
115
122
|
var uploadButton = /*#__PURE__*/React.createElement(Tooltip, {
|
|
116
123
|
title: fileList.length >= (((_props$fieldProps2 = props.fieldProps) === null || _props$fieldProps2 === void 0 ? void 0 : _props$fieldProps2.maxCount) || 1) ? '最多只能上传' + (((_props$fieldProps3 = props.fieldProps) === null || _props$fieldProps3 === void 0 ? void 0 : _props$fieldProps3.maxCount) || 1) + '个文件' : ''
|
|
117
124
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -46,7 +46,7 @@ export default function (props) {
|
|
|
46
46
|
};
|
|
47
47
|
}));
|
|
48
48
|
setLoading(false);
|
|
49
|
-
}, []);
|
|
49
|
+
}, [props.record]);
|
|
50
50
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spin, {
|
|
51
51
|
spinning: loading
|
|
52
52
|
}, /*#__PURE__*/React.createElement(Upload, {
|