first commit

This commit is contained in:
xuyucheng 2021-11-15 16:08:17 +08:00
parent 32326bfa89
commit c7285f7c4a
38 changed files with 3000 additions and 1149 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
PORT=3000

26
.rescriptsrc.js Normal file
View File

@ -0,0 +1,26 @@
const { name } = require('./package');
module.exports = {
webpack: (config) => {
config.output.library = `${name}-[name]`;
config.output.libraryTarget = 'umd';
config.output.jsonpFunction = `webpackJsonp_${name}`;
config.output.globalObject = 'window';
return config;
},
devServer: (_) => {
const config = _;
config.headers = {
'Access-Control-Allow-Origin': '*',
};
config.historyApiFallback = true;
config.hot = false;
config.watchContentBase = false;
config.liveReload = false;
return config;
},
};

View File

@ -1,70 +0,0 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

3043
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,19 @@
{ {
"name": "react-app", "name": "manager",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@testing-library/jest-dom": "^5.14.1", "@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7", "@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3", "@testing-library/user-event": "^12.8.3",
"ali-oss": "^6.16.0",
"antd": "^4.16.13",
"echarts": "^5.1.2",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3", "react-scripts": "4.0.3",
"wangeditor": "^4.7.6",
"web-vitals": "^1.1.2" "web-vitals": "^1.1.2"
}, },
"scripts": { "scripts": {
@ -34,5 +39,8 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
},
"devDependencies": {
"axios": "^0.21.1"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -2,14 +2,14 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta
name="description" name="description"
content="Web site created using create-react-app" content="Web site created using create-react-app"
/> />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.ico" />
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>天府股交</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>

BIN
public/logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,23 +1,18 @@
import logo from './logo.svg'; import React from 'react'
import './App.css'; import 'antd/dist/antd.css'
import User from './pages/user'
import Home from './pages/home'
import { HashRouter, Switch, Route, Redirect } from 'react-router-dom'
function App() { function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <HashRouter>
<img src={logo} className="App-logo" alt="logo" /> <Switch><Route path='/login' component={User} /></Switch>
<p> <Switch><Route path='/home' component={Home} /></Switch>
Edit <code>src/App.js</code> and save to reload. <Redirect from="/" to="/home" exact />
</p> </HashRouter>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div> </div>
); );
} }

View File

@ -1,8 +0,0 @@
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

61
src/api/api.js Normal file
View File

@ -0,0 +1,61 @@
import request from './request'
export function login(url, data) {
return request.post(url, data)
}
export function getAllArticle(url,data) {
return request.get(url,data)
}
export function getUser(url) {
return request.get(url)
}
export function editUser(url, data) {
return request.post(url, data)
}
export function deleteUser(url, data) {
return request.get(url, data)
}
export function getArticleLen(url) {
return request.get(url)
}
export function setArticle(url, data) {
return request.post(url, data)
}
export function updateArticle(url, data) {
return request.post(url, data)
}
export function getSingleArticle(url, data) {
return request.get(url, data)
}
export function deleteArticle(url, data) {
return request.get(url, data)
}
export function uploadFile(url, data) {
return request.post(url, data)
}
export function getFile(url) {
return request.get(url)
}
export function getImage(url, data) {
return request.BlobGet(url, data)
}
export function download(url, data) {
return request.BlobGet(url, data)
}
export function getHotSpot(url) {
return request.get(url)
}

78
src/api/request.js Normal file
View File

@ -0,0 +1,78 @@
import axios from 'axios'
axios.defaults.timeout = 3000;
axios.defaults.baseURL = 'http://localhost:9090/api'
//请求拦截器
axios.interceptors.request.use(config => {
const token = localStorage.getItem('Jwt')
if (token) {
config.headers.Authorization = token
}
return config
}, error => {
Promise.reject(error)
})
//响应拦截器
axios.interceptors.response.use(function (response) {
if (response.status === 200) {
return Promise.resolve(response);
} else {
return Promise.reject(response);
}
}, function (error) {
console.log('拦截器报错');
return Promise.reject(error);
});
const request = {
get: function (path = '', data = {}) {
return new Promise(function (resolve, reject) {
axios.get(path, {
params: data
})
.then(function (response) {
// 按需求来这里我需要的是response.data所以返回response.data一般直接返回response
resolve(response.data);
})
.catch(function (error) {
reject(error);
});
});
},
post: function (path = '', data = {}) {
let formData = new FormData()
for (let key in data) {
formData.append(key, data[key])
}
return new Promise(function (resolve, reject) {
axios.post(path, formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(function (response) {
resolve(response.data);
})
.catch(function (error) {
reject(error);
});
});
},
BlobGet: function (path = '', data = {}) {
return new Promise(function (resolve, reject) {
axios.get(
path,{ params: data },{ responseType: 'blob'})
.then(function (response) {
const blob = new Blob([response.data]);
resolve(window.URL.createObjectURL(blob));
})
.catch(function (error) {
reject(error);
});
})
},
}
export default request

View File

@ -0,0 +1,6 @@
@mixin flex($wrap) {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: $wrap;
}

Binary file not shown.

View File

@ -0,0 +1,180 @@
#root,
html,
body,
.App{
height: 100%;
margin: 0;
padding: 0;
background: #f0f2f5;
font-family: 'SR';
}
@font-face{
font-family: 'SR';
src: url('./SourceHanSansK-Normal.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.ant-layout{
height: 100%;
}
.ant-layout-header{
background-color: #fff;
}
.ant-layout-content{
margin: 0px 50px 40px 50px;
/* overflow: auto; */
height: calc(100% - 254px);
}
.ant-menu{
/* padding: 20px 0px; */
background-color: #1F2E3E;
}
.flex-center{
display: flex;
justify-content: center;
align-items: center;
}
.flex-end{
display: flex;
justify-content: flex-end;
align-items: center;
}
.login-form-button {
width: 100%;
}
.site-layout-background {
background: transparent;
}
.ant-layout-sider-light{
background-color: transparent;
}
::-webkit-scrollbar {
width: 5px;
height: 10px;
}
::-webkit-scrollbar-thumb {
background-color: #a1a3a9;
border-radius: 3px;
}
.w-e-text-container{
height: 90% !important;
}
.ant-input:focus{
border: none !important;
}
p{
margin: 10px 0;
}
.ant-popover-arrow{
display: none;
}
.ant-popover-title{
min-width:80px;
color:#fff;
background-color: rgba(0, 0, 0, 0.85);
border: none;
}
.ant-popover-inner-content{
padding:0;
color: #fff
}
.badge{
position: relative;
top: 20px;
left:0;
width: 20px;
height: 20px;
font-size: 14px;
line-height: 20px;
text-align: center;
background-color: #fe2d46;
color: #fff;
z-index: 999;
}
.gutter-row{
display: flex;
justify-content: center;
}
.ant-popover-inner-content{
padding: 10px 20px;
}
.ant-menu-item{
border-left: 2px solid transparent;
}
.ant-menu-item-selected{
background-color: transparent !important;
border-left: 2px solid #317DE8;
}
.ant-page-header-heading-title{
color: #fff;
}
/* 输入框样式 */
.ant-input-affix-wrapper{
background-color: #FAF7FA;
}
.ant-input{
background-color: #FAF7FA;
}
/* 卡片样式 */
.card{
height: 100%;
padding-bottom: 10px;
}
.ant-card-body{
height: calc(100% - 50px);
overflow: auto;
padding: 10px 20px 20px 20px;
}
.content-p{
font-size: 20px;
}
.increase{
color:#80B065;
}
.reduce{
color:#FF5E40;
}
/* 日历样式 */
.ant-picker-calendar{
padding: 20px;
}
/* 两端对齐文字 */
.space-word{
padding: 10px;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #f0f0f0;
}

1
src/assets/svg/Excel.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1628487188182" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2696" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M608 128H308.8C289.6 128 272 144 272 163.2V320l336 262.4L944 512V320L608 128z" fill="#21A366" p-id="2697"></path><path d="M907.2 128H608v192h336v-155.2C944 145.6 928 128 907.2 128z" fill="#33C481" p-id="2698"></path><path d="M272 320v539.2c0 19.2 16 36.8 35.2 36.8h600c19.2 0 36.8-16 36.8-35.2V704L272 320z" fill="#185C37" p-id="2699"></path><path d="M272 320h336v192H272z" fill="#107C41" p-id="2700"></path><path d="M528 324.8V752c-3.2 17.6-19.2 30.4-36.8 30.4H272V288h219.2c19.2 0 36.8 16 36.8 36.8z" p-id="2701"></path><path d="M544 324.8v388.8c0 28.8-24 52.8-52.8 52.8H272V272h219.2c28.8 0 52.8 24 52.8 52.8z" p-id="2702"></path><path d="M528 324.8v388.8c0 19.2-16 36.8-35.2 36.8H272V288h219.2c19.2 0 36.8 16 36.8 36.8z" p-id="2703"></path><path d="M512 324.8v388.8c0 19.2-16 36.8-35.2 36.8H272V288h203.2c19.2 0 36.8 16 36.8 36.8z" p-id="2704"></path><path d="M100.8 288h372.8c19.2 0 36.8 16 36.8 35.2v374.4c0 19.2-16 36.8-35.2 36.8H100.8C81.6 736 65.6 721.6 64 704V324.8C64 305.6 80 288 100.8 288z" fill="#107C41" p-id="2705"></path><path d="M179.2 633.6l78.4-121.6-72-121.6h57.6l40 76.8c1.6 4.8 4.8 11.2 8 16 3.2-6.4 4.8-11.2 8-17.6l41.6-76.8h52.8L320 510.4l75.2 121.6h-56l-44.8-84.8c-1.6-3.2-3.2-8-4.8-11.2-1.6 3.2-3.2 8-4.8 11.2l-46.4 84.8-59.2 1.6z" fill="#FFFFFF" p-id="2706"></path><path d="M608 512h336v192H608z" fill="#107C41" p-id="2707"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/svg/avatar.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/svg/txt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

1
src/assets/svg/txt.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1628487192941" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2837" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M192 0h448.1536L960 320v576c0 70.6944-57.3056 128-128 128H192C121.3056 1024 64 966.6944 64 896V128C64 57.3056 121.3056 0 192 0z" fill="#2696FF" p-id="2838"></path><path d="M417.7536 546.176h-60.8256v170.5728h-40.9216V546.176H256V512h161.7536v34.176z m94.3872 36.416L549.376 512h47.0528l-57.8304 101.5296 59.328 103.2192h-47.6032l-38.1824-71.7184-38.1952 71.7184h-47.6032l59.3408-103.2192L427.8528 512h47.0528l37.2352 70.592zM768 546.176h-60.8256v170.5728H666.24V546.176h-60.0064V512H768v34.176z" fill="#FFFFFF" opacity=".9" p-id="2839"></path><path d="M640 0l320 320H768c-70.6944 0-128-57.3056-128-128V0z" fill="#8FC6FE" p-id="2840"></path></svg>

After

Width:  |  Height:  |  Size: 1023 B

1
src/assets/svg/word.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1628487179814" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2553" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M1024 298.666667V85.333333c0-25.6-17.066667-42.666667-42.666667-42.666666H298.666667c-25.6 0-42.666667 17.066667-42.666667 42.666666v213.333334l384 85.333333 384-85.333333z" fill="#41A5EE" p-id="2554"></path><path d="M1024 298.666667H256v213.333333l405.333333 85.333333 362.666667-85.333333z" fill="#2B7CD3" p-id="2555"></path><path d="M1024 512H256v213.333333l384 64 384-64z" fill="#185ABD" p-id="2556"></path><path d="M1024 725.333333H256v213.333334c0 25.6 17.066667 42.666667 42.666667 42.666666h682.666666c25.6 0 42.666667-17.066667 42.666667-42.666666v-213.333334z" fill="#103F91" p-id="2557"></path><path d="M588.8 256H256v597.333333h324.266667c29.866667 0 59.733333-29.866667 59.733333-59.733333V307.2c0-29.866667-21.333333-51.2-51.2-51.2z" opacity=".5" p-id="2558"></path><path d="M546.133333 810.666667H51.2C21.333333 810.666667 0 789.333333 0 759.466667V264.533333C0 234.666667 21.333333 213.333333 51.2 213.333333h499.2c25.6 0 46.933333 21.333333 46.933333 51.2v499.2c0 25.6-21.333333 46.933333-51.2 46.933334z" fill="#185ABD" p-id="2559"></path><path d="M435.2 682.666667H371.2L298.666667 448 226.133333 682.666667H162.133333L93.866667 341.333333h59.733333l46.933333 238.933334 72.533334-230.4h51.2l68.266666 230.4L443.733333 341.333333h59.733334l-68.266667 341.333334z" fill="#FFFFFF" p-id="2560"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

View File

@ -1,17 +1,6 @@
import React from 'react'; import React from 'react'
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom'
import './index.css'; import App from './App'
import App from './App'; import './assets/style/general.css'
import reportWebVitals from './reportWebVitals';
ReactDOM.render( ReactDOM.render(<App/>,document.getElementById('root'))
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,197 @@
import React, { Component } from 'react'
import * as echarts from 'echarts/lib/echarts'
import "echarts/lib/chart/line";
import "echarts/lib/chart/pie";
import 'echarts/lib/component/grid'
import { Card, Row, Col, Table, Tag } from 'antd';
class Dashboard extends Component {
constructor(props) {
super(props)
this.state = {
data: [
{ name: 'Project Apollo', start_date: "01/01/2020", end_date: '31/06/2020', status: 1, assignee: 'Vanessa Tucker' },
{ name: 'Project Fireball', start_date: "01/01/2020", end_date: '31/06/2020', status: 0, assignee: 'William Harris' },
{ name: 'Project Hades', start_date: "01/01/2020", end_date: '31/06/2020', status: 1, assignee: 'Sharon Less' },
{ name: 'Project Nitro', start_date: "01/01/2020", end_date: '31/06/2020', status: -1, assignee: 'Vanessa Tucker' },
{ name: 'Project Phoenix', start_date: "01/01/2020", end_date: '31/06/2020', status: 1, assignee: 'Christina Mason' },
{ name: 'Project X', start_date: "01/01/2020", end_date: '31/06/2020', status: -1, assignee: 'William Harris' },
{ name: 'Project Wombat', start_date: "01/01/2020", end_date: '31/06/2020', status: 0, assignee: 'Vanessa Tucker' },
],
columns: [
{ title: 'Name', dataIndex: 'name', key: 'name' },
{ title: 'Start Date', dataIndex: 'start_date', key: 'start_date' },
{ title: 'End Date', dataIndex: 'end_date', key: 'end_date' },
{
title: 'Status', dataIndex: 'status', key: 'status', render: tags => (
<Tag color={tags === 1 ? '#87d068' : tags === 0 ? "#55acee" : "#cd201f"}>
{tags === 1 ? 'Done' : tags === 0 ? "Pending" : "Waiting"}
</Tag>
),
},
{ title: 'Assignee', dataIndex: 'assignee', key: 'assignee' },
]
}
}
initChart = () => {
const myChart = echarts.init(document.getElementById('line'))
myChart.setOption({
grid: {
top: '20px',
left: '50px',
right: '50px',
bottom: '20px',
width: '100%',
height: '100%'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisLine: {
show: false
},
axisTick: {
show: false
},
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
show: false
}
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(58,77,233,0.8)'
},
{
offset: 1,
color: 'rgba(255,255,255,1)'
}
])
},
smooth: true
}
]
})
window.onresize = function () {
myChart.resize()
}
}
initPie() {
console.log(document.getElementById('pie'))
const myChart = echarts.init(document.getElementById('pie'))
myChart.setOption({
grid: {
top: '20px',
left: '50px',
right: '50px',
bottom: '20px',
width: '100%',
height: '100%'
},
color: ['#377AE4', '#F4C100', '#FF3525'],
tooltip: {
trigger: 'item'
},
series: [
{
name: 'Data',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
labelLine: {
show: false
},
itemStyle: {
borderWidth: 5,
borderColor: '#fff',
},
data: [
{ value: 4306, name: 'Chrome' },
{ value: 3801, name: 'Firefox' },
{ value: 1689, name: 'IE' },
]
}
]
})
window.onresize = function () {
myChart.resize()
}
}
componentDidMount() {
setTimeout(() => {
this.initChart()
this.initPie()
}, 100)
}
render() {
return (
<React.Fragment>
<Row gutter={32} style={{ marginBottom: '20px' }}>
<Col span={4}>
<Card title='Sales' style={{ marginBottom: '20px' }}>
<p className='content-p'>2.382</p>
<span><span className='reduce'>-3.65%</span> Since last week</span>
</Card>
<Card title='Visitors'>
<p className='content-p'>14.212</p>
<span><span className='increase'>5.25%</span> Since last week</span>
</Card>
</Col>
<Col span={4}>
<Card title='Earnings' style={{ marginBottom: '20px' }}>
<p className='content-p'>$21.300</p>
<span><span className='increase'>6.65%</span> Since last week</span>
</Card>
<Card title='Order'>
<p className='content-p'>64</p>
<span><span className='reduce'>-2.25%</span> Since last week</span>
</Card>
</Col>
<Col span={16}>
<Card title='Recent Movement'>
<div id='line' style={{ width: '100%', height: '255%' }}></div>
</Card>
</Col>
</Row>
<Row gutter={32} style={{ paddingBottom: '20px' }}>
<Col span={8}>
<Card title='Browser Usage'>
<div id='pie' style={{ width: '100%', height: '300px' }}></div>
<p className='space-word'><span>Chrome</span><span>4306</span></p>
<p className='space-word'><span>Firefox</span><span>3801</span></p>
<p className='space-word'><span>IE</span><span>1689</span></p>
</Card>
</Col>
<Col span={16}>
<Card title="Last Projects">
<Table style={{ marginTop: '30px' }} pagination={false} dataSource={this.state.data} columns={this.state.columns}></Table>
</Card>
</Col>
</Row>
</React.Fragment>
)
}
}
export default Dashboard

