瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/nanyang/machinery-admin

Yansen 2 年之前
父節點
當前提交
94e34f0765

+ 1
- 1
config/proxy.js 查看文件

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

+ 16
- 9
src/pages/SystemManagement/Sensing/index.jsx 查看文件

26
   const actionRef = useRef();
26
   const actionRef = useRef();
27
   const [machineryList, setMachineryList] = useState([]);
27
   const [machineryList, setMachineryList] = useState([]);
28
   const [typeId, setTypeId] = useState();
28
   const [typeId, setTypeId] = useState();
29
-  const e = 0;
29
+
30
   // useEffect(() => {
30
   // useEffect(() => {
31
   //   if (regionId) {
31
   //   if (regionId) {
32
   //   } else {
32
   //   } else {
34
   //   }
34
   //   }
35
   // }, [regionId]);
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
   const handelEdit = (val) => {
45
   const handelEdit = (val) => {
39
     setMachineryId(val.machineryId);
46
     setMachineryId(val.machineryId);
79
     }).catch((err) => {
86
     }).catch((err) => {
80
       console.log(err.message)
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
   useEffect(() => {
96
   useEffect(() => {
88
       }).catch((err) => {
100
       }).catch((err) => {
89
         console.log(err.message)
101
         console.log(err.message)
90
       });
102
       });
91
-    }
92
-  }, [typeId])
93
-
94
-  useEffect(() => {
95
-    if (machineryId) {
96
       getMachineryList({ machineryId }).then((e) => {
103
       getMachineryList({ machineryId }).then((e) => {
97
         setMachineryList(e.records);
104
         setMachineryList(e.records);
98
       }).catch((err) => {
105
       }).catch((err) => {
99
         console.log(err.message)
106
         console.log(err.message)
100
       });
107
       });
101
     }
108
     }
102
-  }, [machineryId])
109
+  }, [typeId])
103
 
110
 
104
   const columns = [
111
   const columns = [
105
     {
112
     {
191
       >
198
       >
192
         <Form  {...formItemLayout} onFinish={Submit} form={form}>
199
         <Form  {...formItemLayout} onFinish={Submit} form={form}>
193
           <FormItem label="农机分类" rules={[{ required: true, message: '请选择农机分类' }]}>
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
               {machineryTypeList.map((item) => (
202
               {machineryTypeList.map((item) => (
196
                 <Option value={item.typeId} key={item.typeId}>
203
                 <Option value={item.typeId} key={item.typeId}>
197
                   {item.name}
204
                   {item.name}
200
             </Select>
207
             </Select>
201
           </FormItem>
208
           </FormItem>
202
           <FormItem label="选择农机" rules={[{ required: true, message: '请选择农机名' }]}>
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
               {machineryList.map((item) => (
211
               {machineryList.map((item) => (
205
                 <Option value={item.machineryId} key={item.machineryId}>
212
                 <Option value={item.machineryId} key={item.machineryId}>
206
                   {item.name}
213
                   {item.name}

+ 1
- 1
src/pages/SystemManagement/Subsoiler/index.jsx 查看文件

11
           <Descriptions.Item label="接口域名">inter-query.huidatech.cn</Descriptions.Item>
11
           <Descriptions.Item label="接口域名">inter-query.huidatech.cn</Descriptions.Item>
12
           <Descriptions.Item label="账号密码">njsyzkj0641</Descriptions.Item>
12
           <Descriptions.Item label="账号密码">njsyzkj0641</Descriptions.Item>
13
           <Descriptions.Item label="密码">dTX7o3</Descriptions.Item>
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
           <Descriptions.Item label="推送GUID">401cf971587342619ffcf7bbad1ef92d</Descriptions.Item>
15
           <Descriptions.Item label="推送GUID">401cf971587342619ffcf7bbad1ef92d</Descriptions.Item>
16
           <Descriptions.Item label="大写缩写">njsyzkj</Descriptions.Item>
16
           <Descriptions.Item label="大写缩写">njsyzkj</Descriptions.Item>
17
           <Descriptions.Item label="公司名称">南京市云致科技服务有限公司</Descriptions.Item>
17
           <Descriptions.Item label="公司名称">南京市云致科技服务有限公司</Descriptions.Item>

+ 0
- 14
src/services/usermachinery.js 查看文件

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 });