zy-react-library 1.0.105 → 1.0.107
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.
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { request } from "@cqsjjb/jjb-common-lib/http";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import BasicSelect from "../../Basic";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 人员下拉组件(港务局版本)
|
|
7
|
-
*/
|
|
8
|
-
function PersonnelSelect(props) {
|
|
9
|
-
const {
|
|
10
|
-
params = {},
|
|
11
|
-
placeholder = "人员",
|
|
12
|
-
isNeedCorpInfoId = false,
|
|
13
|
-
isNeedDepartmentId = true,
|
|
14
|
-
isNeedPostId = false,
|
|
15
|
-
...restProps
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
18
|
-
const [data, setData] = useState([]);
|
|
19
|
-
|
|
20
|
-
const getData = async () => {
|
|
21
|
-
setData([]);
|
|
22
|
-
// 根据参数决定是否发送请求
|
|
23
|
-
if (isNeedCorpInfoId && !params.corpinfoId)
|
|
24
|
-
return;
|
|
25
|
-
if (isNeedDepartmentId && !params.departmentId)
|
|
26
|
-
return;
|
|
27
|
-
if (isNeedPostId && !params.postId)
|
|
28
|
-
return;
|
|
29
|
-
|
|
30
|
-
const { data } = await request("/basic-info/user/listAll", "get", params);
|
|
31
|
-
setData(data);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
getData();
|
|
36
|
-
}, [JSON.stringify(params), isNeedCorpInfoId, isNeedDepartmentId, isNeedPostId]);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<BasicSelect data={data} placeholder={placeholder} {...restProps} />
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
PersonnelSelect.displayName = "PersonnelSelect";
|
|
44
|
-
|
|
45
|
-
export default PersonnelSelect;
|
|
1
|
+
import { request } from "@cqsjjb/jjb-common-lib/http";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import BasicSelect from "../../Basic";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 人员下拉组件(港务局版本)
|
|
7
|
+
*/
|
|
8
|
+
function PersonnelSelect(props) {
|
|
9
|
+
const {
|
|
10
|
+
params = {},
|
|
11
|
+
placeholder = "人员",
|
|
12
|
+
isNeedCorpInfoId = false,
|
|
13
|
+
isNeedDepartmentId = true,
|
|
14
|
+
isNeedPostId = false,
|
|
15
|
+
...restProps
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
const [data, setData] = useState([]);
|
|
19
|
+
|
|
20
|
+
const getData = async () => {
|
|
21
|
+
setData([]);
|
|
22
|
+
// 根据参数决定是否发送请求
|
|
23
|
+
if (isNeedCorpInfoId && !params.corpinfoId)
|
|
24
|
+
return;
|
|
25
|
+
if (isNeedDepartmentId && !params.departmentId)
|
|
26
|
+
return;
|
|
27
|
+
if (isNeedPostId && !params.postId)
|
|
28
|
+
return;
|
|
29
|
+
|
|
30
|
+
const { data } = await request("/basic-info/user/listAll", "get", params);
|
|
31
|
+
setData(data);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
getData();
|
|
36
|
+
}, [JSON.stringify(params), isNeedCorpInfoId, isNeedDepartmentId, isNeedPostId]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<BasicSelect data={data} placeholder={placeholder} {...restProps} />
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
PersonnelSelect.displayName = "PersonnelSelect";
|
|
44
|
+
|
|
45
|
+
export default PersonnelSelect;
|
package/enum/hidden/gwj/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export const HIDDEN_SOURCE_ENUM = [
|
|
3
3
|
{ bianma: "1", name: "隐患快报" },
|
|
4
4
|
{ bianma: "2", name: "清单排查" },
|
|
5
|
-
{ bianma: "3", name: "清单排查" },
|
|
6
5
|
{ bianma: "4", name: "安全环保检查(监管端)" },
|
|
7
6
|
{ bianma: "5", name: "安全环保检查(企业端)" },
|
|
8
7
|
{ bianma: "6", name: "消防检查" },
|
|
@@ -20,6 +19,7 @@ export const HIDDEN_STATE_ENUM = [
|
|
|
20
19
|
{ bianma: "400", name: "归档" },
|
|
21
20
|
{ bianma: "99", name: "用户暂存" },
|
|
22
21
|
{ bianma: "98", name: "安全环保检查/清单排查暂存" },
|
|
22
|
+
{ bianma: "102", name: "安全环保检查,隐患带指派" },
|
|
23
23
|
{ bianma: "97", name: "已过期" },
|
|
24
24
|
{ bianma: "101", name: "忽略隐患" },
|
|
25
25
|
];
|
package/package.json
CHANGED
package/utils/index.js
CHANGED
|
@@ -64,9 +64,10 @@ export function image2Base642(file) {
|
|
|
64
64
|
/**
|
|
65
65
|
base64转File对象
|
|
66
66
|
*/
|
|
67
|
-
export function base642File(base64, filename =
|
|
67
|
+
export function base642File(base64, filename = 'file') {
|
|
68
68
|
const arr = base64.split(",");
|
|
69
69
|
const mime = arr[0].match(/:(.*?);/)[1];
|
|
70
|
+
const ext = mime.split('/')[1];
|
|
70
71
|
const bstr = atob(arr[1]);
|
|
71
72
|
let n = bstr.length;
|
|
72
73
|
const u8arr = new Uint8Array(n);
|
|
@@ -75,7 +76,7 @@ export function base642File(base64, filename = "file") {
|
|
|
75
76
|
u8arr[n] = bstr.charCodeAt(n);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
return new File([u8arr], filename
|
|
79
|
+
return new File([u8arr], `${filename}.${ext}`, { type: mime });
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
/**
|