update 搬迁树节点页面
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Form, Input, Spin } from 'antd'
|
||||
import { Form, Input, InputNumber, Spin } from 'antd'
|
||||
import { AntIcon } from 'components'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
const initialValues = {}
|
||||
const initialValues = {
|
||||
sort: 100
|
||||
}
|
||||
|
||||
export default class form extends Component {
|
||||
|
||||
@@ -29,12 +31,13 @@ export default class form extends Component {
|
||||
* 填充数据
|
||||
* 可以在设置this.record之后对其作出数据结构调整
|
||||
* [异步,必要]
|
||||
* @param {*} record
|
||||
* @param {*} params
|
||||
*/
|
||||
async fillData(record) {
|
||||
async fillData(params) {
|
||||
|
||||
this.record = cloneDeep(record)
|
||||
/** */
|
||||
this.record = cloneDeep(params.record)
|
||||
//#region 从后端转换成前段所需格式
|
||||
//#endregion
|
||||
this.form.current.setFieldsValue(this.record)
|
||||
|
||||
this.setState({
|
||||
@@ -57,7 +60,8 @@ export default class form extends Component {
|
||||
if (this.record) {
|
||||
postData.id = this.record.id
|
||||
}
|
||||
/** */
|
||||
//#region 从前段转换后端所需格式
|
||||
//#endregion
|
||||
return postData
|
||||
}
|
||||
}
|
||||
@@ -79,6 +83,14 @@ export default class form extends Component {
|
||||
<Form.Item label="唯一编码" name="code" rules={[{ required: true, message: '请输入唯一编码' }]}>
|
||||
<Input autoComplete="off" placeholder="请输入唯一编码" />
|
||||
</Form.Item>
|
||||
<Form.Item label="排序" name="sort">
|
||||
<InputNumber
|
||||
max={1000}
|
||||
min={0}
|
||||
placeholder="请输入排序"
|
||||
className="w-100-p"
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
</Spin>
|
||||
</Form>
|
||||
|
||||
@@ -144,7 +144,7 @@ export default class index extends Component {
|
||||
* @param {*} query
|
||||
* @returns
|
||||
*/
|
||||
async loadData(params, query) {
|
||||
loadData = async (params, query) => {
|
||||
const { data } = await apiAction.page({
|
||||
...params,
|
||||
...query,
|
||||
@@ -176,7 +176,9 @@ export default class index extends Component {
|
||||
* @param {*} record
|
||||
*/
|
||||
onOpen(modal, record) {
|
||||
modal.current.open(record)
|
||||
modal.current.open({
|
||||
record
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +242,7 @@ export default class index extends Component {
|
||||
<Button
|
||||
icon={<AntIcon type="plus" />}
|
||||
onClick={() => this.onOpen(this.addForm)}
|
||||
>新增应用</Button>
|
||||
>新增{name}</Button>
|
||||
}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user