Bladeren bron

修改一张图

余思翰 9 maanden geleden
bovenliggende
commit
f1f390a0d5

+ 1
- 1
oa-ui/package.json Bestand weergeven

@@ -60,7 +60,7 @@
60 60
     "js-cookie": "3.0.1",
61 61
     "jsencrypt": "3.0.0-rc.1",
62 62
     "nprogress": "0.2.0",
63
-    "ol": "^6.0.0",
63
+    "ol": "^7.1.0",
64 64
     "quill": "1.3.7",
65 65
     "screenfull": "5.0.2",
66 66
     "sortablejs": "1.10.2",

+ 77
- 0
oa-ui/src/utils/maps.js Bestand weergeven

@@ -0,0 +1,77 @@
1
+
2
+import TileLayer from 'ol/layer/Tile';
3
+import { Cluster, Vector as VectorSource, XYZ } from 'ol/source';
4
+
5
+const Tianditu = new TileLayer({
6
+  source: new XYZ({
7
+    url: 'http://t4.tianditu.com/DataServer?T=img_w&tk=4d02670f819130ba862ebc24a1aebaf3&x={x}&y={y}&l={z}'
8
+  }),
9
+  properties: {
10
+    name: '天地图'
11
+  },
12
+  visible: false
13
+})
14
+
15
+// 中科星图
16
+const ZhongKe = new TileLayer({
17
+  source: new XYZ({
18
+    url: "https://tiles1.geovisearth.com/base/v1/img/{z}/{x}/{y}?format=webp&tmsIds=w&token=9b56a7bcb2f51c939753bc066fa6d0e7b7f55cfbf1939fa9e04f53050f4154b9"
19
+  }),
20
+  properties: {
21
+    name: '中科星图'
22
+  },
23
+  visible: false
24
+})
25
+
26
+// ArcGIS
27
+const ArcGISBlue = new TileLayer({
28
+  source: new XYZ({
29
+    url: "https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}"
30
+  }),
31
+  properties: {
32
+    name: 'ArcGIS'
33
+  },
34
+  visible: false
35
+})
36
+
37
+// 高德
38
+const Autonavi = new TileLayer({
39
+  source: new XYZ({
40
+    url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"
41
+  }),
42
+  properties: {
43
+    name: '高德'
44
+  },
45
+  visible: true
46
+})
47
+// 谷歌
48
+const google = new TileLayer({
49
+  source: new XYZ({
50
+    url: "https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s,m&gl=CN&x={x}&y={y}&z={z}"
51
+  }),
52
+  properties: {
53
+    name: '谷歌'
54
+  },
55
+  visible: false
56
+})
57
+const terrain = new TileLayer({
58
+  source: new XYZ({
59
+    url: "http://t4.tianditu.com/DataServer?T=ter_c&tk=4d02670f819130ba862ebc24a1aebaf3&x={x}&y={y}&l={z}"
60
+  }),
61
+  properties: {
62
+    name: '天地图地形'
63
+  },
64
+  visible: false
65
+})
66
+const vect = new TileLayer({
67
+  source: new XYZ({
68
+    url: "http://t4.tianditu.com/DataServer?T=vec_w&tk=81b9a9cf3e4be1df181e7bf54c5949fc&x={x}&y={y}&l={z}"
69
+  }),
70
+  properties: {
71
+    name: '矢量图'
72
+  },
73
+  visible: false
74
+})
75
+
76
+
77
+export { Tianditu, ZhongKe, ArcGISBlue, Autonavi, google, terrain, vect }

+ 19
- 353
oa-ui/src/views/file/filesProject/project.vue Bestand weergeven

@@ -44,9 +44,8 @@
44 44
         <el-table-column prop="projectNumber" label="项目编号" align="center" />
45 45
         <el-table-column prop="projectName" label="项目名称" width="200px" align="center" />
46 46
         <el-table-column prop="projectLeaderUser.nickName" label="项目负责人" align="center" />
47
-        <el-table-column prop="partyA" label="甲方单位" align="center" />
47
+        <el-table-column prop="partyA.partyAName" label="甲方单位" align="center" />
48 48
         <el-table-column prop="undertakingSector" label="承担部门" align="center" />
49
-        <el-table-column prop="requiredCompletionDate" label="项目要求完成日期" align="center" />
50 49
         <el-table-column prop="storageAddress" label="存放地址" align="center" />
51 50
         <el-table-column label="有无范围KML" align="center" :formatter="formatterKmlurl" />
52 51
         <el-table-column label="有无控制点" align="center" :formatter="formatterCpKmlurl" />
@@ -145,175 +144,6 @@
145 144
             </el-form-item>
146 145
           </el-col>
147 146
         </el-row>
148
-        <el-row :gutter="20">
149
-          <el-col :span="12">
150
-            <el-form-item label="项目类型" prop="projectType">
151
-              <el-input v-model="form.projectType" />
152
-            </el-form-item>
153
-          </el-col>
154
-          <el-col :span="12">
155
-            <el-form-item label="甲方单位" prop="partyA">
156
-              <el-input v-model="form.partyA" />
157
-            </el-form-item>
158
-          </el-col>
159
-        </el-row>
160
-        <el-row :gutter="20">
161
-          <el-col :span="12">
162
-            <el-form-item label="联系人" prop="contactPerson">
163
-              <el-input v-model="form.contactPerson" />
164
-            </el-form-item>
165
-          </el-col>
166
-          <el-col :span="12">
167
-            <el-form-item label="联系电话" prop="telephone">
168
-              <el-input v-model="form.telephone" />
169
-            </el-form-item>
170
-          </el-col>
171
-        </el-row>
172
-        <el-row :gutter="20">
173
-          <el-col :span="12">
174
-            <el-form-item label="项目来源" prop="projectSource">
175
-              <el-input v-model="form.projectSource" />
176
-            </el-form-item>
177
-          </el-col>
178
-          <el-col :span="12">
179
-            <el-form-item label="合同编码" prop="contractCode">
180
-              <el-input v-model="form.contractCode" />
181
-            </el-form-item>
182
-          </el-col>
183
-        </el-row>
184
-        <el-row :gutter="20">
185
-          <el-col :span="12">
186
-            <el-form-item label="合同编号" prop="contractNumber">
187
-              <el-input v-model="form.contractNumber" />
188
-            </el-form-item>
189
-          </el-col>
190
-          <el-col :span="12">
191
-            <el-form-item label="预计价款" prop="expectedPrice">
192
-              <el-input v-model="form.expectedPrice" />
193
-            </el-form-item>
194
-          </el-col>
195
-        </el-row>
196
-        <el-row :gutter="20">
197
-          <el-col :span="12">
198
-            <el-form-item label="项目级别" prop="projectLevel">
199
-              <el-input v-model="form.projectLevel" />
200
-            </el-form-item>
201
-          </el-col>
202
-          <el-col :span="12">
203
-            <el-form-item label="技术负责人" prop="technicalDirector">
204
-              <el-input v-model="form.technicalDirector" />
205
-            </el-form-item>
206
-          </el-col>
207
-        </el-row>
208
-        <el-row :gutter="20">
209
-          <el-col :span="12">
210
-            <el-form-item label="技术设计人" prop="techinicalDesigner">
211
-              <el-input v-model="form.techinicalDesigner" />
212
-            </el-form-item>
213
-          </el-col>
214
-          <el-col :span="12">
215
-            <el-form-item label="质量检查员" prop="qualityInspector">
216
-              <el-input v-model="form.qualityInspector" />
217
-            </el-form-item>
218
-          </el-col>
219
-        </el-row>
220
-        <el-row :gutter="20">
221
-          <el-col :span="12">
222
-            <el-form-item label="承担部门" prop="undertakingSector">
223
-              <el-input v-model="form.undertakingSector" />
224
-            </el-form-item>
225
-          </el-col>
226
-          <el-col :span="12">
227
-            <el-form-item label="经费合计" prop="fund">
228
-              <el-input v-model="form.fund" />
229
-            </el-form-item>
230
-          </el-col>
231
-        </el-row>
232
-        <el-row :gutter="20">
233
-          <el-col :span="12">
234
-            <el-form-item label="领导批准时间" prop="approvalDate">
235
-              <el-input v-model="form.approvalDate" />
236
-            </el-form-item>
237
-          </el-col>
238
-          <el-col :span="12">
239
-            <el-form-item label="进场时间" prop="approachTime">
240
-              <el-input v-model="form.approachTime" />
241
-            </el-form-item>
242
-          </el-col>
243
-        </el-row>
244
-        <el-row :gutter="20">
245
-          <el-col :span="12">
246
-            <el-form-item label="项目要求完成日期" prop="requiredCompletionDate">
247
-              <el-input v-model="form.requiredCompletionDate" />
248
-            </el-form-item>
249
-          </el-col>
250
-          <el-col :span="12">
251
-            <el-form-item label="资料提交日期" prop="submissionDate">
252
-              <el-input v-model="form.submissionDate" />
253
-            </el-form-item>
254
-          </el-col>
255
-        </el-row>
256
-        <el-row :gutter="20">
257
-          <el-col :span="12">
258
-            <el-form-item label="使用车辆" prop="licensePlateNumber">
259
-              <el-input v-model="form.licensePlateNumber" />
260
-            </el-form-item>
261
-          </el-col>
262
-          <el-col :span="12">
263
-            <el-form-item label="项目行车公里数" prop="mileage">
264
-              <el-input v-model="form.mileage" />
265
-            </el-form-item>
266
-          </el-col>
267
-        </el-row>
268
-        <el-row :gutter="20">
269
-          <el-col :span="12">
270
-            <el-form-item label="项目燃油使用费" prop="fuelExpense">
271
-              <el-input v-model="form.fuelExpense" />
272
-            </el-form-item>
273
-          </el-col>
274
-          <el-col :span="12">
275
-            <el-form-item label="主要设备" prop="mainEquipment">
276
-              <el-input v-model="form.mainEquipment" />
277
-            </el-form-item>
278
-          </el-col>
279
-        </el-row>
280
-        <el-row :gutter="20">
281
-          <el-col :span="12">
282
-            <el-form-item label="项目参与人员" prop="projectParticipants">
283
-              <el-input v-model="form.projectParticipants" />
284
-            </el-form-item>
285
-          </el-col>
286
-          <el-col :span="12">
287
-            <el-form-item label="当前处理环节" prop="currentProcessing">
288
-              <el-input v-model="form.currentProcessing" />
289
-            </el-form-item>
290
-          </el-col>
291
-        </el-row>
292
-        <el-row :gutter="20">
293
-          <el-col :span="12">
294
-            <el-form-item label="当前处理人" prop="currentHandler">
295
-              <el-input v-model="form.currentHandler" />
296
-            </el-form-item>
297
-          </el-col>
298
-          <el-col :span="12">
299
-            <el-form-item label="项目登记人" prop="projectRegistrant">
300
-              <el-input v-model="form.projectRegistrant" />
301
-            </el-form-item>
302
-          </el-col>
303
-        </el-row>
304
-        <el-row :gutter="20">
305
-          <el-col :span="12">
306
-            <el-form-item label="项目登记日期" prop="registrationDate">
307
-              <el-input v-model="form.registrationDate" />
308
-            </el-form-item>
309
-          </el-col>
310
-          <el-col :span="12">
311
-            <el-form-item label="牵头项目" prop="leadingSector">
312
-              <el-input v-model="form.leadingSector" />
313
-            </el-form-item>
314
-          </el-col>
315
-        </el-row>
316
-
317 147
       </el-form>
