master_055
张瑞宁 12 months ago
parent bd7e716842
commit ecfc9bec31

@ -40,7 +40,7 @@ const options63=[
const leftMenuType: any = {
// 设备管理
'设备注册': <LeftMenuTree key={1} data={MenuType['设备注册']} />,
'离线管理1':<LeftMenuStep currStep={1} allStep={4} stepName={'设备离线管理'} />,
'离线管理':<LeftMenuStep currStep={1} allStep={4} stepName={'设备离线管理'} />,
// 密钥管理
'预制密钥':<LeftMenuA data={MenuType['预制密钥']}/>,
'密钥装配': <LeftMenuTree key={1} data={MenuType['密钥装配']} />,

@ -1,7 +1,9 @@
import React, { useEffect, useState, useRef } from 'react';
import { Modal, Form, Input,message,DatePicker } from 'antd';
import { Modal, Form, Input, message, DatePicker, Select } from 'antd';
import ButtonComp from '@/components/ButtonComp';
import { addPasswordDeviceInfo } from '@/services/device';
import styles from './index.less';
import moment from 'moment';
interface PageProps {
title?: string;
@ -18,38 +20,39 @@ const AddModal = ({
...props
}: PageProps) => {
const [form] = Form.useForm();
const passwordDeviceInfo= {
"belongCryptoSystem": "string",
"communicationAddressType": "string",
"createTime": "string",
"deviceAliases": "string",
"equipmentDeploymentLocation": "string",
"equipmentManagementUnit": "string",
"equipmentManufacturer": "string",
"equipmentType": "string",
"equipmentUserUnit": "string",
"id": 0,
"isolatorExternalNetworkIp": "string",
"memo": "string",
"passwordDeviceNumber": "string",
"passwordDeviceSerialNumber": "string",
"passwordEntityIdentifier": "string",
"registrationDate": "string",
"superiorEquipmentNumber": "string",
"sysType": "string",
"updateTime": "string"
const passwordDeviceInfo = {
"belongCryptoSystem": "",
"communicationAddressType": "",
"createTime": "",
"deviceAliases": "",
"equipmentDeploymentLocation": "",
"equipmentManagementUnit": "",
"equipmentManufacturer": "",
"equipmentType": "",
"equipmentUserUnit": "",
"id": '',
"isolatorExternalNetworkIp": "",
"memo": "",
"passwordDeviceNumber": "",
"passwordDeviceSerialNumber": "",
"passwordEntityIdentifier": "",
"registrationDate": "",
"superiorEquipmentNumber": "",
"sysType": "",
"updateTime": ""
};
const onFinish = (values: any) => {
values.registrationDate=values['registrationDate'].format('YYYY-MM-DD'),
addPasswordDeviceInfo({...values,passwordDeviceInfo}).then((res) => {
if (res?.result == "success") {
message.success('新增成功');
form.resetFields();
} else {
message.error(res?.errorMsg);
}
})
values.registrationDate = (values['registrationDate'] || moment()).format('YYYY-MM-DD'),
addPasswordDeviceInfo({ ...values, passwordDeviceInfo }).then((res) => {
if (res?.result == "success") {
message.success('新增成功');
onCancel();
form.resetFields();
} else {
message.error(res?.errorMsg);
}
})
};
return (
@ -66,7 +69,8 @@ const AddModal = ({
<Form
onFinish={onFinish}
form={form}
style={{maxHeight:'500px',overflow:'auto'}}
style={{ maxHeight: '500px', overflow: 'auto' }}
className={styles.formWrap}
>
<Form.Item name="belongCryptoSystem" label="所属密码系统">
<Input placeholder="请输入所属密码系统" />
@ -75,43 +79,57 @@ const AddModal = ({
<Input placeholder="请输入所属设备类型" />
</Form.Item>
<div style={{ display: 'flex' }}>
<Form.Item name="passwordEntityIdentifier" label="密码实体标识" rules={[{ required: true, message: '请选择密码实体标识' },]}>
<Form.Item style={{flex:'1'}} name="passwordEntityIdentifier" label="密码实体标识" rules={[{ required: true, message: '请选择密码实体标识' },]}>
<Input placeholder="请选择密码实体标识" />
</Form.Item>
{/* <ButtonComp text={'选择'} style={{ marginLeft: '20px' }} onClick={() => { }} /> */}
</div>
<div style={{ display: 'flex' }}>
<Form.Item name="passwordDeviceSerialNumber" label="密码设备序号" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<div style={{flex:'1'}}>
<Form.Item name="passwordDeviceSerialNumber" label="密码设备序号" rules={[{ required: true, message: '请输入密码设备序号' },]}>
<Input placeholder="请输入密码设备序号" />
</Form.Item>
</div>
<div style={{ marginLeft: '20px' }}>0000001</div>
</div>
<Form.Item name="passwordDeviceNumber" label="密码设备编号" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Form.Item name="passwordDeviceNumber" label="密码设备编号" >
<Input placeholder="请输入密码设备编号" />
</Form.Item>
<Form.Item name="superiorEquipmentNumber" label="上级设备编号" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Form.Item name="superiorEquipmentNumber" label="上级设备编号" rules={[{ required: true, message: '请输入上级设备编号' },]}>
<Input placeholder="请输入上级设备编号" />
</Form.Item>
<Form.Item name="equipmentUserUnit" label="设备使用单位" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Form.Item name="equipmentUserUnit" label="设备使用单位">
<Input placeholder="请输入设备使用单位" />
</Form.Item>
<Form.Item name="equipmentDeploymentLocation" label="设备部署地点" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Form.Item name="equipmentDeploymentLocation" label="设备部署地点" >
<Input placeholder="请输入设备部署地点" />
</Form.Item>
<Form.Item name="equipmentManagementUnit" label="设备管理单位" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Input placeholder="请选择设备管理单位" />
<Form.Item name="equipmentManagementUnit" label="设备管理单位" rules={[{ required: true, message: '请选择设备管理单位' },]}>
<Select placeholder="请选择设备管理单位">
<Option value="单位1">11</Option>
<Option value="单位2">2</Option>
<Option value="单位3">3</Option>
</Select>
</Form.Item>
<Form.Item name="communicationAddressType" label="通信地址类型" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Input placeholder="请选择通信地址类型" />
<Form.Item name="communicationAddressType" label="通信地址类型" rules={[{ required: true, message: '请选择通信地址类型' },]}>
<Select placeholder="请选择通信地址类型">
<Option value="网络地址"></Option>
<Option value="电信地址"></Option>
<Option value="移动地址"></Option>
</Select>
</Form.Item>
<Form.Item name="isolatorExternalNetworkIp" label="隔离器外网IP" rules={[{ required: true, message: '请选择密码设备序号' },]}>
<Form.Item name="isolatorExternalNetworkIp" label="隔离器外网IP" rules={[{ required: true, message: '请输入隔离器外网IP' },]}>
<Input placeholder="请输入隔离器外网IP" />
</Form.Item>
<Form.Item name="equipmentManufacturer" label="设备生产厂商(可空)">
<Input placeholder="请选择设备生产厂商" />
<Select placeholder="请选择设备生产厂商">
<Option value="厂商1">1</Option>
<Option value="厂商2">2</Option>
<Option value="厂商3">3</Option>
</Select>
</Form.Item>
<Form.Item name="deviceAliases" label="设备别名(可空)">
<Input placeholder="请选择设备别名" />
<Input placeholder="请输入设备别名" />
</Form.Item>
<Form.Item name="memo" label="备注信息(可空)">
<Input placeholder="请输入备注信息" />
@ -121,7 +139,7 @@ const AddModal = ({
</Form.Item>
</Form>
<div className='flex_jE mt20'>
<ButtonComp style={{ marginRight: 20 }} text={'确定'} onClick={()=>{
<ButtonComp style={{ marginRight: 20 }} text={'确定'} onClick={() => {
form.submit();
// onOk();
}} />

@ -0,0 +1,14 @@
.formWrap {
label {
font-size: 14px;
}
div[class~='ant-form-item-control-input-content'] {
font-size: 14px;
}
div[class~='ant-form-item-label'] {
width: 160px;
text-align: right;
}
}

@ -3,4 +3,19 @@
align-items: center;
margin-left:20px;
margin-top:10px;
}
.formWrap {
label {
font-size: 14px;
}
div[class~='ant-form-item-control-input-content'] {
font-size: 14px;
}
div[class~='ant-form-item-label'] {
width: 100px;
text-align: right;
}
}

@ -34,10 +34,10 @@ const MachineRegister: FC<PageProps> = ({ }) => {
let sysInfo = localStorage.getItem(`${urlParams?.fileType}`);
let info = sysInfo ? JSON.parse(sysInfo) : null;
useEffect(() => {
installSuccess()
// useEffect(() => {
// installSuccess()
}, [])
// }, [])
useEffect(() => {
if (info?.nodeInitStatus) {
@ -51,22 +51,22 @@ const MachineRegister: FC<PageProps> = ({ }) => {
// 在指定的目录下安装快捷方式
const installSuccess = async () => {
try {
const response = await fetch('http://localhost:3001/createShortcut', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: "cors",
body: JSON.stringify({
folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
shortcutName: '客户端',
shortcutURL: `${DEV.LOCAL_URL}/machineManage/register/${urlParams?.fileType}?sysType=${encodeURIComponent(sysType[urlParams?.fileType] + 'hx')}`
}),
});
} catch (error) {
message.error(error); // 处理请求错误
}
}
// const installSuccess = async () => {
// try {
// const response = await fetch('http://localhost:3001/createShortcut', {
// method: 'POST',
// headers: { 'Content-Type': 'application/json' },
// mode: "cors",
// body: JSON.stringify({
// folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
// shortcutName: '客户端',
// shortcutURL: `${DEV.LOCAL_URL}/machineManage/register/${urlParams?.fileType}?sysType=${encodeURIComponent(sysType[urlParams?.fileType] + 'hx')}`
// }),
// });
// } catch (error) {
// message.error(error); // 处理请求错误
// }
// }
const columns = [{

@ -26,6 +26,7 @@ interface PageProps {
}
const ImportStep: FC<PageProps> = ({ }) => {
const urlParams = useParams();
const [step, setStep] = useState(2)
const props: UploadProps = {
@ -35,9 +36,8 @@ const ImportStep: FC<PageProps> = ({ }) => {
const formData = new FormData();
formData.append('file', file);
formData.append('sysType ', sysTypeStr[str]);
console.log("formData--", formData)
offlineImport(formData).then((res) => {
if (res?.result == "success" && res?.data.length > 0) {
if (res?.result == "success" && res?.data.length >= 0) {
message.success('加载数据成功');
// form.setFieldsValue({ ...res?.data[0] })
// localStorage.setItem('MMJInit', JSON.stringify(res?.data[0]));
@ -65,7 +65,7 @@ const ImportStep: FC<PageProps> = ({ }) => {
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'下一步'} onClick={() => { }} />
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'上一步'} onClick={() => { history.back() }} />
<Upload {...props} showUploadList={false}>
<ButtonComp style={{ marginRight: 20 }} text={'加载数据'} />
<ButtonComp style={{ marginRight: 20 }} text={'开始'} />
</Upload>
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'退出'} onClick={() => { }} />
</div>

@ -18,7 +18,7 @@ const PageName: FC<PageProps> = ({ }) => {
}
return (
<section>
<section style={{margin:'20px'}}>
<ContentWarp text='设备离线管理操作'>
<Radio.Group style={{ margin: '20px' }} onChange={handleRadioChange} value={radioValue}>
<Space direction="vertical">
@ -29,7 +29,7 @@ const PageName: FC<PageProps> = ({ }) => {
</Radio.Group>
</ContentWarp>
<div className='flex_jE_AC'>
<div className='flex_jE_AC' style={{marginTop:'20px'}}>
<ButtonComp style={{ marginRight: 20 }} type={'cancel'} text={'下一步'} onClick={() => {
if(radioValue ==1){
history.push(`/machineManage/offline/import/${urlStr}`)

@ -123,6 +123,7 @@ const NodeInitTool: FC<PageProps> = ({ }) => {
}).then((res) => {
if (res?.result == "success") {
message.success('初始化成功');
installSuccess2()
localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, nodeInitStatus: true }))
form.resetFields();
} else {
@ -132,6 +133,24 @@ const NodeInitTool: FC<PageProps> = ({ }) => {
};
const installSuccess2 = async () => {
try {
const response = await fetch('http://localhost:3001/createShortcut', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: "cors",
body: JSON.stringify({
folderPath: `${DEV.FILE_URL}/${countType[urlParams?.fileType]}`,
shortcutName: '客户端',
shortcutURL: `${DEV.LOCAL_URL}/machineManage/register/${urlParams?.fileType}?sysType=${encodeURIComponent(sysType[urlParams?.fileType] + 'hx')}`
}),
});
} catch (error) {
message.error(error); // 处理请求错误
}
}
return (
<section style={{ width: '1200px', margin: '20px auto' }}>
<Modal

@ -20,6 +20,7 @@ interface PageProps {
}
const ReceiveSecret: FC<PageProps> = ({ }) => {
const urlParams = useParams();
const [form] = Form.useForm();
const formItemSty = { width: 'auto', marginBottom: 20, marginRight: 30 };

@ -6,7 +6,8 @@ export async function addPasswordDeviceInfo(data: any) {
}
// 离线管理--导入
export async function offlineImport(data: any) {
return postRequest(`/055/device/offlineManagement`, data);
console.log("data")
return uploadFile(`/055/device/offlineManagement`, data);
}

@ -2,7 +2,7 @@ export const tabsType: any = {
1: [
{ id: 1, name: '设备注册', url: '/machineManage/register' },
{ id: 2, name: '在线管理' },
{ id: 3, name: '离线管理1', url: '/machineManage/offline' },
{ id: 3, name: '离线管理', url: '/machineManage/offline' },
{ id: 4, name: '黑名单' },
{ id: 5, name: '报表管理' },
],

Loading…
Cancel
Save