Commit e8f88e53 authored by XieZhiXiong's avatar XieZhiXiong

developing

parent 7fd252ce
......@@ -2,7 +2,6 @@ import React from 'react';
import SchemaForm, {
IAntdSchemaFormProps, createVirtualBox, registerVirtualBox, Schema, SchemaField, FormButtonGroup, Reset, createControllerBox, registerValidationRules,
} from '@formily/antd';
import { Input } from '@formily/antd-components';
import { Button, Space, Row, Col } from 'antd';
import styled from 'styled-components'
import CustomUpload from './components/CustomUpload';
......@@ -22,8 +21,8 @@ import CircleBox from './components/CircleBox';
import Phone from './components/Phone';
import CustomRadio from './components/CustomRadio';
import SearchSelect from './components/SearchSelect';
import './index.less'
import { Checkbox } from '@formily/antd-components';
import { Checkbox, Input } from '@formily/antd-components';
import './index.less';
export interface NiceFormProps extends IAntdSchemaFormProps {}
......@@ -115,7 +114,7 @@ const NiceForm: React.FC<NiceFormProps> = props => {
SchemaFormButtonGroup,
FlexBox,
Phone,
SearchSelect,
SearchSelect,
Input,
};
......
......@@ -11,8 +11,8 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { initDetailSchema } from './schema';
import { PublicApi } from '@/services/api';
import { initDetailSchema } from './schema';
const formActions = createFormActions();
......@@ -84,20 +84,6 @@ const addMember: React.FC<any> = props => {
});
}, []);
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
const queryResult = data.find(v => v.key === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
});
};
const handleSubmit = (values: any) => {
console.log(values);
};
......
......@@ -7,11 +7,11 @@ export const importSchema: ISchema = {
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component': 'Mega-Layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
......@@ -34,7 +34,7 @@ export const importSchema: ISchema = {
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component': 'Flex-Layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
......@@ -105,7 +105,7 @@ export const auditModalSchema = props => {
properties: {
MEGA_LAYOUT: {
type: 'object',
'x-component': 'mega-layout',
'x-component': 'Mega-Layout',
'x-component-props': {
labelAlign: 'top',
},
......@@ -113,7 +113,7 @@ export const auditModalSchema = props => {
remark: {
type: 'string',
title: `会员${props.status === 1 ? '解冻' : '冻结'}原因`,
'x-component': 'textarea',
'x-component': 'TextArea',
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
maxLength: 60,
......@@ -168,18 +168,18 @@ const getCompnentValue = (elements: any) => {
};
export const initDetailSchema = (props: any) => {
let tabSchema = {
let tabSchema: ISchema = {
properties: {
'tab-1': {
type: 'object',
'x-component': 'tabpane',
'x-component': 'TabPane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'mega-layout',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
......@@ -214,10 +214,8 @@ export const initDetailSchema = (props: any) => {
},
},
MEGA_LAYOUT1_1: {
key: 'MEGA_LAYOUT1_1',
type: 'object',
name: 'MEGA_LAYOUT1_1',
'x-component': 'mega-layout',
'x-component': 'Mega-Layout',
'x-component-props': {
label: '注册手机',
required: true,
......@@ -250,22 +248,98 @@ export const initDetailSchema = (props: any) => {
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '渠道信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 12,
labelAlign: 'left',
full: true,
},
properties: {
channelLevel: {
type: 'text',
title: '渠道级别',
},
channelType: {
type: 'string',
enum: [
{ label: '电商渠道', value: '1' },
{ label: '线下渠道', value: '2' },
],
title: '渠道类型',
required: true,
'x-component-props': {
defaultValue: '1',
},
},
cities: {
type: 'array',
title: '代理城市',
required: true,
'x-component': 'CustomAddArray',
default: [
{ province: '1', city: '2' },
{ province: '2', city: '1' },
],
items: {
type: 'object',
properties: {
province: {
type: 'string',
enum: [
{ label: '广东省', value: '1' },
{ label: '湖南省', value: '2' },
],
},
city: {
type: 'string',
enum: [
{ label: '广州', value: '1' },
{ label: '深圳', value: '2' },
],
}
}
}
},
desc: {
type: 'string',
title: '渠道描述',
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
placeholder: '最大200个字符,100个汉字',
},
},
},
},
},
},
},
};
if (Object.keys(props).length > 0) {
for (let [index, item] of props.groups.entries()) {
tabSchema.properties[`tab-${index + 2}`] = {
tabSchema.properties[`tab-${index + 3}`] = {
type: 'object',
'x-component': 'tabpane',
'x-component': 'TabPane',
'x-component-props': {
tab: item.groupName,
},
properties: {
[`MEGA_LAYOUT${index + 2}`]: {
type: 'object',
'x-component': 'mega-layout',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
......@@ -283,8 +357,10 @@ export const initDetailSchema = (props: any) => {
properties: {
REPOSIT_TABS: {
type: 'object',
'x-component': 'tab',
'x-component-props': {},
'x-component': 'Tab',
'x-component-props': {
type: 'card',
},
...tabSchema,
},
},
......
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