View File

@ -0,0 +1,24 @@
import React, { Component } from 'react'
import { Table,Card } from 'antd'
class FinancialList extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<Card title="财报管理" className='card'>
<Table bordered dataSource={this.state.data} columns={this.state.columns} scroll={{ y: 'auto' }} />
</Card>
)
}
}
export default FinancialList

View File

@ -0,0 +1,24 @@
import React, { Component } from 'react'
import { Table,Card } from 'antd'
class ServiceList extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<Card title="服务管理" className='card'>
<Table bordered dataSource={this.state.data} columns={this.state.columns} scroll={{ y: 'auto' }} />
</Card>
)
}
}
export default ServiceList

View File

@ -0,0 +1,67 @@
import React, { Component } from 'react'
import { Table, Avatar, Space, Popconfirm, Button,Card } from 'antd'
import { getUser, deleteUser, } from '../../../api/api'
class UserList extends Component {
constructor(props) {
super(props)
this.state = {
visible: false
}
}
componentDidMount() {
this.getUser()
}
getUser = () => {
getUser('/getUser').then(res => {
const col = Object.keys(res.data[0]).map(key => {
return key !== 'Avatar' ? { title: key, dataIndex: key, key: key, align: 'center' } : {
title: key, key: key, dataIndex: key, render: (text, record) => (
<Space size='middle'>
<Avatar src={text} />
</Space>
), align: 'center'
}
})
col.push({
title: 'operation',
dataIndex: 'operation',
align: 'center',
render: (_, record) =>
<div>
<Popconfirm title='确认删除?' onConfirm={() => this.handleDelete(record)}>
<Button type='primary'>删除</Button>
</Popconfirm>
</div>
})
this.setState({
data: res.data,
columns: col
})
}).catch(err => {
console.log(err)
})
}
handleDelete = (value) => {
deleteUser('/deleteUser', value)
.then(res => {
console.log(res)
})
.catch(err => {
console.log(err)
})
}
render() {
return (
<Card title="用户管理" className='card'>
<Table bordered dataSource={this.state.data} columns={this.state.columns} scroll={{ y: 'auto' }} />
</Card>
)
}
}
export default UserList

