4140a1b0
Andy
add 官网移植
|
1
2
|
<template>
<div>
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<div class="index_cont" v-show="see">
<div class="banner">
<div class="ban-tit"></div>
</div>
<div class="berth">
<h1 class="title">泊位分布</h1>
<div class="map" id="map"></div>
<div class="berth-num">
<p>区域泊位规划</p>
<ul class="berth-list">
<li v-for="(result,id) in resultMap" :key="id" >
<span class="fl">{{result.areaName}}</span>
<span class="fr">{{result.berthNum}}</span>
</li>
</ul>
</div>
</div>
<div class="news-wrap">
|
7767c2ce
Andy
add 新闻中心请求后端动态显示 ...
|
22
|
<h1 class="title">新闻/公告中心</h1>
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
23
24
25
26
27
|
<div class="fl news-bg"></div>
<ul class="fl news-con">
<li class="clearfix" v-for="(news,id) in newsList" :key="id" @click="showNews(news.noticeId)">
<span class="ITD-hidden-nowrap ITD-common-color070">{{news.noticeTitle}}</span>
<span class="ITD-common-color050">{{news.effDate | string2Date(1)}}</span>
|
4140a1b0
Andy
add 官网移植
|
28
29
|
</li>
</ul>
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
30
31
32
33
34
35
36
37
38
39
|
<!--分页器-->
<i-pagination
:total="pageTotal"
:page="currentPage"
:limit="pageSize"
:layout="'total, prev, pager, next'"
:page-sizes="pageSizeS"
:hidden="false"
@pagination="handleSizeChange"
/>
|
4140a1b0
Andy
add 官网移植
|
40
41
|
</div>
</div>
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
42
43
44
|
<div class="news_cont" v-if="!see">
<div class="returnLastbtn" @click="backIndex()">返回</div>
<div v-html="newscontent"></div>
|
4140a1b0
Andy
add 官网移植
|
45
46
47
48
49
|
</div>
</div>
</template>
<script>
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
50
51
52
53
|
import {queryParkLotInfoByOrgId,queryNoticeForPage,queryNotice} from '@/api/park';
import pagination from '@/components/Pagination/index.vue'
import {string2Date} from '@/filters/index';
import parkIco from '../assets/home/parkIco.png'; //以import的方式导入图片文件
|
4140a1b0
Andy
add 官网移植
|
54
55
|
export default {
name: 'home',
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
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
|
components: {
'i-pagination': pagination,
// timeOneFormatter,
},
data() {
return {
parkList: [],
resultMap: [],
newsList: [],
//新闻详情开关
see:true,
/** 分页*/
currentPage: 1,
pageSize: 7,
pageSizeS: [8, 16],
pageTotal: 0,
//新闻详情
newscontent:'',
}
},
computed: {
/* hsgtotalSumAll() {
let hsgtotalSumAll = 0;
this.parkList.map((item) => {
if (item.plCountryName === '黄石港区') {
hsgtotalSumAll += item.plBerthNum;
}
});
return hsgtotalSumAll;
},*/
},
created() {
queryParkLotInfoByOrgId({
sysCode: '1001',
orgId: '10079',
plBusiType:'3',
}).then((response) => {
const mapDatas = response.data;
this.parkList = mapDatas;
this.baiduMap(mapDatas);
this.getAreaData(mapDatas);
})
},
|
4140a1b0
Andy
add 官网移植
|
102
|
mounted() {
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
103
|
this.getNoticeForPage();
|
2ed00cc9
Andy
首页 banner 更换icon ...
|
104
|
},
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
105
106
107
108
109
110
111
|
methods: {
//泊位分布 list 区间---泊位数
getAreaData(arrayData) {
let berthMap = {};
let areaMap = {};
if (arrayData === null || arrayData === undefined || arrayData.length === 0) {
return resultMap;
|
2ed00cc9
Andy
首页 banner 更换icon ...
|
112
|
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
113
114
115
116
117
118
119
120
121
122
|
arrayData.forEach((item,index)=>{
let plBerthNum = item.plBerthNum;
if(plBerthNum === undefined || plBerthNum === null){
plBerthNum = 0;
}
if(areaMap[item.plCountryId] === null || areaMap[item.plCountryId] === undefined){
areaMap[item.plCountryId] = item.plCountryName;
}
if(berthMap[item.plCountryId] === null || berthMap[item.plCountryId] === undefined){
berthMap[item.plCountryId] =plBerthNum;
|
2ed00cc9
Andy
首页 banner 更换icon ...
|
123
|
}else{
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
124
|
berthMap[item.plCountryId] = berthMap[item.plCountryId]+plBerthNum;
|
2ed00cc9
Andy
首页 banner 更换icon ...
|
125
|
}
|
2ed00cc9
Andy
首页 banner 更换icon ...
|
126
|
});
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
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
|
for(let berthId in berthMap){
this.resultMap.push({
areaName:areaMap[berthId],
berthNum:berthMap[berthId]
})
}
},
//泊位分布 地图展示
baiduMap(mapDatas) {
if (mapDatas.length === 0) {
// 百度地图API功能
let map = new BMap.Map("map", {enableMapClick: false});
let point = new BMap.Point(115.078186, 30.232887);
map.centerAndZoom(point, 15);
map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
let top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角,添加比例尺
let top_left_navigation = new BMap.NavigationControl(); //左上角,添加默认缩放平移控件
let top_right_navigation = new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_RIGHT,
type: BMAP_NAVIGATION_CONTROL_SMALL
}); //右上角,仅包含平移和缩放按钮
map.addControl(top_left_control);
map.addControl(top_left_navigation);
map.addControl(top_right_navigation);
map.clearOverlays();
}
else {
// 百度地图API功能
let map = new BMap.Map("map", {enableMapClick: false});
let point = new BMap.Point(mapDatas[0].lonId, mapDatas[0].latId);
map.centerAndZoom(point, 18);
map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
let top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角,添加比例尺
let top_left_navigation = new BMap.NavigationControl(); //左上角,添加默认缩放平移控件
let top_right_navigation = new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_RIGHT,
type: BMAP_NAVIGATION_CONTROL_SMALL
}); //右上角,仅包含平移和缩放按钮
map.addControl(top_left_control);
map.addControl(top_left_navigation);
map.addControl(top_right_navigation);
map.clearOverlays();
let i = 0;
let points = [];
/* data.reduce((acc, character) => {
return character.name === '黄石港区' ? acc += character.num : acc
}, 0)*/
for (let item in mapDatas) {
(function (x) {
let itemthat = item;
//创建标注
let pt = new BMap.Point(mapDatas[item].lonId, mapDatas[item].latId);
points[i] = pt;
let myIcon = new BMap.Icon(parkIco,
new BMap.Size(29, 40), {
offset: new BMap.Size(10, 40),
textColor: '#fff'
});
let marker = new BMap.Marker(pt, {icon: myIcon});
// marker.setTop(true,27000000);
map.addOverlay(marker);
let myLabel;
marker.addEventListener("mouseover", (e) => {
map.removeOverlay(myLabel);
let that = this;
myLabel = new BMap.Label(
`<div class="dislog-wrap" title="${mapDatas[itemthat].plName}">${mapDatas[itemthat].plName}</div>`,
{
offset: new BMap.Size(40, 0), //label的偏移量,为了让label的中心显示在点上
position: pt
});
myLabel.setStyle({
color: "#fff",
fontSize: "14px",
//
whiteSpace: "nowrap",
height: "24px",
width: "auto",
textAlign: "center",
lineHeight: "24px",
padding: "0 8px",
border: "0",
backgroundColor: "#ff8600",
borderRadius: "10px",
zIndex: "1000"
}
);
marker.setLabel(myLabel)
marker.setTop(true, 27000000);
});
marker.addEventListener("mouseout", function (e) {
map.removeOverlay(myLabel);
});
i++;
})(i);
}
}
},
//新闻中心
getNoticeForPage(){
let req={
baseRequest:{
pageNum:this.currentPage,
pageSize:this.pageSize
},
sysCode: '1001',
noticeBigTypes: [100,200],
orgIds: [10079],
};
queryNoticeForPage(req).then((response) => {
this.pageTotal = response.data.total;
this.newsList = response.data.rows;
console.log(this.newsList)
})
},
// 获取子组件页码方法
handleSizeChange: function(pages) {
this.currentPage = pages.page;
this.pageSize = pages.limit;
this.getNoticeForPage();
},
//新闻详情
showNews (showNews) {
let noticeId=showNews;
queryNotice({
sysCode: '1001',
orgId: '10079',
noticeId:noticeId,
}).then((response) => {
scrollTo(0, 800);
this.see = false;
this.newscontent = response.data.noticeContent;
})
},
//返回首页
backIndex:function () {
this.see = true;
},
|
4140a1b0
Andy
add 官网移植
|
270
271
272
273
|
}
}
</script>
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
274
275
|
<style lang="scss">
.index_cont .banner {
|
4fc45339
Andy
首页 banner 更换icon ...
|
276
|
background: url("../assets/home/hs_bannerico.jpg") no-repeat center center;
|
4140a1b0
Andy
add 官网移植
|
277
|
background-size: 100% 100%;
|
4fc45339
Andy
首页 banner 更换icon ...
|
278
|
padding-top: 108px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
279
|
.ban-tit {
|
4fc45339
Andy
首页 banner 更换icon ...
|
280
281
|
height: 80px;
width: 776px;
|
9c02a6cd
Andy
首页 banner 更换icon ...
|
282
|
background: url("../assets/home/hs_banner_msg.png") no-repeat center center;
|
4fc45339
Andy
首页 banner 更换icon ...
|
283
284
285
286
|
background-size: 100% 100%;
margin: 0 auto;
/*margin-top: 108px;*/
}
|
4140a1b0
Andy
add 官网移植
|
287
288
|
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
289
|
.index_cont .berth {
|
4140a1b0
Andy
add 官网移植
|
290
291
292
293
294
295
|
width: 1200px;
height: 823px;
padding: 50px 0;
position: relative;
margin: 0 auto;
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
296
297
|
.index_cont .map {
|
4140a1b0
Andy
add 官网移植
|
298
299
300
301
|
width: 1200px;
height: 600px;
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
302
|
.index_cont .berth-num {
|
4140a1b0
Andy
add 官网移植
|
303
304
305
|
width: 323px;
height: 368px;
position: absolute;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
306
|
top: 200px;
|
dfc9b132
Andy
首页add 地图缩放
|
307
|
right: 80px;
|
4140a1b0
Andy
add 官网移植
|
308
|
background: url("../assets/home/berth.png") no-repeat;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
309
|
p {
|
4140a1b0
Andy
add 官网移植
|
310
311
312
313
|
padding-top: 20px;
font-size: 20px;
}
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
314
315
|
.index_cont .berth-list {
|
4140a1b0
Andy
add 官网移植
|
316
|
margin-top: 50px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
317
|
li {
|
4140a1b0
Andy
add 官网移植
|
318
319
320
321
322
323
324
325
326
|
height: 21px;
line-height: 21px;
font-size: 16px;
color: #314659;
padding: 0 40px 30px 60px;
background: url("../assets/home/berth-list.png") no-repeat 30px 0;
margin-bottom: 15px;
}
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
327
328
|
.index_cont .news-wrap {
|
4140a1b0
Andy
add 官网移植
|
329
330
331
332
333
|
width: 1200px;
margin: 0 auto;
padding: 50px 0;
overflow: hidden;
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
334
335
|
.index_cont .title {
|
4140a1b0
Andy
add 官网移植
|
336
|
padding-bottom: 50px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
337
338
339
340
341
|
font-size: 38px;
font-family: PingFangSC-Semibold;
font-weight: 600;
color: rgba(49, 70, 89, 1);
line-height: 46px;
|
4140a1b0
Andy
add 官网移植
|
342
|
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
343
344
345
346
|
.index_cont .news-bg {
width: 589px;
height: 341px;
|
4140a1b0
Andy
add 官网移植
|
347
|
margin-right: 45px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
348
|
background: url("../assets/home/newsBg.png") no-repeat;
|
4140a1b0
Andy
add 官网移植
|
349
350
|
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
351
|
.index_cont .news-con {
|
4140a1b0
Andy
add 官网移植
|
352
|
width: 535px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
353
|
height: 301px;
|
4140a1b0
Andy
add 官网移植
|
354
355
|
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
|
.index_cont .news-con > li {
cursor: pointer;
/*padding: 5px 0;*/
font-size: 16px;
color: #000;
height: 30px;
line-height: 30px;
border-bottom: 1px solid rgba(216, 216, 216, 1);
span:first-of-type{
float: left;
width: calc(100% - 80px);
display: inline-block;
vertical-align: middle;
font-size: 16px;
text-align: left;
}
span:nth-of-type(2){
font-size: 14px;
color: rgba(0,0,0,0.5);
float: right;
text-align: justify;
|
4140a1b0
Andy
add 官网移植
|
377
378
|
}
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
379
380
|
/*
.date {
|
4140a1b0
Andy
add 官网移植
|
381
382
383
384
385
|
width: 83px;
height: 83px;
margin-right: 20px;
background: #FF5656;
position: relative;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
386
|
h3 {
|
4140a1b0
Andy
add 官网移植
|
387
|
padding-top: 15px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
388
389
|
font-size: 32px;
color: rgba(255, 255, 255, 1);
|
4140a1b0
Andy
add 官网移植
|
390
|
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
391
|
h5 {
|
4140a1b0
Andy
add 官网移植
|
392
393
394
395
396
|
font-size: 12px;
text-align: right;
padding-right: 10px;
color: #Fff;
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
397
|
&:before {
|
4140a1b0
Andy
add 官网移植
|
398
399
400
|
content: '';
position: absolute;
right: 14px;
|
dfc9b132
Andy
首页add 地图缩放
|
401
|
bottom: 36px;
|
4140a1b0
Andy
add 官网移植
|
402
403
404
|
transform: rotate(-45deg);
width: 25px;
height: 1px;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
405
|
background: rgba(255, 255, 255, 1)
|
4140a1b0
Andy
add 官网移植
|
406
407
|
}
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
408
409
|
.des h3 {
|
4140a1b0
Andy
add 官网移植
|
410
411
412
413
414
|
padding-bottom: 15px;
font-size: 20px;
color: #0D1A26;
cursor: pointer;
}
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
415
|
|
4140a1b0
Andy
add 官网移植
|
416
417
418
419
|
.des p {
width: 430px;
line-height: 22px;
color: #314659;
|
36fce773
Andy
add 新闻中心请求后端动态显示 ...
|
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
|
}*/
/*.index_cont .dislog-wrap {
height: 30px;
line-height: 30px;
width: 100%;
padding: 0 4px;
border-radius: 4px;
background-color: #3a8ee6;
color: #fff;
font-size: 14px;
text-align: center;
white-space: nowrap;
}*/
/*新闻内容 样式*/
.news_cont h1 {
font-size: 36px !important;
}
.news_cont h1,.news_cont h2,.news_cont h3,.news_cont h4,.news_cont h5,.news_cont h6 {
font-weight: 300 !important;
}
.news_cont h2 {
font-size: 36px !important;
}
.index_cont a {
text-shadow: none !important;
color: #337ab7 !important;
}
.news_cont{
padding: 20px;
}
.news_cont .returnLastbtn{
cursor: pointer;
width: 60px;
height: 24px;
text-align: center;
line-height: 22px;
background: #da2431 !important;
color: #fff !important;
border: 1px solid #da2431 !important;
border-radius: 4px!important;
box-sizing: border-box;
}
.news_cont #title p {
margin: 20px 0 !important;
text-align: center;
}
.news_cont #content p {
margin: 20px 0 !important;
text-align: left;
text-indent: 24px;
line-height:24px;
|
4140a1b0
Andy
add 官网移植
|
472
473
|
}
</style>
|