tongshanglei 3 年之前
父节点
当前提交
5b8adeead5

+ 1 - 1
public/index.html

@@ -6,7 +6,7 @@
     <meta name="renderer" content="webkit">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-6.15.0.min.js"></script>
+    <!-- <script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-6.15.0.min.js"></script> -->
     <title><%= webpackConfig.name %></title>
   </head>
   <body>

+ 3 - 8
src/views/wind/wind/form/AddEditWind.vue

@@ -7,7 +7,7 @@
       <el-form-item label="风场编号" prop="number">
         <el-input v-model="form.number"></el-input>
       </el-form-item>
-      <el-form-item label="风场类型" required prop="wind_shape">
+      <!-- <el-form-item label="风场类型" required prop="wind_shape">
         <el-select
           v-model="form.wind_shape"
           disabled
@@ -21,7 +21,7 @@
             :value="wind.key"
           ></el-option>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="所属部门" required prop="department_id">
         <el-cascader
           class="filter-item form-search-input fl"
@@ -64,12 +64,7 @@ export default {
       type: String,
       default: "windForm",
     },
-    windData: {
-      type: Array,
-      default: function () {
-        return [];
-      },
-    },
+
     formData: {
       type: Object,
       default: function () {

+ 49 - 1
src/views/wind/wind/index.scss

@@ -31,6 +31,24 @@
           }
         
     }
+
+    .searchType{
+        width:100px;
+    }
+    ::v-deep .searchType .el-input__inner{
+        height: 38px ;
+        border-radius: 0px;
+    }
+    ::v-deep .searchInput .el-input__inner{
+        height: 38px ;
+        border-radius: 0px;
+    }
+    .searchInput{
+        width:370px;
+        border-radius: 0px;
+        
+    }
+    
     #rightPanel {
         display: inline-block;
         width: 500px;
@@ -38,8 +56,38 @@
 
         #toggleListBtn {
             position: absolute;
-            top: 12px;
+            top: calc(50vh - 100px);
             right: 510px;
+            background-color:#3895e5;
+            color:#fff;
+            height: 60px;
+            width:30px;
+            border-radius: 40px 0px 0px 40px;
+            text-align: left;
+            font-size: 20px;
+        }
+        ::v-deep .el-icon-d-arrow-right{
+            margin-left:-6px;
+        }
+        ::v-deep .el-icon-d-arrow-left{
+            margin-left:-6px;
+        }
+        #DistanceToolBtn{
+            position: absolute;
+            top: 20px;
+            left: 100px;
+            width:50px;
+            height: 22px;
+            line-height: 16px;
+            border: 1px solid #d64635;
+            background: #d64635;
+            color:white;
+            // font-size: 14px;
+            padding: 2px 6px;
+            font: bold 12px / 1.3em arial, sans-serif;
+            text-align: center;
+            white-space: nowrap;
+            border-radius: 3px 3px 3px 3px;
         }
         #saveWindBtn {
             position: absolute;

+ 262 - 87
src/views/wind/wind/index.vue

@@ -16,6 +16,8 @@
                 <bm-context-menu-item text="添加风场" disabled ></bm-context-menu-item>
                 <bm-context-menu-item :callback="addCircleWind" text="◯ 圆形"></bm-context-menu-item>
                 <bm-context-menu-item :callback="addPolygonWind" text="▱ 多边形"></bm-context-menu-item>
+                <!-- <div class="head_control_btn" @click="openDistanceTool"><i class="el-icon-paperclip"></i>测距</div> -->
+
             </bm-context-menu>
             <!-- 控件 -->
             <bm-scale anchor="BMAP_ANCHOR_BOTTOM_LEFT" :offset="scaleOffset"></bm-scale>
@@ -26,9 +28,20 @@
             <bm-local-search :keyword="keyword" :auto-viewport="true" :panel="false"></bm-local-search>
             <!-- 自定义控件 -->
             <bm-control id="normalCtrl" anchor="BMAP_ANCHOR_TOP_LEFT" :offset="searchbarOffset">
-                <bm-auto-complete v-model="keyword" :sugStyle="{zIndex: 1}">
-                    <el-input v-model="keyword" size="medium" autocomplete="off" maxlength="256" placeholder="输入地址关键字进行搜索,在空白处点击鼠标右键添加" />
+                <el-select v-model="searchType" class="searchType" placeholder="请选择">
+                    <el-option
+                    v-for="item in searchOptions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                    </el-option>
+                </el-select>
+                <bm-auto-complete v-if=" searchType =='area' "   :sugStyle="{zIndex: 1}">
+                    <el-input  size="medium" class="searchInput" v-model="keyword" autocomplete="off" maxlength="256" placeholder="输入地址关键字进行搜索,在空白处点击鼠标右键添加" />
                 </bm-auto-complete>
