fangmingyue 2 лет назад
Родитель
Сommit
aa22b511f9

+ 1
- 1
config/proxy.js Просмотреть файл

@@ -11,7 +11,7 @@ export default {
11 11
     // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
12 12
     '/api/': {
13 13
       // 要代理的地址
14
-      target: 'http://192.168.89.147:7080',
14
+      target: 'http://192.168.89.76:7080',
15 15
       // target: 'http://192.168.89.76:7080',
16 16
       // target: 'http://machine.njyunzhi.com',
17 17
       // 配置了这个可以从 http 代理到 https

+ 16
- 9
src/pages/SystemManagement/Sensing/index.jsx Просмотреть файл

@@ -26,7 +26,7 @@ export default (props) => {
26 26
   const actionRef = useRef();
27 27
   const [machineryList, setMachineryList] = useState([]);
28 28
   const [typeId, setTypeId] = useState();
29
-  const e = 0;
29
+
30 30
   // useEffect(() => {
31 31
   //   if (regionId) {
32 32
   //   } else {
@@ -34,6 +34,13 @@ export default (props) => {
34 34
   //   }
35 35
   // }, [regionId]);
36 36
 
37
+  const handleChange = (e) => {
38
+    getMachineryTypeList().then((e) => {
39
+      setTypeId(e.records);
40
+      console.log('qqqqqqqq', e.records);
41
+    })
42
+  };
43
+
37 44
   //列表编辑
38 45
   const handelEdit = (val) => {
39 46
     setMachineryId(val.machineryId);
@@ -79,6 +86,11 @@ export default (props) => {
79 86
     }).catch((err) => {
80 87
       console.log(err.message)
81 88
     });
89
+    getMachineryList({ pageSize: 999 }).then((e) => {
90
+      setMachineryList(e.records);
91
+    }).catch((err) => {
92
+      console.log(err.message)
93
+    });
82 94
   }, []);
83 95
 
84 96
   useEffect(() => {
@@ -88,18 +100,13 @@ export default (props) => {
88 100
       }).catch((err) => {
89 101
         console.log(err.message)
90 102
       });
91
-    }
92
-  }, [typeId])
93
-
94
-  useEffect(() => {
95
-    if (machineryId) {
96 103
       getMachineryList({ machineryId }).then((e) => {
97 104
         setMachineryList(e.records);
98 105
       }).catch((err) => {
99 106
         console.log(err.message)
100 107
       });
101 108
     }
102
-  }, [machineryId])
109
+  }, [typeId])
103 110
 
104 111
   const columns = [
105 112
     {
@@ -191,7 +198,7 @@ export default (props) => {
191 198
       >
192 199
         <Form  {...formItemLayout} onFinish={Submit} form={form}>
193 200
           <FormItem label="农机分类" rules={[{ required: true, message: '请选择农机分类' }]}>
194
-            <Select value={typeId} onChange={setTypeId} allowClear style={{ width: '320px' }}>
201
+            <Select value={typeId} onChange={handleChange} allowClear style={{ width: '320px' }}>
195 202
               {machineryTypeList.map((item) => (
196 203
                 <Option value={item.typeId} key={item.typeId}>
197 204
                   {item.name}
@@ -200,7 +207,7 @@ export default (props) => {
200 207
             </Select>
201 208
           </FormItem>
202 209
           <FormItem label="选择农机" rules={[{ required: true, message: '请选择农机名' }]}>
203
-            <Select onChange={setMachineryId} allowClear style={{ width: '320px' }}>
210
+            <Select value={machineryId} onChange={setMachineryId} allowClear style={{ width: '320px' }}>
204 211
               {machineryList.map((item) => (
205 212
                 <Option value={item.machineryId} key={item.machineryId}>
206 213
                   {item.name}

+ 1
- 1
src/pages/SystemManagement/Subsoiler/index.jsx Просмотреть файл

@@ -11,7 +11,7 @@ export default (props) => {
11 11
           <Descriptions.Item label="接口域名">inter-query.huidatech.cn</Descriptions.Item>
12 12
           <Descriptions.Item label="账号密码">njsyzkj0641</Descriptions.Item>
13 13
           <Descriptions.Item label="密码">dTX7o3</Descriptions.Item>
14
-          <Descriptions.Item label="厂家ID">njsyzkj_hd_20221014155214766</Descriptions.Item>
14
+          <Descriptions.Item label="厂家ID">njsyzkj_hd_20221014155214776</Descriptions.Item>
15 15
           <Descriptions.Item label="推送GUID">401cf971587342619ffcf7bbad1ef92d</Descriptions.Item>
16 16
           <Descriptions.Item label="大写缩写">njsyzkj</Descriptions.Item>
17 17
           <Descriptions.Item label="公司名称">南京市云致科技服务有限公司</Descriptions.Item>

+ 0
- 14
src/services/usermachinery.js Просмотреть файл

@@ -1,14 +0,0 @@
1
-import request from '@/utils/request';
2
-/**
3
- * 农机绑定列表
4
- * @param {*} params
5
- * @returns
6
- */
7
-export const getUserMachineryList = (params) => request('/user-machinery', { params });
8
-
9
-/**
10
- * 农机绑定保存
11
- * @param {*} data
12
- * @returns
13
- */
14
-export const addUserMachinery = (id, data) => request(`/user/${id}/machinery`, { method: 'post', data });