@hzab/form-render-mobile 1.2.1 → 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/README.md
CHANGED
|
@@ -73,29 +73,33 @@ export default () => {
|
|
|
73
73
|
|
|
74
74
|
- example 本地开发测试代码
|
|
75
75
|
- src 组件源码
|
|
76
|
-
- lib 组件打包编译后的代码
|
|
77
76
|
|
|
78
77
|
## 命令
|
|
79
78
|
|
|
80
|
-
- Mac 执行该命令,设置 pre-commit 为可执行文件
|
|
81
|
-
|
|
82
|
-
- npm run mac-chmod
|
|
83
|
-
- chmod +x .husky && chmod +x .husky/pre-commit
|
|
84
|
-
|
|
85
79
|
- 生成文档:npm run docs
|
|
86
80
|
- 本地运行:npm run dev
|
|
87
81
|
- 打包编译:npm run build
|
|
88
82
|
|
|
89
83
|
## 发布
|
|
90
84
|
|
|
91
|
-
-
|
|
85
|
+
- npm 源和云效源都需要发布
|
|
92
86
|
|
|
93
|
-
- 编译组件:npm run build
|
|
94
87
|
- 命令:npm publish --access public
|
|
95
88
|
- 发布目录:
|
|
96
|
-
- lib
|
|
97
89
|
- src
|
|
98
90
|
|
|
91
|
+
### nrm
|
|
92
|
+
|
|
93
|
+
- 安装
|
|
94
|
+
npm install -g nrm
|
|
95
|
+
- 增加源
|
|
96
|
+
nrm add aliyun https://packages.aliyun.com/62046985b3ead41b374a17f7/npm/npm-registry/
|
|
97
|
+
- 切换源
|
|
98
|
+
nrm use aliyun
|
|
99
|
+
nrm use npm
|
|
100
|
+
- 登录(账号密码在 https://packages.aliyun.com/npm/npm-registry/guide 查看)
|
|
101
|
+
npm login --registry=https://packages.aliyun.com/62046985b3ead41b374a17f7/npm/npm-registry/
|
|
102
|
+
|
|
99
103
|
## 配置
|
|
100
104
|
|
|
101
105
|
### 配置文件
|
package/package.json
CHANGED
|
@@ -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, {
|