|
@@ -1,10 +1,10 @@
|
1
|
1
|
import React, { useState } from 'react';
|
2
|
|
-import { Tag, Space, Button, Popconfirm, Form, Modal, Input } from 'antd';
|
|
2
|
+import { Tag, Space, Button, Popconfirm, Form, Modal, Input, message } from 'antd';
|
3
|
3
|
import { PageHeaderWrapper } from '@ant-design/pro-layout';
|
4
|
4
|
import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
5
|
5
|
|
6
|
6
|
import ProList from '@ant-design/pro-list';
|
7
|
|
-
|
|
7
|
+import './index.less'
|
8
|
8
|
const FormItem = Form.Item
|
9
|
9
|
const defaultData = [
|
10
|
10
|
{
|
|
@@ -12,21 +12,7 @@ const defaultData = [
|
12
|
12
|
name: '赵村',
|
13
|
13
|
desc: '赵村较大,多人协作',
|
14
|
14
|
},
|
15
|
|
- {
|
16
|
|
- id: '2',
|
17
|
|
- name: '钱村',
|
18
|
|
- desc: '钱村头以南二百米',
|
19
|
|
- },
|
20
|
|
- {
|
21
|
|
- id: '3',
|
22
|
|
- name: '孙孙村',
|
23
|
|
- desc: '',
|
24
|
|
- },
|
25
|
|
- {
|
26
|
|
- id: '4',
|
27
|
|
- name: '李村',
|
28
|
|
- desc: '村民拒不配合,暂停',
|
29
|
|
- },
|
|
15
|
+
|
30
|
16
|
];
|
31
|
17
|
export default () => {
|
32
|
18
|
const [form2] = Form.useForm()
|
|
@@ -42,7 +28,8 @@ export default () => {
|
42
|
28
|
const Submit = (values) => {
|
43
|
29
|
console.log('editdetail', editdetail, values);
|
44
|
30
|
message.success(`修改成功`);
|
45
|
|
- setLoading2(false)
|
|
31
|
+ setDataSource([...dataSource, values])
|
|
32
|
+ // setLoading2(false)
|
46
|
33
|
onCancel()
|
47
|
34
|
|
48
|
35
|
}
|
|
@@ -57,24 +44,29 @@ export default () => {
|
57
|
44
|
return (
|
58
|
45
|
<PageHeaderWrapper>
|
59
|
46
|
<ProList
|
|
47
|
+
|
60
|
48
|
toolBarRender={actions}
|
61
|
|
- rowKey="id" headerTitle="区域范围" dataSource={dataSource} showActions="hover" editable={{
|
|
49
|
+ rowKey="id"
|
|
50
|
+ headerTitle="区域范围"
|
|
51
|
+ dataSource={dataSource}
|
|
52
|
+ showActions="hover"
|
|
53
|
+ editable={{
|
62
|
54
|
onSave: async (key, record, originRow) => {
|
63
|
|
- console.log(key, record, originRow);
|
|
55
|
+ console.log('修改后的', key, record, originRow);
|
64
|
56
|
return true;
|
65
|
57
|
},
|
66
|
|
- }} onDataSourceChange={setDataSource} metas={{
|
67
|
|
- title: {
|
|
58
|
+ }}
|
|
59
|
+ onDataSourceChange={setDataSource}
|
|
60
|
+ metas={{
|
|
61
|
+ title: {//标题
|
68
|
62
|
dataIndex: 'name',
|
69
|
63
|
},
|
70
|
|
- // avatar: {
|
71
|
|
- // dataIndex: 'image',
|
72
|
|
- // editable: false,
|
73
|
|
- // },
|
74
|
|
- description: {
|
|
64
|
+
|
|
65
|
+ description: {//简介
|
75
|
66
|
dataIndex: 'desc',
|
76
|
67
|
},
|
77
|
68
|
subTitle: {
|
|
69
|
+ editable: false,
|
78
|
70
|
render: () => {
|
79
|
71
|
return (<Space size={0}>
|
80
|
72
|
{/* <Tag color="blue"></Tag> */}
|
|
@@ -101,12 +93,12 @@ export default () => {
|
101
|
93
|
],
|
102
|
94
|
},
|
103
|
95
|
}} />,
|
104
|
|
- <Modal title="套餐权重修改" visible={editModal} onCancel={onCancel} destroyOnClose={true} footer={null}>
|
|
96
|
+ <Modal title="套餐权重修改" visible={editModal} onCancel={onCancel} keyboard={false} maskClosable={false} destroyOnClose={true} footer={null}>
|
105
|
97
|
< Form {...formItemLayout} onFinish={Submit} form={form2} >
|
106
|
|
- <FormItem label="范围名称" name="shopNam12e" rules={[{ required: true, message: '请输入' }]}>
|
|
98
|
+ <FormItem label="范围名称" name="name" rules={[{ required: true, message: '请输入' }]}>
|
107
|
99
|
<Input placeholder="请输入" style={{ width: '350px' }} />
|
108
|
100
|
</FormItem>
|
109
|
|
- <FormItem label="备注" name="shopName" rules={[{ required: true, message: '请输入' }]}>
|
|
101
|
+ <FormItem label="备注" name="desc" >
|
110
|
102
|
<Input placeholder="请输入" style={{ width: '350px' }} />
|
111
|
103
|
</FormItem>
|
112
|
104
|
<FormItem label=" " colon={false} >
|