41
src/pages/home/content.js Normal file
View File

@ -0,0 +1,41 @@
import React, { Component } from 'react'
import Dashboard from './branch/dashboard'
import ServiceList from './branch/service'
import UserList from './branch/user'
import FinancialList from './branch/financial'
class Main extends Component {
constructor(props) {
super(props)
this.state = {
path: 0
}
}
getBranch = (props) => {
const path = props.path
switch (path) {
case '/dashboard':
return <Dashboard />
case '/service':
return <ServiceList />
case '/user':
return <UserList />
case '/financial':
return <FinancialList />
default:
return <Dashboard />
}
}
render() {
return (
<div className="card-container" style={{height:'100%'}}>
{this.getBranch(this.props)}
</div>
)
}
}
export default Main

26
src/pages/home/head.js Normal file
View File

@ -0,0 +1,26 @@
import React, { Component } from 'react';
import { Input, Row, Col, Avatar, Space } from 'antd';
import { SearchOutlined, BellOutlined, WifiOutlined } from '@ant-design/icons';
class Head extends Component {
render() {
return (
<Row justify="space-between" align='middle' style={{ background: '#fff', padding: '5px 50px', borderRadius: 6 }}>
<Col span={4}>
<Input placeholder="Search" suffix={<SearchOutlined />} bordered={false} />
</Col>
<Col span={8} className='flex-end'>
<Space size={'large'}>
<BellOutlined />
<WifiOutlined />
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<span>Hello,Timor</span>
</Space>
</Col>
</Row>
)
}
}
export default Head

