Authored by 鲁尚清

浙江大屏网络拓扑组件(90%),数据中心组件(90%)

Showing 33 changed files with 715 additions and 0 deletions
... ... @@ -18,3 +18,10 @@
@import "../css/businessVolume.css";
@import "../css/digitalboard.css";
/*zj大屏*/
@import "../css/zjbigscreen.css";
@import "../css/networktopology.css";
@import "../css/datacenter.css";
\ No newline at end of file
... ...
.sjzx {
position: relative;
margin-top: 10px;
font-size: 0;
overflow: hidden
}
.sjzx .item {
display: inline-block;
position: relative;
height: 120px;
margin-right: 120px;
}
.sjzx .item h5 {
color: #fff;
font-size: .2rem;
text-align: center;
position:absolute;
bottom:0;
left:14px;
}
.sjzx .item img {
display: block;
height: 118px;
cursor: pointer;
}
.sjzx .item ul {
-webkit-transform: scale(.8);
-ms-transform: scale(.8);
transform: scale(.8);
-webkit-transform-origin: right top;
-ms-transform-origin: right top;
transform-origin: right top;
font-size: 16px;
position: absolute;
top:30px;
left: 60px;
color: #fff;
white-space: nowrap
}
.sjzx .item ul li{
line-height: 30px;
font-size:16px;
position: relative;
text-align: left;
}
.sjzx .item ul li [class^="icon"] {
width: 14px;
height: 14px;
position: absolute;
top: 6px;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.sjzx .item ul li span{
margin-left:20px;
}
.sjzx .item ul li .icon-wd {
background-image: url('/vue3/src/assets/images/zjdp/icon-wd.png');
}
.sjzx .item ul li .icon-sd {
background-image: url("/vue3/src/assets/images/zjdp/icon-sd.png");
}
.sjzx .item ul li .icon-mj {
background-image: url("/vue3/src/assets/images/zjdp/icon-mj.png");
}
\ No newline at end of file
... ...
.network-container{
width: 100%;
height: 100%;
background-image: url("/vue3/src/assets/images/bg.jpg");
background-position: center;
text-align: left;
overflow: visible;
}
#network-echart{
width: 100%;
height: 100%;
background-image: url("/vue3/src/assets/images/zjdp/img-bg2.png");
background-position: center;
background-repeat: no-repeat;
}
\ No newline at end of file
... ...
body{font-size: 15px;}
#zjdapingIndex{
background: url("/vue3/src/assets/images/zjdp/img-bg.png");
background-position: center;
}
.container-title{
color: white;
padding: 7px;
text-align: left;
}
/**提示展示动画 从左到右进入*/
@-webkit-keyframes fadeInLeft {
0% {
opacity: 0;
-webkit-transform: translateX(-120px);
}
100% {
opacity: 1;
-webkit-transform: translateX(0);
}
}
@keyframes fadeInLeft {
0% {
opacity: 0;
transform: translateX(-120px);
}
100% {
opacity: 1;
transform: translateX(0);
}
}
/*从左下到右上*/
@keyframes fadeInUpLeft
{
from {
opacity: 0;
-webkit-transform: translate(-30px,30px); /* Safari */
transform: stranslate(-10px,2010); /* 标准语法 */
}
to {
opacity:1;
-webkit-transform: translate(0,10px); /* Safari */
transform: stranslate(0,10px); /* 标准语法 */
}
}
@-webkit-keyframes fadeInUpLeft /* Safari 与 Chrome */
{
from {
opacity:0;
-webkit-transform: translate(-30px,30px); /* Safari */
transform: stranslate(-10px,10px); /* 标准语法 */
}
to {
opacity:1;
-webkit-transform: translate(0,10px); /* Safari */
transform: stranslate(0,10px); /* 标准语法 */
}
}
.icon-focus{
width: 14px;
height: 14px;
position: absolute;
top: 12px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: url("/vue3/src/assets/images/zjdp/focus.png");
left: 12px;
}
/*调用animation属性,从而让按钮在载入页面时就具有动画效果 以-webkit为例,请为不同的浏览器添加前缀 */
.map_tips_0{
-webkit-animation-name: "fadeInUpLeft"; /*动画名称,需要跟@keyframes定义的名称一致*/
-webkit-animation-duration: 0.5s;/*动画持续的时间长*/
-webkit-animation-iteration-count: 1;/*动画循环播放的次数为1 infinite为无限次*/
-moz-animation-name: "fadeInUpLeft";
-moz-animation-duration: 0.5s;
-moz-animation-iteration-count: 1;
-ms-animation-name: "fadeInUpLeft";
-ms-animation-duration: 0.5s;
-ms-animation-iteration-count: 1;
-o-animation-name: "fadeInUpLeft";
-o-animation-duration: 0.5s;
-o-animation-iteration-count: 1;
}
.map_tips_city_0{
-webkit-animation-name: "fadeInLeft"; /*动画名称,需要跟@keyframes定义的名称一致*/
-webkit-animation-duration: 0.5s;/*动画持续的时间长*/
-webkit-animation-iteration-count: 1;/*动画循环播放的次数为1 infinite为无限次*/
-moz-animation-name: "fadeInLeft";
-moz-animation-duration: 0.5s;
-moz-animation-iteration-count: 1;
-ms-animation-name: "fadeInLeft";
-ms-animation-duration: 0.5s;
-ms-animation-iteration-count: 1;
-o-animation-name: "fadeInLeft";
-o-animation-duration: 0.5s;
-o-animation-iteration-count: 1;
}
.map_tips_city_1{
-webkit-animation:'fadeInLeft' 0.6s 1;
-moz-animation:'fadeInLeft' 0.6s 1;
-ms-animation:'fadeInLeft' 0.6s 1;
-o-animation:'fadeInLeft' 0.6s 1;
} /* 简写 */
.map_tips_city_2{
-webkit-animation:'fadeInLeft' 0.7s 1;
-moz-animation:'fadeInLeft' 0.7s 1;
-ms-animation:'fadeInLeft' 0.7s 1;
-o-animation:'fadeInLeft' 0.7s 1;
}
.map_tips{
position: absolute;
color: #fff;
width:auto;
height:auto;
z-index:999;
font-size: 16px;
background-repeat: no-repeat;
background-image: url(/vue3/src/assets/images/zjdp/tips_bg.png);
background-size: 100% 100%;
pointer-events: none;
display: none;
}
.map_tips_group{
margin: 0 12px 0 2px;
padding-left:20px;
border-bottom:1px solid #0C4493;
height:75px;
}
.map_tips_group div{
margin-top:5px;
white-space:nowrap;
}
.map_tips_group:last-child{
border-bottom: none !important;
margin-bottom:10px;
}
.map_tips_city{
padding-bottom:3px;
padding-left:30px;
margin:12px 6px 0 6px;
border-bottom:2px solid #0C4493;
}
... ...
This diff could not be displayed because it is too large.
... ... @@ -99,6 +99,13 @@ const routes = [{
path: '/daping',
name: 'daping',
component: () => myImport('views/dpimg/index')
},
{
path: '/zjdaping',
name: 'zjdaping',
component: () => myImport('views/zjdaping/index')
// component: () => myImport('views/zjdaping/components/networkTopology/index')
// component: () => myImport('views/zjdaping/components/dataCenter/index')
}
];
... ...
<div class="container-title">资产概览</div>
<div class="left-bottom-left-bottom"></div>
\ No newline at end of file
... ...
<div class="container-title">云平台</div>
<div class="left-bottom-right-body"></div>
\ No newline at end of file
... ...
<div class="dataCenter-container" id="dataCenter">
<!-- 数据中心-->
<div class="container-title">
<img src="/vue3/src/assets/images/zjdp/title-datacenter.png" alt="">
</div>
<div class="sjzx">
<div class="item sjzx_machineroom" v-for="item in jfdata">
<h5>{{item.machineRoomName}}</h5>
<img v-if="item.healthStatus==0" src="/vue3/src/assets/images/zjdp/jifang-1.png" alt="">
<img else="item.healthStatus==1" src="/vue3/src/assets/images/zjdp/jifang-2.png" alt="">
<ul class="float-container">
<li><i class='icon-wd'></i><span>温度:{{item.wd}}</span></li>
<li><i class='icon-sd'></i><span>湿度:{{item.sd}}</span></li>
<li><i class='icon-mj'></i><span>面积:{{item.area}}</span></li>
</ul>
</div>
</div>
</div>
... ...
export default {
name: 'dataCenter',
template: '',
components: {},
data(){
return {
domainName:'http://192.168.0.245:8180/api-web',
jfdata:''
}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
// 挂载完
Vue.onMounted(() => {
$.get(proxy.domainName +"/datavis/getMachineRoomInfoList",function (res) {
if(res.data){
proxy.jfdata=res.data;
/* const html = $("#sjzx_machineroom_id_Tmpl").render(res.data);
$("#sjzx_machineroom_id").html(html);
//机房点击事件
$(".sjzx_machineroom").on("click",function () {
const name = $(this).attr("name");
layer.open({
type:2
, shade: 0.6 //遮罩透明度
, maxmin: false //允许全屏最小化
, anim: 1 //0-6的动画形式,-1不开启
, content:['http://127.0.0.1:8081/video.html?type='+name+'','no']
, area:["1100px",'720px']
// , title: true //不显示标题栏
// , title: name
})
});*/
}
})
})
return{
}
}
}
... ...
<div class="network-container">
<!-- 省局网络拓扑-->
<div class="container-title network-title">
<img src="/vue3/src/assets/images/zjdp/title-network.png" alt="">
</div>
<div id="network-echart"></div>
</div>
... ...
export default {
name: 'networkTopology',
// props:['divIdName','geoCoordMap','domainName','mapJsonUrl','cityUrl'],
template: '',
components: {
},
data() {
return {
divIdName:'#network-echart',
domainName:'http://192.168.0.245:8180/api-web',
mapJsonUrl:'public/data/zhejiang.json',
cityUrl:'/datavis/getEchartsMap',
// 标记各地市的坐标
geoCoordMap:{
"省局": [119.453576,30.005871],
"杭州市": [120.153576,30.287459],
"宁波": [121.549792,29.868388],
"温州市": [120.672111,28.000575],
"嘉兴市": [120.750865,30.762653],
"湖州市": [120.102398,30.867198],
"绍兴市": [120.582112,29.997117],
"金华市": [119.649506,29.089524],
"衢州市": [118.87263,28.941708],
"舟山市": [122.106863,30.016028],
"台州市": [121.428599,28.661378],
"丽水市": [ 119.921786,28.451993]
}
}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
// 输出json对象数组,value里包含坐标值和随机值
let convertData = (data) =>{
let res = [];
$.each(data,function (i,v) {
let geoCoord = proxy.geoCoordMap[v.name];
res.push({
name: v.name,
value: geoCoord.concat(v.value)
})
});
return res
}
// 设置目标点, 配置线条指向
let convertToLineData = (data) => {
let res = [];
$.each(data,function (i,v) {
// 起点
let fromCoord = proxy.geoCoordMap[v.name];
// 终点,这里设置的省局
let toCoord = [119.453576,30.005871];
res.push([{ coord: fromCoord, value: v.value },{ coord: toCoord }]);
});
return res
}
// 挂载完
Vue.onMounted(() => {
let colors = ["#00eaff","#1e9fff","#FF7E00","#D81E06"];
// 解析地图数据包
$.getJSON(proxy.mapJsonUrl, function(geoJson) {
// 注册地图,传入数据
echarts.registerMap('echarts', geoJson);
//获取浙江各地市链路信息
$.get(proxy.domainName +proxy.cityUrl,function(res){
if(res.data && res.data.length > 0){
const mapData = res.data;
const obj = res.object;
const optionMap = {
timeline: {
show: false
},
baseOption: {
// 设置地图参数和样式
geo: {
show: true,
map: 'echarts',
roam: true,
zoom: 1.25,
// 地图中心点的坐标, 可调节显示的偏移量
center: [120.453576,29.197459],
label: {
// 高亮文字隐藏
emphasis: {
show: false
}
},
itemStyle: {
normal: {
borderColor: '#42adff',
borderWidth: 2,
areaColor: 'rgba(0,0,0,0)',
shadowColor: '#294167',
shadowOffsetX: -2,
shadowOffsetY: 2,
shadowBlur: 25
},
emphasis: {
// 鼠标悬浮高亮
areaColor: '#0D114B',
borderWidth: 1,
shadowColor: '#294167',
borderColor: '#42adff'
}
}
}
},
options: [{
xAxis: {
show: false
},
yAxis: {
show: false
},
tooltip: {
show:false
},
series: [{
// 坐标点参数和样式
type: 'effectScatter',
coordinateSystem: 'geo',
data: proxy.convertData(mapData),
symbolSize: 10,
showEffectOn: 'render',
rippleEffect: { //涟漪特效
period: 4, //动画时间,值越小速度越快
brushType: 'stroke', //波纹绘制方式 stroke, fill
scale: 4 //波纹圆环最大限制,值越大波纹越大
},
label: {
normal: {
formatter: '{b}',
position: 'right',
show: true,
color:'#fff',
fontSize:16
}
},
itemStyle: {
normal: {
//点的颜色
color: function (data) {
return colors[data.value[2]];
},
shadowBlur: 2,
shadowColor: '#03BED9',
symbolSize: 5
}
}
},
{
// 线条参数和样式
type: 'lines',
// 变化频率
zlevel: 2,
effect: {
show: true,
// 箭头指向速度,值越小速度越快
period: 4,
// 特效尾迹长度,取值0到1,值越大,尾迹越长
trailLength: 0.03,
symbol: 'arrow',
// 图标大小
symbolSize: 6
},
lineStyle: {
normal: {
//线条颜色
color: function (data) {
// return colors[0];//线条跟着点的颜色一致
if(data.value == 0){
return '#00eaff';
}else{
return '#D81E06';
}
},
// 尾迹线条宽度
width: 1,
// 尾迹线条透明度
opacity: 1,
// 尾迹线条曲直度
curveness: 0.3
}
},
data: proxy.convertToLineData(mapData)
},
{//被攻击点
// type: 'scatter',
type:'effectScatter',
hoverAnimation:true,//鼠标移入是否显示动画
coordinateSystem: 'geo',
zlevel: 3,
rippleEffect: {
number:3,
period: 4,
brushType: 'fill',
scale: 2
},
symbol: 'circle',
symbolSize: 30,
itemStyle:{
color:'#EE4237',
},
label: {
normal: {
show: false,
position: 'left',
formatter: '省局',
textStyle: {
color: "#0f0"
},
fontSize:16
},
emphasis: {
show: false,
color: "#0f0"//鼠标移入字体颜色
}
},
data: [{
name: '省局',
value: proxy.geoCoordMap['省局'].concat([10])
}]
}]
}]
};
// let map_chart = echarts.init(document.getElementById('network-echart'));
let map_chart=echarts.init($(proxy.divIdName)[0])
map_chart.setOption(optionMap);
map_chart.on('mouseout', 'geo', function (params) {
$('.map_tips').hide();
});
//当鼠标移入当前区域显示提示信息
map_chart.on('mouseover', 'geo',function (params) {
let name = params.name;
//先删除原来的
$(proxy.divIdName).find('.map_tips').remove();
//当前城市提示信息
let currentCity = obj[name];
if(currentCity && currentCity.length > 0){
let cityInfos = '';
$.each(currentCity,function (i,v) {
cityInfos += '<div class="map_tips_group">' +
' <div class="map_tips_res" style="margin-left: -8px;">'+v.resName+'</div>' +
' <div class="map_tips_sxll">上行流量:'+v.sxll+'</div>' +
' <div class="map_tips_xxll">下行流量:'+v.xxll+'</div>' +
' </div>';
});
//地图区域悬浮提示
let cityTips =
'<div class="map_tips">' +
' <div class="map_tips_city"><i class="icon-focus"></i><span>'+name+'</span></div>'
+ cityInfos +
'</div>';
//提示框拼接在echar区域
$(cityTips).appendTo($(proxy.divIdName));
if ($('.map_tips').is(':hidden')) {
$('.map_tips').show();
}
//城市名称从左到右滑入效果
$('.map_tips_res').addClass("map_tips_city_0");
$('.map_tips_sxll').addClass("map_tips_city_1");
$('.map_tips_xxll').addClass("map_tips_city_2");
//根据鼠标位置定位
let layerX = params.event.offsetX;
let layerY = params.event.offsetY;
//随鼠标移动
if(name == '湖州市' || name == '嘉兴市'){
$('.map_tips').css({
'top': layerY + 10,
'left': layerX + 15
});
}else{
$('.map_tips').css({
'top': layerY -120,
'left': layerX + 15
});
}
}else{
$('.map_tips').hide();
}
});
//鼠标移动,提示信息随鼠标走
map_chart.on('mousemove', 'geo', function (params) {
let name = params.name;
//随鼠标移动
let layerX = params.event.offsetX;
let layerY = params.event.offsetY;
//随鼠标移动
if(name == '湖州市' || name == '嘉兴市'){
$('.map_tips').css({
'top': layerY + 10,
'left': layerX + 15
});
}else{
$('.map_tips').css({
'top': layerY -120,
'left': layerX + 15
});
}
});
}
});
});
})
return {
convertData,
convertToLineData
}
}
}
... ...
<div id="zjdapingIndex">
<header class="screen-header" :style="screenheaderStyle">
<div>
<img style="width: 100%" src="/vue3/src/assets/images/zjdp/img-top-bg2.png" alt="">
</div>
<div class="title-left">
<img src="/vue3/src/assets/img/time-icon.png" :style="timelogoStyle" class="timelog">
<span :style="datetimeStyle" >{{dateTime}}</span>
</div>
</header>
<div class="screen-body">
<section class="screen-left" >
<div class="left-top">
<!-- 省局网络拓扑-->
<!-- <NetworkTopology :></NetworkTopology>-->
</div>
<div class="left-bottom">
<div class="left-bottom-left">
<div class="left-bottom-left-top">
<!-- 数据中心-->
<DataCenter></DataCenter>
</div>
<div class="left-bottom-left-bottom">
资产概览
</div>
</div>
<div class="left-bottom-right">
云平台
</div>
</div>
</section>
<section class="screen-right" >
</section>
</div>
</div>
\ No newline at end of file
... ...
export default {
name: 'zjdaping',
template: '',
components: {
'NetworkTopology': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/networkTopology/index')
),
'DataCenter': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/dataCenter/index')
)
},
data() {
return {
titleFontSize: 30,
dateTime: '00-00-00 00:00:00',
}
},
setup() {
const {proxy} = Vue.getCurrentInstance();
let datetimeStyle=()=>{// 左上角日期时间大小
fontSize: this.titleFontSize / 3 + 'px';
marginLeft: this.titleFontSize / 5 + 'px'
}
// 挂载完
Vue.onMounted(() => {
let that = this
// 获取当前系统时间
let myDate = new Date();
that.dateTime = myDate.getFullYear() + '-' + that.timeFormat(myDate.getMonth() + 1 + '') + '-' + that.timeFormat(myDate.getDate() + '') // + ' ' + that.timeFormat(myDate.getHours() + '') + ':' + that.timeFormat(myDate.getMinutes() + '') + ':' + that.timeFormat(myDate.getSeconds() + '');
})
return {
datetimeStyle
}
}
}
... ...