更新筛选条件,增加订单统计

This commit is contained in:
PC-202306242200\Administrator
2024-09-23 18:15:22 +08:00
parent ee8c853b79
commit 480adb69af
23 changed files with 292 additions and 85 deletions

View File

@@ -84,8 +84,9 @@ export default defineConfig({
}, },
define: { define: {
'process.env': { 'process.env': {
API_URL: "https://iadminapi.zhongshuai2023.com", // API_URL: "https://iadminapi.zhongshuai2023.com",
// API_URL: "http://192.168.1.63:1002", // API_URL: "http://192.168.1.63:1002",
API_URL: "http://192.168.1.54:1002",
WS_URL: "ws://lv.com", WS_URL: "ws://lv.com",
STATIC_URL: "http://lv.com", STATIC_URL: "http://lv.com",
WEMAP_KEY: 'ZFDBZ-YUTWB-353UZ-NYKEY-JTVIZ-Q3F6X' WEMAP_KEY: 'ZFDBZ-YUTWB-353UZ-NYKEY-JTVIZ-Q3F6X'

File diff suppressed because one or more lines are too long

10
dist/6709.04f236d8.async.js vendored Normal file

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View File

@@ -3,11 +3,11 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>广东星动</title> <title>广东星动</title>
<link rel="stylesheet" href="/umi.d4b01ce4.css"> <link rel="stylesheet" href="/umi.7b0758b1.css">
<script async="" src="/scripts/loading.js"></script> <script async="" src="/scripts/loading.js"></script>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.60eced26.js"></script> <script src="/umi.d07eaff9.js"></script>
</body></html> </body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9037],{63768:function(N,m,n){n.r(m),n.d(m,{default:function(){return P}});var T=n(26068),x=n.n(T),G=n(48305),f=n.n(G),v=n(50959),j=n(40676),F=n(14417),a=n(87980),s=n(23885),r=n(57385),$=n(90228),p=n.n($),D=n(87999),g=n.n(D),y=n(7485);function M(i){return Z.apply(this,arguments)}function Z(){return Z=g()(p()().mark(function i(o){return p()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/statMallStatistics",x()({method:"GET"},o||{})));case 1:case"end":return u.stop()}},i)})),Z.apply(this,arguments)}function R(i){return E.apply(this,arguments)}function E(){return E=g()(p()().mark(function i(o){return p()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/getAmountAndGoodsCount",x()({method:"GET"},o||{})));case 1:case"end":return u.stop()}},i)})),E.apply(this,arguments)}var B=n(54569),t=n(11527),P=function(){var i,o,d,u,W=(0,v.useState)([]),A=f()(W,2),z=A[0],H=A[1],I=(0,v.useState)([]),S=f()(I,2),e=S[0],J=S[1],K=(0,v.useState)([]),C=f()(K,2),O=C[0],Q=C[1],L={data:z,xField:"name",yField:"value",seriesField:"type",xAxis:{type:"time"},padding:"auto",legend:{position:"right-top"},yAxis:{label:{formatter:function(c){return"".concat(c).replace(/\d{1,3}(?=(\d{3})+$)/g,function(l){return"".concat(l,",")})}}}};return(0,v.useEffect)(function(){M().then(function(h){J(h.data)}),R().then(function(h){var c=[];h.data.map(function(l,U){c.push({name:l.createTime,category:"\u5546\u54C1\u6570\u91CF",value:l.goodsCount,type:1}),c.push({name:l.createTime,category:"\u91D1\u989D",value:l.amountCount,type:2})}),H(c)})},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{children:"\u5145\u7535\u6869"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4ECA\u65E5\u5145\u7535",value:e==null||(i=e.device_count)===null||i===void 0?void 0:i.today,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u6628\u65E5\u5145\u7535",value:e==null||(o=e.device_count)===null||o===void 0?void 0:o.yesterday,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u5468\u5145\u7535",value:e==null||(d=e.device_count)===null||d===void 0?void 0:d.week,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u6708\u5145\u7535",value:e==null||(u=e.device_count)===null||u===void 0?void 0:u.month,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4ECA\u5929\u6210\u4EA4",value:e==null?void 0:e.todayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u6628\u5929\u6210\u4EA4",value:e==null?void 0:e.yesterdayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u5468\u6210\u4EA4",value:e==null?void 0:e.lastWeekTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u6708\u6210\u4EA4",value:e==null?void 0:e.lastMonthTransaction,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE(\u5546\u54C1\u6570\u91CF/\u91D1\u989D)-\u6298\u7EBF\u56FE"}),(0,t.jsx)(B.Z,x()({},L))]})}}}]);

View File

@@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9037],{63768:function(L,m,n){n.r(m),n.d(m,{default:function(){return P}});var D=n(26068),f=n.n(D),G=n(48305),x=n.n(G),p=n(50959),j=n(40676),F=n(14417),r=n(87980),s=n(23885),a=n(57385),$=n(90228),h=n.n($),M=n(87999),g=n.n(M),y=n(7485);function N(i){return Z.apply(this,arguments)}function Z(){return Z=g()(h()().mark(function i(l){return h()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/statMallStatistics",f()({method:"GET"},l||{})));case 1:case"end":return u.stop()}},i)})),Z.apply(this,arguments)}function R(i){return E.apply(this,arguments)}function E(){return E=g()(h()().mark(function i(l){return h()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/getAmountAndGoodsCount",f()({method:"GET"},l||{})));case 1:case"end":return u.stop()}},i)})),E.apply(this,arguments)}var B=n(54569),t=n(11527),P=function(){var i,l,c,u,W=(0,p.useState)([]),A=x()(W,2),S=A[0],z=A[1],H=(0,p.useState)([]),C=x()(H,2),e=C[0],I=C[1],J=(0,p.useState)([]),T=x()(J,2),O=T[0],Q=T[1],K={title:{visible:!0,text:"\u5546\u57CE(\u5546\u54C1\u6570\u91CF/\u91D1\u989D)-\u6298\u7EBF\u56FE"},padding:"auto",forceFit:!0,data:S,xField:"date",yField:"value",yAxis:{label:{formatter:function(o){return"".concat(o).replace(/\d{1,3}(?=(\d{3})+$)/g,function(d){return"".concat(d,",")})}}},legend:{position:"right-top"},seriesField:"type",color:function(o){return o==="register"?"#93D072":"#2D71E7"},responsive:!0};return(0,p.useEffect)(function(){N().then(function(v){I(v.data)}),R().then(function(v){var o=[];v.data.map(function(d,U){o.push({date:d.createTime,type:"shop",value:Number(d.goodsCount)}),o.push({date:d.createTime,type:"money",value:Number(d.amountCount)})}),console.log(o),z(o)})},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{children:"\u5145\u7535\u6869"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4ECA\u65E5\u5145\u7535",value:e==null||(i=e.device_count)===null||i===void 0?void 0:i.today,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u6628\u65E5\u5145\u7535",value:e==null||(l=e.device_count)===null||l===void 0?void 0:l.yesterday,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u5468\u5145\u7535",value:e==null||(c=e.device_count)===null||c===void 0?void 0:c.week,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u6708\u5145\u7535",value:e==null||(u=e.device_count)===null||u===void 0?void 0:u.month,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4ECA\u5929\u6210\u4EA4",value:e==null?void 0:e.todayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u6628\u5929\u6210\u4EA4",value:e==null?void 0:e.yesterdayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u5468\u6210\u4EA4",value:e==null?void 0:e.lastWeekTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(r.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(a.Z,{title:"\u4E0A\u6708\u6210\u4EA4",value:e==null?void 0:e.lastMonthTransaction,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE(\u5546\u54C1\u6570\u91CF/\u91D1\u989D)-\u6298\u7EBF\u56FE"}),S.length!=0?(0,t.jsx)(B.Z,f()({},K)):(0,t.jsx)(t.Fragment,{})]})}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -256,6 +256,10 @@
width: 13rem width: 13rem
} }
.w-6 {
width: 1.5rem
}
.max-w-\[712px\] { .max-w-\[712px\] {
max-width: 712px max-width: 712px
} }

