|
@@ -1,6 +1,7 @@
|
|
|
import React, { useState, useEffect } from 'react'
|
|
import React, { useState, useEffect } from 'react'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
-import { Row, Col, List, Divider, Select } from 'antd'
|
|
|
|
|
|
|
+import { Row, Col, Divider, Select } from 'antd'
|
|
|
|
|
+import { AddressBook, City, Finance, Comment } from '@icon-park/react'
|
|
|
import { DualAxes } from '@ant-design/charts'
|
|
import { DualAxes } from '@ant-design/charts'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
import { queryDashboard } from '@/services/dashboard'
|
|
import { queryDashboard } from '@/services/dashboard'
|
|
@@ -13,7 +14,8 @@ const Dashboard = () => {
|
|
|
clientChainRatio: {},
|
|
clientChainRatio: {},
|
|
|
customerChainRatio: {},
|
|
customerChainRatio: {},
|
|
|
businessChainRatio: {},
|
|
businessChainRatio: {},
|
|
|
- serviceLogChainRatio: {}
|
|
|
|
|
|
|
+ serviceLogChainRatio: {},
|
|
|
|
|
+ aggregation: {}
|
|
|
})
|
|
})
|
|
|
const initData = async payload => {
|
|
const initData = async payload => {
|
|
|
const {
|
|
const {
|
|
@@ -24,7 +26,8 @@ const Dashboard = () => {
|
|
|
clientChainRatio = {},
|
|
clientChainRatio = {},
|
|
|
customerChainRatio = {},
|
|
customerChainRatio = {},
|
|
|
businessChainRatio = {},
|
|
businessChainRatio = {},
|
|
|
- serviceLogChainRatio = {}
|
|
|
|
|
|
|
+ serviceLogChainRatio = {},
|
|
|
|
|
+ aggregation = {}
|
|
|
}
|
|
}
|
|
|
} = await queryDashboard(payload)
|
|
} = await queryDashboard(payload)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
@@ -35,7 +38,8 @@ const Dashboard = () => {
|
|
|
clientChainRatio,
|
|
clientChainRatio,
|
|
|
customerChainRatio,
|
|
customerChainRatio,
|
|
|
businessChainRatio,
|
|
businessChainRatio,
|
|
|
- serviceLogChainRatio
|
|
|
|
|
|
|
+ serviceLogChainRatio,
|
|
|
|
|
+ aggregation
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -57,7 +61,7 @@ const Dashboard = () => {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '30天',
|
|
title: '30天',
|
|
|
- dataIndex: 'day30'
|
|
|
|
|
|
|
+ dataIndex: 'day15'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '3个月',
|
|
title: '3个月',
|
|
@@ -75,7 +79,8 @@ const Dashboard = () => {
|
|
|
const columnsCustomer = [
|
|
const columnsCustomer = [
|
|
|
{
|
|
{
|
|
|
title: '排名',
|
|
title: '排名',
|
|
|
- dataIndex: 'rank'
|
|
|
|
|
|
|
+ dataIndex: 'rank',
|
|
|
|
|
+ valueType: 'indexBorder'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '姓名',
|
|
title: '姓名',
|
|
@@ -160,14 +165,6 @@ const Dashboard = () => {
|
|
|
增幅: 220
|
|
增幅: 220
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
- const data = [
|
|
|
|
|
- '新增客户 0 个,服务 0 条',
|
|
|
|
|
- '新增联系人 0 个,服务 0 条',
|
|
|
|
|
- '新增商机 0 个,金额 0 元,服务 0 条,赢单 0 个',
|
|
|
|
|
- '新增开票 0 张,开票总金额 0 元',
|
|
|
|
|
- '回款 0 条,回款总金额 0 元',
|
|
|
|
|
- '支出 0 元,收入 0 元'
|
|
|
|
|
- ]
|
|
|
|
|
const config = {
|
|
const config = {
|
|
|
data: [uvBillData, transformData],
|
|
data: [uvBillData, transformData],
|
|
|
height: 230,
|
|
height: 230,
|
|
@@ -191,6 +188,7 @@ const Dashboard = () => {
|
|
|
<div>
|
|
<div>
|
|
|
<div>
|
|
<div>
|
|
|
<ProTable
|
|
<ProTable
|
|
|
|
|
+ rowKey={record => record.day7 + Date.now()}
|
|
|
columns={columns}
|
|
columns={columns}
|
|
|
dataSource={state.reminderData}
|
|
dataSource={state.reminderData}
|
|
|
search={false}
|
|
search={false}
|
|
@@ -206,7 +204,7 @@ const Dashboard = () => {
|
|
|
<Col span={6}>
|
|
<Col span={6}>
|
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
|
<span className="absolute top-9px left-9px">
|
|
<span className="absolute top-9px left-9px">
|
|
|
- <iconpark-icon name="city" size="26" />
|
|
|
|
|
|
|
+ <City size="26" fill="#fff" />
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
@@ -227,7 +225,7 @@ const Dashboard = () => {
|
|
|
<Col span={6}>
|
|
<Col span={6}>
|
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
|
<span className="absolute top-10px left-10px">
|
|
<span className="absolute top-10px left-10px">
|
|
|
- <iconpark-icon name="address-book" size="26" />
|
|
|
|
|
|
|
+ <AddressBook size="26" fill="#fff" />
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
@@ -248,7 +246,7 @@ const Dashboard = () => {
|
|
|
<Col span={6}>
|
|
<Col span={6}>
|
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
|
<span className="absolute top-10px left-10px">
|
|
<span className="absolute top-10px left-10px">
|
|
|
- <iconpark-icon name="finance" size="26" />
|
|
|
|
|
|
|
+ <Finance size="26" fill="#fff" />
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
@@ -269,7 +267,7 @@ const Dashboard = () => {
|
|
|
<Col span={6}>
|
|
<Col span={6}>
|
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
<div className="w-48px h-48px border rounded-48px bg-[#0c7cd5] relative">
|
|
|
<span className="absolute top-10px left-10px">
|
|
<span className="absolute top-10px left-10px">
|
|
|
- <iconpark-icon name="comment" size="26" />
|
|
|
|
|
|
|
+ <Comment size="26" fill="#fff" />
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
@@ -305,13 +303,24 @@ const Dashboard = () => {
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col className="gutter-row" span={8}>
|
|
<Col className="gutter-row" span={8}>
|
|
|
- <div className="bg-white rounded-lg">
|
|
|
|
|
- <List
|
|
|
|
|
- header={<div>数据汇总</div>}
|
|
|
|
|
- bordered
|
|
|
|
|
- dataSource={data}
|
|
|
|
|
- renderItem={item => <List.Item>{item}</List.Item>}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div className="bg-white border rounded-lg">
|
|
|
|
|
+ <h4 className="px-12px py-16px border-b-1">数据汇总</h4>
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li className="px-12px py-16px border-b-1">
|
|
|
|
|
+ 新增客户<b className="px-1">{state.aggregation.customerCount}</b>个,服务
|
|
|
|
|
+ <b className="px-1">{state.aggregation.customerServiceCount}</b>条
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li className="px-12px py-16px border-b-1">
|
|
|
|
|
+ 新增联系人<b className="px-1">{state.aggregation.clientCount}</b>个,服务
|
|
|
|
|
+ <b className="px-1">{state.aggregation.clientServiceCount}</b> 条
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li className="px-12px py-16px">
|
|
|
|
|
+ 新增商机<b className="px-1">{state.aggregation.businessCount}</b>个,金额
|
|
|
|
|
+ <b className="px-1">{state.aggregation.businessSum}</b> 元,服务
|
|
|
|
|
+ <b className="px-1">{state.aggregation.businessServiceCount}</b>
|
|
|
|
|
+ 条,赢单<b className="px-1">{state.aggregation.businessWinCount}</b>个
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
|
</Row>
|
|
</Row>
|
|
@@ -337,6 +346,7 @@ const Dashboard = () => {
|
|
|
</div>
|
|
</div>
|
|
|
<div className="text-center">新增客户排行榜</div>
|
|
<div className="text-center">新增客户排行榜</div>
|
|
|
<ProTable
|
|
<ProTable
|
|
|
|
|
+ rowKey={record => record.rank}
|
|
|
columns={columnsCustomer}
|
|
columns={columnsCustomer}
|
|
|
dataSource={state.leaderboard}
|
|
dataSource={state.leaderboard}
|
|
|
search={false}
|
|
search={false}
|