zy-react-library 1.0.82 → 1.0.84
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.
|
@@ -63,7 +63,7 @@ function HiddenLevelSelectTree(props) {
|
|
|
63
63
|
}, []);
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
|
-
<BasicSelectTree treeData={treeData} nameKey="dictLabel" idKey="dictValue" {...restProps} />
|
|
66
|
+
<BasicSelectTree treeData={treeData} placeholder="隐患级别" nameKey="dictLabel" idKey="dictValue" {...restProps} />
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { FC } from "react";
|
|
2
2
|
import type { BasicSelectTreeProps } from "../../Basic";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* 请求参数
|
|
6
|
+
*/
|
|
7
|
+
export interface Params {
|
|
8
|
+
/** 企业id */
|
|
9
|
+
eqCorpinfoId?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
/**
|
|
5
13
|
* 组件属性
|
|
6
14
|
*/
|
|
7
15
|
export interface HiddenPartSelectTreeProps extends Omit<BasicSelectTreeProps, "treeData" | "nameKey" | "idKey" | "childrenKey"> {
|
|
16
|
+
/** 请求参数 */
|
|
17
|
+
params?: Params;
|
|
18
|
+
/** 是否需要企业id,默认 false */
|
|
19
|
+
isNeedCorpInfoId?: boolean;
|
|
8
20
|
}
|
|
9
21
|
|
|
10
22
|
/**
|
|
@@ -6,20 +6,31 @@ import BasicSelectTree from "../../Basic";
|
|
|
6
6
|
* 隐患部位下拉树组件(港务局版本)
|
|
7
7
|
*/
|
|
8
8
|
function HiddenPartSelectTree(props) {
|
|
9
|
+
const {
|
|
10
|
+
params = {},
|
|
11
|
+
isNeedCorpInfoId = false,
|
|
12
|
+
...restProps
|
|
13
|
+
} = props;
|
|
14
|
+
|
|
9
15
|
const [treeData, setTreeData] = useState([]);
|
|
10
16
|
|
|
11
17
|
const getData = async () => {
|
|
12
18
|
setTreeData([]);
|
|
13
|
-
|
|
19
|
+
|
|
20
|
+
// 根据参数决定是否发送请求
|
|
21
|
+
if (isNeedCorpInfoId && !params.eqCorpinfoId)
|
|
22
|
+
return;
|
|
23
|
+
|
|
24
|
+
const { data } = await request("/hidden/hiddenRegion/listByTree", "post", params);
|
|
14
25
|
setTreeData(data);
|
|
15
26
|
};
|
|
16
27
|
|
|
17
28
|
useEffect(() => {
|
|
18
29
|
getData();
|
|
19
|
-
}, []);
|
|
30
|
+
}, [JSON.stringify(params), isNeedCorpInfoId]);
|
|
20
31
|
|
|
21
32
|
return (
|
|
22
|
-
<BasicSelectTree treeData={treeData} nameKey="hiddenregion" idKey="hiddenregionId" {...
|
|
33
|
+
<BasicSelectTree treeData={treeData} placeholder="隐患部位" nameKey="hiddenregion" idKey="hiddenregionId" {...restProps} />
|
|
23
34
|
);
|
|
24
35
|
}
|
|
25
36
|
|
|
@@ -17,5 +17,5 @@ export type DownloadBlobFunction = (options: downloadBlobOptions) => Promise<any
|
|
|
17
17
|
/**
|
|
18
18
|
* 下载Blob流文件
|
|
19
19
|
*/
|
|
20
|
-
export default function
|
|
21
|
-
export default function
|
|
20
|
+
export default function useDownloadBlob(returnType: "array"): [boolean, DownloadBlobFunction];
|
|
21
|
+
export default function useDownloadBlob(returnType?: "object"): { loading: boolean; downloadBlob: DownloadBlobFunction };
|