update1.6

This commit is contained in:
lnljyang
2026-01-07 09:51:51 +08:00
parent 3bb5419386
commit 667006bb89
4 changed files with 523 additions and 457 deletions

View File

@@ -11,7 +11,13 @@ $colors: (
"dark": #222222, "dark": #222222,
"black-1": #333333, "black-1": #333333,
"black": #000000, "black": #000000,
"icon": #1976d2 "icon": #1976d2,
// 新增浅色主题专用颜色
"bg-light": #fafbfc,
"bg-lighter": #ffffff,
"border-light": #e4e7ed,
"text-secondary": #606266,
"text-regular": #909399
); );
// 字体大小 // 字体大小

View File

@@ -16,7 +16,7 @@
height: 100%; height: 100%;
padding: 16px 16px 10px 16px; padding: 16px 16px 10px 16px;
box-sizing: border-box; box-sizing: border-box;
background-color: #f5f7fa; background-color: #fafbfc;
background-image: none; background-image: none;
background-size: cover; background-size: cover;
background-position: center center; background-position: center center;
@@ -102,7 +102,7 @@
font-weight: 900; font-weight: 900;
letter-spacing: 6px; letter-spacing: 6px;
width: 100%; width: 100%;
background: linear-gradient(92deg, #2c5aa0 0%, #1e88e5 48.8525390625%, #1976d2 100%); background: linear-gradient(92deg, #1976d2 0%, #2196f3 48.8525390625%, #42a5f5 100%);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }

View File

@@ -9,7 +9,10 @@
<div class="centermap"> <div class="centermap">
<div class="maptitle"> <div class="maptitle">
<div class="zuo"></div> <div class="zuo"></div>
<span class="titletextBefore">今年累计碳减排<span class="titletext">{{ maptitle }}</span>{{ maptitle2 }}</span> <span class="titletextBefore"
>今年累计碳减排<span class="titletext">{{ maptitle }}</span
>{{ maptitle2 }}</span
>
<div class="you"></div> <div class="you"></div>
</div> </div>
<div class="mapwrap"> <div class="mapwrap">
@@ -21,11 +24,19 @@
车辆实况 车辆实况
</div> </div>
<div class="quanguo2" @click="changeShow1()" :style="{ backgroundColor: currentBgColor2 }"> <div
<div >车辆信息</div> class="quanguo2"
@click="changeShow1()"
:style="{ backgroundColor: currentBgColor2 }"
>
<div>车辆信息</div>
</div> </div>
<div class="quanguo3" @click="changeShow2()" :style="{ backgroundColor: currentBgColor3 }"> <div
<div >加氢站</div> class="quanguo3"
@click="changeShow2()"
:style="{ backgroundColor: currentBgColor3 }"
>
<div>加氢站</div>
</div> </div>
<Echart id="CenterMap" :options="options" ref="CenterMap" /> <Echart id="CenterMap" :options="options" ref="CenterMap" />
@@ -45,17 +56,16 @@ export default {
data() { data() {
return { return {
maptitle: "2536238", maptitle: "2536238",
maptitle2:'', maptitle2: "",
options: {}, options: {},
code: "china", //china 代表中国 其他地市是行政编码 code: "china", //china 代表中国 其他地市是行政编码
//code:"440000", //code:"440000",
echartBindClick: false, echartBindClick: false,
isSouthChinaSea: false, //是否要展示南海群岛 修改此值请刷新页面 isSouthChinaSea: false, //是否要展示南海群岛 修改此值请刷新页面
currentMap : 'china', // 当前显示的地图层级 currentMap: "china", // 当前显示的地图层级
showType: 1, //显示内容类型: 1车辆信息2加氢站信息 showType: 1, //显示内容类型: 1车辆信息2加氢站信息
currentBgColor2:'', currentBgColor2: "",
currentBgColor3:'', currentBgColor3: "",
}; };
}, },
created() {}, created() {},
@@ -65,70 +75,82 @@ export default {
this.getYearData(); this.getYearData();
this.showType = 1; this.showType = 1;
this.currentBgColor2 = '#1976d2'; this.currentBgColor2 = "#1976d2";
this.getData("china"); this.getData("china");
//this.getData("440000"); //this.getData("440000");
}, },
methods: { methods: {
changeShow1(){ changeShow1() {
this.showType = 1; this.showType = 1;
this.currentBgColor2 = '#1976d2'; this.currentBgColor2 = "#1976d2";
this.currentBgColor3 = ''; this.currentBgColor3 = "";
this.getData(this.code); this.getData(this.code);
}, },
changeShow2(){ changeShow2() {
this.currentBgColor2 = ''; this.currentBgColor2 = "";
this.currentBgColor3 = '#1976d2'; this.currentBgColor3 = "#1976d2";
this.showType = 2; this.showType = 2;
this.getData(this.code); this.getData(this.code);
}, },
goToPage() { goToPage() {
//window.open("http://localhost:9528/vehicle-management/vehicle-state?"+this.code, "_blank"); //window.open("http://localhost:9528/vehicle-management/vehicle-state?"+this.code, "_blank");
window.open("http://47.100.49.118:8090/vehicle-lnSituation?"+this.code, "_blank"); window.open(
"http://47.100.49.118:8090/vehicle-lnSituation?" + this.code,
"_blank"
);
//window.open("http://127.0.0.1:9528/vehicle-lnSituation?"+this.code, "_blank"); //window.open("http://127.0.0.1:9528/vehicle-lnSituation?"+this.code, "_blank");
//window.open("http://192.168.0.219:9528/vehicle-lnSituation?"+this.code, "_blank"); //window.open("http://192.168.0.219:9528/vehicle-lnSituation?"+this.code, "_blank");
}, },
parseAdcodeLevel(adcode) { parseAdcodeLevel(adcode) {
const codeStr = String(adcode); const codeStr = String(adcode);
if (codeStr.endsWith('0000')) return 'province'; // 省级(如 440000 if (codeStr.endsWith("0000")) return "province"; // 省级(如 440000
if (codeStr.endsWith('00')) return 'city'; // 市级(如 440300 if (codeStr.endsWith("00")) return "city"; // 市级(如 440300
return 'district'; // 区县级(如 440305 return "district"; // 区县级(如 440305
}, },
getYearData() { getYearData() {
currentGET("big3").then((res) => { currentGET("big3").then((res) => {
console.log('年度碳减排量'); console.log("年度碳减排量");
console.log(res); console.log(res);
//this.maptitle = res.data.yearCarbon ; //单位kg //this.maptitle = res.data.yearCarbon ; //单位kg
this.maptitle = res.data.yearCarbonTon ; //单位吨 this.maptitle = res.data.yearCarbonTon; //单位吨
this.maptitle2 = '吨'; this.maptitle2 = "吨";
}); });
}, },
getData(code) { getData(code) {
console.log("code", code); console.log("code", code);
this.currentMap = this.parseAdcodeLevel(code); this.currentMap = this.parseAdcodeLevel(code);
//2025.9.10 szy 增加showType 分类处理1时处理车辆信息2时处理加氢站信息 //2025.9.10 szy 增加showType 分类处理1时处理车辆信息2时处理加氢站信息
if(this.showType === 1){ if (this.showType === 1) {
currentGET("big9", { regionCode: code, adcodeLevel: this.currentMap }).then((res) => { currentGET("big9", {
regionCode: code,
adcodeLevel: this.currentMap,
}).then((res) => {
console.log("map车辆分布", res); console.log("map车辆分布", res);
//if (res.success) //if (res.success)
if (res.status) { if (res.status) {
this.getGeojson(res.data.regionCode, res.data.dataList); this.getGeojson(res.data.regionCode, res.data.dataList);
this.mapclick(); this.mapclick();
} else { } else {
this.$Message.warning(res.msg); this.$Message.warning(
"获取车辆信息失败:" + (res.msg || "未知错误")
);
} }
}); });
}else if(this.showType === 2){ } else if (this.showType === 2) {
currentGET("big10", { regionCode: code, adcodeLevel: this.currentMap }).then((res) => { currentGET("big10", {
regionCode: code,
adcodeLevel: this.currentMap,
}).then((res) => {
console.log("加氢站_map分布", res); console.log("加氢站_map分布", res);
//if (res.success) //if (res.success)
if (res.status) { if (res.status) {
this.getGeojson2(res.data.regionCode, res.data.dataList); this.getGeojson2(res.data.regionCode, res.data.dataList);
this.mapclick(); this.mapclick();
} else { } else {
this.$Message.warning(res.msg); this.$Message.warning(
"获取加氢站信息失败:" + (res.msg || "未知错误")
);
} }
}); });
} }
@@ -142,27 +164,26 @@ export default {
async getGeojson(name, mydata) { async getGeojson(name, mydata) {
this.code = name; this.code = name;
this.currentMap = name; this.currentMap = name;
console.log('当前地图层级'); console.log("当前地图层级");
console.log(this.currentMap); console.log(this.currentMap);
//如果要展示南海群岛并且展示的是中国的话 //如果要展示南海群岛并且展示的是中国的话
let geoname=name let geoname = name;
if (this.isSouthChinaSea && name == "china") { if (this.isSouthChinaSea && name == "china") {
geoname = "chinaNanhai"; geoname = "chinaNanhai";
} }
//如果有注册地图的话就不用再注册 了 //如果有注册地图的话就不用再注册 了
let mapjson = echarts.getMap(name); let mapjson = echarts.getMap(name);
console.log('已经是否已存在的地图数据'); console.log("已经是否已存在的地图数据");
if (mapjson) { if (mapjson) {
mapjson = mapjson.geoJson; mapjson = mapjson.geoJson;
} } else {
else
{
//console.log('当前未注册地图'); //console.log('当前未注册地图');
mapjson = await GETNOBASE(`./map-geojson/${geoname}.json`).then((res) => { mapjson = await GETNOBASE(`./map-geojson/${geoname}.json`).then(
(res) => {
return res; return res;
}); }
);
echarts.registerMap(name, mapjson); echarts.registerMap(name, mapjson);
} }
console.log(mapjson); console.log(mapjson);
let cityCenter = {}; let cityCenter = {};
@@ -176,29 +197,33 @@ export default {
let newData = []; let newData = [];
mydata.map((item) => { mydata.map((item) => {
if (cityCenter[item.name]) { if (cityCenter[item.name]) {
if(item.vehicleTotal===undefined || item.vehicleTotal===null ){ if (item.vehicleTotal === undefined || item.vehicleTotal === null) {
item.vehicleTotal = 0; item.vehicleTotal = 0;
} }
if(item.onLineCount===undefined || item.onLineCount===null){ if (item.onLineCount === undefined || item.onLineCount === null) {
item.onLineCount = 0; item.onLineCount = 0;
} }
if(item.dayMileage===undefined || item.dayMileage===null){ if (item.dayMileage === undefined || item.dayMileage === null) {
item.dayMileage = 0; item.dayMileage = 0;
} }
if(item.dayHydrogen===undefined || item.dayHydrogen===null){ if (item.dayHydrogen === undefined || item.dayHydrogen === null) {
item.dayHydrogen = 0; item.dayHydrogen = 0;
} }
if(item.dayCarbon===undefined || item.dayCarbon===null){ if (item.dayCarbon === undefined || item.dayCarbon === null) {
item.dayCarbon = 0; item.dayCarbon = 0;
} }
newData.push({ newData.push({
name: item.name, name: item.name,
value: cityCenter[item.name].concat(item.vehicleTotal).concat(item.onLineCount).concat(item.dayMileage).concat(item.dayHydrogen).concat(item.dayCarbon), value: cityCenter[item.name]
.concat(item.vehicleTotal)
.concat(item.onLineCount)
.concat(item.dayMileage)
.concat(item.dayHydrogen)
.concat(item.dayCarbon),
}); });
} }
}); });
console.log('开始初始化地图'); console.log("开始初始化地图");
console.log(newData); console.log(newData);
this.init(name, mydata, newData); this.init(name, mydata, newData);
}, },
@@ -211,27 +236,26 @@ export default {
async getGeojson2(name, mydata) { async getGeojson2(name, mydata) {
this.code = name; this.code = name;
this.currentMap = name; this.currentMap = name;
console.log('加氢站_当前地图层级'); console.log("加氢站_当前地图层级");
console.log(this.currentMap); console.log(this.currentMap);
//如果要展示南海群岛并且展示的是中国的话 //如果要展示南海群岛并且展示的是中国的话
let geoname=name let geoname = name;
if (this.isSouthChinaSea && name == "china") { if (this.isSouthChinaSea && name == "china") {
geoname = "chinaNanhai"; geoname = "chinaNanhai";
} }
//如果有注册地图的话就不用再注册 了 //如果有注册地图的话就不用再注册 了
let mapjson = echarts.getMap(name); let mapjson = echarts.getMap(name);
console.log('加氢站_已经是否已存在的地图数据'); console.log("加氢站_已经是否已存在的地图数据");
if (mapjson) { if (mapjson) {
mapjson = mapjson.geoJson; mapjson = mapjson.geoJson;
} } else {
else
{
//console.log('当前未注册地图'); //console.log('当前未注册地图');
mapjson = await GETNOBASE(`./map-geojson/${geoname}.json`).then((res) => { mapjson = await GETNOBASE(`./map-geojson/${geoname}.json`).then(
(res) => {
return res; return res;
}); }
);
echarts.registerMap(name, mapjson); echarts.registerMap(name, mapjson);
} }
console.log(mapjson); console.log(mapjson);
let cityCenter = {}; let cityCenter = {};
@@ -245,20 +269,24 @@ export default {
let newData = []; let newData = [];
mydata.map((item) => { mydata.map((item) => {
if (cityCenter[item.name]) { if (cityCenter[item.name]) {
if(item.siteTotalCount===undefined || item.siteTotalCount===null ){ if (
item.siteTotalCount === undefined ||
item.siteTotalCount === null
) {
item.siteTotalCount = 0; item.siteTotalCount = 0;
} }
if(item.siteCount===undefined || item.siteCount===null){ if (item.siteCount === undefined || item.siteCount === null) {
item.siteCount = 0; item.siteCount = 0;
} }
newData.push({ newData.push({
name: item.name, name: item.name,
value: cityCenter[item.name].concat(item.siteTotalCount).concat(item.siteCount), value: cityCenter[item.name]
.concat(item.siteTotalCount)
.concat(item.siteCount),
}); });
} }
}); });
console.log('加氢站_开始初始化地图'); console.log("加氢站_开始初始化地图");
console.log(newData); console.log(newData);
this.init2(name, mydata, newData); this.init2(name, mydata, newData);
}, },
@@ -291,7 +319,7 @@ export default {
{ gte: 500, label: "500 辆以上" }, // 不指定 max表示 max 为无限大Infinity { gte: 500, label: "500 辆以上" }, // 不指定 max表示 max 为无限大Infinity
{ gte: 100, lte: 500, label: "100-500 辆" }, { gte: 100, lte: 500, label: "100-500 辆" },
{ gte: 50, lte: 100, label: "50-100 辆" }, { gte: 50, lte: 100, label: "50-100 辆" },
{ lte: 50, label: "1-50 辆" },// 不指定 min表示 min 为无限大(-Infinity { lte: 50, label: "1-50 辆" }, // 不指定 min表示 min 为无限大(-Infinity
], ],
inRange: { inRange: {
// 渐变颜色,从小到大 // 渐变颜色,从小到大
@@ -334,6 +362,7 @@ export default {
zoom: zoom, zoom: zoom,
geoIndex: 1, geoIndex: 1,
top: top, top: top,
showLegendSymbol: false, // 存在legend时显示
tooltip: { tooltip: {
show: true, show: true,
formatter: function (params) { formatter: function (params) {
@@ -347,7 +376,7 @@ export default {
return params.name; return params.name;
} }
}, },
backgroundColor: "rgba(0,0,0,.6)", backgroundColor: "rgba(255,255,255,0.8)",
borderColor: "rgba(147, 235, 248, .8)", borderColor: "rgba(147, 235, 248, .8)",
textStyle: { textStyle: {
color: "#333333", color: "#333333",
@@ -367,7 +396,8 @@ export default {
}, },
rich: {}, rich: {},
}, },
emphasis: { //高亮时显示 emphasis: {
//高亮时显示
label: { label: {
show: false, show: false,
}, },
@@ -404,10 +434,13 @@ export default {
}, },
{ {
data: data2, data: data2,
type: "effectScatter",
type: "scatter",
coordinateSystem: "geo", coordinateSystem: "geo",
symbol:
"image://https://lnh2etest.oss-cn-shanghai.aliyuncs.com/truck25.png",
symbolSize: function (val) { symbolSize: function (val) {
return 4; return 20;
// return val[2] / 50; // return val[2] / 50;
}, },
legendHoverLink: true, legendHoverLink: true,
@@ -427,12 +460,31 @@ export default {
if (params.data) { if (params.data) {
console.log("params.data"); console.log("params.data");
console.log(params.data); console.log(params.data);
console.log(params.data.name + "\n 车辆总数:"+params.data["value"][2] + "\n GPS在线总数" + params.data["value"][3]); console.log(
return params.data.name + "<br> 车辆总数:"+params.data["value"][2] + "<br> GPS在线总数" + params.data["value"][3] + "<br>当日里程: " + params.data["value"][4] + "km<br>当日用量: " + params.data["value"][5] + "kg<br>当日减碳: " + params.data["value"][6] + "kg"; params.data.name +
"\n 车辆总数:" +
params.data["value"][2] +
"\n GPS在线总数" +
params.data["value"][3]
);
return (
params.data.name +
"<br> 车辆总数:" +
params.data["value"][2] +
"<br> GPS在线总数" +
params.data["value"][3] +
"<br>当日里程: " +
params.data["value"][4] +
"km<br>当日用量: " +
params.data["value"][5] +
"kg<br>当日减碳: " +
params.data["value"][6] +
"kg"
);
//return '${params.name} <br />车辆总数:${params.data[value][2]} <br /> GPS在线总数${ params.data.[value][3]}'; //return '${params.name} <br />车辆总数:${params.data[value][2]} <br /> GPS在线总数${ params.data.[value][3]}';
} }
}, },
backgroundColor: "rgba(0,0,0,.6)", backgroundColor: "rgba(255,255,255,0.8)",
borderColor: "rgba(147, 235, 248, .8)", borderColor: "rgba(147, 235, 248, .8)",
textStyle: { textStyle: {
color: "#333333", color: "#333333",
@@ -442,7 +494,7 @@ export default {
formatter: (param) => { formatter: (param) => {
//return param.name.slice(0, 2) + "\n 车辆总数:"+param.data["value"][2] + "\n GPS在线数"+param.data["value"][3]; //2025.03.28 //return param.name.slice(0, 2) + "\n 车辆总数:"+param.data["value"][2] + "\n GPS在线数"+param.data["value"][3]; //2025.03.28
//return param.name.slice(0, 2) + "\n "+param.data["value"][2]; //2025.03.31 //return param.name.slice(0, 2) + "\n "+param.data["value"][2]; //2025.03.31
return param.name.slice(0, 2) ; return param.name.slice(0, 2);
}, },
fontSize: 11, fontSize: 11,
offset: [0, 2], offset: [0, 2],
@@ -455,13 +507,6 @@ export default {
show: true, show: true,
}, },
// colorBy: "data", // colorBy: "data",
itemStyle: {
color: "rgba(255,255,255,1)",
borderColor: "rgba(2255,255,255,2)",
borderWidth: 4,
shadowColor: "#000",
shadowBlur: 10,
},
}, },
], ],
//动画效果 //动画效果
@@ -494,7 +539,7 @@ export default {
{ gte: 100, label: "100 座以上" }, // 不指定 max表示 max 为无限大Infinity { gte: 100, label: "100 座以上" }, // 不指定 max表示 max 为无限大Infinity
{ gte: 30, lte: 100, label: "30-100 座" }, { gte: 30, lte: 100, label: "30-100 座" },
{ gte: 10, lte: 30, label: "10-30 座" }, { gte: 10, lte: 30, label: "10-30 座" },
{ lte: 10, label: "1-10 座" },// 不指定 min表示 min 为无限大(-Infinity { lte: 10, label: "1-10 座" }, // 不指定 min表示 min 为无限大(-Infinity
], ],
inRange: { inRange: {
// 渐变颜色,从小到大 // 渐变颜色,从小到大
@@ -534,6 +579,7 @@ export default {
data: data, data: data,
//data: [1,100], //data: [1,100],
selectedMode: false, //是否允许选中多个区域 selectedMode: false, //是否允许选中多个区域
showLegendSymbol: false, // 存在legend时显示
zoom: zoom, zoom: zoom,
geoIndex: 1, geoIndex: 1,
top: top, top: top,
@@ -550,7 +596,7 @@ export default {
return params.name; return params.name;
} }
}, },
backgroundColor: "rgba(0,0,0,.6)", backgroundColor: "rgba(255,255,255,0.8)",
borderColor: "rgba(147, 235, 248, .8)", borderColor: "rgba(147, 235, 248, .8)",
textStyle: { textStyle: {
color: "#333333", color: "#333333",
@@ -570,7 +616,8 @@ export default {
}, },
rich: {}, rich: {},
}, },
emphasis: { //高亮时显示 emphasis: {
//高亮时显示
label: { label: {
show: false, show: false,
}, },
@@ -607,10 +654,18 @@ export default {
}, },
{ {
data: data2, data: data2,
type: "effectScatter", // type: "effectScatter",
// coordinateSystem: "geo",
// symbolSize: function (val) {
// return 4;
// // return val[2] / 50;
// },
type: "scatter",
coordinateSystem: "geo", coordinateSystem: "geo",
symbol:
"image://https://lnh2etest.oss-cn-shanghai.aliyuncs.com/station25.png",
symbolSize: function (val) { symbolSize: function (val) {
return 4; return 20;
// return val[2] / 50; // return val[2] / 50;
}, },
legendHoverLink: true, legendHoverLink: true,
@@ -630,11 +685,23 @@ export default {
if (params.data) { if (params.data) {
console.log("params.data"); console.log("params.data");
console.log(params.data); console.log(params.data);
console.log(params.data.name + "\n 加氢站总数:"+params.data["value"][2] + "\n 当前运营总数:" + params.data["value"][3]); console.log(
return params.data.name + "<br> 加氢站总数:"+params.data["value"][2] + "<br> 当前运营总数: " + params.data["value"][3]; params.data.name +
"\n 加氢站总数:" +
params.data["value"][2] +
"\n 当前运营总数:" +
params.data["value"][3]
);
return (
params.data.name +
"<br> 加氢站总数:" +
params.data["value"][2] +
"<br> 当前运营总数: " +
params.data["value"][3]
);
} }
}, },
backgroundColor: "rgba(0,0,0,.6)", backgroundColor: "rgba(255,255,255,0.8)",
borderColor: "rgba(147, 235, 248, .8)", borderColor: "rgba(147, 235, 248, .8)",
textStyle: { textStyle: {
color: "#333333", color: "#333333",
@@ -644,7 +711,7 @@ export default {
formatter: (param) => { formatter: (param) => {
//return param.name.slice(0, 2) + "\n 车辆总数:"+param.data["value"][2] + "\n GPS在线数"+param.data["value"][3]; //2025.03.28 //return param.name.slice(0, 2) + "\n 车辆总数:"+param.data["value"][2] + "\n GPS在线数"+param.data["value"][3]; //2025.03.28
//return param.name.slice(0, 2) + "\n "+param.data["value"][2]; //2025.03.31 //return param.name.slice(0, 2) + "\n "+param.data["value"][2]; //2025.03.31
return param.name.slice(0, 2) ; return param.name.slice(0, 2);
}, },
fontSize: 11, fontSize: 11,
offset: [0, 2], offset: [0, 2],
@@ -657,13 +724,13 @@ export default {
show: true, show: true,
}, },
// colorBy: "data", // colorBy: "data",
itemStyle: { // itemStyle: {
color: "rgba(255,255,255,1)", // color: "rgba(255,255,255,1)",
borderColor: "rgba(2255,255,255,2)", // borderColor: "rgba(2255,255,255,2)",
borderWidth: 4, // borderWidth: 4,
shadowColor: "#000", // shadowColor: "#000",
shadowBlur: 10, // shadowBlur: 10,
}, // },
}, },
], ],
//动画效果 //动画效果
@@ -692,7 +759,7 @@ export default {
} }
}); });
this.echartBindClick = true; this.echartBindClick = true;
} },
}, },
destroyed() { destroyed() {
// 销毁事件监听 // 销毁事件监听

View File

@@ -21,7 +21,7 @@
<div class="platform-circle"></div> <div class="platform-circle"></div>
<!-- 图标本身此处用Unicode或自定义图标 --> <!-- 图标本身此处用Unicode或自定义图标 -->
<div class="icon"> <div class="icon">
<img src="@/assets/img/left/1.svg" class="images"/> <img src="@/assets/img/left/1.svg" class="images" />
</div> </div>
</div> </div>
</div> </div>
@@ -45,7 +45,7 @@
<div class="platform-circle"></div> <div class="platform-circle"></div>
<!-- 图标本身此处用Unicode或自定义图标 --> <!-- 图标本身此处用Unicode或自定义图标 -->
<div class="icon"> <div class="icon">
<img src="@/assets/img/left/2.svg" class="images"/> <img src="@/assets/img/left/2.svg" class="images" />
</div> </div>
</div> </div>
</div> </div>
@@ -69,7 +69,7 @@
<div class="platform-circle"></div> <div class="platform-circle"></div>
<!-- 图标本身此处用Unicode或自定义图标 --> <!-- 图标本身此处用Unicode或自定义图标 -->
<div class="icon"> <div class="icon">
<img src="@/assets/img/left/3.svg" class="images"/> <img src="@/assets/img/left/3.svg" class="images" />
</div> </div>
</div> </div>
</div> </div>
@@ -93,17 +93,17 @@
<div class="platform-circle"></div> <div class="platform-circle"></div>
<!-- 图标本身此处用Unicode或自定义图标 --> <!-- 图标本身此处用Unicode或自定义图标 -->
<div class="icon"> <div class="icon">
<img src="@/assets/img/left/4.svg" class="images"/> <img src="@/assets/img/left/4.svg" class="images" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { currentGET } from 'api/modules' import { currentGET } from "api/modules";
export default { export default {
name: "BlinkingIcons", name: "BlinkingIcons",
data() { data() {
return { return {
@@ -130,7 +130,7 @@
srcValue: "@/assets/img/left/1.svg", srcValue: "@/assets/img/left/1.svg",
}, },
{ {
id:4, id: 4,
value: "3300", value: "3300",
unit: "km", unit: "km",
label: "当日里程", label: "当日里程",
@@ -145,7 +145,7 @@
methods: { methods: {
getData() { getData() {
currentGET("big1").then((res) => { currentGET("big1").then((res) => {
console.log('当日实况'); console.log("当日实况");
console.log(res); console.log(res);
let onLineCount = 0; let onLineCount = 0;
let vehicleCount = 0; let vehicleCount = 0;
@@ -153,18 +153,13 @@
let dayHydrogen = 0; let dayHydrogen = 0;
let dayMileage = 0; let dayMileage = 0;
if(res !==null && res.data !==null ) if (res !== null && res.data !== null) {
{ if (res.data.onLineCount !== null) onLineCount = res.data.onLineCount;
if(res.data.onLineCount !== null) if (res.data.vehicleCount !== null)
onLineCount = res.data.onLineCount;
if(res.data.vehicleCount !== null)
vehicleCount = res.data.vehicleCount; vehicleCount = res.data.vehicleCount;
if(res.data.dayCarbon !== null) if (res.data.dayCarbon !== null) dayCarbon = res.data.dayCarbon;
dayCarbon = res.data.dayCarbon; if (res.data.dayHydrogen !== null) dayHydrogen = res.data.dayHydrogen;
if(res.data.dayHydrogen !== null) if (res.data.dayMileage !== null) dayMileage = res.data.dayMileage;
dayHydrogen = res.data.dayHydrogen;
if(res.data.dayMileage !== null)
dayMileage = res.data.dayMileage;
} }
let change = this.cards[0]; let change = this.cards[0];
@@ -182,13 +177,13 @@
this.$set(this.cards, 3, change); this.$set(this.cards, 3, change);
}); });
}, },
} },
}; };
</script> </script>
<style scoped> <style scoped>
/* 整体背景 */ /* 整体背景 */
.cards-container { .cards-container {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: flex-end; align-items: flex-end;
@@ -200,50 +195,50 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0% 100%; background-position: 0% 100%;
} }
.images{ .images {
width: 65px; width: 65px;
height: 70px; height: 70px;
margin-left: 10px; margin-left: 10px;
margin-top: -5px; margin-top: -5px;
} }
/* 单个卡片 */ /* 单个卡片 */
.card { .card {
position: relative; position: relative;
width: 180px; width: 180px;
text-align: center; text-align: center;
color: #333333; color: #333333;
} }
/* 卡片信息区域 */ /* 卡片信息区域 */
.card-info { .card-info {
margin-bottom: 120px; /* 给下方图标区域留出空间 */ margin-bottom: 120px; /* 给下方图标区域留出空间 */
margin-left:10px; margin-left: 10px;
} }
.value-line { .value-line {
font-size: 20px; font-size: 20px;
margin-bottom: 8px; margin-bottom: 8px;
width:120px; width: 120px;
} }
.number { .number {
font-weight: 700;
color: #1976d2; /* 高亮数字颜色 */ color: #1976d2; /* 高亮数字颜色 */
margin-right: 6px; margin-right: 6px;
}
} .unit {
.unit {
font-size: 14px; font-size: 14px;
opacity: 0.8; opacity: 0.8;
} }
.label { .label {
font-size: 16px; font-size: 16px;
color: #666666; color: #666666;
} }
/* 图标容器 */ /* 图标容器 */
.icon-wrapper { .icon-wrapper {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 54%; left: 54%;
@@ -251,10 +246,10 @@
width: 100%; width: 100%;
height: 100px; height: 100px;
overflow: visible; overflow: visible;
} }
/* 背后闪动的竖直矩形 */ /* 背后闪动的竖直矩形 */
.icon-bg { .icon-bg {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 50%; left: 50%;
@@ -267,23 +262,22 @@
background-repeat: no-repeat; background-repeat: no-repeat;
animation: blink 1s infinite alternate; animation: blink 1s infinite alternate;
top: -15%; top: -15%;
} }
.icon-bg-0 { .icon-bg-0 {
animation-delay: 0s; animation-delay: 0s;
} }
.icon-bg-1 { .icon-bg-1 {
animation-delay: 0.2s; animation-delay: 0.2s;
} }
.icon-bg-2 { .icon-bg-2 {
animation-delay: 0.4s; animation-delay: 0.4s;
} }
.icon-bg-3 { .icon-bg-3 {
animation-delay: 0.6s; animation-delay: 0.6s;
} }
/* 圆形平台 */
/* 圆形平台 */ .platform-circle {
.platform-circle {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 50%; left: 50%;
@@ -293,40 +287,39 @@
background: radial-gradient(rgba(25, 118, 210, 0.3), transparent 70%); background: radial-gradient(rgba(25, 118, 210, 0.3), transparent 70%);
border-radius: 50%; border-radius: 50%;
box-shadow: 0 0 8px rgba(25, 118, 210, 0.4), 0 0 12px rgba(25, 118, 210, 0.3); box-shadow: 0 0 8px rgba(25, 118, 210, 0.4), 0 0 12px rgba(25, 118, 210, 0.3);
} }
/* 图标 */ /* 图标 */
.icon { .icon {
position: absolute; position: absolute;
bottom: -5px; bottom: -5px;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
font-size: 28px; font-size: 28px;
color: #1976d2; color: #1976d2;
} }
/* 关键帧动画:闪动 */ /* 关键帧动画:闪动 */
@keyframes blink { @keyframes blink {
0% { 0% {
opacity: 0.5; opacity: 0.5;
} }
100% { 100% {
opacity: 1; opacity: 1;
} }
} }
/* 图标模拟,可用 Font Awesome 等替换 */ /* 图标模拟,可用 Font Awesome 等替换 */
.icon-phone::before { .icon-phone::before {
content: "☎"; content: "☎";
} }
.icon-shield::before { .icon-shield::before {
content: "⛨"; content: "⛨";
} }
.icon-star::before { .icon-star::before {
content: "★"; content: "★";
} }
.icon-protect::before { .icon-protect::before {
content: "🛡"; content: "🛡";
} }
</style> </style>