parent
8b9c4d08d7
commit
0912e03f6d
@ -0,0 +1,57 @@
|
||||
.head {
|
||||
height: 60px;
|
||||
background: #001628;
|
||||
|
||||
> section {
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
font-size: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
width: 1200px;
|
||||
|
||||
> span {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
line-height: 18px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
> ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
margin-left: 100px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #28b1ff;
|
||||
position: relative;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
b {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -9px;
|
||||
width: 40px;
|
||||
height: 2px;
|
||||
background: #28b1ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
height: calc(100vh - 60px);
|
||||
background-color: #fafafa;
|
||||
overflow: auto;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 20px;
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
margin-top: 30px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,182 @@
|
||||
import styles from './index.less';
|
||||
import { Input, Button, Row, Form, Select, message } from 'antd';
|
||||
import { FC } from 'react';
|
||||
import { connect, Dispatch, BasicInfoModelState } from 'umi';
|
||||
import Fetch from '@/utils/fetch';
|
||||
|
||||
interface PageProps {
|
||||
basic: BasicInfoModelState;
|
||||
dispatch: Dispatch;
|
||||
}
|
||||
|
||||
const Page: FC<PageProps> = ({ basic, dispatch }) => {
|
||||
const [form] = Form.useForm();
|
||||
const { certificateInfo } = basic;
|
||||
const { step } = certificateInfo;
|
||||
|
||||
console.log(certificateInfo, 'certificateInfo');
|
||||
|
||||
const handleValuesChange = (v: any) => {
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: v,
|
||||
});
|
||||
};
|
||||
|
||||
const testLink = async () => {
|
||||
const res = await Fetch('/openi/resource/dbTestConnection', {
|
||||
method: 'post',
|
||||
data: {
|
||||
dbType: certificateInfo.dbType,
|
||||
dbDrive: certificateInfo.dbDrive,
|
||||
dbIp: certificateInfo.dbIp,
|
||||
dbPort: certificateInfo.dbPort,
|
||||
dbName: certificateInfo.dbName,
|
||||
dbUser: certificateInfo.dbUser,
|
||||
dbPasswd: certificateInfo.dbPasswd,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: {
|
||||
dbIsConn: data?.isConn,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
message.error(res.errorMsg);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{ display: step === 1 ? 'block' : 'none' }}
|
||||
className={styles.page}
|
||||
>
|
||||
<div className={styles.name}>
|
||||
<b /> <span>数据库配置</span>
|
||||
</div>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 5 }}
|
||||
size="large"
|
||||
wrapperCol={{ span: 14 }}
|
||||
onValuesChange={handleValuesChange}
|
||||
onFinish={() => {
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: { step: 2 },
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Form.Item
|
||||
label="数据库类型"
|
||||
name="dbType"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库类型`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
<Select.Option key={'ORACEL'}>ORACEL</Select.Option>
|
||||
<Select.Option key={'SQL'}>SQL</Select.Option>
|
||||
<Select.Option key={'SERVER'}>SERVER</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="数据库驱动"
|
||||
name="dbDrive"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库驱动`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="IP地址"
|
||||
name="dbIp"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入IP地址`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="端口号"
|
||||
name="dbPort"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入端口号`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="数据库名"
|
||||
name="dbName"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库名`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="数据库用户名"
|
||||
name="dbUser"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库用户名`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="数据库密码"
|
||||
name="dbPasswd"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库密码`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.Password autoComplete="new-password" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Row justify="end">
|
||||
<Button onClick={testLink} type="primary">
|
||||
测试链接
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={() => form.submit()}
|
||||
className="ml20"
|
||||
>
|
||||
下一步
|
||||
</Button>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
||||
@ -0,0 +1,51 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 20px;
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
margin-top: 30px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 60px;
|
||||
margin-bottom: 30px;
|
||||
|
||||
b {
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,169 @@
|
||||
import styles from './index.less';
|
||||
import { Input, Button, Row, Form } from 'antd';
|
||||
import { FC } from 'react';
|
||||
import { connect, Dispatch, BasicInfoModelState } from 'umi';
|
||||
|
||||
interface PageProps {
|
||||
basic: BasicInfoModelState;
|
||||
dispatch: Dispatch;
|
||||
}
|
||||
|
||||
const Page: FC<PageProps> = ({ basic, dispatch }) => {
|
||||
const [form] = Form.useForm();
|
||||
const { certificateInfo } = basic;
|
||||
const { step } = certificateInfo;
|
||||
|
||||
console.log(certificateInfo, 'certificateInfo');
|
||||
|
||||
const handleValuesChange = (v: any) => {
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: v,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{ display: step === 2 ? 'block' : 'none' }}
|
||||
className={styles.page}
|
||||
>
|
||||
<div className={styles.name}>
|
||||
<b /> <span>发布配置</span>
|
||||
</div>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 5 }}
|
||||
size="large"
|
||||
wrapperCol={{ span: 14 }}
|
||||
onValuesChange={handleValuesChange}
|
||||
onFinish={() => {
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: { step: 3 },
|
||||
});
|
||||
}}
|
||||
>
|
||||
<div className={styles.title}>
|
||||
<b /> <span>数据库配置</span>
|
||||
</div>
|
||||
<Form.Item
|
||||
label="服务器地址"
|
||||
name="targetIp"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入服务器地址`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="服务器端口"
|
||||
name="targetPort"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入服务器端口`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="用户DN"
|
||||
name="targetUserdn"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入用户DN`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="用户口令"
|
||||
name="targetPasswd"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入用户口令`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.Password autoComplete="new-password" />
|
||||
</Form.Item>
|
||||
<div className={styles.title}>
|
||||
<b /> <span>用户证书发布配置</span>
|
||||
</div>
|
||||
<Form.Item
|
||||
label="文件路径"
|
||||
name="certUrl"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入文件路径`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<div className={styles.title}>
|
||||
<b /> <span>CRL发布配置</span>
|
||||
</div>
|
||||
<Form.Item
|
||||
label="CRL发布点中的证书数量"
|
||||
name="certNum"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入CRL发布点中的证书数量`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="CRL发布周期"
|
||||
name="certCycle"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入CRL发布周期`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Row justify="end">
|
||||
<Button
|
||||
onClick={() => {
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: { step: 1 },
|
||||
});
|
||||
}}
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
上一步
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={() => form.submit()}
|
||||
className="ml20"
|
||||
>
|
||||
下一步
|
||||
</Button>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
||||
@ -0,0 +1,48 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 20px;
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
margin-top: 30px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30px 0;
|
||||
|
||||
sup {
|
||||
color: red;
|
||||
margin-top: 13px;
|
||||
margin-right: 4px;
|
||||
font-size: 14px;
|
||||
}
|
||||
button {
|
||||
margin-left: 30px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 20px;
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
margin-top: 30px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 60px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
b {
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15px 0;
|
||||
|
||||
span {
|
||||
margin: 0 10px;
|
||||
width: 50%;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
span:first-child {
|
||||
text-align: right;
|
||||
color: #464f66;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
import styles from './index.less';
|
||||
import { Button, Row, message } from 'antd';
|
||||
import { FC } from 'react';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { connect, Dispatch, BasicInfoModelState, history } from 'umi';
|
||||
|
||||
interface PageProps {
|
||||
basic: BasicInfoModelState;
|
||||
dispatch: Dispatch;
|
||||
}
|
||||
|
||||
const Page: FC<PageProps> = ({ basic, dispatch }) => {
|
||||
const { certificateInfo } = basic;
|
||||
const { step, result } = certificateInfo;
|
||||
|
||||
const handleClick = async () => {
|
||||
const res = await Fetch('/openi/resource/openCertNow', {
|
||||
method: 'post',
|
||||
data: certificateInfo,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
message.success('开通证书系统成功');
|
||||
history.replace('/basic/login');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{ display: step === 4 ? 'block' : 'none' }}
|
||||
className={styles.page}
|
||||
>
|
||||
<div className={styles.name}>
|
||||
<b /> <span>发布配置</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.title}>
|
||||
<b /> <span>ECCDSA359颁发机构信息</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>颁发证书主题</span>
|
||||
<span>{result?.[0]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>证书序列号</span>
|
||||
<span>{result?.[1]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>证书主题</span>
|
||||
<span>{result?.[2]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>起始时间</span>
|
||||
<span>{result?.[3]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>结束时间</span>
|
||||
<span>{result?.[4]}</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.title}>
|
||||
<b /> <span>ECCDSA281颁发机构信息</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>颁发证书主题</span>
|
||||
<span>{result?.[5]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>证书序列号</span>
|
||||
<span>{result?.[6]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>证书主题</span>
|
||||
<span>{result?.[7]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>起始时间</span>
|
||||
<span>{result?.[8]}</span>
|
||||
</div>
|
||||
<div className={styles.row}>
|
||||
<span>结束时间</span>
|
||||
<span>{result?.[9]}</span>
|
||||
</div>
|
||||
|
||||
<Row justify="end">
|
||||
<Button
|
||||
onClick={() => {
|
||||
dispatch({
|
||||
type: 'basic/setCertificateInfo',
|
||||
payload: { step: 3 },
|
||||
});
|
||||
}}
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
上一步
|
||||
</Button>
|
||||
<Button type="primary" ghost className="ml20" onClick={handleClick}>
|
||||
确认
|
||||
</Button>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
||||
@ -0,0 +1,4 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
margin-top: 20px;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
import styles from './index.less';
|
||||
import { FC } from 'react';
|
||||
import Step1 from './Step1';
|
||||
import Step2 from './Step2';
|
||||
import Step3 from './Step3';
|
||||
import Step4 from './Step4';
|
||||
|
||||
const Page: FC<{}> = () => {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<Step1 />
|
||||
<Step2 />
|
||||
<Step3 />
|
||||
<Step4 />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Page;
|
||||
@ -0,0 +1,51 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
padding: 40px 118px;
|
||||
|
||||
sup {
|
||||
color: red;
|
||||
margin-top: 10px;
|
||||
margin-right: 4px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #464f66;
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
margin-bottom: 30px;
|
||||
|
||||
span {
|
||||
color: #e30000;
|
||||
}
|
||||
}
|
||||
|
||||
.box3 {
|
||||
border-top: 1px solid #e3e4e6;
|
||||
border-bottom: 1px solid #e3e4e6;
|
||||
margin-top: 20px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,167 @@
|
||||
.page {
|
||||
width: 1200px;
|
||||
margin: 22px auto;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
width: 146px;
|
||||
height: 334px;
|
||||
background: #ffffff;
|
||||
border-radius: 4px;
|
||||
padding-top: 18px;
|
||||
|
||||
> div {
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
i {
|
||||
padding-right: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 1034px;
|
||||
border-radius: 4px;
|
||||
|
||||
.info {
|
||||
background: #ffffff;
|
||||
border-radius: 4px;
|
||||
|
||||
.name {
|
||||
width: 250px;
|
||||
height: 36px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
background: #eef2f8;
|
||||
line-height: 48px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #165dff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
background: #eef2f8;
|
||||
height: 154px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
> aside {
|
||||
width: 994px;
|
||||
height: 124px;
|
||||
background: #ffffff;
|
||||
|
||||
> div:first-child {
|
||||
height: 36px;
|
||||
background: #98bdf7;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
display: flex;
|
||||
|
||||
> div {
|
||||
width: 50%;
|
||||
padding: 16px;
|
||||
color: #464f66;
|
||||
|
||||
span:first-child {
|
||||
color: #9096a3;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
> div:first-child {
|
||||
border-right: 1px solid #e3effc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-top: 10px;
|
||||
|
||||
.head {
|
||||
height: 72px;
|
||||
background: #ffffff;
|
||||
border-radius: 4px 4px 0 0;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
div {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
border-radius: 0 0 4px 4px;
|
||||
padding: 0 20px;
|
||||
|
||||
> aside {
|
||||
height: 124px;
|
||||
background: #ffffff;
|
||||
|
||||
> div:first-child {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #232b40;
|
||||
padding: 0 20px;
|
||||
|
||||
div {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
display: flex;
|
||||
|
||||
i {
|
||||
font-size: 34px;
|
||||
color: #a0a4f7;
|
||||
padding: 16px 50px 16px 16px;
|
||||
}
|
||||
|
||||
> div {
|
||||
padding: 16px 80px 16px 16px;
|
||||
color: #464f66;
|
||||
|
||||
span:first-child {
|
||||
color: #9096a3;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,233 @@
|
||||
import styles from './index.less';
|
||||
import { Select, Input, Button, Row, Modal, Form, message, Empty } from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC } from 'react';
|
||||
|
||||
import {
|
||||
connect,
|
||||
ConnectProps,
|
||||
Dispatch,
|
||||
BasicInfoModelState,
|
||||
history,
|
||||
} from 'umi';
|
||||
import { downLoadLink } from '@/utils/download';
|
||||
import url from '@/utils/url';
|
||||
|
||||
interface PageProps extends ConnectProps {
|
||||
basic: BasicInfoModelState;
|
||||
dispatch: Dispatch;
|
||||
match: any;
|
||||
}
|
||||
|
||||
const Page: FC<PageProps> = ({ basic, dispatch }) => {
|
||||
const [facilityList, setFacilityList] = useState<any[]>([{}]);
|
||||
const [visible, setVisible] = useState<boolean>(false);
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, []);
|
||||
|
||||
const getData = async () => {
|
||||
const res = await Fetch('/openi/resource/getResourceStatus');
|
||||
if (res.result === 'success') {
|
||||
dispatch({
|
||||
type: 'basic/setActionData',
|
||||
payload: {
|
||||
resource: res?.data?.[0]?.resource ? '已开通' : '未开通',
|
||||
cert: res?.data?.[0]?.cert ? '已开通' : '未开通',
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const open = async () => {
|
||||
const res = await Fetch.post('/openi/resource/clickOpenResource');
|
||||
if (res.result === 'success') {
|
||||
form.setFieldsValue({ dbUser, dbPasswd, dbServerIp });
|
||||
setVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
const certificateOpen = async () => {
|
||||
if (!company) {
|
||||
message.warn('选择单位不能为空');
|
||||
return;
|
||||
}
|
||||
if (!certSign) {
|
||||
message.warn('请先下载证书');
|
||||
return;
|
||||
}
|
||||
const res = await Fetch.post('/openi/resource/openCertSystem');
|
||||
if (res.result === 'success') {
|
||||
history.replace('/basic/certificate');
|
||||
}
|
||||
};
|
||||
|
||||
const handleFinish = (v: any) => {
|
||||
const { dbUser, dbPasswd, dbServerIp } = v;
|
||||
dispatch({
|
||||
type: 'basic/setActionData',
|
||||
payload: { dbUser, dbPasswd, dbServerIp },
|
||||
});
|
||||
setVisible(false);
|
||||
history.replace('/basic/device');
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.left}>
|
||||
<div>
|
||||
<i className="iconfont icon-shuju" />
|
||||
数据中心
|
||||
</div>
|
||||
<div>
|
||||
<i className="iconfont icon-jiedian" />
|
||||
管理节点
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.right}>
|
||||
<div className={styles.info}>
|
||||
<div className={styles.name}>设备管理</div>
|
||||
<div className={styles.wrap}>
|
||||
<aside>
|
||||
<div>数据中心基本信息</div>
|
||||
<div className={styles.li}>
|
||||
<div>
|
||||
<p>
|
||||
<span>数据中心编号</span>
|
||||
<span>22</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>数据中心名称</span>
|
||||
<span>未定义数据中心名称</span>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<span>所属单位</span>
|
||||
<span>未定义所属单位</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>管理设备编号</span>
|
||||
<span>NO.88888888888</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.list}>
|
||||
<div className={styles.head}>
|
||||
<div>数据中心设备列表</div>
|
||||
<Button type="primary" ghost>
|
||||
新增数据中心服务器
|
||||
</Button>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
{!facilityList.length && <Empty style={{ margin: '20px 0' }} />}
|
||||
{!!facilityList.length &&
|
||||
facilityList.map((e: any, i: number) => {
|
||||
return (
|
||||
<aside key={i}>
|
||||
<div>
|
||||
<span>XXXX数据中心服务器</span>
|
||||
<div>
|
||||
<i className="iconfont icon-mimaruanjianjiami mr5" />
|
||||
<span>收起</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.li}>
|
||||
<i className="iconfont icon-zhucedengji"></i>
|
||||
<div>
|
||||
<p>
|
||||
<span>数据中心编号</span>
|
||||
<span>22</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>数据中心名称</span>
|
||||
<span>未定义数据中心名称</span>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<span>所属单位</span>
|
||||
<span>未定义所属单位</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>管理设备编号</span>
|
||||
<span>NO.88888888888</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Modal
|
||||
centered
|
||||
title="填写用户信息"
|
||||
visible={visible}
|
||||
okText="保存"
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
form.submit();
|
||||
}}
|
||||
onCancel={() => {
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
layout="horizontal"
|
||||
onFinish={handleFinish}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="数据库用户名"
|
||||
name="dbUser"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库用户名`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="数据库密码"
|
||||
name="dbPasswd"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库密码`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.Password autoComplete="new-password" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="数据库服务器IP地址"
|
||||
name="dbServerIp"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入数据库服务器IP地址`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 30 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue