1
This commit is contained in:
@@ -236,6 +236,10 @@
|
||||
height: 0.5rem
|
||||
}
|
||||
|
||||
.h-3\.5 {
|
||||
height: 0.875rem
|
||||
}
|
||||
|
||||
.h-6 {
|
||||
height: 1.5rem
|
||||
}
|
||||
|
||||
@@ -1,81 +1,102 @@
|
||||
[{
|
||||
"name": "充值",
|
||||
"id": 1100
|
||||
},
|
||||
{
|
||||
"name": "后台充值",
|
||||
"id": 1200
|
||||
},
|
||||
{
|
||||
"name": "购买商品",
|
||||
"id": 2100
|
||||
},
|
||||
{
|
||||
"name": "商品推广",
|
||||
"id": 2110
|
||||
},
|
||||
{
|
||||
"name": "商品培育津贴",
|
||||
"id": 2120
|
||||
},
|
||||
{
|
||||
"name": "商品服务津贴",
|
||||
"id": 2130
|
||||
},
|
||||
{
|
||||
"name": "购买商品-退单",
|
||||
"id": 2200
|
||||
},
|
||||
{
|
||||
"name": "商品推广-退单",
|
||||
"id": 2210
|
||||
},
|
||||
{
|
||||
"name": "商品培育津贴-退单",
|
||||
"id": 2220
|
||||
},
|
||||
{
|
||||
"name": "商品服务津贴-退单",
|
||||
"id": 2230
|
||||
},
|
||||
{
|
||||
"name": "充电桩收益",
|
||||
"id": 3100
|
||||
},
|
||||
{
|
||||
"name": "充电桩推广",
|
||||
"id": 3110
|
||||
},
|
||||
{
|
||||
"name": "充电桩培育津贴",
|
||||
"id": 3120
|
||||
},
|
||||
{
|
||||
"name": "充电桩服务津贴",
|
||||
"id": 3130
|
||||
},
|
||||
{
|
||||
"name": "充电桩收益-退单",
|
||||
"id": 3200
|
||||
},
|
||||
{
|
||||
"name": "充电桩推广-退单",
|
||||
"id": 3210
|
||||
},
|
||||
{
|
||||
"name": "充电桩培育津贴-退单",
|
||||
"id": 3220
|
||||
},
|
||||
{
|
||||
"name": "充电桩服务津贴-退单",
|
||||
"id": 3230
|
||||
},
|
||||
{
|
||||
"name": "提现",
|
||||
"id": 4100
|
||||
},
|
||||
{
|
||||
"name": "提现失败",
|
||||
"id": 4200
|
||||
}
|
||||
[
|
||||
{
|
||||
"name": "充值",
|
||||
"id": 1100
|
||||
},
|
||||
{
|
||||
"name": "后台充值",
|
||||
"id": 1200
|
||||
},
|
||||
{
|
||||
"name": "增值收益转换",
|
||||
"id": 1300
|
||||
},
|
||||
{
|
||||
"name": "购买商品",
|
||||
"id": 2100
|
||||
},
|
||||
{
|
||||
"name": "商品推广",
|
||||
"id": 2110
|
||||
},
|
||||
{
|
||||
"name": "商品培育津贴",
|
||||
"id": 2120
|
||||
},
|
||||
{
|
||||
"name": "商品服务津贴",
|
||||
"id": 2130
|
||||
},
|
||||
{
|
||||
"name": "购买商品-退单",
|
||||
"id": 2200
|
||||
},
|
||||
{
|
||||
"name": "商品推广-退单",
|
||||
"id": 2210
|
||||
},
|
||||
{
|
||||
"name": "商品培育津贴-退单",
|
||||
"id": 2220
|
||||
},
|
||||
{
|
||||
"name": "商品服务津贴-退单",
|
||||
"id": 2230
|
||||
},
|
||||
{
|
||||
"name": "充电桩收益",
|
||||
"id": 3100
|
||||
},
|
||||
{
|
||||
"name": "充电桩推广",
|
||||
"id": 3110
|
||||
},
|
||||
{
|
||||
"name": "充电桩培育津贴",
|
||||
"id": 3120
|
||||
},
|
||||
{
|
||||
"name": "充电桩服务津贴",
|
||||
"id": 3130
|
||||
},
|
||||
{
|
||||
"name": "充电桩收益-退单",
|
||||
"id": 3200
|
||||
},
|
||||
{
|
||||
"name": "充电桩推广-退单",
|
||||
"id": 3210
|
||||
},
|
||||
{
|
||||
"name": "充电桩培育津贴-退单",
|
||||
"id": 3220
|
||||
},
|
||||
{
|
||||
"name": "充电桩服务津贴-退单",
|
||||
"id": 3230
|
||||
},
|
||||
{
|
||||
"name": "提现",
|
||||
"id": 4100
|
||||
},
|
||||
{
|
||||
"name": "提现失败",
|
||||
"id": 4200
|
||||
},
|
||||
{
|
||||
"name": "转赠付款",
|
||||
"id": 5100
|
||||
},
|
||||
{
|
||||
"name": "转赠收款",
|
||||
"id": 5200
|
||||
},
|
||||
{
|
||||
"name": "转换减少",
|
||||
"id": 6100
|
||||
},
|
||||
{
|
||||
"name": "转换增加",
|
||||
"id": 6200
|
||||
}
|
||||
]
|
||||
@@ -87,7 +87,7 @@ const LogTableList: React.FC = () => {
|
||||
hidden:true
|
||||
},
|
||||
{
|
||||
title: '钱包',
|
||||
title: '增值收益',
|
||||
dataIndex: 'points2',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
|
||||
@@ -136,7 +136,7 @@ const LogTableList: React.FC = () => {
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收益',
|
||||
title: '基础收益',
|
||||
dataIndex: 'points1',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { devicePage, importDeviceData } from '@/services/piles';
|
||||
import { devicePage, importDeviceData, getDeviceAnalyze, deviceExport } from '@/services/piles';
|
||||
import { exportData } from '@/utils/func';
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import { useIntl, useAccess } from '@umijs/max';
|
||||
import { message, Tag, Image, Button, Select } from 'antd';
|
||||
import { message, Tag, Image, Button, Select, Row, Col, Card } from 'antd';
|
||||
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
import BonusFormModal from './components/BonusFormModal';
|
||||
import TempFormModal from './components/TempFormModal';
|
||||
@@ -17,9 +17,18 @@ const LogTableList: React.FC = () => {
|
||||
const [tempFormModal, setTempFormModal] = useState(false);
|
||||
const access = useAccess()
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const [count, setCountRows] = useState(false);
|
||||
|
||||
const countInit = async (params) => {
|
||||
const { success, data } = await getDeviceAnalyze(params);
|
||||
if (success) {
|
||||
setCountRows(data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const handleTemp = async (fields) => {
|
||||
|
||||
|
||||
const { success } = await importDeviceData(fields);
|
||||
if (success) {
|
||||
message.success('导入成功');
|
||||
@@ -119,11 +128,38 @@ const LogTableList: React.FC = () => {
|
||||
title: '设备状态',
|
||||
dataIndex: 'deviceStatus',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
let color = record.deviceStatus == 1 ? 'volcano' : record.deviceStatus == 2 ? 'orange' : 'red'
|
||||
return <Tag color={color}>{record.deviceStatus == 1 ? '已安装' : record.deviceStatus == 2 ? '已运营' : '未安装'}</Tag>
|
||||
},
|
||||
renderFormItem: (
|
||||
_,
|
||||
{ type, defaultRender, formItemProps, fieldProps, ...rest },
|
||||
form,
|
||||
) => {
|
||||
return <Select
|
||||
{...fieldProps}
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请输入选择"
|
||||
style={{ width: "100%" }}
|
||||
filterOption={false}
|
||||
fieldNames={{
|
||||
label: "label",
|
||||
value: "value"
|
||||
}}
|
||||
options={[
|
||||
{
|
||||
label: '未安装',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
label: '已安装',
|
||||
value: '1'
|
||||
},
|
||||
]}
|
||||
/>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '安装站点名称',
|
||||
@@ -162,23 +198,93 @@ const LogTableList: React.FC = () => {
|
||||
title: '分账类型',
|
||||
dataIndex: 'paymentType',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
let color = record.paymentType == 1 ? 'volcano' : 'red'
|
||||
return <Tag color={color}>{record.paymentType == 1 ? '普通分账' : '不分账'}</Tag>
|
||||
let color = ['magenta', 'red', 'volcano', 'orange', 'gold']
|
||||
let name = ['不分账', '普通分账', '赠送桩', '冻结收益']
|
||||
return <Tag color={color[record.paymentType]}>{name[record.paymentType]}</Tag>
|
||||
},
|
||||
renderFormItem: (
|
||||
_,
|
||||
{ type, defaultRender, formItemProps, fieldProps, ...rest },
|
||||
form,
|
||||
) => {
|
||||
return <Select
|
||||
{...fieldProps}
|
||||
placeholder="请输入选择"
|
||||
style={{ width: "100%" }}
|
||||
fieldNames={{
|
||||
label: "label",
|
||||
value: "value"
|
||||
}}
|
||||
options={[
|
||||
{
|
||||
label: '不分账',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
label: '普通分账',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '赠送桩',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
label: '冻结收益',
|
||||
value: '3'
|
||||
}
|
||||
]}
|
||||
/>
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
valueType: 'dateRange',
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return {
|
||||
createTimeBegin: value[0],
|
||||
createTimeEnd: value[1],
|
||||
};
|
||||
},
|
||||
},
|
||||
render: (_: any, record: any) => {
|
||||
return record.createTime
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<Row gutter={10}>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>总数</div>
|
||||
<div>数量: {count?.deviceTotal}</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>已安装</div>
|
||||
<div>数量: {count?.installedCount}</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>未安装</div>
|
||||
<div>数量: {count?.notInstalledCount}</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>已过期</div>
|
||||
<div>数量: {count?.expiredCount}</div>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className='h-3.5'></div>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<BonusFormModal
|
||||
values={row}
|
||||
@@ -199,12 +305,20 @@ const LogTableList: React.FC = () => {
|
||||
defaultCollapsed: false,
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button type="primary" onClick={async () => {
|
||||
let data = JSON.parse(JSON.stringify(searchParams))
|
||||
delete data.pageSize
|
||||
delete data.current
|
||||
let _res = await deviceExport(data)
|
||||
exportData(_res, '设备记录')
|
||||
}}>导出</Button>,
|
||||
<Button hidden={!access.hasPerms('/api/device/importDeviceData')} onClick={async () => {
|
||||
setTempFormModal(true)
|
||||
}}>导入</Button>
|
||||
]}
|
||||
request={async (params, sorter, filter) => {
|
||||
setSearchParams({ ...params });
|
||||
countInit(params)
|
||||
let { data } = await devicePage(params)
|
||||
return {
|
||||
data: data?.records || [],
|
||||
|
||||
@@ -51,12 +51,12 @@ export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '余额',
|
||||
title: '增值收益',
|
||||
dataIndex: 'points2',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收益',
|
||||
title: '基础收益',
|
||||
dataIndex: 'points1',
|
||||
search: false,
|
||||
},
|
||||
|
||||
@@ -258,13 +258,13 @@ const LogTableList: React.FC = () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '钱包',
|
||||
title: '增值收益',
|
||||
dataIndex: 'points2',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收益',
|
||||
title: '基础收益',
|
||||
dataIndex: 'points1',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function getDeviceInfoVO(params) {
|
||||
|
||||
|
||||
export async function importDeviceData(body) {
|
||||
return request('/api/device/importDeviceData ', {
|
||||
return request('/api/device/importDeviceData', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
@@ -43,3 +43,25 @@ export async function importDeviceData(body) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export async function getDeviceAnalyze(body) {
|
||||
return request('/api/device/getDeviceAnalyze', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
export async function deviceExport(body) {
|
||||
return request('/api/device/export', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user