|
|
|
@ -1,76 +1,225 @@
|
|
|
|
|
import ButtonComp from '@/components/ButtonComp';
|
|
|
|
|
import ContentWarp from '@/components/ContentWarp';
|
|
|
|
|
import { rowClassName } from '@/utils';
|
|
|
|
|
import { Input, Select, Table } from 'antd';
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
import { Form, Input, Pagination, Select, Table, message } from 'antd';
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import styles from './index.less'
|
|
|
|
|
import { deviceHardEditOrAdd, deviceHardPage } from '@/services/register';
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
|
|
|
|
|
export default function Page() {
|
|
|
|
|
const [tableData, setTableData] = useState([]);
|
|
|
|
|
const [pageNumber, setPageNumber] = useState(1);
|
|
|
|
|
const [pageSize, setpageSize] = useState(10);
|
|
|
|
|
const [total, setTotal] = useState(0);
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
const [content, setContent] = useState('');
|
|
|
|
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
|
|
|
|
|
|
|
|
const columns: any = [
|
|
|
|
|
{ title: '单位名称', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '实体标识', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '310标识', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '设备信号', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '管理盘号', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '所属网络', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: 'IP地址', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '电话号码', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '联系人', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '联系方式', dataIndex: 'name', key: 'name', align: 'center' },
|
|
|
|
|
{ title: '席位名称', dataIndex: 'name', key: 'name', align: 'center' }
|
|
|
|
|
{ title: '单位名称', dataIndex: 'unitName', key: 'unitName', align: 'center' },
|
|
|
|
|
{ title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', align: 'center' },
|
|
|
|
|
{ title: '实体标识', dataIndex: 'deviceEntityId', key: 'deviceEntityId', align: 'center' },
|
|
|
|
|
{ title: '310标识', dataIndex: 'deviceMarkId', key: 'deviceMarkId', align: 'center' },
|
|
|
|
|
{ title: '设备型号', dataIndex: 'deviceType', key: 'deviceType', align: 'center' },
|
|
|
|
|
{ title: '管理盘号', dataIndex: 'diskNumber', key: 'diskNumber', align: 'center' },
|
|
|
|
|
{ title: '所属网络', dataIndex: 'homeNetwork', key: 'homeNetwork', align: 'center' },
|
|
|
|
|
{ title: 'IP地址', dataIndex: 'ip', key: 'ip', align: 'center' },
|
|
|
|
|
{ title: '电话号码', dataIndex: 'telephone', key: 'telephone', align: 'center' },
|
|
|
|
|
{ title: '联系人', dataIndex: 'contacts', key: 'contacts', align: 'center' },
|
|
|
|
|
{ title: '联系方式', dataIndex: 'contactsInfo', key: 'contactsInfo', align: 'center' },
|
|
|
|
|
{ title: '席位名称', dataIndex: 'seatName', key: 'seatName', align: 'center' }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
let inputSty = { width: 230, marginLeft: 16, marginRight: 10 };
|
|
|
|
|
let inputSty1= { width: 230, marginLeft: 18, marginRight: 10 };
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
initForm()
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getList();
|
|
|
|
|
}, [pageNumber]);
|
|
|
|
|
|
|
|
|
|
const getList = () => {
|
|
|
|
|
deviceHardPage({ pageNumber, pageSize }).then((res) => {
|
|
|
|
|
if (res?.result == "success") {
|
|
|
|
|
setTotal(res.data[0].total)
|
|
|
|
|
setTableData(res.data[0].list)
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res?.errorMsg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const initForm = () => {
|
|
|
|
|
form.resetFields()
|
|
|
|
|
form.setFieldsValue({
|
|
|
|
|
connFlag: 1,
|
|
|
|
|
homeNetwork: '指挥专网',
|
|
|
|
|
})
|
|
|
|
|
setContent('')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const updateList = () => {
|
|
|
|
|
pageNumber == 1 ? getList() : setPageNumber(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onFinish = (values: any) => {
|
|
|
|
|
let params = {
|
|
|
|
|
level: 1,
|
|
|
|
|
photoUrl: "",
|
|
|
|
|
content,
|
|
|
|
|
...values
|
|
|
|
|
}
|
|
|
|
|
console.log("params", params);
|
|
|
|
|
|
|
|
|
|
deviceHardEditOrAdd(params).then((res) => {
|
|
|
|
|
if (res?.result == "success") {
|
|
|
|
|
message.success('添加成功');
|
|
|
|
|
initForm();
|
|
|
|
|
updateList();
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res?.errorMsg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const pageOnChange = (pageNumber: number) => {
|
|
|
|
|
setPageNumber(pageNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onShowSizeChange = (current: any, pageSize: any) => {
|
|
|
|
|
setpageSize(pageSize);
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div className='flex_jB'>
|
|
|
|
|
<ContentWarp text={'注册信息'} style={{ width: 'calc(70% - 25px)' }}>
|
|
|
|
|
<div className='pd20'>
|
|
|
|
|
<div className='mb10'>级别:1</div>
|
|
|
|
|
<div className='flex_aiC_jB' style={{flexWrap: 'nowrap'}}>
|
|
|
|
|
<div style={{ width: '50%', minWidth: 450 }}>
|
|
|
|
|
<div className='flex_aiC mt20'>
|
|
|
|
|
单位名称<Input style={inputSty} />
|
|
|
|
|
<ButtonComp text={'定位'} onClick={() => { }} />
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC mt20'>设备名称<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>
|
|
|
|
|
设备型号<Input style={inputSty} />
|
|
|
|
|
版本<Select style={{width: 64, marginLeft: 12}} />
|
|
|
|
|
<div >级别:1</div>
|
|
|
|
|
<Form
|
|
|
|
|
form={form}
|
|
|
|
|
onFinish={onFinish}
|
|
|
|
|
className={styles.formSty}
|
|
|
|
|
>
|
|
|
|
|
<div className='flex_aiC_jB' style={{ flexWrap: 'nowrap' }}>
|
|
|
|
|
<div style={{ width: '50%', minWidth: 450 }}>
|
|
|
|
|
<div className='flex_fw'>
|
|
|
|
|
<Form.Item name="unitName" label="单位名称" rules={[{ required: true, message: '请输入单位名称' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<ButtonComp text={'定位'} style={{ margin: '20px 0 0px 20px' }} onClick={() => { }} />
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="deviceName" label="设备名称" rules={[{ required: true, message: '请输入设备名称' }]}>
|
|
|
|
|
<Input placeholder='请输入设备名称'/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_fw'>
|
|
|
|
|
<Form.Item name="deviceType" label="设备型号" rules={[{ required: true, message: '请选择设备型号' }]}>
|
|
|
|
|
<Select
|
|
|
|
|
placeholder="请选择设备型号"
|
|
|
|
|
style={{ width: 200 }}
|
|
|
|
|
options={[
|
|
|
|
|
{label:'设备型号1', value: '设备型号1'},
|
|
|
|
|
{label:'设备型号2', value: '设备型号2'},
|
|
|
|
|
{label:'设备型号3', value: '设备型号3'},
|
|
|
|
|
{label:'设备型号4', value: '设备型号4'},
|
|
|
|
|
]}/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item style={{ width: 60 }} name="version" label="版本">
|
|
|
|
|
<Select style={{ width: 80 }} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="deviceNumber" label="设备编号" rules={[{ required: true, message: '请输入设备编号' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="deviceEntityId" label="实体标识" rules={[{ required: true, message: '请输入实体标识' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="deviceMarkId" label="310标识" rules={[{ required: true, message: '请输入310标识' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_fw'>
|
|
|
|
|
<Form.Item name="diskNumber" label="管理盘号" rules={[{ required: true, message: '请输入管理盘号' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<ButtonComp text={'选择'} style={{ margin: '20px 0 0px 20px' }} onClick={() => { }} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC mt20'>设备编号<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>实体标识<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>310标识 <Input style={inputSty1}/></div>
|
|
|
|
|
<div className='flex_aiC mt20'>
|
|
|
|
|
管理盘号<Input style={inputSty} />
|
|
|
|
|
<ButtonComp text={'选择'} onClick={() => { }} />
|
|
|
|
|
<div style={{ width: '50%', minWidth: 400 }}>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="homeNetwork" label="所属网络" rules={[{ required: true, message: '请输入所属网络' }]}>
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 200 }}
|
|
|
|
|
options={[
|
|
|
|
|
{ label: '指挥专网', value: '指挥专网' },
|
|
|
|
|
{ label: '军事综合信息网', value: '军事综合信息网' },
|
|
|
|
|
{ label: '资源管理网', value: '资源管理网' }
|
|
|
|
|
]}>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="contacts" label="联系人" rules={[{ required: true, message: '请输入联系人' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="contactsInfo" label="联系方式" rules={[{ required: true, message: '请输入联系方式' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="ip" label="IP地址" rules={[{ required: true, message: '请输入IP地址' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="telephone" label="电话号码" rules={[{ required: true, message: '请输入电话号码' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="connFlag" label="接入标志" rules={[{ required: true, message: '请输入接入标志' }]}>
|
|
|
|
|
<Select
|
|
|
|
|
style={{ width: 200 }}
|
|
|
|
|
options={[
|
|
|
|
|
{ label: '接入', value: 1 },
|
|
|
|
|
{ label: '未接入', value: 2 }
|
|
|
|
|
]}>
|
|
|
|
|
</Select>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<Form.Item name="seatName" label="席位名称" rules={[{ required: true, message: '请输入席位名称' }]}>
|
|
|
|
|
<Input />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ width: '50%', minWidth: 400 }}>
|
|
|
|
|
<div className='flex_aiC mt20'>单位名称<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>设备名称<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>设备型号<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>设备编号<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>实体标识<Input style={inputSty} /></div>
|
|
|
|
|
<div className='flex_aiC mt20'>310标识 <Input style={inputSty1}/></div>
|
|
|
|
|
<div className='flex_aiC mt20'>管理盘号<Input style={inputSty} /></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
</ContentWarp>
|
|
|
|
|
|
|
|
|
|
<div className='ml20' style={{ height: 455, width: '30%', marginTop: 8}}>
|
|
|
|
|
<div className='ml20' style={{ height: 'auto', width: '30%', marginTop: 8 }}>
|
|
|
|
|
<div className='mb10'>设备照片</div>
|
|
|
|
|
<div style={{ height: 193, border: '1px solid #d8d8d8', background: '#fff' }}></div>
|
|
|
|
|
<div style={{ height: 'calc(50% - 27px)', border: '1px solid #d8d8d8', background: '#fff' }}>
|
|
|
|
|
<img src="" style={{width: '100%', height: '100%'}} />
|
|
|
|
|
</div>
|
|
|
|
|
<div className='mb10 mt20'>备注</div>
|
|
|
|
|
<TextArea
|
|
|
|
|
style={{ height: 193, resize: 'none' }}
|
|
|
|
|
style={{ height: "calc(50% - 44px)", resize: 'none' }}
|
|
|
|
|
value={content}
|
|
|
|
|
onChange={(e) => { setContent(e.target.value) }}
|
|
|
|
|
placeholder="请输入备注" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -83,10 +232,10 @@ export default function Page() {
|
|
|
|
|
</div>
|
|
|
|
|
<div className='flex_aiC'>
|
|
|
|
|
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'修改'} onClick={() => { }} />
|
|
|
|
|
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'添加'} onClick={() => { }} />
|
|
|
|
|
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'添加'} onClick={() => form.submit()} />
|
|
|
|
|
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'注销'} onClick={() => { }} />
|
|
|
|
|
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'恢复'} onClick={() => { }} />
|
|
|
|
|
<ButtonComp type={'cancel'} text={'恢复'} onClick={() => { }} />
|
|
|
|
|
<ButtonComp type={'cancel'} text={'删除'} onClick={() => { }} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -98,7 +247,25 @@ export default function Page() {
|
|
|
|
|
dataSource={tableData}
|
|
|
|
|
rowKey={(record: any) => record?.id}
|
|
|
|
|
rowClassName={rowClassName}
|
|
|
|
|
rowSelection={{
|
|
|
|
|
selectedRowKeys,
|
|
|
|
|
onChange: (selectedKeys: any) => {
|
|
|
|
|
setSelectedRowKeys(selectedKeys);
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
{total > 0 && <div className='flex_aiC_jB mt20'>
|
|
|
|
|
<div>共 {total} 条</div>
|
|
|
|
|
<Pagination
|
|
|
|
|
current={pageNumber}
|
|
|
|
|
pageSize={pageSize}
|
|
|
|
|
total={total}
|
|
|
|
|
showQuickJumper
|
|
|
|
|
onChange={pageOnChange}
|
|
|
|
|
onShowSizeChange={onShowSizeChange}
|
|
|
|
|
/>
|
|
|
|
|
</div>}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|