diff --git a/src/assets/api.js b/src/assets/api.js
index a79aea02..9883fa54 100644
--- a/src/assets/api.js
+++ b/src/assets/api.js
@@ -888,8 +888,4 @@ export const batchSend = (data) => {
return req("post", baseurl + `/keys/batchSend`, data);
};
-export const exportKey = (data) => {
- return req("get", baseurl + "/key/export", data);
-};
-
export { req };
diff --git a/src/components/gird/main.js b/src/components/gird/main.js
index 83f3b4f1..03581977 100644
--- a/src/components/gird/main.js
+++ b/src/components/gird/main.js
@@ -1,658 +1,581 @@
import React from 'react'
-import ReactDom from 'react-dom';
-import "./main.css"
-import {
- Icon,
- Menu,
- Checkbox,
- Switch,
- Sweetalert,
- Notify
-} from 'zent';
-import _ from "lodash";
-import Pagination from "../pagination/main.js"
-import GridEdit from "../gridEdit/main.js"
-import Input from "../input/main.js"
-import GridCheckBar from "../gridCheckBar/main.js"
-
-
+import ReactDom from 'react-dom'
+import './main.css'
+import { Icon, Menu, Checkbox, Switch, Sweetalert, Notify } from 'zent'
+import _ from 'lodash'
+import Pagination from '../pagination/main.js'
+import GridEdit from '../gridEdit/main.js'
+import Input from '../input/main.js'
+import GridCheckBar from '../gridCheckBar/main.js'
//tabbar组件机构{title:"",index:""}
//props {}
// type : normal slot
-//tableColumn 表格列属性结构 type width,label,background,textAlign
-
+//tableColumn 表格列属性结构 type width,label,background,textAlign
export default class menu extends React.Component {
+ static defaultProps = {
+ isShowPageBar: true, //是否显示页码
+ isMultiple: true,
+ isSwitch: true,
+ page: '',
+ headBackgroud: '',
+ spliteColor: '#f9fafc',
+ countbarVisible: true,
+ maxheight: 400,
+ isBorder: false,
+ Column: [
+ {
+ title: '推广计划名称',
+ prop: 'name',
+ width: '300px',
+ textAlign: 'flex-start',
+ type: 'normal',
+ sort: false,
+ total: false,
+ valueType: 'text'
+ },
+ {
+ title: '操作',
+ prop: 'edit',
+ width: '220px',
+ textAlign: 'flex-start',
+ type: 'slot',
+ sort: false,
+ total: false,
+ valueType: 'text'
+ },
+ {
+ title: '曝光量',
+ prop: 'num1',
+ width: 'auto',
+ textAlign: 'left',
+ type: 'normal',
+ sort: true,
+ total: true,
+ valueType: 'number'
+ },
+ {
+ title: '点击量',
+ prop: 'num2',
+ width: 'auto',
+ textAlign: 'left',
+ type: 'normal',
+ sort: true,
+ total: true,
+ valueType: 'number'
+ },
+ {
+ title: '点击率',
+ prop: 'num3',
+ width: 'auto',
+ textAlign: 'left',
+ type: 'normal',
+ sort: true,
+ total: true,
+ valueType: 'percentage'
+ },
+ {
+ title: '点击均价',
+ prop: 'price',
+ width: 'auto',
+ textAlign: 'left',
+ type: 'normal',
+ sort: true,
+ total: true,
+ valueType: 'price'
+ },
+ {
+ title: '花费',
+ prop: 'totalprice',
+ width: 'auto',
+ textAlign: 'left',
+ type: 'normal',
+ sort: true,
+ total: true,
+ valueType: 'price'
+ }
+ ],
+ tableData: [
+ {
+ id: 0,
+ name: '推广计划-2021-10-19 17:43',
+ num1: 0,
+ num2: 0,
+ num3: 0,
+ price: 0,
+ totalprice: 0
+ }
+ ],
+ emptyText: '抱歉,暂无相关数据记录',
+ dataCount: 0,
+ curIndex: 0
+ }
- static defaultProps = {
- isShowPageBar:true, //是否显示页码
- isMultiple: true,
- isSwitch: true,
- page:'',
- headBackgroud: "",
- spliteColor: "#f9fafc",
- countbarVisible:true,
- maxheight:400,
- isBorder:false,
- Column: [{
- title: "推广计划名称",
- prop: "name",
- width: "300px",
- textAlign: "flex-start",
- type: "normal",
- sort: false,
- total: false,
- valueType: "text"
- },
- {
- title: "操作",
- prop: "edit",
- width: "220px",
- textAlign: "flex-start",
- type: "slot",
- sort: false,
- total: false,
- valueType: "text"
- },
- {
- title: "曝光量",
- prop: "num1",
- width: "auto",
- textAlign: "left",
- type: "normal",
- sort: true,
- total: true,
- valueType: "number"
- },
- {
- title: "点击量",
- prop: "num2",
- width: "auto",
- textAlign: "left",
- type: "normal",
- sort: true,
- total: true,
- valueType: "number"
- },
- {
- title: "点击率",
- prop: "num3",
- width: "auto",
- textAlign: "left",
- type: "normal",
- sort: true,
- total: true,
- valueType: "percentage"
- },
- {
- title: "点击均价",
- prop: "price",
- width: "auto",
- textAlign: "left",
- type: "normal",
- sort: true,
- total: true,
- valueType: "price"
- },
- {
- title: "花费",
- prop: "totalprice",
- width: "auto",
- textAlign: "left",
- type: "normal",
- sort: true,
- total: true,
- valueType: "price"
- },
- ],
- tableData: [{
- id: 0,
- name: "推广计划-2021-10-19 17:43",
- num1: 0,
- num2: 0,
- num3: 0,
- price: 0,
- totalprice: 0
- }
- ],
- emptyText: "抱歉,暂无相关数据记录",
- dataCount:0,
- curIndex:0,
-
- }
+ constructor(props) {
+ super(props)
+ let tableData = []
+ // 如果是多选
+ // if (props.isMultiple) {
+ // tableData = _.map(props.tableData, (item) => {
+ // return item.checked = false;
+ // })
+ // }
+ // if (props.isSwitch) {
+ // tableData = _.map(props.tableData, (item) => {
+ // return item.switched = false;
+ // })
+ // }
- constructor(props) {
- super(props);
- let tableData = [];
- // 如果是多选
- // if (props.isMultiple) {
- // tableData = _.map(props.tableData, (item) => {
- // return item.checked = false;
- // })
- // }
+ this.state = {
+ switchLoading: false,
+ allChecked: false,
+ tableData: props.tableData,
+ Column: props.Column,
+ dataTotal: props.dataTotal,
+ indeterminate: false,
+ pageNum: 0,
+ pageCount: props.dataCount,
+ pageLoading: false,
+ editShow: false,
+ postion: null,
+ historyrow_id: null,
+ curRow: null,
+ emptyText: props.emptyText || '抱歉,暂无相关数据记录',
+ edit_title: '',
+ edit_column: ''
+ }
+ }
- // if (props.isSwitch) {
- // tableData = _.map(props.tableData, (item) => {
- // return item.switched = false;
- // })
- // }
+ scrollFunc = function (e) {}
+ componentDidMount() {
+ const dom = ReactDom.findDOMNode(this)
+ if (dom.attachEvent) {
+ dom.attachEvent('onmousewheel', this.scrollFunc)
+ }
+ //Firefox使用addEventListener添加滚轮事件
+ if (dom.addEventListener) {
+ //firefox
+ dom.addEventListener('DOMMouseScroll', this.scrollFunc, false)
+ }
+ //Safari与Chrome属于同一类型
+ dom.onmousewheel = this.scrollFunc
+ }
+ //多选
+ AllCheckChange = (e) => {
+ if (this.state.tableData.length == 0) {
+ return
+ }
- this.state = {
- switchLoading: false,
- allChecked: false,
- tableData: props.tableData,
- Column: props.Column,
- dataTotal:props.dataTotal,
- indeterminate: false,
- pageNum:0,
- pageCount:props.dataCount,
- pageLoading:false,
- editShow:false,
- postion:null,
- historyrow_id:null,
- curRow:null,
- emptyText: "抱歉,暂无相关数据记录",
- edit_title:"",
- edit_column:""
- }
- }
-
-
- scrollFunc = function (e) {
+ this.setState({
+ indeterminate: false
+ })
+ this.setState({
+ allChecked: e.target.checked
+ })
- }
-
- componentDidMount() {
- const dom = ReactDom.findDOMNode(this);
- if(dom.attachEvent){
- dom.attachEvent('onmousewheel',this.scrollFunc);
- }
- //Firefox使用addEventListener添加滚轮事件
- if (dom.addEventListener) {//firefox
- dom.addEventListener('DOMMouseScroll', this.scrollFunc, false);
- }
- //Safari与Chrome属于同一类型
- dom.onmousewheel = this.scrollFunc;
- }
-
- //多选
- AllCheckChange = (e) => {
-
- if(this.state.tableData.length == 0)
- {
- return;
- }
-
- this.setState({
- indeterminate: false
- })
- this.setState({
- allChecked: e.target.checked
- })
+ let tableData = _.map(this.state.tableData, (item) => {
+ return (item.checked = e.target.checked)
+ })
+ this.setState({
+ tableData: this.state.tableData
+ })
+ let selection = _.filter(this.state.tableData, (item) => {
+ return item.checked == true
+ })
+ this.props.checkChange(selection)
+ }
- let tableData = _.map(this.state.tableData, (item) => {
- return item.checked = e.target.checked;
- })
- this.setState({
- tableData: this.state.tableData
- })
- let selection = _.filter(this.state.tableData, (item) => {
- return item.checked == true;
- })
- this.props.checkChange(selection)
- }
-
-
- allChecked(status)
- {
+ allChecked(status) {
+ this.setState({ allChecked: status })
+ let tabledata = _.map(this.state.tableData, (item) => {
+ item.checked = false
+ return item
+ })
+ this.setState({
+ indeterminate: false
+ })
+ this.setState({ tableData: tabledata })
+ }
- this.setState({allChecked:status})
- let tabledata = _.map(this.state.tableData,(item)=>{
- item.checked =false
- return item
- })
- this.setState({
- indeterminate: false
- })
- this.setState({tableData:tabledata})
-
- }
-
-
-
-
- checkChange(index, e){
- this.state.tableData[index].checked = e.target.checked;
- this.setState({
- tableData: this.state.tableData
- })
- let selection = _.filter(this.state.tableData, (item) => {
- return item.checked == true;
- })
- this.props.checkChange(selection)
-
- if (selection.length == this.state.tableData.length ) {
- this.setState({
- indeterminate: false
- })
- this.setState({
- allChecked: true
- })
- }
- else if(selection.length == 0)
- {
- this.setState({
- indeterminate: false
- })
- this.setState({
- allChecked: false
- })
- }
- else {
- this.setState({
- indeterminate: true
- })
- }
+ checkChange(index, e) {
+ this.state.tableData[index].checked = e.target.checked
+ this.setState({
+ tableData: this.state.tableData
+ })
+ let selection = _.filter(this.state.tableData, (item) => {
+ return item.checked == true
+ })
+ this.props.checkChange(selection)
- }
-
- getCellValue(column,rowData){
- let value = _.get(rowData,column)
- return value||value==0 ? value : "-"
- }
-
- switchChange(index,e) {
+ if (selection.length == this.state.tableData.length) {
+ this.setState({
+ indeterminate: false
+ })
+ this.setState({
+ allChecked: true
+ })
+ } else if (selection.length == 0) {
+ this.setState({
+ indeterminate: false
+ })
+ this.setState({
+ allChecked: false
+ })
+ } else {
+ this.setState({
+ indeterminate: true
+ })
+ }
+ }
- this.state.tableData[index].switched = e;
- this.setState({
- tableData: this.state.tableData
- })
+ getCellValue(column, rowData) {
+ let value = _.get(rowData, column)
+ return value || value == 0 ? value : '-'
+ }
-
- }
+ switchChange(index, e) {
+ this.state.tableData[index].switched = e
+ this.setState({
+ tableData: this.state.tableData
+ })
+ }
- editRow(e,column, row) {
- this.setState({edit_title:column.title})
- this.setState({edit_column:column.prop})
-
- this.setState({curRow:row})
-
- let pos = {}
- pos.x = e.clientX;
- pos.y = e.clientY;
-
- this.setState({postion:pos});
-
- if(this.state.historyrow_id == row.id)
- {
- this.setState({editShow:!this.state.editShow})
- }
- else{
- this.setState({editShow:true})
- this.setState({historyrow_id:row.id})
- }
-
+ editRow(e, column, row) {
+ this.setState({ edit_title: column.title })
+ this.setState({ edit_column: column.prop })
- }
-
- componentWillReceiveProps(nextProps) {
-
- if(this.state.tableData != nextProps.tableData)
- {
+ this.setState({ curRow: row })
- this.setState({tableData: nextProps.tableData});
- this.setState({page: nextProps.page});
- this.setState( {dataCount:nextProps.dataCount})
- }
- }
+ let pos = {}
+ pos.x = e.clientX
+ pos.y = e.clientY
- onConfirm = () => {
-
- }
+ this.setState({ postion: pos })
-
- onCancel = () => {
-
- }
- total = (e) => {
- let sum = 0
- if (e.total) {
- for (let i = 0; i < this.state.tableData.length; i++) {
+ if (this.state.historyrow_id == row.id) {
+ this.setState({ editShow: !this.state.editShow })
+ } else {
+ this.setState({ editShow: true })
+ this.setState({ historyrow_id: row.id })
+ }
+ }
- let row = this.state.tableData[i]
- let num = row[e.prop] == "" ? 0 : row[e.prop];
- sum += num;
- }
- if (e.valueType == "percentage") {
- return sum <= 0 ? "0.00%" : sum.toFixed(2) + "%";
- }
- if (e.valueType == "price") {
- return sum <= 0 ? "0.00" : sum.toFixed(2);
- }
+ componentWillReceiveProps(nextProps) {
+ if (this.state.tableData != nextProps.tableData) {
+ this.setState({ tableData: nextProps.tableData })
+ this.setState({ page: nextProps.page })
+ this.setState({ dataCount: nextProps.dataCount })
+ }
+ }
- } else {
- return "";
- }
- return sum;
- }
- //当前页码条数
- onCountChange(e){
- this.props.countChange(e)
- this.setState({pageCount:e})
- }
- gridPageLoad(){
- this.setState({pageLoading:true})
- setTimeout(()=>{
- this.setState({pageLoading:false})
- },500)
- }
- pageShow(e){
-
- }
- gridEditChange(e){
-
- }
- getSelectData(){
-
- let selectList = this.state.tableData.filter((o)=>{return o.checked == true})
- selectList = _.map(selectList, o => _.omit(o, ['checked']));
- return selectList
-
- }
- rowItemClick(index){
- console.log(index)
-
- this.setState({curIndex:index})
- }
+ onConfirm = () => {}
-
- render() {
- const {
- data,
- ComponentHandler
- } = this.props;
- var column_width = 0;
-
- let auto_column_width = this.state.Column.length > 12 ? "100px" : 100 / (this.state.Column.length - 2) + "%";
-
-
- return (
-
{
- this.props.isMultiple ? ( < div className = "th-td"
- style = {
- {
- "width": "50px",
- "textAlign": "left",
- "background":this.props.headBackgroud,
- }
- } >
- < /Checkbox> < /
- div > ) : null
- } {
- this.props.isSwitch ? ( < div className = "th-td"
- style = {
- {
- "width": "30px",
- "textAlign": "left",
- "visibility": "hidden",
- "background":this.props.headBackgroud,
- }
- } >
- {
- this.switchChange()
- }
- } >
) : null
- }
+ onCancel = () => {}
+ total = (e) => {
+ let sum = 0
+ if (e.total) {
+ for (let i = 0; i < this.state.tableData.length; i++) {
+ let row = this.state.tableData[i]
+ let num = row[e.prop] == '' ? 0 : row[e.prop]
+ sum += num
+ }
+ if (e.valueType == 'percentage') {
+ return sum <= 0 ? '0.00%' : sum.toFixed(2) + '%'
+ }
+ if (e.valueType == 'price') {
+ return sum <= 0 ? '0.00' : sum.toFixed(2)
+ }
+ } else {
+ return ''
+ }
+ return sum
+ }
+ //当前页码条数
+ onCountChange(e) {
+ this.props.countChange(e)
+ this.setState({ pageCount: e })
+ }
+ gridPageLoad() {
+ this.setState({ pageLoading: true })
+ setTimeout(() => {
+ this.setState({ pageLoading: false })
+ }, 500)
+ }
+ pageShow(e) {}
+ gridEditChange(e) {}
+ getSelectData() {
+ let selectList = this.state.tableData.filter((o) => {
+ return o.checked == true
+ })
+ selectList = _.map(selectList, (o) => _.omit(o, ['checked']))
+ return selectList
+ }
+ rowItemClick(index) {
+ console.log(index)
- {
+ this.setState({ curIndex: index })
+ }
- this.state.Column.map((item, index) => {
- column_width = item.width == "auto" ? auto_column_width : item.width;
- return (
{
- item.title
- }
+ render() {
+ const { data, ComponentHandler } = this.props
+ var column_width = 0
- {
- item.sort ? ( <
- Icon type = "arrow-down" / >
- ) : null
- }
+ let auto_column_width =
+ this.state.Column.length > 12
+ ? '100px'
+ : 100 / (this.state.Column.length - 2) + '%'
- )
- })
- }
-
-
-
-
-
{
- this.state.tableData.length == 0 ? ( < div className = "empty-text" > {
- this.state.emptyText
- } < /div>): (
- this.state.tableData.map((item, index) => {
- return (
{this.rowItemClick(index)}}
- style = {
- {
- "background": index % 2 == 0 ? this.props.spliteColor : "#ffffff"
- }
- }
- key = {
- index
- } > {
- this.props.isMultiple ? ( < div className = "td"
- style = {
- {
- "width": "50px",
- "textAlign": "left"
- }
- } >
-
{
- this.checkChange(index, e)
- }
+ return (
+
+
+
+ {' '}
+ {this.props.isMultiple ? (
+
+
+ {' '}
+ {' '}
+
+ ) : null}{' '}
+ {this.props.isSwitch ? (
+
+ {
+ this.switchChange()
+ }}>
+ {' '}
+ {' '}
+
+ ) : null}
+ {this.state.Column.map((item, index) => {
+ column_width =
+ item.width == 'auto' ? auto_column_width : item.width
+ return (
+
+ {' '}
+ {item.title}
+ {item.sort ? : null}{' '}
+
+ )
+ })}{' '}
+
- } >
) : null
- }
- {
- this.props.isSwitch ? ( < div className = "td"
- style = {
- {
- "width": "30px",
- "textAlign": "left"
- }
- } >
-
{
- this.switchChange(index,e)
- }
- }
- loading = {
- this.state.switchLoading
- } > < /Switch> < /div > ) : null
- }
- {
- this.state.Column.map((child, c_index) => {
- column_width = child.width == "auto" ? auto_column_width : child.width;
- return (
- child.type == "normal" ? ( <
- div className = "td"
- style = {
- {
- "width": column_width,
- "justifyContent": child.textAlign
- }
- }
- key = {
- c_index
- } > {
- this.getCellValue(child.prop,item)
- }
-
-
- // this.editRow(e,child, item)
- // }
- // >
- //
- ) : ( {
- ComponentHandler(child.prop, item,index)
- }
- )
- )
+
+
+ {' '}
+ {this.state.tableData.length == 0 ? (
+
{this.state.emptyText}
+ ) : (
+ this.state.tableData.map((item, index) => {
+ return (
+
{
+ this.rowItemClick(index)
+ }}
+ style={{
+ background:
+ index % 2 == 0 ? this.props.spliteColor : '#ffffff'
+ }}
+ key={index}>
+ {' '}
+ {this.props.isMultiple ? (
+
+ {
+ this.checkChange(index, e)
+ }}>
+ {' '}
+ {' '}
+
+ ) : null}
+ {this.props.isSwitch ? (
+
+ {
+ this.switchChange(index, e)
+ }}
+ loading={this.state.switchLoading}>
+ {' '}
+ {' '}
+
+ ) : null}
+ {this.state.Column.map((child, c_index) => {
+ column_width =
+ child.width == 'auto' ? auto_column_width : child.width
+ return child.type == 'normal' ? (
+
+ {' '}
+ {this.getCellValue(child.prop, item)}
+
+ ) : (
+ //
this.editRow(e,child, item)
+ // }
+ // >
+ //
+
+ {' '}
+ {ComponentHandler(child.prop, item, index)}{' '}
+
+ )
+ })}{' '}
+
+ )
+ })
+ )}
+ {this.state.editShow ? (
+
{
+ this.setState({ editShow: false })
+ }}
+ onOk={(row) => {
+ this.setState({ editShow: false })
+ console.log('当前数据行', row)
+ }}
+ row={this.state.curRow}
+ />
+ ) : null}
+
+
- })
+
+ {' '}
+
+ 总计({this.state.tableData.length}
+ 条数据):
+
+ {this.state.Column.map((child, c_index) => {
+ column_width =
+ child.width == 'auto' ? auto_column_width : child.width
+ return (
+
+ {' '}
+ {this.total(child)}{' '}
+
+ )
+ })}{' '}
+
+
- }
- )
- })
- )
- }
- {
- this.state.editShow ?
- (
{
- this.setState({editShow:false}) } } onOk={(row)=>{ this.setState({editShow:false});console.log("当前数据行",row) }} row={this.state.curRow}
- />) : null
- }
-
-
-
-
-
-
-
- 总计({
- this.state.tableData.length
- }
- 条数据):
-
- {
- this.state.Column.map((child, c_index) => {
- column_width = child.width == "auto" ? auto_column_width : child.width;
- return (
{
- this.total(child)
- }
- )
- })
- } < /div>
-
-
-
- {
- this.props.isShowPageBar ? (
-
-
{
- this.gridPageLoad()
- this.props.pageChange(e);
- }
- }
- page={this.props.page}
- pageFn={(e)=>this.setState({page:e})}
- onNextClick = {
- (e) => {
-
- this.gridPageLoad()
- this.props.pageChange(e);
- }
- }
- onJumpPage={
- (e)=>{
-
- this.gridPageLoad()
- this.props.pageChange(e);
- }
- }
- onCountChange ={
- (e)=>{
- this.onCountChange(e)
- }
- }>
-
-
-
):null
-
- }
-
-
- )
- }
+ {this.props.isShowPageBar ? (
+
+
{
+ this.gridPageLoad()
+ this.props.pageChange(e)
+ }}
+ page={this.props.page}
+ pageFn={(e) => this.setState({ page: e })}
+ onNextClick={(e) => {
+ this.gridPageLoad()
+ this.props.pageChange(e)
+ }}
+ onJumpPage={(e) => {
+ this.gridPageLoad()
+ this.props.pageChange(e)
+ }}
+ onCountChange={(e) => {
+ this.onCountChange(e)
+ }}>
+
+ ) : null}
+
+ )
+ }
}
diff --git a/src/components/keysFind/index.jsx b/src/components/keysFind/index.jsx
index c041ceb6..fbb104ef 100644
--- a/src/components/keysFind/index.jsx
+++ b/src/components/keysFind/index.jsx
@@ -2,21 +2,27 @@
* @Author: Wind
* @Date: 2022-07-25 10:53:41
* @LastEditors: Wind
- * @LastEditTime: 2022-07-28 15:29:24
+ * @LastEditTime: 2022-08-10 15:52:01
* @Description:key列表查询组件
* @FilePath: \frontend\src\components\keysFind\index.jsx
*/
import './index.less'
-import { useState } from 'react'
-import { Button, Select, DateRangePicker } from 'zent'
+import { useState, useEffect } from 'react'
+import { Button, Select, DateRangePicker, Notify } from 'zent'
import Ipt from '@/components/input/main'
import Form from '@/components/form/main'
import FormItem from '@/components/form-item/main'
import _ from 'lodash'
+import {
+ getReSellerOption,
+ handelResponse,
+ getPlanChoseOption
+} from '../../assets/api'
+import { FixedSizeList } from 'react-window'
const stateList = [
{ key: 0, text: '全部' },
- { key: 1, text: '待使用' },
+ { key: 1, text: '可使用' },
{ key: 2, text: '已使用' },
{ key: 3, text: '已完结' },
{ key: 4, text: '已作废' }
@@ -26,20 +32,67 @@ function init() {
date: [],
reseller: '',
plan: '',
- state: '',
+ state: { key: 0, text: '全部' },
key: ''
}
}
export default ({ onQuery }) => {
const [models, setModels] = useState(init())
+ const [resellerOption, setResellerOption] = useState([]) /* 分销商 */
+ const [planChoseOption, setPlanChoseOption] = useState([]) /* 营销计划 */
+
+ useEffect(() => {
+ /* 获取分销商 */
+ getReSellerOption().then((res) =>
+ handelResponse(
+ res,
+ (req, msg) => {
+ const data = req.map((item) => ({
+ key: item.direct_reseller_id,
+ text: item.name
+ }))
+ setResellerOption(data)
+ },
+ (err) => {}
+ )
+ )
+ /* 获取营销计划 */
+ getPlanChoseOption().then((res) =>
+ handelResponse(
+ res,
+ (req, msg) => {
+ const data = req.map((item) => ({
+ key: item.id,
+ text: item.title
+ }))
+ setPlanChoseOption(data)
+ },
+ (err) => {}
+ )
+ )
+ }, [])
+
+ function renderOptionList(options, renderOption) {
+ return (
+
+ {({ index, style }) => (
+ {renderOption(options[index], index)}
+ )}
+
+ )
+ }
function onChange(data) {
return {
begin_time: data.date[0] || null,
end_time: data.date[1] || null,
- reseller_name: data.reseller || null,
- plan_name: data.plan || null,
+ reseller_id: data.reseller?.key || null,
+ plan_id: data.plan?.key || null,
status: data.state?.key || null,
key: data.key || null
}
@@ -69,26 +122,26 @@ export default ({ onQuery }) => {
/>
- setModels({ ...models, reseller: '' })}
+ clearable
onChange={(va) => setModels({ ...models, reseller: va })}
/>
- setModels({ ...models, plan: va })}
- onClearItem={() => setModels({ ...models, plan: '' })}
/>
@@ -103,8 +156,20 @@ export default ({ onQuery }) => {
/>
-
-
-
this.bulkSendFunction()}>
+ this.bulkSendFunction()}
+ disabled={!this.state.gridSelection[0]?.reseller_id}>
批量发送
@@ -871,12 +888,19 @@ export default class acclist extends React.Component {
str = (
编辑
- {
- [1,2,8].includes(rowData.status)||[2,6,8,7].includes(this.state.planStatus)?(复制):(
- {this.onCopyRow(e, rowData)}}>复制
- )
- }
-
+ {[1, 2, 8].includes(rowData.status) ||
+ [2, 6, 8, 7].includes(this.state.planStatus) ? (
+ 复制
+ ) : (
+ {
+ this.onCopyRow(e, rowData)
+ }}>
+ 复制
+
+ )}
+
撤销审批
编辑
- {
- [1,2,8].includes(rowData.status)||[2,6,8,7].includes(this.state.planStatus)?(复制):(
- {this.onCopyRow(e, rowData)}}>复制
- )
- }
+ {[1, 2, 8].includes(rowData.status) ||
+ [2, 6, 8, 7].includes(this.state.planStatus) ? (
+ 复制
+ ) : (
+ {
+ this.onCopyRow(e, rowData)
+ }}>
+ 复制
+
+ )}
this.onReCall(e, rowData)}>
@@ -950,11 +981,18 @@ export default class acclist extends React.Component {
}}>
编辑
- {
- [1,2,8].includes(rowData.status)||[2,6,8,7].includes(this.state.planStatus)?(复制):(
- {this.onCopyRow(e, rowData)}}>复制
- )
- }
+ {[1, 2, 8].includes(rowData.status) ||
+ [2, 6, 8, 7].includes(this.state.planStatus) ? (
+ 复制
+ ) : (
+ {
+ this.onCopyRow(e, rowData)
+ }}>
+ 复制
+
+ )}
撤销审批
{
this.onPageChange(e);
}}
+ emptyText="查询 请输入【分销商】或【计划名称】或【key】进行查询"
countChange={(e) => {
this.onCountChange(e);
}}
diff --git a/src/pages/system/account/add/adduserinfo/adduserinfo.js b/src/pages/system/account/add/adduserinfo/adduserinfo.js
index c2d77a2c..7c7dc835 100644
--- a/src/pages/system/account/add/adduserinfo/adduserinfo.js
+++ b/src/pages/system/account/add/adduserinfo/adduserinfo.js
@@ -311,7 +311,11 @@ export default class adduserinfo extends React.Component{
//获取角色
getRoleFn(){
let _self=this;
- getRole().then(res=>{
+ let data={
+ page:1,
+ limit:1000
+ }
+ getRole(data).then(res=>{
handelResponse(res,(response,msg)=>{
let roleList=response.data.map(item=>{
diff --git a/营销系统修改key列表bug.zip b/营销系统修改key列表bug.zip
deleted file mode 100644
index 2a8ebeff..00000000
Binary files a/营销系统修改key列表bug.zip and /dev/null differ