1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
<template>
<div class="auditMap">
<div>
<div class="head_boxtwo" v-show="this.$route.query.isTitle != 0">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/indexPage'}">首页</el-breadcrumb-item>
<el-breadcrumb-item>待办事件</el-breadcrumb-item>
</el-breadcrumb>
<div class="myBox">
<div class="headLeft"><h4>待办事件</h4></div>
<div class="headRight">
<el-row>
<el-button class="addButton" type="text" @click="rejectMsg" v-if="rejectShow">驳回</el-button>
<el-button class="addButton a" type="primary" @click="handleBtnChange($event)">{{appro}}</el-button>
</el-row>
</div>
</div>
<div class="myMsg">
<div class="msgLift">
<el-col :span="9">
<div class="mymsgTOP"> <span class="myColor">创建人:</span><span>{{myName}}</span></div>
<div><span class="myColor">创建时间:</span><span>{{craetionTime | formatDate}}</span></div>
</el-col>
<el-col :span="9">
<div class="mymsgTOP"> <span class="myColor">修改人:</span><span>{{hisName}}</span></div>
<div><span class="myColor">修改时间:</span><span>{{modifiTime | formatDate}}</span></div>
</el-col>
<el-col :span="6" v-if="!rejectShow">
<div><span class="myColor">驳回原因:</span><span>{{rejectReason}}</span></div>
</el-col>
</div>
<div class="msgRight">
<div>状态</div>
<div class="msgRight_top">{{stateNow}}</div>
</div>
</div>
</div>
<div class="head_boxtwo" v-show="this.$route.query.isTitle == 0">
<el-breadcrumb separator="/">
<el-breadcrumb-item >内容管理</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/serviceDirectoryPage'}">网点服务地图</el-breadcrumb-item>
<el-breadcrumb-item>详情</el-breadcrumb-item>
</el-breadcrumb>
<div class="headLeft"><h4>详情</h4></div>
<div class="myMsg">
<div class="msgLift">
<el-col :span="9">
<div class="mymsgTOP"> <span class="myColor">创建人:</span><span>{{myName}}</span></div>
<div><span class="myColor">创建时间:</span><span>{{craetionTime | formatDate}}</span></div>
</el-col>
<el-col :span="9">
<div class="mymsgTOP"> <span class="myColor">修改人:</span><span>{{hisName}}</span></div>
<div><span class="myColor">修改时间:</span><span>{{modifiTime | formatDate}}</span></div>
</el-col>
<el-col :span="6" v-if="!rejectShow">
<div><span class="myColor">驳回原因:</span><span>{{rejectReason}}</span></div>
</el-col>
</div>
</div>
</div>
<div class="content_boxtwo">
<div class="form_box h778px">
<div class="myWord">信息</div>
<div class="myOnly">
<div class="myonlyFirst">
<div><span class="myColor">网点名称:</span><span>{{activity}}</span></div>
</div>
<div class="myonlyThird" v-show="this.$route.query.isTitle != 0"><span class="myColor">类别:</span><span>{{category}}</span></div>
</div>
<div class="line"></div>
<div class="myWord">
<div class="mymap">
<div class="map_content_left">
<div class="scrool">
<div>
<el-table :data="hotSpotList" stripe style="width: 300px; height:calc(100% - 50px)"
@dblclick="toggleSelection(props.row,feature)">
<el-table-column prop="name" label="热点名称"></el-table-column>
<el-table-column label="操作" header-align="center" align="center">
<template slot-scope="scope">
<el-button-group>
<el-button title="定位" size="mini" type="text" @click="setMapCenterByFeature(scope.row)">定位</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<div class="map_content_right">
<div id="map"></div>
<div id="popup" class="ol-popup portlet box">
<div class="portlet-title">
<div class="caption">
<i class="icon icon-info-20"></i>
<span class="caption-subject" v-show="hotSpot.type == POINT_TYPE">热点</span>
<span class="caption-subject" v-show="hotSpot.type == POLYGON_TYPE">热区</span>
</div>
<div class="actions">
<a href="#" id="popup-closer" class="ol-popup-closer"></a>
</div>
</div>
<div id="popup-content">
<el-row>
<el-form ref="form" :model="form" label-width="90px">
<el-col :span="24">
<el-form-item label="热点名称" v-show="hotSpot.type == POINT_TYPE" prop="name">
<el-input placeholder="请输入热点名称" size="mini" v-model="hotSpot.name" class="hotSpotNum"></el-input>
</el-form-item>
<el-form-item label="热区名称" v-show="hotSpot.type == POLYGON_TYPE" prop="name">
<el-input placeholder="请输入热区名称" size="mini" v-model="hotSpot.name" class="hotSpotNum"></el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="热区说明" v-show="hotSpot.type == POLYGON_TYPE">
<el-input size="mini" type="textarea" :rows="2" placeholder="请输入对该热区的描述" v-model="hotSpot.note"></el-input>
</el-form-item>
<el-form-item label="上传图标" v-show="hotSpot.type == POINT_TYPE" >
<el-upload class="avatar-uploader" name="headMap" style="height: 70px" action="" :show-file-list="false"
:http-request="addPointImage"
accept="image/gif, image/jpeg, image/png">
<img v-if="hotSpot.imageUrl" :src="hotSpot.imageUrl" class="avatar" style="width: 70px;height: 70px">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {ColorChange} from '../../js/front/colorChange';
import {createMap} from '../../js/front/map';
import {startDataClass} from '../../js/front/getData';
import {startDraw} from '../../js/front/drawFeature';
import {FeatureStyle} from '../../js/front/FeatureStyle'
import {ChangeBaseLayer} from '../../js/front/ChangeBaseLayer';
import {Measure} from '../../js/tools/Measure';
let mapControl;
let maoObj;
let drawFeatureObj;
let editFeatureStyle;
let changeBaseLayer;
let measure;
export default {
data() {
return {
appro: "",
status: "",
rejectReason: '',
rejectShow: true,
myName: '',
hisName: '',
craetionTime: '',
modifiTime: '',
stateNow: '',
blank: '',
category: '',
process: '',
activity: '',
hotSpot: {
id: null,
type: "",// 1 ,2点还是面
bankBranchId: null,
name: "",
note: "",
coordinate: "",
width: "",
height: "",
rotationAngle: "",
imageUrl: "" //图标地址
},
tempImageLayer: null,
POINT_TYPE: 'Point',
POLYGON_TYPE: 'Polygon',
hotSpotList: [],
form: {
id: null,
name: "",
imageUrl: '',
width: '',
height: '',
bankQrCode: '',
},
}
},
filters: {
formatDate: function (value) {
let date = new Date(value);
let y = date.getFullYear();
let MM = date.getMonth() + 1;
MM = MM < 10 ? ('0' + MM) : MM;
let d = date.getDate();
d = d < 10 ? ('0' + d) : d;
let h = date.getHours();
h = h < 10 ? ('0' + h) : h;
let m = date.getMinutes();
m = m < 10 ? ('0' + m) : m;
let s = date.getSeconds();
s = s < 10 ? ('0' + s) : s;
return y + '-' + MM + '-' + d;
}
},
computed: {},
mounted() {
this.init();
},
components: {},
methods: {
init() {
let vm = this;
this.auditEdit();
let colorChange = ColorChange();
maoObj = createMap();
mapControl = startDataClass(maoObj, this);
drawFeatureObj = startDraw(maoObj, this);
changeBaseLayer = new ChangeBaseLayer(vm, maoObj);
measure = new Measure(vm, maoObj);
editFeatureStyle = new FeatureStyle(this, maoObj);
editFeatureStyle.setToken(vm.backToken);
drawFeatureObj.setCilckCallBack(function (type, fe, event) {
editFeatureStyle.popupWindow(type, event, fe)
});
},
//上传图标
addPointImage(file) {
let vm = this;
vm.createReader(file.file);
vm.handleUpload(file.file).then(function (response) {
vm.hotSpot.imageUrl = response.data.url;
vm.changeImageStyle();
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
//获取feature数据信息
getFeatureList(isResh) {
let vm = this;
editFeatureStyle.getFeaturePageByLayerId(this.$route.query.id, {}, function (data) {
vm.hotSpotList = data;
if (!isResh) {
let layerData = {};
layerData.id = vm.form.id;
layerData.featureList = data
vm.addLayerOnView(layerData);
}
});
},
//绘制
drawFeature(type) {
let vm = this;
vm.clearn();
vm.hotSpot.type = type;
drawFeatureObj.addInteraction(type, function () {
editFeatureStyle.closePopupWindow();
});
},
changeImageStyle() {
//调用修改属性值方法
editFeatureStyle.setFeatureStyle();
},
rejectMsg() {
this.$prompt('', '驳回', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPlaceholder: '请输入驳回原因',
showInput: true
}).then(({value}) => {
let _this = this;
if(!value || value ==" "){
_this.$message({
type: 'error',
message: "驳回理由不能为空!"
});
}else{
let param = {
id: _this.$route.query.id,
rejectReason: value,
status: _this.status,
};
_this.$https({
method: 'put',
url: 'bankBranchInfo/reject',
authType: this.backToken
}, _this.$qs.stringify(param)).then((res) => {
if (res.data.status == 201) {
_this.$message({
type: 'success',
message: res.data.message
});
_this.$router.push('/indexPage');
} else {
_this.$message({
type: 'error',
message: res.data.message
});
}
}, (error) => {
console.log(error)
}
)
}
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
handleBtnChange (ev) {
let btnName = ev.currentTarget.innerText;
switch (btnName) {
case '通过(上线)':
this.passMsg();
break;
case '通过(下线)':
this.passMsg();
break;
case '重新编辑':
this.$router.push({
path: '/hotSpotManage',
query:{pId: this.$route.query.id}
});
break;
case '再次申请下线':
this.handleLine();
break;
default:
break;
}
},
passMsg() {
let _this = this;
let param = {
id: _this.$route.query.id,
status: _this.status,
};
_this.$https({
method: 'put',
url: 'bankBranchInfo/approved',
authType: this.backToken
}, _this.$qs.stringify(param)).then((res) => {
if (res.data.status == 201) {
_this.$message({
type: 'success',
message: res.data.message
});
_this.$router.push('/indexPage');
} else {
_this.$message({
type: 'error',
message: res.data.message
});
}
}, (error) => {
console.log(error)
}
)
},
handleLine() {
let _this = this;
this.$confirm('是否再次申请下线当前网点服务地图?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
_this.$https({
method: 'put',
url: 'bankBranchInfo/applyOffline?id='+ _this.$route.query.id,
authType: this.backToken
}).then((res) => {
_this.onSearch();
if(res.data.status == 201){
this.$message({
type: 'success',
message: res.data.message
});
_this.$router.push('/indexPage');
}
}, (error) => {
this.$message({
type: 'fail',
message: res.data.message
});
}
)
}).catch(() => {
this.$message({
type: 'info',
message: '已取消此操作'
});
});
},
auditEdit() {
this.category = this.$route.query.typeName;
let _this = this;
let param = {id: _this.$route.query.id};
_this.$https({
method: 'get',
url: 'bankBranchInfo/getById',
authType: this.backToken
}, param).then((res) => {
if (res.status == 200) {
_this.form = res.data;
if (_this.form.imageUrl) {
_this.changeMapBaseLayerMap(_this.form);
}
_this.getFeatureList(false); //先根据id 去获取基本信息 然后再根据id 获取热点列表
}
if (res.data.isShow == 2) {
_this.appro = "通过(上线)";
_this.stateNow = "审批上线";
} else if (res.data.isShow == 3) {
_this.appro = "通过(下线)";
_this.stateNow = "审批下线";
}else if(res.data.isShow == 1) {
_this.appro = "重新编辑";
_this.stateNow ="上线被驳回";
_this.rejectShow = false;
}else if(res.data.isShow == 6) {
_this.appro = "再次申请下线";
_this.stateNow ="下线被驳回";
_this.rejectShow = false;
}
_this.status = res.data.isShow;
_this.activity = res.data.name;
_this.blank = res.data.name;
_this.craetionTime = res.data.createTime;
_this.modifiTime = res.data.updateTime;
_this.myName = res.data.creatorName;
_this.hisName = res.data.modifierName;
_this.process = res.data.headImage;
_this.rejectReason = res.data.rejectReason
if (res.data.imageUrl) {
_this.changeMapBaseLayerMap(_this.form);
}
}, (error) => {
console.log(error)
}
)
},
changeMapBaseLayerMap(data) {
let extent = [0, 0, Number(this.form.width) / 1000, Number(this.form.height) / 1000,];
if (data.imageUrl) {
data.url = data.imageUrl;
this.flag = false;
}
this.tempImageLayer = changeBaseLayer.setImageLayer(extent, data.url, this.tempImageLayer);
maoObj.setCenterAndZoom([Number(this.form.width) / 2000, Number(this.form.height) / 2000], 9);
},
createReader(file) {
let vm = this;
var reader = new FileReader;
reader.onload = function (evt) {
var image = new Image();
image.onload = function () {
var width = this.width;
var height = this.height;
vm.form.width = width;
vm.form.height = height;
};
image.src = evt.target.result;
};
reader.readAsDataURL(file);
},
getParm() {
let subject = {};
subject = JSON.parse(JSON.stringify(this.hotSpot));
subject.coordinate = editFeatureStyle.getWkt();
subject.bankBranchId = this.form.id;
return subject;
},
cancel() {
// 清除数据
let vm = this;
let modifyFe = editFeatureStyle.getFeature();
if (modifyFe && modifyFe.getId() && modifyFe.get('data')) {
//属于修改的部分
let data = modifyFe.get('data');
editFeatureStyle.deleteFeatureFromLayer(data.id, data.layerId, function () {
drawFeatureObj.cleanModifyOrDraw();//删除之后清空绘制的地图 这个方法不需要提示
editFeatureStyle.closePopupWindow();
//从图层中移除数据
changeBaseLayer.removeFeatureFromLayer(data.layerId, data.id);
vm.$refs.controlPanel.refreshLayerData(data.layerId);
})
} else {
//自定义编辑部分
drawFeatureObj.cleanAllFeature(function () {
//关闭弹出框
editFeatureStyle.closePopupWindow();
});
}
}
,
setMapCenterByFeature(featureItem) {
changeBaseLayer.getFeatureById(this.$route.query.id, featureItem.id);
},
//热点底图
addLayerOnView(data) {
let vm = this;
changeBaseLayer.changeLayerVisable(data, true, function (event, feature, layerName) {
editFeatureStyle.popupModifyFeature(event, feature);//沿用开始I编辑的和后面做区分
});
},
},
}
</script>
<style lang="less">
@import '../../style/common';
.auditMap {
width: 100%;
height: calc(100% - 0px);
overflow-x: hidden;
overflow-y: scroll;
.head_boxtwo {
padding: 20px 30px 20px 20px!important;
h6 {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
padding: 5px 0px 13px;
}
h4 {
font-size: 20px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
.myBox {
width: 100%;
display: flex;
justify-content: space-between;
.headLeft {
width: 10%;
}
.headRight {
.el-button--text {
color: rgba(0, 0, 0, 0.6);
border: 1px solid #dcdfe6;
}
.addButton {
width: 47px;
height: 26px;
padding: 0;
text-align: center;
line-height: 26px;
font-size: 23px;
}
.addButton.a {
width: 85px;
}
.el-button {
text-align: center;
font-size: 12px;
line-height: 20px;
}
.el-button span {
font-size: 12px;
}
}
}
.myMsg {
width: 100%;
margin-top: 18px;
display: flex;
justify-content: space-between;
.msgLift {
width: 80%;
display: flex;
justify-content: space-between;
.myColor {
display: inline-block;
color: black;
width: 70px;
text-align: right;
}
.mymsgTOP {
margin-bottom: 10px;
span.myColor {
width: 63px;
}
}
}
.msgRight {
text-align: right;
div {
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
}
div.msgRight_top {
margin-top: 5px;
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
}
}
}
.content_boxtwo {
width: 100%;
height: 100%;
background: #F0F2F5;
/*padding: 24px 24px 0;*/
border: 1px solid transparent;
.form_box {
margin-bottom: 0px;
background: #fff;
.myWord {
font-weight: 600;
font-size: 18px;
.mymap{
height: 500px;
width: 100%;
.map_content_left {
display: inline-block;
float: left;
width: 300px;
height: calc(100% - 20px);
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
background-color: #fff;
.scrool {
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
}
}
.map_content_right {
position: relative;
display: inline-block;
width: calc(100% - 300px);
height: calc(100% - 20px);
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
background: url("../../../static/images/map-background.jpg");
#map{
width: 100%;
height: 100%;
background: url("../../../static/images/map-background.jpg") repeat;
.ol-overlaycontainer-stopevent .ol-overlay-container.ol-selectable{
#popup { /*窗体*/
width: 374px;
/*height: 240px;*/
background: #fff;
border-radius: 4px;
.portlet-title{
height: 40px;
line-height: 40px;
padding-left: 10px;
background-color: #409EFF;
border-bottom: 1px solid #E9E9E9;
}
#popup-content {
.el-row{
.el-form {
.el-col-24{
padding: 0px 20px 10px;
}
.el-col-24:nth-child(1){
padding-top: 10px;
}
.el-form-item {
margin-bottom: 10px;
width: 100%;
.el-form-item__content{
width: calc(100% - 90px);
.avatar-uploader .el-upload {
width: 70px;
height: 70px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
.el-icon-plus.avatar-uploader-icon {
line-height: 5;
}
}
}
}
.el-input__inner {
height: 32px;
}
.el-upload--picture-card {
width: 468px;
height: 270px;
line-height: 270px;
}
}
.dialog-footer {
text-align: center;
.el-button {
padding: 6px 13px;
}
}
}
/*.el-input-number--mini {*/
/*width: 105px;*/
/*}*/
/*.el-input-number--mini .el-input-number__decrease, .el-input-number--mini .el-input-number__increase {*/
/*height: 30px;*/
/*}*/
/*.el-row .el-form .el-col .el-form-item .el-form-item__content{*/
/*width: 70%;*/
/*}*/
}
}
}
}
.btn_group {
position: absolute;
bottom: 10px;
right: 20px;
.avatar-uploader {
display: inline-block
}
}
}
}
}
.myOnly {
width: 80%;
display: flex;
justify-content: space-between;
margin-top: 10px;
.myColor {
color: black;
}
.myonlyFirst {
.myfirstOne {
margin-top: 20px;
display: flex;
align-items: center;
.myImg {
width: 100px;
height: 100px;
}
}
}
.myonlySecond {
.myfirstOneoo {
margin-top: 15px;
}
.myColortwo {
display: inline-block;
width: 80px;
height: 16px;
}
}
.myonlyThird {
.myonlyThirdone {
margin-top: 20px;
.myColoro {
color: #0000cc;
}
}
}
}
.line {
width: 100%;
height: 1.5px;
background: #eeeeee;
margin-top: 10px;
}
}
}
}
</style>