更新一版 完成到管理系统管理数据盘维护

master
鲁誉程 10 months ago
parent 89c4e3a1ef
commit d1ab3f2f72

@ -20,11 +20,11 @@ export default function Page() {
return <span>{c + 1}</span>;
},
},
{ title: '管理盘号', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '密钥种类', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '当前版本号', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '导入时间', dataIndex: 'importTime', key: 'importTime', align: 'center' }, ,
{ title: '数据长度', dataIndex: 'name', key: 'name', align: 'center' }
{ title: '管理盘号', dataIndex: 'managementDiskNumber', key: 'managementDiskNumber', align: 'center' },
{ title: '密钥种类', dataIndex: 'carrierModel', key: 'carrierModel', align: 'center' },
{ title: '当前版本号', dataIndex: 'version', key: 'version', align: 'center' },
{ title: '导入时间', dataIndex: 'createTime', key: 'createTime', align: 'center' }, ,
{ title: '数据长度', dataIndex: 'dataLength', key: 'dataLength', align: 'center' }
]
const props: UploadProps = {
@ -51,11 +51,11 @@ export default function Page() {
})
}
// 获取密钥体列表
// 管理系统管理盘数据维护 -- 列表
const getList = () => {
secretFormatList({ pageNumber: 1, pageSize: 50 }).then((res) => {
if (res?.result == "success") {
setTableData(res.data[0].list)
setTableData(res.data[0])
} else {
message.error(res?.errorMsg);
}

@ -26,19 +26,19 @@ export default function Page() {
return <span>{c + 1}</span>;
},
},
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '000标识', 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: 'deviceName', key: 'deviceName', align: 'center' },
{ title: '管理实体标识', dataIndex: 'managerModelId', key: 'managerModelId', align: 'center' },
{ title: '310标识', dataIndex: 'deviceMarkId', key: 'deviceMarkId', align: 'center' },
{ title: 'IP地址', dataIndex: 'ip', key: 'ip', align: 'center' },
{ title: '密钥种类名称', dataIndex: 'keyTypeName', key: 'keyTypeName', align: 'center' },
{ title: '密钥类型', dataIndex: 'keyType', key: 'keyType', align: 'center' },
{ title: '使用区/备用区', dataIndex: 'usageReserveArea', key: 'usageReserveArea', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', 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: 'name', key: 'name', align: 'center' }
{ title: '安装方式', dataIndex: 'installMethod', key: 'installMethod', align: 'center' },
{ title: '启用日期', dataIndex: 'activeDate', key: 'activeDate', align: 'center' },
{ title: '终止日期', dataIndex: 'enterDate', key: 'enterDate', align: 'center' },
{ title: '密钥套号', dataIndex: 'setNumber', key: 'setNumber', align: 'center' },
{ title: '协同管理标志', dataIndex: 'managementFlag', key: 'managementFlag', align: 'center' }
]
const columns1: any = [
@ -68,8 +68,7 @@ export default function Page() {
}
secretInstallSearch({deviceId: selectedRowKeys[0]}).then((res) => {
if (res?.result == "success") {
let data = res.data[0].filter((val: any) => { return val.delFlag == 0 })
setTableData([...data])
setTableData(res.data[0])
setVisibility(false)
setSelectedRowKeys([])
} else {
@ -139,13 +138,13 @@ export default function Page() {
dataSource={tableData1}
rowKey={(record: any) => record?.id}
rowClassName={rowClassName}
rowSelection={{
rowSelection={tableData1.length > 0 ? {
type: 'radio',
selectedRowKeys,
onChange: (selectedKeys: any) => {
setSelectedRowKeys(selectedKeys);
}
}}
} : null}
/>
<div className='flex_jE mt20'>

@ -1,14 +1,28 @@
import styles from '../../../GLQ/index.less';
import { useState } from 'react';
import { ConfigProvider, DatePicker, Modal, Radio, Select, Table } from 'antd';
import { useEffect, useState } from 'react';
import { ConfigProvider, DatePicker, Form, Modal, Pagination, Radio, Select, Table, message } from 'antd';
import { rowClassName } from '@/utils';
import ButtonComp from '@/components/ButtonComp';
import moment from 'moment';
import { secretFormatList, secretList } from '@/services/my';
export default function Page() {
const [tableData, setTableData] = useState([]);
const [tableData1, setTableData1] = useState([]);
const [visibility, setVisibility] = useState(false);
const [form] = Form.useForm();
const [pageNumber, setPageNumber] = useState(1);
const [pageSize, setpageSize] = useState(10);
const [total, setTotal] = useState();
const [usageReserveArea, setUsageReserveArea] = useState('1');
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [allRowKeys, setAllRowKeys] = useState([]);
useEffect(() => {
initForm()
}, [])
const columns: any = [
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
@ -23,85 +37,129 @@ export default function Page() {
return <span>{c + 1}</span>;
},
},
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '000标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', align: 'center' },
{ title: '管理实体标识', dataIndex: 'managementFlag', key: 'managementFlag', align: 'center' },
{ title: '310标识', dataIndex: 'distType', key: 'distType', align: 'center' },
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
{ title: '使用期/备用区', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '使用区/备用区', dataIndex: 'usageReserveArea', key: 'usageReserveArea', 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: 'installMethod', key: 'installMethod', align: 'center' },
{
title: '启用日期', dataIndex: 'activeDate', key: 'activeDate', align: 'center',
render: (text: any) => {
return <span>{text || '--'}</span>;
},
},
{ title: '套号', dataIndex: 'setNumber', key: 'setNumber', align: 'center' },
{ title: '载体类型', dataIndex: 'carrierType', key: 'carrierType', align: 'center' },
{ title: '输出日期', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '协同管理标志', dataIndex: 'name', key: 'name', align: 'center' }
]
const formItemSty = { width: 'auto', marginBottom: 20, marginRight: 30 };
const disabledDate = (current: any) => {
return current && current < moment().startOf('day');
};
const initForm = () => {
}
const disabledTime = (current, type) => {
if (type === 'start' && current && current.isSame(moment(), 'day')) {
const currentTime = moment();
const disabledHours = generateOptions(0, currentTime.hour());
const disabledMinutes = generateOptions(0, currentTime.minute());
return {
disabledHours: () => disabledHours,
disabledMinutes: () => disabledMinutes,
const onFinish = () => {
pageNumber == 1 ? getList() : setPageNumber(1);
};
useEffect(() => {
getList();
setSelectedRowKeys([])
}, [pageNumber]);
// 管理系统管理盘数据维护 -- 列表
const _secretFormatList = () => {
let res = false
secretFormatList({ pageNumber: 1, pageSize: 10 }).then((res) => {
if (res?.result == "success") {
if (res.data[0].length > 0) { res = true }
} else {
message.error(res?.errorMsg);
}
})
return res
}
// 获取密钥体列表
const getList = () => {
if (_secretFormatList()) {
message.info('请先完成管理系统管理盘数据维护--数据导入!')
return
}
secretList({ pageNumber, pageSize }).then((res) => {
if (res?.result == "success") {
res.data[0].list = res.data[0].list.filter((val: any) => { return val?.content != 'PMCS' })
setTotal(res.data[0].total - 1)
setTableData(res.data[0].list)
const keys = res.data[0].list.map((item: any) => item?.id);
setAllRowKeys(keys);
} else {
message.error(res?.errorMsg);
}
})
}
return {};
};
const generateOptions = (start, end) => Array.from({ length: end - start }, (_, i) => start + i);
const pageOnChange = (pageNumber: number) => {
setPageNumber(pageNumber);
}
const onShowSizeChange = (current: any, pageSize: any) => {
setpageSize(pageSize);
getList();
}
const disabledDate = (current: any) => {
return current && current < moment().startOf('day');
};
return (
<div className={`${styles.params_warp}`}>
<ButtonComp type={'special'} text={'管理密钥装配'} onClick={() => { }} />
<div className='flex_aiC mt20 mb20'>
<Radio.Group>
<Radio value="1" style={{ marginRight: 50 }}> 使 </Radio>
<Radio.Group value={usageReserveArea}>
<Radio value="1" style={{ marginRight: 30 }}> 使 </Radio>
<Radio value="2"> </Radio>
</Radio.Group>
</div>
<div className='flex_aiC mt20 mb20'>
<div className='mr16'></div>
<Select style={{ width: 260, marginRight: 20 }} placeholder={'请选择密钥类型'}
<Form form={form} layout={'inline'} onFinish={onFinish} className='mt20'>
<Form.Item name="keyType" label="密钥类型" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }} placeholder={'请选择密钥类型'}
options={[
{ label: '密钥-111', value: '密钥-111'},
{ label: '密钥-222', value: '密钥-222'}
{ label: '密钥种类1', value: '密钥种类1' },
{ label: '密钥种类2', value: '密钥种类2' }
]} />
<div className='mr16'></div>
<Select style={{ width: 260, marginRight: 20 }} placeholder={'请选择所属网络'}
</Form.Item>
<Form.Item name="keyType" label="所属网络" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }} placeholder={'请选择所属网络'}
options={[
{ label: '离线', value: '离线' },
{ label: '指挥专网', value: '指挥专网' },
{ label: '军事综合信息网', value: '军事综合信息网' },
{ label: '资源管理网', value: '资源管理网' }
]} />
<div className='mr16'></div>
</Form.Item>
<Form.Item name="keyType" label="启用日期" style={formItemSty} rules={[{ required: true, message: '请选择启用日期' }]}>
<DatePicker
showTime={{ format: 'HH:mm' }}
style={{ width: 260 }}
disabledDate={disabledDate}
disabledTime={disabledTime}
format="YYYY-MM-DD HH:mm" />
</div>
</Form.Item>
</Form>
<div className='mb10'></div>
<Table
scroll={tableData.length > 0 ? { y: 41 * 5 } : {}}
scroll={tableData1.length > 0 ? { y: 41 * 5 } : {}}
pagination={false}
bordered
columns={columns}
dataSource={tableData}
dataSource={tableData1}
rowKey={(record: any) => record?.id}
rowClassName={rowClassName}
/>
@ -111,6 +169,7 @@ export default function Page() {
</div>
<div className='mb10 mt30'></div>
<Table
scroll={tableData.length > 0 ? { y: 41 * 5 } : {}}
pagination={false}
@ -119,7 +178,26 @@ export default function Page() {
dataSource={tableData}
rowKey={(record: any) => record?.id}
rowClassName={rowClassName}
rowSelection={tableData.length > 0 ? {
type: 'radio',
selectedRowKeys,
onChange: (selectedKeys: any) => {
setSelectedRowKeys(selectedKeys);
}
} : null}
/>
{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 className='flex_jE mt20'>
<ButtonComp type='cancel' style={{ marginRight: 20 }} text={'过滤'} onClick={() => { }} />

@ -17,7 +17,7 @@ export default function Page() {
},
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '000标识', 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: 'carrierType', key: 'carrierType', align: 'center' },

@ -23,7 +23,7 @@ export default function Page() {
},
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '000标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '310标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
{ title: '安装方式', dataIndex: 'name', key: 'name', align: 'center' },

@ -26,7 +26,7 @@ export default function Page() {
},
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '000标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '310标识', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
{ title: '使用期/备用区', dataIndex: 'name', key: 'name', align: 'center' },

@ -67,5 +67,5 @@ export async function manageDiskDataImport(formData: any) {
// 管理系统管理盘数据维护 - 列表
export async function secretFormatList(params: any) {
return getRequest(`/xgd/secretInstall/secretFormatList`, params);
return getRequest(`/xgd/secretInstall/managerSysDataList`, params);
}

@ -2,7 +2,8 @@ export const DEV = {
PROXY_SERVER: 'http://localhost:8088',
// PROXY_SERVER: 'http://127.0.0.1:8088',
LOCAL_URL: 'http://localhost:8000',
FILE_URL: 'C:/Users/lyc/Desktop' // 快捷方式储存的路径
FILE_URL: 'C:/Users/lyc/Desktop', // 快捷方式储存的路径
HARD_CODE: false, // 是否写死接口的请求地址
};
export default DEV;

@ -1,7 +1,5 @@
import { DEV } from './env/dev'
// 是否写死请求地址
const hardCode = false;
/**
* GET
@ -16,7 +14,7 @@ export function getRequest(url: string, params: object) {
.join('&');
// 拼接查询字符串到 URL
let urlWithParams = ((hardCode ? DEV.PROXY_SERVER : '')) + url;
let urlWithParams = ((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url;
if (queryString) {
urlWithParams += `?${queryString}`;
}
@ -43,7 +41,7 @@ export function getRequest(url: string, params: object) {
* @returns {Promise} - Promise response error
*/
export function postRequest(url: string, data: object) {
return fetch(((hardCode ? DEV.PROXY_SERVER : '')) + url, {
return fetch(((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url, {
method: 'POST',
headers: { 'Content-Type': 'application/json'},
mode: "cors",
@ -69,7 +67,7 @@ export function postFormDataRequest(url: string, data: object) {
formData.append(key, data[key]);
}
return fetch(((hardCode ? DEV.PROXY_SERVER : '')) + url, {
return fetch(((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url, {
method: 'POST',
mode: "cors",
body: formData
@ -89,7 +87,7 @@ export function postFormDataRequest(url: string, data: object) {
*/
export function deleteRequest(url: string, params: object) {
const searchParams = new URLSearchParams(params);
return fetch(`${((hardCode ? DEV.PROXY_SERVER : '')) + url}?${searchParams.toString()}`, {
return fetch(`${((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url}?${searchParams.toString()}`, {
method: 'DELETE',
mode: "cors",
})
@ -108,7 +106,7 @@ export function deleteRequest(url: string, params: object) {
* @returns {Promise} - Promise
*/
export function putRequest(url: string, data: object) {
return fetch(((hardCode ? DEV.PROXY_SERVER : '')) + url, {
return fetch(((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
@ -131,7 +129,7 @@ export function putRequest(url: string, data: object) {
* @returns {Promise} - Promise blob error
*/
export function downloadFile(url: string, fileName?: string) {
return fetch(((hardCode ? DEV.PROXY_SERVER : '')) + url, {
return fetch(((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url, {
method: 'GET',
mode: "cors",
})
@ -158,7 +156,7 @@ export function downloadFile(url: string, fileName?: string) {
* @returns {Promise} - Promise
*/
export function uploadFile(url: string, formData: any) {
return fetch(((hardCode ? DEV.PROXY_SERVER : '')) + url, {
return fetch(((DEV.HARD_CODE ? DEV.PROXY_SERVER : '')) + url, {
method: 'POST',
body: formData,
mode: "cors"

Loading…
Cancel
Save