更新一版离线版

master
鲁誉程 9 months ago
parent 6f1f4b41fc
commit e46a673653

@ -92,8 +92,11 @@ const GBase: FC<PageProps> = ({
{active == 1 && <div className={styles.a1} onClick={() => setValue()}></div>} {active == 1 && <div className={styles.a1} onClick={() => setValue()}></div>}
{(active > 1 && active != 11) && <div className={styles.a2} onClick={() => { {(active > 1 && active != 11) && <div className={styles.a2} onClick={() => {
if (active == 8 && verifyPassword()) return; if (active == 8 && verifyPassword()) return;
if (active == 8) setGBasePassword(); if (active == 12) {
if (active == 12) { installSuccess(); return } installSuccess();
setGBasePassword();
return
}
setValue() setValue()
}}></div>} }}></div>}

@ -91,6 +91,10 @@ const InstallExe: FC<PageProps> = ({ }) => {
'用户登录组件' '用户登录组件'
] ]
if (urlParams?.fileType == 'offLine') {
notRequireds.push('执勤区安装程序')
}
// needArr 校验依赖程序中是否有未安装的 // needArr 校验依赖程序中是否有未安装的
let needArr = false; let needArr = false;
listData.slice(0, 7).forEach((k, i) => { listData.slice(0, 7).forEach((k, i) => {

@ -236,7 +236,7 @@ export default function Page() {
</div> </div>
<Table <Table
scroll={tableData.length > 0 ? { y: 41 * 9 } : {}} scroll={tableData.length > 0 ? { y: 41 * 10 } : {}}
pagination={false} pagination={false}
bordered bordered
columns={columns} columns={columns}
@ -276,7 +276,9 @@ export default function Page() {
centered centered
width={speed != 2 ? 425 : 515} width={speed != 2 ? 425 : 515}
onCancel={() => setVisibility(false)} onCancel={() => setVisibility(false)}
footer={null}> footer={null}
maskClosable={false}
>
<div> <div>
{ {
speed == 1 && speed == 1 &&

@ -4,7 +4,7 @@ import { ConfigProvider, Input, Modal, Table, Upload, UploadProps, message } fro
import { rowClassName } from '@/utils'; import { rowClassName } from '@/utils';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { manageDiskDataImport, secretFormatList } from '@/services/register'; import { manageDiskDataImport, managerSysDataList } from '@/services/register';
import ImportProgress from '@/components/ImportProgress'; import ImportProgress from '@/components/ImportProgress';
export default function Page() { export default function Page() {
@ -53,7 +53,7 @@ export default function Page() {
// 管理系统管理盘数据维护 -- 列表 // 管理系统管理盘数据维护 -- 列表
const getList = () => { const getList = () => {
secretFormatList({ pageNumber: 1, pageSize: 50 }).then((res) => { managerSysDataList({ pageNumber: 1, pageSize: 50 }).then((res) => {
if (res?.result == "success") { if (res?.result == "success") {
setTableData(res.data[0]) setTableData(res.data[0])
} else { } else {
@ -90,7 +90,8 @@ export default function Page() {
centered centered
width={speed != 1 ? 425 : 515} width={speed != 1 ? 425 : 515}
onCancel={() => setVisibility(false)} onCancel={() => setVisibility(false)}
footer={null}> footer={null}
maskClosable={false}>
<div> <div>
{ {
speed == 1 && speed == 1 &&

@ -5,11 +5,13 @@ import { ConfigProvider, DatePicker, Form, Modal, Pagination, Radio, Select, Tab
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'; import { secretKey, secretList } from '@/services/my';
import { managerSysDataList } from '@/services/register';
import { sysTypeStr } from '@/utils/sysType';
export default function Page() { export default function Page() {
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [tableData1, setTableData1] = useState([]); const [tableData1, setTableData1] = useState<any>([]);
const [visibility, setVisibility] = useState(false); const [visibility, setVisibility] = useState(false);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [pageNumber, setPageNumber] = useState(1); const [pageNumber, setPageNumber] = useState(1);
@ -18,48 +20,79 @@ export default function Page() {
const [usageReserveArea, setUsageReserveArea] = useState('1'); const [usageReserveArea, setUsageReserveArea] = useState('1');
const [selectedRowKeys, setSelectedRowKeys] = useState([]); const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [allRowKeys, setAllRowKeys] = useState([]); const [selectedRowKeys1, setSelectedRowKeys1] = useState([]);
const [selectedData, setSelectedData] = useState();
useEffect(() => { useEffect(() => {
initForm() initForm()
}, []) }, [])
const columns: any = [ const columns: any = [
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' }, {
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' }, title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center',
{ title: '装配情况', dataIndex: 'name', key: 'name', align: 'center' } render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '装配情况', dataIndex: 'assemblySituation', key: 'assemblySituation', align: 'center', render: (text: any) => { return <span>{text || '--'}</span> },
}
] ]
const columns1: any = [ const columns1: any = [
{ {
title: '序号', key: 'index', align: 'center', width: 80, title: '序号', key: 'index', align: 'center', width: 80,
render: (a: any, b: any, c: any) => { render: (a: any, b: any, c: any) => { return <span>{c + 1}</span> },
return <span>{c + 1}</span>; }, {
}, title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', align: 'center',
}, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', align: 'center' }, }, {
{ title: '管理实体标识', dataIndex: 'managementFlag', key: 'managementFlag', align: 'center' }, title: '管理实体标识', dataIndex: 'managerModelId', key: 'managerModelId', align: 'center',
{ title: '310标识', dataIndex: 'distType', key: 'distType', align: 'center' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' }, }, {
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' }, title: '310标识', dataIndex: 'deviceMarkId', key: 'deviceMarkId', align: 'center',
{ title: '使用区/备用区', dataIndex: 'usageReserveArea', key: 'usageReserveArea', align: 'center' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '分发状态', dataIndex: 'name', key: 'name', align: 'center' }, }, {
{ title: '安装方式', dataIndex: 'installMethod', key: 'installMethod', align: 'center' }, title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center',
{ render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '使用区/备用区', dataIndex: 'usageReserveArea', key: 'usageReserveArea', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '分发状态', dataIndex: 'distType', key: 'distType', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '安装方式', dataIndex: 'installMethod', key: 'installMethod', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '启用日期', dataIndex: 'activeDate', key: 'activeDate', align: 'center', title: '启用日期', dataIndex: 'activeDate', key: 'activeDate', align: 'center',
render: (text: any) => { render: (text: any) => { return <span>{text || '--'}</span> },
return <span>{text || '--'}</span>; }, {
}, title: '套号', dataIndex: 'setNumber', key: 'setNumber', 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' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '协同管理标志', dataIndex: 'name', key: 'name', align: 'center' } }, {
title: '输出日期', dataIndex: 'name', key: 'name', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '协同管理标志', dataIndex: 'managementFlag', key: 'managementFlag', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}
] ]
const formItemSty = { width: 'auto', marginBottom: 20, marginRight: 30 }; const formItemSty = { width: 'auto', marginBottom: 20, marginRight: 30 };
const initForm = () => { const initForm = () => {
form.setFieldsValue({
keyType: null,
web: null,
activeDate: null,
})
} }
const onFinish = () => { const onFinish = () => {
@ -71,33 +104,21 @@ export default function Page() {
setSelectedRowKeys([]) setSelectedRowKeys([])
}, [pageNumber]); }, [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 = () => { const getList = () => {
if (_secretFormatList()) {
message.info('请先完成管理系统管理盘数据维护--数据导入!')
return
}
secretList({ pageNumber, pageSize }).then((res) => { secretList({ pageNumber, pageSize }).then((res) => {
if (res?.result == "success") { if (res?.result == "success") {
res.data[0].list = res.data[0].list.filter((val: any) => { return val?.content != 'PMCS' }) res.data[0].list = res.data[0].list.filter((val: any) => {
setTotal(res.data[0].total - 1) return (['PT0', 'PT2', 'PT3', 'PT4'].includes(val?.content))
})
setTotal(res.data[0].list.length)
setTableData(res.data[0].list) setTableData(res.data[0].list)
const keys = res.data[0].list.map((item: any) => item?.id);
setAllRowKeys(keys); let arr: any = []
arr = res.data[0].list.filter((val: any) => {
return val?.assemblySituation == '未装配'
})
setTableData1([...arr])
} else { } else {
message.error(res?.errorMsg); message.error(res?.errorMsg);
} }
@ -117,6 +138,79 @@ export default function Page() {
return current && current < moment().startOf('day'); return current && current < moment().startOf('day');
}; };
// 校验是否少了步骤
const onRules = async () => {
// 校验管理系统管理盘数据维护列表是否有数据
let stop = false
await managerSysDataList({ pageNumber: 1, pageSize: 10 }).then((res) => {
if (res?.result == "success") {
if (res.data[0].length == 0) { stop = true }
} else {
message.error(res?.errorMsg);
}
})
if (stop) {
message.info('请先完成管理系统管理盘数据维护--数据导入!')
return
}
if (selectedRowKeys.length == 0) {
message.info('请选择一条可装配的密钥体!')
return
}
form.validateFields().then(() => {
tableData1.forEach(e => {
if (e.id == selectedRowKeys[0]) { setSelectedData(e) }
});
setVisibility(true)
})
}
// 过滤可装配列表
const onchange = () => {
let info = form.getFieldsValue();
setSelectedRowKeys([])
let arr: any = []
arr = tableData.filter((item) => {
if (item?.assemblySituation == '已装配') return
if (info?.keyType && info?.web) {
return (item?.keyType == info?.keyType && item?.web == info?.web)
} else if (info?.keyType) {
return item?.keyType == info?.keyType
} else if (info?.web) {
return item?.web == info?.web
}
})
setTableData1([...arr])
}
// 提交装配
const submit = () => {
const searchParams = new URLSearchParams(location.search);
const sysType = searchParams.get('sysType');
let info = form.getFieldsValue();
const formData = new FormData();
formData.append('activeDate', info.activeDate.format('YYYY-MM-DD'));
formData.append('endDate', moment().format('YYYY-MM-DD'));
formData.append('secretImportId', selectedRowKeys[0]);
formData.append('sysType', sysTypeStr[sysType]);
formData.append('type', '1');
secretKey(formData).then((res) => {
if (res?.result == "success") {
initForm()
onFinish()
setSelectedRowKeys([])
message.success('装配成功!')
setVisibility(false)
} else {
message.error(res?.errorMsg);
}
})
}
return ( return (
<div className={`${styles.params_warp}`}> <div className={`${styles.params_warp}`}>
<ButtonComp type={'special'} text={'管理密钥装配'} onClick={() => { }} /> <ButtonComp type={'special'} text={'管理密钥装配'} onClick={() => { }} />
@ -130,14 +224,20 @@ export default function Page() {
<Form form={form} layout={'inline'} onFinish={onFinish} className='mt20'> <Form form={form} layout={'inline'} onFinish={onFinish} className='mt20'>
<Form.Item name="keyType" label="密钥类型" style={formItemSty}> <Form.Item name="keyType" label="密钥类型" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }} placeholder={'请选择密钥类型'} <Select style={{ width: 260, marginRight: 16 }}
onChange={(e) => onchange()}
placeholder={'请选择密钥类型'}
allowClear
options={[ options={[
{ label: '密钥种类1', value: '密钥种类1' }, { label: '密钥种类1', value: '密钥种类1' },
{ label: '密钥种类2', value: '密钥种类2' } { label: '密钥种类2', value: '密钥种类2' }
]} /> ]} />
</Form.Item> </Form.Item>
<Form.Item name="keyType" label="所属网络" style={formItemSty}> <Form.Item name="web" label="所属网络" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }} placeholder={'请选择所属网络'} <Select style={{ width: 260, marginRight: 16 }}
onChange={(e) => onchange()}
placeholder={'请选择所属网络'}
allowClear
options={[ options={[
{ label: '离线', value: '离线' }, { label: '离线', value: '离线' },
{ label: '指挥专网', value: '指挥专网' }, { label: '指挥专网', value: '指挥专网' },
@ -145,11 +245,11 @@ export default function Page() {
{ label: '资源管理网', value: '资源管理网' } { label: '资源管理网', value: '资源管理网' }
]} /> ]} />
</Form.Item> </Form.Item>
<Form.Item name="keyType" label="启用日期" style={formItemSty} rules={[{ required: true, message: '请选择启用日期' }]}> <Form.Item name="activeDate" label="启用日期" style={formItemSty} rules={[{ required: true, message: '请选择启用日期' }]}>
<DatePicker <DatePicker
style={{ width: 260 }} style={{ width: 260 }}
disabledDate={disabledDate} disabledDate={disabledDate}
format="YYYY-MM-DD HH:mm" /> format="YYYY-MM-DD" />
</Form.Item> </Form.Item>
</Form> </Form>
@ -162,16 +262,23 @@ export default function Page() {
dataSource={tableData1} dataSource={tableData1}
rowKey={(record: any) => record?.id} rowKey={(record: any) => record?.id}
rowClassName={rowClassName} rowClassName={rowClassName}
rowSelection={tableData1.length > 0 ? {
type: 'radio',
selectedRowKeys1,
onChange: (selectedKeys: any) => {
setSelectedRowKeys1(selectedKeys);
}
} : null}
/> />
<div className='flex_jE mt20'> <div className='flex_jE mt20'>
<ButtonComp text={'装配'} onClick={() => setVisibility(true)} /> <ButtonComp text={'装配'} onClick={() => onRules()} />
</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 * 10 } : {}}
pagination={false} pagination={false}
bordered bordered
columns={columns1} columns={columns1}
@ -201,7 +308,14 @@ export default function Page() {
<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={() => {
if (selectedRowKeys.length == 0) {
message.info('请在管理密钥装配列表中选择一条数据!');
return
}
onFinish()
message.success('载体输出成功!')
}} />
<ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} /> <ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} />
</div> </div>
@ -209,21 +323,22 @@ export default function Page() {
title="xx部一体化对称密码管理系统" title="xx部一体化对称密码管理系统"
open={visibility} open={visibility}
centered centered
width={500} width={450}
onCancel={() => setVisibility(false)} onCancel={() => setVisibility(false)}
footer={null}> footer={null}
maskClosable={false}>
<div> <div>
<div className='mb20'> {selectedData && <div className='mb20'>
1 <div className='mb10' style={{ fontWeight: 'bold' }}>:</div>
<div className='ml20'>:</div> <div className='ml30'>{selectedData?.productName} ,</div>
<div className='ml20'> ZY310</div> <div className='ml30 mt10 mb10'>{selectedData?.productNum} ,</div>
<div className='ml20'> 8151</div> <div className='ml30'>{form.getFieldValue('activeDate') && form.getFieldValue('activeDate').format('YYYY-MM-DD')}</div>
<div className='ml20'> 20231011</div> </div>}
</div> {/* <div>类型判断2 没有需要装配管理密钥的密码设备!</div> */}
<div>2 </div>
</div> </div>
<div className='flex_jE mt20'> <div className='flex_jE mt20'>
<ButtonComp text={'确定'} onClick={() => { }} /> <ButtonComp text={'确定'} style={{ marginRight: 20 }} onClick={() => submit()} />
<ButtonComp type='cancel' text={'取消'} onClick={() => setVisibility(false)} />
</div> </div>
</Modal> </Modal>
</div> </div>

@ -1,12 +1,43 @@
import styles from '../../../GLQ/index.less'; import styles from '../../../GLQ/index.less';
import { useState } from 'react'; import { useEffect, useState } from 'react';
import { ConfigProvider, Select, Table } from 'antd'; import { ConfigProvider, Select, Table, message } from 'antd';
import { rowClassName } from '@/utils'; import { rowClassName } from '@/utils';
import ButtonComp from '@/components/ButtonComp'; import ButtonComp from '@/components/ButtonComp';
import { secretList } from '@/services/my';
export default function Page() { export default function Page() {
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [selectedData, setSelectedData] = useState([]);
const [proxy, setProxy] = useState('全部');
const [keyType, setKeyType] = useState(null);
useEffect(() => {
getList()
}, [])
const getList = () => {
secretList({ pageNumber: 1, pageSize: 10 }).then((res) => {
if (res?.result == "success") {
let show = true;
let pmcs;
res.data[0].list.forEach((e: any) => {
if (e?.content == 'PMCS') {
pmcs = { ...e, label: e.keyType, value: e.keyType }
}
if (!['PMCS', 'vpn', 'ythglmy'].includes(e?.content) && e?.assemblySituation == '未装配') {
show = false
}
});
if (show) { setSelectedData([pmcs]) }
} else {
message.error(res?.errorMsg);
}
})
}
const columns: any = [ const columns: any = [
{ {
@ -15,14 +46,14 @@ 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: 'managerModelId', key: 'managerModelId', align: 'center' },
{ title: '310标识', dataIndex: 'name', key: 'name', align: 'center' }, { title: '310标识', dataIndex: 'deviceMarkId', key: 'deviceMarkId', 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: 'installMethod', key: 'installMethod', 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: 'managementFlag', key: 'managementFlag', align: 'center' },
{ title: '是否下载到邮箱', dataIndex: 'name', key: 'name', align: 'center' } { title: '是否下载到邮箱', dataIndex: 'name', key: 'name', align: 'center' }
] ]
@ -32,15 +63,29 @@ export default function Page() {
<div className='flex_aiC mt20 mb20'> <div className='flex_aiC mt20 mb20'>
<div className='mr16'></div> <div className='mr16'></div>
<Select style={{ width: 260, marginRight: 20 }} onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} /> <Select
style={{ width: 260, marginRight: 30 }}
placeholder={'请选择密钥类型'}
value={keyType}
onChange={(e, option) => {
setKeyType(e);
setTableData([option])
}}
options={selectedData} />
<div className='mr16'></div> <div className='mr16'></div>
<Select style={{ width: 260 }} onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} /> <Select
style={{ width: 260 }}
placeholder={'请选择管理代理'}
value={proxy}
onChange={(e) => setProxy(e)}
options={[
{ label: '全部', value: '全部' },
{ label: '无代理', value: '无代理' }
]} />
</div> </div>
<div className='mt30 mb30'></div> <div className='mb10'></div>
<div className='mb10'></div>
<Table <Table
scroll={tableData.length > 0 ? { y: 41 * 8 } : {}} scroll={tableData.length > 0 ? { y: 41 * 8 } : {}}
pagination={false} pagination={false}
@ -49,10 +94,24 @@ 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}
/> />
<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={() => {
if (selectedRowKeys.length == 0) {
message.info('请在管理密钥装配列表中选择一条数据!');
return
}
getList()
message.success('载体输出成功!')
}} />
<ButtonComp type='cancel' style={{ marginRight: 20 }} text={'载体输出'} onClick={() => { }} /> <ButtonComp type='cancel' style={{ marginRight: 20 }} text={'载体输出'} onClick={() => { }} />
<ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} /> <ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} />
</div> </div>

@ -1,95 +1,354 @@
import styles from '../../../GLQ/index.less'; import styles from '../../../GLQ/index.less';
import { useState } from 'react'; import { useEffect, useState } from 'react';
import { ConfigProvider, DatePicker, 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 { secretKey, secretList } from '@/services/my';
import { managerSysDataList } from '@/services/register';
import { sysTypeStr } from '@/utils/sysType';
export default function Page() { export default function Page() {
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [tableData1, setTableData1] = useState<any>([]);
const [visibility, setVisibility] = useState(false);
const [form] = Form.useForm();
const [pageNumber, setPageNumber] = useState(1);
const [pageSize, setpageSize] = useState(10);
const [total, setTotal] = useState();
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [selectedRowKeys1, setSelectedRowKeys1] = useState([]);
const [selectedData, setSelectedData] = useState();
useEffect(() => {
initForm()
}, [])
const columns: any = [ const columns: any = [
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' }, {
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' }, title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center',
{ title: '装配情况', dataIndex: 'name', key: 'name', align: 'center' } render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '装配情况', dataIndex: 'assemblySituation', key: 'assemblySituation', align: 'center', render: (text: any) => { return <span>{text || '--'}</span> },
}
] ]
const columns1: any = [ const columns1: any = [
{ {
title: '序号', key: 'index', align: 'center', width: 80, title: '序号', key: 'index', align: 'center', width: 80,
render: (a: any, b: any, c: any) => { render: (a: any, b: any, c: any) => { return <span>{c + 1}</span> },
return <span>{c + 1}</span>; }, {
}, title: '设备名称', dataIndex: 'deviceName', key: 'deviceName', align: 'center',
}, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '设备名称', dataIndex: 'name', key: 'name', align: 'center' }, }, {
{ title: '管理实体标识', dataIndex: 'name', key: 'name', align: 'center' }, title: '管理实体标识', dataIndex: 'managerModelId', key: 'managerModelId', align: 'center',
{ title: '310标识', dataIndex: 'name', key: 'name', align: 'center' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center' }, }, {
{ title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center' }, title: '310标识', dataIndex: 'deviceMarkId', key: 'deviceMarkId', align: 'center',
{ title: '安装方式', dataIndex: 'name', key: 'name', align: 'center' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '分发状态', dataIndex: 'name', key: 'name', align: 'center' }, }, {
{ title: '启用日期', dataIndex: 'name', key: 'name', align: 'center' }, title: '产品名称', dataIndex: 'productName', key: 'productName', align: 'center',
{ title: '终止日期', dataIndex: 'name', key: 'name', align: 'center' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '密钥套号', dataIndex: 'name', key: 'name', align: 'center' }, }, {
{ title: '载体类型', dataIndex: 'carrierType', key: 'carrierType', align: 'center' }, title: '产品编号', dataIndex: 'productNum', key: 'productNum', align: 'center',
{ title: '输出日期', dataIndex: 'name', key: 'name', align: 'center' }, render: (text: any) => { return <span>{text || '--'}</span> },
{ title: '协同管理标志', dataIndex: 'name', key: 'name', align: 'center' } }, {
title: '安装方式', dataIndex: 'installMethod', key: 'installMethod', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '分发状态', dataIndex: 'distType', key: 'distType', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '启用日期', dataIndex: 'activeDate', key: 'activeDate', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '终止日期', dataIndex: 'endDate', key: 'endDate', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '密钥套号', dataIndex: 'setNumber', key: 'setNumber', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '载体类型', dataIndex: 'carrierType', key: 'carrierType', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '输出日期', dataIndex: 'name', key: 'name', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}, {
title: '协同管理标志', dataIndex: 'managementFlag', key: 'managementFlag', align: 'center',
render: (text: any) => { return <span>{text || '--'}</span> },
}
] ]
return ( const formItemSty = { width: 'auto', marginBottom: 20, marginRight: 30 };
<div className={`${styles.params_warp}`}>
<ButtonComp type={'special'} text={'用户密钥装配'} onClick={() => { }} />
<div className='flex_aiC mt20 mb20'> const initForm = () => {
<div className='mr16'></div> form.setFieldsValue({
<Select style={{ width: 260, marginRight: 20 }} placeholder="请选择密钥类型" onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} /> keyType: null,
web: null,
activeDate: null,
endDate: null
})
}
<div className='mr16'></div> const onFinish = () => {
<Select style={{ width: 260, marginRight: 20 }} placeholder="请选择所属网络" onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} /> pageNumber == 1 ? getList() : setPageNumber(1);
};
<div className='mr16'></div> useEffect(() => {
<DatePicker style={{ width: 260, marginRight: 20 }} /> getList();
</div> setSelectedRowKeys([])
}, [pageNumber]);
<div className='flex_aiC mt20 mb20'> // 获取密钥体列表
<div className='mr16'></div> const getList = () => {
<DatePicker style={{ width: 260, marginRight: 20 }} /> secretList({ pageNumber, pageSize }).then((res) => {
if (res?.result == "success") {
res.data[0].list = res.data[0].list.filter((val: any) => {
return (['PT5',].includes(val?.content))
})
setTotal(res.data[0].list.length)
setTableData(res.data[0].list)
<div className='mr16'></div> let arr: any = []
<Select style={{ width: 260 }} placeholder="请选择应用系统" onChange={(e) => { }} options={[{ label: '选项1', value: 1 }]} /> arr = res.data[0].list.filter((val: any) => {
</div> return val?.assemblySituation == '未装配'
})
setTableData1([...arr])
} else {
message.error(res?.errorMsg);
}
})
}
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');
};
// 校验是否少了步骤
const onRules = async () => {
// 校验管理系统管理盘数据维护列表是否有数据
let stop = false
await managerSysDataList({ pageNumber: 1, pageSize: 10 }).then((res) => {
if (res?.result == "success") {
if (res.data[0].length == 0) { stop = true }
} else {
message.error(res?.errorMsg);
}
})
if (stop) {
message.info('请先完成管理系统管理盘数据维护--数据导入!')
return
}
if (selectedRowKeys.length == 0) {
message.info('请选择一条可装配的密钥体!')
return
}
form.validateFields().then(() => {
tableData1.forEach(e => {
if (e.id == selectedRowKeys[0]) { setSelectedData(e) }
});
setVisibility(true)
})
}
// 过滤可装配列表
const onchange = () => {
let info = form.getFieldsValue();
setSelectedRowKeys([])
let arr: any = []
arr = tableData.filter((item) => {
if (item?.assemblySituation == '已装配') return
if (info?.keyType && info?.web) {
return (item?.keyType == info?.keyType && item?.web == info?.web)
} else if (info?.keyType) {
return item?.keyType == info?.keyType
} else if (info?.web) {
return item?.web == info?.web
}
})
setTableData1([...arr])
}
// 提交装配
const submit = () => {
const searchParams = new URLSearchParams(location.search);
const sysType = searchParams.get('sysType');
let info = form.getFieldsValue();
const formData = new FormData();
formData.append('activeDate', info.activeDate.format('YYYY-MM-DD'));
formData.append('endDate', moment().format('YYYY-MM-DD'));
formData.append('secretImportId', selectedRowKeys[0]);
formData.append('sysType', sysTypeStr[sysType]);
formData.append('type', '2');
secretKey(formData).then((res) => {
if (res?.result == "success") {
initForm()
onFinish()
setSelectedRowKeys([])
message.success('装配成功!')
setVisibility(false)
} else {
message.error(res?.errorMsg);
}
})
}
return (
<div className={`${styles.params_warp}`}>
<ButtonComp type={'special'} text={'用户密钥装配'} onClick={() => { }} />
<Form form={form} layout={'inline'} onFinish={onFinish} className='mt20'>
<Form.Item name="keyType" label="密钥类型" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }}
onChange={(e) => onchange()}
placeholder={'请选择密钥类型'}
allowClear
options={[
{ label: '密钥种类1', value: '密钥种类1' },
{ label: '密钥种类2', value: '密钥种类2' }
]} />
</Form.Item>
<Form.Item name="web" label="所属网络" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }}
onChange={(e) => onchange()}
placeholder={'请选择所属网络'}
allowClear
options={[
{ label: '离线', value: '离线' },
{ label: '指挥专网', value: '指挥专网' },
{ label: '军事综合信息网', value: '军事综合信息网' },
{ label: '资源管理网', value: '资源管理网' }
]} />
</Form.Item>
<Form.Item name="activeDate" label="启用日期" style={formItemSty} rules={[{ required: true, message: '请选择启用日期' }]}>
<DatePicker
style={{ width: 260 }}
disabledDate={disabledDate}
format="YYYY-MM-DD" />
</Form.Item>
<Form.Item name="endDate" label="终止日期" style={formItemSty} rules={[{ required: true, message: '请选择启用日期' }]}>
<DatePicker
style={{ width: 260 }}
disabledDate={disabledDate}
format="YYYY-MM-DD" />
</Form.Item>
<Form.Item name="system" label="应用系统" style={formItemSty}>
<Select style={{ width: 260, marginRight: 16 }}
onChange={(e) => onchange()}
placeholder={'请选择应用系统'}
allowClear
options={[
{ label: '全部', value: '全部' }
]} />
</Form.Item>
</Form>
<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}
rowSelection={tableData1.length > 0 ? {
type: 'radio',
selectedRowKeys1,
onChange: (selectedKeys: any) => {
setSelectedRowKeys1(selectedKeys);
}
} : null}
/> />
<div className='flex_jE mt20'> <div className='flex_jE mt20'>
<ButtonComp text={'装配'} onClick={() => { }} /> <ButtonComp text={'装配'} onClick={() => onRules()} />
</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 * 10 } : {}}
pagination={false} pagination={false}
bordered bordered
columns={columns1} columns={columns1}
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={() => {
if (selectedRowKeys.length == 0) {
message.info('请在用户密钥装配列表中选择一条数据!');
return
}
onFinish()
message.success('载体输出成功!')
}} />
<ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} /> <ButtonComp type='cancel' text={'下载到邮箱'} onClick={() => { }} />
</div> </div>
<Modal
title="xx部一体化对称密码管理系统"
open={visibility}
centered
width={450}
onCancel={() => setVisibility(false)}
footer={null}
maskClosable={false}>
<div>
{selectedData && <div className='mb20'>
<div className='mb10' style={{ fontWeight: 'bold' }}>:</div>
<div className='ml30'>{selectedData?.productName} ,</div>
<div className='ml30 mt10 mb10'>{selectedData?.productNum} ,</div>
<div className='ml30 mb10'>{form.getFieldValue('activeDate') && form.getFieldValue('activeDate').format('YYYY-MM-DD')}</div>
<div className='ml30'>{form.getFieldValue('endDate') && form.getFieldValue('endDate').format('YYYY-MM-DD')}</div>
</div>}
{/* <div>类型判断2 没有需要装配管理密钥的密码设备!</div> */}
</div>
<div className='flex_jE mt20'>
<ButtonComp text={'确定'} style={{ marginRight: 20 }} onClick={() => submit()} />
<ButtonComp type='cancel' text={'取消'} onClick={() => setVisibility(false)} />
</div>
</Modal>
</div> </div>
); );
} }

@ -1,5 +1,4 @@
import ButtonComp from "@/components/ButtonComp"; import ButtonComp from "@/components/ButtonComp";
import { diskDataImport, secretFormatList } from "@/services/register";
import { rowClassName } from "@/utils"; import { rowClassName } from "@/utils";
import { Modal, Table, Upload, UploadProps, message } from "antd"; import { Modal, Table, Upload, UploadProps, message } from "antd";
import { FC, useEffect, useState } from "react"; import { FC, useEffect, useState } from "react";
@ -49,7 +48,8 @@ const SelectDiskDialog: FC<PageProps> = ({ visibility = false, onCancel, onOk})
centered centered
width={900} width={900}
onCancel={() => onCancel()} onCancel={() => onCancel()}
footer={null}> footer={null}
maskClosable={false}>
<div className="flex_aiC_jB"> <div className="flex_aiC_jB">
<div>310</div> <div>310</div>
<Upload {...props} showUploadList={false}> <Upload {...props} showUploadList={false}>

@ -82,3 +82,8 @@ export async function keyBodyCarrierEncrypted(data: any) {
export async function secretInstallSearch(params: any) { export async function secretInstallSearch(params: any) {
return getRequest(`/xgd/secretInstall/search`, params); return getRequest(`/xgd/secretInstall/search`, params);
} }
// 管理密钥装配 -- 装配
export async function secretKey(formData: any) {
return uploadFile(`/xgd/secretInstall/secretInstall`, formData);
}

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

@ -1,4 +1,5 @@
export const countType = { export const countType = {
'offLine': '核心区',
'hx1': '核心区一', 'hx1': '核心区一',
'hx2': '核心区二', 'hx2': '核心区二',
'zq1': '执勤区一', 'zq1': '执勤区一',
@ -6,6 +7,7 @@ export const countType = {
} }
export const fileStr = { export const fileStr = {
'offLine': 'offLine',
'hx1': 'hx', 'hx1': 'hx',
'hx2': 'hx', 'hx2': 'hx',
'zq1': 'zq', 'zq1': 'zq',

Loading…
Cancel
Save