Commit a4d437d7 authored by Bill's avatar Bill

refactor: 重构新建加工

parent b49d4938
import { ColumnsType } from 'antd/es/table';
export const enterprisesColumn: ColumnsType<any> = [
{
title: '会员ID',
dataIndex: 'memberId'
},
{
title: '会员名称',
dataIndex: 'name',
},
{
title: '会员类型',
dataIndex: "memberTypeName"
},
{
title: '会员角色',
dataIndex: "roleName"
},
{
title: '会员等级',
dataIndex: "levelTag"
}
]
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema } from '@formily/antd';
export const enterprisesSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索会员名称',
align: 'flex-left',
tip: '输入会员名称进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
columns: 1,
},
properties: {
roleId: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员角色',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
/**
* 加工商品schema
*/
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ISchema } from '@formily/antd';
export const productSchema: ISchema = {
type: 'object',
properties: {
megaLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索商品名称',
align: 'flex-left',
tip: '输入商品名称进行搜索',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
full: true,
columns: 3,
},
properties: {
customerCategoryId: {
type: 'string',
'x-component': 'Cascader',
'x-component-props': {
placeholder: '请选择商品品类',
allowClear:true,
style: {
width: '160px',
// margin: '0 20px 0 0'
},
fieldNames: { label: 'title', value: 'id', children: 'children' }
}
},
brandId: {
type: 'string',
// 'x-component': 'Select',
enum: [],
'x-component-props': {
placeholder: '请选择商品品牌',
allowClear:true,
showSearch: true,
optionFilterProp: "children",
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
......@@ -15,7 +15,6 @@ export const mapTextComponent = (
): React.JSXElementConstructor<any> => {
const { editable } = fieldProps
// console.log("props", props, "fieldProps", fieldProps);
console.log(fieldProps.form.getFieldValue("detail.layout1.productList.0"))
if (editable !== undefined) {
if (editable === false) {
return PreviewText
......@@ -40,4 +39,7 @@ export const mapStyledProps = (
export default connect({
// getProps: mapStyledProps, //处理状态映射
getComponent: mapTextComponent //处理详情态
})((Input))
})((props) => {
const { dataSource, value, onChange } = props;
return <Input value={value} onChange={onChange} />
})
This diff is collapsed.
This diff is collapsed.
......@@ -29,8 +29,8 @@ interface Iprops {
footer?: React.ReactNode,
tableProps?: {
rowKey: string | ((record) => any)
},
width?: number,
mode: 'checkbox' | 'radio',
customizeRadio?: boolean,
/**
......@@ -45,6 +45,7 @@ interface Iprops {
* format话参数
*/
format?: ((value) => any) | null,
components?: { [key: string]: any },
effects?: ($, actions) => void,
fetchData: (params: any) => any,
onClose: () => void,
......@@ -53,7 +54,7 @@ interface Iprops {
}
const TableModal: React.FC<Iprops> = (props: Iprops) => {
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format, customizeRadio, modalType, footer } = props;
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format, customizeRadio, modalType, footer, width, components } = props;
const ref = useRef<any>({});
const isFirstLoad = useRef<boolean>(true)
const [selectRow, setSelectRow] = useState<number[] | string[]>(() => {
......@@ -132,7 +133,7 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
visible={visible}
onCancel={handleOnClose}
// onOk={handleOk}
width={840}
width={width}
{...otherProps}
>
<StandardTable
......@@ -150,14 +151,19 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
hideSelectAll: customizeRadio,
}}
formRender={(child, ps) => (
<div style={{display: "flex", flexDirection: 'row', justifyContent: 'space-between'}}>
<div>{child}</div>
<div>{ps}</div>
// <div style={{display: "flex", flexDirection: 'row', justifyContent: 'space-between'}}>
// <div>{child}</div>
// <div>{ps}</div>
// </div>
<div style={{position: "relative", }}>
<div >{child}</div>
<div style={{position: 'absolute', right: 0, top: 0}}>{ps}</div>
</div>
)}
controlRender={
<NiceForm
schema={schema}
components={components}
actions={formActions}
onSubmit={handleSearch}
expressionScope={expressionScope}
......@@ -182,7 +188,9 @@ TableModal.defaultProps = {
format: null,
customizeRadio: false,
modalType: "Modal",
footer: null
footer: null,
width: 840,
components: {}
}
export default TableModal;
......@@ -189,12 +189,15 @@ export const memberSchema: ISchema = {
layout: {
type: 'object',
'x-component': 'mega-layout',
"x-component-props": {
inline: true
},
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索会员名称',
placeholder: '搜索会员名称1',
tip: '输入 会员名称 进行搜索',
advanced: false,
},
......
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