37
src/pages/home/index.js Normal file
View File

@ -0,0 +1,37 @@
import { Layout } from 'antd'
import Head from './head'
import Side from './side'
import Main from './content'
import React, { Component } from 'react'
const { Header, Sider, Content } = Layout;
class Home extends Component {
constructor(props){
super(props)
this.state = {
path:'/dashboard'
}
}
getMenuItem = (value) => {
this.setState({
path: value
})
}
render() {
return (
<Layout>
<Sider width={220} className="site-layout-background"><Side parent={this} /></Sider>
<Layout>
<Header className="site-layout-background" style={{ padding:'0px 0px 40px 0px',height:'auto' }}>
<Head/>
</Header>
<Content><Main path={this.state.path} /></Content>
</Layout>
</Layout>
)
}
}
export default Home

50
src/pages/home/side.js Normal file
View File

@ -0,0 +1,50 @@
import { Menu, PageHeader } from 'antd';
import React, { Component } from 'react'
import { AreaChartOutlined, BookOutlined, UsergroupDeleteOutlined,CodepenOutlined, PaperClipOutlined, FireOutlined, PieChartOutlined } from '@ant-design/icons';
class Side extends Component {
constructor(props) {
super(props)
this.state = {
data: [
{ title: '面板', path: '/dashboard', icon: <AreaChartOutlined />, category: 'Board' },
{ title: '服务管理', path: '/service', icon: <BookOutlined />, category: 'Manager' },
{ title: '用户管理', path: '/user', icon: <UsergroupDeleteOutlined />, category: 'Manager' },
{ title: '财报管理', path: '/financial', icon: <BookOutlined />, category: 'Manager' },
{ title: '企查查', path: '/qcc', icon: <CodepenOutlined />, category: 'Crawler' },
{ title: '天眼查', path: '/tyc', icon: <PaperClipOutlined />, category: 'Crawler' },
{ title: '企业预警通', path: '/qyyjt', icon: <FireOutlined />, category: 'Crawler' },
{ title: '爱企查', path: '/aqc', icon: <PieChartOutlined />, category: 'Crawler' }
]
}
}
handleClick = e => {
this.props.parent.getMenuItem(this.state.data[e.key].path)
}
render() {
const menuItem = ['Board', 'Manager', 'Crawler'].map((item, index) => {
return <Menu.ItemGroup title={item}>
{this.state.data.map((ele, index) => {
return ele.category === item?<Menu.Item key={index} icon={ele.icon} onClick={this.handleClick}>{ele.title}</Menu.Item>:null
})}
</Menu.ItemGroup>
})
return (
<Menu
mode="inline"
defaultSelectedKeys={['0']}
style={{ height: '100%', borderRight: 0, position: 'fixed', width: '220px' }}
theme="dark"
className='menu'
>
<PageHeader title="TFSE" style={{ marginBottom: '40px',color:'#fff' }}></PageHeader>
{menuItem}
</Menu>
)
}
}
export default Side

