Sfoglia il codice sorgente

天地图点线面绘制功能

liaoyitao 3 mesi fa
parent
commit
5bc533dd76

+ 2 - 1
public/config.js

@@ -1,3 +1,4 @@
1
-var BASE_URL = 'http://192.168.4.194:8081/YH-server'
1
+var BASE_URL = 'http://192.168.4.194:8080/JKC-server'
2
+// var BASE_URL = 'https://dev.lqkj.top/JKC-server'
2 3
 // var BASE_URL = 'http://182.140.29.12:89/ywtb-server'
3 4
 

+ 8 - 9
src/views/info/areaInfo/index.vue

@@ -190,25 +190,20 @@ export default {
190 190
   methods: {
191 191
 
192 192
     openPolygonTool() {
193
-
194 193
       if (  JSON.parse(this.form.location).coordinates[0].length > 0 || this.geoJson.coordinates[0].length > 0 ) {
195
-
196 194
         this.$notify({
197 195
           title: '警告',
198 196
           message: '请先清空地图',
199 197
           type: 'warning'
200 198
         });
201 199
         return
202
-      }else{
203
-  
204 200
       }
205
-
206 201
       if (this.handler) this.handler.close();
207 202
       this.handler = new T.PolygonTool(this.map);
208 203
       this.handler.open();
209 204
 
210 205
       this.handler.on("draw", (yu) => {
211
-        // console.log("参数??99", yu.currentLnglats);
206
+        console.log("参数??99", yu.currentLnglats);
212 207
         let drawData = yu.currentLnglats.map((item) => {
213 208
           return [item.lng, item.lat];
214 209
         });
@@ -237,7 +232,7 @@ export default {
237 232
     this.geoJson.coordinates[0]=[]
238 233
     // 直接将节点给删掉
239 234
     console.log('1qsad');
240
-    
235
+
241 236
     const parentEl = document.getElementById('mainMap');
242 237
     const cahildrenEl = document.getElementById('mapDiv');
243 238
     if(cahildrenEl) parentEl.removeChild(cahildrenEl);
@@ -251,7 +246,7 @@ export default {
251 246
 
252 247
 
253 248
     clearmian() {
254
-   
249
+
255 250
       this.geoJson.coordinates[0] = []
256 251
       this.$set(this.form, 'location', JSON.stringify(this.geoJson))
257 252
       this.map.clearOverLays()
@@ -260,6 +255,9 @@ export default {
260 255
     },
261 256
 
262 257
     openditu() {
258
+      if (this.form.location == null){
259
+        this.$set(this.form, 'location', JSON.stringify(this.geoJson))
260
+      }
263 261
       console.log('sdasd11');
264 262
       this.dialogVisible = true;
265 263
 
@@ -269,7 +267,7 @@ export default {
269 267
         var zoom = 12;
270 268
 
271 269
         this.map = new T.Map('mapDiv');
272
-        this.map.centerAndZoom(new T.LngLat(103.959050, 30.654104), zoom);
270
+        this.map.centerAndZoom(new T.LngLat(103.96,30.66), zoom);
273 271
 
274 272
 
275 273
         var config = {
@@ -359,6 +357,7 @@ export default {
359 357
       this.reset();
360 358
       this.open = true;
361 359
       this.title = "添加区域对象";
360
+      this.clearmian();
362 361
     },
363 362
     /** 修改按钮操作 */
364 363
     handleUpdate(row) {

+ 4 - 4
src/views/info/buildingInfo/index.vue

@@ -130,8 +130,8 @@
130 130
         <el-form-item label="大楼名称" prop="buildingName">
131 131
           <el-input v-model="form.buildingName" placeholder="请输入大楼名称" />
132 132
         </el-form-item>
133
-        <el-form-item label="地图编码" prop="mapCode">
134
-          <el-input-number v-model="form.mapCode" controls-position="right"   :min="0" placeholder="请输入地图编码" />
133
+        <el-form-item label="楼栋号" prop="mapCode">
134
+          <el-input-number v-model="form.mapCode" controls-position="right"   :min="0" placeholder="请输入楼栋号" />
135 135
         </el-form-item>
136 136
 
137 137
         <el-form-item label="英文名称" prop="enName">
@@ -153,8 +153,8 @@
153 153
         <el-form-item label="二维坐标" prop="lngLat">
154 154
           <el-input v-model="form.lngLat" placeholder="请输入二维坐标" />
155 155
         </el-form-item>
156
-        <el-form-item label="备注" prop="memo">
157
-          <el-input v-model="form.memo" placeholder="请输入备注" />
156
+        <el-form-item label="招商简介" prop="memo">
157
+          <wang-editor v-model="form.memo" :min-height="140" />
158 158
         </el-form-item>
159 159
         <el-form-item label="三维坐标" prop="rasterLngLat">
160 160
           <el-input v-model="form.rasterLngLat" placeholder="请输入三维坐标" />

+ 36 - 2
src/views/info/elevatorInfo/index.vue

@@ -32,6 +32,16 @@
32 32
           />
33 33
         </el-select>
34 34
       </el-form-item>
35
+      <el-form-item label="电梯类型" prop="status">
36
+        <el-select v-model="queryParams.type" placeholder="请选择电梯类型" clearable size="small">
37
+          <el-option
38
+            v-for="dict in dict.type.elevator_type"
39
+            :key="dict.value"
40
+            :label="dict.label"
41
+            :value="dict.value"
42
+          />
43
+        </el-select>
44
+      </el-form-item>
35 45
       <el-form-item label="电梯名字" prop="elevatorName">
36 46
         <el-input
37 47
           v-model="queryParams.elevatorName"
@@ -108,6 +118,11 @@
108 118
           <dict-tag :options="dict.type.elevator_info_status" :value="scope.row.status"/>
109 119
         </template>
110 120
       </el-table-column>
121
+      <el-table-column label="电梯类型" align="center" prop="type">
122
+        <template slot-scope="scope">
123
+          <dict-tag :options="dict.type.elevator_type" :value="scope.row.type"/>
124
+        </template>
125
+      </el-table-column>
111 126
       <el-table-column label="电梯名字" align="center" prop="elevatorName" />
112 127
       <el-table-column label="保养次数" align="center" prop="upkeepNum" />
113 128
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
@@ -166,12 +181,28 @@
166 181
             ></el-option>
167 182
           </el-select>
168 183
         </el-form-item>
184
+        <el-form-item label="电梯类型" prop="status">
185
+          <el-select v-model="form.type" placeholder="请选择电梯类型">
186
+            <el-option
187
+              v-for="dict in dict.type.elevator_type"
188
+              :key="dict.value"
189
+              :label="dict.label"
190
+              :value="parseInt(dict.value)"
191
+            ></el-option>
192
+          </el-select>
193
+        </el-form-item>
169 194
         <el-form-item label="电梯名字" prop="elevatorName">
170 195
           <el-input v-model="form.elevatorName" placeholder="请输入电梯名字" />
171 196
         </el-form-item>
172 197
         <el-form-item label="保养次数" prop="upkeepNum">
173 198
           <el-input-number v-model="form.upkeepNum" controls-position="right"   :min="0" placeholder="请输入保养次数" />
174 199
         </el-form-item>
200
+        <el-form-item label="运行楼层" prop="runFloor">
201
+          <el-input v-model="form.runFloor" placeholder="请输入" />
202
+        </el-form-item>
203
+        <el-form-item label="运行时间" prop="runTime">
204
+          <el-input v-model="form.runTime" placeholder="请输入" />
205
+        </el-form-item>
175 206
 
176 207
       </el-form>
177 208
       <div slot="footer" class="dialog-footer">
@@ -187,7 +218,7 @@ import { listElevatorInfo, getElevatorInfo, delElevatorInfo, addElevatorInfo, up
187 218
 import { listBuildingInfo, getBuildingInfo } from "@/api/info/buildingInfo";
188 219
 export default {
189 220
   name: "ElevatorInfo",
190
-  dicts: ['elevator_info_status'],
221
+  dicts: ['elevator_info_status', 'elevator_type'],
191 222
   data() {
192 223
     return {
193 224
       buildingList: [],
@@ -274,7 +305,10 @@ export default {
274 305
         buildingId: null,
275 306
         status: null,
276 307
         elevatorName: null,
277
-        upkeepNum: null
308
+        upkeepNum: null,
309
+        type: null,
310
+        runFloor: null,
311
+        runTime: null
278 312
       };
279 313
       this.resetForm("form");
280 314
     },

+ 46 - 20
src/views/info/equipmentInfo/index.vue

@@ -46,24 +46,24 @@
46 46
           @keyup.enter.native="handleQuery"
47 47
         />
48 48
       </el-form-item>
49
-      <el-form-item label="二维坐标" prop="lngLat">
50
-        <el-input
51
-          v-model="queryParams.lngLat"
52
-          placeholder="请输入二维坐标"
53
-          clearable
54
-          size="small"
55
-          @keyup.enter.native="handleQuery"
56
-        />
57
-      </el-form-item>
58
-      <el-form-item label="三维坐标" prop="rasterLngLat">
59
-        <el-input
60
-          v-model="queryParams.rasterLngLat"
61
-          placeholder="请输入三维坐标"
62
-          clearable
63
-          size="small"
64
-          @keyup.enter.native="handleQuery"
65
-        />
66
-      </el-form-item>
49
+<!--      <el-form-item label="二维坐标" prop="lngLat">-->
50
+<!--        <el-input-->
51
+<!--          v-model="queryParams.lngLat"-->
52
+<!--          placeholder="请输入二维坐标"-->
53
+<!--          clearable-->
54
+<!--          size="small"-->
55
+<!--          @keyup.enter.native="handleQuery"-->
56
+<!--        />-->
57
+<!--      </el-form-item>-->
58
+<!--      <el-form-item label="三维坐标" prop="rasterLngLat">-->
59
+<!--        <el-input-->
60
+<!--          v-model="queryParams.rasterLngLat"-->
61
+<!--          placeholder="请输入三维坐标"-->
62
+<!--          clearable-->
63
+<!--          size="small"-->
64
+<!--          @keyup.enter.native="handleQuery"-->
65
+<!--        />-->
66
+<!--      </el-form-item>-->
67 67
       <el-form-item label="类型" prop="typeName">
68 68
         <template>
69 69
           <el-select v-model="queryParams.typeId" filterable placeholder="请选择">
@@ -249,6 +249,9 @@
249 249
             </el-select>
250 250
           </template>
251 251
         </el-form-item>
252
+        <el-form-item label="设备编号" prop="equipCode">
253
+          <el-input v-model="form.equipCode" placeholder="请输入" />
254
+        </el-form-item>
252 255
         <el-form-item label="名称" prop="equipmentName">
253 256
           <el-input v-model="form.equipmentName" placeholder="请输入名称" />
254 257
         </el-form-item>
@@ -268,6 +271,26 @@
268 271
             ></el-option>
269 272
           </el-select>
270 273
         </el-form-item>
274
+        <el-form-item label="使用状态" prop="status">
275
+          <el-select v-model="form.deviceStatus" placeholder="请选择">
276
+            <el-option
277
+              v-for="dict in dict.type.device_status"
278
+              :key="dict.value"
279
+              :label="dict.label"
280
+              :value="parseInt(dict.value)"
281
+            ></el-option>
282
+          </el-select>
283
+        </el-form-item>
284
+        <el-form-item label="品牌" prop="status">
285
+          <el-select v-model="form.brand" placeholder="请选择">
286
+            <el-option
287
+              v-for="dict in dict.type.equip_brand"
288
+              :key="dict.value"
289
+              :label="dict.label"
290
+              :value="parseInt(dict.value)"
291
+            ></el-option>
292
+          </el-select>
293
+        </el-form-item>
271 294
       </el-form>
272 295
       <div slot="footer" class="dialog-footer">
273 296
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -285,7 +308,7 @@ import { listRoomInfo, getRoomInfo } from "@/api/info/roomInfo";
285 308
 import { listEquipmentType, getEquipmentType } from "@/api/type/equipmentType";
286 309
 export default {
287 310
   name: "EquipmentInfo",
288
-  dicts: ['equipment_info_type'],
311
+  dicts: ['equipment_info_type', 'device_status', 'equip_brand'],
289 312
   data() {
290 313
     return {
291 314
       equipmentTypeList: [],
@@ -418,7 +441,10 @@ export default {
418 441
         lngLat: null,
419 442
         rasterLngLat: null,
420 443
         typeName: null,
421
-        status: null
444
+        status: null,
445
+        brand: null,
446
+        equipCode: null,
447
+
422 448
       };
423 449
       this.resetForm("form");
424 450
     },

+ 178 - 3
src/views/info/organizationInfo/index.vue

@@ -49,6 +49,28 @@
49 49
           </el-select>
50 50
         </template>
51 51
       </el-form-item>
52
+      <el-form-item label="户型" prop="houseTypeId">
53
+        <template>
54
+          <el-select v-model="queryParams.houseTypeId" filterable placeholder="请选择">
55
+            <el-option
56
+              v-for="item in houseTypeList"
57
+              :key="item.typeId"
58
+              :label="item.typeName"
59
+              :value="item.typeId">
60
+            </el-option>
61
+          </el-select>
62
+        </template>
63
+      </el-form-item>
64
+      <el-form-item label="产业类型" prop="typeId">
65
+        <el-select v-model="queryParams.industryType" placeholder="请选择类型" clearable size="small">
66
+          <el-option
67
+            v-for="dict in dict.type.industry_type"
68
+            :key="dict.value"
69
+            :label="dict.label"
70
+            :value="dict.value"
71
+          />
72
+        </el-select>
73
+      </el-form-item>
52 74
       <el-form-item label="名称" prop="organizationName">
53 75
         <el-input
54 76
           v-model="queryParams.organizationName"
@@ -58,6 +80,15 @@
58 80
           @keyup.enter.native="handleQuery"
59 81
         />
60 82
       </el-form-item>
83
+      <el-form-item label="楼层" prop="floor">
84
+        <el-input
85
+          v-model="queryParams.floor"
86
+          placeholder="请输入楼层"
87
+          clearable
88
+          size="small"
89
+          @keyup.enter.native="handleQuery"
90
+        />
91
+      </el-form-item>
61 92
       <el-form-item label="是否重要" prop="important">
62 93
         <el-select v-model="queryParams.important" placeholder="请选择是否重要" clearable size="small">
63 94
           <el-option
@@ -144,6 +175,11 @@
144 175
           {{ getAreaName(scope.row.areaId) }}
145 176
         </template>
146 177
       </el-table-column>
178
+      <el-table-column label="产业类型" align="center">
179
+        <template slot-scope="scope">
180
+          <dict-tag :options="dict.type.industry_type" :value="scope.row.industryType"/>
181
+        </template>
182
+      </el-table-column>
147 183
       <el-table-column label="名称" align="center" prop="organizationName" />
148 184
       <el-table-column label="是否重要" align="center" prop="important">
149 185
         <template slot-scope="scope">
@@ -234,9 +270,34 @@
234 270
             </el-select>
235 271
           </template>
236 272
         </el-form-item>
273
+        <el-form-item label="户型" prop="houseTypeId">
274
+          <template>
275
+            <el-select v-model="form.houseTypeId" filterable placeholder="请选择">
276
+              <el-option
277
+                v-for="item in houseTypeList"
278
+                :key="item.typeId"
279
+                :label="item.typeName"
280
+                :value="item.typeId">
281
+              </el-option>
282
+            </el-select>
283
+          </template>
284
+        </el-form-item>
285
+        <el-form-item label="产业类型" prop="typeId">
286
+          <el-select v-model="form.industryType" placeholder="请选择类型" clearable size="small">
287
+            <el-option
288
+              v-for="dict in dict.type.industry_type"
289
+              :key="dict.value"
290
+              :label="dict.label"
291
+              :value="parseInt(dict.value)"
292
+            />
293
+          </el-select>
294
+        </el-form-item>
237 295
         <el-form-item label="名称" prop="organizationName">
238 296
           <el-input v-model="form.organizationName" placeholder="请输入名称" />
239 297
         </el-form-item>
298
+        <el-form-item label="楼层" prop="floor">
299
+          <el-input v-model="form.floor" placeholder="请输入楼层" />
300
+        </el-form-item>
240 301
         <el-form-item label="简介" prop="intro">
241 302
           <el-input v-model="form.intro" placeholder="请输入简介" />
242 303
         </el-form-item>
@@ -244,7 +305,9 @@
244 305
           <el-input v-model="form.lngLat" placeholder="请输入二维坐标" />
245 306
         </el-form-item>
246 307
         <el-form-item label="三维坐标" prop="rasterLngLat">
247
-          <el-input v-model="form.rasterLngLat" placeholder="请输入三维坐标" />
308
+          <el-input v-model="form.rasterLngLat" @focus="openditu">
309
+            {{ form.rasterLngLat}}
310
+          </el-input>
248 311
         </el-form-item>
249 312
         <el-form-item label="是否重要">
250 313
           <el-switch v-model="form.important"></el-switch>
@@ -282,6 +345,19 @@
282 345
         <el-button @click="cancel">取 消</el-button>
283 346
       </div>
284 347
     </el-dialog>
348
+
349
+    <el-dialog title="地图" :visible.sync="dialogVisible" width="80%">
350
+      <div id='mainMap'>
351
+        <div id="mapDiv" style="width:100%; height:700px">
352
+        </div>
353
+      </div>
354
+      <input type="button" value="清除" @click='clearmian()' />
355
+      <input type="button" value="标点工具" @click='openMarkTool()' />
356
+      <span slot="footer" class="dialog-footer">
357
+        <el-button @click="dialogVisible = false">取 消</el-button>
358
+        <el-button type="primary" @click='tijiao'>确定</el-button>
359
+      </span>
360
+    </el-dialog>
285 361
   </div>
286 362
 </template>
287 363
 
@@ -291,11 +367,17 @@ import { listBuildingInfo, getBuildingInfo } from "@/api/info/buildingInfo";
291 367
 import { listAreaInfo, getAreaInfo } from "@/api/info/areaInfo";
292 368
 import { listRoomInfo, getRoomInfo } from "@/api/info/roomInfo";
293 369
 import { listOrganizationType, getOrganizationType } from "@/api/type/organizationType";
370
+import { listHouseType, getHouseType } from "@/api/type/houseType";
294 371
 export default {
295 372
   name: "OrganizationInfo",
296
-  dicts: ['sys_yes_no'],
373
+  dicts: ['sys_yes_no', 'industry_type'],
297 374
   data() {
298 375
     return {
376
+      dialogVisible: false,
377
+      map: null,
378
+      handler: null,
379
+      markPoints: [], // 保存标记点的坐标
380
+      houseTypeList: [],
299 381
       organizationTypeList: [],
300 382
       areaList: [],
301 383
       roomList: [],
@@ -331,6 +413,8 @@ export default {
331 413
         areaId: null,
332 414
         organizationName: null,
333 415
         important: null,
416
+        industryType: null,
417
+        houseTypeId: null,
334 418
       },
335 419
       queryBuildingParams: {
336 420
         pageNum: 1,
@@ -352,9 +436,97 @@ export default {
352 436
     this.getRoomList();
353 437
     this.getAreaList();
354 438
     this.getOrganizationTypeList();
439
+    this.getHouseTypeLst();
355 440
   },
356 441
   methods: {
357 442
 
443
+
444
+    // 销毁天地图
445
+    destructionTMap ()  {
446
+      if (this.map) {
447
+        this.map = null;
448
+        // 直接将节点给删掉
449
+        console.log('1qsad');
450
+
451
+        const parentEl = document.getElementById('mainMap');
452
+        const cahildrenEl1 = document.getElementById('mapDiv');
453
+        if(cahildrenEl1) parentEl.removeChild(cahildrenEl1);
454
+        // 然后再手动将节点加进来
455
+        const newCahildrenEl = document.createElement("div");
456
+        newCahildrenEl.id = 'mapDiv'
457
+        newCahildrenEl.style = 'height: 700px;width: 100%;'
458
+        parentEl.appendChild(newCahildrenEl)
459
+      }
460
+    },
461
+
462
+    tijiao() {
463
+      console.log('多边形数据:', this.form.rasterLngLat);
464
+      console.log('多边形数据:', this.markPoints);
465
+      this.form.rasterLngLat = JSON.stringify(this.markPoints)
466
+      this.destructionTMap()
467
+      this.dialogVisible = false;
468
+    },
469
+
470
+    clearmian() {
471
+      if (this.handler) this.handler.close();
472
+      this.map.clearOverLays(); // 清除所有覆盖物
473
+      this.markPoints = []; // 清除保存的标记点坐标
474
+    },
475
+
476
+    openMarkTool() {
477
+      console.log("1111111111")
478
+      if (this.handler) this.handler.close(); // 关闭之前的工具
479
+
480
+      this.handler = new T.MarkTool(this.map); // 创建标点工具
481
+      this.handler.open(); // 打开标点工具
482
+
483
+      this.handler.on("mouseup", (e) => {
484
+        let drawData1 = [e.currentLnglat.lat, e.currentLnglat.lng]
485
+        this.markPoints = drawData1;
486
+      });
487
+
488
+      this.handler.on("close", () => {
489
+        // 标点工具关闭时的处理
490
+        this.handler = null;
491
+      });
492
+    },
493
+
494
+
495
+    openditu() {
496
+      console.log('打开地图对话框');
497
+      this.dialogVisible = true;
498
+      this.$nextTick(() => {
499
+        const T = window.T;
500
+        const zoom = 12;
501
+        this.map = new T.Map('mapDiv');
502
+        this.map.centerAndZoom(new T.LngLat(103.96, 30.66), zoom);
503
+        // 创建标注工具对象
504
+        this.handler = new T.MarkTool(this.map);
505
+        console.log('handler 初始化完成:', this.handler);
506
+        console.log('kanknak1', this.form.rasterLngLat);
507
+        let points = null;
508
+        if (this.form.rasterLngLat) {
509
+          const coordinates = JSON.parse(this.form.rasterLngLat);
510
+          points =  new T.LngLat(coordinates[1], coordinates[0]);
511
+        }
512
+        // 创建面对象
513
+        console.log('kanknak2', points);
514
+        const marker = new T.Marker(points);
515
+        // 向地图上添加面
516
+        this.map.addOverLay(marker);
517
+      });
518
+    },
519
+    getHouseTypeName(typeId) {
520
+      const houseType = this.houseTypeList.find(b => b.typeId === typeId);
521
+      return houseType ? houseType.typeName : '未知';
522
+    },
523
+
524
+    getHouseTypeLst() {
525
+      listHouseType(this.queryBuildingParams).then(response => {
526
+        this.houseTypeList = response.data.list;
527
+      });
528
+    },
529
+
358 530
     getOrganizationTypeName(typeId) {
359 531
       const type = this.organizationTypeList.find(b => b.typeId === typeId);
360 532
       return type ? type.typeName : '未知';
@@ -432,7 +604,10 @@ export default {
432 604
         product: null,
433 605
         enterTime: null,
434 606
         employeNum: null,
435
-        audio: null
607
+        audio: null,
608
+        industryType: null,
609
+        houseTypeId: null,
610
+        floor: null,
436 611
       };
437 612
       this.resetForm("form");
438 613
     },

+ 17 - 1
src/views/info/planInfo/index.vue

@@ -176,6 +176,18 @@
176 176
         <el-form-item label="面积" prop="acreage">
177 177
           <el-input-number v-model="form.acreage" controls-position="right"   :min="0" placeholder="请输入面积" />
178 178
         </el-form-item>
179
+        <el-form-item label="成本" prop="cost">
180
+          <el-input v-model="form.cost" type="textarea" placeholder="请输入内容" />
181
+        </el-form-item>
182
+        <el-form-item label="收益" prop="earnings">
183
+          <el-input v-model="form.earnings" type="textarea" placeholder="请输入内容" />
184
+        </el-form-item>
185
+        <el-form-item label="总占比" prop="totalPct">
186
+          <el-input v-model="form.totalPct" placeholder="请输入内容" />
187
+        </el-form-item>
188
+        <el-form-item label="风险" prop="risk">
189
+          <el-input v-model="form.risk" type="textarea" placeholder="请输入内容" />
190
+        </el-form-item>
179 191
 
180 192
       </el-form>
181 193
       <div slot="footer" class="dialog-footer">
@@ -292,7 +304,11 @@ export default {
292 304
         planName: null,
293 305
         content: null,
294 306
         colour: null,
295
-        acreage: null
307
+        acreage: null,
308
+        cost: null,
309
+        earnings: null,
310
+        totalPct: null,
311
+        risk: null
296 312
       };
297 313
       this.resetForm("form");
298 314
     },

+ 26 - 0
src/views/info/policyInfo/index.vue

@@ -27,6 +27,16 @@
27 27
           @keyup.enter.native="handleQuery"
28 28
         />
29 29
       </el-form-item>
30
+      <el-form-item label="类型" prop="typeId">
31
+        <el-select v-model="queryParams.typeId" placeholder="请选择类型id" clearable size="small">
32
+          <el-option
33
+            v-for="dict in dict.type.policy_type"
34
+            :key="dict.value"
35
+            :label="dict.label"
36
+            :value="dict.value"
37
+          />
38
+        </el-select>
39
+      </el-form-item>
30 40
       <el-form-item>
31 41
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
32 42
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -90,6 +100,11 @@
90 100
         </template>
91 101
       </el-table-column>
92 102
       <el-table-column label="文件名" align="center" prop="fileName" />
103
+      <el-table-column label="类型" align="center" prop="typeId">
104
+        <template slot-scope="scope">
105
+          <dict-tag :options="dict.type.policy_type" :value="scope.row.typeId"/>
106
+        </template>
107
+      </el-table-column>
93 108
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
94 109
         <template slot-scope="scope">
95 110
           <el-button
@@ -121,6 +136,16 @@
121 136
     <!-- 添加或修改政策信息对话框 -->
122 137
     <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
123 138
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
139
+        <el-form-item label="类型" prop="typeId">
140
+          <el-select v-model="form.typeId" placeholder="请选择类型id">
141
+            <el-option
142
+              v-for="dict in dict.type.policy_type"
143
+              :key="dict.value"
144
+              :label="dict.label"
145
+              :value="parseInt(dict.value)"
146
+            ></el-option>
147
+          </el-select>
148
+        </el-form-item>
124 149
         <el-form-item label="政策名称" prop="policyName">
125 150
           <el-input v-model="form.policyName" placeholder="请输入政策名称" />
126 151
         </el-form-item>
@@ -144,6 +169,7 @@ import fileUpload from "../../../components/FileUpload";
144 169
 
145 170
 export default {
146 171
   name: "PolicyInfo",
172
+  dicts: ['policy_type'],
147 173
   components: {
148 174
     fileUpload
149 175
   },

+ 95 - 1
src/views/info/stationInfo/index.vue

@@ -136,7 +136,9 @@
136 136
           <el-input v-model="form.lngLat" placeholder="请输入二维坐标" />
137 137
         </el-form-item>
138 138
         <el-form-item label="三维坐标" prop="rasterLngLat">
139
-          <el-input v-model="form.rasterLngLat" placeholder="请输入三维坐标" />
139
+          <el-input v-model="form.rasterLngLat" @focus="openditu">
140
+            {{ form.rasterLngLat}}
141
+          </el-input>
140 142
         </el-form-item>
141 143
         <el-form-item label="车辆" prop="trafficId">
142 144
           <template>
@@ -156,6 +158,19 @@
156 158
         <el-button @click="cancel">取 消</el-button>
157 159
       </div>
158 160
     </el-dialog>
161
+
162
+    <el-dialog title="地图" :visible.sync="dialogVisible" width="80%">
163
+      <div id='mainMap'>
164
+        <div id="mapDiv" style="width:100%; height:700px">
165
+        </div>
166
+      </div>
167
+      <input type="button" value="清除" @click='clearmian()' />
168
+      <input type="button" value="标点工具" @click='openMarkTool()' />
169
+      <span slot="footer" class="dialog-footer">
170
+        <el-button @click="dialogVisible = false">取 消</el-button>
171
+        <el-button type="primary" @click='tijiao'>确定</el-button>
172
+      </span>
173
+    </el-dialog>
159 174
   </div>
160 175
 </template>
161 176
 
@@ -167,6 +182,10 @@ export default {
167 182
   name: "StationInfo",
168 183
   data() {
169 184
     return {
185
+      dialogVisible: false,
186
+      map: null,
187
+      handler: null,
188
+      markPoints: [], // 保存标记点的坐标
170 189
       trafficList: [],
171 190
       // 遮罩层
172 191
       loading: true,
@@ -215,6 +234,81 @@ export default {
215 234
     this.getTrafficList();
216 235
   },
217 236
   methods: {
237
+    // 销毁天地图
238
+    destructionTMap ()  {
239
+      if (this.map) {
240
+        this.map = null;
241
+        // 直接将节点给删掉
242
+        console.log('1qsad');
243
+
244
+        const parentEl = document.getElementById('mainMap');
245
+        const cahildrenEl1 = document.getElementById('mapDiv');
246
+        if(cahildrenEl1) parentEl.removeChild(cahildrenEl1);
247
+        // 然后再手动将节点加进来
248
+        const newCahildrenEl = document.createElement("div");
249
+        newCahildrenEl.id = 'mapDiv'
250
+        newCahildrenEl.style = 'height: 700px;width: 100%;'
251
+        parentEl.appendChild(newCahildrenEl)
252
+      }
253
+    },
254
+
255
+    tijiao() {
256
+      console.log('多边形数据:', this.form.rasterLngLat);
257
+      console.log('多边形数据:', this.markPoints);
258
+      this.form.rasterLngLat = JSON.stringify(this.markPoints)
259
+      this.destructionTMap()
260
+      this.dialogVisible = false;
261
+    },
262
+
263
+    clearmian() {
264
+      if (this.handler) this.handler.close();
265
+      this.map.clearOverLays(); // 清除所有覆盖物
266
+      this.markPoints = []; // 清除保存的标记点坐标
267
+    },
268
+
269
+    openMarkTool() {
270
+      console.log("1111111111")
271
+      if (this.handler) this.handler.close(); // 关闭之前的工具
272
+
273
+      this.handler = new T.MarkTool(this.map); // 创建标点工具
274
+      this.handler.open(); // 打开标点工具
275
+
276
+      this.handler.on("mouseup", (e) => {
277
+        let drawData1 = [e.currentLnglat.lat, e.currentLnglat.lng]
278
+        this.markPoints = drawData1;
279
+      });
280
+
281
+      this.handler.on("close", () => {
282
+        // 标点工具关闭时的处理
283
+        this.handler = null;
284
+      });
285
+    },
286
+
287
+
288
+    openditu() {
289
+      console.log('打开地图对话框');
290
+      this.dialogVisible = true;
291
+      this.$nextTick(() => {
292
+        const T = window.T;
293
+        const zoom = 12;
294
+        this.map = new T.Map('mapDiv');
295
+        this.map.centerAndZoom(new T.LngLat(103.96, 30.66), zoom);
296
+        // 创建标注工具对象
297
+        this.handler = new T.MarkTool(this.map);
298
+        console.log('handler 初始化完成:', this.handler);
299
+        console.log('kanknak1', this.form.rasterLngLat);
300
+        let points = [];
301
+        if (this.form.rasterLngLat) {
302
+          const coordinates = JSON.parse(this.form.rasterLngLat);
303
+          points =  new T.LngLat(coordinates[1], coordinates[0]);
304
+        }
305
+        // 创建面对象
306
+        console.log('kanknak2', points);
307
+        const marker = new T.Marker(points);
308
+        // 向地图上添加面
309
+        this.map.addOverLay(marker);
310
+      });
311
+    },
218 312
 
219 313
     getTrafficName(trafficId) {
220 314
       const trafficName = this.trafficList.find(item => item.trafficId === trafficId);

+ 126 - 1
src/views/info/trafficInfo/index.vue

@@ -147,7 +147,9 @@
147 147
           <el-color-picker v-model="form.colour"></el-color-picker>
148 148
         </el-form-item>
149 149
         <el-form-item label="坐标" prop="location">
150
-          <el-input v-model="form.location" placeholder="请输入坐标" />
150
+          <el-input v-model="form.location" @focus="openditu">
151
+            {{ form.location}}
152
+          </el-input>
151 153
         </el-form-item>
152 154
       </el-form>
153 155
       <div slot="footer" class="dialog-footer">
@@ -155,6 +157,20 @@
155 157
         <el-button @click="cancel">取 消</el-button>
156 158
       </div>
157 159
     </el-dialog>
160
+
161
+
162
+    <el-dialog title="地图" :visible.sync="dialogVisible" width="80%">
163
+      <div id='mainMap'>
164
+        <div id="mapDiv" style="width:100%; height:700px">
165
+        </div>
166
+      </div>
167
+      <input type="button" value="清除" @click='clearmian()' />
168
+      <input type="button" value="划线工具" @click='openPolylineTool()' />
169
+      <span slot="footer" class="dialog-footer">
170
+        <el-button @click="dialogVisible = false">取 消</el-button>
171
+        <el-button type="primary" @click='tijiao'>确定</el-button>
172
+      </span>
173
+    </el-dialog>
158 174
   </div>
159 175
 </template>
160 176
 
@@ -165,6 +181,14 @@ export default {
165 181
   name: "TrafficInfo",
166 182
   data() {
167 183
     return {
184
+      polylineTool: null,
185
+      handler: null,
186
+      geoJson: {
187
+        type: "Polyline",
188
+        coordinates: [[]],
189
+      },
190
+      map: null,
191
+      dialogVisible: false,
168 192
       trafficTypeList: [],
169 193
       // 遮罩层
170 194
       loading: true,
@@ -216,6 +240,105 @@ export default {
216 240
   },
217 241
   methods: {
218 242
 
243
+    // 销毁天地图
244
+    destructionTMap ()  {
245
+      if (this.map) {
246
+        this.map = null;
247
+        this.geoJson.coordinates[0]=[]
248
+        // 直接将节点给删掉
249
+        console.log('1qsad');
250
+
251
+        const parentEl = document.getElementById('mainMap');
252
+        const cahildrenEl = document.getElementById('mapDiv');
253
+        if(cahildrenEl) parentEl.removeChild(cahildrenEl);
254
+        // 然后再手动将节点加进来
255
+        const newCahildrenEl = document.createElement("div");
256
+        newCahildrenEl.id = 'mapDiv'
257
+        newCahildrenEl.style = 'height: 700px;width: 100%;'
258
+        parentEl.appendChild(newCahildrenEl)
259
+      }
260
+    },
261
+
262
+    tijiao() {
263
+      console.log('多边形数据:', this.form.location);
264
+
265
+      if (this.geoJson.coordinates[0].length > 0) {
266
+        this.form.location = JSON.stringify(this.geoJson)
267
+      }
268
+
269
+      this.destructionTMap()
270
+      this.dialogVisible = false;
271
+
272
+    },
273
+
274
+    openPolylineTool(){
275
+      console.log(this.form.location);
276
+      if (JSON.parse(this.form.location).coordinates[0].length > 0 || this.geoJson.coordinates[0].length > 0 ) {
277
+        this.$notify({
278
+          title: '警告',
279
+          message: '请先清空地图',
280
+          type: 'warning'
281
+        });
282
+        return
283
+      }
284
+      // if (this.handler) this.handler.close();
285
+      this.handler = new T.PolylineTool(this.map);
286
+      this.handler.open();
287
+      this.handler.on("draw", (yu) => {
288
+        console.log("参数??99", yu.currentLnglats);
289
+        let drawData = yu.currentLnglats.map((item) => {
290
+          return [item.lng, item.lat];
291
+        });
292
+        this.geoJson.coordinates[0] = drawData;
293
+        console.log("区域之后处理数据", this.geoJson.coordinates[0]);
294
+
295
+      });
296
+    },
297
+
298
+    showPolyLine() {
299
+      var config = {
300
+      showLabel: true,
301
+      color: "red", weight: 3.5, opacity: 0.8, fillColor: "red", fillOpacity: 0.5
302
+      };
303
+      //创建标注工具对象
304
+      this.polygonTool = new T.PolylineTool(this.map, config);
305
+      console.log('kanknak1', this.form.location);
306
+      var points = [];
307
+      JSON.parse(this.form.location).coordinates[0].map((item) => {
308
+        points.push(new T.LngLat(item[0], item[1]));
309
+      })
310
+      console.log('kanknak2', points);
311
+      //创建面对象
312
+      var polyline = new T.Polyline(points, {
313
+        color: "red", weight: 3.5, opacity: 0.8, fillColor: "red", fillOpacity: 0.5
314
+      });
315
+      //向地图上添加面
316
+      this.map.addOverLay(polyline);;
317
+    },
318
+
319
+    clearmian(){
320
+      this.geoJson.coordinates[0] = []
321
+      this.$set(this.form, 'location', JSON.stringify(this.geoJson))
322
+      this.map.clearOverLays()
323
+
324
+    },
325
+
326
+    openditu(){
327
+      if (this.form.location == null){
328
+        this.$set(this.form, 'location', JSON.stringify(this.geoJson))
329
+      }
330
+      this.dialogVisible = true;
331
+      this.$nextTick(() => {
332
+        const T = window.T;
333
+        const zoom = 12;
334
+        this.map = new T.Map('mapDiv');
335
+        this.map.centerAndZoom(new T.LngLat(103.96, 30.66), zoom);
336
+        this.showPolyLine();
337
+      });
338
+
339
+
340
+    },
341
+
219 342
     getTrafficTypeName(typeId) {
220 343
       const type = this.trafficTypeList.find(b => b.typeId === typeId);
221 344
       return type ? type.typeName : '未知';
@@ -248,6 +371,7 @@ export default {
248 371
         trafficName: null,
249 372
         amount: null,
250 373
         memo: null,
374
+        location: null,
251 375
         colour: null
252 376
       };
253 377
       this.resetForm("form");
@@ -289,6 +413,7 @@ export default {
289 413
       this.$refs["form"].validate(valid => {
290 414
         if (valid) {
291 415
           if (this.form.trafficId != null) {
416
+            this.form.location=JSON.parse(this.form.location)
292 417
             updateTrafficInfo(this.form).then(response => {
293 418
               this.$modal.msgSuccess("修改成功");
294 419
               this.open = false;