李志伟 пре 2 година
родитељ
комит
1417331023
2 измењених фајлова са 5 додато и 2 уклоњено
  1. 1
    1
      config/proxy.js
  2. 4
    1
      src/pages/Machinery/Person/index.jsx

+ 1
- 1
config/proxy.js Прегледај датотеку

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.25:7080',
15
+      target: 'http://192.168.89.147: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

+ 4
- 1
src/pages/Machinery/Person/index.jsx Прегледај датотеку

51
   // 列表点击编辑按钮
51
   // 列表点击编辑按钮
52
   const handleEdit = (val) => {
52
   const handleEdit = (val) => {
53
     setuserId(val.userId);
53
     setuserId(val.userId);
54
+    if (!userId && orgId) {
55
+      form.setFieldsValue({ orgId: orgId })
56
+    }
54
     setEditModal(true);
57
     setEditModal(true);
55
   };
58
   };
56
   //列表点击删除按钮
59
   //列表点击删除按钮
124
   }, [orgId, userId]);
127
   }, [orgId, userId]);
125
 
128
 
126
   const actions = () => [
129
   const actions = () => [
127
-    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => setEditModal(true)}>
130
+    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={handleEdit}>
128
       新增
131
       新增
129
     </Button>,
132
     </Button>,
130
   ];
133
   ];