zy-react-library 1.0.152 → 1.0.155
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/components/FormBuilder/FormItemsRenderer.js +10 -8
- package/components/HiddenInfo/gwj/index.js +10 -11
- package/components/Map/MapSelector.js +15 -3
- package/components/PreviewImg/index.js +1 -1
- package/components/Select/Personnel/Gwj/index.d.ts +2 -0
- package/components/Select/Personnel/Gwj/index.js +3 -2
- package/components/SelectTree/Basic/index.js +14 -10
- package/enum/uploadFile/gwj/index.js +2 -0
- package/package.json +1 -1
- package/utils/index.d.ts +2 -2
- package/utils/index.js +4 -4
|
@@ -481,14 +481,16 @@ const FormItemsRenderer = ({
|
|
|
481
481
|
required={getRequired(listOption.required)}
|
|
482
482
|
{...getFormItemProps(listOption)}
|
|
483
483
|
>
|
|
484
|
-
<div style={{ display: "flex", gap: 10, alignItems: "center" }}>
|
|
485
|
-
<
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
484
|
+
<div style={{ display: "flex", gap: 10, alignItems: "center", justifyContent: "space-between" }}>
|
|
485
|
+
<div>
|
|
486
|
+
<Form.Item
|
|
487
|
+
noStyle
|
|
488
|
+
rules={getRules(listOption)}
|
|
489
|
+
name={listOption.name}
|
|
490
|
+
>
|
|
491
|
+
{renderFormControl(listOption)}
|
|
492
|
+
</Form.Item>
|
|
493
|
+
</div>
|
|
492
494
|
{
|
|
493
495
|
// 只有当不是第一行时才显示删除按钮
|
|
494
496
|
fieldIndex >= 1
|
|
@@ -63,19 +63,18 @@ function HiddenInfo(props) {
|
|
|
63
63
|
setHiddenVideoFiles(hiddenVideoFiles);
|
|
64
64
|
|
|
65
65
|
if (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) {
|
|
66
|
-
const afterRectificationImageFiles = await getFile({
|
|
67
|
-
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
|
|
68
|
-
eqForeignKey: hiddenId || query[hiddenIdKey],
|
|
69
|
-
});
|
|
70
|
-
setAfterRectificationImageFiles(afterRectificationImageFiles);
|
|
71
|
-
|
|
72
66
|
for (let i = 0; i < info.hiddenRectifyUserCO.length; i++) {
|
|
73
|
-
|
|
67
|
+
const afterRectificationImageFiles = await getFile({
|
|
68
|
+
eqType: UPLOAD_FILE_TYPE_ENUM["4"],
|
|
69
|
+
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenUserId,
|
|
70
|
+
});
|
|
71
|
+
setAfterRectificationImageFiles(prevState => [...prevState, afterRectificationImageFiles]);
|
|
72
|
+
if (info.hiddenRectifyUserCO[i].isRectificationScheme === 1 && info.hiddenRectifyUserCO[i].hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO[i].hiddenSchemeCO).length > 0) {
|
|
74
73
|
const rectificationPlanImageFiles = await getFile({
|
|
75
74
|
eqType: UPLOAD_FILE_TYPE_ENUM["8"],
|
|
76
|
-
eqForeignKey:
|
|
75
|
+
eqForeignKey: info.hiddenRectifyUserCO[i].hiddenSchemeId,
|
|
77
76
|
});
|
|
78
|
-
setRectificationPlanImageFiles(prevState => [...prevState,
|
|
77
|
+
setRectificationPlanImageFiles(prevState => [...prevState, rectificationPlanImageFiles]);
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
}
|
|
@@ -86,7 +85,7 @@ function HiddenInfo(props) {
|
|
|
86
85
|
eqType: UPLOAD_FILE_TYPE_ENUM["5"],
|
|
87
86
|
eqForeignKey: hiddenId || query[hiddenIdKey],
|
|
88
87
|
});
|
|
89
|
-
setAcceptImageFiles(prevState => [...prevState,
|
|
88
|
+
setAcceptImageFiles(prevState => [...prevState, acceptImageFiles]);
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
|
|
@@ -392,7 +391,7 @@ function HiddenInfo(props) {
|
|
|
392
391
|
{ label: "整改描述", children: item.descr },
|
|
393
392
|
{ label: "投入资金", children: item.investmentFunds },
|
|
394
393
|
{ label: "临时安全措施", children: info.tempSafeMeasure },
|
|
395
|
-
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles} /> },
|
|
394
|
+
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> },
|
|
396
395
|
{ label: "整改方案", children: item.isRectificationScheme === 0 ? "无" : "有" },
|
|
397
396
|
...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0)
|
|
398
397
|
? [
|
|
@@ -19,6 +19,7 @@ const MapSelector = (props) => {
|
|
|
19
19
|
|
|
20
20
|
const mapContainerRef = useRef(null);
|
|
21
21
|
const mapInstanceRef = useRef(null);
|
|
22
|
+
const local = useRef(null);
|
|
22
23
|
const [loading, setLoading] = useState(false);
|
|
23
24
|
const [currentLongitude, setCurrentLongitude] = useState(longitude || "");
|
|
24
25
|
const [currentLatitude, setCurrentLatitude] = useState(latitude || "");
|
|
@@ -86,10 +87,18 @@ const MapSelector = (props) => {
|
|
|
86
87
|
// 搜索功能
|
|
87
88
|
const handleLocalSearch = () => {
|
|
88
89
|
if (localSearch && mapInstanceRef.current) {
|
|
89
|
-
|
|
90
|
+
local.current = new window.BMapGL.LocalSearch(mapInstanceRef.current, {
|
|
90
91
|
renderOptions: { map: mapInstanceRef.current },
|
|
91
92
|
});
|
|
92
|
-
local.search(localSearch);
|
|
93
|
+
local.current.search(localSearch);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// 清空
|
|
98
|
+
const handleLocalClear = () => {
|
|
99
|
+
setLocalSearch("");
|
|
100
|
+
if (mapInstanceRef.current) {
|
|
101
|
+
local.current.search("");
|
|
93
102
|
}
|
|
94
103
|
};
|
|
95
104
|
|
|
@@ -191,10 +200,13 @@ const MapSelector = (props) => {
|
|
|
191
200
|
</Form.Item>
|
|
192
201
|
</Col>
|
|
193
202
|
<Col span={12}>
|
|
194
|
-
<Form.Item label=" " colon={false}>
|
|
203
|
+
<Form.Item label=" " colon={false} style={{ textAlign: "right" }}>
|
|
195
204
|
<Button type="primary" onClick={handleLocalSearch}>
|
|
196
205
|
搜索
|
|
197
206
|
</Button>
|
|
207
|
+
<Button onClick={handleLocalClear} style={{ marginLeft: 8 }}>
|
|
208
|
+
重置
|
|
209
|
+
</Button>
|
|
198
210
|
</Form.Item>
|
|
199
211
|
</Col>
|
|
200
212
|
</Row>
|
|
@@ -16,7 +16,7 @@ const PreviewImg = (props) => {
|
|
|
16
16
|
<Image
|
|
17
17
|
key={item[fileUrlKey] || item}
|
|
18
18
|
src={item[fileUrlKey] ? fileUrl + item[fileUrlKey] : fileUrl + item}
|
|
19
|
-
|
|
19
|
+
wrapperStyle={{ marginLeft: index > 0 ? 10 : 0 }}
|
|
20
20
|
width={100}
|
|
21
21
|
height={100}
|
|
22
22
|
alt=""
|
|
@@ -12,6 +12,7 @@ function PersonnelSelect(props) {
|
|
|
12
12
|
isNeedCorpInfoId = false,
|
|
13
13
|
isNeedDepartmentId = true,
|
|
14
14
|
isNeedPostId = false,
|
|
15
|
+
noMain = "",
|
|
15
16
|
...restProps
|
|
16
17
|
} = props;
|
|
17
18
|
|
|
@@ -27,13 +28,13 @@ function PersonnelSelect(props) {
|
|
|
27
28
|
if (isNeedPostId && !params.postId)
|
|
28
29
|
return;
|
|
29
30
|
|
|
30
|
-
const { data } = await request("/basicInfo/user/listAll", "get", params);
|
|
31
|
+
const { data } = await request("/basicInfo/user/listAll", "get", { ...params, noMain });
|
|
31
32
|
setData(data);
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
useEffect(() => {
|
|
35
36
|
getData();
|
|
36
|
-
}, [JSON.stringify(params), isNeedCorpInfoId, isNeedDepartmentId, isNeedPostId]);
|
|
37
|
+
}, [JSON.stringify(params), isNeedCorpInfoId, isNeedDepartmentId, isNeedPostId, noMain]);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
40
|
<BasicSelect data={data} placeholder={placeholder} {...restProps} />
|
|
@@ -25,11 +25,11 @@ function BasicSelectTree(props) {
|
|
|
25
25
|
// 根据 level 处理树数据
|
|
26
26
|
let processedTreeData = level
|
|
27
27
|
? processTreeDataByLevel({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
data: treeData,
|
|
29
|
+
level,
|
|
30
|
+
childrenKey,
|
|
31
|
+
currentLevel: 1,
|
|
32
|
+
})
|
|
33
33
|
: treeData;
|
|
34
34
|
|
|
35
35
|
// 根据 onlyLastLevel 处理树数据
|
|
@@ -40,22 +40,25 @@ function BasicSelectTree(props) {
|
|
|
40
40
|
if (getDataType(value) === "Array") {
|
|
41
41
|
const parentNodes = [];
|
|
42
42
|
for (let i = 0; i < value.length; i++) {
|
|
43
|
+
const targetId = (restProps.labelInValue || restProps.treeCheckStrictly) ? value[i].value : value[i];
|
|
43
44
|
const currentParentNodes = getTreeNodePaths({
|
|
44
45
|
data: treeData,
|
|
45
|
-
targetId
|
|
46
|
+
targetId,
|
|
46
47
|
idKey,
|
|
47
48
|
childrenKey,
|
|
48
49
|
isIncludeOneself: onGetNodePathsIsIncludeOneself,
|
|
49
50
|
});
|
|
50
51
|
parentNodes.push(...currentParentNodes);
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
const deduplicationParentNodes = arrayObjectDeduplication(parentNodes, idKey);
|
|
54
|
+
onGetNodePaths?.(deduplicationParentNodes);
|
|
55
|
+
onGetLabel?.((restProps.labelInValue || restProps.treeCheckStrictly) ? value.map(item => item.label) : label);
|
|
54
56
|
}
|
|
55
57
|
else {
|
|
58
|
+
const targetId = (restProps.labelInValue || restProps.treeCheckStrictly) ? value.value : value;
|
|
56
59
|
const parentNodes = getTreeNodePaths({
|
|
57
60
|
data: treeData,
|
|
58
|
-
targetId
|
|
61
|
+
targetId,
|
|
59
62
|
idKey,
|
|
60
63
|
childrenKey,
|
|
61
64
|
isIncludeOneself: onGetNodePathsIsIncludeOneself,
|
|
@@ -68,7 +71,7 @@ function BasicSelectTree(props) {
|
|
|
68
71
|
onGetNodePaths?.([]);
|
|
69
72
|
onGetLabel?.("");
|
|
70
73
|
}
|
|
71
|
-
onChange?.(value, label, extra);
|
|
74
|
+
onChange?.((restProps.labelInValue || restProps.treeCheckStrictly) ? value.map(item => item.value) : value, label, extra);
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
useEffect(() => {
|
|
@@ -88,6 +91,7 @@ function BasicSelectTree(props) {
|
|
|
88
91
|
treeData={processedTreeData}
|
|
89
92
|
fieldNames={{ label: nameKey, value: idKey, children: childrenKey }}
|
|
90
93
|
treeNodeFilterProp={nameKey}
|
|
94
|
+
showCheckedStrategy={TreeSelect.SHOW_ALL}
|
|
91
95
|
{...restProps}
|
|
92
96
|
/>
|
|
93
97
|
);
|
|
@@ -85,6 +85,7 @@ export const UPLOAD_FILE_TYPE_ENUM = {
|
|
|
85
85
|
153: 153, // regulations_resource_library - 安全生产操作规程资源库
|
|
86
86
|
154: 154, // responsibility_based_resource_library - 安全生产责任制资源库
|
|
87
87
|
155: 155, // institutional_resource_library - 安全生产管理制度资源库
|
|
88
|
+
156: 156, // security_management_agreement - 相关方-安全管理协议
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
/**
|
|
@@ -171,4 +172,5 @@ export const UPLOAD_FILE_PATH_ENUM = {
|
|
|
171
172
|
153: "regulations_resource_library",
|
|
172
173
|
154: "responsibility_based_resource_library",
|
|
173
174
|
155: "institutional_resource_library",
|
|
175
|
+
156: "security_management_agreement",
|
|
174
176
|
};
|
package/package.json
CHANGED
package/utils/index.d.ts
CHANGED
|
@@ -329,14 +329,14 @@ export function processTreeDataForOnlyLastLevel(
|
|
|
329
329
|
/**
|
|
330
330
|
* 验证结束时间是否大于开始时间
|
|
331
331
|
*/
|
|
332
|
-
export function validatorEndTime(timeStart: string): {
|
|
332
|
+
export function validatorEndTime(timeStart: string, message: string): {
|
|
333
333
|
validator: (_: any, value: any) => Promise<void | string>;
|
|
334
334
|
};
|
|
335
335
|
|
|
336
336
|
/**
|
|
337
337
|
* 验证时间是否大于等于当前时间
|
|
338
338
|
*/
|
|
339
|
-
export function validatorTimeGTCurrentDay(): {
|
|
339
|
+
export function validatorTimeGTCurrentDay(message: string): {
|
|
340
340
|
validator: (_: any, value: any) => Promise<void | string>;
|
|
341
341
|
};
|
|
342
342
|
|
package/utils/index.js
CHANGED
|
@@ -511,11 +511,11 @@ export const processTreeDataForOnlyLastLevel = (options) => {
|
|
|
511
511
|
/**
|
|
512
512
|
* 验证结束时间是否大于开始时间
|
|
513
513
|
*/
|
|
514
|
-
export const validatorEndTime = (timeStart) => {
|
|
514
|
+
export const validatorEndTime = (timeStart, message = "结束时间不能早于开始时间") => {
|
|
515
515
|
return {
|
|
516
516
|
validator: (_, value) => {
|
|
517
517
|
if (value && timeStart && value < timeStart) {
|
|
518
|
-
return Promise.reject(
|
|
518
|
+
return Promise.reject(message);
|
|
519
519
|
}
|
|
520
520
|
else {
|
|
521
521
|
return Promise.resolve();
|
|
@@ -527,11 +527,11 @@ export const validatorEndTime = (timeStart) => {
|
|
|
527
527
|
/**
|
|
528
528
|
* 验证时间是否大于等于当前时间
|
|
529
529
|
*/
|
|
530
|
-
export const validatorTimeGTCurrentDay = () => {
|
|
530
|
+
export const validatorTimeGTCurrentDay = (message = "需要大于当前时间") => {
|
|
531
531
|
return {
|
|
532
532
|
validator: (_, value) => {
|
|
533
533
|
if (value && value <= dayjs().format("YYYY-MM-DD hh:mm:ss")) {
|
|
534
|
-
return Promise.reject(
|
|
534
|
+
return Promise.reject(message);
|
|
535
535
|
}
|
|
536
536
|
else {
|
|
537
537
|
return Promise.resolve();
|