65
src/pages/user/index.js Normal file
View File

@ -0,0 +1,65 @@
import React, { Component } from 'react'
import { withRouter } from "react-router-dom";
import { login } from '../../api/api'
import { Layout, Form, Input, Button, message } from 'antd'
import { UserOutlined, LockOutlined } from '@ant-design/icons';
const { Content } = Layout;
class User extends Component {
constructor(props){
super(props)
this.state = {}
}
onFinish = async (value)=>{
// const {account,password} = value
login('/login',value).then(res=>{
switch (res.result.Code){
case 1:
message.success(res.result.Msg);
this.props.history.push('/home')
break
default:
message.error(res.result.Msg);
break
}
}).catch(err=>{
console.log(err)
})
}
render() {
return (
<Layout>
<Content className='flex-center'>
<Form
name="normal_login"
className='login-form'
onFinish={this.onFinish}
>
<Form.Item
name="account"
rules={[{ required: true, message: 'Please input your username!' }]}
>
<Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" />
</Form.Item>
<Form.Item
name="password"
rules={[{ required: true, message: 'Please input your password!' }]}
>
<Input.Password prefix={<LockOutlined className="site-form-item-icon" />} placeholder="Password" />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" className="login-form-button">
Submit
</Button>
</Form.Item>
</Form>
</Content>
</Layout>
)
}
}
export default withRouter(User)

View File

@ -1,13 +0,0 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

View File

@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

8
src/utils/oss.js Normal file
View File

@ -0,0 +1,8 @@
import OSS from 'ali-oss'
const client = new OSS({
region: 'oss-cn-beijing',
accessKeyId: 'LTAI5t794SjuStaixXES3SHN',
accessKeySecret: 'dnvCvFwcnUSQPrffgHC4ur7ilx7puO',
bucket: 'corasann-img'
})
export default client