+                <el-input  v-if=" searchType =='wind' " v-model="windWord" @keyup.enter.native="searchWindList" size="medium" class="searchInput" autocomplete="off" maxlength="256" placeholder="输入风场名称或者风场编号等进行搜索" />
+                <el-input  v-if=" searchType =='pump' " v-model="pumpWord" @keyup.enter.native="searchPumpList"  size="medium" class="searchInput" autocomplete="off" maxlength="256" placeholder="输入液压泵名称或者液压泵编号等进行搜索" />
+                
                 <!-- 搜索栏 -->
                 <div id="searchbox"></div>
             </bm-control>
@@ -36,6 +49,7 @@
                 <!-- 显示/隐藏覆盖物 -->
                 <div id="checkboxArea">
                     <el-row class="checkbox-item">
+                        <el-checkbox v-model="showPumpOverlay" @change="toggleMarkers('pump', $event)">液压泵</el-checkbox>
                         <el-checkbox v-model="showWindOverlay" @change="toggleMarkers('wind', $event)">风场范围</el-checkbox>
                     </el-row>
                 </div>
@@ -43,19 +57,27 @@
         </baidu-map>
         <!-- 风场表单 -->
         <el-dialog title="风场信息" :visible.sync="visibleWindDialog" destroy-on-close width="600px">
-            <add-edit-wind @result="addEditWindResult" :windData="windData" :formData="windFormData"  />
+            <add-edit-wind @result="addEditWindResult"  :formData="windFormData"  />
         </el-dialog>
         <div id="rightPanel">
+            
+            <div id="DistanceToolBtn" @click="openDistanceTool"><i class="el-icon-paperclip"></i>测距</div>
             <!-- 收起列表 -->
             <el-button id="toggleListBtn" @click="toggleTabs" :icon="'el-icon-d-arrow-'+toggleIcon"></el-button>
             <!-- 保存按钮 -->
             <el-button id="saveWindBtn" @click="showWindFormDialog" v-show="showSaveWindBtn" type="success" round>保存信息</el-button>
             <el-button id="clearWindBtn" @click="clearWind" v-show="showSaveWindBtn" type="danger" round>取消</el-button>
+            <!-- 形状保存按钮 -->
+            <el-button id="saveWindBtn" @click="saveWindShapeInfo" v-show="showUpdateShapeWindBtn" type="success" round>保存修改</el-button>
+            <el-button id="clearWindBtn" @click="clearWind" v-show="showUpdateShapeWindBtn" type="danger" round>取消修改</el-button>
             <!-- 风场 -->
             <div id="tableTabs" v-show="showTabs">
                 <el-tabs type="border-card">
                     <el-tab-pane label="风场列表">
-                        <wind-table ref="windTable" @updateInfo="updateWindInfo" @rowClick="clickWindRow($event, 0)" @afterDeleted="afterDeletedWind" />
+                        <wind-table ref="windTable" name="wind" @updateInfo="showUpdateWindForm" @updateShapeInfo="updateWindInfo" @rowClick="clickWindRow($event, 0)" @afterDeleted="afterDeletedWind" />
+                    </el-tab-pane>
+                    <el-tab-pane label="液压泵列表">
+                        <pump-table ref="pumpTable" name="pump" @rowClick="addSingleMarker($event, 0)"/>
                     </el-tab-pane>
                 </el-tabs>
             </div>
@@ -69,17 +91,36 @@
 import AddEditWind from './form/AddEditWind';
 import Regionals from "@/components/Cascader/Regionals";
 import WindTable from './table/WindTable';
