@cqsjjb/jjb-react-admin-component 3.0.18 → 3.0.20
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 +16 -14
- package/FormilyDescriptions/index.mjs +16 -14
- package/package.json +1 -1
|
@@ -132,21 +132,23 @@ 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
|
+
}, [props.value]);
|
|
150
152
|
return Array.isArray(text) ? /*#__PURE__*/React.createElement(Spin, {
|
|
151
153
|
spinning: loading
|
|
152
154
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -189,21 +189,23 @@ 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
|
+
}, [ props.value ]);
|
|
207
209
|
|
|
208
210
|
return Array.isArray(text)
|
|
209
211
|
? (
|