Yansen 2 年之前
父節點
當前提交
d5b1ae1f98
共有 3 個文件被更改,包括 13 次插入4 次删除
  1. 1
    1
      config/proxy.js
  2. 5
    2
      src/pages/MonitoringScreen2/components/MachineryInfo.jsx
  3. 7
    1
      src/pages/MonitoringScreen2/index.jsx

+ 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.76:7080',
14
+      target: 'http://192.168.89.147:7080',
15 15
       // target: 'http://192.168.89.76:7080',
16 16
       // target: 'http://machine.njyunzhi.com',
17 17
       // 配置了这个可以从 http 代理到 https

+ 5
- 2
src/pages/MonitoringScreen2/components/MachineryInfo.jsx 查看文件

@@ -2,7 +2,7 @@ import React from 'react';
2 2
 import { Col, Row } from 'antd';
3 3
 
4 4
 export default React.forwardRef((props, ref) => {
5
-  const { data = {} } = props;
5
+  const { data = {}, onClose } = props;
6 6
   console.log(data);
7 7
 
8 8
   return (
@@ -12,11 +12,14 @@ export default React.forwardRef((props, ref) => {
12 12
         background: 'rgba(0,0,0,0.8)',
13 13
         color: '#fff',
14 14
         padding: '1em',
15
+        paddingTop: '0',
15 16
         borderRadius: '4px',
16 17
         width: '320px',
17 18
       }}
18 19
     >
19
-      <div style={{ textAlign: 'right' }}>X</div>
20
+      <div style={{ textAlign: 'right', fontSize: '24px' }} onClick={onClose}>
21
+        ×
22
+      </div>
20 23
       <Row gutter={16}>
21 24
         <Col span={8}>农机名称</Col>
22 25
         <Col span={16}>{data.machineryName || ''}</Col>

+ 7
- 1
src/pages/MonitoringScreen2/index.jsx 查看文件

@@ -158,7 +158,13 @@ export default (props) => {
158 158
         </div>
159 159
       </div>
160 160
       <div style={{ position: 'absolute', zIndex: -1 }}>
161
-        <MachineryInfo data={curMachine} ref={infoWinRef} />
161
+        <MachineryInfo
162
+          data={curMachine}
163
+          ref={infoWinRef}
164
+          onClose={() => {
165
+            mapRef.current.clearInfoWindow();
166
+          }}
167
+        />
162 168
       </div>
163 169
     </div>
164 170
   );