-
+import PumpTable from './table/PumpTable';
+import DistanceTool from '@/utils/DistanceTool';
+import $ from "jquery";
 export default {
     name: "wind_index",
     components: { 
         AddEditWind, 
         Regionals, 
         WindTable,
+        PumpTable
     },
     data: function() {
         return {
             loading: false, // 加载
+            activeName:'wind',
+            searchType:'area',
+            searchOptions:[
+                {
+                    value: 'area',
+                    label: '地区'
+                },
+                {
+                    value: 'wind',
+                    label: '风场'
+                },
+                {
+                    value: 'pump',
+                    label: '液压泵'
+                },
+            ],
             loadingText: '加载中',
             // 地图
             BMap: null,
@@ -89,6 +130,8 @@ export default {
             zoom: 13,
             currentCityId: null, // 当前城市id
             keyword: '', // 搜索关键字
+            windWord:'',
+            pumpWord:'',
             currentCityText: null, // 当前城市全名称,可用于地图中心
             markerIcons: { // 覆盖物图标
                 building: '/icons/building.png', 
@@ -108,21 +151,25 @@ export default {
             visibleWindDialog: false, // 显示风场
             
             showSaveWindBtn: false, // 显示保存风场信息按钮
+            showUpdateShapeWindBtn:false,//修改风场范围
             currentWindObject: null, // 当前添加风场对象
             windGroup: [], // 风场覆盖物群组
             windData: [], // 风场数据
+            pumpGroup:[],
           
             addWindType:'0',
             showWindOverlay: true,
-          
+            showPumpOverlay:true,
             queryParams: {
-                province_id: null,
-                city_id: null,
-                district_id: null,
+
             },
+            markerIcons: 'https://rlfd.oss-cn-hangzhou.aliyuncs.com/smart_tool/beng.png',
 
         }
     },
+    unmount () {
+        distanceTool && distanceTool.close()
+    },
     created() {
        
     },
@@ -142,6 +189,7 @@ export default {
 
             let that = this
             this.center=new this.BMap.Point(116.403694, 39.913828)
+            this.distanceTool = new BMapLib.DistanceTool(map);
             // 浏览器定位
             // let geo = new this.BMap.Geolocation
             // geo.getCurrentPosition(function(e){
@@ -166,6 +214,8 @@ export default {
         initData() {
             // 获取风场数据
             this.getwindData()
+            // 获取泵数据
+            this.getPumpData()
         },
         // 添加多覆盖物
         addMultiMarkers(data, type = '') {
@@ -216,9 +266,7 @@ export default {
                 })
                 this.windGroup = []
             }
-            this.$http.get('wind').then(resp => {
-                console.log(resp);
-                        // this.isSetCenter=false
+            this.$http.get('wind/getWindList').then(resp => {
                          if (resp.code === 10000) {
                              this.windData = resp.data
                              this.windData.forEach(wind => {
@@ -229,6 +277,64 @@ export default {
                          }
             }).catch(() => {})
         },
+        getPumpData(){
+            if (this.pumpGroup && this.pumpGroup.length) {
+                // 移除覆盖物
+                this.pumpGroup.forEach(pump => {
+                    pump.remove()
+                })
+                this.pumpGroup = []
+            }
+            this.$http.get('map/queryLocationList').then(response => {
+                if(response.data.length>0){
+                    this.addMarkerPoint(response.data);
+                }
+            }).catch(() => {})
+        },
+        addMarkerPoint(data) {
+            var myIcon;
+            Object.keys(data).forEach((k)=>{
+
+                let item=data[k]
+                var pt = new BMap.Point(item.longitude, item.latitude);
+                
+                myIcon = new BMap.Icon(this.markerIcons, new BMap.Size(32, 32));
+                myIcon.setImageSize(new BMap.Size(32, 32));
+                
+                var marker = new BMap.Marker(pt, {
+                icon: myIcon
+                }); // 创建标注
+            
+                let that=this
+                marker.addEventListener("click", function(){     
+                let content=that.createMarkerContent(item);
+                var opts = {
+                    width : 320,     // 信息窗口宽度
+                    enableAutoPan:false
+                }
+                var infoWindow = new BMap.InfoWindow(content,opts);  // 创建信息窗口对象      
+                this.map.openInfoWindow(infoWindow, pt); //开启信息窗口
+                });
+                this.map.addOverlay(marker);
+                this.pumpGroup.push(marker);
+            })
+        },
+        createMarkerContent(data){
+            let address
+                var myGeo = new BMap.Geocoder();      
+                // 根据坐标得到地址描述    
+                myGeo.getLocation(new BMap.Point(data.longitude,data.latitude), function(result){          
+                    address=result.address
+                    $('#marker_address').text(address);
+                });
+                var content ='<div class="info_label">设备名称:' + (data.name) + '</div>'
+                content +='<div class="info_label">设备编号:' + (data.number) + '</div>'
+                content += '<div class="info_label">定位地址:<a id="marker_address">' + address + '</a></div>' 
+                content+='<div class="handle_btn info_label">'
+                content+='</div>'
+                
+            return content
+            },
         SetMapCenter(windGroup){
             if(this.isSetCenter || !this[windGroup][0]){
                 return
@@ -253,36 +359,7 @@ export default {
             this.searchbarOffset = null
             this.showHideOffset = null
         },
-        // 切换城市
-        changeCity(data) {
-            // 清除覆盖物
-            this.map && this.map.clearOverlays()
-            // 清空数据
-            this.clearData()
-
-            if (!data || !data.key) {
-                return;
-            }
-            this.currentCityId = data.key
-            // 移动地图中心点
-            this.currentCityText = data.fullLabels.join('')
-            this.map.setCenter(this.currentCityText)
-            // 设置缩放等级
-            let length = data.fullKeys.length
-            let zoom = 9 // 省/无
-            if (length == 2) { // 市
-                zoom = 11
-            } else if (length == 3) {
-                zoom = 13
-            }
-            this.map.setZoom(zoom)
-            // 请求参数
-            this.queryParams.province_id = data.fullKeys[0] || null
-            this.queryParams.city_id = data.fullKeys[1] || null
-            this.queryParams.district_id = data.fullKeys[2] || null
-
-            this.initData()
-        },
+       
         // 添加修改结果
         addEditResult(info) {
             if (!info || !info.id) {
@@ -449,6 +526,7 @@ export default {
             var bm = document.getElementsByClassName('bm-view')[0]
             var tabs = document.getElementById('rightPanel')
             var toggleListBtn = document.getElementById('toggleListBtn')
+            // var DistanceToolBtn = document.getElementById('DistanceToolBtn')
             var saveWindBtn = document.getElementById('saveWindBtn')
             var clearWindBtn = document.getElementById('clearWindBtn')
             
@@ -457,6 +535,8 @@ export default {
                 tabs && (tabs.style.width = '500px')
                 bm && (bm.style.width = 'calc(100% - 500px)')
                 toggleListBtn && (toggleListBtn.style.right = '510px')
+                // DistanceToolBtn && (DistanceToolBtn.style.right = '560px')
+                
                 saveWindBtn && (saveWindBtn.style.right = '510px')
                 clearWindBtn && (clearWindBtn.style.right = '510px')
             } else {
@@ -464,13 +544,23 @@ export default {
                 tabs && (tabs.style.width = '0px')
                 bm && (bm.style.width = '100%')
                 toggleListBtn && (toggleListBtn.style.right = '10px')
+                // DistanceToolBtn && (DistanceToolBtn.style.right = '60px')
                 saveWindBtn && (saveWindBtn.style.right = '10px')
                 clearWindBtn && (clearWindBtn.style.right = '10px')
             }
             
         },
         // 显示风场表单窗口
-        showWindFormDialog(e) {
+        showUpdateWindForm(info) {
+            this.windFormData = info;
+            if(this.addWindType=='2'){
+            }else if(this.addWindType=='3'){
+            }else{
+                this.visibleWindDialog = true
+            }
+        },
+        showWindFormDialog() {
+           
             if(this.addWindType=='2'){
             }else if(this.addWindType=='3'){
             }else{
@@ -517,25 +607,6 @@ export default {
                 }
                 this.isSetCenter=true
             }
-            // 双击事件
-            windObj.addEventListener('dblclick', function(e){
-                // console.log(e);
-                // 清除上个风场样式
-                that.clearWind();
-
-                // 赋值当前对象
-                that.currentWindObject = e.currentTarget;
-                that.addWindType = windType;
-                // 可编辑
-                that.currentWindObject.enableEditing();
-                that.currentWindObject.setStrokeColor(that.currentWindObject._infoData.side_color);
-                that.currentWindObject.setStrokeStyle('dashed');
-                // 当前风场数据
-                that.windFormData = that.currentWindObject._infoData;
-                // 显示保存按钮
-                that.showSaveWindBtn = true;
-                
-            })
             // 加入群组
             if (windType == 0) {
                 this.windGroup.push(windObj);
@@ -568,18 +639,8 @@ export default {
             this.currentWindObject.setFillColor('pink');
             
             var that = this;
-            this.currentWindObject.addEventListener('dblclick', function(e){
-                // 清除上个风场样式
-                that.clearWind();
-                // 赋值当前对象
-                that.currentWindObject = e.currentTarget;
-                that.currentWindObject.enableEditing();
-                that.showSaveWindBtn = true;
-                
-                if (that.currentWindObject._infoData) {
-                    that.windFormData = that.currentWindObject._infoData;
-                }
-            })
+            this.RightAndDblClickAdd(this.currentWindObject)
+            
             // 加入分组
             this.windGroup.push(this.currentWindObject);
         },
@@ -609,18 +670,19 @@ export default {
             this.currentWindObject.setFillColor('pink');
             
             var that = this
-            this.currentWindObject.addEventListener('dblclick', function(e){
-                // 清除上个风场样式
-                that.clearWind();
-                // 赋值当前对象
-                that.currentWindObject = e.currentTarget
-                that.currentWindObject.enableEditing();
-                that.showSaveWindBtn = true;
-
-                if (that.currentWindObject._infoData) {
-                    that.windFormData = that.currentWindObject._infoData
-                }
-            })
+            this.RightAndDblClickAdd(this.currentWindObject)
+            // this.currentWindObject.addEventListener('dblclick', function(e){
+            //     // 清除上个风场样式
+            //     that.clearWind();
+            //     // 赋值当前对象
+            //     that.currentWindObject = e.currentTarget
+            //     that.currentWindObject.enableEditing();
+            //     that.showSaveWindBtn = true;
+
+            //     if (that.currentWindObject._infoData) {
+            //         that.windFormData = that.currentWindObject._infoData
+            //     }
+            // })
             // 加入分组
             this.windGroup.push(this.currentWindObject);
         },
@@ -637,6 +699,7 @@ export default {
                 this.currentWindObject.setStrokeStyle('solid');
             }
             this.showSaveWindBtn = false;
+            this.showUpdateShapeWindBtn=false;
         },
         // 添加修改风场结果
         addEditWindResult(result) {
@@ -660,7 +723,7 @@ export default {
                 if (wind._infoData && info.id == wind._infoData.id) {
                     wind.enableEditing() // 可编辑
                     wind.setStrokeColor(wind._infoData.side_color);
-                    this.showSaveWindBtn = true;
+                    this.showUpdateShapeWindBtn = true;
                     // 设置中心点并移动
                     if (info.wind_shape == 'circle') {
                         this.map.setViewport(wind.getBounds(), {zoomFactor: -1});
@@ -670,6 +733,7 @@ export default {
                     
                     this.windFormData = info;
                     this.currentWindObject = wind;
+                    this.RightAndDblClickHandler(wind)
                     wind.setStrokeStyle('dashed');
                 } else {
                     wind.disableEditing(); // 不可编辑
@@ -678,6 +742,89 @@ export default {
                 }
             })
         },
+        RightAndDblClickAdd(marker){
+            const that=this
+            var removeMarker = function(e,ee,marker){//右键删除站点
+                    that.showWindFormDialog()
+                    
+             };
+             var updateMarker = function(marker){//右键更新
+                    that.getwindData()
+                    that.showSaveWindBtn=false
+             };
+            var markerMenu=new BMap.ContextMenu();
+            markerMenu.addItem(new BMap.MenuItem('确认添加',removeMarker.bind(marker)));
+            markerMenu.addItem(new BMap.MenuItem('取消添加',updateMarker.bind(marker)));
+            marker.addContextMenu(markerMenu);//给标记添加右键菜单
+            marker.addEventListener('dblclick', function(e){
+               that.showWindFormDialog()
+            })
+        },
+        RightAndDblClickHandler(marker){
+             const that=this
+             var removeMarker = function(e,ee,marker){//右键删除站点
+
+                    that.$confirm('是否保存风场范围?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'info'
+                    }).then(() => {
+                        that.saveWindShapeInfo()
+
+                    }).catch(() => {
+                                
+                    });
+                    
+             };
+             var updateMarker = function(marker){//右键更新
+                    that.getwindData()
+                    that.showUpdateShapeWindBtn=false
+             };
+            var markerMenu=new BMap.ContextMenu();
+            markerMenu.addItem(new BMap.MenuItem('保存修改',removeMarker.bind(marker)));
+            markerMenu.addItem(new BMap.MenuItem('取消修改',updateMarker.bind(marker)));
+            marker.addContextMenu(markerMenu);//给标记添加右键菜单
+            marker.addEventListener('dblclick', function(e){
+                that.$confirm('是否保存风场范围?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'info'
+                }).then(() => {
+                        that.saveWindShapeInfo()
+                }).catch(() => {
+                                
+                });
+            })
+         },
+         
+         saveWindShapeInfo(){
+             
+             if (this.windFormData.wind_shape == 'circle') {
+                this.windFormData.wind_info = {
+                    radius: this.currentWindObject.getRadius(),
+                    center: {lng: this.currentWindObject.point.lng, lat: this.currentWindObject.point.lat},
+                }
+            } else if (this.windFormData.wind_shape == 'polygon') {
+                this.windFormData.wind_info = this.currentWindObject.getPath()
+            }
+ 
+            var saveData = {
+              
+                wind_shape: this.windFormData.wind_shape,
+                wind_info: this.windFormData.wind_info,
+        
+            };
+            this.showUpdateShapeWindBtn=false
+            this.$http.put("wind/" + this.windFormData.id, saveData).then((resp) => {
+                if (resp.code != 10000) {
+                    return false;
+                }
+                 this.currentWindObject.disableEditing()
+                // this.getwindData()
+                this.$message.success("修改成功");
+
+            });
+         },
         // 删除风场
         afterDeletedWind(id) {
             if (!id) return;
@@ -739,6 +886,34 @@ export default {
 
         },
 
+        addSingleMarker(data){
+            // 如果没有经纬度
+            if (!data.latitude || !data.longitude) {
+            this.$message.warning('暂无定位数据');
+            // return false;
+            }
+
+            var pt = new BMap.Point(data.longitude, data.latitude);
+            var opts = {
+                width : 320,     // 信息窗口宽度
+                enableAutoPan:false
+            }
+            let studentWindowContent=this.createMarkerContent(data)
+            var infoWindow = new BMap.InfoWindow(studentWindowContent,opts);  // 创建信息窗口对象 
+            this.map.openInfoWindow(infoWindow, pt); //开启信息窗口
+            this.map.centerAndZoom(pt,19);
+        },
+        openDistanceTool (e) {
+            const {distanceTool} = this
+            distanceTool && distanceTool.open()
+        },
+        searchWindList(){
+            console.log(this.windWord)
+        },
+        searchPumpList(){
+            console.log(this.pumpWord)
+        }
+
     }
 }
 </script>

+ 142 - 0
src/views/wind/wind/table/PumpTable.vue

@@ -0,0 +1,142 @@
+<template>
+    <div class="app-container">
+        <div class="table-body">
+            <el-table
+                :data="tableData"
+                border
+                fit
+                @row-click="rowClick"
+                style="width: 100%">
+                 <el-table-column
+                   fixed
+                   label="序号"
+                    type="index"
+                    align="center"
+                    width="45"/>
+                   
+                <el-table-column
+                    fixed
+                    prop="name"
+                    label="液压泵名称"
+                    align="center"
+                />
+                <el-table-column
+                    fixed
+                    prop="number"
+                    label="液压泵编号"
+                    align="center"
+                />
+                <el-table-column
+                    fixed
+                    prop="online_time"
+                    label="在线时间"
+                    align="center"
+                />
+                <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    width="60">
+                    <template slot-scope="scope">
+                         <el-tooltip content="查看" placement="top" :enterable="false">
+                            <el-button type="text" size="small" icon="el-icon-view" @click.stop="updateInfo(scope.row)"></el-button>
+                        </el-tooltip>
+
+                    </template>
+                </el-table-column>
+            </el-table>
+            <div class="table-pagination">
+                <el-pagination
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                    :current-page="paginate.current"
+                    :page-sizes="paginate.sizes"
+                    :page-size="paginate.limit"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="paginate.total">
+                </el-pagination>
+            </div>
+        </div>
+        <div class="table-footer">
+        </div>
+
+        <!-- form 表单 -->
+
+        <!-- 围栏日志 -->
+        
+        <!-- <el-dialog title="围栏告警记录" :visible.sync="showAlarmDialog" append-to-body fullscreen>
+            <alarm-report-table :fenceId="currentFenceId" />
+        </el-dialog> -->
+
+    </div>
+</template>
+
+<script>
+
+import rlListOperate from '@/layout/rl-list-operate/rlListOperate';
+import FloorTable from '../floor/index';
+// import AlarmReportTable from '@/views/alarm/alarmReport';
+
+export default {
+    name: 'FenceTable',
+    mixins: [ rlListOperate ],
+    components: { 
+            FloorTable,
+            // AlarmReportTable
+         },
+    props: {
+    },
+    data() {
+      return {
+        url: 'hydraulic',
+        // showAlarmDialog: false,
+        // currentFenceId: null,
+        tableData: [],
+      }
+    },
+    methods: {
+        afterGetList(){
+            this.tableData = this.data
+        },
+        // 点击行
+        rowClick(row, column, event) {
+            this.$emit('rowClick', row)
+        },
+       
+        
+
+    },
+}
+</script>
+<style lang="scss" scoped>
+    .el-select { width: 100%; }
+
+    .table-pagination {
+        margin-top: 10px;
+        text-align: right;
+    }
+
+    ::v-deep .avatar-uploader .el-upload {
+        border: 1px dashed #d9d9d9;
+        border-radius: 6px;
+        cursor: pointer;
+        position: relative;
+        overflow: hidden;
+    }
+    ::v-deep .avatar-uploader .el-upload:hover {
+        border-color: #409EFF;
+    }
+    ::v-deep .avatar-uploader-icon {
+        font-size: 28px;
+        color: #8c939d;
+        width: 178px;
+        height: 178px;
+        line-height: 178px;
+        text-align: center;
+    }
+    ::v-deep .avatar {
+        width: 178px;
+        height: 178px;
+        display: block;
+    }
+</style>

+ 22 - 21
src/views/wind/wind/table/WindTable.vue

@@ -7,50 +7,48 @@
                 fit
                 @row-click="rowClick"
                 style="width: 100%">
-                <el-table-column
-                    fixed
-                    label="展开"
+                 <el-table-column
+                   fixed
+                   label="序号"
+                    type="index"
                     align="center"
-                    type="expand"
-                >
-                    <template slot-scope="scope">
-                        <el-row style="line-height: 25px;font-size: 15px;">
-                            <el-col :span="24">所属部门:{{ scope.row.depart_name }}</el-col>
-                            <el-col :span="24">风场地址:{{ scope.row.address }}</el-col>
-                            <el-col :span="24">添加时间:{{ scope.row.created_at }}</el-col>
-                            <el-col :span="24">备注:{{ scope.row.remark }}</el-col>
-                        </el-row>
-                    </template>
-                </el-table-column>
+                    width="45"/>
+                   
                 <el-table-column
                     fixed
                     prop="name"
                     label="风场名称"
                     align="center"
+                     width="80"
                 />
                   <el-table-column
                     fixed
                     prop="number"
                     label="风场编号"
                     align="center"
+                    width="70"
                 />
                 <el-table-column
-                    prop="type_name"
-                    label="风场类型"
+                    prop="address"
+                    label="风场地址"
                     align="center"
                 />
                 <el-table-column
                     label="操作"
                     align="center"
                     fixed="right"
-                    width="100">
+                    width="110">
                     <template slot-scope="scope">
-                        <!-- <el-tooltip content="告警记录" placement="top" :enterable="false">
-                            <el-button type="text" size="small" icon="el-icon-document" @click.stop="alarmTable(scope.row.id)"></el-button>
-                        </el-tooltip> -->
-                        <el-tooltip content="修改" placement="top" :enterable="false">
+            
+                        <el-tooltip content="修改信息" placement="top" :enterable="false">
                             <el-button type="text" size="small" icon="el-icon-edit" @click.stop="updateInfo(scope.row)"></el-button>
                         </el-tooltip>
+                         <el-tooltip content="修改区域" placement="top" :enterable="false">
+                            <el-button type="text" size="small" icon="el-icon-scissors" @click.stop="updateShapeInfo(scope.row)"></el-button>
+                        </el-tooltip>
+                         <el-tooltip content="查看" placement="top" :enterable="false">
+                            <el-button type="text" size="small" icon="el-icon-view" @click.stop="updateInfo(scope.row)"></el-button>
+                        </el-tooltip>
                         <el-tooltip content="删除" placement="top" :enterable="false">
                             <el-button type="text" size="small" icon="el-icon-delete" @click.stop="deleteItem(scope.row.id)"></el-button>
                         </el-tooltip>
@@ -118,6 +116,9 @@ export default {
         updateInfo(info) {
             this.$emit('updateInfo', info)
         },
+        updateShapeInfo(info) {
+            this.$emit('updateShapeInfo', info)
+        },
         // 删除
         deleteItem(id) {
             this.$confirm('确定要删除吗?', '提示', {