@ecoding/components.antd 0.3.14 → 0.3.16
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.
|
@@ -11,12 +11,18 @@ interface IFace {
|
|
|
11
11
|
format?: {
|
|
12
12
|
[props: string]: any;
|
|
13
13
|
};
|
|
14
|
+
format2?: {
|
|
15
|
+
[props: string]: any;
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
interface IData {
|
|
16
19
|
datas: any;
|
|
17
20
|
format?: {
|
|
18
21
|
[props: string]: any;
|
|
19
22
|
};
|
|
23
|
+
format2?: {
|
|
24
|
+
[props: string]: any;
|
|
25
|
+
};
|
|
20
26
|
}
|
|
21
27
|
interface IProps extends SelectProps<any> {
|
|
22
28
|
iface?: IFace;
|
|
@@ -12,7 +12,7 @@ import { Select } from "antd";
|
|
|
12
12
|
import { LoadingOutlined } from "@ant-design/icons";
|
|
13
13
|
import http from "../../helpers/http";
|
|
14
14
|
import { isSomething } from "@ecoding/helper.is";
|
|
15
|
-
import { jsonFormatNewKey } from "@ecoding/helper.json";
|
|
15
|
+
import { jsonFormatNewKey, jsonFormatNewKey2 } from "@ecoding/helper.json";
|
|
16
16
|
const { Option } = Select;
|
|
17
17
|
let timeout;
|
|
18
18
|
const AsyncSlect = memo((props) => {
|
|
@@ -28,7 +28,7 @@ const AsyncSlect = memo((props) => {
|
|
|
28
28
|
var _a;
|
|
29
29
|
// 获得第一个接口信息
|
|
30
30
|
if (data) {
|
|
31
|
-
const res = data.format ? jsonFormatNewKey(data.datas, data.format) : data.datas;
|
|
31
|
+
const res = data.format2 ? jsonFormatNewKey(data.datas, data.format2) : data.format ? jsonFormatNewKey(data.datas, data.format) : data.datas;
|
|
32
32
|
return Promise.resolve(res);
|
|
33
33
|
}
|
|
34
34
|
let params = {};
|
|
@@ -60,7 +60,7 @@ const AsyncSlect = memo((props) => {
|
|
|
60
60
|
resOrigin = resOrigin[iface.fromKey];
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const res = jsonFormatNewKey(resOrigin, iface.format);
|
|
63
|
+
const res = iface.format2 ? jsonFormatNewKey2(resOrigin, iface.format2) : iface.format ? jsonFormatNewKey(resOrigin, iface.format) : resOrigin;
|
|
64
64
|
return Promise.resolve(res);
|
|
65
65
|
}
|
|
66
66
|
return Promise.reject("没有iface或data");
|
|
@@ -110,10 +110,9 @@ const AsyncSlect = memo((props) => {
|
|
|
110
110
|
resOrigin = resOrigin[searchIface.fromKey];
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
const res = jsonFormatNewKey(resOrigin, searchIface.format);
|
|
113
|
+
const res = searchIface.format2 ? jsonFormatNewKey2(resOrigin, searchIface.format2) : searchIface.format ? jsonFormatNewKey(resOrigin, searchIface.format) : resOrigin;
|
|
114
114
|
setOptions(res);
|
|
115
115
|
}
|
|
116
|
-
return Promise.reject("没有searchIface");
|
|
117
116
|
});
|
|
118
117
|
timeout = setTimeout(innerEx, 300);
|
|
119
118
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"antd": "^5.8.4",
|
|
44
44
|
"axios": "^1.1.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "238b4ca0487a9c8f52c4499b2aabd442fb2c63dc"
|
|
47
47
|
}
|