318 148
       <template #footer>
319 149
         <div class="dialog-footer">
@@ -326,35 +156,35 @@
326 156
     <el-dialog :title="title" :visible.sync="modifyOpen" width="60%" append-to-body>
327 157
       <el-form :model="modifyForm" ref="projectModifyRef" label-width="130px" :rules="modifyRules">
328 158
         <el-row :gutter="20">
329
-          <el-col :span="12">
159
+          <!-- <el-col :span="12">
330 160
             <el-form-item label="项目是否结束" prop="isFinished">
331 161
               <el-switch :disabled="true" v-model="modifyForm.isFinished" class="ml-2" inline-prompt
332 162
                 style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" active-text="是" inactive-text="否"
333 163
                 active-value="1" inactive-value="0" />
334 164
             </el-form-item>
335
-          </el-col>
165
+          </el-col> -->
336 166
           <el-col :span="12">
337 167
             <el-form-item label="项目编号" prop="projectNumber">
338 168
               <el-input :disabled="true" v-model="modifyForm.projectNumber" placeholder="请输入项目编号" />
339 169
             </el-form-item>
340 170
           </el-col>
341
-        </el-row>
342
-        <el-row :gutter="20">
343 171
           <el-col :span="12">
344 172
             <el-form-item label="项目名称" prop="projectName">
345 173
               <el-input :disabled="true" v-model="modifyForm.projectName" placeholder="请输入项目名称" />
346 174
             </el-form-item>
347 175
           </el-col>
176
+        </el-row>
177
+        <!-- <el-row :gutter="20">
348 178
           <el-col :span="12">
349 179
             <el-form-item label="项目负责人" prop="projectLeader">
350 180
               <el-input :disabled="true" v-model="modifyForm.projectLeader" placeholder="请输入项目负责人" />
351 181
             </el-form-item>
352 182
           </el-col>
353
-        </el-row>
183
+        </el-row> -->
354 184
         <el-row :gutter="20">
355 185
           <el-col :span="12">
356 186
             <el-form-item label="存放地址" prop="storageAddress">
357
-              <el-select v-model="modifyForm.storageAddress" placeholder="请选择" filterable allow-create clearable>
187
+              <el-select v-model="modifyForm.storageAddress" placeholder="请选择" filterable allow-create clearable style="width: 100%;">
358 188
                 <el-option v-for="item, index in storageList" :key="index" :label="item.storageAddress"
359 189
                   :value="item.storageAddress" />
360 190
               </el-select>
@@ -365,7 +195,7 @@
365 195
           <el-col :span="12">
366 196
             <el-form-item label="范围kml" prop="projectKml">
367 197
               <div style="display: flex;">
368
-                <div>
198
+                <div style="width: 100%;">
369 199
                   <el-input v-model="kmlFileName" disabled v-if="isUpdate" placeholder="请选择kml文件"></el-input>
370 200
                 </div>
371 201
                 <div>
@@ -387,7 +217,7 @@
387 217
           <el-col :span="12">
388 218
             <el-form-item label="控制点Kml" prop="projectCp">
389 219
               <div style="display: flex;">
390
-                <div>
220
+                <div style="width: 100%;">
391 221
                   <el-input v-model="cpFileName" disabled v-if="isUpdate" placeholder="请选择kml文件"></el-input>
392 222
                 </div>
393 223
                 <div>
@@ -401,175 +231,6 @@
401 231
             </el-form-item>
402 232
           </el-col>
403 233
         </el-row>
