Compare commits
68 Commits
Author | SHA1 | Date |
---|---|---|
|
9103f7ea64 | 3 years ago |
|
5806392844 | 3 years ago |
|
bcee1fa9f6 | 3 years ago |
|
2dbc23d094 | 3 years ago |
|
f23648ab35 | 3 years ago |
|
550f3e8621 | 3 years ago |
|
a20f6a7ff6 | 3 years ago |
|
c8d2bdef14 | 3 years ago |
|
482e48b195 | 3 years ago |
|
2c4cf97d5b | 3 years ago |
|
870de2fe74 | 3 years ago |
|
dc1d9f9281 | 3 years ago |
|
6a31462dfc | 3 years ago |
|
7ae1438d8b | 3 years ago |
|
19a64db035 | 3 years ago |
|
a7bcf0d7d2 | 3 years ago |
|
4953dcb997 | 3 years ago |
|
4d0ebe7503 | 3 years ago |
|
795a06679e | 3 years ago |
|
3e5033d403 | 3 years ago |
|
ceca3e4ead | 3 years ago |
|
c06ef2e9dc | 3 years ago |
|
d331ae58a4 | 3 years ago |
|
df7f97406c | 3 years ago |
|
6f23ab6d50 | 3 years ago |
|
3b610c722c | 3 years ago |
|
f4ac688d50 | 3 years ago |
|
8d1b0d9696 | 3 years ago |
|
c389cb93b3 | 3 years ago |
|
41213e1077 | 3 years ago |
|
d2cb27988f | 3 years ago |
|
365bd2b29d | 3 years ago |
|
9237cdc572 | 3 years ago |
|
00f67bc7c6 | 3 years ago |
|
61fbf0383f | 3 years ago |
|
cb259fee0a | 3 years ago |
|
13e9c7438e | 3 years ago |
|
8c94ab1450 | 3 years ago |
|
2eb9bcba52 | 3 years ago |
|
cae9ef9fee | 3 years ago |
|
5af575607d | 3 years ago |
|
bb4d63cd30 | 3 years ago |
|
5aa21e77b3 | 3 years ago |
|
6ec00d1d7b | 3 years ago |
|
24e0fda473 | 3 years ago |
|
04282bcf03 | 3 years ago |
|
c717620e0a | 3 years ago |
|
008dd0f51c | 3 years ago |
|
201ad07cd0 | 3 years ago |
|
214f93d0ad | 3 years ago |
|
520eb0750b | 3 years ago |
|
a0130b493d | 3 years ago |
|
8f71dd2f76 | 3 years ago |
|
5c4c86429b | 3 years ago |
|
842a217234 | 3 years ago |
|
bb13fc02c1 | 3 years ago |
|
f049f164b4 | 3 years ago |
|
156b984599 | 3 years ago |
|
ce1b50bb36 | 3 years ago |
|
0912e03f6d | 3 years ago |
|
8b9c4d08d7 | 3 years ago |
|
2b74bdbce9 | 3 years ago |
|
eccae16d68 | 3 years ago |
|
c2ea6a3811 | 3 years ago |
|
10de1e2718 | 3 years ago |
|
1b4482ef34 | 3 years ago |
|
cd80917350 | 3 years ago |
|
97f1ee43cd | 3 years ago |
@ -0,0 +1,16 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
@ -0,0 +1,20 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/npm-debug.log*
|
||||
/yarn-error.log
|
||||
/yarn.lock
|
||||
/package-lock.json
|
||||
|
||||
# production
|
||||
/dist
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
|
||||
# umi
|
||||
/src/.umi
|
||||
/src/.umi-production
|
||||
/src/.umi-test
|
||||
/.env.local
|
@ -0,0 +1,8 @@
|
||||
**/*.md
|
||||
**/*.svg
|
||||
**/*.ejs
|
||||
**/*.html
|
||||
package.json
|
||||
.umi
|
||||
.umi-production
|
||||
.umi-test
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 80,
|
||||
"overrides": [
|
||||
{
|
||||
"files": ".prettierrc",
|
||||
"options": { "parser": "json" }
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
import { defineConfig } from 'umi';
|
||||
|
||||
let publicPath = process.env.NODE_ENV === 'development' ? '/' : '/react/build/';
|
||||
|
||||
export default defineConfig({
|
||||
publicPath,
|
||||
title: false,
|
||||
nodeModulesTransform: {
|
||||
type: 'none',
|
||||
},
|
||||
theme: {
|
||||
'@primary-color': '#165DFF',
|
||||
},
|
||||
dva: {
|
||||
hmr: true,
|
||||
// immer: true,
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
component: '@/pages/index',
|
||||
routes: [
|
||||
{
|
||||
path: '/basic',
|
||||
component: '@/pages/Basic/Header',
|
||||
routes: [
|
||||
{
|
||||
path: '/basic',
|
||||
component: '@/pages/Basic/List/Index',
|
||||
},
|
||||
{
|
||||
path: '/basic/device',
|
||||
component: '@/pages/Basic/List/Device',
|
||||
},
|
||||
{
|
||||
path: '/basic/certificate',
|
||||
component: '@/pages/Basic/List/Certificate',
|
||||
},
|
||||
{ component: '@/pages/HttpStatus/404' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/dataCenter',
|
||||
component: '@/pages/Equipment/List/DataCenter',
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
path: '/terminal',
|
||||
component: '@/pages/Equipment/List/LocalManager',
|
||||
exact: true,
|
||||
},
|
||||
{
|
||||
path: '/equipment',
|
||||
component: '@/pages/Equipment/Header',
|
||||
routes: [
|
||||
{
|
||||
path: '/equipment',
|
||||
component: '@/pages/Equipment/List/Index',
|
||||
},
|
||||
{ component: '@/pages/HttpStatus/404' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/encrypt',
|
||||
component: '@/pages/Equipment/Header',
|
||||
routes: [
|
||||
{
|
||||
path: '/encrypt',
|
||||
component: '@/pages/Encrypt/List/Index',
|
||||
},
|
||||
{ component: '@/pages/HttpStatus/404' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/manager',
|
||||
component: '@/pages/Manager/Header',
|
||||
routes: [
|
||||
{
|
||||
path: '/manager/passwordManager',
|
||||
component: '@/pages/Manager/PasswordManager',
|
||||
},
|
||||
{
|
||||
path: '/manager/basicManager',
|
||||
component: '@/pages/Manager/BasicManager',
|
||||
routes: [
|
||||
{
|
||||
path: '/manager/basicManager/register',
|
||||
component: '@/pages/Manager/BasicManager/List/Register',
|
||||
},
|
||||
{
|
||||
path: '/manager/basicManager/model',
|
||||
component: '@/pages/Manager/BasicManager/List/Model',
|
||||
},
|
||||
{
|
||||
path: '/manager/basicManager/manufacturer',
|
||||
component: '@/pages/Manager/BasicManager/List/Manufacturer',
|
||||
},
|
||||
{
|
||||
path: '/manager/basicManager/allotment',
|
||||
component: '@/pages/Manager/BasicManager/List/Allotment',
|
||||
},
|
||||
{
|
||||
path: '/manager/basicManager/demand',
|
||||
component: '@/pages/Manager/BasicManager/List/Demand',
|
||||
},
|
||||
{ component: '@/pages/HttpStatus/404' },
|
||||
],
|
||||
},
|
||||
{ component: '@/pages/HttpStatus/404' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/simulation',
|
||||
component: '@/pages/Simulation',
|
||||
exact: true,
|
||||
},
|
||||
{ component: '@/pages/HttpStatus/404' },
|
||||
],
|
||||
},
|
||||
],
|
||||
fastRefresh: {},
|
||||
});
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"cSpell.words": ["iconfont"]
|
||||
}
|
@ -1,2 +1,15 @@
|
||||
# datacenter
|
||||
# 信工大数据中心项目
|
||||
|
||||
## 开始使用
|
||||
|
||||
安装依赖,
|
||||
|
||||
```bash
|
||||
$ yarn
|
||||
```
|
||||
|
||||
启动服务,
|
||||
|
||||
```bash
|
||||
$ yarn start
|
||||
```
|
||||
|
@ -0,0 +1,42 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "umi dev",
|
||||
"build": "umi build",
|
||||
"postinstall": "umi generate tmp",
|
||||
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
|
||||
"test": "umi-test",
|
||||
"test:coverage": "umi-test --coverage"
|
||||
},
|
||||
"gitHooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,less,md,json}": [
|
||||
"prettier --write"
|
||||
],
|
||||
"*.ts?(x)": [
|
||||
"prettier --parser=typescript --write"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/pro-layout": "^6.5.0",
|
||||
"echarts": "^5.3.3",
|
||||
"echarts-for-react": "^3.0.2",
|
||||
"react": "17.x",
|
||||
"react-dom": "17.x",
|
||||
"umi": "^3.5.32",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.14.182",
|
||||
"@types/react": "^17.0.0",
|
||||
"@types/react-dom": "^17.0.0",
|
||||
"@umijs/preset-react": "1.x",
|
||||
"@umijs/test": "^3.5.32",
|
||||
"lint-staged": "^10.0.7",
|
||||
"prettier": "^2.2.0",
|
||||
"typescript": "^4.1.2",
|
||||
"yorkie": "^2.0.0"
|
||||
}
|
||||
}
|
Binary file not shown.
@ -0,0 +1,24 @@
|
||||
.nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 1200px;
|
||||
margin: auto;
|
||||
padding-bottom: 20px;
|
||||
|
||||
> div {
|
||||
width: 280px;
|
||||
height: 260px;
|
||||
background: #fff;
|
||||
cursor: pointer;
|
||||
|
||||
b {
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
background: #d9d9d9;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,159 @@
|
||||
import { Effect, Reducer } from 'umi';
|
||||
import { getSelectData } from '@/service/index';
|
||||
|
||||
export interface BasicInfo {
|
||||
resource: string;
|
||||
cert: string;
|
||||
dataName: string;
|
||||
dbPasswd: string;
|
||||
dbServerIp: string;
|
||||
dbUser: string;
|
||||
deviceNo: string;
|
||||
managerNode: string;
|
||||
nodeName: string;
|
||||
supportUnit: string;
|
||||
type: string;
|
||||
file1: any;
|
||||
file2: any;
|
||||
file3: any;
|
||||
file4: any;
|
||||
}
|
||||
|
||||
export interface CertificateInfo {
|
||||
step: number;
|
||||
certCycle: number;
|
||||
certNum: number;
|
||||
certUrl: string;
|
||||
company: string;
|
||||
dbDrive: string;
|
||||
dbIp: string;
|
||||
dbIsConn: boolean;
|
||||
dbName: string;
|
||||
dbPasswd: string;
|
||||
dbPort: string;
|
||||
dbType: string;
|
||||
dbUser: string;
|
||||
importCertFile1: string;
|
||||
importCertFile2: string;
|
||||
targetIp: string;
|
||||
targetPort: string;
|
||||
targetPasswd: string;
|
||||
targetUserdn: string;
|
||||
result: any;
|
||||
}
|
||||
|
||||
export interface BasicInfoModelState {
|
||||
basicInfo: BasicInfo;
|
||||
certificateInfo: CertificateInfo;
|
||||
initData: any;
|
||||
echartsData: any;
|
||||
}
|
||||
|
||||
export interface BasicModelType {
|
||||
namespace: 'basic';
|
||||
state: BasicInfoModelState;
|
||||
effects: {
|
||||
setActionData: Effect;
|
||||
setCertificateInfo: Effect;
|
||||
getSelectData: Effect;
|
||||
setEchartsData: Effect;
|
||||
};
|
||||
reducers: {
|
||||
save: Reducer<any>;
|
||||
};
|
||||
}
|
||||
|
||||
const BasicModel: BasicModelType = {
|
||||
namespace: 'basic',
|
||||
state: {
|
||||
basicInfo: {
|
||||
resource: '',
|
||||
cert: '',
|
||||
dbUser: '',
|
||||
dbPasswd: '',
|
||||
dbServerIp: '',
|
||||
type: '1',
|
||||
dataName: '',
|
||||
nodeName: '',
|
||||
deviceNo: '',
|
||||
supportUnit: '',
|
||||
managerNode: '',
|
||||
file1: null,
|
||||
file2: null,
|
||||
file3: null,
|
||||
file4: null,
|
||||
},
|
||||
certificateInfo: {
|
||||
step: 1,
|
||||
company: '',
|
||||
dbType: '',
|
||||
dbDrive: '',
|
||||
dbIp: '',
|
||||
dbPort: '',
|
||||
dbName: '',
|
||||
dbUser: '',
|
||||
dbPasswd: '',
|
||||
dbIsConn: false,
|
||||
targetIp: '',
|
||||
targetPort: '',
|
||||
targetUserdn: '',
|
||||
targetPasswd: '',
|
||||
certUrl: '',
|
||||
certNum: 0,
|
||||
certCycle: 0,
|
||||
importCertFile1: '',
|
||||
importCertFile2: '',
|
||||
result: [],
|
||||
},
|
||||
initData: [],
|
||||
echartsData: {
|
||||
resourceData: {},
|
||||
},
|
||||
},
|
||||
effects: {
|
||||
*setEchartsData({ payload }, { call, put, select }): any {
|
||||
const echartsData = yield select((state: any) => state.basic.echartsData);
|
||||
yield put({
|
||||
type: 'save',
|
||||
payload: { echartsData: { ...echartsData, resourceData: payload } },
|
||||
});
|
||||
},
|
||||
*getSelectData({ payload }, { call, put }): any {
|
||||
const response = yield call(getSelectData, payload);
|
||||
if (response?.result === 'success') {
|
||||
yield put({
|
||||
type: 'save',
|
||||
payload: { initData: response?.data?.[0] },
|
||||
});
|
||||
}
|
||||
|
||||
return response;
|
||||
},
|
||||
*setActionData({ payload }, { call, put, select }): any {
|
||||
const basicInfo = yield select((state: any) => state.basic.basicInfo);
|
||||
yield put({
|
||||
type: 'save',
|
||||
payload: { basicInfo: { ...basicInfo, ...payload } },
|
||||
});
|
||||
},
|
||||
*setCertificateInfo({ payload }, { call, put, select }): any {
|
||||
const certificateInfo = yield select(
|
||||
(state: any) => state.basic.certificateInfo,
|
||||
);
|
||||
yield put({
|
||||
type: 'save',
|
||||
payload: { certificateInfo: { ...certificateInfo, ...payload } },
|
||||
});
|
||||
},
|
||||
},
|
||||
reducers: {
|
||||
save(state, action) {
|
||||
return {
|
||||
...state,
|
||||
...action.payload,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default BasicModel;
|
@ -0,0 +1,21 @@
|
||||
.head {
|
||||
height: 60px;
|
||||
background: #001628;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
line-height: 60px;
|
||||
padding-left: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
i {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
height: calc(100vh - 60px);
|
||||
background-color: #fafafa;
|
||||
overflow: auto;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import styles from './index.less';
|
||||
import { Fragment, useEffect } from 'react';
|
||||
|
||||
const Header = ({ ...props }) => {
|
||||
return (
|
||||
<Fragment>
|
||||
<div className={styles.head}>
|
||||
<i className="iconfont icon-a-dashujushujujiegouguanxiguanxifenxigongtonglianxirenzuzhi1 mr10" />
|
||||
设施管理设备
|
||||
</div>
|
||||
<div className={styles.content}>{props.children}</div>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
export default Header;
|
@ -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,181 @@
|
||||
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';
|
||||
import { getInitData } from '@/utils/util';
|
||||
|
||||
interface PageProps {
|
||||
basic: BasicInfoModelState;
|
||||
dispatch: Dispatch;
|
||||
}
|
||||
|
||||
const Page: FC<PageProps> = ({ basic, dispatch }) => {
|
||||
const [form] = Form.useForm();
|
||||
const { certificateInfo } = basic;
|
||||
const { step } = 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>
|
||||
{getInitData('dbTypeList')?.map((e: any) => (
|
||||
<Select.Option key={e}>{e}</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,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,107 @@
|
||||
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 { step, ...data } = certificateInfo;
|
||||
const res = await Fetch('/openi/resource/openCertNow', {
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
message.success('开通证书体系成功');
|
||||
history.replace('/equipment');
|
||||
}
|
||||
};
|
||||
|
||||
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,56 @@
|
||||
.page {
|
||||
background-color: #fff;
|
||||
padding: 40px 0;
|
||||
|
||||
.wrap {
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
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,134 @@
|
||||
.login {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
.left {
|
||||
width: 480px;
|
||||
height: 400px;
|
||||
background: #fff;
|
||||
box-shadow: 0px 10px 28px 2px rgba(231, 231, 231, 0.5);
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 42px;
|
||||
margin-bottom: 52px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #165dff;
|
||||
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;
|
||||
|
||||
span {
|
||||
color: #e30000;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 240px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin-top: 52px;
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 14px;
|
||||
color: #fa6400;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
left: 0;
|
||||
bottom: -45px;
|
||||
width: 1400px;
|
||||
}
|
||||
}
|
||||
|
||||
> aside {
|
||||
width: 56px;
|
||||
height: 34px;
|
||||
color: #165dff;
|
||||
font-size: 26px;
|
||||
padding-left: 7px;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 480px;
|
||||
height: 400px;
|
||||
background: #fff;
|
||||
box-shadow: 0px 10px 28px 2px rgba(231, 231, 231, 0.5);
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 42px;
|
||||
margin-bottom: 52px;
|
||||
|
||||
b {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
background: #165dff;
|
||||
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;
|
||||
|
||||
span {
|
||||
color: #e30000;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 240px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin-top: 22px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
@ -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,136 @@
|
||||
.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: 16px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
padding: 20px 0;
|
||||
cursor: pointer;
|
||||
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 16px;
|
||||
background: @primary-color;
|
||||
margin-right: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
i {
|
||||
padding-right: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: @primary-color;
|
||||
|
||||
b {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
i {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
> aside {
|
||||
width: 994px;
|
||||
background: #ffffff;
|
||||
padding-bottom: 40px;
|
||||
|
||||
> div:nth-child(1) {
|
||||
height: 36px;
|
||||
background: #98bdf7;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #232b40;
|
||||
}
|
||||
|
||||
> div:nth-child(2),
|
||||
> div:nth-child(3),
|
||||
> div:nth-child(4) {
|
||||
display: flex;
|
||||
margin-top: 40px;
|
||||
margin-left: 40px;
|
||||
align-items: center;
|
||||
|
||||
sup {
|
||||
color: red;
|
||||
margin-top: 10px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
> span {
|
||||
font-size: 14px;
|
||||
color: #464f66;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.annotation {
|
||||
background: #eef2f8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px 20px 20px;
|
||||
|
||||
sup {
|
||||
color: red;
|
||||
margin-top: 10px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
.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;
|
||||
|
||||
.active {
|
||||
color: #28b1ff;
|
||||
|
||||
b {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
margin-left: 100px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
b {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -9px;
|
||||
width: 40px;
|
||||
height: 2px;
|
||||
background: #28b1ff;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
height: calc(100vh - 60px);
|
||||
background-color: #fafafa;
|
||||
overflow: auto;
|
||||
}
|
After Width: | Height: | Size: 394 KiB |
After Width: | Height: | Size: 392 KiB |
@ -0,0 +1,185 @@
|
||||
.page {
|
||||
height: 100vh;
|
||||
background: url('./img/bg.png') no-repeat center center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.box {
|
||||
width: 800px;
|
||||
height: 400px;
|
||||
background: #ffffff;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
width: 380px;
|
||||
height: 100%;
|
||||
background: url('./img/l.png') no-repeat center center;
|
||||
background-size: cover;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
letter-spacing: 2px;
|
||||
text-align: center;
|
||||
padding-top: 40px;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 420px;
|
||||
height: 100%;
|
||||
|
||||
.one {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
> span {
|
||||
width: 144px;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #464f66;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
div {
|
||||
color: #e30000;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-top: 32px;
|
||||
|
||||
i {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 82px;
|
||||
width: 240px;
|
||||
height: 40px;
|
||||
// background: #165dff;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
aside {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
}
|
||||
}
|
||||
|
||||
.two {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
> span {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #464f66;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
div {
|
||||
width: 340px;
|
||||
font-size: 14px;
|
||||
color: #464f66;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 340px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 20px;
|
||||
width: 340px;
|
||||
height: 40px;
|
||||
background: #165dff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
aside {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
section {
|
||||
width: 340px;
|
||||
font-size: 14px;
|
||||
color: #9096a3;
|
||||
text-align: right;
|
||||
margin-top: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.three {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
> span {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #464f66;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
div {
|
||||
width: 340px;
|
||||
font-size: 14px;
|
||||
color: #464f66;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0px;
|
||||
|
||||
input {
|
||||
width: 250px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
> button {
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
> button {
|
||||
margin-top: 20px;
|
||||
width: 340px;
|
||||
height: 40px;
|
||||
background: #165dff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
aside {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
section {
|
||||
width: 340px;
|
||||
font-size: 14px;
|
||||
color: #9096a3;
|
||||
text-align: right;
|
||||
margin-top: 36px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
.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: 16px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
padding: 20px 0;
|
||||
cursor: pointer;
|
||||
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 16px;
|
||||
background: @primary-color;
|
||||
margin-right: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
i {
|
||||
padding-right: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: @primary-color;
|
||||
|
||||
b {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
i {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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: 196px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
> button {
|
||||
margin-left: auto;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.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: 62px;
|
||||
background: #ffffff;
|
||||
border-radius: 4px 4px 0 0;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 10px;
|
||||
|
||||
div {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
overflow: hidden;
|
||||
background: #ffffff;
|
||||
border-radius: 0 0 4px 4px;
|
||||
padding: 0 20px 10px 20px;
|
||||
|
||||
> aside {
|
||||
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;
|
||||
margin-top: 10px;
|
||||
|
||||
div {
|
||||
color: @primary-color;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
transform: scale(0.7);
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
display: flex;
|
||||
border: 1px solid #ebf3ff;
|
||||
border-top: 0;
|
||||
|
||||
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,489 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
Select,
|
||||
Input,
|
||||
Button,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
message,
|
||||
Empty,
|
||||
Spin,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, useRef, Fragment } from 'react';
|
||||
|
||||
import {
|
||||
connect,
|
||||
ConnectProps,
|
||||
Dispatch,
|
||||
BasicInfoModelState,
|
||||
history,
|
||||
Link,
|
||||
} 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 [localList, setLocalList] = useState<any[]>([]);
|
||||
const [firmList, setFirmList] = useState<any[]>([]);
|
||||
const [packList, setPackList] = useState<any[]>([]);
|
||||
const [visible, setVisible] = useState<any>(false);
|
||||
const [type, setType] = useState<string>('1');
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [form] = Form.useForm();
|
||||
const editId = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
getData('1');
|
||||
getData('2');
|
||||
getFirmList();
|
||||
}, []);
|
||||
|
||||
const getData = async (type: string) => {
|
||||
setLoading(true);
|
||||
const res = await Fetch(
|
||||
`/openi/${type === '1' ? 'dataCenter' : 'localManager'}/page`,
|
||||
{
|
||||
method: 'get',
|
||||
params: {
|
||||
type,
|
||||
pageSize: 1000000,
|
||||
pageNumber: 1,
|
||||
},
|
||||
},
|
||||
);
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
if (type === '1') {
|
||||
setFacilityList(data.list || []);
|
||||
} else {
|
||||
setLocalList(data.list || []);
|
||||
}
|
||||
setPackList([]);
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const getFirmList = async () => {
|
||||
const res = await Fetch('/openi/producer/list');
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
setFirmList(data);
|
||||
}
|
||||
};
|
||||
|
||||
const handleFinish = async (v: any) => {
|
||||
const res = await Fetch(
|
||||
`/openi/${visible === '1' ? 'dataCenter' : 'localManager'}/editOrAdd`,
|
||||
{
|
||||
method: 'post',
|
||||
data: {
|
||||
...v,
|
||||
type: visible,
|
||||
id: editId.current,
|
||||
},
|
||||
},
|
||||
);
|
||||
if (res.result === 'success') {
|
||||
getData(visible);
|
||||
setVisible(false);
|
||||
}
|
||||
};
|
||||
|
||||
const addList = (type: string) => {
|
||||
setVisible(type);
|
||||
};
|
||||
|
||||
const deleteList = (type: string, id: any) => {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
content: '确认删除吗?',
|
||||
onOk: async () => {
|
||||
const res = await Fetch(
|
||||
`/openi/${type === '1' ? 'dataCenter' : 'localManager'}/delete/${id}`,
|
||||
{
|
||||
method: 'post',
|
||||
},
|
||||
);
|
||||
if (res.result === 'success') {
|
||||
getData(type);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const editList = (type: string, param: any) => {
|
||||
form.setFieldsValue({ ...param });
|
||||
editId.current = param.id;
|
||||
setVisible(type);
|
||||
};
|
||||
|
||||
const pack = (id: any) => {
|
||||
if (packList.includes(id)) {
|
||||
setPackList(packList.filter((e: any) => e !== id));
|
||||
} else {
|
||||
setPackList([...packList, id]);
|
||||
}
|
||||
};
|
||||
|
||||
const item: any = [
|
||||
{
|
||||
icon: 'iconfont icon-shuju',
|
||||
name: '数据中心',
|
||||
key: '1',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-jiedian',
|
||||
name: '管理节点',
|
||||
key: '2',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.left}>
|
||||
{item.map((e: any) => (
|
||||
<div
|
||||
key={e.key}
|
||||
className={type === e.key ? styles.active : ''}
|
||||
onClick={() => {
|
||||
if (e.key === '1') {
|
||||
setType(e.key);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<b />
|
||||
<i className={e.icon} />
|
||||
{e.name}
|
||||
</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>
|
||||
<Button type="primary">修改数据中心基本信息</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Spin spinning={loading}>
|
||||
<div className={styles.list}>
|
||||
<div className={styles.head}>
|
||||
<div>数据中心设备列表</div>
|
||||
<Button onClick={() => addList('1')} type="primary" ghost>
|
||||
新增数据中心设备
|
||||
</Button>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
{!facilityList.length && <Empty style={{ margin: '20px 0' }} />}
|
||||
{!!facilityList.length &&
|
||||
facilityList.map((e: any, i: number) => {
|
||||
const bool = packList.includes(e.id);
|
||||
return (
|
||||
<aside key={i}>
|
||||
<div>
|
||||
<span>{e.name}</span>
|
||||
<div onClick={() => pack(e.id)}>
|
||||
{bool ? (
|
||||
<>
|
||||
<i className="iconfont icon-zhankaixiaojiantou" />
|
||||
<span>展开</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<i className="iconfont icon-shouqixiaojiantou" />
|
||||
<span>收起</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{!bool && (
|
||||
<Fragment>
|
||||
<div className={styles.li}>
|
||||
<i className="iconfont icon-fuwuqi"></i>
|
||||
<div>
|
||||
<p>
|
||||
<span>数据中心编号</span>
|
||||
<span>{e.physicsNum}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>数据中心名称</span>
|
||||
<span>{e.number}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<span>所属单位</span>
|
||||
<span>{e.managerNum}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>管理设备编号</span>
|
||||
<span>{e.producerId}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Row justify="end" className="mt10 mb20">
|
||||
<Button
|
||||
onClick={() => editList('1', e)}
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
修改设备
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() =>
|
||||
downLoadLink(
|
||||
url +
|
||||
`/openi/dataCenter/resourceExport/${e.id}`,
|
||||
)
|
||||
}
|
||||
className="ml10"
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
导出初装资源
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => deleteList('1', e.id)}
|
||||
className="ml10"
|
||||
type="primary"
|
||||
danger
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Row>
|
||||
</Fragment>
|
||||
)}
|
||||
</aside>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.list}>
|
||||
<div className={styles.head}>
|
||||
<div>数据管理终端列表</div>
|
||||
<Button onClick={() => addList('2')} type="primary" ghost>
|
||||
新增数据管理终端
|
||||
</Button>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
{!localList.length && <Empty style={{ margin: '20px 0' }} />}
|
||||
{!!localList.length &&
|
||||
localList.map((e: any, i: number) => {
|
||||
const bool = packList.includes(e.id);
|
||||
return (
|
||||
<aside key={i}>
|
||||
<div>
|
||||
<span>{e.name}</span>
|
||||
<div onClick={() => pack(e.id)}>
|
||||
{bool ? (
|
||||
<>
|
||||
<i className="iconfont icon-zhankaixiaojiantou" />
|
||||
<span>展开</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<i className="iconfont icon-shouqixiaojiantou" />
|
||||
<span>收起</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{!bool && (
|
||||
<Fragment>
|
||||
<div className={styles.li}>
|
||||
<i className="iconfont icon-zhongduan"></i>
|
||||
<div>
|
||||
<p>
|
||||
<span>数据中心编号</span>
|
||||
<span>{e.physicsNum}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>数据中心名称</span>
|
||||
<span>{e.number}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<span>所属单位</span>
|
||||
<span>{e.managerNum}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>管理设备编号</span>
|
||||
<span>{e.producerId}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Row justify="end" className="mt10 mb20">
|
||||
<Button
|
||||
onClick={() => editList('2', e)}
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
修改设备
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() =>
|
||||
downLoadLink(
|
||||
url +
|
||||
`/openi/localManager/resourceExport/${e.id}`,
|
||||
)
|
||||
}
|
||||
className="ml10"
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
导出初装资源
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => deleteList('2', e.id)}
|
||||
className="ml10"
|
||||
type="primary"
|
||||
danger
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Row>
|
||||
</Fragment>
|
||||
)}
|
||||
</aside>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
|
||||
<Modal
|
||||
centered
|
||||
title="新增设备"
|
||||
visible={visible}
|
||||
afterClose={() => {
|
||||
form.resetFields();
|
||||
editId.current = null;
|
||||
}}
|
||||
okText="保存"
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
form.submit();
|
||||
}}
|
||||
onCancel={() => {
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
layout="horizontal"
|
||||
colon={false}
|
||||
onFinish={handleFinish}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
>
|
||||
<Form.Item
|
||||
label="名称"
|
||||
name="name"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入名称`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="物理标识"
|
||||
name="physicsNum"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入物理标识`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="铭牌编码"
|
||||
name="number"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入铭牌编码`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="管理标识"
|
||||
name="managerNum"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入管理标识`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="生产厂商"
|
||||
name="producerId"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入生产厂商`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{firmList?.map((e) => (
|
||||
<Select.Option value={e.id} key={e.id}>
|
||||
{e.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
After Width: | Height: | Size: 9.9 MiB |
After Width: | Height: | Size: 706 KiB |
@ -0,0 +1,211 @@
|
||||
.page {
|
||||
height: 100vh;
|
||||
background: url('./img/bg.png') no-repeat center center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.red {
|
||||
color: #ff3f41;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 902px;
|
||||
height: 611px;
|
||||
background: #ffffff;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
background: url('./img/c.png') no-repeat center center;
|
||||
background-size: cover;
|
||||
|
||||
.one {
|
||||
width: 100%;
|
||||
height: 470px;
|
||||
margin-top: 130px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
> div {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 50px;
|
||||
padding-right: 110px;
|
||||
}
|
||||
|
||||
aside {
|
||||
display: flex;
|
||||
margin-top: 50px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
|
||||
ul {
|
||||
padding-left: 15px;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #376042;
|
||||
border: 2px solid #2fffdb;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.a {
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
background-color: #2fffdb;
|
||||
border-radius: 50%;
|
||||
right: 2px;
|
||||
top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
width: 208px;
|
||||
height: 42px;
|
||||
background: rgba(22, 93, 255, 0.5);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
> b {
|
||||
color: #fff;
|
||||
margin-top: 76px;
|
||||
}
|
||||
}
|
||||
|
||||
.two {
|
||||
width: 100%;
|
||||
height: 470px;
|
||||
margin-top: 130px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
> span {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 38px;
|
||||
}
|
||||
|
||||
> div {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 52px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 208px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
border: 2px solid #2fffdb;
|
||||
margin-top: 30px;
|
||||
background-color: transparent;
|
||||
color: #2fffdb;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 208px;
|
||||
height: 42px;
|
||||
border-radius: 4px;
|
||||
margin-top: 70px;
|
||||
background: rgba(22, 93, 255, 0.5);
|
||||
}
|
||||
|
||||
aside {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 66px;
|
||||
}
|
||||
}
|
||||
|
||||
.three {
|
||||
width: 100%;
|
||||
height: 470px;
|
||||
margin-top: 130px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
> span {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 38px;
|
||||
}
|
||||
|
||||
> div {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 52px;
|
||||
}
|
||||
|
||||
p {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
|
||||
input {
|
||||
width: 160px;
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
border: 2px solid #2fffdb;
|
||||
background-color: transparent;
|
||||
color: #2fffdb;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #2fffdb;
|
||||
border-radius: 4px;
|
||||
border: 2px solid #2fffdb;
|
||||
color: #10291d;
|
||||
margin-left: 10px;
|
||||
line-height: 38px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
> button {
|
||||
width: 208px;
|
||||
height: 42px;
|
||||
border-radius: 4px;
|
||||
margin-top: 70px;
|
||||
background: rgba(22, 93, 255, 0.5);
|
||||
}
|
||||
|
||||
aside {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
margin-top: 66px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import { Button, Result } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const App: React.FC = () => (
|
||||
<Result
|
||||
status="404"
|
||||
title="404"
|
||||
subTitle="抱歉,你访问的页面不存在"
|
||||
// extra={<Button type="primary"></Button>}
|
||||
/>
|
||||
);
|
||||
|
||||
export default App;
|
@ -0,0 +1,53 @@
|
||||
.page {
|
||||
.title {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 20px 20px 0 0;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
cursor: pointer;
|
||||
color: #6b758b;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
background: #464f66;
|
||||
border-radius: 50%;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #232b40;
|
||||
}
|
||||
}
|
@ -0,0 +1,599 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
Button,
|
||||
Select,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
message,
|
||||
Empty,
|
||||
Table,
|
||||
DatePicker,
|
||||
Input,
|
||||
Col,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, useRef } from 'react';
|
||||
import { downLoadLink } from '@/utils/download';
|
||||
import url from '@/utils/url';
|
||||
import moment from 'moment';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
import { getInitData } from '@/utils/util';
|
||||
import { Link, BasicInfoModelState, connect } from 'umi';
|
||||
const RangePicker: any = DatePicker.RangePicker;
|
||||
|
||||
interface PageProps {}
|
||||
|
||||
const Page: FC<PageProps> = () => {
|
||||
const distributionNode = getInitData('distributionNodeList');
|
||||
|
||||
const [data, setData] = useState<any>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [total, setTotal] = useState<number>(0);
|
||||
|
||||
//编辑新增弹框
|
||||
const [visible, setVisible] = useState<boolean>(false);
|
||||
const [modalData, setModalData] = useState<any>([]);
|
||||
// const [selectKey, setSelectKey] = useState<any>([]);
|
||||
|
||||
//选择设备弹框
|
||||
const [facilityVisible, setFacilityVisible] = useState<boolean>(false);
|
||||
const [facilityData, setFacilityData] = useState<any>([]);
|
||||
const [facilityKey, setFacilityKey] = useState<any>([]);
|
||||
const [facilityKeyData, setFacilityKeyData] = useState<any>([]);
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const [formInquire] = Form.useForm();
|
||||
const [formFacility] = Form.useForm();
|
||||
let [params, setParams] = useState<any>({
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
type: '2',
|
||||
status: '',
|
||||
time: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
});
|
||||
const editId = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
getData(params);
|
||||
}, []);
|
||||
|
||||
const getFacilityData = async (record: any) => {
|
||||
const res = await Fetch('/openi/device/page', {
|
||||
method: 'get',
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 100000,
|
||||
...record,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
const item = res?.data?.[0]?.list?.filter((e: any) => e.status !== '0');
|
||||
setFacilityData(item);
|
||||
}
|
||||
};
|
||||
|
||||
const getData = async (record: any) => {
|
||||
setLoading(true);
|
||||
const { time, ...sendData } = record;
|
||||
const res = await Fetch('/openi/deviceDistribution/page', {
|
||||
method: 'get',
|
||||
params: sendData,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
setData(res?.data?.[0]?.list);
|
||||
setTotal(res?.data?.[0]?.total);
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const columns: ColumnsType<any> = [
|
||||
{
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
dataIndex: 'index',
|
||||
render: (text: string, record: any, index: number) =>
|
||||
params.pageSize * (params.pageNumber - 1) + index + 1,
|
||||
},
|
||||
{
|
||||
width: 220,
|
||||
title: '调拨单编号',
|
||||
dataIndex: 'number',
|
||||
},
|
||||
{
|
||||
width: 220,
|
||||
title: '调拨单时间',
|
||||
dataIndex: 'beginTime',
|
||||
},
|
||||
{
|
||||
title: '调拨单节点',
|
||||
dataIndex: 'sendNode',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
render: (v: any, r: any) =>
|
||||
v === '1' ? (
|
||||
<span style={{ color: 'green' }}>已同步</span>
|
||||
) : (
|
||||
<span>未同步</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '依据',
|
||||
dataIndex: 'basis',
|
||||
},
|
||||
{
|
||||
title: '设备数量/(台)',
|
||||
dataIndex: 'deviceCount',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 110,
|
||||
render: (v: any, r: any) => (
|
||||
<span>
|
||||
<i
|
||||
onClick={() => handleEdit(r)}
|
||||
title="修改"
|
||||
className={'iconfont icon-xiugaikucundixian ' + styles.action}
|
||||
/>
|
||||
<i
|
||||
onClick={() => handleDelete(r.id)}
|
||||
title="删除"
|
||||
className={'iconfont icon-shanchuzhuangbeixinghao ' + styles.action}
|
||||
/>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const modalColumns: ColumnsType<any> = [
|
||||
{
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
dataIndex: 'index',
|
||||
render: (_: string, __: any, index: number) => index + 1,
|
||||
},
|
||||
{
|
||||
title: '装备型号',
|
||||
dataIndex: 'deviceType',
|
||||
render: (v: any) => v?.name,
|
||||
},
|
||||
{
|
||||
title: '装备名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '铭牌编号',
|
||||
dataIndex: 'deviceId',
|
||||
},
|
||||
{
|
||||
title: '管理标识',
|
||||
dataIndex: 'sign',
|
||||
render: (v: any) => v || '--',
|
||||
},
|
||||
{
|
||||
title: '生产厂商',
|
||||
dataIndex: 'producer',
|
||||
render: (v: any) => v?.name,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
render: (v: any, r: any) => (
|
||||
<span>
|
||||
<i
|
||||
onClick={() => {
|
||||
setModalData(modalData.filter((e: any) => e.id !== r.id));
|
||||
}}
|
||||
title="删除"
|
||||
className={'iconfont icon-shanchuzhuangbeixinghao ' + styles.action}
|
||||
/>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const handleChangePage = (param: any) => {
|
||||
params.pageNumber = param?.current;
|
||||
params.pageSize = param?.pageSize;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
};
|
||||
|
||||
const handleFinish = async (v: any) => {
|
||||
if (modalData.length === 0) {
|
||||
message.warn('请选择配发设备');
|
||||
return;
|
||||
}
|
||||
const res = await Fetch(`/openi/deviceDistribution/editOrAdd`, {
|
||||
method: 'post',
|
||||
data: {
|
||||
...v,
|
||||
type: '2',
|
||||
deviceList: modalData.map((e: any) => ({ id: e.id })),
|
||||
id: editId.current,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
params.pageNumber = editId.current ? params.pageNumber : 1;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
setVisible(false);
|
||||
}
|
||||
};
|
||||
|
||||
//按钮查询
|
||||
const handleInquire = async (v: any) => {
|
||||
params = { ...params, ...v };
|
||||
if (v.time) {
|
||||
params.startDate = moment(v?.time?.[0]).format('YYYY-MM-DD HH:mm:ss');
|
||||
params.endDate = moment(v?.time?.[1]).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
console.log(v, params, 222);
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
};
|
||||
|
||||
const handleFacility = async (v: any) => {
|
||||
getFacilityData(v);
|
||||
};
|
||||
|
||||
const handleEdit = (param: any) => {
|
||||
form.setFieldsValue({ ...param });
|
||||
setModalData(param?.deviceList);
|
||||
editId.current = param.id;
|
||||
setVisible(true);
|
||||
};
|
||||
|
||||
const handleDelete = (id: any) => {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
content: '确认删除吗?',
|
||||
onOk: async () => {
|
||||
const res = await Fetch(`/openi/deviceDistribution/delete/${id}`, {
|
||||
method: 'post',
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
const page =
|
||||
1 === data.length && params.pageNumber > 1
|
||||
? params.pageNumber - 1
|
||||
: params.pageNumber;
|
||||
params.pageNumber = page;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.title}>
|
||||
<span>调拨单列表</span>
|
||||
<i
|
||||
onClick={() => getData(params)}
|
||||
className="iconfont icon-a-shuaxin2"
|
||||
/>
|
||||
</div>
|
||||
<Row justify="space-between" className={styles.btn}>
|
||||
<Form
|
||||
form={formInquire}
|
||||
colon={false}
|
||||
layout="inline"
|
||||
onFinish={handleInquire}
|
||||
initialValues={{
|
||||
status: '',
|
||||
time: '',
|
||||
}}
|
||||
style={{ padding: '0 20px 20px 20px' }}
|
||||
>
|
||||
{/* <Form.Item
|
||||
label="类型"
|
||||
name="type"
|
||||
className='mr20'
|
||||
>
|
||||
<Select style={{ width: 100 }}>
|
||||
<Select.Option key={''}>所有</Select.Option>
|
||||
<Select.Option key={'1'}>配发</Select.Option>
|
||||
<Select.Option key={'2'}>调拨</Select.Option>
|
||||
</Select>
|
||||
</Form.Item> */}
|
||||
<Form.Item label="时间" name="time" className="mr20">
|
||||
<RangePicker format="YYYY-MM-DD HH:mm:ss" showTime />
|
||||
</Form.Item>
|
||||
<Form.Item label="状态" name="status" className="mr20">
|
||||
<Select style={{ width: 100 }}>
|
||||
<Select.Option key={''}>所有</Select.Option>
|
||||
<Select.Option key={'1'}>已同步</Select.Option>
|
||||
<Select.Option key={'0'}>未同步</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button
|
||||
onClick={() => {
|
||||
formInquire.resetFields();
|
||||
params = {
|
||||
...params,
|
||||
status: '',
|
||||
time: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
};
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
}}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Button
|
||||
onClick={() => setVisible(true)}
|
||||
icon={<i className="iconfont icon-tianjia" />}
|
||||
>
|
||||
新建调拨单
|
||||
</Button>
|
||||
</Row>
|
||||
|
||||
<Table
|
||||
dataSource={data}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
scroll={{ x: 1200 }}
|
||||
loading={loading}
|
||||
className="pr20 pl20"
|
||||
onChange={handleChangePage}
|
||||
pagination={{
|
||||
pageSize: params.per_page,
|
||||
total: total,
|
||||
current: params.page,
|
||||
showQuickJumper: true,
|
||||
hideOnSinglePage: true,
|
||||
position: ['bottomCenter'],
|
||||
showTotal: (total) => (
|
||||
<span className="mr10">
|
||||
共<span>{total}</span>条数据
|
||||
</span>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
centered
|
||||
title={`${editId.current ? '编辑' : '新建'}调拨单`}
|
||||
visible={visible}
|
||||
okText="保存"
|
||||
width={924}
|
||||
afterClose={() => {
|
||||
form.resetFields();
|
||||
editId.current = null;
|
||||
setModalData([]);
|
||||
}}
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
form.submit();
|
||||
}}
|
||||
onCancel={() => {
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
layout="horizontal"
|
||||
onFinish={handleFinish}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
>
|
||||
<div className={styles.name + ' mb10'}>
|
||||
<b />
|
||||
<span>装备配发单</span>
|
||||
</div>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="发往节点"
|
||||
name="sendNode"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入发往节点`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select>
|
||||
{distributionNode?.map((e: any) => (
|
||||
<Select.Option key={e}>{e}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="配发依据"
|
||||
name="basis"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入配发依据`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="领用人"
|
||||
name="userName"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入领用人`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="联系方式"
|
||||
name="phone"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入联系方式`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
<Row align="middle" justify="end">
|
||||
<div style={{ marginRight: 'auto' }} className={styles.name}>
|
||||
<b />
|
||||
<span>配发设备清单</span>
|
||||
</div>
|
||||
<Button
|
||||
icon={<i className="iconfont icon-daorushebei font14 mr5" />}
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
导入设备
|
||||
</Button>
|
||||
<Button
|
||||
icon={<i className="iconfont icon-xiazai font14 mr5" />}
|
||||
className="ml10 mr10"
|
||||
type="primary"
|
||||
ghost
|
||||
>
|
||||
下载模板
|
||||
</Button>
|
||||
<Button
|
||||
ghost
|
||||
icon={<i className="iconfont icon-xuanzeshebei font14 mr5" />}
|
||||
onClick={() => {
|
||||
getFacilityData({});
|
||||
setFacilityVisible(true);
|
||||
setFacilityKey(modalData.map((e: any) => e.id));
|
||||
setFacilityKeyData(modalData);
|
||||
}}
|
||||
type="primary"
|
||||
>
|
||||
选择设备
|
||||
</Button>
|
||||
</Row>
|
||||
<Table
|
||||
dataSource={modalData}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={modalColumns}
|
||||
scroll={{ y: 400 }}
|
||||
className="mt20"
|
||||
pagination={false}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
{/* 选择设备弹框 */}
|
||||
<Modal
|
||||
centered
|
||||
title="选择设备"
|
||||
visible={facilityVisible}
|
||||
okText="确认"
|
||||
width={924}
|
||||
afterClose={() => {
|
||||
formFacility.resetFields();
|
||||
setFacilityKey([]);
|
||||
setFacilityKeyData([]);
|
||||
}}
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
setModalData(facilityKeyData);
|
||||
setFacilityVisible(false);
|
||||
}}
|
||||
onCancel={() => {
|
||||
setFacilityVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={formFacility}
|
||||
colon={false}
|
||||
layout="inline"
|
||||
onFinish={handleFacility}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item label="装备代号" name="type">
|
||||
<Input style={{ width: 200 }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="铭牌编号" name="deviceId">
|
||||
<Input style={{ width: 200 }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Form.Item>
|
||||
<Button
|
||||
className="ml20"
|
||||
onClick={() => {
|
||||
formFacility.resetFields();
|
||||
getFacilityData({});
|
||||
}}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Table
|
||||
dataSource={facilityData}
|
||||
rowSelection={{
|
||||
type: 'checkbox',
|
||||
selectedRowKeys: facilityKey,
|
||||
onChange: (selectedRowKeys: any[], selectedRows: any[]) => {
|
||||
setFacilityKey(selectedRowKeys);
|
||||
setFacilityKeyData(selectedRows);
|
||||
},
|
||||
}}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={modalColumns.filter((e: any) => e.dataIndex !== 'action')}
|
||||
scroll={{ y: 400 }}
|
||||
className="mt20"
|
||||
pagination={false}
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
@ -0,0 +1,53 @@
|
||||
.page {
|
||||
.title {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 13px 20px;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
cursor: pointer;
|
||||
color: #6b758b;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.li:last-child {
|
||||
border-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
Button,
|
||||
Select,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
message,
|
||||
Empty,
|
||||
Table,
|
||||
InputNumber,
|
||||
Input,
|
||||
Col,
|
||||
DatePicker,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, useRef, Fragment } from 'react';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
const RangePicker: any = DatePicker.RangePicker;
|
||||
import moment from 'moment';
|
||||
|
||||
interface PageProps {}
|
||||
|
||||
const Page: FC<PageProps> = () => {
|
||||
const [data, setData] = useState<any>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [total, setTotal] = useState<number>(0);
|
||||
const [deviceList, setDeviceList] = useState<any[]>([]);
|
||||
const [form] = Form.useForm();
|
||||
let [params, setParams] = useState<any>({
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
getData(params);
|
||||
getDeviceList();
|
||||
}, []);
|
||||
|
||||
const getData = async (record: any) => {
|
||||
setLoading(true);
|
||||
const res = await Fetch('/openi/device/page', {
|
||||
method: 'get',
|
||||
params: record,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
setData(res?.data?.[0]?.list);
|
||||
setTotal(res?.data?.[0]?.total);
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const getDeviceList = async () => {
|
||||
const res = await Fetch('/openi/deviceType/list');
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
setDeviceList(data);
|
||||
}
|
||||
};
|
||||
|
||||
const columns: ColumnsType<any> = [
|
||||
{
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
dataIndex: 'index',
|
||||
render: (text: string, record: any, index: number) =>
|
||||
params.pageSize * (params.pageNumber - 1) + index + 1,
|
||||
},
|
||||
{
|
||||
title: '装备型号',
|
||||
dataIndex: 'deviceType',
|
||||
render: (v: any) => v?.name,
|
||||
},
|
||||
{
|
||||
title: '装备名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '铭牌编号',
|
||||
dataIndex: 'deviceId',
|
||||
},
|
||||
{
|
||||
title: '管理标识',
|
||||
dataIndex: 'sign',
|
||||
render: (v: any) => v || '--',
|
||||
},
|
||||
{
|
||||
title: '生产厂商',
|
||||
dataIndex: 'producer',
|
||||
render: (v: any) => v?.name,
|
||||
},
|
||||
];
|
||||
|
||||
const handleChangePage = (param: any) => {
|
||||
params.pageNumber = param?.current;
|
||||
params.pageSize = param?.pageSize;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
};
|
||||
|
||||
const handleFinish = async (v: any) => {
|
||||
params = { ...params, ...v };
|
||||
if (v.time) {
|
||||
params.startDate = moment(v?.time?.[0]).format('YYYY-MM-DD HH:mm:ss');
|
||||
params.endDate = moment(v?.time?.[1]).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
delete params.time;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.title}>
|
||||
<span>装备信息查询</span>
|
||||
<i
|
||||
onClick={() => getData(params)}
|
||||
className="iconfont icon-a-shuaxin2"
|
||||
/>
|
||||
</div>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
layout="inline"
|
||||
onFinish={handleFinish}
|
||||
initialValues={{
|
||||
time: '',
|
||||
}}
|
||||
style={{ padding: '0 20px 20px 20px' }}
|
||||
>
|
||||
<Row className="mt10 mb10">
|
||||
<Form.Item label="设备类型" name="type" className="mr20">
|
||||
<Input style={{ width: 200 }} />
|
||||
</Form.Item>
|
||||
<Form.Item label="铭牌号" name="deviceId" className="mr20">
|
||||
<Input placeholder="支持模糊查询" style={{ width: 200 }} />
|
||||
</Form.Item>
|
||||
<Form.Item label="初装资源" name="status" className="mr20">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="请选择初始资源状态"
|
||||
style={{ width: 200 }}
|
||||
>
|
||||
<Select.Option key={'0'}>未出装</Select.Option>
|
||||
<Select.Option key={'1'}>已出装</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Row>
|
||||
<Row>
|
||||
<Form.Item label="流转状态" name="distributionId" className="mr20">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="请选择设备流转状态"
|
||||
style={{ width: 200 }}
|
||||
>
|
||||
<Select.Option key={'0'}>未配发</Select.Option>
|
||||
<Select.Option key={'1'}>已配发</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item label="注册时间" name="time" className="mr20">
|
||||
<RangePicker
|
||||
placeholder={['请选择起始时间', '请选择结束时间']}
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
showTime
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button
|
||||
onClick={() => {
|
||||
form.resetFields();
|
||||
params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
};
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
}}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Row>
|
||||
</Form>
|
||||
<Table
|
||||
dataSource={data}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
loading={loading}
|
||||
className="pr20 pl20"
|
||||
onChange={handleChangePage}
|
||||
pagination={{
|
||||
pageSize: params.per_page,
|
||||
total: total,
|
||||
current: params.page,
|
||||
showQuickJumper: true,
|
||||
hideOnSinglePage: true,
|
||||
position: ['bottomCenter'],
|
||||
showTotal: (total) => (
|
||||
<span className="mr10">
|
||||
共<span>{total}</span>条数据
|
||||
</span>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Page;
|
@ -0,0 +1,35 @@
|
||||
.page {
|
||||
.title {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 13px 20px;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
cursor: pointer;
|
||||
color: #6b758b;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,388 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
Button,
|
||||
Select,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
message,
|
||||
Empty,
|
||||
Table,
|
||||
InputNumber,
|
||||
Input,
|
||||
Col,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, useRef } from 'react';
|
||||
import { downLoadLink } from '@/utils/download';
|
||||
import url from '@/utils/url';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
|
||||
interface PageProps {}
|
||||
|
||||
const Page: FC<PageProps> = () => {
|
||||
const [data, setData] = useState<any>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [total, setTotal] = useState<number>(0);
|
||||
const [visible, setVisible] = useState<boolean>(false);
|
||||
const [form] = Form.useForm();
|
||||
const [params, setParams] = useState<any>({
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
const editId = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
getData(params);
|
||||
}, []);
|
||||
|
||||
const getData = async (record: any) => {
|
||||
setLoading(true);
|
||||
const res = await Fetch('/openi/producer/page', {
|
||||
method: 'get',
|
||||
params: record,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
setData(res?.data?.[0]?.list);
|
||||
setTotal(res?.data?.[0]?.total);
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const columns: ColumnsType<any> = [
|
||||
{
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
dataIndex: 'index',
|
||||
render: (text: string, record: any, index: number) =>
|
||||
params.pageSize * (params.pageNumber - 1) + index + 1,
|
||||
},
|
||||
{
|
||||
title: '厂商编号',
|
||||
dataIndex: 'producerNumber',
|
||||
},
|
||||
{
|
||||
title: '生产厂商全名',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '生产厂商简称',
|
||||
dataIndex: 'simpleName',
|
||||
},
|
||||
{
|
||||
title: '生产厂商地址',
|
||||
dataIndex: 'address',
|
||||
},
|
||||
{
|
||||
title: '联系人1姓名',
|
||||
dataIndex: 'contacts1',
|
||||
},
|
||||
{
|
||||
title: '联系人1电话',
|
||||
dataIndex: 'tel1',
|
||||
},
|
||||
{
|
||||
title: '联系人1手机',
|
||||
dataIndex: 'phone1',
|
||||
},
|
||||
{
|
||||
title: '联系人2姓名',
|
||||
dataIndex: 'contacts2',
|
||||
render: (text: string) => text || '--',
|
||||
},
|
||||
{
|
||||
title: '联系人2电话',
|
||||
dataIndex: 'tel2',
|
||||
render: (text: string) => text || '--',
|
||||
},
|
||||
{
|
||||
title: '联系人2手机',
|
||||
dataIndex: 'phone2',
|
||||
render: (text: string) => text || '--',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 110,
|
||||
render: (v: any, r: any) => (
|
||||
<span>
|
||||
<i
|
||||
onClick={() => handleEdit(r)}
|
||||
title="修改"
|
||||
className={'iconfont icon-xiugaikucundixian ' + styles.action}
|
||||
/>
|
||||
<i
|
||||
onClick={() => handleDelete(r.id)}
|
||||
title="删除"
|
||||
className={'iconfont icon-shanchuzhuangbeixinghao ' + styles.action}
|
||||
/>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const handleChangePage = (param: any) => {
|
||||
params.pageNumber = param?.current;
|
||||
params.pageSize = param?.pageSize;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
};
|
||||
|
||||
const handleFinish = async (v: any) => {
|
||||
const res = await Fetch(`/openi/producer/editOrAdd`, {
|
||||
method: 'post',
|
||||
data: {
|
||||
...v,
|
||||
id: editId.current,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
params.pageNumber = editId.current ? params.pageNumber : 1;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
setVisible(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleEdit = (param: any) => {
|
||||
form.setFieldsValue({ ...param });
|
||||
editId.current = param.id;
|
||||
setVisible(true);
|
||||
};
|
||||
|
||||
const handleDelete = (id: any) => {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
content: '确认删除吗?',
|
||||
onOk: async () => {
|
||||
const res = await Fetch(`/openi/producer/delete/${id}`, {
|
||||
method: 'post',
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
const page =
|
||||
1 === data.length && params.pageNumber > 1
|
||||
? params.pageNumber - 1
|
||||
: params.pageNumber;
|
||||
params.pageNumber = page;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.title}>
|
||||
<span>厂商信息管理</span>
|
||||
<i
|
||||
onClick={() => getData(params)}
|
||||
className="iconfont icon-a-shuaxin2"
|
||||
/>
|
||||
</div>
|
||||
<Row justify="end" className={styles.btn}>
|
||||
<Button
|
||||
onClick={() => setVisible(true)}
|
||||
icon={<i className="iconfont icon-tianjia" />}
|
||||
>
|
||||
添加厂商
|
||||
</Button>
|
||||
{/* <Button icon={<i className='iconfont icon-daorushuju2' />} className='ml10'>导出厂商信息</Button> */}
|
||||
</Row>
|
||||
<Table
|
||||
dataSource={data}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
scroll={{ x: 1800 }}
|
||||
loading={loading}
|
||||
className="pr20 pl20"
|
||||
onChange={handleChangePage}
|
||||
pagination={{
|
||||
pageSize: params.per_page,
|
||||
total: total,
|
||||
current: params.page,
|
||||
showQuickJumper: true,
|
||||
hideOnSinglePage: true,
|
||||
position: ['bottomCenter'],
|
||||
showTotal: (total) => (
|
||||
<span className="mr10">
|
||||
共<span>{total}</span>条数据
|
||||
</span>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Modal
|
||||
centered
|
||||
title={`${editId.current ? '编辑' : '添加'}厂商信息`}
|
||||
visible={visible}
|
||||
okText="保存"
|
||||
width={924}
|
||||
afterClose={() => {
|
||||
form.resetFields();
|
||||
editId.current = null;
|
||||
}}
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
form.submit();
|
||||
}}
|
||||
onCancel={() => {
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
layout="horizontal"
|
||||
onFinish={handleFinish}
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="生产厂商代号"
|
||||
name="producerNumber"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入生产厂商代号`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="生产厂商全名"
|
||||
name="name"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入生产厂商全名`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item label="生产厂商简称" name="simpleName">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="生产厂商地址"
|
||||
name="address"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入生产厂商地址`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="联系人1姓名"
|
||||
name="contacts1"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入联系人1姓名`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="联系人1电话"
|
||||
name="tel1"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入联系人1电话`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="联系人1手机"
|
||||
name="phone1"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入联系人1手机`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="联系人1邮箱" name="email1">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item label="联系人2姓名" name="contacts2">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="联系人2电话" name="tel2">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item label="联系人2手机" name="phone2">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="联系人2邮箱" name="email2">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={24}>
|
||||
<Form.Item
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 20 }}
|
||||
label="详情备注"
|
||||
name="remarks"
|
||||
>
|
||||
<Input.TextArea />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Page;
|
@ -0,0 +1,45 @@
|
||||
.page {
|
||||
.title {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 13px 20px;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
cursor: pointer;
|
||||
color: #6b758b;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
div[class~='ant-form-item-control'] {
|
||||
width: 388px;
|
||||
}
|
||||
}
|
||||
|
||||
.colorBlue {
|
||||
color: @primary-color;
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
.page {
|
||||
.title {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 13px 20px;
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
cursor: pointer;
|
||||
color: #6b758b;
|
||||
padding: 0 10px;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.li:last-child {
|
||||
border-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
@ -0,0 +1,416 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
Button,
|
||||
Select,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
message,
|
||||
Empty,
|
||||
Table,
|
||||
InputNumber,
|
||||
Input,
|
||||
Col,
|
||||
Space,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, useRef, Fragment } from 'react';
|
||||
import { downLoadLink } from '@/utils/download';
|
||||
import url from '@/utils/url';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
import { uniq } from 'lodash';
|
||||
|
||||
interface PageProps {}
|
||||
|
||||
const Page: FC<PageProps> = () => {
|
||||
const [data, setData] = useState<any>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [total, setTotal] = useState<number>(0);
|
||||
const [visible, setVisible] = useState<boolean>(false);
|
||||
const [value, setValue] = useState<number>(1);
|
||||
const [firmList, setFirmList] = useState<any[]>([]);
|
||||
const [deviceList, setDeviceList] = useState<any[]>([]);
|
||||
const [form] = Form.useForm();
|
||||
const [params, setParams] = useState<any>({
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
const editId = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
getData(params);
|
||||
getFirmList();
|
||||
getDeviceList();
|
||||
}, []);
|
||||
|
||||
const getData = async (record: any) => {
|
||||
setLoading(true);
|
||||
const res = await Fetch('/openi/device/page', {
|
||||
method: 'get',
|
||||
params: record,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
setData(res?.data?.[0]?.list);
|
||||
setTotal(res?.data?.[0]?.total);
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const getFirmList = async () => {
|
||||
const res = await Fetch('/openi/producer/list');
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
setFirmList(data);
|
||||
}
|
||||
};
|
||||
|
||||
const getDeviceList = async () => {
|
||||
const res = await Fetch('/openi/deviceType/list');
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
setDeviceList(data);
|
||||
}
|
||||
};
|
||||
|
||||
const columns: ColumnsType<any> = [
|
||||
{
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
dataIndex: 'index',
|
||||
render: (text: string, record: any, index: number) =>
|
||||
params.pageSize * (params.pageNumber - 1) + index + 1,
|
||||
},
|
||||
{
|
||||
title: '装备型号',
|
||||
dataIndex: 'deviceType',
|
||||
render: (v: any) => v?.name,
|
||||
},
|
||||
{
|
||||
title: '装备名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '铭牌编号',
|
||||
dataIndex: 'deviceId',
|
||||
},
|
||||
{
|
||||
title: '管理标识',
|
||||
dataIndex: 'sign',
|
||||
render: (v: any) => v || '--',
|
||||
},
|
||||
{
|
||||
title: '生产厂商',
|
||||
dataIndex: 'producer',
|
||||
render: (v: any) => v?.name,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 110,
|
||||
render: (v: any, r: any) => (
|
||||
<span>
|
||||
<i
|
||||
onClick={() => handleEdit(r)}
|
||||
title="修改"
|
||||
className={'iconfont icon-xiugaikucundixian ' + styles.action}
|
||||
/>
|
||||
<i
|
||||
onClick={() => handleDelete(r.id)}
|
||||
title="删除"
|
||||
className={'iconfont icon-shanchuzhuangbeixinghao ' + styles.action}
|
||||
/>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const handleChangePage = (param: any) => {
|
||||
params.pageNumber = param?.current;
|
||||
params.pageSize = param?.pageSize;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
};
|
||||
|
||||
const handleFinish = async (v: any) => {
|
||||
const sights = v?.sights?.map((e: any) => e.deviceId);
|
||||
if (uniq(sights).length !== sights.length) {
|
||||
message.warn('铭牌编号不能重复');
|
||||
return;
|
||||
}
|
||||
if (editId.current) {
|
||||
const res = await Fetch(`/openi/device/editOrAdd`, {
|
||||
method: 'post',
|
||||
data: { ...v?.sights?.[0] },
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
getData(params);
|
||||
setVisible(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
const res = await Fetch(`/openi/device/addList`, {
|
||||
method: 'post',
|
||||
data: v.sights,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
params.pageNumber = 1;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
setVisible(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleAdd = () => {
|
||||
if (!value) {
|
||||
message.warn('请输入添加设备台数');
|
||||
return;
|
||||
}
|
||||
const num = String(Math.random())?.slice(-8);
|
||||
const sights = [];
|
||||
for (let i = 0; i < value; i++) {
|
||||
sights.push({ deviceId: num + i });
|
||||
}
|
||||
form.setFieldsValue({ sights });
|
||||
setVisible(true);
|
||||
};
|
||||
|
||||
const handleEdit = (param: any) => {
|
||||
form.setFieldsValue({
|
||||
sights: [
|
||||
{
|
||||
name: param.name,
|
||||
deviceId: param.deviceId,
|
||||
type: param.type,
|
||||
producerId: param.producerId,
|
||||
},
|
||||
],
|
||||
});
|
||||
editId.current = param.id;
|
||||
setVisible(true);
|
||||
};
|
||||
|
||||
const handleDelete = (id: any) => {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
content: '确认删除吗?',
|
||||
onOk: async () => {
|
||||
const res = await Fetch(`/openi/device/delete/${id}`, {
|
||||
method: 'post',
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
const page =
|
||||
1 === data.length && params.pageNumber > 1
|
||||
? params.pageNumber - 1
|
||||
: params.pageNumber;
|
||||
params.pageNumber = page;
|
||||
setParams({ ...params });
|
||||
getData(params);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleFile = () => {
|
||||
var inputObj = document.createElement('input');
|
||||
inputObj.setAttribute('id', '_ef');
|
||||
inputObj.setAttribute('type', 'file');
|
||||
inputObj.setAttribute('style', 'visibility:hidden');
|
||||
document.body.appendChild(inputObj);
|
||||
inputObj.click();
|
||||
inputObj.onchange = async (e: any) => {
|
||||
const data: any = new FormData();
|
||||
data.append('file', e?.target?.files?.[0]);
|
||||
const res = await Fetch('/openi/device/import', {
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
message.success('导入成功');
|
||||
getData(params);
|
||||
} else {
|
||||
message.warn(res?.errorMsg);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.title}>
|
||||
<span>装备注册登记</span>
|
||||
<i
|
||||
onClick={() => getData(params)}
|
||||
className="iconfont icon-a-shuaxin2"
|
||||
/>
|
||||
</div>
|
||||
<Row justify="end" className={styles.btn}>
|
||||
<Row align="middle">
|
||||
<span>增加设备台数</span>
|
||||
<InputNumber
|
||||
precision={0}
|
||||
value={value}
|
||||
min={1}
|
||||
className="ml10"
|
||||
onChange={(k) => setValue(k)}
|
||||
style={{ width: 90 }}
|
||||
/>
|
||||
</Row>
|
||||
<Button
|
||||
className="ml10"
|
||||
onClick={handleAdd}
|
||||
icon={<i className="iconfont icon-tianjia" />}
|
||||
>
|
||||
增加设备
|
||||
</Button>
|
||||
<Button onClick={handleFile} style={{ marginLeft: 'auto' }}>
|
||||
选择导入设备信息的EXCEL文件并上传
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => downLoadLink(`${url}/openi/device/model`)}
|
||||
className="ml10"
|
||||
>
|
||||
下载模版
|
||||
</Button>
|
||||
</Row>
|
||||
<Table
|
||||
dataSource={data}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
// scroll={{ x: 1800 }}
|
||||
loading={loading}
|
||||
className="pr20 pl20"
|
||||
onChange={handleChangePage}
|
||||
pagination={{
|
||||
pageSize: params.per_page,
|
||||
total: total,
|
||||
current: params.page,
|
||||
showQuickJumper: true,
|
||||
hideOnSinglePage: true,
|
||||
position: ['bottomCenter'],
|
||||
showTotal: (total) => (
|
||||
<span className="mr10">
|
||||
共<span>{total}</span>条数据
|
||||
</span>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Modal
|
||||
centered
|
||||
title={`${editId.current ? '编辑' : '注册'}设备`}
|
||||
visible={visible}
|
||||
okText="保存"
|
||||
width={1180}
|
||||
afterClose={() => {
|
||||
form.resetFields();
|
||||
editId.current = null;
|
||||
}}
|
||||
cancelText="取消"
|
||||
onOk={() => {
|
||||
form.submit();
|
||||
}}
|
||||
onCancel={() => {
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
layout="inline"
|
||||
onFinish={handleFinish}
|
||||
style={{
|
||||
maxHeight: 500,
|
||||
overflow: 'auto',
|
||||
}}
|
||||
// labelCol={{ span: 8 }}
|
||||
// wrapperCol={{ span: 16 }}
|
||||
>
|
||||
<Form.List name="sights">
|
||||
{(fields) =>
|
||||
fields.map(({ key, name, ...restField }: any, index: number) => {
|
||||
return (
|
||||
<div className={styles.li} key={key}>
|
||||
{!editId.current && (
|
||||
<div className={styles.name}>设备{index + 1}</div>
|
||||
)}
|
||||
<Row>
|
||||
<Form.Item
|
||||
{...restField}
|
||||
className="mb10"
|
||||
label="装备名称"
|
||||
name={[name, 'name']}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入装备名称`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
{...restField}
|
||||
label="装备型号"
|
||||
name={[name, 'type']}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入装备型号`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select style={{ width: 200 }}>
|
||||
{deviceList?.map((e) => (
|
||||
<Select.Option value={e.id} key={e.id}>
|
||||
{e.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
{...restField}
|
||||
label="生产厂商"
|
||||
name={[name, 'producerId']}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入生产厂商`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select style={{ width: 200 }}>
|
||||
{firmList?.map((e) => (
|
||||
<Select.Option value={e.id} key={e.id}>
|
||||
{e.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
{...restField}
|
||||
label="铭牌编号"
|
||||
name={[name, 'deviceId']}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: `请输入装备名称`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
}
|
||||
</Form.List>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Page;
|
@ -0,0 +1,61 @@
|
||||
.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: 16px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
padding: 20px 0;
|
||||
cursor: pointer;
|
||||
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 16px;
|
||||
background: @primary-color;
|
||||
margin-right: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
i {
|
||||
padding-right: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: @primary-color;
|
||||
|
||||
b {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
i {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 1034px;
|
||||
border-radius: 4px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
import styles from './index.less';
|
||||
import { history } from 'umi';
|
||||
|
||||
const Page = ({ ...props }) => {
|
||||
const pathname = props.location.pathname;
|
||||
|
||||
const item: any = [
|
||||
{
|
||||
icon: 'iconfont icon-tongji',
|
||||
name: '装备信息统计',
|
||||
key: '2',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-chaxun',
|
||||
name: '装备信息查询',
|
||||
key: '/demand',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-zhucedengji',
|
||||
name: '装备注册登记',
|
||||
key: '/register',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-xinghaoguanli',
|
||||
name: '装备型号管理',
|
||||
key: '/model',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-peifaguanli',
|
||||
name: '装备配发管理',
|
||||
key: '/allotment',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-changshangxinxiguanli',
|
||||
name: '厂商信息管理',
|
||||
key: '/manufacturer',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.left}>
|
||||
{item.map((e: any) => (
|
||||
<div
|
||||
key={e.key}
|
||||
className={pathname?.includes(e.key) ? styles.active : ''}
|
||||
onClick={() => {
|
||||
if (e.key !== '2') {
|
||||
history.push(`/manager/basicManager${e.key}`);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<b />
|
||||
<i className={e.icon} />
|
||||
{e.name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className={styles.right}>{props.children}</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Page;
|
@ -0,0 +1,66 @@
|
||||
.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;
|
||||
|
||||
.active {
|
||||
color: #28b1ff;
|
||||
|
||||
b {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
margin-left: 100px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
b {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -9px;
|
||||
width: 40px;
|
||||
height: 2px;
|
||||
background: #28b1ff;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
height: calc(100vh - 60px);
|
||||
background-color: #fafafa;
|
||||
overflow: auto;
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
.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: 16px;
|
||||
font-weight: 400;
|
||||
color: #464f66;
|
||||
padding: 20px 0;
|
||||
cursor: pointer;
|
||||
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 16px;
|
||||
background: @primary-color;
|
||||
margin-right: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
i {
|
||||
padding-right: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
color: @primary-color;
|
||||
|
||||
b {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
i {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 1034px;
|
||||
border-radius: 4px;
|
||||
background-color: #ffffff;
|
||||
|
||||
.title {
|
||||
height: 36px;
|
||||
background: #e3effc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
font-weight: 500;
|
||||
color: #464f66;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
height: 500px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-top: 1px solid #ebf3ff;
|
||||
height: 58px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,305 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
InputNumber,
|
||||
Input,
|
||||
Button,
|
||||
Select,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
message,
|
||||
Empty,
|
||||
Spin,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, useRef } from 'react';
|
||||
import { Link, BasicInfoModelState, connect, Dispatch } from 'umi';
|
||||
import { downLoadLink } from '@/utils/download';
|
||||
import url from '@/utils/url';
|
||||
import ReactEcharts from 'echarts-for-react';
|
||||
import { getInitData } from '@/utils/util';
|
||||
|
||||
interface PageProps {
|
||||
dispatch: Dispatch;
|
||||
}
|
||||
|
||||
const Page: FC<PageProps> = ({ dispatch }) => {
|
||||
const algorithmList = getInitData('algorithmList');
|
||||
const keyLengthList = getInitData('keyLengthList');
|
||||
const keyNodeList = getInitData('keyNodeList');
|
||||
const [type, setType] = useState<string>('1');
|
||||
const [algorithm, setAlgorithm] = useState<string>('');
|
||||
const [length, setLength] = useState<string>('');
|
||||
const [pushNode, setPushNode] = useState<string>('');
|
||||
const [count, setCount] = useState<number>(1000);
|
||||
const [data, setData] = useState<any>([]);
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, [type]);
|
||||
|
||||
const getData = async () => {
|
||||
const res = await Fetch('/openi/secretKey/statistics', {
|
||||
method: 'get',
|
||||
params: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
setData(res?.data?.[0]);
|
||||
// const xData = res?.data?.[0]?.map((e: any) => {
|
||||
// if (type !== '2') {
|
||||
// return e.length;
|
||||
// }
|
||||
// return e.algorithm;
|
||||
// })
|
||||
// const yData = res?.data?.[0]?.map((e: any) => e.count)
|
||||
// dispatch({
|
||||
// type: 'basic/setEchartsData',
|
||||
// payload: {
|
||||
// xData,
|
||||
// yData
|
||||
// },
|
||||
// });
|
||||
}
|
||||
};
|
||||
|
||||
const item: any = [
|
||||
{
|
||||
icon: 'iconfont icon-yuzhiziyuan',
|
||||
name: '预制秘钥资源',
|
||||
key: '1',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-gongsiyueduiziyuan',
|
||||
name: '公私钥对资源',
|
||||
key: '2',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-suanfacanshuziyuan',
|
||||
name: '算法参数资源',
|
||||
key: '3',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-suanfaluojiziyuan',
|
||||
name: '算法逻辑资源',
|
||||
key: '4',
|
||||
},
|
||||
{
|
||||
icon: 'iconfont icon-ruanjianziyuan',
|
||||
name: '密码软件资源',
|
||||
key: '5',
|
||||
},
|
||||
];
|
||||
|
||||
const handleFile = () => {
|
||||
var inputObj = document.createElement('input');
|
||||
inputObj.setAttribute('id', '_ef');
|
||||
inputObj.setAttribute('type', 'file');
|
||||
inputObj.setAttribute('style', 'visibility:hidden');
|
||||
document.body.appendChild(inputObj);
|
||||
inputObj.click();
|
||||
inputObj.onchange = async (e: any) => {
|
||||
const data: any = new FormData();
|
||||
data.append('file', e?.target?.files?.[0]);
|
||||
const res = await Fetch(`/openi/secretKey/resourceImport/${type}`, {
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
message.success('导入成功');
|
||||
getData();
|
||||
} else {
|
||||
message.error(res.errorMsg);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const title = item.find((e: any) => e.key === type).name;
|
||||
|
||||
// const items = [
|
||||
// {
|
||||
// key: '1',
|
||||
// name: 'ECC359',
|
||||
// },
|
||||
// {
|
||||
// key: '2',
|
||||
// name: 'ECC281',
|
||||
// },
|
||||
// ];
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
},
|
||||
},
|
||||
legend: {},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
boundaryGap: [0, 0.01],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: data?.map((e: any) => {
|
||||
if (type !== '2') {
|
||||
return e.length;
|
||||
}
|
||||
return e.algorithm;
|
||||
}),
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '库存数量',
|
||||
type: 'bar',
|
||||
barMaxWidth: 12,
|
||||
data: data?.map((e: any) => e.count),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const push = async () => {
|
||||
if (!count) {
|
||||
message.warn('推送组数不能为空');
|
||||
return;
|
||||
}
|
||||
if (!algorithm && type === '2') {
|
||||
message.warn('算法类型不能为空');
|
||||
return;
|
||||
}
|
||||
if (!length) {
|
||||
message.warn('密码长度不能为空');
|
||||
return;
|
||||
}
|
||||
if (!pushNode) {
|
||||
message.warn('推送节点不能为空');
|
||||
return;
|
||||
}
|
||||
const res = await Fetch('/openi/secretKey/pushKey', {
|
||||
method: 'post',
|
||||
data: {
|
||||
pushNode,
|
||||
type,
|
||||
length: Number(length),
|
||||
count,
|
||||
algorithm,
|
||||
},
|
||||
});
|
||||
if (res.errorCode === 500) {
|
||||
message.warn(res.errorMsg);
|
||||
return;
|
||||
}
|
||||
if (res.result === 'success') {
|
||||
message.success('推出成功');
|
||||
getData();
|
||||
}
|
||||
};
|
||||
|
||||
const mr = type === '2' ? 'mr15' : 'mr30';
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.left}>
|
||||
{item.map((e: any) => (
|
||||
<div
|
||||
key={e.key}
|
||||
className={type === e.key ? styles.active : ''}
|
||||
onClick={() => {
|
||||
setType(e.key);
|
||||
}}
|
||||
>
|
||||
<b />
|
||||
<i className={e.icon} />
|
||||
{e.name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className={styles.right}>
|
||||
<div className={styles.title}>
|
||||
<span>{title}列表 </span>
|
||||
<i onClick={() => getData()} className="iconfont icon-a-shuaxin2" />
|
||||
</div>
|
||||
<div className={styles.box}>
|
||||
<ReactEcharts
|
||||
option={option}
|
||||
style={{ height: 500 }}
|
||||
opts={{ renderer: 'svg' }}
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.btn}>
|
||||
<Button
|
||||
onClick={handleFile}
|
||||
className={mr}
|
||||
icon={
|
||||
<i
|
||||
className="iconfont icon-daorushuju2 mr5"
|
||||
style={{ fontSize: 14 }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
导入资源文件
|
||||
</Button>
|
||||
<Row align="middle" className={mr}>
|
||||
<span className="mr10">密码长度</span>
|
||||
<Select
|
||||
style={{ width: 96 }}
|
||||
value={length}
|
||||
onChange={(k) => setLength(k)}
|
||||
>
|
||||
{keyLengthList?.map((e: any) => (
|
||||
<Select.Option key={e}>{e}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Row>
|
||||
<Row align="middle" className={mr}>
|
||||
<span className="mr10">推送节点</span>
|
||||
<Select
|
||||
style={{ width: 160 }}
|
||||
value={pushNode}
|
||||
onChange={(k) => setPushNode(k)}
|
||||
>
|
||||
{keyNodeList?.map((e: any) => (
|
||||
<Select.Option key={e}>{e}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Row>
|
||||
{type === '2' && (
|
||||
<Row align="middle" className={mr}>
|
||||
<span className="mr10">算法类型</span>
|
||||
<Select
|
||||
value={algorithm}
|
||||
onChange={(k) => setAlgorithm(k)}
|
||||
style={{ width: 100 }}
|
||||
>
|
||||
{algorithmList?.map((e: any) => (
|
||||
<Select.Option key={e}>{e}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Row>
|
||||
)}
|
||||
<Row align="middle" className={mr}>
|
||||
<span className="mr10">推送组数</span>
|
||||
<InputNumber
|
||||
precision={0}
|
||||
value={count}
|
||||
style={{ width: type === '2' ? 98 : 218 }}
|
||||
onChange={(k) => setCount(k)}
|
||||
/>
|
||||
</Row>
|
||||
<Button onClick={push} type="primary">
|
||||
推送
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ basic }: { basic: BasicInfoModelState }) => ({
|
||||
basic,
|
||||
}))(Page);
|
@ -0,0 +1,166 @@
|
||||
.page {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.iframe {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
height: 300px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.list {
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 20px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.bar {
|
||||
height: 2px;
|
||||
width: 100%;
|
||||
background: #000;
|
||||
cursor: ns-resize;
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
i {
|
||||
color: #000000;
|
||||
font-size: 12px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.s0 {
|
||||
flex: 0 0 50px !important;
|
||||
text-align: center !important;
|
||||
|
||||
> i {
|
||||
cursor: pointer;
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
.s1 {
|
||||
flex: 1 !important;
|
||||
}
|
||||
|
||||
.s2 {
|
||||
flex: 2 !important;
|
||||
}
|
||||
|
||||
.s3 {
|
||||
flex: 3 !important;
|
||||
}
|
||||
|
||||
.progress {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.pw {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
height: 8px;
|
||||
background: #07c160;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.t {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.head {
|
||||
height: 60px;
|
||||
background: #e6e6e6;
|
||||
display: flex;
|
||||
|
||||
> div {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
border-left: 1px solid #979797;
|
||||
}
|
||||
|
||||
> div:first-child {
|
||||
border-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.headTitle {
|
||||
height: 38px;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
|
||||
> div {
|
||||
height: 38px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
|
||||
> div {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
height: 58px;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #eef2f8;
|
||||
|
||||
> div {
|
||||
height: 58px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #232b40;
|
||||
|
||||
> div {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no {
|
||||
pointer-events: none !important;
|
||||
user-select: none;
|
||||
}
|
@ -0,0 +1,665 @@
|
||||
import styles from './index.less';
|
||||
import {
|
||||
message,
|
||||
Input,
|
||||
Button,
|
||||
Row,
|
||||
Modal,
|
||||
Form,
|
||||
Table,
|
||||
Empty,
|
||||
Col,
|
||||
Select,
|
||||
DatePicker,
|
||||
} from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect, useState, FC, Fragment, useRef } from 'react';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { ColumnsType } from 'antd/lib/table';
|
||||
const RangePicker: any = DatePicker.RangePicker;
|
||||
import moment from 'moment';
|
||||
|
||||
const testData = {
|
||||
id: 1,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
deviceId: 'h55g66',
|
||||
name: '测试设备1',
|
||||
type: 1,
|
||||
producerId: 1,
|
||||
status: '0',
|
||||
distributionId: 0,
|
||||
addTime: '2022-08-11 08:50',
|
||||
producer: null,
|
||||
deviceType: null,
|
||||
deviceList: null,
|
||||
aText: '正在封装资源',
|
||||
aProgress: 0,
|
||||
bText: '正在封装资源',
|
||||
bProgress: 0,
|
||||
cText: '正在封装资源',
|
||||
cProgress: 0,
|
||||
};
|
||||
|
||||
const Progress = ({ item, onFinish, start, setVisible }: any) => {
|
||||
const [data, setData] = useState<any>({});
|
||||
const timer = useRef<any>(null);
|
||||
const dataSave = useRef<any>({});
|
||||
|
||||
useEffect(() => {
|
||||
if (item.id) {
|
||||
dataSave.current = item;
|
||||
setData(item);
|
||||
}
|
||||
}, [item]);
|
||||
|
||||
useEffect(() => {
|
||||
if (start) {
|
||||
recursionFun();
|
||||
}
|
||||
return () => {
|
||||
clearTimeout(timer.current);
|
||||
};
|
||||
}, [start]);
|
||||
|
||||
const rand = (m: number, n: number) => {
|
||||
return Math.ceil(Math.random() * (n - m + 1) + m - 1);
|
||||
};
|
||||
|
||||
const recursionFun = () => {
|
||||
clearTimeout(timer.current);
|
||||
const newItem = cloneDeep(dataSave.current);
|
||||
const array = [
|
||||
['aText', 'aProgress'],
|
||||
['bText', 'bProgress'],
|
||||
['cText', 'cProgress'],
|
||||
];
|
||||
const arrayIndex = newItem.type > 2 ? 0 : newItem.type;
|
||||
const arrayItem = array[arrayIndex];
|
||||
const dataNum = rand(5, 10);
|
||||
let total = newItem[arrayItem[1]] + dataNum;
|
||||
if (total >= 100) {
|
||||
newItem[arrayItem[1]] = 100;
|
||||
newItem[arrayItem[0]] = '资源写入完成';
|
||||
} else if (total < 15) {
|
||||
newItem[arrayItem[1]] = total;
|
||||
newItem[arrayItem[0]] = '正在封装资源';
|
||||
} else {
|
||||
newItem[arrayItem[1]] = total;
|
||||
newItem[arrayItem[0]] = '正在写入';
|
||||
}
|
||||
if (newItem.aProgress + newItem.bProgress + newItem.cProgress !== 100) {
|
||||
timer.current = setTimeout(() => {
|
||||
recursionFun();
|
||||
}, (10 - dataNum) * 1000);
|
||||
} else {
|
||||
newItem.state = 'done';
|
||||
console.log(newItem, 'newItem');
|
||||
onFinish(newItem);
|
||||
}
|
||||
setData(newItem);
|
||||
dataSave.current = newItem;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.row}>
|
||||
<div className={styles.s2}>
|
||||
<div className={styles.s1}>{data.deviceId}</div>
|
||||
<div className={styles.s2}>{data.name}</div>
|
||||
<div
|
||||
className={styles.s0}
|
||||
style={{ pointerEvents: start ? 'none' : 'auto' }}
|
||||
>
|
||||
{data.type !== 3 ? (
|
||||
<i
|
||||
onClick={() => setVisible(data)}
|
||||
className="iconfont icon-bianji10"
|
||||
/>
|
||||
) : (
|
||||
<i
|
||||
className="iconfont icon-bianji10"
|
||||
style={{ cursor: 'not-allowed', color: '#999' }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.s1}>
|
||||
<div>{data.aText}</div>
|
||||
<div className={styles.progress}>
|
||||
<div className={styles.pw}>
|
||||
<span
|
||||
style={{ width: `${data.aProgress}%` }}
|
||||
className={styles.p}
|
||||
></span>
|
||||
</div>
|
||||
<div className={styles.t}>{data.aProgress}%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.s1}>
|
||||
<div>{data.bText}</div>
|
||||
<div className={styles.progress}>
|
||||
<div className={styles.pw}>
|
||||
<span
|
||||
style={{ width: `${data.bProgress}%` }}
|
||||
className={styles.p}
|
||||
></span>
|
||||
</div>
|
||||
<div className={styles.t}>{data.bProgress}%</div>
|
||||
</div>
|
||||
<div
|
||||
className={styles.s0}
|
||||
style={{ pointerEvents: start ? 'none' : 'auto' }}
|
||||
>
|
||||
{data.type === 1 ? (
|
||||
<i
|
||||
// onClick={() => setVisible(data)}
|
||||
className="iconfont icon-bianji10"
|
||||
/>
|
||||
) : (
|
||||
<i
|
||||
className="iconfont icon-bianji10"
|
||||
style={{ cursor: 'not-allowed', color: '#999' }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.s1}>
|
||||
<div>{data.cText}</div>
|
||||
<div className={styles.progress}>
|
||||
<div className={styles.pw}>
|
||||
<span
|
||||
style={{ width: `${data.cProgress}%` }}
|
||||
className={styles.p}
|
||||
></span>
|
||||
</div>
|
||||
<div className={styles.t}>{data.cProgress}%</div>
|
||||
</div>
|
||||
<div
|
||||
className={styles.s0}
|
||||
style={{ pointerEvents: start ? 'none' : 'auto' }}
|
||||
>
|
||||
{data.type === 2 ? (
|
||||
<i
|
||||
// onClick={() => setVisible(data)}
|
||||
className="iconfont icon-bianji10"
|
||||
/>
|
||||
) : (
|
||||
<i
|
||||
className="iconfont icon-bianji10"
|
||||
style={{ cursor: 'not-allowed', color: '#999' }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const Page = () => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [data, setData] = useState<any>([]);
|
||||
const [disabled, setDisabled] = useState<boolean>(false);
|
||||
const [start, setStart] = useState<boolean>(false);
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
|
||||
const [visible, setVisible] = useState<any>(false);
|
||||
const [modalData, setModalData] = useState<any>([]);
|
||||
const [modalSelectKey, setModalSelectKey] = useState<any>([]);
|
||||
|
||||
const [deviceList, setDeviceList] = useState<any[]>([]);
|
||||
|
||||
const resizeBar = useRef<any>(null);
|
||||
const resizeBox = useRef<any>(null);
|
||||
const iframeBox = useRef<any>(null);
|
||||
const dataSave = useRef<any>([]);
|
||||
|
||||
console.log(data, 'data');
|
||||
|
||||
useEffect(() => {
|
||||
document.title = '栅格化密码管理基础设施';
|
||||
getDeviceList();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
getModalData({});
|
||||
setModalSelectKey(visible?.keys || []);
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('message', getData, false);
|
||||
return () => {
|
||||
window.removeEventListener('message', getData, false);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const getDeviceList = async () => {
|
||||
const res = await Fetch('/openi/deviceType/list');
|
||||
if (res.result === 'success') {
|
||||
const data = res?.data?.[0];
|
||||
setDeviceList(data);
|
||||
}
|
||||
};
|
||||
|
||||
const getData = (e: any) => {
|
||||
if (
|
||||
e.origin === 'https://edu-xnfz.educoder.net' ||
|
||||
e.origin === 'http://localhost:81'
|
||||
) {
|
||||
console.log(e.data, 22222);
|
||||
let newData: any = [];
|
||||
try {
|
||||
if (e.data) {
|
||||
newData = JSON.parse(e.data);
|
||||
}
|
||||
} catch (s) {
|
||||
newData = eval('(' + e.data + ')');
|
||||
}
|
||||
if (dataSave.current.length === newData.length) return;
|
||||
|
||||
let realData = [];
|
||||
|
||||
if (dataSave.current.length > newData.length) {
|
||||
realData = dataSave.current.filter((e: any) => {
|
||||
if (newData.some((l: any) => l?.id === e?.id)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if (dataSave.current.length < newData.length) {
|
||||
const param = newData.find((e: any) => {
|
||||
if (!dataSave.current.map((l: any) => l?.id).includes(e?.id)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
param.name = '';
|
||||
param.keys = [];
|
||||
if (param.u3dType === 2) {
|
||||
param.type = 1;
|
||||
param.bText = '开机棒连接成功';
|
||||
} else if (param.u3dType === 3) {
|
||||
param.type = 2;
|
||||
param.cText = '授启棒连接成功';
|
||||
} else if (param.u3dType === 1) {
|
||||
param.type = 4;
|
||||
param.aText = '注入器连接成功';
|
||||
} else {
|
||||
param.type = 3;
|
||||
param.aText = '密码设备连接成功';
|
||||
param.name = `${param.deviceType?.typeNumber}_${param.deviceId}`;
|
||||
}
|
||||
realData = [
|
||||
...dataSave.current,
|
||||
{
|
||||
...param,
|
||||
aProgress: 0,
|
||||
bProgress: 0,
|
||||
cProgress: 0,
|
||||
},
|
||||
];
|
||||
}
|
||||
setData(realData);
|
||||
dataSave.current = cloneDeep(realData);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (resizeBar.current) {
|
||||
let h = 0;
|
||||
let dragging = false;
|
||||
let startY = 0;
|
||||
function onMouseDown(e: any) {
|
||||
dragging = true;
|
||||
iframeBox.current.style.pointerEvents = 'none';
|
||||
document.body.style.cursor = 'ns-resize';
|
||||
h = resizeBox.current.offsetHeight;
|
||||
startY = e.clientY;
|
||||
document.onselectstart = function () {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
function onMouseUp() {
|
||||
dragging = false;
|
||||
iframeBox.current.style.pointerEvents = 'auto';
|
||||
document.body.style.cursor = 'initial';
|
||||
document.onselectstart = null;
|
||||
}
|
||||
function onMouseMove(e: any) {
|
||||
if (dragging) {
|
||||
let delta = startY - e.clientY;
|
||||
let resizeH = h + delta;
|
||||
if (resizeH < 10) {
|
||||
resizeH = 10;
|
||||
}
|
||||
if (resizeH > window.innerHeight - 30) {
|
||||
resizeH = window.innerHeight - 30;
|
||||
}
|
||||
resizeBox.current.style.height = resizeH + 'px';
|
||||
}
|
||||
}
|
||||
const dom: any = resizeBar.current;
|
||||
dom.addEventListener('mousedown', onMouseDown);
|
||||
window.addEventListener('mousemove', onMouseMove);
|
||||
window.addEventListener('mouseup', onMouseUp);
|
||||
return () => {
|
||||
const dom: any = resizeBar.current;
|
||||
dom.removeEventListener('mousedown', onMouseDown);
|
||||
window.removeEventListener('mousemove', onMouseMove);
|
||||
window.removeEventListener('mouseup', onMouseUp);
|
||||
};
|
||||
}
|
||||
}, [resizeBar]);
|
||||
|
||||
const handleFinish = (v: any) => {
|
||||
const newData = dataSave.current.map((e: any) => {
|
||||
if (e.id === v.id) {
|
||||
return { ...v };
|
||||
}
|
||||
return e;
|
||||
});
|
||||
if (newData.every((e: any) => e.state === 'done')) {
|
||||
setDisabled(true);
|
||||
setLoading(false);
|
||||
// setStart(false);
|
||||
message.success('初装成功,正在重置页面');
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 500);
|
||||
}
|
||||
setData(newData);
|
||||
dataSave.current = newData;
|
||||
};
|
||||
|
||||
const handleClick = async () => {
|
||||
const bool = dataSave.current.every((e: any) => e.name);
|
||||
if (!bool) {
|
||||
message.warn('请添加设备物理标志');
|
||||
return;
|
||||
}
|
||||
let deviceList: any = [];
|
||||
dataSave.current.forEach((e: any) => {
|
||||
deviceList.push(e.id);
|
||||
deviceList = deviceList.concat(e.keys || []);
|
||||
});
|
||||
deviceList = deviceList.map((id: any) => {
|
||||
return { id, status: '1' };
|
||||
});
|
||||
const res = await Fetch(`/openi/device/configureDevice`, {
|
||||
method: 'post',
|
||||
data: {
|
||||
deviceList,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
iframeBox.current.className = styles.iframe + ' ' + styles.no;
|
||||
setStart(true);
|
||||
setLoading(true);
|
||||
setDisabled(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleModalFinish = async (v: any) => {
|
||||
const params = { ...v };
|
||||
if (v.time) {
|
||||
params.startDate =
|
||||
moment(v?.time?.[0]).format('YYYY-MM-DD') + ' 00:00:00';
|
||||
params.endDate = moment(v?.time?.[1]).format('YYYY-MM-DD') + ' 23:59:59';
|
||||
delete params.time;
|
||||
}
|
||||
getModalData(params);
|
||||
};
|
||||
|
||||
const columns: ColumnsType<any> = [
|
||||
{
|
||||
width: 120,
|
||||
title: '编号',
|
||||
dataIndex: 'index',
|
||||
render: (_: string, __: any, index: number) => index + 1,
|
||||
},
|
||||
{
|
||||
title: '设备物理标识',
|
||||
dataIndex: 'deviceType',
|
||||
render: (v: any, r: any) => (
|
||||
<span>
|
||||
{v?.typeNumber}_{r.deviceId}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '注册时间',
|
||||
dataIndex: 'addTime',
|
||||
},
|
||||
{
|
||||
width: 120,
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
render: (v: any, r: any) =>
|
||||
v === '1' ? (
|
||||
<span style={{ color: 'green' }}>已初装</span>
|
||||
) : (
|
||||
<span>未初装</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const getModalData = async (record: any) => {
|
||||
const res = await Fetch('/openi/device/page', {
|
||||
method: 'get',
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 100000,
|
||||
...record,
|
||||
},
|
||||
});
|
||||
if (res.result === 'success') {
|
||||
const item = res?.data?.[0]?.list;
|
||||
setModalData(item);
|
||||
} else {
|
||||
message.warn(res.errorMsg);
|
||||
}
|
||||
};
|
||||
|
||||
const handleOk = async () => {
|
||||
if (!modalSelectKey.length) {
|
||||
message.warn('请选择一个设备');
|
||||
return;
|
||||
}
|
||||
const items = modalData.filter((e: any) => modalSelectKey.includes(e.id));
|
||||
let str = '';
|
||||
if (items.length === 1) {
|
||||
str = `${items[0]?.deviceType?.typeNumber}_${items[0]?.deviceId}`;
|
||||
}
|
||||
if (items.length > 1) {
|
||||
str = `${items[0]?.deviceType?.typeNumber}_${items[0]?.deviceId} ~ ${
|
||||
items[items.length - 1]?.deviceType?.typeNumber
|
||||
}_${items[items.length - 1]?.deviceId}`;
|
||||
}
|
||||
const param = cloneDeep(visible);
|
||||
param.name = str;
|
||||
param.keys = items.map((e: any) => e.id);
|
||||
const newData = cloneDeep(data).map((e: any) => {
|
||||
if (e.id === param.id) {
|
||||
return param;
|
||||
}
|
||||
return e;
|
||||
});
|
||||
console.log(newData, 22244);
|
||||
setData(newData);
|
||||
dataSave.current = newData;
|
||||
setVisible(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<iframe
|
||||
className={styles.iframe}
|
||||
src={
|
||||
process.env.NODE_ENV === 'development' ||
|
||||
window.location.origin === 'http://47.111.130.18:56841'
|
||||
? 'https://edu-xnfz.educoder.net/Test/Hejidong/SheBeiChuZhuang1_0/index.html'
|
||||
: 'http://localhost:81'
|
||||
}
|
||||
ref={iframeBox}
|
||||
frameBorder={0}
|
||||
></iframe>
|
||||
<div ref={resizeBox} className={styles.wrap}>
|
||||
<div className={styles.bar} ref={resizeBar} draggable={false}>
|
||||
<i className="iconfont icon-guangbiao" draggable={false}></i>
|
||||
</div>
|
||||
<div className={styles.list}>
|
||||
<div className={styles.head}>
|
||||
<div className={styles.s2}>待初装设备信息</div>
|
||||
<div className={styles.s1}>密码设备接口</div>
|
||||
<div className={styles.s1}>开机载体接口</div>
|
||||
<div className={styles.s1}>授启载体接口</div>
|
||||
</div>
|
||||
<div className={styles.headTitle}>
|
||||
<div className={styles.s2}>
|
||||
<div className={styles.s1}>接口板编号</div>
|
||||
<div className={styles.s2}>设备物理标志</div>
|
||||
<div className={styles.s0}>编辑</div>
|
||||
</div>
|
||||
<div className={styles.s1}>
|
||||
<div>接入状态</div>
|
||||
<div>执行状态</div>
|
||||
</div>
|
||||
<div className={styles.s1}>
|
||||
<div>接入状态</div>
|
||||
<div>执行状态</div>
|
||||
<div className={styles.s0}>编辑</div>
|
||||
</div>
|
||||
<div className={styles.s1}>
|
||||
<div>接入状态</div>
|
||||
<div>执行状态</div>
|
||||
<div className={styles.s0}>编辑</div>
|
||||
</div>
|
||||
</div>
|
||||
{!!data.length ? (
|
||||
data.map((e: any) => (
|
||||
<Progress
|
||||
key={e.id}
|
||||
item={e}
|
||||
start={start}
|
||||
setVisible={setVisible}
|
||||
onFinish={handleFinish}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<Empty className="mt10" />
|
||||
)}
|
||||
<Button
|
||||
onClick={handleClick}
|
||||
loading={loading}
|
||||
type="primary"
|
||||
ghost
|
||||
disabled={disabled || data.length === 0}
|
||||
className={styles.btn}
|
||||
>
|
||||
开始初装
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Modal
|
||||
centered
|
||||
title="设备详细信息"
|
||||
visible={visible}
|
||||
okText="确认"
|
||||
width={924}
|
||||
afterClose={() => {
|
||||
form.resetFields();
|
||||
setModalSelectKey([]);
|
||||
setModalData([]);
|
||||
}}
|
||||
cancelText="取消"
|
||||
onOk={handleOk}
|
||||
onCancel={() => {
|
||||
setVisible(false);
|
||||
}}
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
colon={false}
|
||||
onFinish={handleModalFinish}
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item label="装备类型" name="type" initialValue={''}>
|
||||
<Select>
|
||||
<Select.Option key={''}>全部类型</Select.Option>
|
||||
{deviceList?.map((e) => (
|
||||
<Select.Option value={e.id} key={e.id}>
|
||||
{e.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="注册时间" name="time" initialValue={''}>
|
||||
<RangePicker style={{ width: 328 }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row align="middle">
|
||||
<Col span={12}>
|
||||
<Form.Item label="资源状态" name="status" initialValue={''}>
|
||||
<Select>
|
||||
<Select.Option key={''}>全部状态</Select.Option>
|
||||
<Select.Option key={'0'}>未初装</Select.Option>
|
||||
<Select.Option key={'1'}>已初装</Select.Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="铭牌号" name="deviceId" initialValue={''}>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row justify="end">
|
||||
<Form.Item>
|
||||
<Button
|
||||
className="mr20"
|
||||
onClick={() => {
|
||||
form.resetFields();
|
||||
getModalData({});
|
||||
}}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">
|
||||
查询
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Row>
|
||||
</Form>
|
||||
<Table
|
||||
dataSource={modalData}
|
||||
rowSelection={{
|
||||
hideSelectAll: true,
|
||||
type: visible?.type === 4 ? 'checkbox' : 'radio',
|
||||
selectedRowKeys: modalSelectKey,
|
||||
onChange: (selectedRowKeys: any[], selectedRows: any[]) => {
|
||||
setModalSelectKey(selectedRowKeys);
|
||||
},
|
||||
}}
|
||||
bordered={false}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
scroll={{ y: 400 }}
|
||||
pagination={false}
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Page;
|
@ -0,0 +1,23 @@
|
||||
import { useEffect } from 'react';
|
||||
import { history, getDvaApp } from 'umi';
|
||||
import { ConfigProvider } from 'antd';
|
||||
import zhCN from 'antd/es/locale/zh_CN';
|
||||
import '@/styles/base.less';
|
||||
import '@/styles/iconfont/iconfont.css';
|
||||
|
||||
const IndexPage = ({ ...props }) => {
|
||||
//重定向页面
|
||||
useEffect(() => {
|
||||
const basic = ['/', '/basic/device', '/basic/certificate'];
|
||||
if (basic.includes(props.location.pathname)) {
|
||||
history.replace('/basic');
|
||||
}
|
||||
getDvaApp()._store.dispatch({
|
||||
type: 'basic/getSelectData',
|
||||
payload: {},
|
||||
});
|
||||
}, []);
|
||||
|
||||
return <ConfigProvider locale={zhCN}>{props.children}</ConfigProvider>;
|
||||
};
|
||||
export default IndexPage;
|
@ -0,0 +1,8 @@
|
||||
import Fetch from '@/utils/fetch';
|
||||
|
||||
export async function getSelectData(params: any) {
|
||||
return Fetch(`/openi/sysDict/all`, {
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
@ -0,0 +1,564 @@
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.primary-color {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
.mt0 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.mt3 {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.mt4 {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.mt5 {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.mt6 {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.mt8 {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.mt10 {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
|
||||
.mt12 {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.mt15 {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.mt17 {
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
||||
.mt20 {
|
||||
margin-top: 20px !important;
|
||||
}
|
||||
|
||||
.mt25 {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.mt30 {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.mt35 {
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
.mt40 {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.mt50 {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.mt60 {
|
||||
margin-top: 60px;
|
||||
}
|
||||
|
||||
.mt70 {
|
||||
margin-top: 70px;
|
||||
}
|
||||
|
||||
.mt75 {
|
||||
margin-top: 75px;
|
||||
}
|
||||
|
||||
.mt80 {
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
.mt100 {
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.ml0 {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.ml2 {
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.ml5 {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.ml8 {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.ml10 {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.ml10soft {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ml15 {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.ml20 {
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
.ml25 {
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
.ml30 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.ml35 {
|
||||
margin-left: 35px;
|
||||
}
|
||||
|
||||
.ml40 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.ml50 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.ml60 {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
.ml90 {
|
||||
margin-left: 90px;
|
||||
}
|
||||
|
||||
.ml100 {
|
||||
margin-left: 100px;
|
||||
}
|
||||
|
||||
.mr0 {
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.mr1 {
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
.mr3 {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.mr5 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.mr8 {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.mr10 {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.mr15 {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.mr20 {
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
|
||||
.mr25 {
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.mr30 {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.mr32 {
|
||||
margin-right: 32px;
|
||||
}
|
||||
|
||||
.mr40 {
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.mr50 {
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
.mb0 {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.mb5 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.mb10 {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.mb16 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.mb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mb25 {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.mb30 {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.mb50 {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.mb60 {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.mb80 {
|
||||
margin-bottom: 80px;
|
||||
}
|
||||
|
||||
.mb100 {
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.mtb20 {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.p0 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p12 {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.p16 {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.p20 {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.p30 {
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.pt2 {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.pt5 {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.pt8 {
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.pt10 {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.pt20 {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.pt30 {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.pt40 {
|
||||
padding-top: 40px;
|
||||
}
|
||||
|
||||
.pt60 {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.pb0 {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.pb5 {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.pb8 {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.pb10 {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.pb12 {
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.pb20 {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.pb30 {
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.pb40 {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.pb50 {
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
.pb60 {
|
||||
padding-bottom: 60px;
|
||||
}
|
||||
|
||||
.pr5 {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.pr10 {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.pr20 {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.pr25 {
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
||||
.pr30 {
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.pr40 {
|
||||
padding-right: 40px;
|
||||
}
|
||||
|
||||
.pl0 {
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.pl8 {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.pl10 {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.pl12 {
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.pl15 {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.pl20 {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.pl25 {
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.pl30 {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
.pl40 {
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
.pl60 {
|
||||
padding-left: 60px;
|
||||
}
|
||||
|
||||
.pl70 {
|
||||
padding-left: 70px;
|
||||
}
|
||||
|
||||
.pl80 {
|
||||
padding-left: 80px;
|
||||
}
|
||||
|
||||
.plr20 {
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.plr30 {
|
||||
padding-left: 30px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.tl {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tc {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tr {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.c-green-shixun {
|
||||
color: #43d7b5;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block;
|
||||
_display: block;
|
||||
}
|
||||
|
||||
.minHb100 {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.minH200 {
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.minH500 {
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.minH1000 {
|
||||
min-height: 1000px;
|
||||
}
|
||||
|
||||
.minH1050 {
|
||||
min-height: 1050px;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
_display: none;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.overflow_hidden {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.zIndexf1 {
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.font8 {
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.font12 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.font13 {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.font14 {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
.font15 {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.font16 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.font17 {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.font18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.font19 {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
.font20 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.font22 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.font24 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.font26 {
|
||||
font-size: 26px !important;
|
||||
}
|
||||
|
||||
.font28 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.font40 {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.font50 {
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.line14 {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.line24 {
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.line26 {
|
||||
line-height: 26px;
|
||||
}
|
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,234 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3579477 */
|
||||
src: url('iconfont.eot?t=1663901035581'); /* IE9 */
|
||||
src: url('iconfont.eot?t=1663901035581#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('iconfont.woff2?t=1663901035581') format('woff2'),
|
||||
url('iconfont.woff?t=1663901035581') format('woff'),
|
||||
url('iconfont.ttf?t=1663901035581') format('truetype'),
|
||||
url('iconfont.svg?t=1663901035581#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-chaxun:before {
|
||||
content: "\ec4c";
|
||||
}
|
||||
|
||||
.icon-tongji:before {
|
||||
content: "\e89e";
|
||||
}
|
||||
|
||||
.icon-piliangshanchubeifen:before {
|
||||
content: "\e9e3";
|
||||
}
|
||||
|
||||
.icon-bianji10:before {
|
||||
content: "\ea4b";
|
||||
}
|
||||
|
||||
.icon-fujian:before {
|
||||
content: "\e671";
|
||||
}
|
||||
|
||||
.icon-guangbiao:before {
|
||||
content: "\e7c4";
|
||||
}
|
||||
|
||||
.icon-xiazai:before {
|
||||
content: "\e670";
|
||||
}
|
||||
|
||||
.icon-xuanzeshebei:before {
|
||||
content: "\e66e";
|
||||
}
|
||||
|
||||
.icon-daorushebei:before {
|
||||
content: "\e66f";
|
||||
}
|
||||
|
||||
.icon-daorushuju2:before {
|
||||
content: "\e716";
|
||||
}
|
||||
|
||||
.icon-weitongguo:before {
|
||||
content: "\e66c";
|
||||
}
|
||||
|
||||
.icon-jingxiang:before {
|
||||
content: "\e9e7";
|
||||
}
|
||||
|
||||
.icon-wodegongzuotai:before {
|
||||
content: "\e9ee";
|
||||
}
|
||||
|
||||
.icon-chuangjianjiahao:before {
|
||||
content: "\ea79";
|
||||
}
|
||||
|
||||
.icon-chakan2:before {
|
||||
content: "\ea7a";
|
||||
}
|
||||
|
||||
.icon-zhongduan:before {
|
||||
content: "\ea7b";
|
||||
}
|
||||
|
||||
.icon-fuwuqi:before {
|
||||
content: "\ea7c";
|
||||
}
|
||||
|
||||
.icon-shouqixiaojiantou:before {
|
||||
content: "\ea7d";
|
||||
}
|
||||
|
||||
.icon-zhankaixiaojiantou:before {
|
||||
content: "\ea7e";
|
||||
}
|
||||
|
||||
.icon-a-dashujushujujiegouguanxiguanxifenxigongtonglianxirenzuzhi1:before {
|
||||
content: "\e715";
|
||||
}
|
||||
|
||||
.icon-changshangxinxiguanli:before {
|
||||
content: "\e701";
|
||||
}
|
||||
|
||||
.icon-peifaguanli:before {
|
||||
content: "\e702";
|
||||
}
|
||||
|
||||
.icon-gongsiyueduiziyuan:before {
|
||||
content: "\e707";
|
||||
}
|
||||
|
||||
.icon-ruanjianziyuan:before {
|
||||
content: "\e709";
|
||||
}
|
||||
|
||||
.icon-suanfacanshuziyuan:before {
|
||||
content: "\e70a";
|
||||
}
|
||||
|
||||
.icon-xinghaoguanli:before {
|
||||
content: "\e70b";
|
||||
}
|
||||
|
||||
.icon-xinxichaxun:before {
|
||||
content: "\e70d";
|
||||
}
|
||||
|
||||
.icon-xinxitongji:before {
|
||||
content: "\e70e";
|
||||
}
|
||||
|
||||
.icon-yuzhiziyuan:before {
|
||||
content: "\e712";
|
||||
}
|
||||
|
||||
.icon-zhucedengji:before {
|
||||
content: "\e713";
|
||||
}
|
||||
|
||||
.icon-suanfaluojiziyuan:before {
|
||||
content: "\e714";
|
||||
}
|
||||
|
||||
.icon-shouqi:before {
|
||||
content: "\e700";
|
||||
}
|
||||
|
||||
.icon-guanbi:before {
|
||||
content: "\e703";
|
||||
}
|
||||
|
||||
.icon-sousuo:before {
|
||||
content: "\e704";
|
||||
}
|
||||
|
||||
.icon-shanchuzhuangbeixinghao:before {
|
||||
content: "\e705";
|
||||
}
|
||||
|
||||
.icon-a-shuaxin2:before {
|
||||
content: "\e706";
|
||||
}
|
||||
|
||||
.icon-tianjia:before {
|
||||
content: "\e708";
|
||||
}
|
||||
|
||||
.icon-xiala:before {
|
||||
content: "\e70c";
|
||||
}
|
||||
|
||||
.icon-xiugaikucundixian:before {
|
||||
content: "\e70f";
|
||||
}
|
||||
|
||||
.icon-tuichu:before {
|
||||
content: "\e710";
|
||||
}
|
||||
|
||||
.icon-zhongzhi:before {
|
||||
content: "\e711";
|
||||
}
|
||||
|
||||
.icon-jiantou:before {
|
||||
content: "\e66b";
|
||||
}
|
||||
|
||||
.icon-bianzu:before {
|
||||
content: "\e65f";
|
||||
}
|
||||
|
||||
.icon-mimaruanjianjiami:before {
|
||||
content: "\e660";
|
||||
}
|
||||
|
||||
.icon-jiedian:before {
|
||||
content: "\e661";
|
||||
}
|
||||
|
||||
.icon-chanshenggongsiyuedui:before {
|
||||
content: "\e662";
|
||||
}
|
||||
|
||||
.icon-suanfaluojijiami:before {
|
||||
content: "\e663";
|
||||
}
|
||||
|
||||
.icon-shuju:before {
|
||||
content: "\e664";
|
||||
}
|
||||
|
||||
.icon-shujuji:before {
|
||||
content: "\e665";
|
||||
}
|
||||
|
||||
.icon-suanfacanshujiami:before {
|
||||
content: "\e666";
|
||||
}
|
||||
|
||||
.icon-rengongzhineng:before {
|
||||
content: "\e667";
|
||||
}
|
||||
|
||||
.icon-yuzhimiyuejiami:before {
|
||||
content: "\e668";
|
||||
}
|
||||
|
||||
.icon-suanfasheji:before {
|
||||
content: "\e669";
|
||||
}
|
||||
|
||||
.icon-yunjisuan:before {
|
||||
content: "\e66a";
|
||||
}
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,387 @@
|
||||
{
|
||||
"id": "3579477",
|
||||
"name": "信工大图标库",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "5961297",
|
||||
"name": "查询",
|
||||
"font_class": "chaxun",
|
||||
"unicode": "ec4c",
|
||||
"unicode_decimal": 60492
|
||||
},
|
||||
{
|
||||
"icon_id": "10520233",
|
||||
"name": "统计",
|
||||
"font_class": "tongji",
|
||||
"unicode": "e89e",
|
||||
"unicode_decimal": 59550
|
||||
},
|
||||
{
|
||||
"icon_id": "27904347",
|
||||
"name": "批量删除备份",
|
||||
"font_class": "piliangshanchubeifen",
|
||||
"unicode": "e9e3",
|
||||
"unicode_decimal": 59875
|
||||
},
|
||||
{
|
||||
"icon_id": "29889324",
|
||||
"name": "编辑",
|
||||
"font_class": "bianji10",
|
||||
"unicode": "ea4b",
|
||||
"unicode_decimal": 59979
|
||||
},
|
||||
{
|
||||
"icon_id": "826201",
|
||||
"name": "附件",
|
||||
"font_class": "fujian",
|
||||
"unicode": "e671",
|
||||
"unicode_decimal": 58993
|
||||
},
|
||||
{
|
||||
"icon_id": "17272329",
|
||||
"name": "光标",
|
||||
"font_class": "guangbiao",
|
||||
"unicode": "e7c4",
|
||||
"unicode_decimal": 59332
|
||||
},
|
||||
{
|
||||
"icon_id": "31306044",
|
||||
"name": "下载",
|
||||
"font_class": "xiazai",
|
||||
"unicode": "e670",
|
||||
"unicode_decimal": 58992
|
||||
},
|
||||
{
|
||||
"icon_id": "31305208",
|
||||
"name": "选择设备",
|
||||
"font_class": "xuanzeshebei",
|
||||
"unicode": "e66e",
|
||||
"unicode_decimal": 58990
|
||||
},
|
||||
{
|
||||
"icon_id": "31305209",
|
||||
"name": "导入设备",
|
||||
"font_class": "daorushebei",
|
||||
"unicode": "e66f",
|
||||
"unicode_decimal": 58991
|
||||
},
|
||||
{
|
||||
"icon_id": "31258224",
|
||||
"name": "导入数据",
|
||||
"font_class": "daorushuju2",
|
||||
"unicode": "e716",
|
||||
"unicode_decimal": 59158
|
||||
},
|
||||
{
|
||||
"icon_id": "31225732",
|
||||
"name": "未通过",
|
||||
"font_class": "weitongguo",
|
||||
"unicode": "e66c",
|
||||
"unicode_decimal": 58988
|
||||
},
|
||||
{
|
||||
"icon_id": "31206162",
|
||||
"name": "镜像",
|
||||
"font_class": "jingxiang",
|
||||
"unicode": "e9e7",
|
||||
"unicode_decimal": 59879
|
||||
},
|
||||
{
|
||||
"icon_id": "31206163",
|
||||
"name": "我的工作台",
|
||||
"font_class": "wodegongzuotai",
|
||||
"unicode": "e9ee",
|
||||
"unicode_decimal": 59886
|
||||
},
|
||||
{
|
||||
"icon_id": "31207787",
|
||||
"name": "创建加号",
|
||||
"font_class": "chuangjianjiahao",
|
||||
"unicode": "ea79",
|
||||
"unicode_decimal": 60025
|
||||
},
|
||||
{
|
||||
"icon_id": "31207788",
|
||||
"name": "查看",
|
||||
"font_class": "chakan2",
|
||||
"unicode": "ea7a",
|
||||
"unicode_decimal": 60026
|
||||
},
|
||||
{
|
||||
"icon_id": "31219592",
|
||||
"name": "终端",
|
||||
"font_class": "zhongduan",
|
||||
"unicode": "ea7b",
|
||||
"unicode_decimal": 60027
|
||||
},
|
||||
{
|
||||
"icon_id": "31219593",
|
||||
"name": "服务器",
|
||||
"font_class": "fuwuqi",
|
||||
"unicode": "ea7c",
|
||||
"unicode_decimal": 60028
|
||||
},
|
||||
{
|
||||
"icon_id": "31222118",
|
||||
"name": "收起小箭头",
|
||||
"font_class": "shouqixiaojiantou",
|
||||
"unicode": "ea7d",
|
||||
"unicode_decimal": 60029
|
||||
},
|
||||
{
|
||||
"icon_id": "31222119",
|
||||
"name": "展开小箭头",
|
||||
"font_class": "zhankaixiaojiantou",
|
||||
"unicode": "ea7e",
|
||||
"unicode_decimal": 60030
|
||||
},
|
||||
{
|
||||
"icon_id": "31215787",
|
||||
"name": "大数据",
|
||||
"font_class": "a-dashujushujujiegouguanxiguanxifenxigongtonglianxirenzuzhi1",
|
||||
"unicode": "e715",
|
||||
"unicode_decimal": 59157
|
||||
},
|
||||
{
|
||||
"icon_id": "31175964",
|
||||
"name": "厂商信息管理",
|
||||
"font_class": "changshangxinxiguanli",
|
||||
"unicode": "e701",
|
||||
"unicode_decimal": 59137
|
||||
},
|
||||
{
|
||||
"icon_id": "31175965",
|
||||
"name": "配发管理",
|
||||
"font_class": "peifaguanli",
|
||||
"unicode": "e702",
|
||||
"unicode_decimal": 59138
|
||||
},
|
||||
{
|
||||
"icon_id": "31175966",
|
||||
"name": "公私钥对资源",
|
||||
"font_class": "gongsiyueduiziyuan",
|
||||
"unicode": "e707",
|
||||
"unicode_decimal": 59143
|
||||
},
|
||||
{
|
||||
"icon_id": "31175967",
|
||||
"name": "软件资源",
|
||||
"font_class": "ruanjianziyuan",
|
||||
"unicode": "e709",
|
||||
"unicode_decimal": 59145
|
||||
},
|
||||
{
|
||||
"icon_id": "31175968",
|
||||
"name": "算法参数资源",
|
||||
"font_class": "suanfacanshuziyuan",
|
||||
"unicode": "e70a",
|
||||
"unicode_decimal": 59146
|
||||
},
|
||||
{
|
||||
"icon_id": "31175969",
|
||||
"name": "型号管理",
|
||||
"font_class": "xinghaoguanli",
|
||||
"unicode": "e70b",
|
||||
"unicode_decimal": 59147
|
||||
},
|
||||
{
|
||||
"icon_id": "31175970",
|
||||
"name": "信息查询",
|
||||
"font_class": "xinxichaxun",
|
||||
"unicode": "e70d",
|
||||
"unicode_decimal": 59149
|
||||
},
|
||||
{
|
||||
"icon_id": "31175971",
|
||||
"name": "信息统计",
|
||||
"font_class": "xinxitongji",
|
||||
"unicode": "e70e",
|
||||
"unicode_decimal": 59150
|
||||
},
|
||||
{
|
||||
"icon_id": "31175972",
|
||||
"name": "预制资源",
|
||||
"font_class": "yuzhiziyuan",
|
||||
"unicode": "e712",
|
||||
"unicode_decimal": 59154
|
||||
},
|
||||
{
|
||||
"icon_id": "31175973",
|
||||
"name": "注册登记",
|
||||
"font_class": "zhucedengji",
|
||||
"unicode": "e713",
|
||||
"unicode_decimal": 59155
|
||||
},
|
||||
{
|
||||
"icon_id": "31175976",
|
||||
"name": "算法逻辑资源",
|
||||
"font_class": "suanfaluojiziyuan",
|
||||
"unicode": "e714",
|
||||
"unicode_decimal": 59156
|
||||
},
|
||||
{
|
||||
"icon_id": "31169141",
|
||||
"name": "收起",
|
||||
"font_class": "shouqi",
|
||||
"unicode": "e700",
|
||||
"unicode_decimal": 59136
|
||||
},
|
||||
{
|
||||
"icon_id": "31169144",
|
||||
"name": "关闭",
|
||||
"font_class": "guanbi",
|
||||
"unicode": "e703",
|
||||
"unicode_decimal": 59139
|
||||
},
|
||||
{
|
||||
"icon_id": "31169145",
|
||||
"name": "搜索",
|
||||
"font_class": "sousuo",
|
||||
"unicode": "e704",
|
||||
"unicode_decimal": 59140
|
||||
},
|
||||
{
|
||||
"icon_id": "31169146",
|
||||
"name": "删除装备型号",
|
||||
"font_class": "shanchuzhuangbeixinghao",
|
||||
"unicode": "e705",
|
||||
"unicode_decimal": 59141
|
||||
},
|
||||
{
|
||||
"icon_id": "31169147",
|
||||
"name": "刷新 (2)",
|
||||
"font_class": "a-shuaxin2",
|
||||
"unicode": "e706",
|
||||
"unicode_decimal": 59142
|
||||
},
|
||||
{
|
||||
"icon_id": "31169149",
|
||||
"name": "添加",
|
||||
"font_class": "tianjia",
|
||||
"unicode": "e708",
|
||||
"unicode_decimal": 59144
|
||||
},
|
||||
{
|
||||
"icon_id": "31169153",
|
||||
"name": "下拉",
|
||||
"font_class": "xiala",
|
||||
"unicode": "e70c",
|
||||
"unicode_decimal": 59148
|
||||
},
|
||||
{
|
||||
"icon_id": "31169156",
|
||||
"name": "修改库存底线",
|
||||
"font_class": "xiugaikucundixian",
|
||||
"unicode": "e70f",
|
||||
"unicode_decimal": 59151
|
||||
},
|
||||
{
|
||||
"icon_id": "31169157",
|
||||
"name": "退出 ",
|
||||
"font_class": "tuichu",
|
||||
"unicode": "e710",
|
||||
"unicode_decimal": 59152
|
||||
},
|
||||
{
|
||||
"icon_id": "31169158",
|
||||
"name": "重置",
|
||||
"font_class": "zhongzhi",
|
||||
"unicode": "e711",
|
||||
"unicode_decimal": 59153
|
||||
},
|
||||
{
|
||||
"icon_id": "31164284",
|
||||
"name": "箭头",
|
||||
"font_class": "jiantou",
|
||||
"unicode": "e66b",
|
||||
"unicode_decimal": 58987
|
||||
},
|
||||
{
|
||||
"icon_id": "31161856",
|
||||
"name": "编组",
|
||||
"font_class": "bianzu",
|
||||
"unicode": "e65f",
|
||||
"unicode_decimal": 58975
|
||||
},
|
||||
{
|
||||
"icon_id": "31161857",
|
||||
"name": "密码软件加密",
|
||||
"font_class": "mimaruanjianjiami",
|
||||
"unicode": "e660",
|
||||
"unicode_decimal": 58976
|
||||
},
|
||||
{
|
||||
"icon_id": "31161858",
|
||||
"name": "节点",
|
||||
"font_class": "jiedian",
|
||||
"unicode": "e661",
|
||||
"unicode_decimal": 58977
|
||||
},
|
||||
{
|
||||
"icon_id": "31161859",
|
||||
"name": "产生公私钥对",
|
||||
"font_class": "chanshenggongsiyuedui",
|
||||
"unicode": "e662",
|
||||
"unicode_decimal": 58978
|
||||
},
|
||||
{
|
||||
"icon_id": "31161860",
|
||||
"name": "算法逻辑加密",
|
||||
"font_class": "suanfaluojijiami",
|
||||
"unicode": "e663",
|
||||
"unicode_decimal": 58979
|
||||
},
|
||||
{
|
||||
"icon_id": "31161861",
|
||||
"name": "数据",
|
||||
"font_class": "shuju",
|
||||
"unicode": "e664",
|
||||
"unicode_decimal": 58980
|
||||
},
|
||||
{
|
||||
"icon_id": "31161862",
|
||||
"name": "数据集",
|
||||
"font_class": "shujuji",
|
||||
"unicode": "e665",
|
||||
"unicode_decimal": 58981
|
||||
},
|
||||
{
|
||||
"icon_id": "31161863",
|
||||
"name": "算法参数加密",
|
||||
"font_class": "suanfacanshujiami",
|
||||
"unicode": "e666",
|
||||
"unicode_decimal": 58982
|
||||
},
|
||||
{
|
||||
"icon_id": "31161864",
|
||||
"name": "人工智能",
|
||||
"font_class": "rengongzhineng",
|
||||
"unicode": "e667",
|
||||
"unicode_decimal": 58983
|
||||
},
|
||||
{
|
||||
"icon_id": "31161865",
|
||||
"name": "预制密钥加密",
|
||||
"font_class": "yuzhimiyuejiami",
|
||||
"unicode": "e668",
|
||||
"unicode_decimal": 58984
|
||||
},
|
||||
{
|
||||
"icon_id": "31161866",
|
||||
"name": "算法设计",
|
||||
"font_class": "suanfasheji",
|
||||
"unicode": "e669",
|
||||
"unicode_decimal": 58985
|
||||
},
|
||||
{
|
||||
"icon_id": "31161867",
|
||||
"name": "云集算",
|
||||
"font_class": "yunjisuan",
|
||||
"unicode": "e66a",
|
||||
"unicode_decimal": 58986
|
||||
}
|
||||
]
|
||||
}
|
After Width: | Height: | Size: 46 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,75 @@
|
||||
//get下载
|
||||
export function downLoadLink(url: string, filename?: string) {
|
||||
let link = document.createElement('a');
|
||||
document.body.appendChild(link);
|
||||
link.href = url;
|
||||
if (filename) {
|
||||
link.title = filename;
|
||||
link.download = filename;
|
||||
}
|
||||
//兼容火狐浏览器
|
||||
let evt = document.createEvent('MouseEvents');
|
||||
evt.initEvent('click', false, false);
|
||||
link.dispatchEvent(evt);
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
||||
//post下载
|
||||
/**
|
||||
* 获取 blob
|
||||
* @param {String} url 目标文件地址
|
||||
* @return {Promise}
|
||||
*/
|
||||
export function getBlob(url: any) {
|
||||
return new Promise((resolve) => {
|
||||
const xhr = new window.XMLHttpRequest();
|
||||
|
||||
xhr.open('GET', url, true);
|
||||
xhr.withCredentials = true;
|
||||
xhr.responseType = 'blob';
|
||||
xhr.onload = () => {
|
||||
if (xhr.status === 200) {
|
||||
resolve(xhr.response);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param {Blob} blob
|
||||
* @param {String} filename 想要保存的文件名称
|
||||
*/
|
||||
export function saveAs(blob: any, filename: any) {
|
||||
if (window.navigator.msSaveOrOpenBlob) {
|
||||
window.navigator.msSaveBlob(blob, filename);
|
||||
} else {
|
||||
const link = document.createElement('a');
|
||||
const body: any = document.querySelector('body');
|
||||
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = filename;
|
||||
|
||||
// fix Firefox
|
||||
link.style.display = 'none';
|
||||
body.appendChild(link);
|
||||
|
||||
link.click();
|
||||
body.removeChild(link);
|
||||
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param {String} url 目标文件地址
|
||||
* @param {String} filename 想要保存的文件名称
|
||||
*/
|
||||
export function download(url: any, filename: any) {
|
||||
getBlob(url).then((blob) => {
|
||||
saveAs(blob, filename);
|
||||
});
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
export const publicPath =
|
||||
process.env.NODE_ENV === 'development' ? '/' : '/react/build/';
|
||||
|
||||
const env = {
|
||||
dev: 'https://testxgd.educoder.net',
|
||||
build:
|
||||
window.location.origin === 'http://47.111.130.18:56841'
|
||||
? 'https://testxgd.educoder.net'
|
||||
: 'http://localhost:48982',
|
||||
};
|
||||
console.log('当前环境:', process.env.NODE_ENV);
|
||||
const url = process.env.NODE_ENV === 'development' ? env.dev : env.build;
|
||||
export default url;
|
@ -0,0 +1,9 @@
|
||||
import { getDvaApp } from 'umi';
|
||||
|
||||
export const getInitData = (type: string) => {
|
||||
const { basic }: any = getDvaApp()._store.getState();
|
||||
const { initData }: any = basic;
|
||||
const param = { ...initData[0], ...initData[1], ...initData[2] };
|
||||
console.log(param, param[type], type, 'initData');
|
||||
return param[type];
|
||||
};
|
@ -0,0 +1,37 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"importHelpers": true,
|
||||
"jsx": "react-jsx",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": "./",
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"@/*": ["src/*"],
|
||||
"@@/*": ["src/.umi/*"]
|
||||
},
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": [
|
||||
"mock/**/*",
|
||||
"src/**/*",
|
||||
"config/**/*",
|
||||
".umirc.ts",
|
||||
"typings.d.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"lib",
|
||||
"es",
|
||||
"dist",
|
||||
"typings",
|
||||
"**/__test__",
|
||||
"test",
|
||||
"docs",
|
||||
"tests"
|
||||
]
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
declare module '*.css';
|
||||
declare module '*.less';
|
||||
declare module '*.png';
|
||||
declare module '*.svg' {
|
||||
export function ReactComponent(
|
||||
props: React.SVGProps<SVGSVGElement>,
|
||||
): React.ReactElement;
|
||||
const url: string;
|
||||
export default url;
|
||||
}
|
Loading…
Reference in new issue