Sfoglia il codice sorgente

Merge branch 'master' of http://git.ycjcjy.com/marketing/pc-admin into master

zlisen 3 anni fa
parent
commit
5da9349a17

+ 44
- 0
src/pages/staff/Organization/addForm.jsx Vedi File

1
+
2
+
3
+import { Form, Icon, Input, Button, Card, message, Checkbox } from 'antd';
4
+const FormItem = Form.Item
5
+const formItemLayout = {
6
+    //布局
7
+    labelCol: { span: 6 },
8
+    wrapperCol: { span: 14 },
9
+
10
+};
11
+class AddForm extends React.Component {
12
+    handleSubmit = e => {
13
+        e.preventDefault();
14
+        this.props.form.validateFields((err, values) => {
15
+            if (!err) {
16
+                console.log('Received values of form: ', values);
17
+            }
18
+        });
19
+    };
20
+
21
+    render() {
22
+        const { getFieldDecorator } = this.props.form;
23
+        return (
24
+            <Form onSubmit={this.handleSubmit} className="login-form" {...formItemLayout}>
25
+                <FormItem label="名称">
26
+                    {getFieldDecorator('title', {
27
+                        rules: [
28
+                            { required: true, message: '请输入名称!' }
29
+                        ]
30
+                    })(
31
+                        <Input />
32
+                    )}
33
+                </FormItem>
34
+                <FormItem >
35
+                    <Button type="primary" htmlType="submit" style={{ marginLeft: '14em', marginTop: '30px' }}>
36
+                        新增
37
+                    </Button>
38
+                </FormItem>
39
+            </Form>
40
+        );
41
+    }
42
+}
43
+
44
+export default Form.create({})(AddForm);

+ 49
- 126
src/pages/staff/Organization/form.jsx Vedi File

2
 
2
 
3
 import React, { useEffect, useState, useCallback } from 'react';
3
 import React, { useEffect, useState, useCallback } from 'react';
4
 import { Button, Form, Select, Input, InputNumber, Radio, message, Card, DatePicker, } from 'antd';
4
 import { Button, Form, Select, Input, InputNumber, Radio, message, Card, DatePicker, } from 'antd';
5
-// import ImageUpload from '@/components/XForm/ImageUpload';
6
-// import { ProFormDatePicker } from "@ant-design/pro-form";
5
+import router from 'umi/router';
6
+import { fetch, apis, request } from '@/utils/request';
7
+// import { values } from 'lodash';
7
 
8
 
8
-import { values } from 'lodash';
9
 const FormItem = Form.Item;
9
 const FormItem = Form.Item;
10
 const { RangePicker } = DatePicker
10
 const { RangePicker } = DatePicker
11
 const { Option } = Select;
11
 const { Option } = Select;