404
-        <el-row :gutter="20">
405
-          <el-col :span="12">
406
-            <el-form-item label="项目类型" prop="projectType">
407
-              <el-input :disabled="true" v-model="modifyForm.projectType" />
408
-            </el-form-item>
409
-          </el-col>
410
-          <el-col :span="12">
411
-            <el-form-item label="甲方单位" prop="partyA">
412
-              <el-input :disabled="true" v-model="modifyForm.partyA" />
413
-            </el-form-item>
414
-          </el-col>
415
-        </el-row>
416
-        <el-row :gutter="20">
417
-          <el-col :span="12">
418
-            <el-form-item label="联系人" prop="contactPerson">
419
-              <el-input :disabled="true" v-model="modifyForm.contactPerson" />
420
-            </el-form-item>
421
-          </el-col>
422
-          <el-col :span="12">
423
-            <el-form-item label="联系电话" prop="telephone">
424
-              <el-input :disabled="true" v-model="modifyForm.telephone" />
425
-            </el-form-item>
426
-          </el-col>
427
-        </el-row>
428
-        <el-row :gutter="20">
429
-          <el-col :span="12">
430
-            <el-form-item label="项目来源" prop="projectSource">
431
-              <el-input :disabled="true" v-model="modifyForm.projectSource" />
432
-            </el-form-item>
433
-          </el-col>
434
-          <el-col :span="12">
435
-            <el-form-item label="合同编码" prop="contractCode">
436
-              <el-input :disabled="true" v-model="modifyForm.contractCode" />
437
-            </el-form-item>
438
-          </el-col>
439
-        </el-row>
440
-        <el-row :gutter="20">
441
-          <el-col :span="12">
442
-            <el-form-item label="合同编号" prop="contractNumber">
443
-              <el-input :disabled="true" v-model="modifyForm.contractNumber" />
444
-            </el-form-item>
445
-          </el-col>
446
-          <el-col :span="12">
447
-            <el-form-item label="预计价款" prop="expectedPrice">
448
-              <el-input :disabled="true" v-model="modifyForm.expectedPrice" />
449
-            </el-form-item>
450
-          </el-col>
451
-        </el-row>
452
-        <el-row :gutter="20">
453
-          <el-col :span="12">
454
-            <el-form-item label="项目级别" prop="projectLevel">
455
-              <el-input :disabled="true" v-model="modifyForm.projectLevel" />
456
-            </el-form-item>
457
-          </el-col>
458
-          <el-col :span="12">
459
-            <el-form-item label="技术负责人" prop="technicalDirector">
460
-              <el-input :disabled="true" v-model="modifyForm.technicalDirector" />
461
-            </el-form-item>
462
-          </el-col>
463
-        </el-row>
464
-        <el-row :gutter="20">
465
-          <el-col :span="12">
466
-            <el-form-item label="技术设计人" prop="techinicalDesigner">
467
-              <el-input :disabled="true" v-model="modifyForm.techinicalDesigner" />
468
-            </el-form-item>
469
-          </el-col>
470
-          <el-col :span="12">
471
-            <el-form-item label="质量检查员" prop="qualityInspector">
472
-              <el-input :disabled="true" v-model="modifyForm.qualityInspector" />
473
-            </el-form-item>
474
-          </el-col>
475
-        </el-row>
476
-        <el-row :gutter="20">
477
-          <el-col :span="12">
478
-            <el-form-item label="承担部门" prop="undertakingSector">
479
-              <el-input :disabled="true" v-model="modifyForm.undertakingSector" />
480
-            </el-form-item>
481
-          </el-col>
482
-          <el-col :span="12">
483
-            <el-form-item label="经费合计" prop="fund">
484
-              <el-input :disabled="true" v-model="modifyForm.fund" />
485
-            </el-form-item>
486
-          </el-col>
487
-        </el-row>
488
-        <el-row :gutter="20">
489
-          <el-col :span="12">
490
-            <el-form-item label="领导批准时间" prop="approvalDate">
491
-              <el-input :disabled="true" v-model="modifyForm.approvalDate" />
492
-            </el-form-item>
493
-          </el-col>
494
-          <el-col :span="12">
495
-            <el-form-item label="进场时间" prop="approachTime">
496
-              <el-input :disabled="true" v-model="modifyForm.approachTime" />
497
-            </el-form-item>
498
-          </el-col>
499
-        </el-row>
500
-        <el-row :gutter="20">
501
-          <el-col :span="12">
502
-            <el-form-item label="项目要求完成日期" prop="requiredCompletionDate">
503
-              <el-input :disabled="true" v-model="modifyForm.requiredCompletionDate" />
504
-            </el-form-item>
505
-          </el-col>
506
-          <el-col :span="12">
507
-            <el-form-item label="资料提交日期" prop="submissionDate">
508
-              <el-input :disabled="true" v-model="modifyForm.submissionDate" />
509
-            </el-form-item>
510
-          </el-col>
511
-        </el-row>
512
-        <el-row :gutter="20">
513
-          <el-col :span="12">
514
-            <el-form-item label="使用车辆" prop="licensePlateNumber">
515
-              <el-input :disabled="true" v-model="modifyForm.licensePlateNumber" />
516
-            </el-form-item>
517
-          </el-col>
518
-          <el-col :span="12">
519
-            <el-form-item label="项目行车公里数" prop="mileage">
520
-              <el-input :disabled="true" v-model="modifyForm.mileage" />
521
-            </el-form-item>
522
-          </el-col>
523
-        </el-row>
524
-        <el-row :gutter="20">
525
-          <el-col :span="12">
526
-            <el-form-item label="项目燃油使用费" prop="fuelExpense">
527
-              <el-input :disabled="true" v-model="modifyForm.fuelExpense" />
528
-            </el-form-item>
529
-          </el-col>
530
-          <el-col :span="12">
531
-            <el-form-item label="主要设备" prop="mainEquipment">
532
-              <el-input :disabled="true" v-model="modifyForm.mainEquipment" />
533
-            </el-form-item>
534
-          </el-col>
535
-        </el-row>
536
-        <el-row :gutter="20">
537
-          <el-col :span="12">
538
-            <el-form-item label="项目参与人员" prop="projectParticipants">
539
-              <el-input :disabled="true" v-model="modifyForm.projectParticipants" />
540
-            </el-form-item>
541
-          </el-col>
542
-          <el-col :span="12">
543
-            <el-form-item label="当前处理环节" prop="currentProcessing">
544
-              <el-input :disabled="true" v-model="modifyForm.currentProcessing" />
545
-            </el-form-item>
546
-          </el-col>
547
-        </el-row>
548
-        <el-row :gutter="20">
549
-          <el-col :span="12">
550
-            <el-form-item label="当前处理人" prop="currentHandler">
551
-              <el-input :disabled="true" v-model="modifyForm.currentHandler" />
552
-            </el-form-item>
553
-          </el-col>
554
-          <el-col :span="12">
555
-            <el-form-item label="项目登记人" prop="projectRegistrant">
556
-              <el-input :disabled="true" v-model="modifyForm.projectRegistrant" />
557
-            </el-form-item>
558
-          </el-col>
559
-        </el-row>
560
-        <el-row :gutter="20">
561
-          <el-col :span="12">
562
-            <el-form-item label="项目登记日期" prop="registrationDate">
563
-              <el-input :disabled="true" v-model="modifyForm.registrationDate" />
564
-            </el-form-item>
565
-          </el-col>
566
-          <el-col :span="12">
567
-            <el-form-item label="牵头项目" prop="leadingSector">
568
-              <el-input :disabled="true" v-model="modifyForm.leadingSector" />
569
-            </el-form-item>
570
-          </el-col>
571
-        </el-row>
572
-
573 234
       </el-form>
574 235
       <template #footer>
575 236
         <div class="dialog-footer">
@@ -820,12 +481,12 @@ export default {
820 481
       this.modifyForm = row;
821 482
       let leaderObj = this.$store.state.user.userList.find(obj => obj.userId == row.projectLeader);
822 483
       if(leaderObj)
823
-        this.modifyForm.projectLeader = leaderObj.nickName
484
+        this.modifyForm.projectLeaderName = leaderObj.nickName
824 485
       this.modifyOpen = true;
825 486
       this.position = [];
826 487
       this.kmlFileName = row.projectKml;
827 488
       this.cpFileName = row.projectCp;
828
-      this.title = "修改项目";
489
+      this.title = "修改项目KML";
829 490
       this.isUpdate = true;
830 491
     },
831 492
     /* 新增确定按钮 */
