Browse Source

人员管理优化1.1

李志伟 2 years ago
parent
commit
5ffc6fd385

+ 1
- 1
config/proxy.js View File

12
     '/api/': {
12
     '/api/': {
13
       // 要代理的地址
13
       // 要代理的地址
14
       // target: 'http://127.0.0.1:7080',
14
       // target: 'http://127.0.0.1:7080',
15
-      target: 'http://192.168.89.147:7080',
15
+      target: 'http://192.168.89.25:7080',
16
       // target: 'http://machine.njyunzhi.com',
16
       // target: 'http://machine.njyunzhi.com',
17
       // 配置了这个可以从 http 代理到 https
17
       // 配置了这个可以从 http 代理到 https
18
       // 依赖 origin 的功能可能需要这个,比如 cookie
18
       // 依赖 origin 的功能可能需要这个,比如 cookie

+ 2
- 1
src/components/CooperativeSearch/index.jsx View File

4
 
4
 
5
 const Option = Select.Option;
5
 const Option = Select.Option;
6
 export default (props) => {
6
 export default (props) => {
7
-  const { value, onChange, ...otherProps } = props;
7
+  const { value, onChange, disabled, ...otherProps } = props;
8
 
8
 
9
   const [list, setList] = useState([]);
9
   const [list, setList] = useState([]);
10
 
10
 
42
       onSearch={handleSearch}
42
       onSearch={handleSearch}
43
       onChange={onChange}
43
       onChange={onChange}
44
       notFoundContent={null}
44
       notFoundContent={null}
45
+      disabled={disabled}
45
       {...otherProps}
46
       {...otherProps}
46
     >
47
     >
47
       {list.map((item) => {
48
       {list.map((item) => {

+ 11
- 5
src/pages/Machinery/Person/index.jsx View File

136
     setEditModal(false);
136
     setEditModal(false);
137
   };
137
   };
138
   // 弹窗表单中合作社搜索框改变事件目前没用
138
   // 弹窗表单中合作社搜索框改变事件目前没用
139
-  const handelChange = () => {};
139
+  const handelChange = () => { };
140
 
140
 
141
   // 列表点击编辑按钮
141
   // 列表点击编辑按钮
142
   const handleEdit = (val) => {
142
   const handleEdit = (val) => {
196
     form.resetFields();
196
     form.resetFields();
197
     setEditRoleModal(false);
197
     setEditRoleModal(false);
198
   };
198
   };
199
+  //授权角色弹窗点击保存按钮
199
   const handelOk = () => {
200
   const handelOk = () => {
200
     if (!currentCheckbox) {
201
     if (!currentCheckbox) {
201
       message.info('请选择角色');
202
       message.info('请选择角色');
264
         console.log(err.message);
265
         console.log(err.message);
265
       });
266
       });
266
   }, []);
267
   }, []);
268
+  //监控
267
   useEffect(() => {
269
   useEffect(() => {
268
     if (userId) {
270
     if (userId) {
269
       getUserDetail(userId)
271
       getUserDetail(userId)
278
           console.log(err.message);
280
           console.log(err.message);
279
         });
281
         });
280
     } else {
282
     } else {
281
-      form.resetFields();
283
+      if (orgId) {
284
+        form.setFieldsValue({ orgId: orgId })
285
+      } else {
286
+        form.resetFields();
287
+      }
282
     }
288
     }
283
-  }, [userId]);
289
+  }, [orgId, userId]);
284
 
290
 
285
   const actions = () => [
291
   const actions = () => [
286
     <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => setEditModal(true)}>
292
     <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => setEditModal(true)}>
413
           <FormItem label="用户名" name="userName" rules={[{ required: true, message: '请输入' }]}>
419
           <FormItem label="用户名" name="userName" rules={[{ required: true, message: '请输入' }]}>
414
             <Input placeholder="请输入" />
420
             <Input placeholder="请输入" />
415
           </FormItem>
421
           </FormItem>
416
-          <FormItem label="性别" name="sex">
422
+          <FormItem label="性别" name="sex" rules={[{ required: true, message: '请选择' }]}>
417
             <Radio.Group>
423
             <Radio.Group>
418
               <Radio value={1}>男</Radio>
424
               <Radio value={1}>男</Radio>
419
               <Radio value={0}>女</Radio>
425
               <Radio value={0}>女</Radio>
436
             <span style={{ opacity: '0.7' }}>默认密码{password}</span>
442
             <span style={{ opacity: '0.7' }}>默认密码{password}</span>
437
           </FormItem>
443
           </FormItem>
438
           <FormItem label="所属合作社" name="orgId" rules={[{ required: true, message: '请输入' }]}>
444
           <FormItem label="所属合作社" name="orgId" rules={[{ required: true, message: '请输入' }]}>
439
-            <Search placeholder="请输入合作社" onChange={handelChange} />
445
+            <Search placeholder="请输入合作社" disabled={orgId && !userId ? true : false} onChange={handelChange} />
440
           </FormItem>
446
           </FormItem>
441
           {userId && (
447
           {userId && (
442
             <FormItem
448
             <FormItem