zy-react-library 1.0.11 → 1.0.13
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/HeaderBack/index.d.ts +18 -0
- package/components/HeaderBack/index.js +35 -0
- package/components/HeaderBack/index.less +21 -0
- package/components/Map/MapSelector.js +12 -7
- package/components/Map/index.js +3 -0
- package/components/Pdf/index.js +3 -0
- package/components/PreviewImg/index.js +4 -0
- package/components/PreviewPdf/index.js +3 -0
- package/components/Search/index.js +1 -1
- package/components/Table/index.js +1 -0
- package/components/TooltipPreviewImg/index.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export interface HeaderBackProps {
|
|
4
|
+
/** 标题 */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** 历史记录对象,用于返回上一页,默认使用 window.history.back */
|
|
7
|
+
history?: {
|
|
8
|
+
goBack?: () => void;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
/** 是否显示返回按钮,默认为 true */
|
|
12
|
+
previous?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** 头部返回组件 */
|
|
16
|
+
declare const HeaderBack: FC<HeaderBackProps>;
|
|
17
|
+
|
|
18
|
+
export default HeaderBack;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ArrowLeftOutlined } from "@ant-design/icons";
|
|
2
|
+
import { Divider } from "antd";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 头部返回组件
|
|
7
|
+
*/
|
|
8
|
+
function HeaderBack(props) {
|
|
9
|
+
const { title, history, previous = true } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="header-back">
|
|
13
|
+
<div className="action">
|
|
14
|
+
{
|
|
15
|
+
previous
|
|
16
|
+
&& (
|
|
17
|
+
<>
|
|
18
|
+
<div
|
|
19
|
+
className="back"
|
|
20
|
+
onClick={() => history?.goBack?.() || window.history.back()}
|
|
21
|
+
>
|
|
22
|
+
<ArrowLeftOutlined style={{ fontSize: 14 }} />
|
|
23
|
+
<span>返回</span>
|
|
24
|
+
</div>
|
|
25
|
+
<Divider type="vertical" style={{ backgroundColor: "#dcdfe6", marginLeft: 15, marginRight: 15 }} />
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
<div className="title">{title}</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default HeaderBack;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.header-back {
|
|
2
|
+
padding: 10px 20px;
|
|
3
|
+
border-bottom: 1px solid #dcdfe6;
|
|
4
|
+
|
|
5
|
+
.action {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
.back {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 10px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.title {
|
|
18
|
+
font-size: 17px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { Button, Col, Form, Input, Modal, Row, Spin } from "antd";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 定位组件弹窗
|
|
6
|
+
*/
|
|
7
|
+
const MapSelector = (props) => {
|
|
8
|
+
const {
|
|
9
|
+
visible,
|
|
10
|
+
onClose,
|
|
11
|
+
longitude,
|
|
12
|
+
latitude,
|
|
13
|
+
onConfirm,
|
|
14
|
+
} = props;
|
|
15
|
+
|
|
11
16
|
const mapContainerRef = useRef(null);
|
|
12
17
|
const mapInstanceRef = useRef(null);
|
|
13
18
|
const [loading, setLoading] = useState(false);
|
package/components/Map/index.js
CHANGED
package/components/Pdf/index.js
CHANGED
|
@@ -9,6 +9,7 @@ function TablePro(props) {
|
|
|
9
9
|
rowKey = 'id',
|
|
10
10
|
...restProps
|
|
11
11
|
} = props;
|
|
12
|
+
|
|
12
13
|
const storeIndex = props.storeIndex || `${window.process.env.app.antd["ant-prefix"]}_${Math.random().toString(36).substring(2)}`;
|
|
13
14
|
function calcColumns() {
|
|
14
15
|
showIndex && columns.unshift(getIndexColumn(props.pagination));
|