This commit is contained in:
xuyucheng 2021-11-26 15:11:38 +08:00
parent 6a3303dc08
commit f398d51991
14 changed files with 96 additions and 119 deletions

View File

@ -15,7 +15,7 @@ http {
sendfile on;
keepalive_timeout 65;
server {
listen 5555;
listen 51004;
server_name localhost;
location / {
root /app;

View File

@ -14,7 +14,7 @@
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/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.

View File

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -1,4 +1,5 @@
import axios from 'axios'
import { message } from 'antd'
axios.defaults.timeout = 3000;
axios.defaults.baseURL = 'http://console.fecribd.com/'
@ -20,7 +21,11 @@ axios.interceptors.response.use(function (response) {
return Promise.reject(response);
}
}, function (error) {
console.log('拦截器报错');
const { status } = error.response;
if (status === 401) {
message.warning("认证失效,请重新登录");
window.location.href = '/#/login'
}
return Promise.reject(error);
});
@ -71,7 +76,7 @@ const api = {
BlobGet: function (path = '', data = {}) {
return new Promise(function (resolve, reject) {
axios.get(
path,{ params: data },{ responseType: 'blob'})
path, { params: data }, { responseType: 'blob' })
.then(function (response) {
const blob = new Blob([response.data]);
resolve(window.URL.createObjectURL(blob));

View File

@ -151,7 +151,7 @@ p{
.ant-card-body{
height: calc(100% - 50px);
overflow: auto;
padding: 30px 20px 20px 20px;
padding: 10px 20px 20px 20px;
}
.content-p{

View File

@ -19,9 +19,9 @@ class Dashboard extends Component {
{ 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: '企业名称', dataIndex: 'name', key: 'name' },
{ title: '所属行业', dataIndex: 'start_date', key: 'start_date' },
{ title: '认证日期', dataIndex: 'end_date', key: 'end_date' },
{
title: 'Status', dataIndex: 'status', key: 'status', render: tags => (
<Tag color={tags === 1 ? '#87d068' : tags === 0 ? "#55acee" : "#cd201f"}>
@ -29,7 +29,7 @@ class Dashboard extends Component {
</Tag>
),
},
{ title: 'Assignee', dataIndex: 'assignee', key: 'assignee' },
{ title: '评价信息', dataIndex: 'assignee', key: 'assignee' },
]
}
}
@ -95,7 +95,6 @@ class Dashboard extends Component {
}
initPie() {
console.log(document.getElementById('pie'))
const myChart = echarts.init(document.getElementById('pie'))
myChart.setOption({
grid: {
@ -107,9 +106,6 @@ class Dashboard extends Component {
height: '100%'
},
color: ['#377AE4', '#F4C100', '#FF3525'],
tooltip: {
trigger: 'item'
},
series: [
{
name: 'Data',
@ -124,9 +120,9 @@ class Dashboard extends Component {
borderColor: '#fff',
},
data: [
{ value: 4306, name: 'Chrome' },
{ value: 3801, name: 'Firefox' },
{ value: 1689, name: 'IE' },
{ value: 4306, name: '电子行业' },
{ value: 3801, name: '服务行业' },
{ value: 1689, name: '金融行业' },
]
}
]
@ -149,42 +145,42 @@ class Dashboard extends Component {
<React.Fragment>
<Row gutter={32} style={{ marginBottom: '20px' }}>
<Col span={4}>
<Card title='Sales' style={{ marginBottom: '20px' }}>
<p className='content-p'>2.382</p>
<Card title='留言反馈' style={{ marginBottom: '20px' }}>
<p className='content-p'>282</p>
<span><span className='reduce'>-3.65%</span> Since last week</span>
</Card>
<Card title='Visitors'>
<p className='content-p'>14.212</p>
<Card title='新增注册'>
<p className='content-p'>1413</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>
<Card title='新增认证' style={{ marginBottom: '20px' }}>
<p className='content-p'>523</p>
<span><span className='increase'>6.65%</span> Since last week</span>
</Card>
<Card title='Order'>
<p className='content-p'>64</p>
<Card title='新增评测'>
<p className='content-p'>66</p>
<span><span className='reduce'>-2.25%</span> Since last week</span>
</Card>
</Col>
<Col span={16}>
<Card title='Recent Movement'>
<Card title='留言反馈'>
<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'>
<Card title='行业分布'>
<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>
<p className='space-word'><span>电子行业</span><span>4306</span></p>
<p className='space-word'><span>服务行业</span><span>3801</span></p>
<p className='space-word'><span>金融行业</span><span>1689</span></p>
</Card>
</Col>
<Col span={16}>
<Card title="Last Projects">
<Card title="新增企业信息">
<Table style={{ marginTop: '30px' }} pagination={false} dataSource={this.state.data} columns={this.state.columns}></Table>
</Card>
</Col>

View File

@ -37,8 +37,8 @@ class ServiceList extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -56,8 +56,8 @@ class ServiceList extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -70,7 +70,7 @@ class ServiceList extends Component {
render() {
return (
<Card title="服务管理" className='card'>
<Form layout="inline" style={{ marginBottom: 20 }} onFinish={this.onFinish}>
<Form layout="inline" style={{ margin: '20px 0 40px 0' }} onFinish={this.onFinish}>
<Row style={{width:"100%"}}>
<Col span={5}>
<Form.Item label="服务ID" name="service_id">

View File

@ -32,8 +32,8 @@ class Company extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -51,8 +51,8 @@ class Company extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})

View File

@ -31,8 +31,8 @@ class Invitation extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -50,8 +50,8 @@ class Invitation extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})

View File

@ -32,8 +32,8 @@ class Login extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -51,8 +51,8 @@ class Login extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})

View File

@ -31,8 +31,8 @@ class Mail extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -50,8 +50,8 @@ class Mail extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})

View File

@ -32,8 +32,8 @@ class UserInfo extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key,i) => {
return { title: key, dataIndex: key, align: 'center',key:i }
}),
total: res.total
})
@ -51,8 +51,8 @@ class UserInfo extends Component {
.then(res => {
this.setState({
targetData: res.data,
columns: Object.keys(res.data[0]).map(key => {
return { title: key, dataIndex: key, align: 'center' }
columns: Object.keys(res.data[0]).map((key, i) => {
return { title: key, dataIndex: key, align: 'center', key: i }
}),
total: res.total
})

View File

@ -1,6 +1,6 @@
import { Menu, PageHeader } from 'antd';
import React, { Component } from 'react'
import { AreaChartOutlined, BookOutlined, UsergroupDeleteOutlined,CodepenOutlined, PaperClipOutlined, FireOutlined, PieChartOutlined } from '@ant-design/icons';
import { AreaChartOutlined, BookOutlined, UsergroupDeleteOutlined } from '@ant-design/icons';
class Side extends Component {
constructor(props) {
@ -11,10 +11,6 @@ class Side extends Component {
{ 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' }
]
}
}
@ -24,8 +20,8 @@ class Side extends Component {
}
render() {
const menuItem = ['Board', 'Manager', 'Crawler'].map((item, index) => {
return <Menu.ItemGroup title={item}>
const menuItem = ['Board', 'Manager'].map((item,i) => {
return <Menu.ItemGroup title={item} key={i}>
{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
})}

View File

@ -11,6 +11,10 @@ class User extends Component {
this.state = {}
}
componentDidMount(){
}
onFinish = async (value) => {
const data = {
mail: value.mail,
@ -36,18 +40,19 @@ class User extends Component {
name="normal_login"
className='login-form'
onFinish={this.onFinish}
initialValues={{mail:"wangsichuan@fecr.com.cn",password:"Wangsichuan1234."}}
>
<Form.Item
name="mail"
rules={[{ required: true, message: 'Please input your username!' }]}
rules={[{ required: true, message: 'Please input your mail!' }]}
>
<Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Username" defaultValue="wangsichuan@fecr.com.cn"/>
<Input prefix={<UserOutlined className="site-form-item-icon" />} placeholder="Mail"/>
</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" defaultValue="Wangsichuan1234."/>
<Input.Password prefix={<LockOutlined className="site-form-item-icon" />} placeholder="Password"/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" className="login-form-button">