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

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

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

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

@ -1,14 +1,28 @@
import styles from '../../../GLQ/index.less'; import styles from '../../../GLQ/index.less';
import { useState } from 'react'; import { useEffect, useState } from 'react';
import { ConfigProvider, DatePicker, Modal, Radio, Select, Table } from 'antd'; import { ConfigProvider, DatePicker, Form, Modal, Pagination, Radio, Select, Table, message } from 'antd';
import { rowClassName } from '@/utils'; import { rowClassName } from '@/utils';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import moment from 'moment'; import moment from 'moment';
import { secretFormatList, secretList } from '@/services/my';
export default function Page() { export default function Page() {
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [tableData1, setTableData1] = useState([]);
const [visibility, setVisibility] = useState(false); 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 = [ const columns: any = [
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' }, { title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
@ -23,85 +37,129 @@ export default function Page() {
return <span>{c + 1}</span>; return <span>{c + 1}</span>;
}, },
}, },
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' }, { title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', align: 'center' },
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' }, { title: '管理实体标识', dataIndex: 'managementFlag', key: 'managementFlag', align: 'center' },
{ title: '000标识', dataIndex: 'name', key: 'name', align: 'center' }, { title: '310标识', dataIndex: 'distType', key: 'distType', align: 'center' },
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' }, { title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', 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: 'installMethod', key: 'installMethod', align: 'center' },
{ title: '启用日期', dataIndex: 'name', key: 'name', align: 'center' }, {
{ title: '套号', dataIndex: 'name', key: 'name', 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: 'carrierType', key: 'carrierType', 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' }
] ]
const formItemSty = { width: 'auto', marginBottom: 20, marginRight: 30 };
const initForm = () => {
}
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);
}
})
}
const pageOnChange = (pageNumber: number) => {
setPageNumber(pageNumber);
}
const onShowSizeChange = (current: any, pageSize: any) => {
setpageSize(pageSize);
getList();
}
const disabledDate = (current: any) => { const disabledDate = (current: any) => {
return current && current < moment().startOf('day'); return current && current < moment().startOf('day');
}; };
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,
};
}
return {};
};
const generateOptions = (start, end) => Array.from({ length: end - start }, (_, i) => start + i);
return ( return (
<div className={`${styles.params_warp}`}> <div className={`${styles.params_warp}`}>
<ButtonComp type={'special'} text={'管理密钥装配'} onClick={() => { }} /> <ButtonComp type={'special'} text={'管理密钥装配'} onClick={() => { }} />
<div className='flex_aiC mt20 mb20'> <div className='flex_aiC mt20 mb20'>
<Radio.Group> <Radio.Group value={usageReserveArea}>
<Radio value="1" style={{ marginRight: 50 }}> 使 </Radio> <Radio value="1" style={{ marginRight: 30 }}> 使 </Radio>
<Radio value="2"> </Radio> <Radio value="2"> </Radio>
</Radio.Group> </Radio.Group>
</div> </div>
<div className='flex_aiC mt20 mb20'> <Form form={form} layout={'inline'} onFinish={onFinish} className='mt20'>
<div className='mr16'></div> <Form.Item name="keyType" label="密钥类型" style={formItemSty}>
<Select style={{ width: 260, marginRight: 20 }} placeholder={'请选择密钥类型'} <Select style={{ width: 260, marginRight: 16 }} placeholder={'请选择密钥类型'}
options={[ options={[
{ label: '密钥-111', value: '密钥-111'}, { label: '密钥种类1', value: '密钥种类1' },
{ label: '密钥-222', value: '密钥-222'} { label: '密钥种类2', value: '密钥种类2' }
]} /> ]} />
</Form.Item>
<div className='mr16'></div> <Form.Item name="keyType" label="所属网络" style={formItemSty}>
<Select style={{ width: 260, marginRight: 20 }} placeholder={'请选择所属网络'} <Select style={{ width: 260, marginRight: 16 }} placeholder={'请选择所属网络'}
options={[ options={[
{ label: '离线', value: '离线' }, { label: '离线', value: '离线' },
{ label: '指挥专网', value: '指挥专网' }, { label: '指挥专网', value: '指挥专网' },
{ label: '军事综合信息网', value: '军事综合信息网' }, { label: '军事综合信息网', value: '军事综合信息网' },
{ label: '资源管理网', value: '资源管理网' } { label: '资源管理网', value: '资源管理网' }
]} /> ]} />
</Form.Item>
<div className='mr16'></div> <Form.Item name="keyType" label="启用日期" style={formItemSty} rules={[{ required: true, message: '请选择启用日期' }]}>
<DatePicker <DatePicker
showTime={{ format: 'HH:mm' }} style={{ width: 260 }}
style={{ width: 260 }} disabledDate={disabledDate}
disabledDate={disabledDate} format="YYYY-MM-DD HH:mm" />
disabledTime={disabledTime} </Form.Item>
format="YYYY-MM-DD HH:mm"/> </Form>
</div>
<div className='mb10'></div> <div className='mb10'></div>
<Table <Table
scroll={tableData.length > 0 ? { y: 41 * 5 } : {}} scroll={tableData1.length > 0 ? { y: 41 * 5 } : {}}
pagination={false} pagination={false}
bordered bordered
columns={columns} columns={columns}
dataSource={tableData} dataSource={tableData1}
rowKey={(record: any) => record?.id} rowKey={(record: any) => record?.id}
rowClassName={rowClassName} rowClassName={rowClassName}
/> />
@ -111,6 +169,7 @@ export default function Page() {
</div> </div>
<div className='mb10 mt30'></div> <div className='mb10 mt30'></div>
<Table <Table
scroll={tableData.length > 0 ? { y: 41 * 5 } : {}} scroll={tableData.length > 0 ? { y: 41 * 5 } : {}}
pagination={false} pagination={false}
@ -119,8 +178,27 @@ export default function Page() {
dataSource={tableData} dataSource={tableData}
rowKey={(record: any) => record?.id} rowKey={(record: any) => record?.id}
rowClassName={rowClassName} 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'> <div className='flex_jE mt20'>
<ButtonComp type='cancel' style={{ marginRight: 20 }} text={'过滤'} onClick={() => { }} /> <ButtonComp type='cancel' style={{ marginRight: 20 }} text={'过滤'} onClick={() => { }} />
<ButtonComp type='cancel' style={{ marginRight: 20 }} text={'载体输出'} onClick={() => { }} /> <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: '管理实体标识', 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: 'name', key: 'name', align: 'center' }, { title: '安装方式', dataIndex: 'name', key: 'name', align: 'center' },
{ title: '载体类型', dataIndex: 'carrierType', key: 'carrierType', 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: '管理实体标识', 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: 'productName', key: 'productName', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' }, { title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
{ title: '安装方式', dataIndex: 'name', key: 'name', 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: '管理实体标识', 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: 'productName', key: 'productName', align: 'center' },
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' }, { title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' },
{ title: '使用期/备用区', dataIndex: 'name', key: 'name', 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) { 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://localhost:8088',
// PROXY_SERVER: 'http://127.0.0.1:8088', // PROXY_SERVER: 'http://127.0.0.1:8088',
LOCAL_URL: 'http://localhost:8000', LOCAL_URL: 'http://localhost:8000',
FILE_URL: 'C:/Users/lyc/Desktop' // 快捷方式储存的路径 FILE_URL: 'C:/Users/lyc/Desktop', // 快捷方式储存的路径
HARD_CODE: false, // 是否写死接口的请求地址
}; };
export default DEV; export default DEV;

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

Loading…
Cancel
Save