@@ -858,6 +519,8 @@ export default {
858 519
       this.uploadKmlData = new FormData();
859 520
       this.uploadKmlData.append("kmlfile", this.kmlfile);
860 521
       this.uploadKmlData.append("cpfile", this.cpfile);
522
+      this.modifyForm.partyA = null
523
+      console.log( this.kmlfile);
861 524
       if (this.position.length != 0) {
862 525
         this.modifyForm.kmlLng = this.position[0];
863 526
         this.modifyForm.kmlLat = this.position[1];
@@ -868,6 +531,9 @@ export default {
868 531
           for (let i in this.modifyForm) {
869 532
             this.uploadKmlData.append(i, this.modifyForm[i] == null ? "" : this.modifyForm[i]);
870 533
           }
534
+          console.log(this.modifyForm);
535
+          console.log((this.uploadKmlData) );
536
+          // return
871 537
           updateProject(this.uploadKmlData).then(response => {
872 538
             this.$modal.msgSuccess("修改成功");
873 539
             this.addModifyOpen = false;
@@ -986,7 +652,7 @@ export default {
986 652
       this.uploadFormData.append("file", file);
987 653
       this.upload.data = this.uploadFormData;
988 654
     },
989
-    handleKmlUploadChange(file, fileList) {
655
+    async handleKmlUploadChange(file, fileList) {
990 656
       if (fileList.length > 1) {
991 657
         fileList.splice(0, 1);
992 658
       }
@@ -995,7 +661,7 @@ export default {
995 661
       let fileReader = new FileReader();
996 662
       fileReader.readAsText(this.kmlfile);
997 663
       fileReader.onload = async (e) => {
998
-        let result = await extractGoogleCoords(e.target.result)
664
+        let result = await this.extractGoogleCoords(e.target.result)
999 665
         //Do something with result object here
1000 666
         if (result.markers.length != 0) {
1001 667
           let points = result.markers[0];
@@ -1003,7 +669,7 @@ export default {
1003 669
           this.position.push(points.lat);
1004 670
         } else if (result.polygons.length != 0) {
1005 671
           let polygonCor = result.polygons;
1006
-          let center = calculateCenter(polygonCor);
672
+          let center = this.calculateCenter(polygonCor);
1007 673
           this.position = [];
1008 674
           this.position.push(center.lng);
1009 675
           this.position.push(center.lat);

+ 472
- 359
oa-ui/src/views/file/index.vue Bestand weergeven

@@ -1,17 +1,15 @@
1 1
 <!--
2
- * @Author: wrh
3
- * @Date: 2024-06-06 13:40:02
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-06-07 16:00:36
2
+ * @Author: ysh
3
+ * @Date: 2024-06-21 18:51:49
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-06-28 16:49:32
6 6
 -->
7 7
 <template>
8 8
   <div class="warpper-container">
9 9
     <!-- 地图 -->
10
-    <div class="map-container" id="maps" tabindex="0" ref="maps"></div>
10
+    <div class="map-container" id="maps" tabindex="0"></div>
11 11
     <!-- 鼠标移动坐标 -->
12 12
     <div id="mouse-position"></div>
13
-    <!-- 项目信息弹出框 -->
14
-    <InfoBox :datas="datas" @closePopup="closePopup" @open="openAchiList"></InfoBox>
15 13
     <!-- 工具栏列表 -->
16 14
     <div class="tool-box">
17 15
       <div class="item">
@@ -24,7 +22,7 @@
24 22
           <div class="layers" @click="layersOpen = !layersOpen"></div>
25 23
         </el-tooltip>
26 24
       </div>
27
-      <!-- <div class="item">
25
+      <div class="item">
28 26
         <el-tooltip effect="dark" content="矩形框选" placement="right">
29 27
           <div class="select" @click="rectSelect()"></div>
30 28
         </el-tooltip>
@@ -33,166 +31,233 @@
33 31
         <el-tooltip effect="dark" content="多边形框选" placement="right">
34 32
           <div class="selectM" @click="polygonSelect()"></div>
35 33
         </el-tooltip>
36
-      </div> -->
34
+      </div>
37 35
     </div>
38
-    <!-- 图层显示 -->
39
-    <transition-group appear name="animate__animated animate__bounce" enter-active-class="animate__fadeInLeft"
40
-      leave-active-class="animate__fadeOutLeft">
41
-      <div class="layer-type dialog_wrap" v-if="layersOpen" @mousedown.stop="move">
42
-        <div class="layer-content">
43
-          <div>
44
-            <el-icon class="close" @click="layersOpen = false">
45
-              <CloseBold />
46
-            </el-icon>
47
-          </div>
48
-          <el-tabs v-model="activeName" class="demo-tabs">
49
-            <el-tab-pane label="项目图层" name="first">
50
-              <ProjectLayer :proTree="proTableData"></ProjectLayer>
51
-            </el-tab-pane>
52
-          </el-tabs>
36
+    <!-- 项目信息弹出框 -->
37
+    <div id="popup" class="ol-popup">
38
+      <span id="popup-closer" class="ol-popup-closer" @click="closePopup"></span>
39
+      <div id="popup-content">
40
+        <el-descriptions :column="1" border v-if="clickFeacture.type == 'projectPoint'">
41
+          <el-descriptions-item label="项目编号" width="130px">
42
+            {{ clickFeacture.projectNumber }}
43
+          </el-descriptions-item>
44
+          <el-descriptions-item label="项目名称" width="130px">
45
+            {{ clickFeacture.projectName }}
46
+          </el-descriptions-item>
47
+          <el-descriptions-item label="项目负责人" width="130px">
48
+            {{ getUserName(clickFeacture.projectLeader) }}
49
+          </el-descriptions-item>
50
+          <el-descriptions-item label="存放地址" width="130px">
51
+            {{ clickFeacture.storageAddress == '' || clickFeacture.storageAddress == null ? '暂无' :
52
+            clickFeacture.storageAddress }}
53
+          </el-descriptions-item>
54
+        </el-descriptions>
55
+
56
+        <div v-if="clickFeacture.type == 'featurePoint'">
57
+          <div class="title">项目编号:{{ clickFeacture.projectNumber }}</div>
58
+          <el-descriptions :column="1" border>
59
+            <el-descriptions-item label="名称" width="130px">
60
+              {{ clickFeacture.selectFeatures.values_.name }}
61
+            </el-descriptions-item>
62
+          </el-descriptions>
63
+        </div>
64
+      </div>
65
+      <div class="look-achi" @click="" v-if="clickFeacture.type == 'projectPoint'">成果目录>></div>
66
+    </div>
67
+    <!-- 项目目录 -->
68
+    <div class="right-project" :class="{ closeProBox: isOpenPro }">
69
+      <div class="result-click" @click="isOpenPro = !isOpenPro">
70
+        <i class="el-icon-d-arrow-left" v-if="isOpenPro"></i>
71
+        <i class="el-icon-d-arrow-right" v-if="!isOpenPro"></i>
72
+      </div>
73
+      <div class="right-content">
74
+        <div class="header">项目列表</div>
75
+        <!-- 搜索栏 -->
76
+        <div class="search-box">
77
+          <el-input v-model="searchVal" placeholder="请输入......" @keyup.enter="queryProject">
78
+            <template #prepend>
79
+              <el-select v-model="searchType" placeholder="请选择" style="width: 125px">
80
+                <el-option label="按项目编号" value="1" />
81
+                <el-option label="按项目名称" value="2" />
82
+                <el-option label="按项目类别" value="3" />
83
+              </el-select>
84
+            </template>
85
+            <template #append>
86
+              <el-button icon="el-icon-search" @click="queryProject" />
87
+            </template>
88
+          </el-input>
89
+        </div>
90
+        <el-divider />
91
+        <!-- 项目数据 -->
92
+        <div class="pro-catalogue" v-loading="loading">
93
+          <el-table ref="myTable" :data="projectList" :height="tableHeight" border style="width: 100%;"
94
+            :row-class-name="tableRowClassName" @row-click="handleRowClick">
95
+            <el-table-column type="expand">
96
+              <template slot-scope="props">
97
+                <div class="expand-info">
98
+                  <el-descriptions :column="2">
99
+                    <el-descriptions-item label="存放地址:" class="desLabel" :span="2">
100
+                      {{ props.row.storageAddress == '' || props.row.storageAddress == undefined ? '暂无' :
101
+            props.row.storageAddress
102
+                      }}
103
+                    </el-descriptions-item>
104
+                    <el-descriptions-item label="甲方单位:" class="desLabel" :span="2">{{ props.row.partyA.partyAName == ''
105
+            ? '暂无' :
106
+            props.row.partyA.partyAName
107
+                      }}</el-descriptions-item>
108
+                    <el-descriptions-item label="联系人:" class="desLabel">{{ props.row.contactPerson == '' ? '暂无' :
109
+            props.row.contactPerson
110
+                      }}</el-descriptions-item>
111
+                    <el-descriptions-item label="联系电话:" class="desLabel">{{ props.row.telephone == '' ? '暂无' :
112
+            props.row.telephone
113
+                      }}</el-descriptions-item>
114
+                    <el-descriptions-item label="项目类型:" class="desLabel">{{ props.row.projectType == '' ? '暂无' :
115
+            props.row.projectType
116
+                      }}</el-descriptions-item>
117
+                    <el-descriptions-item label="技术负责人:" class="desLabel">{{ props.row.technicalDirector == '' ? '暂无'
118
+            :
119
+            getUserName(props.row.technicalDirector)
120
+                      }}</el-descriptions-item>
121
+                    <el-descriptions-item label="技术设计人:" class="desLabel">{{ props.row.techinicalDesigner == '' ? '暂无'
122
+            :
123
+            getUserName(props.row.techinicalDesigner)
124
+                      }}</el-descriptions-item>
125
+                    <el-descriptions-item label="承担部门:" class="desLabel">{{ props.row.undertakingSector == '' ? '暂无' :
126
+            props.row.undertakingSector
127
+                      }}</el-descriptions-item>
128
+                    <el-descriptions-item label="质量检察员:" class="desLabel">{{ props.row.qualityInspector == '' ? '暂无' :
129
+            getUserNames(props.row.qualityInspector)
130
+                      }}</el-descriptions-item>
131
+                    <el-descriptions-item label="项目登记时间:" class="desLabel" :span="2">{{ props.row.registrationDate ==
132
+            '' ? '暂无' :
133
+            props.row.registrationDate
134
+                      }}</el-descriptions-item>
135
+                    <el-descriptions-item label="项目登记人:" class="desLabel">{{ props.row.projectRegistrant == '' ? '暂无'
136
+            :
137
+            getUserName(props.row.projectRegistrant)
138
+                      }}</el-descriptions-item>
139
+                    <el-descriptions-item label="进场时间:" class="desLabel">{{ props.row.approachTime == '' ? '暂无' :
140
+            props.row.approachTime
141
+                      }}</el-descriptions-item>
142
+                    <el-descriptions-item label="撤场时间:" class="desLabel">{{ props.row.withdrawalTime == '' ? '暂无' :
143
+            props.row.withdrawalTime
144
+                      }}</el-descriptions-item>
145
+                    <el-descriptions-item label="项目要求完成时间:" class="desLabel">{{ props.row.requiredCompletionDate == ''
146
+            ? '暂无' :
147
+            props.row.requiredCompletionDate
148
+                      }}</el-descriptions-item>
149
+                  </el-descriptions>
150
+                  <div class="look-achi" @click="lookThisAchi(props.row)">
151
+                    查看成果>>
152
+                  </div>
153
+                </div>
154
+              </template>
155
+            </el-table-column>
156
+            <el-table-column label="kml范围" width="95" align="center" :formatter="formatterKmlurl" />
157
+            <el-table-column prop="projectNumber" label="项目编号" width="95" align="center" />
158
+            <el-table-column prop="projectName" label="项目名称" width="180" align="center" />
159
+            <el-table-column prop="projectLeader" label="负责人" align="center">
160
+              <template slot-scope="scope">
161
+                {{ getUserName(scope.row.projectLeader) }}
162
+              </template>
163
+            </el-table-column>
164
+          </el-table>
165
+          <el-pagination @current-change="handleCurrentChange" :current-page.sync="queryParams.pageNum"
166
+            :page-size="queryParams.pageSize" layout="total, prev, pager, next" :total="total">
167
+          </el-pagination>
168
+          <!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
169
+            :limit.sync="queryParams.pageSize" @pagination="getProjectList" /> -->
53 170
         </div>
54 171
       </div>
55
-    </transition-group>
56
-
57
-    <!-- 地图样式 -->
58
-    <div class="switch-map">
59
-      <SwitchMap></SwitchMap>
60 172
     </div>
61 173
   </div>
62 174
 </template>
63
-<script>
64 175
 
65
-import 'ol/ol.css';
176
+<script>
177
+import { Tianditu, ZhongKe, ArcGISBlue, Autonavi, google, terrain, vect } from '@/utils/maps'
178
+import { listProject, getProject } from '@/api/oa/project/project'
179
+import infoBox from './index/infoBox.vue';
180
+// ---------------------------------ol引用------------------------------------------------
181
+import 'ol/ol.css'
66 182
 import { Map, View } from 'ol';
67
-import { XYZ, Cluster, Vector as VectorSource } from 'ol/source';
183
+// import XYZ from 'ol/source/XYZ';
184
+// import VectorSource from 'ol/source/Vector';
185
+import KML from 'ol/format/KML';
68 186
 import Overlay from 'ol/Overlay';
187
+import Feature from 'ol/Feature';
188
+import { toLonLat } from 'ol/proj';
69 189
 import TileLayer from 'ol/layer/Tile';
190
+// import Draw from 'ol/interaction/Draw';
191
+import { createBox } from 'ol/interaction/Draw';
192
+import { Select, DragBox, Draw } from "ol/interaction";
193
+import { platformModifierKeyOnly, never } from 'ol/events/condition';
70 194
 import VectorLayer from 'ol/layer/Vector';
71
-import { MousePosition, defaults as defaultControls } from 'ol/control';
72 195
 import { boundingExtent } from 'ol/extent';
73
-import { createStringXY } from 'ol/coordinate';
74
-import Feature from 'ol/Feature';
75
-import { Point } from 'ol/geom';
76
-import { Circle, Fill, Stroke, Style, Text } from 'ol/style';
77
-import ProjectLayer from './index/projectLayer.vue';
78
-import SwitchMap from './index/switchMap.vue';
79
-import InfoBox from './index/infoBox.vue';
80
-import { listProject } from "@/api/file/project";
81
-import { getAchievementByProject } from "@/api/file/achievement";
82
-
196
+import { Cluster, Vector as VectorSource, XYZ } from 'ol/source';
197
+import { Point, Polygon, MultiPolygon, MultiLineString } from 'ol/geom';
198
+import { toStringXY, createStringXY, toStringHDMS } from 'ol/coordinate';
199
+import { Circle, Fill, Stroke, Style, RegularShape, Icon, Text } from 'ol/style';
200
+import { MousePosition, ScaleLine, defaults as defaultControls } from 'ol/control';
83 201
 export default {
84
-  components: {
85
-    ProjectLayer,
86
-    InfoBox,
87
-    SwitchMap
88
-  },
202
+  components: { infoBox },
89 203
   data() {
90 204
     return {
91
-      map: null,
92
-      clusters: null,
205
+      queryParams: {
206
+        pageNum: 1,
207
+        pageSize: 10
208
+      },
209
+      map: {},
210
+      control: null,
211
+      view: null,
212
+      select: null,
93 213
       popup: null,
94
-      mousePositionControl: null,
95
-      proTableData: [],
96
-      allproTableData: [],
97
-      layersOpen: false,
98
-      achiDialogData: [],
99
-      dialogTableVisible: false,
100
-      dialogTitle: '',
214
+      clusters: null,
101 215
       viewCenter: [105.55, 34.18],
102
-      datas: {
103
-        clickFeacture: {},
216
+      layersOpen: false,
217
+      isOpenPro: false, //项目列表是否展开
218
+      searchVal: '',
219
+      searchType: '',
220
+      projectList: [],
221
+      allproTableData: [],
222
+      total: 0,
223
+      loading: true,
224
+      tableHeight: 0,
225
+      clickFeacture: {},
226
+      clickDatas: {
104 227
         selectFeatures: null,
105 228
         selectProjectNumber: "",
106 229
         type: '',
107
-        infoData: {}
108
-      },
109
-      tileLayers: [
110
-        new TileLayer({
111
-          source: new XYZ({
112
-            url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"
113
-          }),
114
-          properties: {
115
-            name: '高德'
116
-          },
117
-          visible: true
118
-        }),
119
-        new TileLayer({
120
-          source: new XYZ({
121
-            url: "https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s,m&gl=CN&x={x}&y={y}&z={z}"
122
-          }),
123
-          properties: {
124
-            name: '谷歌'
125
-          },
126
-          visible: false
127
-        }),
128
-        new TileLayer({
129
-          source: new XYZ({
130
-            url: "http://t4.tianditu.com/DataServer?T=ter_c&tk=4d02670f819130ba862ebc24a1aebaf3&x={x}&y={y}&l={z}"
131
-          }),
132
-          properties: {
133
-            name: '天地图地形'
134
-          },
135
-          visible: false
136
-        }),
137
-        new TileLayer({
138
-          source: new XYZ({
139
-            url: "http://t4.tianditu.com/DataServer?T=vec_w&tk=81b9a9cf3e4be1df181e7bf54c5949fc&x={x}&y={y}&l={z}"
140
-          }),
141
-          properties: {
142
-            name: '矢量图'
143
-          },
144
-          visible: false
145
-        }),
146
-        new TileLayer({
147
-          source: new XYZ({
148
-            url: 'http://t4.tianditu.com/DataServer?T=img_w&tk=4d02670f819130ba862ebc24a1aebaf3&x={x}&y={y}&l={z}'
149
-          }),
150
-          properties: {
151
-            name: '天地图'
152
-          },
153
-          visible: false
154
-        }),
155
-        new TileLayer({
156
-          source: new XYZ({
157
-            url: "https://tiles1.geovisearth.com/base/v1/img/{z}/{x}/{y}?format=webp&tmsIds=w&token=9b56a7bcb2f51c939753bc066fa6d0e7b7f55cfbf1939fa9e04f53050f4154b9"
158
-          }),
159
-          properties: {
160
-            name: '中科星图'
161
-          },
162
-          visible: false
163
-        }),
164
-        new TileLayer({
165
-          source: new XYZ({
166
-            url: "https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}"
167
-          }),
168
-          properties: {
169
-            name: 'ArcGIS'
170
-          },
171
-          visible: false
172
-        })
173
-      ],
174
-    };
175
-  },
176
-  watch: {
177
-    map: function (newval, oldval) {
178
-      console.log(oldval);
179
-      console.log(newval);
230
+      }
180 231
     }
181 232
   },
182 233
   mounted() {
183
-  },
184
-  created() {
234
+    this.setTableDomHeight();
185 235
     this.initMap();
186
-    this.getProTableData()
236
+    this.getProjectList();
187 237
   },
188 238
   methods: {
239
+    setTableDomHeight() {
240
+      let dom = document.querySelector('.right-project');
241
+      dom.style.height = window.innerHeight - 110 + 'px'; //减去110为页头的高度
242
+      let height = dom.offsetHeight - 28 + 25 - 179 //表格的高度,减去表头179,边距25,以及页码28
243
+      this.resetHeight().then(() => {
244
+        this.tableHeight = height
245
+      })
246
+    },
247
+    resetHeight() {
248
+      return new Promise((resolve, rehect) => {
249
+        this.tableHeight = 0;
250
+        resolve()
251
+      })
252
+    },
189 253
     initMap() {
190
-      const mousePositionControl = new MousePosition({
191
-        coordinateFormat: createStringXY(4),
192
-        projection: 'EPSG:4326',
193
-        className: 'custom-mouse-position',
194
-        target: document.getElementById('mouse-position'),
195
-      });
254
+      this.view = new View({
255
+        projection: "EPSG:4326", // 坐标系,有EPSG:4326和EPSG:3857
256
+        center: this.viewCenter, // 中心点
257
+        zoom: 5, // // 地图缩放级别(打开页面时默认级别)
258
+        maxZoom: 20,
259
+        minZoom: 1,  // 地图缩放最小级别
260
+      })
196 261
       this.popup = new Overlay({
197 262
         element: document.getElementById('popup'),
198 263
         autoPan: {
@@ -200,75 +265,142 @@ export default {
200 265
             duration: 250,
201 266
           },
202 267
         },
268
+      })
269
+      this.control = new MousePosition({
270
+        coordinateFormat: this.formatCoordinate(4),
271
+        projection: 'EPSG:4326',
272
+        className: 'custom-mouse-position',
273
+        target: document.getElementById('mouse-position'),
203 274
       });
204
-      this.popup.setPosition(undefined);
205 275
       this.map = new Map({
206
-        target: document.getElementById('maps'),
207
-        controls: defaultControls().extend([mousePositionControl]),
208
-        overlays: [this.popup],
209
-        layers: this.tileLayers,
210
-        view: new View({
211
-          projection: "EPSG:4326", // 坐标系,有EPSG:4326和EPSG:3857
212
-          center: this.viewCenters, // 中心点
213
-          // zoom: 5, // // 地图缩放级别(打开页面时默认级别)
214
-          // maxZoom: 20,
215
-          // minZoom: 1,  // 地图缩放最小级别
216
-        })
217
-      });
276
+        target: 'maps',
277
+        controls: defaultControls().extend([this.control]),
278
+        layers: [
279
+          Autonavi,
280
+          new TileLayer({//标注
281
+            source: new XYZ({
282
+              url: "http://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8",
283
+            }),
284
+            properties: {
285
+              name: '标注'
286
+            },
287
+          }),
288
+        ],
289
+        view: this.view,
290
+      })
291
+      this.map.addOverlay(this.popup);
292
+      this.mapClick(this.map, this.popup);
218 293
     },
219
-    getProTableData() {
220
-      let param = {
221
-        pageNum: 1,
222
-        pageSize: 10000,
223
-      }
224
-      listProject(param).then(res => {
225
-        let data = res.rows;
226
-        let features = [];
227
-        let datas = [];
228
-        for (let d of data) {
229
-          if (d.kmlLat && d.kmlLng) {
230
-            let f = new Feature(new Point([Number(d.kmlLng), Number(d.kmlLat)]));
231
-            f.name = d.projectNumber;
232
-            features.push(f);
233
-            datas.push(d);
234
-          }
235
-        }
236
-        this.proTableData = datas;
237
-        this.allproTableData = datas;
238
-        let source = new VectorSource({
239
-          features: features,
240
-        });
241
-        let clusterSource = new Cluster({
242
-          distance: 100,     //群集之间的最小距离(以像素为单位)。
243
-          source: source,	   //数据源
294
+    mapClick(map, popup) {
295
+      let that = this;
296
+      map.on('singleclick', function (evt) {
297
+        const coordinate = evt.coordinate;
298
+        let features = map.forEachFeatureAtPixel(evt.pixel, (feature) => {
299
+          return feature;
244 300
         });
245
-        this.clusters = new VectorLayer({
246
-          name: 'clusters',
247
-          source: clusterSource,
248
-          style: this.clusterStyle(features,),
249
-          zIndex: 99
250
-        })
251
-        this.map.addLayer(this.clusters);
252
-        this.map.on('click', (e) => {
253
-          this.clusters.getFeatures(e.pixel).then((clickedFeatures) => {
254
-            if (clickedFeatures.length) {
255
-              // Get clustered Coordinates
256
-              const features = clickedFeatures[0].get('features');
257
-              if (features.length > 1) {
258
-                const extent = boundingExtent(
259
-                  features.map((r) => r.getGeometry().getCoordinates())
260
-                );
261
-                this.map.getView().fit(extent, { duration: 1000, padding: [100, 100, 100, 100] });
301
+        if (features != undefined && features != null && features != "") {
302
+          let feature = features.values_.features;
303
+          if (feature.length == 1) {
304
+            let num = feature[0].name
305
+            let projectId = feature[0].projectId
306
+            getProject(projectId).then(res => {
307
+              if (res.data) {
308
+                that.clickFeacture = res.data;
309
+                that.clickFeacture.type = 'projectPoint';
310
+                console.log(that.clickFeacture);
311
+                popup.setPosition(coordinate);
262 312
               }
263
-            }
264
-          });
265
-        });
313
+            })
314
+          } else {
315
+            popup.setPosition(undefined);
316
+          }
317
+        } else {
318
+          popup.setPosition(undefined);
319
+        }
266 320
       })
267 321
     },
322
+    /* 关闭信息框 */
323
+    closePopup() {
324
+      this.popup.setPosition(undefined);
325
+    },
326
+    openAchiList() {
268 327
 
328
+    },
329
+    formatCoordinate(fractionDigits) {
330
+      return (
331
+        /**
332
+         * @param {Coordinate} coordinate Coordinate.
333
+         * @return {string} String XY.
334
+         */
335
+        function (coordinate) {
336
+          return '经纬度:' + toStringXY(coordinate, fractionDigits);
337
+        }
338
+      );
339
+    },
340
+    resetView() {
341
+      this.map.getView().setCenter(this.viewCenter);
342
+      this.map.getView().setZoom(5)
343
+    },
344
+    rectSelect() {
345
+
346
+    },
347
+    polygonSelect() {
348
+
349
+    },
350
+    getProjectList() {
351
+      this.loading = true
352
+      listProject(this.queryParams).then(res => {
353
+        let data = res.rows;
354
+        this.total = res.total;
355
+        this.projectList = data;
356
+        this.allproTableData = data;
357
+        this.loading = false
358
+        this.addProjectCluster(data);
359
+      })
360
+    },
361
+    /* 格式化表格显示 */
362
+    formatterKmlurl(row, cloumn) {
363
+      if (row.projectKml == "" || row.projectKml == null) {
364
+        return "无";
365
+      } else {
366
+        return "有";
367
+      }
368
+    },
369
+    // 添加项目点在地图上
370
+    addProjectCluster(data) {
371
+      let features = [], projectPoints = []
372
+      for (let d of data) {
373
+        if (d.kmlLat && d.kmlLng) {
374
+          let f = new Feature(new Point([Number(d.kmlLng), Number(d.kmlLat)]));
375
+          f.name = d.projectNumber;
376
+          f.projectId = d.projectId;
377
+          features.push(f);
378
+          projectPoints.push(d);
379
+        }
380
+      }
381
+      let source = new VectorSource({
382
+        features: features,
383
+      });
384
+      let clusterSource = new Cluster({
385
+        distance: 100,     //群集之间的最小距离(以像素为单位)。
386
+        source: source,	   //数据源
387
+      });
388
+      this.clusters = new VectorLayer({
389
+        name: 'clusters',
390
+        source: clusterSource,
391
+        style: this.clusterStyle,
392
+        zIndex: 99
393
+      })
394
+      this.map.addLayer(this.clusters);
395
+    },
396
+    handleCurrentChange(val) {
397
+      this.queryParams.pageNum = val
398
+      this.getProjectList()
399
+    },
400
+    /* 得到项目的点位绘制到地图上 */
269 401
     clusterStyle(feature, resolution) {
270 402
       let styleCache = {};
271
-      const size = feature.length;
403
+      const size = feature.get('features').length;
272 404
       let style = styleCache[size];
273 405
       if (!style) {
274 406
         style = [
@@ -324,7 +456,7 @@ export default {
324 456
       return style;
325 457
     },
326 458
     getText(feature, resolution) {
327
-      let features = feature;
459
+      let features = feature.values_.features;
328 460
       let reo = resolution * 100;
329 461
       let text;
330 462
       if (reo > 2) {
@@ -336,45 +468,50 @@ export default {
336 468
       }
337 469
       return text;
338 470
     },
339
-    closePopup() {
340
-      this.popup.setPosition(undefined);
341
-    },
342
-    openAchiList() {
343
-      this.dialogTableVisible = true;
344
-      let projectId = this.datas.clickFeacture.id;
345
-      this.dialogTitle = this.datas.clickFeacture.projectNumber
346
-      getAchievementByProject({ projectId }).then(res => {
347
-        if (res.data.length == 0) {
348
-          this.$message.error('暂无成果,请添加!');
349
-          this.achiDialogData = [];
350
-        } else {
351
-          this.dialogTableVisible = true;
352
-          this.achiDialogData = res.data;
471
+    queryProject() {
472
+      let type = this.searchType;
473
+      let param;
474
+      if (type == "1") {
475
+        param = {
476
+          pageNum: 1,
477
+          pageSize: 9999999,
478
+          projectNumber: this.searchVal
479
+        }
480
+      } else if (type == "2") {
481
+        param = {
482
+          pageNum: 1,
483
+          pageSize: 9999999,
484
+          projectName: this.searchVal
485
+        }
486
+      } else if (type == "3") {
487
+        param = {
488
+          pageNum: 1,
489
+          pageSize: 9999999,
490
+          projectType: this.searchVal
491
+        }
492
+      }
493
+      listProject(param).then(res => {
494
+        let data = res.rows;
495
+        let datas = [];
496
+        for (let d of data) {
497
+          if (d.kmlLat && d.kmlLng) {
498
+            datas.push(d);
499
+          }
353 500
         }
501
+        this.projectList = data;
354 502
       })
355 503
     },
504
+    tableRowClassName() {
505
+
506
+    },
507
+    handleRowClick() {
356 508
 
357
-    // 视角复位
358
-    resetView() {
359
-      this.map.getView().setCenter(this.viewCenter);
360
-      this.map.getView().setZoom(5)
361 509
     }
362 510
   },
363
-};
364
-</script>
365
-<style lang="scss" scoped>
366
-:deep(.el-descriptions__label) {
367
-  font-weight: bold;
368
-}
369
-
370
-:deep(.el-checkbox__label) {
371
-  color: #fff;
372
-}
373
-
374
-:deep(.el-dialog) {
375
-  margin-top: 10vh !important;
376 511
 }
512
+</script>
377 513
 
514
+<style lang="scss" scoped>
378 515
 .warpper-container {
379 516
   position: relative;
380 517
 }
@@ -384,48 +521,74 @@ export default {
384 521
   height: calc(100vh - 84px);
385 522
 }
386 523
 
387
-.layer-type {
524
+/* 鼠标移动,坐标样式 */
525
+#mouse-position {
526
+  width: 220px;
527
+  height: 40px;
528
+  line-height: 40px;
388 529
   position: absolute;
389
-  top: 67px;
390
-  left: 53px;
391
-  width: 250px;
392
-  padding: 12px 10px;
393
-  background-color: #fff;
530
+  top: 0px;
531
+  left: 50%;
532
+  transform: translate(-50%, 0%);
533
+  padding-left: 15px;
534
+  color: #fff;
535
+}
536
+
537
+.tool-box {
538
+  position: absolute;
539
+  top: 60px;
540
+  left: 8px;
541
+  width: 50px;
394 542
   border-radius: 5px;
395
-  cursor: move;
543
+  // background-color: #fff;
396 544
 
397
-  .title {
398
-    font-size: 16px;
399
-    text-align: center;
400
-    line-height: 45px;
545
+  .item {
546
+    margin-top: 10px;
547
+    width: 40px;
548
+    height: 40px;
549
+    padding: 6px;
550
+    background-color: rgba($color: #000000, $alpha: 0.5);
551
+    border-radius: 50%;
552
+    cursor: pointer;
401 553
   }
402 554
 
403
-  .layer-content {
404
-    cursor: default;
405
-    position: relative;
555
+  .view {
556
+    width: 100%;
557
+    height: 100%;
558
+    background: url('~@/assets/images/gis/home.png') no-repeat;
559
+    background-size: contain;
560
+  }
406 561
 
407
-    .close {
408
-      position: absolute;
409
-      top: 0px;
410
-      right: 2px;
411
-      z-index: 12;
412
-    }
562
+  .layers {
563
+    width: 100%;
564
+    height: 100%;
565
+    background: url('~@/assets/images/gis/layers.png') no-repeat;
566
+    background-size: contain;
567
+  }
413 568
 
414
-    .close:hover {
415
-      color: #409EFF;
416
-      cursor: pointer;
417
-    }
569
+  .select {
570
+    width: 100%;
571
+    height: 100%;
572
+    background: url('~@/assets/images/gis/select.png') no-repeat;
573
+    background-size: contain;
574
+  }
575
+
576
+  .selectM {
577
+    width: 100%;
578
+    height: 100%;
579
+    background: url('~@/assets/images/gis/selectM.png') no-repeat;
580
+    background-size: contain;
418 581
   }
419 582
 }
420 583
 
421 584
 .right-project {
422
-  width: v-bind('theme.width');
423
-  min-height: 800px;
585
+  width: 500px;
586
+  // min-height: 600px;
424 587
   max-height: calc(100vh - 110px);
425 588
   padding: 10px;
426 589
   position: absolute;
427 590
   top: 10px;
428
-  right: v-bind('theme.right');
591
+  right: 0;
429 592
   background-color: #fff;
430 593
   box-shadow: v-bind(--el - box - shadow - dark);
431 594
   transition: all 0.6s ease-in-out;
@@ -474,128 +637,78 @@ export default {
474 637
   }
475 638
 }
476 639
 
477
-.achi-list {
478
-  width: 425px;
479
-  min-height: 300px;
480
-  background-color: #fff;
481
-  position: absolute;
482
-  top: 55px;
483
-  right: 520px;
484
-  padding: 10px;
485
-  border-radius: 4px;
486
-  box-shadow: 0 0 10px rgba($color: #000000, $alpha: 0.5);
487
-  cursor: move;
488
-
489
-  .achi-content {
490
-    cursor: default;
491
-  }
492
-
493
-  .achi-projectNumber {
494
-    padding-left: 20px;
495
-    font-size: 14px;
496
-    font-family: '微软雅黑';
497
-  }
498
-
499
-  .achi-header {
500
-    text-align: center;
501
-    line-height: 40px;
502
-    font-weight: bold;
503
-    font-family: '黑体';
504
-    position: relative;
505
-
506
-    .close {
507
-      position: absolute;
508
-      right: 20px;
509
-      top: 10px;
510
-    }
511
-
512
-    .close:hover {
513
-      color: #409EFF;
514
-      cursor: pointer;
515
-    }
516
-  }
640
+.closeProBox {
641
+  right: -500px;
517 642
 }
518 643
 
519
-.tool-box {
644
+// 弹出框
645
+.ol-popup {
520 646
   position: absolute;
521
-  top: 60px;
522
-  left: 8px;
523
-  width: 50px;
524
-  border-radius: 5px;
525
-  // background-color: #fff;
647
+  background-color: #fff;
648
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
649
+  padding: 25px;
650
+  border-radius: 10px;
651
+  // border: 1px solid #cccccc;
652
+  bottom: 17px;
653
+  left: -220px;
654
+  min-width: 461px;
655
+
656
+  .ol-popup-closer {
657
+    text-decoration: none;
658
+    position: absolute;
659
+    top: 2px;
660
+    right: 8px;
661
+  }
526 662
 
527
-  .item {
528
-    margin-top: 10px;
529
-    width: 40px;
530
-    height: 40px;
531
-    padding: 6px;
532
-    background-color: rgba($color: #000000, $alpha: 0.5);
533
-    border-radius: 50%;
663
+  .ol-popup-closer:after {
664
+    content: "✖";
534 665
     cursor: pointer;
535 666
   }
536 667
 
537
-  .view {
538
-    width: 100%;
539
-    height: 100%;
540
-    background: url('../../assets/images/gis/home.png') no-repeat;
541
-    background-size: contain;
668
+  .ol-popup-closer:hover:after {
669
+    color: #409EFF;
542 670
   }
543 671
 
544
-  .layers {
545
-    width: 100%;
546
-    height: 100%;
547
-    background: url('../../assets/images/gis/layers.png') no-repeat;
548
-    background-size: contain;
549
-  }
550 672
 
551
-  .select {
552
-    width: 100%;
553
-    height: 100%;
554
-    background: url('../../assets/images/gis/select.png') no-repeat;
555
-    background-size: contain;
673
+  .look-achi {
674
+    text-align: right;
675
+    color: #409EFF;
676
+    cursor: pointer;
677
+    font-size: 14px;
678
+    margin-top: 10px;
679
+    font-family: '微软雅黑';
556 680
   }
557 681
 
558
-  .selectM {
559
-    width: 100%;
560
-    height: 100%;
561
-    background: url('../../assets/images/gis/selectM.png') no-repeat;
562
-    background-size: contain;
682
+  .title {
683
+    font-size: 14px;
684
+    font-family: 'Times New Roman', '黑体', Times, serif, ;
563 685
   }
564 686
 }
565 687
 
566
-.projectpoint-switch {
688
+.ol-popup:after,
689
+.ol-popup:before {
690
+  top: 100%;
691
+  border: solid transparent;
692
+  content: " ";
693
+  height: 0;
694
+  width: 0;
567 695
   position: absolute;
568
-  top: 10px;
569
-  left: 60px;
570
-  width: 100px;
571
-  height: 50px;
572
-  color: #fff;
696
+  pointer-events: none;
573 697
 }
574 698
 
575
-.alter-position {
576
-  width: 470px;
577
-  position: absolute;
699
+.ol-popup:after {
700
+  border-top-color: #fff;
701
+  border-width: 10px;
578 702
   left: 50%;
579
-  top: 10px;
580 703
   transform: translate(-50%, 0);
704
+  margin-left: -10px;
581 705
 }
582 706
 
583
-.switch-map {
584
-  position: absolute;
585
-  bottom: 0;
586
-  left: 0;
587
-}
588
-
589
-/* 鼠标移动,坐标样式 */
590
-#mouse-position {
591
-  width: 220px;
592
-  height: 40px;
593
-  line-height: 40px;
594
-  position: absolute;
595
-  top: 0px;
707
+.ol-popup:before {
708
+  border-top-color: #fff;
709
+  border-width: 11px;
596 710
   left: 50%;
597
-  transform: translate(-50%, 0%);
598
-  padding-left: 15px;
599
-  color: #fff;
711
+  transform: translate(-50%, 0);
712
+  margin-left: -11px;
600 713
 }
601 714
 </style>

+ 38
- 32
oa-ui/src/views/file/index/infoBox.vue Bestand weergeven

@@ -3,41 +3,39 @@
3 3
  * @version: 
4 4
  * @Author: ysh
5 5
  * @Date: 2022-11-22 11:41:47
6
- * @LastEditors: wrh
7
- * @LastEditTime: 2024-06-07 13:43:54
6
+ * @LastEditors: Please set LastEditors
7
+ * @LastEditTime: 2024-06-28 16:04:26
8 8
 -->
9 9
 <template>
10
-  <div>
11
-    <div id="popup" class="ol-popup">
12
-      <span id="popup-closer" class="ol-popup-closer" @click="$emit('closePopup')"></span>
13
-      <div id="popup-content">
14
-        <el-descriptions :column="1" border v-if="datas.type == 'projectPoint'">
15
-          <el-descriptions-item label="项目编号" width="130px">
16
-            {{ datas.clickFeacture.projectNumber }}
17
-          </el-descriptions-item>
18
-          <el-descriptions-item label="项目名称" width="130px">
19
-            {{ datas.clickFeacture.projectName }}
20
-          </el-descriptions-item>
21
-          <el-descriptions-item label="项目负责人" width="130px">
22
-            {{ datas.clickFeacture.projectLeader }}
23
-          </el-descriptions-item>
24
-          <el-descriptions-item label="存放地址" width="130px">
25
-            {{ datas.clickFeacture.storageAddress == '' || datas.clickFeacture.storageAddress == null ? '暂无' :
26
-              datas.clickFeacture.storageAddress }}
10
+  <div id="popup" class="ol-popup">
11
+    <span id="popup-closer" class="ol-popup-closer" @click="$emit('closePopup')"></span>
12
+    <div id="popup-content">
13
+      <el-descriptions :column="1" border v-if="datas.type == 'projectPoint'">
14
+        <el-descriptions-item label="项目编号" width="130px">
15
+          {{ datas.projectNumber }}
16
+        </el-descriptions-item>
17
+        <el-descriptions-item label="项目名称" width="130px">
18
+          {{ datas.projectName }}
19
+        </el-descriptions-item>
20
+        <el-descriptions-item label="项目负责人" width="130px">
21
+          {{ datas.projectLeader }}
22
+        </el-descriptions-item>
23
+        <el-descriptions-item label="存放地址" width="130px">
24
+          {{ datas.storageAddress == '' || datas.storageAddress == null ? '暂无' :
25
+      datas.storageAddress }}
26
+        </el-descriptions-item>
27
+      </el-descriptions>
28
+
29
+      <div v-if="datas.type == 'featurePoint'">
30
+        <div class="title">项目编号:{{ datas.projectNumber }}</div>
31
+        <el-descriptions :column="1" border>
32
+          <el-descriptions-item label="名称" width="130px">
33
+            {{ datas.selectFeatures.values_.name }}
27 34
           </el-descriptions-item>
28 35
         </el-descriptions>
29
-
30
-        <div v-if="datas.type == 'featurePoint'">
31
-          <div class="title">项目编号:{{ datas.selectProjectNumber }}</div>
32
-          <el-descriptions :column="1" border>
33
-            <el-descriptions-item label="名称" width="130px">
34
-              {{ datas.selectFeatures.values_.name }}
35
-            </el-descriptions-item>
36
-          </el-descriptions>
37
-        </div>
38 36
       </div>
39
-      <div class="look-achi" @click="$emit('open')" v-if="datas.type == 'projectPoint'">成果目录>></div>
40 37
     </div>
38
+    <div class="look-achi" @click="$emit('open')" v-if="datas.type == 'projectPoint'">成果目录>></div>
41 39
   </div>
42 40
 </template>
43 41
 
@@ -45,7 +43,7 @@
45 43
 
46 44
 
47 45
 export default {
48
-  props:{
46
+  props: {
49 47
     datas: {
50 48
       type: Object,
51 49
       required: true
@@ -55,6 +53,14 @@ export default {
55 53
     return {
56 54
     };
57 55
   },
56
+  watch: {
57
+    'datas.type'(val){
58
+      console.log(val);
59
+    }
60
+  },
61
+  mounted() {
62
+    console.log(this.datas);
63
+  },
58 64
   methods: {},
59 65
 }
60 66
 
@@ -128,8 +134,8 @@ export default {
128 134
   font-family: '微软雅黑';
129 135
 }
130 136
 
131
-.title{
137
+.title {
132 138
   font-size: 14px;
133
-  font-family:'Times New Roman','黑体', Times, serif,;
139
+  font-family: 'Times New Roman', '黑体', Times, serif, ;
134 140
 }
135 141
 </style>

+ 2
- 2
oa-ui/src/views/flowable/form/budget/components/choosePeople.vue Bestand weergeven

@@ -30,12 +30,12 @@
30 30
           {{ scope.row.sex == 0 ? '男' : '女' }}
31 31
         </template>
32 32
       </el-table-column>
33
-      <el-table-column label="岗级" align="center" key="postLevel" :show-overflow-tooltip="true">
33
+      <!-- <el-table-column label="岗级" align="center" key="postLevel" :show-overflow-tooltip="true">
34 34
         <template slot-scope="scope">
35 35
           {{ formatLevel(scope.row.postLevel, scope.row.salaryLevel,
36 36
             dict.type.sys_user_postlevel, dict.type.sys_user_salarylevel) }}
37 37
         </template>
38
-      </el-table-column>
38
+      </el-table-column> -->
39 39
     </el-table>
40 40
     <div style="text-align: right;">
41 41
       <el-pagination @current-change="getList" :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize"

+ 12
- 7
oa-ui/src/views/flowable/form/projectProcess/technicalTab.vue Bestand weergeven

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-04-19 15:32:00
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-19 17:36:00
5
+ * @LastEditTime: 2024-06-26 11:24:27
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -182,6 +182,9 @@ export default {
182 182
       rules: {},
183 183
       userList: [],
184 184
     };
185
+  },
186
+  created() {
187
+
185 188
   },
186 189
   mounted() {
187 190
     this.initForm();
@@ -197,6 +200,8 @@ export default {
197 200
         const technicalRes = await getTechnical(this.taskForm.formId);
198 201
         if (technicalRes.data) {
199 202
           this.haveTechnical = true;
203
+          let qualityInspector = this.processQualityInspector(technicalRes.data)
204
+          technicalRes.data.qualityInspector = qualityInspector
200 205
           this.form = technicalRes.data;
201 206
           if (!this.projectNumber || !this.projectName) {
202 207
             // 仅在需要时调用getProject  
@@ -206,23 +211,21 @@ export default {
206 211
               this.$set(this.form, "projectName", projectRes.data.projectName);
207 212
             }
208 213
           }
209
-          this.processQualityInspector(this.form);
210 214
         }
211 215
       } catch (error) {
212 216
       }
213 217
     },
214 218
     processQualityInspector(form) {
215 219
       if (Array.isArray(form.qualityInspector)) {
216
-        // 如果已经是数组,则不需要进一步处理  
217
-        // 除非你想将数组中的字符串元素转换为整数  
218
-        // 例如:form.qualityInspector = form.qualityInspector.map(inspector => parseInt(inspector, 10));  
219 220
       } else if (typeof form.qualityInspector === 'string') {
220 221
         // 如果是一个字符串,则按逗号分割并转换为整数数组  
221 222
         const qualityInspectorArr = form.qualityInspector.split(',').map(inspector => parseInt(inspector, 10));
222
-        this.$set(form, "qualityInspector", qualityInspectorArr);
223
+        return qualityInspectorArr
224
+        // this.$set(form, "qualityInspector", qualityInspectorArr);
223 225
       } else if (form.qualityInspector === null || form.qualityInspector === undefined || form.qualityInspector === '') {
224 226
         // 如果为空、null或undefined,则设置为空数组  
225
-        this.$set(form, "qualityInspector", []);
227
+        // this.$set(form, "qualityInspector", []);
228
+        return []
226 229
       }
227 230
     },
228 231
     // 查询用户列表
@@ -242,6 +245,8 @@ export default {
242 245
 </script>
243 246
 
244 247
 <style lang="scss" scoped>
248
+@import "@/assets/styles/element-reset.scss";
249
+
245 250
 ::v-deep .el-input.is-disabled .el-input__inner {
246 251
   color: #686a6e;
247 252
 }

Laden…
Annuleren
Opslaan