管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2022-12-13 950c7bf191b173b45eedd08fd2d576bb093186ca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<template>
  <div class="menuPop">
    <div class="leftBox">
      <ul>
        <li
          v-for="(item, index) in option"
          @click="setTableChange(item)"
          class="leftBoxLi"
        >
          {{ item.label }}
        </li>
      </ul>
    </div>
    <div class="rightBox">
      <div class="rightTitle">
        <span>管道</span>
        <el-link @click="closeMenuBox" :underline="false" class="boxClose"
          ><i class="el-icon-close"></i>
        </el-link>
      </div>
      <div class="tableBox">
        <el-table :data="tableData" style="height: 100%; width: 100%">
          <el-table-column
            align="center"
            type="index"
            label="序号"
            width="50"
          />
          <el-table-column label="定位" width="100" align="center">
            <template slot-scope="scope">
              <el-button
                icon="el-icon-map-location"
                size="mini"
                @click="spaceLocation(scope.$index, scope.row)"
              ></el-button>
            </template>
          </el-table-column>
          <el-table-column
            v-for="(item, index) in attributeData"
            :key="index"
            :label="item.alias"
            :prop="item.field"
            show-overflow-tooltip
            align="center"
          ></el-table-column>
        </el-table>
      </div>
      <!-- <div class="rightPage"> -->
      <!-- <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listPage.pageIndex"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="listPage.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="listPage.pageCount"
        >
        </el-pagination> -->
      <!-- </div> -->
    </div>
  </div>
</template>
 
<script>
import {
  dataQuerySelectByPage,
  inquiry_selectDomains,
  inquiry_selectFields,
  dataQuerySelectWktById,
  decr,
} from '../../api/api.js';
export default {
  data() {
    return {
      listPage: {
        pageSize: 10,
        pageIndex: 1,
        pageCount: 0,
      },
      attributeData: [],
      option: [],
      tableData: [],
      listdata: {
        pageIndex: 1,
        pageSize: 10,
        name: null,
        srid: 4326,
        wkt: null,
        filter: null,
      },
      querylayer: null,
      queryTable: [],
      domainsLayer: [],
      optionx: [],
      imagePoint: null,
    };
  },
  methods: {
    startTableMssage() {
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = 10;
      this.listdata.name = null;
      this.option = [];
    },
    setTableAll() {
      this.startTableMssage();
      this.listdata.wkt = this.$store.state.mapMenuShpFile;
      this.querylayer = this.$store.state.mapSpaceQueryLayer;
      this.option = this.$store.state.mapSpaceQueryLayer;
      debugger;
      this.listdata.name = this.option[0].entity;
 
      this.getTableDateHidder();
    },
    async getTableDateHidder() {
      const data = await inquiry_selectFields({ name: this.listdata.name });
      if (data.code != 200) {
        this.$message.error('列表调用失败');
      }
      const data1 = await inquiry_selectDomains({ name: this.listdata.name });
      if (data1.code != 200) {
        this.$message.error('列表调用失败');
      }
      this.optionx = [];
      this.attributeData = [];
      var valadata = data.result;
      var laydomain = data1.result;
 
      for (var i in valadata) {
        if (valadata[i].showtype == 1) {
          if (
            valadata[i].domainNa != null &&
            valadata[i].domainNa != undefined
          ) {
            for (var j in laydomain) {
              if (laydomain[j].domName == valadata[i].domainNa) {
                valadata[i].domainNa = laydomain[j].codeDesc;
              }
            }
          }
          this.optionx.push(valadata[i]);
          this.attributeData.push(valadata[i]);
        }
      }
      this.getTableData();
    },
    async spaceLocation(index, row) {
      var param = {
        gid: row.gid,
        name: this.listdata.name,
      };
      const data = await dataQuerySelectWktById(param);
      if (data.code != 200) {
        this.$message.error('列表调用失败');
      }
 
      var val1 = decr(data.result);
      if (val1) {
        if (this.imagePoint != null) {
          sgworld.Creator.DeleteObject(this.imagePoint);
          this.imagePoint = null;
        }
        var wkt = this.$wkt.parse(val1);
        this.setMapLoaction(wkt);
      }
    },
    setMapLoaction(res) {
      var coord = res.coordinates;
      if (res.type == 'Point') {
        this.imagePoint = sgworld.Creator.CreateLabel(
          { X: coord[0], Y: coord[1], Altitude: 2000 },
          '',
          SmartEarthRootUrl + 'Workers/image/mark.png',
          {
            disableDepthTestDistance: Infinity,
            scale: 0.8,
          },
          0,
          '巡检点'
        );
        sgworld.Navigate.flyToObj(this.imagePoint.item);
      }
    },
    setTableChange(res) {
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = 10;
      this.listdata.name = res.entity;
      this.getTableDateHidder();
    },
    async getTableData() {
      this.tableData = [];
 
      const data = await dataQuerySelectByPage(this.listdata);
      if (data.code != 200) {
        this.$message.error('列表调用失败');
      }
 
      var val_Data = data.result;
      for (var i in val_Data) {
        var valste = val_Data[i];
        for (var j in this.optionx) {
          if (
            this.optionx[j].domainNa != null &&
            this.optionx[j].domainNa != undefined
          ) {
            valste[this.optionx[j].field] = this.optionx[j].domainNa;
          }
        }
      }
      this.tableData = data.result;
    },
    closeMenuBox() {
      if (this.imagePoint != null) {
        sgworld.Creator.DeleteObject(this.imagePoint);
        this.imagePoint = null;
      }
      sgworld.Creator.SimpleGraphic.clear();
      this.$store.state.mapPopBoolean = false;
      this.$store.state.mapPopBoxFlag = null;
    },
  },
  created() {
    this.setTableAll();
  },
  mounted() {
    this.$bus.$on('changeMapMenuTop', (res) => {
      if (res == 'true') {
        this.setTableAll();
      }
    });
  },
};
</script>
 
