|
@@ -49,7 +49,6 @@ class Index extends React.PureComponent {
|
|
|
{ title: '序号', dataIndex: 'id' },
|
|
|
{ title: '规则名', dataIndex: 'rule' },
|
|
|
{ title: '接口', dataIndex: 'url' },
|
|
|
- { title: '字段配置', dataIndex: 'fieldsJson' },
|
|
|
{ title: '是否可以运行', dataIndex: 'status' },
|
|
|
{ title: '描述', dataIndex: 'desc' },
|
|
|
// { title: '创建时间', dataIndex: 'createTime' },
|
|
@@ -70,7 +69,7 @@ class Index extends React.PureComponent {
|
|
|
this.refresh = refresh
|
|
|
},
|
|
|
// 筛选和列表的中间位置如果有批量操作按钮,可以放在这个位置
|
|
|
- batchBtns: [{ label: '创建', type: 'primary', onClick: () => this.editItem({}) }]
|
|
|
+ batchBtns: [{ label: '创建', type: 'primary', onClick: () => this.editItem({fieldsJson:"{}"}) }]
|
|
|
}
|
|
|
|
|
|
// 点击编辑按钮时的事件处理函数
|
|
@@ -104,11 +103,11 @@ class Index extends React.PureComponent {
|
|
|
// 点击新建、编辑对话框的确定按钮的事件处理函数
|
|
|
onModalOk = (params) => {
|
|
|
// 在触发action调用接口前,可以做一些前端校验工作,比如下面的:
|
|
|
- if (!params.developerName) {
|
|
|
- // 如果developerName不存在或者为空字符,那么给用户一个warning提示,同时return阻止后面的接口调用
|
|
|
- message.warning('公司名称必填')
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (!params.developerName) {
|
|
|
+ // // 如果developerName不存在或者为空字符,那么给用户一个warning提示,同时return阻止后面的接口调用
|
|
|
+ // message.warning('公司名称必填')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
const fieldsJson = params.fieldsJson.reduce((t, { key, desc, column }) => {
|
|
|
t[key] = {
|
|
@@ -116,7 +115,7 @@ class Index extends React.PureComponent {
|
|
|
}
|
|
|
}, {})
|
|
|
params.fieldsJson = JSON.stringify(fieldsJson)
|
|
|
- const type = params.id ? 'template/_addItem' : 'template/_editItem'
|
|
|
+ const type = !params.id ? 'template/_addItem' : 'template/_editItem'
|
|
|
this.props.dispatch({
|
|
|
type,
|
|
|
payload: params,
|