@hzab/form-render-mobile 1.2.2-beta → 1.2.2-beta1
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hzab/form-render-mobile",
|
|
3
|
-
"version": "1.2.2-
|
|
3
|
+
"version": "1.2.2-beta1",
|
|
4
4
|
"description": "formily-form-render-mobile",
|
|
5
5
|
"main": "src",
|
|
6
6
|
"scripts": {
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"@formily/antd-mobile": "1.0.0-beta.3",
|
|
45
45
|
"@formily/core": "2.2.29",
|
|
46
46
|
"@formily/react": "2.2.29",
|
|
47
|
-
"@hzab/data-model": "^
|
|
48
|
-
"@hzab/utils": "^1.0.4",
|
|
47
|
+
"@hzab/data-model": "^0.0.3",
|
|
49
48
|
"antd-mobile": "^5.32.0",
|
|
50
49
|
"antd-mobile-icons": "^0.2.2",
|
|
51
50
|
"nanoid": "^3.3.7",
|
|
@@ -13,7 +13,7 @@ export async function handleOssUpload(files, opt) {
|
|
|
13
13
|
const ossUpload = new OssUpload({
|
|
14
14
|
axios: opt.axios,
|
|
15
15
|
axiosConf: axiosConf,
|
|
16
|
-
serverUrl: ossUrl || "/api/v1/
|
|
16
|
+
serverUrl: ossUrl || "/api/v1/common/oss/getWebOssConfig",
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const promise = [];
|
|
@@ -105,10 +105,10 @@ export function handleMaxCount(fileList, maxCount) {
|
|
|
105
105
|
}
|
|
106
106
|
/**判断是否私有 */
|
|
107
107
|
const isSelf = (selfUrlList, fileUrl) => {
|
|
108
|
-
let flag =
|
|
108
|
+
let flag = "?";
|
|
109
109
|
selfUrlList?.forEach((el) => {
|
|
110
110
|
if (fileUrl?.startsWith(el)) {
|
|
111
|
-
flag =
|
|
111
|
+
flag = "&";
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
return flag;
|
|
@@ -132,9 +132,7 @@ export function handleInputFileList(_fileList, maxCount = 1, opt) {
|
|
|
132
132
|
if (typeof file === "string") {
|
|
133
133
|
const uid = nanoid();
|
|
134
134
|
let thumbnailUrl = "";
|
|
135
|
-
|
|
136
|
-
thumbnailUrl = `${file}${opt?.thumbnailParams ? "?" + opt?.thumbnailParams : ""}`;
|
|
137
|
-
}
|
|
135
|
+
thumbnailUrl = `${file}${opt?.thumbnailParams ? isSelf(opt?.selfUrlList, file) + opt?.thumbnailParams : ""}`;
|
|
138
136
|
return {
|
|
139
137
|
name: uid,
|
|
140
138
|
uid: uid,
|
|
@@ -42,8 +42,8 @@ function Uploader(props, ref) {
|
|
|
42
42
|
// cordova插件上传类型 cordova-plugin-chooser | cordova-plugin-camera
|
|
43
43
|
cordovaPlugin = "cordova-plugin-camera",
|
|
44
44
|
uploaderProps,
|
|
45
|
-
thumbnailParams = "
|
|
46
|
-
selfUrlList = ["https://
|
|
45
|
+
thumbnailParams = "image_process=resize,p_30",
|
|
46
|
+
selfUrlList = ["https://self-oss.abt.hzabjt.com"]
|
|
47
47
|
} = props;
|
|
48
48
|
const [loading, setLoading] = useState(false);
|
|
49
49
|
const [fileList, setFileList] = useState(handleInputFileList(value, maxCount, {
|
|
@@ -134,7 +134,6 @@ function Uploader(props, ref) {
|
|
|
134
134
|
const actions = useMemo(() => {
|
|
135
135
|
const allEnum = {
|
|
136
136
|
select: { text: "选择文件", key: "select" },
|
|
137
|
-
input: { text: "选择文件(H5)", key: "input" },
|
|
138
137
|
image: { text: "拍照", key: "captureImage" },
|
|
139
138
|
video: { text: "录像", key: "captureVideo" },
|
|
140
139
|
audio: { text: "录音", key: "captureAudio" },
|
|
@@ -192,10 +191,6 @@ function Uploader(props, ref) {
|
|
|
192
191
|
}
|
|
193
192
|
break;
|
|
194
193
|
|
|
195
|
-
case "input":
|
|
196
|
-
uploaderRef.current.click();
|
|
197
|
-
console.log("使用h5上传", uploaderRef)
|
|
198
|
-
break;
|
|
199
194
|
case "captureImage":
|
|
200
195
|
getImage(props.imgPluginOpt, props.getImgOpt).then((res) => {
|
|
201
196
|
onFileChange({
|