Commit a8926610 authored by LeeJiancong's avatar LeeJiancong

'条件筛选换写法'

parent 013bdcbc
......@@ -412,7 +412,6 @@ export const payStrategySchema:ISchema = {
properties: {
memberTypeId: {
type: 'string',
"x-component": 'Input',
enum: [],
"x-component-props": {
placeholder: '会员类型',
......@@ -423,7 +422,6 @@ export const payStrategySchema:ISchema = {
},
roleId: {
type: 'string',
"x-component": 'Input',
enum: [],
"x-component-props": {
placeholder: '会员角色',
......@@ -434,7 +432,6 @@ export const payStrategySchema:ISchema = {
},
level: {
type: 'string',
"x-component": 'Input',
enum: [],
"x-component-props": {
placeholder: '会员等级',
......
export interface BusinessType {
businessTypeId: number;
businessTypeName: string;
}
export interface UseType {
memberTypeId: number;
memberTypeName: string;
businessTypes: BusinessType[];
}
export interface UserRegister {
useType: UseType[];
}
export interface RuleConfiguration {
value: number;
label: string;
platformType: number;
}
export interface PayWayResponse {
payType: number;
value: number;
label: string;
}
export interface PayInitializeConfig {
payType: number;
ruleConfigurations: RuleConfiguration[];
payWayResponses: PayWayResponse[];
}
export interface PayPlatformPayConfig {
id: number;
way: string;
payType: number;
isPitchOn: number;
}
export interface PayConfig {
payInitializeConfig: PayInitializeConfig[];
payPlatformPayConfig: PayPlatformPayConfig[];
}
export interface CountryList {
name: string;
key: string;
icon: string;
}
export interface Children {
code: string;
}
export interface MenuList {
code: string;
children: Children[];
}
export interface Global {
logo: string;
countryList: CountryList[];
menuList: MenuList[];
}
export interface RootObject {
userRegister: UserRegister;
payConfig: PayConfig;
global: Global;
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Date: 2020-08-06 19:07:53
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-10-15 17:09:26
* @LastEditTime: 2020-10-15 17:35:06
*/
import React, { useEffect , useState,useRef } from 'react'
import {Card,Button,Modal} from 'antd'
......@@ -17,6 +17,7 @@ import PayForm from '../components/PayForm'
import ModalTable from '@/components/ModalTable'
import Search from '@/components/NiceForm/components/Search'
import SearchSelect from '@/components/NiceForm/components/SearchSelect'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import {useInitValue} from '@/formSchema/effects/useInitValue'
import {strategyDetailTab} from '../schema'
import {usePageStatus, PageStatus} from '@/hooks/usePageStatus'
......@@ -194,7 +195,13 @@ const PaySetting: React.FC<{}> = () => {
}
PublicApi.getMemberManagePageitems().then(res => {
return () => {
}
}, [])
const fetchSelectOptions = async () =>{
let res = await PublicApi.getMemberManagePageitems()
if(res.code === 1000){
let {data} = res
let a = [{value:'',label:'请选择'}]
......@@ -211,13 +218,16 @@ const PaySetting: React.FC<{}> = () => {
value: v.level,
label: v.levelTag
}))
setfilterParams({...filterParams,roleList:[...a,...roleList],levelList:[...a,...leverList],memberTypeList: [...a,...memberTypeList] })
return {
memberTypeId: [...a,...memberTypeList],
roleId: [...a,...roleList],
level :[...a,...leverList]
}
// setfilterParams({...filterParams,roleList:[...a,...roleList],levelList:[...a,...leverList],memberTypeList: [...a,...memberTypeList] })
}
})
return () => {
}
}, [])
}
const formSearch: ISchema = {
type: 'object',
properties: {
......@@ -245,7 +255,6 @@ const PaySetting: React.FC<{}> = () => {
properties: {
memberTypeId: {
type: 'string',
"x-component": 'Input',
enum: filterParams.memberTypeList,
"x-component-props": {
placeholder: '会员类型',
......@@ -256,7 +265,6 @@ const PaySetting: React.FC<{}> = () => {
},
roleId: {
type: 'string',
"x-component": 'Input',
enum: filterParams.roleList,
"x-component-props": {
placeholder: '会员角色',
......@@ -267,7 +275,6 @@ const PaySetting: React.FC<{}> = () => {
},
level: {
type: 'string',
"x-component": 'Input',
enum: filterParams.levelList,
"x-component-props": {
placeholder: '会员等级',
......@@ -289,6 +296,78 @@ const PaySetting: React.FC<{}> = () => {
}
}
}
// 会员弹框高级筛选
const formMember: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '请输入会员名称',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
style: {
marginRight: 0
}
},
colStyle: {
marginTop: 20,
},
},
properties: {
memberTypeId: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员类型',
// style: {
// width: 160
// }
}
},
roleId: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员角色',
// style: {
// width: 160
// }
}
},
level: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员等级',
// style: {
// width: 160
// }
}
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}
// 整体表单提交
const handleSubmit = (values:any) => {
let baseList: any = GlobalConfig.payConfig.payInitializeConfig
......@@ -393,19 +472,23 @@ const PaySetting: React.FC<{}> = () => {
columns={columnsSetMember}
rowSelection={memberRowSelection}
fetchTableData={params => fetchMemberList(params)}
modalType='payStrategyFilter'
// modalType='payStrategyFilter'
formilyProps={
{
ctx: {
schema: formSearch,
schema: formMember,
components: { ModalSearch: Search, SearchSelect, Submit, Input },
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name1',
'name',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['memberTypeId', 'roleId', 'level'],
fetchSelectOptions,
);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment