Yansen 2 年之前
父節點
當前提交
05f322fd32

+ 1
- 0
config/routes.js 查看文件

@@ -149,6 +149,7 @@ export default [
149 149
   {
150 150
     path: '/iot',
151 151
     name: 'IOT平台',
152
+    icon: 'LaptopOutlined',
152 153
     component: '../layouts/BasicLayout',
153 154
     access: 'iot',
154 155
     routes: [

+ 11
- 2
src/pages/Machinery/Sensing/index.jsx 查看文件

@@ -7,6 +7,7 @@ import {
7 7
   syncShenSong,
8 8
   addRawDevice,
9 9
   deleteRawDevice,
10
+  syncLoc,
10 11
 } from '@/services/device';
11 12
 import List from './components/List';
12 13
 import MaBind from './components/MaBind';
@@ -104,8 +105,16 @@ export default (props) => {
104 105
     setOpen(true);
105 106
   };
106 107
 
107
-  const syncLoc = (row) => {
108
+  const onSyncLoc = ({ deviceType, deviceNo }) => {
108 109
     const hide = message.loading('请稍候...', 0);
110
+    syncLoc({ deviceType, deviceNo })
111
+      .then(() => {
112
+        hide();
113
+        message.success('同步定位成功');
114
+      })
115
+      .catch(() => {
116
+        hide();
117
+      });
109 118
   };
110 119
 
111 120
   // 设备操作
@@ -121,7 +130,7 @@ export default (props) => {
121 130
         unBind(row);
122 131
         break;
123 132
       case 'syncLoc':
124
-        syncLoc(row);
133
+        onSyncLoc(row);
125 134
         break;
126 135
       case 'delete':
127 136
         onDelete(row);

+ 4
- 4
src/pages/MonitoringScreen2/components/map/map.jsx 查看文件

@@ -31,11 +31,11 @@ export default (props) => {
31 31
         // 绘制边线
32 32
         const dengzhou = new AMap.Polygon({
33 33
           path: dzData,
34
-          fillColor: '#ccebc5',
34
+          fillColor: '#0050b3',
35 35
           strokeOpacity: 1,
36
-          fillOpacity: 0,
37
-          strokeColor: '#ff0000', // '#2b8cbe',
38
-          strokeWeight: 2,
36
+          fillOpacity: 0.4,
37
+          strokeColor: '#fff', // '#2b8cbe',
38
+          strokeWeight: 1,
39 39
           strokeStyle: 'dashed',
40 40
           strokeDasharray: [5, 5],
41 41
         });

+ 6
- 0
src/services/device.js 查看文件

@@ -76,3 +76,9 @@ export const addRawDevice = (data) => request('/raw-device', { method: 'POST', d
76 76
  * @returns
77 77
  */
78 78
 export const deleteRawDevice = (id) => request(`/raw-device/${id}`, { method: 'DELETE' });
79
+
80
+/**
81
+ * 同步位置信息
82
+ * @returns
83
+ */
84
+export const syncLoc = (params) => request('/raw-device/sync-loc', { method: 'put', params });