<style scoped lang="less">
.menuPop {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid gray;
  float: left;
  .leftBox {
    width: 20%;
    height: 100%;
    overflow: auto;
    float: left;
    border-right: 1px solid gray;
    li {
      color: white;
      line-height: 20px;
      border-bottom: 1px solid gray;
      padding: 5px;
      background: rgba(255, 255, 255, 0.2);
    }
    li:hover {
      color: #409eff;
      background: rgba(128, 128, 128, 0.2);
    }
  }
 
  .rightBox {
    width: calc(80% - 1px);
    height: 100%;
    float: left;
    .rightTitle {
      padding: 5px;
      color: white;
      width: 100%;
    }
    .tableBox {
      height: 327px;
    }
    .rightPage {
      position: absolute;
      bottom: 10px;
      margin-left: 50px;
      /*不可点击的*/
    }
    .boxClose {
      float: right;
      margin-right: 20px;
      color: white;
    }
  }
  /deep/ .el-table {
    background-color: transparent;
 
    th,
    td {
      background-color: transparent;
    }
    .el-table__expanded-cell {
      background-color: transparent !important;
    }
 
    // 表头背景色
    th.el-table__cell {
      background-color: #303030;
      color: #fff;
    }
    tr > td {
      background-color: #303030;
      color: #fff;
    }
 
    // hover效果
    tr:hover > td {
      background-color: rgba(255, 255, 255, 0.3) !important;
    }
 
    tbody tr:hover {
      background-color: rgba(255, 255, 255, 0.3) !important;
      // text-align: center;
    }
 
    // 滚动条宽高
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
 
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      /*滚动条宽度*/
      height: 5px;
      /*滚动条高度*/
    }
    /*定义滚动条轨道 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-track {
      box-shadow: 0px 1px 3px #216fe6 inset;
      /*滚动条的背景区域的内阴影*/
      border-radius: 10px;
    }
 
    /*定义滑块 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      box-shadow: 0px 1px 3px #216fe6 inset;
      border-radius: 6px;
      background-color: #216fe6;
    }
  }
}
</style>
<style lang="less"></style>
<style scoped lang="less"></style>