View File

@@ -43,8 +43,8 @@ const LogTableList: React.FC = () => {
render: (_: any, record: any) => { render: (_: any, record: any) => {
return <div> return <div>
<div>ID:{record?.userId}</div> <div>ID:{record?.userId}</div>
{/* <div>用户名:{record?.userName}</div> */} <div>{record?.userName}</div>
{/* <div>手机号:{record?.phone}</div> */} <div>{record?.phone}</div>
</div> </div>
}, },
renderFormItem: ( renderFormItem: (
@@ -81,12 +81,12 @@ const LogTableList: React.FC = () => {
valueType: 'text', valueType: 'text',
search: false, search: false,
}, },
{ // {
title: '当前余额', // title: '当前余额',
dataIndex: 'curPoints', // dataIndex: 'curPoints',
valueType: 'text', // valueType: 'text',
search: false, // search: false,
}, // },
{ {
title: '余额变动', title: '余额变动',
dataIndex: 'points', dataIndex: 'points',
@@ -196,7 +196,7 @@ const LogTableList: React.FC = () => {
}}></Button>, }}></Button>,
]} ]}
request={async (params, sorter, filter) => { request={async (params, sorter, filter) => {
params.pointType = 2 // params.pointType = 2
setSearchParams(params) setSearchParams(params)
let { data } = await variationPage(params) let { data } = await variationPage(params)
return { return {

View File

@@ -11,24 +11,29 @@ export default () => {
const [deviceData, setDeviceData] = useState([]); const [deviceData, setDeviceData] = useState([]);
const [profit, setProfit] = useState([]); const [profit, setProfit] = useState([]);
const [shop, setShop] = useState([]); const [shop, setShop] = useState([]);
const deviceConfig = {
data: deviceData,
xField: 'name',
yField: 'value', const config = {
seriesField: 'type', title: {
xAxis: { visible: true,
type: 'time', text: '商城(商品数量/金额)-折线图',
}, },
padding: 'auto', padding: 'auto',
forceFit: true,
data:deviceData,
xField: 'date',
yField: 'value',
yAxis: { label: { formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`) } },
legend: { position: 'right-top' }, legend: { position: 'right-top' },
yAxis: { seriesField: 'type',
label: { color: (d) => {
// 数值格式化为千分位 return d === 'register' ? '#93D072' : '#2D71E7';
formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
},
}, },
responsive: true,
}; };
useEffect(() => { useEffect(() => {
statMallStatistics().then((res) => { statMallStatistics().then((res) => {
setProfit(res.data) setProfit(res.data)
@@ -37,20 +42,17 @@ export default () => {
let list = [] let list = []
res.data.map((item, index) => { res.data.map((item, index) => {
list.push({ list.push({
"name": item.createTime, "date": item.createTime,
"category": "商品数量", "type": "shop",
"value": item.goodsCount, "value": Number(item.goodsCount),
"type": 1
}) })
list.push({ list.push({
"name": item.createTime, "date": item.createTime,
"category": "金额", "type": "money",
"value": item.amountCount, "value": Number(item.amountCount),
"type": 2
}) })
}) })
console.log(list);
setDeviceData(list) setDeviceData(list)
}) })
}, []); }, []);
@@ -144,7 +146,9 @@ export default () => {
</Col> </Col>
</Row> </Row>
<Divider>(/)-线</Divider> <Divider>(/)-线</Divider>
<Line {...deviceConfig} /> {
deviceData.length != 0 ? <Line {...config} /> : <></>
}
</> </>
); );
}; };

View File

@@ -2,10 +2,12 @@ import { orderPage, orderExport, orderRefund } from '@/services/order';
import { exportData } from '@/utils/func'; import { exportData } from '@/utils/func';
import React, { useRef, useEffect, useState } from 'react'; import React, { useRef, useEffect, useState } from 'react';
import { useIntl, useAccess } from '@umijs/max'; import { useIntl, useAccess } from '@umijs/max';
import { message, Tag, Image, Button, Select } from 'antd'; import { message, Tag, Col, Row, Card, Image, Button, Select } from 'antd';
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components'; import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
import BonusFormModal from './components/BonusFormModal'; import BonusFormModal from './components/BonusFormModal';
import EscFormModal from './components/EscFormModal'; import EscFormModal from './components/EscFormModal';
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => { const LogTableList: React.FC = () => {
@@ -16,6 +18,19 @@ const LogTableList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState([]); const [selectedRowsState, setSelectedRows] = useState([]);
const [escFormModal, setEscFormModal] = useState(false); const [escFormModal, setEscFormModal] = useState(false);
const access = useAccess() const access = useAccess()
const count = useState({})
const [shopOption, setShopOption] = useState([]);
const searchShop = async (value) => {
const { success, data } = await usersPage({
userName: value
});
data.records.map((i) => {
i.userName = i.userName + ' ' + i.phone
})
setShopOption(data.records)
}
const columns = [ const columns = [
@@ -36,9 +51,8 @@ const LogTableList: React.FC = () => {
}, },
{ {
title: '用户信息', title: '用户信息',
dataIndex: 'ordersGoodsList', dataIndex: 'usersId',
valueType: 'text', valueType: 'text',
search: false,
render: (_: any, record: any) => { render: (_: any, record: any) => {
return <div className={'flex'}> return <div className={'flex'}>
<div> <div>
@@ -51,9 +65,39 @@ const LogTableList: React.FC = () => {
<div> <div>
{record?.usersDto?.userName} {record?.usersDto?.userName}
</div> </div>
<div>
{record?.usersDto?.phone || '-'}
</div> </div>
</div> </div>
</div>
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
showSearch
placeholder="请输入用户名"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
} }
searchShop(e);
}
}
fieldNames={{
label: "userName",
value: "id"
}}
options={shopOption}
/>
},
}, },
{ {
title: '商品信息', title: '商品信息',
@@ -101,8 +145,8 @@ const LogTableList: React.FC = () => {
valueType: 'text', valueType: 'text',
search: true, search: true,
render: (_: any, record: any) => { render: (_: any, record: any) => {
let color = record.orderPlatform == 1 ? 'volcano' : record.orderPlatform == 2 ? 'orange' : 'red' let color = record.payType == 1 ? 'volcano' : record.payType == 2 ? 'orange' : 'red'
return <Tag color={color}>{record.orderPlatform == 2 ? '微信' : record.orderPlatform == 3 ? '支付宝' : record.orderPlatform == 1 ? '钱包' : '-'}</Tag> return <Tag color={color}>{record.payType == 1 ? '支付宝' : '微信'}</Tag>
}, },
renderFormItem: ( renderFormItem: (
_, _,
@@ -169,8 +213,18 @@ const LogTableList: React.FC = () => {
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
valueType: 'text', valueType: 'dateRange',
search: false, search: {
transform: (value) => {
return {
createTimeBegin: value[0],
createTimeEnd: value[1],
};
},
},
render: (_, record) => {
return record?.createTime
},
}, },
]; ];
@@ -185,7 +239,54 @@ const LogTableList: React.FC = () => {
return ( return (
<PageContainer> <PageContainer>
<div style={{ width: '100%', float: 'right' }}> <Row gutter={10} className='mb-30'>
<Col span={6}>
<Card>
<div></div>
<div>: {count?.all0?.money}</div>
<div className='flex '>
<div>{count?.all0?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all0?.goods_num}</div>
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<div></div>
<div>: {count?.all1?.money}</div>
<div className='flex '>
<div>{count?.all1?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all1?.goods_num}</div>
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<div></div>
<div>: {count?.all3?.money}</div>
<div className='flex '>
<div>{count?.all3?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all3?.goods_num}</div>
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<div>线</div>
<div>: {count?.all4?.money}</div>
<div className='flex '>
<div>{count?.all4?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all4?.goods_num}</div>
</div>
</Card>
</Col>
</Row>
<div style={{ width: '100%', float: 'right', marginTop: "20px" }}>
<EscFormModal <EscFormModal
modalOpenState={escFormModal} modalOpenState={escFormModal}
onModalOpenState={setEscFormModal} onModalOpenState={setEscFormModal}

View File

@@ -1,53 +1,81 @@
import { paymentPage } from '@/services/payment'; import { paymentPage } from '@/services/payment';
import React, { useRef, useEffect } from 'react'; import React, { useRef, useEffect,useState } from 'react';
import { useIntl, useAccess } from '@umijs/max'; import { useIntl, useAccess } from '@umijs/max';
import { message, Tag, Image, Button, Select } from 'antd'; import { message, Tag, Image, Button, Select } from 'antd';
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components'; import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => { const LogTableList: React.FC = () => {
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const [shopOption, setShopOption] = useState([]);
const searchShop = async (value) => {
const { success, data } = await usersPage({
userName: value
});
data.records.map((i) => {
i.userName = i.userName + ' ' + i.phone
})
setShopOption(data.records)
}
const columns = [ const columns = [
{ {
title: '订单号', title: '支付号',
dataIndex: 'orderNo', dataIndex: 'paymentNo',
valueType: 'text', valueType: 'text',
search: true, search: true,
render: (_: any, record: any) => {
return <div className={'flex items-center'}>
{record.orderNo}
<Button type="link" onClick={() => {
}}></Button>
</div>
}
}, },
{ {
title: '用户信息', title: '用户信息',
dataIndex: 'ordersGoodsList', dataIndex: 'userId',
valueType: 'text', valueType: 'text',
search: false,
render: (_: any, record: any) => { render: (_: any, record: any) => {
// return record.ordersGoodsList.map((i) => { return <div>
// let _Img = i.picture ? JSON.parse(i.picture)[0] : '' <div>ID:{record?.userId}</div>
// return <div className={'flex'} key={i.id}> <div>{record?.userName}</div>
// <Image src={_Img}></Image> <div>{record?.phone}</div>
// <div> </div>
// <div> },
// 用户ID{i.goodsName} renderFormItem: (
// </div> _,
// <div> { type, defaultRender, formItemProps, fieldProps, ...rest },
// 用户账号:{i.salePrice} form,
// </div> ) => {
// </div> return <Select
// </div> {...fieldProps}
// }) allowClear
showSearch
placeholder="请输入用户名"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
} }
searchShop(e);
}
}
fieldNames={{
label: "userName",
value: "id"
}}
options={shopOption}
/>
},
},
{
title: '用户手机号',
dataIndex: 'userInfo',
valueType: 'text',
search: true,
hidden: true
}, },
{ {
title: '支付类型', title: '支付类型',

View File

@@ -6,6 +6,8 @@ import { message, Tag, Image, Button, Select } from 'antd';
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components'; import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
import BonusFormModal from './components/BonusFormModal'; import BonusFormModal from './components/BonusFormModal';
import TempFormModal from './components/TempFormModal'; import TempFormModal from './components/TempFormModal';
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => { const LogTableList: React.FC = () => {
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
@@ -14,7 +16,7 @@ const LogTableList: React.FC = () => {
const [row, setRow] = useState(); const [row, setRow] = useState();
const [tempFormModal, setTempFormModal] = useState(false); const [tempFormModal, setTempFormModal] = useState(false);
const access = useAccess() const access = useAccess()
const [shopOption, setShopOption] = useState([]);
const handleTemp = async (fields) => { const handleTemp = async (fields) => {
const { success } = await importDeviceData(fields); const { success } = await importDeviceData(fields);
@@ -25,6 +27,16 @@ const LogTableList: React.FC = () => {
} }
}; };
const searchShop = async (value) => {
const { success, data } = await usersPage({
userName: value
});
data.records.map((i) => {
i.userName = i.userName + ' ' + i.phone
})
setShopOption(data.records)
}
const columns = [ const columns = [
{ {
title: '设备号', title: '设备号',
@@ -47,6 +59,52 @@ const LogTableList: React.FC = () => {
valueType: 'text', valueType: 'text',
search: true, search: true,
}, },
{
title: '用户信息',
dataIndex: 'userId',
valueType: 'text',
render: (_: any, record: any) => {
return <div>
<div>ID:{record?.userId}</div>
<div>{record?.userName}</div>
<div>{record?.phone}</div>
</div>
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
showSearch
placeholder="请输入用户名"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
}
searchShop(e);
}
}
fieldNames={{
label: "userName",
value: "id"
}}
options={shopOption}
/>
},
},
{
title: '用户手机号',
dataIndex: 'userInfo',
valueType: 'text',
search: true,
hidden: true
},
{ {
title: '设备类型', title: '设备类型',
dataIndex: 'deviceType', dataIndex: 'deviceType',
@@ -144,6 +202,7 @@ const LogTableList: React.FC = () => {
key="logList" key="logList"
search={{ search={{
labelWidth: 120, labelWidth: 120,
defaultCollapsed: false,
}} }}
toolBarRender={() => [ toolBarRender={() => [
<Button hidden={!access.hasPerms('/api/device/importDeviceData')} onClick={async () => { <Button hidden={!access.hasPerms('/api/device/importDeviceData')} onClick={async () => {

View File

@@ -41,7 +41,7 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
form.resetFields(); form.resetFields();
setMenuIconName(props.values.icon); setMenuIconName(props.values.icon);
setmenuType(props.values.menuType) setmenuType(props.values.menuType)
setmenuType(props.values.isFrame) setIsFrame(props.values.isFrame)
form.setFieldsValue({ form.setFieldsValue({
id: props.values.id, id: props.values.id,
name: props.values.name, name: props.values.name,