预览效果
Ds文件
import intl from 'utils/intl';
import { SRM_PLATFORM } from '_utils/config';
import { getCurrentTenant } from 'utils/utils';
const apiRoute = SRM_PLATFORM;
const { tenantId } = getCurrentTenant();
export { xxx};
const xxx = (record) => {
return {
fields: [
// lov彈框或下拉框使用
{
name: 'Obj',
label: xxx,
type: 'object',// 注明类型为object
lovCode: 'xxxx',
// lov所需参数
lovPara: {
noneEpFlag: 'Y',
},
ignore: 'always',// 排除此次请求
textField: 'xxx',
required: true,
multiple: true, // 是否支持多选
// 提交数据前对数据进行修改
transformRequest:(value) => {
return value[0];
},
// 动态属性
dynamicProps: ({ record }) => {
return {
xxx: {
},
};
},
},
{
name: 'xxx',//不显示在列,用来发请求,绑定lov值
bind: 'Obj.xxx',
},
],
transport: {
read: () => ({
url: ``,
method: 'GET',
params: {
XXXX
},
}),
create: () => ({
}),
update: () => ({
}),
destroy: () => ({
}),
},
};
};
index.js
import React, { Component } from 'react';
import { Header, Content } from 'components/Page';
import {
xxx
} from 'choerodon-ui/pro';
import intl from 'utils/intl';
export default class xxx extends Component {
xxxx= new DataSet({
...xxx(),
});
get Columns() {
return [
{
name: 'companyObj',
editor: true,
},
];
}
render() {
return (
<>
<Header title="xxxx" />
<Content>
<Table
dataSet={this.xxx}
columns={this.Columns}
buttons={[
'add',
'save',
'delete',
]}
/>
</Content>
</>
);
}
}