@ecoding/components.antd 0.2.37 → 0.2.38
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.
|
@@ -13,7 +13,6 @@ import { UploadOutlined, LinkOutlined, DeleteOutlined, EllipsisOutlined } from '
|
|
|
13
13
|
import { buildURL } from '@ecoding/helper.url';
|
|
14
14
|
import Toast from "../../core/toast";
|
|
15
15
|
import Loading from "../../core/loading";
|
|
16
|
-
import http from "../../helpers/http";
|
|
17
16
|
const InfosRender = ({ infos, setInfos }) => {
|
|
18
17
|
const remove = (i) => {
|
|
19
18
|
const temp = infos.concat([]);
|
|
@@ -41,15 +40,12 @@ const SingleFileUpload = (props) => {
|
|
|
41
40
|
const [infos, setInfos] = useState([]);
|
|
42
41
|
const [open, setOpen] = useState(undefined);
|
|
43
42
|
const timeout = useRef();
|
|
44
|
-
const r = http.getRequest();
|
|
45
43
|
const action = useMemo(() => {
|
|
46
44
|
if (typeof props.action === "string") {
|
|
47
|
-
return
|
|
48
|
-
? buildURL(props.action, props.actionParams)
|
|
49
|
-
: buildURL(`${r.domain}${props.action}`, props.actionParams);
|
|
45
|
+
return buildURL(props.action, props.actionParams);
|
|
50
46
|
}
|
|
51
|
-
return props.action();
|
|
52
|
-
}, [props.actionParams]);
|
|
47
|
+
return buildURL(props.action(), props.actionParams);
|
|
48
|
+
}, [props.actionParams, props.action]);
|
|
53
49
|
const handleChange = (info, type) => {
|
|
54
50
|
var _a, _b;
|
|
55
51
|
switch (info.file.status) {
|
|
@@ -12,18 +12,14 @@ import { Upload, message, Button, Input, Space } from "antd";
|
|
|
12
12
|
import { UploadOutlined } from "@ant-design/icons";
|
|
13
13
|
import { buildURL } from "@ecoding/helper.url";
|
|
14
14
|
import Toast from "../../core/toast";
|
|
15
|
-
import http from "../../helpers/http";
|
|
16
15
|
const SingleFileUpload = (props) => {
|
|
17
|
-
const r = http.getRequest();
|
|
18
16
|
const [fileUrl, setFileUrl] = useState('');
|
|
19
17
|
const action = useMemo(() => {
|
|
20
18
|
if (typeof props.action === "string") {
|
|
21
|
-
return
|
|
22
|
-
? buildURL(props.action, props.actionParams)
|
|
23
|
-
: buildURL(`${r.domain}${props.action}`, props.actionParams);
|
|
19
|
+
return buildURL(props.action, props.actionParams);
|
|
24
20
|
}
|
|
25
|
-
return props.action();
|
|
26
|
-
}, [props.actionParams]);
|
|
21
|
+
return buildURL(props.action(), props.actionParams);
|
|
22
|
+
}, [props.actionParams, props.action]);
|
|
27
23
|
const handleChange = (info) => {
|
|
28
24
|
// props.onChange && props.onChange(info.file);
|
|
29
25
|
switch (info.file.status) {
|
|
@@ -12,19 +12,15 @@ import { Upload, message, Space } from "antd";
|
|
|
12
12
|
import { LoadingOutlined, PlusOutlined, DeleteOutlined } from "@ant-design/icons";
|
|
13
13
|
import { buildURL } from "@ecoding/helper.url";
|
|
14
14
|
import Toast from "../../core/toast";
|
|
15
|
-
import http from "../../helpers/http";
|
|
16
15
|
const ImgUpload = (props) => {
|
|
17
|
-
const r = http.getRequest();
|
|
18
16
|
const [loading, setLoading] = useState(false);
|
|
19
17
|
const [imageUrl, setImageUrl] = useState(props.value || "");
|
|
20
18
|
const action = useMemo(() => {
|
|
21
19
|
if (typeof props.action === "string") {
|
|
22
|
-
return
|
|
23
|
-
? buildURL(props.action, props.actionParams)
|
|
24
|
-
: buildURL(`${r.domain}${props.action}`, props.actionParams);
|
|
20
|
+
return buildURL(props.action, props.actionParams);
|
|
25
21
|
}
|
|
26
|
-
return props.action();
|
|
27
|
-
}, [props.actionParams]);
|
|
22
|
+
return buildURL(props.action(), props.actionParams);
|
|
23
|
+
}, [props.actionParams, props.action]);
|
|
28
24
|
const getBase64 = useCallback((imgFile) => {
|
|
29
25
|
return new Promise((resolve) => {
|
|
30
26
|
const reader = new FileReader();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.38",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"react-quill": "^2.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "9b5a9f3404ebd8d8cf7d355c8dab89c77bd388f1"
|
|
48
48
|
}
|