12
+const updateTreeData = fetch(apis.Institution.instiAlert); //接口
13
+// const Treelist = fetch(apis.Institution.instIist)
14
+
12
 const TreedataFrom = React.forwardRef((props, ref) => {
15
 const TreedataFrom = React.forwardRef((props, ref) => {
13
   // const [treeData, onChangethis] = useState();
16
   // const [treeData, onChangethis] = useState();
14
   const [treeData, settreeData] = useState(0)
17
   const [treeData, settreeData] = useState(0)
15
-  const OnchangeThis = (value) => { }
16
-  const [data, setData] = useState(treeData);
17
-  const { form, treeTitle, onChangethis } = props;
18
+  const { onChangethis } = props//获取父组件的方法
19
+  // const [data, setData] = useState(treeData);
20
+  const { form, treeTitle, } = props;
18
   const { getFieldDecorator, setFieldsValue, validateFields } = form;
21
   const { getFieldDecorator, setFieldsValue, validateFields } = form;
22
+  // const { institutionId } = history || {}
19
 
23
 
20
   const formItemLayout = {
24
   const formItemLayout = {
21
     //布局
25
     //布局
26
   const formRef = React.createRef();
30
   const formRef = React.createRef();
27
 
31
 
28
   const onChange = (date, dateString) => {
32
   const onChange = (date, dateString) => {
29
-    // onChangethis(value)
30
-    console.log(date, dateString);
33
+    onChangethis(value)
34
+    console.log('fomr onChange---', date, dateString);
31
   }
35
   }
36
+  //
32
 
37
 
33
-  const handleSubmit = (value) => {
34
-    props.onChangethis(value)
35
-    console.log(value);
38
+  const handleSubmitAdd = (value) => {
39
+    let arr = []
40
+    arr = props.form.getFieldsValue()//获取表单的值
41
+    console.log('---------------arr', arr.institutionId)
42
+    onChangethis(arr)//把表单值传入父组件的修改方法
43
+    return arr()
36
 
44
 
37
-    setFieldsValue(treeData)
45
+    // setFieldsValue(treeData) 
38
 
46
 
39
   }
47
   }
40
 
48
 
41
 
49
 
50
+  const handleSubmit11 = (values) => {
42
 
51
 
52
+    updateTreeData({ urlData: { id: institutionId }, data: { ...values } }).then((data) => {
53
+    }).catch((err) => {
54
+      message.error(err.msg || err.message)
55
+    })
43
 
56
 
57
+  }
44
 
58
 
45
-  const handleChange = (e, props) => {
46
 
59
 
47
-    // e.preventDefault();
60
+  const handleSubmit = (e, values) => {
48
     let arr = []
61
     let arr = []
49
     arr = props.form.getFieldsValue()
62
     arr = props.form.getFieldsValue()
50
-    // console.log(arr)
51
-    onChangethis(arr)
52
-
63
+    e.preventDefault();//阻止默认提交
64
+    validateFields((err, value) => {
65
+      updateTreeData({
66
+        data: arr,
67
+        urlData: { id: value.institutionId }
68
+      }).then((data) => {
69
+        setData(treeData)
70
+        message.success('修改成功');
71
+      }).catch((err) => {
72
+        message.error(err.message || err);
73
+      })
74
+    });
53
   }
75
   }
54
-  // const handleSubmit = (e) => {s
55
-  //   e.preventDefault();
56
-  //   validateFields((err, values) => {
57
-  //     if (err) {
58
-  //       return;
59
-  //       //字符验证未填写---返回
60
-  //     }
61
-  //   });
62
-  // }
76
+
77
+
63
   //挂载 
78
   //挂载 
64
   const componentDidMount = () => {
79
   const componentDidMount = () => {
65
-    console.log(this.props.FromValue)
80
+    console.log('6666666666form挂载', this.props.FromValue)
66
 
81
 
67
     this.props.triggerRef(this)
82
     this.props.triggerRef(this)
68
   }
83
   }
72
 
87
 
73
     <Form   {...formItemLayout} ref={formRef}
88
     <Form   {...formItemLayout} ref={formRef}
74
       // onChange={onChange}  
89
       // onChange={onChange}  
75
-      onSubmit={e => handleChange(e, props)}
76
-
77
-
90
+      onSubmit={handleSubmit}
78
     >
91
     >
79
       <FormItem hidden >
92
       <FormItem hidden >
93
+        {getFieldDecorator('institutionId')(<Input />)}
94
+      </FormItem> <FormItem hidden >
80
         {getFieldDecorator('key')(<Input />)}
95
         {getFieldDecorator('key')(<Input />)}
81
       </FormItem>
96
       </FormItem>
82
-      <FormItem label="名">
83
-        {getFieldDecorator('title', {
84
-          rules: [{ required: true, message: '请输入名!' }],
97
+      <FormItem label="名">
98
+        {getFieldDecorator('institutionName', {
99
+          rules: [{ required: true, message: '请输入名!' }],
85
         })(<Input />)}
100
         })(<Input />)}
86
       </FormItem>
101
       </FormItem>
87
-      <FormItem label="身份证号" >
88
-        {
89
-          getFieldDecorator('cardId', {
90
-            rules: [{ required: true, message: '请输入身份证号' }]
91
-          })(
92
-            <Input maxLength={19} />
93
-          )
94
-        }
95
-      </FormItem>
96
-      <FormItem label="性别">
97
-        {
98
-          getFieldDecorator('sex', {
99
-            rules: [
100
-              { required: true, message: '请选择性别' }
101
-            ]
102
-          })(
103
-            <Radio.Group style={{ width: '500px' }} initialValue={1}>
104
-              <Radio value={1}>男</Radio>
105
-              <Radio value={2}>女</Radio>
106
-            </Radio.Group>
107
-          )
108
-        }
109
-      </FormItem>
110
-      <FormItem label="联系方式" >
111
-        {
112
-          getFieldDecorator('phone', {
113
-            rules: [{ required: true, message: '请输入联系方式' }]
114
-          })(
115
-            <Input maxLength={11} />
116
-          )
117
-        }
118
-      </FormItem>
119
-      <FormItem label="员工卡号" >
120
-        {
121
-          getFieldDecorator('id', {
122
-            rules: [{ required: true, message: '请输入员工卡号' }]
123
-          })(
124
-            <Input />
125
-          )
126
-        }
127
-      </FormItem>
128
-      <FormItem label="归属部门" >
129
-        {
130
-          getFieldDecorator('belon', {
131
-            rules: [{ required: true, message: '请选择归属部门' }]
132
-          })(
133
-            <Select initialValue={1} onChange={handleChange}>
134
-              <Option value={1}>财务部</Option>
135
-              <Option value={2}>宣传部</Option>
136
-              <Option value={3}>研发部</Option>
137
-              <Option value={4}>仓储物流部</Option>
138
-            </Select>
139
-          )
140
-        }
141
-      </FormItem>
142
-      <FormItem label="居住所在地" >
143
-        {
144
-          getFieldDecorator('homeaddres', {
145
-            rules: [{ required: true, message: '请选择所在地' }]
146
-          })(
147
-            <Select initialValue={1} onChange={handleChange}>
148
-              <Option value={1}>南京</Option>
149
-              <Option value={2}>北京</Option>
150
-              <Option value={3}>湖北</Option>
151
-              <Option value={4}>湖南</Option>
152
-              <Option value={5}>上海</Option>
153
-              <Option value={6}>四川</Option>
154
-            </Select>
155
-          )
156
-        }
157
-      </FormItem>
158
-      <FormItem label="备注" >
159
-        {
160
-          getFieldDecorator('remark', {
161
-            rules: [{ required: false, message: '请输入备注' }]
162
-          })(
163
-            <Input />
164
-          )
165
-        }
166
-      </FormItem>
167
-      <FormItem label="出生日期" style={{ marginBottom: 0 }} >
168
-        {
169
-          getFieldDecorator('day', {
170
-            rules: [
171
-              { required: true, message: '请选择出生日期' }
172
-            ]
173
-          })(
174
-            // <RangePicker style={{width: '255px'}}  />
175
-            <DatePicker onChange={onChange} />
176
-          )
177
-        }
178
-      </FormItem>
179
       <FormItem wrapperCol={{ span: 12, offset: 5 }}>
102
       <FormItem wrapperCol={{ span: 12, offset: 5 }}>
180
         <Button type="primary" htmlType="submit" style={{ marginLeft: '80px', marginTop: '30px' }}>
103
         <Button type="primary" htmlType="submit" style={{ marginLeft: '80px', marginTop: '30px' }}>
181
           修改
104
           修改
182
         </Button>
105
         </Button>
183
         {/* <Button type="danger">
106
         {/* <Button type="danger">
184
           删除
107
           删除
185
-        </Button> */}
108
+           </Button> */}
186
       </FormItem>
109
       </FormItem>
187
     </Form>
110
     </Form>
188
   )
111
   )

+ 94
- 154
src/pages/staff/Organization/index.jsx Vedi File

5
 import apis from '@/services/apis';
5
 import apis from '@/services/apis';
6
 import moment from 'moment';
6
 import moment from 'moment';
7
 import TreedataFrom from './form';
7
 import TreedataFrom from './form';
8
+import TreedataAdd from './addForm';
9
+import { values } from 'lodash';
8
 const { TreeNode, DirectoryTree } = Tree;
10
 const { TreeNode, DirectoryTree } = Tree;
9
 const FormItem = Form.Item;
11
 const FormItem = Form.Item;
10
 const { Search } = Input;
12
 const { Search } = Input;
11
 const { TabPane } = Tabs;
13
 const { TabPane } = Tabs;
12
 
14
 
13
-const treeData =
14
-  [
15
-    {
16
-      title: 'institutionId',
17
-      name: 'institutionName',
18
-      key: '0-0-0',
19
-      selectable: false,
20
-      children: [
21
-        { name: 'institutionName', phone: '13184013427', remark: "", day: "1991-11-22", cardId: '210203197503102721', sex: 2, id: '4242', belon: 2, homeaddres: 2, key: '0-0-0-1', },
22
-        { title: '柯琼彦', phone: '13184013427', remark: "", day: "1991-11-22", cardId: '210203197503102721', sex: 2, id: '4242', belon: 2, homeaddres: 2, key: '0-0-0-2', },
23
-      ],
24
-    },
25
-    {
26
-      title: '分厂员工管理',
27
-      key: '0-0-1',
28
-      selectable: false,
29
-      children: [
30
-        { title: '伏佳', phone: '18613523527', remark: "", day: "1992-10-11", cardId: '520323197806058856', sex: 1, id: '1124', belon: 4, homeaddres: 4, key: '0-0-1-0' },
31
-        { title: '舒宏', phone: '14736632088', remark: "", day: "1992-12-13", cardId: '610729197408202551', sex: 1, id: '4534', belon: 3, homeaddres: 2, key: '0-0-1-1' },
32
-        { title: '狄莉珍', phone: '17604898508', remark: "", day: "1993-10-11", cardId: '820000195008115837', sex: 1, id: '4242', belon: 1, homeaddres: 5, key: '0-0-1-2' },
33
-      ],
34
-    },
35
-  ]
36
-
15
+const treeData = []
16
+const updateTreeData = fetch(apis.Institution.instiAlert); //接口
37
 
17
 
38
 
18
 
39
 
19
 
45
   constructor(props) {
25
   constructor(props) {
46
     super(props)
26
     super(props)
47
     this.state = {
27
     this.state = {
48
-      expandedKeys: ['0-0-0', '0-0-1'],
49
-      autoExpandParent: false,
50
-      checkedKeys: ['0-0-0'],
51
-      searchValue: '',
52
-      selectedKeys: [],
28
+      // autoExpandParent: false,
53
       // treeTitle: [info.node.props],
29
       // treeTitle: [info.node.props],
30
+      // checkedKeys: ['0-0-0'],
31
+      expandedKeys: [],//展开的key
32
+      checkedKeys: [],//选中的key
33
+      autoExpandParent: true,
34
+      searchValue: '',
35
+      selectedKeys: [],//搜索得key
54
       checked: true,
36
       checked: true,
55
       treeData: [],
37
       treeData: [],
56
       testarr: []
38
       testarr: []
57
     };
39
     };
58
   }
40
   }
41
+
42
+
43
+  // onExpand = expandedKeys => {
44
+  //   this.setState({
45
+  //     expandedKeys,
46
+  //     autoExpandParent: false,
47
+  //   });
48
+  // };
49
+
50
+
51
+
59
   // --------标签页
52
   // --------标签页
60
   callback = (key) => {
53
   callback = (key) => {
61
     console.log(key);
54
     console.log(key);
62
   }
55
   }
63
 
56
 
64
 
57
 
65
-
66
-
67
   onExpand = expandedKeys => {
58
   onExpand = expandedKeys => {
68
     console.log('onExpand', expandedKeys);
59
     console.log('onExpand', expandedKeys);
69
 
60
 
79
     this.setState({
70
     this.setState({
80
       sex: e.target.value
71
       sex: e.target.value
81
     });
72
     });
82
-    console.log(valeu);
73
+    console.log(value);
83
   };
74
   };
84
 
75
 
85
   //修改
76
   //修改
86
-  onChangethis = (value) => {
87
-
88
-    const treeData = this.state.treeData
89
-    let Data1 = this.state.treeData
90
-    for (var i = 0; i < treeData.length; i++) {
91
-      for (var j = 0; j < treeData[i].children.length; j++) {
92
-        // console.log(Data1[i].children[j].key);
93
-        // console.log("---------")
94
-        // console.log(value);
95
-        if (treeData[i].children[j].key == value.key) {
96
-
97
-          Data1[i].children[j] = value
98
-          //qileguaile wo cao
99
-          console.log(Data1[i].children[j]);
100
-          // console.log(treeData[i].children[j].key)
101
-          break
102
-        }
103
-      }
104
-    }
105
-    this.setState({
106
-      treeData1: Data1
107
-    }, () => {
108
-      message.success('修改成功!')
109
-    })
110
-
111
-  }
112
-  //删除
113
-  onDelect = (value) => {
114
-    const treeData = this.state.treeData
115
-    let Data1 = this.state.treeData
116
-    for (var i = 0; i < treeData.length; i++) {
117
-      for (var j = 0; j < treeData[i].children.length; j++) {
118
 
77
 
119
-        if (treeData[i].children[j].key == value.key) {
120
-
121
-          delete Data1[i].children[j]
122
-          break
123
-        }
124
-      }
125
-
126
-    }
127
-    // console.log("----Data1-----")
128
-    // console.log(Data1)
129
-    this.setState({
130
-      treeData: Data1
131
-    }, () => {
132
-      message.success('shanchuchenggong')
133
-    })
78
+  onChangethis = async (value) => {
79
+    //获取tree的修改前数据
80
+    const testarr = this.state.treeData
81
+    //把tree的修改前数据赋修改代存数据
82
+    // let Data1 = this.state.treeData
83
+    console.log('value*********>>', value)
84
+    // console.log('Data1------------>', Data1)
85
+    // urlData: { id: value.institutionId }
86
+    // //修改树的数据存在Data1 
87
+    // for (var i = 0; i < testarr.length; i++) {
88
+    //   // console.log('ID------------>', Data1[i].key);
89
+    //   if (testarr[i].key == value.institutionId) {
90
+    //     Data1[i] = value
91
+    //     const res = request(`/api/admin/institution/${Data1[i].institutionId}`, {
92
+    //       method: 'PUT',
93
+    //       data: value,
94
+    //     })
95
+    //     console.log('*************', value)
96
+    //     // console.log('*institutionName*****', institutionName)
97
+
98
+    //     if (res.success) {
99
+    //       message.success("成功")
100
+    //     } else {
101
+    //       message.error("失败")
102
+    //     }
103
+    //   }
104
+    // }
105
+    // this.setState({
106
+    //   treeData1: Data1
107
+    // }, () => {
108
+    //   message.success('修改成功!')
109
+    // })
134
 
110
 
135
   }
111
   }
136
 
112
 
137
 
113
 
138
-
114
+  //单击赋值
139
   onSelect = (values, info) => {
115
   onSelect = (values, info) => {
140
-    // this.FromValue(info.node)
141
-    console.log(this.state.treeData)
142
-    console.log(info)
143
     this.setState({ values }, () => {
116
     this.setState({ values }, () => {
144
       this.formRef.current.setFieldsValue({
117
       this.formRef.current.setFieldsValue({
145
         ...info.node.props,
118
         ...info.node.props,
146
-        key: info.node.props.eventKey,//event
147
-        day: moment(info.node.props.day)
119
+        // institutionId: info.node.props.institutionId,//event
120
+        // day: moment(info.node.props.day)
148
       })
121
       })
149
-      console.log(this.getTreeData)
150
-
151
-      // moment(info.node.props.day).format('YYYY-MM-DD')
122
+      console.log(info.node.props);
152
     })
123
     })
153
   }
124
   }
154
 
125
 
155
-
156
-
157
-  // getTreeData = (e) => {
158
-  //   request({
159
-  //     url: "http://localhost:8000/api/admin/institution/list",
160
-  //     method: 'GET',
161
-
162
-  //     // params: {leveltype: 3, cityId},
163
-  //     action: "admin.institution.get",
164
-  //   }).then((treeData) => {
165
-  //     setData(treeData)
166
-  //     console.log(this.getTreeData)
167
-  //   })
168
-  // }
169
-
170
-
171
-
172
-
173
-
174
-
126
+  //首次加载
175
   async institutionTree(params) {
127
   async institutionTree(params) {
176
     let arr = []
128
     let arr = []
177
-
178
     return request('/api/admin/institution/list', {
129
     return request('/api/admin/institution/list', {
179
       method: 'GET',
130
       method: 'GET',
180
       data: params,
131
       data: params,
181
     }).then((testarr2) => {
132
     }).then((testarr2) => {
182
       this.setState({ testarr: testarr2 }, () => {
133
       this.setState({ testarr: testarr2 }, () => {
183
-        console.log("testarr2")
184
-        console.log(this.state.testarr)
134
+        // console.log("testarr2")
135
+        // console.log(this.state.testarr)
185
         // title: 'institutionId',
136
         // title: 'institutionId',
186
         // name: 'institutionName',
137
         // name: 'institutionName',
187
         // key: '0-0-0',
138
         // key: '0-0-0',
188
         const arr2 = this.state.testarr
139
         const arr2 = this.state.testarr
189
         for (var i = 0; i < this.state.testarr.length; i++) {
140
         for (var i = 0; i < this.state.testarr.length; i++) {
190
           let list = {
141
           let list = {
191
-            title: 'institutionId',
192
-            name: 'institutionName',
193
-            key: '0-0-0'
142
+            title: '',
143
+            institutionName: 'institutionName',
144
+            // name: 'institutionId',
145
+            institutionId: 'institutionId',
146
+            key: '0-0-0',
194
           }
147
           }
148
+          list.institutionName = arr2[i].institutionName
195
           list.title = arr2[i].institutionName
149
           list.title = arr2[i].institutionName
196
-          list.key = '0' + i.toString
150
+          list.institutionId = arr2[i].institutionId
151
+          list.key = arr2[i].institutionId
152
+          // '0' + i.toString
197
           arr.push(list)
153
           arr.push(list)
198
-
199
         }
154
         }
200
-
155
+        // console.log("arr")
156
+        // console.log(arr)
201
         this.setState({
157
         this.setState({
202
           treeData: arr
158
           treeData: arr
203
         })
159
         })
207
     })
163
     })
208
   }
164
   }
209
 
165
 
210
-  componentDidMount() {
211
-    // fetch(`http://localhost:8000/api/admin/institution/list`, {
212
-    //   headers: {
213
-    //     Authorization: "Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiIxIiwib3JnSWQiOiIxIiwiZXhwIjoxNjI3MDQ1MjQxfQ.7FhVDoI0dEECZinRUzMzcLl-kcobkamZSqoUzTxBTRo"
214
-    //   }
215
-    // }).then((res) => {
216
-    //   console.log(res)
217
-    // }),
218
-    // this.institutionTree()
219
-    this.institutionTree([])
220
-
221
-  }
222
-
223
 
166
 
224
 
167
 
225
 
168
 
169
+  UNSAFE_componentWillMount() {
170
+    this.institutionTree([])
226
 
171
 
172
+  }
227
 
173
 
228
 
174
 
229
   renderTreeNodes = data =>
175
   renderTreeNodes = data =>
230
-    data.map(item => {
176
+    (data || []).map(item => {//初始化data
231
       if (item.children) {
177
       if (item.children) {
232
         return (
178
         return (
233
           <TreeNode title={item.title} key={item.key} dataRef={item}  >
179
           <TreeNode title={item.title} key={item.key} dataRef={item}  >
237
       }
183
       }
238
       return <TreeNode key={item.key} {...item} />;
184
       return <TreeNode key={item.key} {...item} />;
239
     });
185
     });
240
-  //搜索框 
241
-  // onChange = e => {
242
-  //   const { value } = e.target;
243
-  //   const expandedKeys = treeData
244
-  //     .map(item => {
245
-  //       if (item.title.indexOf(value) > -1) {
246
-  //         return getParentKey(item.key, gData);
247
-  //       }
248
-  //       return null;
249
-  //     })
250
-  //     .filter((item, i, self) => item && self.indexOf(item) === i);
251
-  //   this.setState({
252
-  //     expandedKeys,
253
-  //     searchValue: value,
254
-  //     autoExpandParent: true,
255
-  //   });
256
-  // };
186
+
257
 
187
 
258
 
188
 
259
 
189
 
260
 
190
 
261
   render() {
191
   render() {
262
-    const { searchValue } = this.state;
192
+    const { searchValue, autoExpandParent, expandedKeys, checkedKeys } = this.state;
263
     return (
193
     return (
264
       <Card>
194
       <Card>
265
         <Row >
195
         <Row >
268
               <FormItem
198
               <FormItem
269
                 label="管辖部门"
199
                 label="管辖部门"
270
               >
200
               >
271
-                {/* <Search style={{ marginBottom: 8 }} placeholder="Search" onChange={this.onChange} /> */}
201
+                <Search style={{ marginBottom: 8 }} placeholder="Search" onChange={this.onChange} />
272
                 <Tree
202
                 <Tree
273
                   // api={apis.Institution.instIist}
203
                   // api={apis.Institution.instIist}
204
+                  // checkable
205
+                  onExpand={this.onExpand}
206
+                  expandedKeys={expandedKeys}
207
+                  autoExpandParent={autoExpandParent}
208
+                  // checkedKeys={checkedKeys}
209
+
274
                   showLine
210
                   showLine
275
-                  defaultExpandedKeys={['0-0']}
211
+                  // defaultExpandedKeys={['0-0']}
276
                   onSelect={this.onSelect}
212
                   onSelect={this.onSelect}
277
                   treeData={this.state.treeData}
213
                   treeData={this.state.treeData}
214
+                // treeData={loop(gData)}
278
                 // api={apis.Institution.instIist} 
215
                 // api={apis.Institution.instIist} 
279
                 >
216
                 >
280
                   {this.renderTreeNodes(this.state.treeData)}
217
                   {this.renderTreeNodes(this.state.treeData)}
289
                 <TabPane tab='编辑' key='1'>
226
                 <TabPane tab='编辑' key='1'>
290
                   <TreedataFrom
227
                   <TreedataFrom
291
                     ref={this.formRef}
228
                     ref={this.formRef}
229
+                    api={apis.Institution.instiAlert}
292
                     triggerRef={this.bindRef}
230
                     triggerRef={this.bindRef}
293
                     onChangethis={this.onChangethis}
231
                     onChangethis={this.onChangethis}
294
                     onSubmit={this.onChangethis}
232
                     onSubmit={this.onChangethis}
295
                   />
233
                   />
296
                 </TabPane>
234
                 </TabPane>
297
-                <TabPane tab='新增' key='2'>
298
-                  <div>You cannot set a form field before rendering a field associated with the value. </div>
299
-                </TabPane>
235
+                {/* <TabPane tab='新增' key='2'>
236
+                  <TreedataAdd
237
+                  >
238
+                  </TreedataAdd>
239
+                </TabPane> */}
300
 
240
 
301
               </Tabs>
241
               </Tabs>
302
             </Card>
242
             </Card>

+ 1
- 1
src/services/apis.js Vedi File

2283
       url: `${prefix}/video/:id`,
2283
       url: `${prefix}/video/:id`,
2284
       action: 'admin.publish.id.put',
2284
       action: 'admin.publish.id.put',
2285
     },
2285
     },
2286
-   
2286
+
2287
   },
2287
   },
2288
 };
2288
 };