@cqsjjb/jjb-react-admin-component 3.0.18 → 3.0.19
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/FormilyDescriptions/index.js +15 -13
- package/FormilyDescriptions/index.mjs +15 -13
- package/package.json +1 -1
|
@@ -132,19 +132,21 @@ function RenderText(props) {
|
|
|
132
132
|
const [text, setText] = React.useState();
|
|
133
133
|
const [loading, setLoading] = React.useState(false);
|
|
134
134
|
React.useEffect(() => {
|
|
135
|
-
if (value
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
if (value) {
|
|
136
|
+
if (value.load) {
|
|
137
|
+
setLoading(true);
|
|
138
|
+
value.load().then(res => res.json()).then(res => {
|
|
139
|
+
if (res.success) {
|
|
140
|
+
const data = generateValue(res.data);
|
|
141
|
+
setText(value.selected?.map(item => {
|
|
142
|
+
return data.find(i => i.key === item.key)?.name?.join('/');
|
|
143
|
+
})?.filter(i => i));
|
|
144
|
+
}
|
|
145
|
+
setLoading(false);
|
|
146
|
+
});
|
|
147
|
+
} else {
|
|
148
|
+
setText(value);
|
|
149
|
+
}
|
|
148
150
|
}
|
|
149
151
|
}, []);
|
|
150
152
|
return Array.isArray(text) ? /*#__PURE__*/React.createElement(Spin, {
|
|
@@ -189,19 +189,21 @@ function RenderText(props) {
|
|
|
189
189
|
const [ loading, setLoading ] = React.useState(false);
|
|
190
190
|
|
|
191
191
|
React.useEffect(() => {
|
|
192
|
-
if (value
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
192
|
+
if (value) {
|
|
193
|
+
if (value.load) {
|
|
194
|
+
setLoading(true);
|
|
195
|
+
value.load().then(res => res.json()).then(res => {
|
|
196
|
+
if (res.success) {
|
|
197
|
+
const data = generateValue(res.data);
|
|
198
|
+
setText(value.selected?.map(item => {
|
|
199
|
+
return data.find(i => i.key === item.key)?.name?.join('/');
|
|
200
|
+
})?.filter(i => i));
|
|
201
|
+
}
|
|
202
|
+
setLoading(false);
|
|
203
|
+
});
|
|
204
|
+
} else {
|
|
205
|
+
setText(value);
|
|
206
|
+
}
|
|
205
207
|
}
|
|
206
208
|
}, []);
|
|
207
209
|
|