1、新增keys条件查询组件静态数据

2、营销计划key列表新增批量发送按钮
This commit is contained in:
wangsongsole 2022-07-25 15:01:31 +08:00
parent 9e12956b15
commit 62941ada28
2 changed files with 106 additions and 86 deletions

View File

@ -2,7 +2,7 @@
* @Author: Wind
* @Date: 2022-07-25 10:53:41
* @LastEditors: Wind
* @LastEditTime: 2022-07-25 13:49:44
* @LastEditTime: 2022-07-25 14:44:27
* @Description:
* @FilePath: \frontend\src\components\keysFind\index.jsx
*/
@ -15,6 +15,14 @@ import {
FormInputField,
Button
} from 'zent'
const stateList = [
{ key: 1, text: '全部' },
{ key: 2, text: '待使用' },
{ key: 3, text: '已使用' },
{ key: 4, text: '已完结' },
{ key: 5, text: '已作废' }
]
export default ({ onQuery }) => {
const form = Form.useForm(FormStrategy.View)
@ -52,10 +60,7 @@ export default ({ onQuery }) => {
name='state'
label='状态:'
props={{
options: [
{ key: 1, text: '普通用户' },
{ key: 2, text: '高级用户' }
]
options: stateList
}}
/>
<FormInputField

View File

@ -22,7 +22,7 @@ import {
DropdownContent
} from 'zent'
import './list.less'
import { Switch,Pop } from 'zent'
import { Switch, Pop } from 'zent'
import '../../../assets/comm.css'
import Ipt from '../../../components/input/main'
import Grid from '../../../components/gird/main.js'
@ -96,11 +96,11 @@ const Column = [
width: '100px'
},
{
title: "发放key码总数",
name: "grant",
type: "normal",
prop: "grant",
width: "110px",
title: '发放key码总数',
name: 'grant',
type: 'normal',
prop: 'grant',
width: '110px'
},
{
title: '领取key总数',
@ -110,47 +110,47 @@ const Column = [
width: '120px'
},
{
title: "已消耗key总数",
name: "usage",
type: "slot",
prop: "usage",
width: "120px",
title: '已消耗key总数',
name: 'usage',
type: 'slot',
prop: 'usage',
width: '120px'
},
{
title: "作废key码总数",
name: "invalid",
type: "normal",
prop: "invalid",
width: "120px",
title: '作废key码总数',
name: 'invalid',
type: 'normal',
prop: 'invalid',
width: '120px'
},
{
title: "可用key码总数",
name: "silent",
type: "normal",
prop: "silent",
width: "140px",
title: '可用key码总数',
name: 'silent',
type: 'normal',
prop: 'silent',
width: '140px'
},
{
title: "失效key码总数",
name: "overdue",
type: "normal",
prop: "overdue",
width: "140px",
title: '失效key码总数',
name: 'overdue',
type: 'normal',
prop: 'overdue',
width: '140px'
},
{
title: "完结key码总数",
name: "end",
type: "normal",
prop: "end",
width: "140px",
title: '完结key码总数',
name: 'end',
type: 'normal',
prop: 'end',
width: '140px'
},
{
title: "更新时间",
name: "update_time",
type: "normal",
prop: "update_time",
width: "140px",
},
title: '更新时间',
name: 'update_time',
type: 'normal',
prop: 'update_time',
width: '140px'
}
// {
// title: "发放总价(预估)",
// name: "grant_total",
@ -185,7 +185,7 @@ const Column = [
// prop: "silent_total",
// width: "140px",
// },
];
]
export default class acclist extends React.Component {
constructor(props) {
@ -204,6 +204,7 @@ export default class acclist extends React.Component {
{ title: '已完结' },
{ title: '已作废' }
],
gridSelection: [],
distdata: [],
combinedValue: [],
distdata2: [
@ -310,9 +311,9 @@ export default class acclist extends React.Component {
handelResponse(
res,
(req, msg) => {
this.setState({ distdata: req.data });
this.setState({ dataCount: req.total });
sessionStorage.setItem('key_plan_status',req.plan.status);
this.setState({ distdata: req.data })
this.setState({ dataCount: req.total })
sessionStorage.setItem('key_plan_status', req.plan.status)
},
(err) => {}
)
@ -564,7 +565,13 @@ export default class acclist extends React.Component {
this.setState({ email: e.target.value })
}
menuItemClick(e, key, row) {
menuItemClick(key, row, isMany = false) {
/* isMany 是否是批量发送 */
let ids = row.id
if (isMany) {
ids = this.state.gridSelection.map((item) => item.id)
}
console.log(ids)
let self = this
if (key == 1) {
getReseller(row.reseller_id).then((res) => {
@ -717,44 +724,50 @@ export default class acclist extends React.Component {
onChange={this.onChangeCombinedDate.bind(this)}
/>
)
const popDom=(row)=>{
return (
<div>
<b>兑换码统计</b>
<ul className='dflexaj mt5 fz12'>
<li className='dflexajc mr15'>
<span>已作废数</span>
<span>{row.invalid_total}</span>
</li>
<li className='dflexajc mr15'>
<span>已使用数</span>
<span>{row.usage_total}</span>
</li>
{/* <li className='dflexajc mr15'>
const popDom = (row) => {
return (
<div>
<b>兑换码统计</b>
<ul className='dflexaj mt5 fz12'>
<li className='dflexajc mr15'>
<span>已作废数</span>
<span>{row.invalid_total}</span>
</li>
<li className='dflexajc mr15'>
<span>已使用数</span>
<span>{row.usage_total}</span>
</li>
{/* <li className='dflexajc mr15'>
<span>已完结数</span>
<span>{row.end_total}</span>
</li> */}
<li className='dflexajc'>
<span>已失效数</span>
<span>{row.overdue_total}</span>
</li>
</ul>
</div>
)
}
<li className='dflexajc'>
<span>已失效数</span>
<span>{row.overdue_total}</span>
</li>
</ul>
</div>
)
}
const { current, pageSize } = this.state
return (
<div id='exchangecodelist'>
<TabPage tabs={this.state.tabList} tabChange={this.tabFn.bind(this)}>
<div className='codetable dflexj'>
<Button
type='primary'
icon='plus'
onClick={this.clickFn.bind(this)}
disabled={this.state.disabled}>
新建key
</Button>
{/* <Button type="info">批量操作</Button> */}
<div>
<Button
type='primary'
icon='plus'
onClick={this.clickFn.bind(this)}
disabled={this.state.disabled}>
新建key
</Button>
<Button
type='primary'
onClick={(e) => this.menuItemClick(1, [], true)}>
批量发送
</Button>
</div>
<Ipt
icon='search'
placeholder={'请输入key批次ID进行匹配查询'}
@ -781,13 +794,14 @@ export default class acclist extends React.Component {
maxheight={this.state.tableHeight}
countbarVisible={false}
isSwitch={false}
isMultiple={false}
page={this.state.page}
dataCount={this.state.dataCount}
pageChange={(e) => {
this.pageChange(e)
}}
checkChange={(selection) => {}}
checkChange={(selection) => {
this.setState({ gridSelection: selection })
}}
ComponentHandler={(com, rowData) => {
if (com == 'link') {
let str = (
@ -808,10 +822,12 @@ export default class acclist extends React.Component {
}
return str
}
if(com=='usage'){
return <Pop trigger="hover" content={popDom(rowData)}>
<span className='grid-link'>{rowData.usage}</span>
</Pop>
if (com == 'usage') {
return (
<Pop trigger='hover' content={popDom(rowData)}>
<span className='grid-link'>{rowData.usage}</span>
</Pop>
)
}
if (com == 'switch') {
return (
@ -856,7 +872,6 @@ export default class acclist extends React.Component {
}>
<DropdownClickTrigger>
<div className='linkmore disabled'>
{' '}
更多 <Icon type={'down'} />{' '}
</div>
</DropdownClickTrigger>
@ -889,7 +904,7 @@ export default class acclist extends React.Component {
<DropdownContent>
<Menu
onClick={(e, key) =>
this.menuItemClick(e, key, rowData)
this.menuItemClick(key, rowData)
}>
<MenuItem key='1' disabled>
发送密码及压缩包
@ -932,7 +947,7 @@ export default class acclist extends React.Component {
<DropdownContent>
<Menu
onClick={(e, key) =>
this.menuItemClick(e, key, rowData)
this.menuItemClick(key, rowData)
}>
<MenuItem key='1'>发送密码及压缩包</MenuItem>
<MenuItem key='2' disabled>