master
鲁誉程 10 months ago
parent 55a0e03588
commit 2f521b4b1b

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

@ -1,19 +1,25 @@
.wzgl_warp {
width: 100%;
height: 100%;
background-color: #020202;
}
.earthWarp {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background: url('../../../../assets/images/googleEarth/startBG.jpg') no-repeat;
background-size: 100% 100%;
background: url('../../../../assets/images/googleEarth/starBG.png') no-repeat;
background-size: 85% 100%;
background-position: center;
object-fit: cover;
.earthCon {
width: 500px;
height: 500px;
width: 46%;
height: 96%;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
}

@ -1,16 +1,46 @@
import { useState } from 'react';
import styles from './index.less';
import { Input, Modal } from 'antd';
import { Input, Modal, message } from 'antd';
import ButtonComp from '@/components/ButtonComp';
import { unitAddressEditOrAdd } from '@/services/register';
import { useLocation, useParams } from 'umi';
import { sysTypeStr } from '@/utils/sysType';
export default function Page() {
const location = useLocation();
const [unitName, setUnitName] = useState<any>('');
const [visibility, setVisibility] = useState<boolean>(false);
const [showFlag, setShowFlag] = useState<boolean>(false);
const submit = () => {
const searchParams = new URLSearchParams(location.search);
const sysType = searchParams.get('sysType');
unitAddressEditOrAdd({
parentId: 1,
sysType: sysTypeStr[sysType],
unitName: unitName,
}).then((res) => {
if (res.result == 'success') {
setShowFlag(true);
setUnitName('')
setVisibility(false);
message.success('添加成功!')
}else {
message.error(res?.errorMsg)
}
})
}
return (
<div className={styles.earthWarp}>
<div className={styles.earthCon} onClick={() => setVisibility(true)}>
<div className={styles.marker}></div>
<div className={styles.wzgl_warp}>
<div className={styles.earthWarp}>
<div className={styles.earthCon} onClick={() => setVisibility(true)}>
{/* 小红旗 */}
{ showFlag && <img src={require('../../../../assets/images/googleEarth/flag.png')} width={30} height={30}/> }
</div>
</div>
{/* 开机认证 */}
@ -36,8 +66,8 @@ export default function Page() {
</div>
<div className='flex_jE mt20'>
<ButtonComp style={{marginRight: 20}} text={'定位'} onClick={() => setVisibility(false)} />
<ButtonComp style={{marginRight: 20}} text={'确定'} onClick={() => setVisibility(false)} />
<ButtonComp style={{ marginRight: 20 }} text={'定位'} onClick={() => setVisibility(false)} />
<ButtonComp style={{ marginRight: 20 }} text={'确定'} onClick={() => {submit()}} />
<ButtonComp type='cancel' text={'取消'} onClick={() => setVisibility(false)} />
</div>
</Modal>

@ -49,3 +49,13 @@ export async function devicePhotoEditOrAdd(data: any) {
export async function devicePhotoList(params: any) {
return getRequest(`/xgd/devicePhoto/page`, params);
}
// 新增或修改位置
export async function unitAddressEditOrAdd(data: any) {
return postRequest(`/xgd/unitAddress/editOrAdd`, data);
}
// 单位名称列表分页查看
export async function unitAddressList(params: any) {
return getRequest(`/xgd/unitAddress/page`, params);
}
Loading…
Cancel
Save