@ecoding/components.antd 0.2.16 → 0.2.18
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.
|
@@ -117,6 +117,10 @@ const AsyncSlect = memo((props) => {
|
|
|
117
117
|
});
|
|
118
118
|
timeout = setTimeout(innerEx, 300);
|
|
119
119
|
});
|
|
120
|
+
const changeHandler = (v, ary) => {
|
|
121
|
+
props.onChange(v);
|
|
122
|
+
props.onChangeAry && props.onChangeAry(ary);
|
|
123
|
+
};
|
|
120
124
|
const children = useMemo(() => {
|
|
121
125
|
return (options &&
|
|
122
126
|
options.map((item) => {
|
|
@@ -131,6 +135,6 @@ const AsyncSlect = memo((props) => {
|
|
|
131
135
|
return option.children.join("").toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
132
136
|
}
|
|
133
137
|
return option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
134
|
-
}, allowClear: true, showSearch: true, onSearch: handleSearch, optionFilterProp: "children" }, props), children));
|
|
138
|
+
}, allowClear: true, showSearch: true, onSearch: handleSearch, optionFilterProp: "children" }, props, { onChange: changeHandler }), children));
|
|
135
139
|
});
|
|
136
140
|
export default AsyncSlect;
|
|
@@ -52,12 +52,12 @@ const SingleFileUpload = (props) => {
|
|
|
52
52
|
};
|
|
53
53
|
const beforeUpload = useCallback((file) => {
|
|
54
54
|
return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
-
const ary = ["jpg", "jpeg", "png", "gif"];
|
|
56
|
-
if (ary.indexOf(file.type.toLowerCase().replace(/image\//g, "")) !== -1) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
55
|
+
// const ary = ["jpg", "jpeg", "png", "gif"];
|
|
56
|
+
// if (ary.indexOf(file.type.toLowerCase().replace(/image\//g, "")) !== -1) {
|
|
57
|
+
// message.error("上传图片请使用 SingleImgUpload 组件");
|
|
58
|
+
// reject(new Error("上传图片请使用 SingleImgUpload 组件"));
|
|
59
|
+
// return;
|
|
60
|
+
// }
|
|
61
61
|
const fileExtension = file.name && file.name.split(".").pop().toLowerCase();
|
|
62
62
|
if (fileExtension && props.type.indexOf(fileExtension) === -1) {
|
|
63
63
|
message.error(`请上传 ${props.type} 格式的文件!`);
|
|
@@ -73,7 +73,7 @@ const SingleFileUpload = (props) => {
|
|
|
73
73
|
}
|
|
74
74
|
}, [props.value]);
|
|
75
75
|
return (React.createElement(Space.Compact, { block: true },
|
|
76
|
-
React.createElement(Input, { value: fileUrl }),
|
|
76
|
+
React.createElement(Input, { value: fileUrl, onChange: (e) => setFileUrl(e.target.value.trim()) }),
|
|
77
77
|
React.createElement(Upload, { ref: props.uploadRef, withCredentials: true, openFileDialogOnClick: props.openFileDialogOnClick, beforeUpload: beforeUpload, name: props.name, disabled: props.disabled, action: action, onChange: handleChange, showUploadList: false, onRemove: (e) => {
|
|
78
78
|
console.log(e);
|
|
79
79
|
props.onRemove && props.onRemove(e);
|
|
@@ -24,7 +24,10 @@ const TablePro = memo(({ className, header, buttonArea, filterArea, loading, row
|
|
|
24
24
|
setOpenFilter(false);
|
|
25
25
|
};
|
|
26
26
|
const showColumns = useMemo(() => {
|
|
27
|
-
|
|
27
|
+
if (dataSource && dataSource.length > 0) {
|
|
28
|
+
return innerColumns.filter((c) => c.checked !== false).concat(operationColumn || []);
|
|
29
|
+
}
|
|
30
|
+
return operationColumn;
|
|
28
31
|
}, [innerColumns, dataSource]);
|
|
29
32
|
useEffect(() => {
|
|
30
33
|
if (disColumnRef.current && disColumnRef.current.length > 0 && columns.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
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": "65c39fd48fe8394b7a8f294e9d2f5108590806ee"
|
|
48
48
|
}
|