diff --git a/.env.production b/.env.production index 5116935..94a9118 100644 --- a/.env.production +++ b/.env.production @@ -5,7 +5,7 @@ VITE_APP_TITLE = 若依管理系统 VITE_APP_ENV = 'production' #生产环境 -VITE_APP_BASE_API = '/prod-api' +VITE_APP_BASE_API = '' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip \ No newline at end of file diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..8171b16 Binary files /dev/null and b/dist.zip differ diff --git a/public/ChangDaobuild/Build/build.data.unityweb b/public/ChangDaobuild/Build/build.data.unityweb index fe1dfbd..80b8d6a 100644 Binary files a/public/ChangDaobuild/Build/build.data.unityweb and b/public/ChangDaobuild/Build/build.data.unityweb differ diff --git a/public/ChangDaobuild/Build/build.framework.js.unityweb b/public/ChangDaobuild/Build/build.framework.js.unityweb index 82be8ee..65c39ff 100644 Binary files a/public/ChangDaobuild/Build/build.framework.js.unityweb and b/public/ChangDaobuild/Build/build.framework.js.unityweb differ diff --git a/public/ChangDaobuild/Build/build.wasm.unityweb b/public/ChangDaobuild/Build/build.wasm.unityweb index 9c76507..4ec95a9 100644 Binary files a/public/ChangDaobuild/Build/build.wasm.unityweb and b/public/ChangDaobuild/Build/build.wasm.unityweb differ diff --git a/public/ChangDaobuild/StreamingAssets/ipConfig.json b/public/ChangDaobuild/StreamingAssets/ipConfig.json new file mode 100644 index 0000000..20af504 --- /dev/null +++ b/public/ChangDaobuild/StreamingAssets/ipConfig.json @@ -0,0 +1,3 @@ +{ + "loginIp": "http://localhost:8011/api/GetDrainHeading" +} \ No newline at end of file diff --git a/public/ChangDaobuild/index.html b/public/ChangDaobuild/index.html index 33347a1..4fa856f 100644 --- a/public/ChangDaobuild/index.html +++ b/public/ChangDaobuild/index.html @@ -6,7 +6,8 @@
{{ item.name }}
-{{ item.value }}
++ {{ + item.value > 10000 + ? (item.value / 10000).toFixed(3) + : item.value > 100000000 + ? (item.value / 100000000).toFixed(3) + : item.value + }} + {{ + item.value > 10000 ? "万" : item.value > 100000000 ? "亿" : "" + }} +
- 全开
+ > -->
{
height: 4.375rem;
}
}
-
+.light-item:nth-child(2n){
+ padding-left: 1.2rem;
+}
.light-item {
display: flex;
flex-basis: 50%;
@@ -1044,12 +1094,17 @@ onMounted(() => {
display: block;
font-size: 0.75rem;
}
+ .num{
+ font-family: 'D-DIN-Bold';
+ font-size: 1.25rem;
+ }
}
}
//照明回路详情
.state0,
-.state1 {
+.state1,
+.state2 {
width: 1.1rem;
height: 1.1rem;
display: block;
@@ -1064,6 +1119,9 @@ onMounted(() => {
.state1 {
background-image: url("@/assets/images/lighting/state1.png");
}
+.state2 {
+ background-image: url("@/assets/images/lighting/state2.png");
+}
//照明控制
.control {
diff --git a/src/views/overview/index.vue b/src/views/overview/index.vue
index 080e3c3..335f484 100644
--- a/src/views/overview/index.vue
+++ b/src/views/overview/index.vue
@@ -11,8 +11,7 @@ import {
getSystemRanking,
} from "@/api/overview";
import getPath from "@/utils/getPath.js";
-
-console.log(getPath)
+const emit = defineEmits(["getHeart"]);
// 实时负荷
const realTimeLoad = ref([
{ pic: getPath.roomnum, name: "配电室数量", value: 8, unit: "个" },
@@ -21,17 +20,17 @@ const realTimeLoad = ref([
]);
// 气象站
const weatherStation = ref([
- { pic: getPath.rain, name: "雨量", value: 100, unit: "mm" },
- { pic: getPath.rainsnow, name: "雨雪", value: "实际取值", unit: "mm" },
+ { pic: getPath.rain, name: "雨量", value: 100 },
+ { pic: getPath.rainsnow, name: "雨雪", value: "实际取值" },
{ pic: getPath.wind, name: "风向", value: "东南风" },
- { pic: getPath.illuminance, name: "光照度", value: 101, unit: "lux" },
- { pic: getPath.windspeed, name: "风速", value: "东南风3级" },
- { pic: getPath.air, name: "空气质量", value: "优" },
+ { pic: getPath.illuminance, name: "光照度", value: 101, unit: "万Lux" },
+ { pic: getPath.windspeed, name: "风速", value: "东南风3级", unit: "m/s" },
+ { pic: getPath.air, name: "空气质量", value: "优", unit: "ug/m³" },
]);
// const getImageUrl=(name)=>{
// return `url(${new URL(name, import.meta.url).href})`
// }
-
+const windList = ref(["北", "东北", "东", "东南", "南", "西南", "西", "西北"]);
// 用电量列表
const powerList = ref([]);
onMounted(() => {
@@ -49,7 +48,7 @@ onMounted(() => {
// getCarbonEmissionEcahrts();
});
// 用电量时间切换
-const powerDate = ref("year");
+const powerDate = ref("month");
const togglePower = (event) => {
powerDate.value = event.srcElement.className;
@@ -63,10 +62,21 @@ const toggleCarbonEmission = (event) => {
CarbonEmissionInterface();
};
const drawPowerEcharts = (item) => {
- let myChart = echarts.init(document.getElementById("power"));
+ let dom = document.getElementById("power");
+ dom.removeAttribute("_echarts_instance_");
+ let myChart;
+ myChart = echarts.init(dom);
+ // let myChart = echarts.init(document.getElementById("power"));
const option = {
// backgroundColor: "#05224d",
- tooltip: {},
+ tooltip: {
+ trigger: "axis",
+ axisPointer: {
+ lineStyle: {
+ color: "#57617B",
+ },
+ },
+ },
grid: {
top: "18%",
left: "4%",
@@ -86,6 +96,7 @@ const drawPowerEcharts = (item) => {
// color: "#233e64",
},
},
+
axisLabel: {
//坐标轴刻度标签的相关设置
textStyle: {
@@ -108,15 +119,14 @@ const drawPowerEcharts = (item) => {
name: "单位:kWh",
nameTextStyle: {
color: "#DDFFFD",
+ padding: [0, 15, 0, 0],
},
- min: 0,
- max: 500,
splitNumber: 5,
splitLine: {
show: true,
lineStyle: {
type: "dashed",
- color: "rgba(1, 39, 37, 0.30)",
+ color: "rgba(255, 255, 255, 0.20)",
},
},
axisLine: { show: false },
@@ -124,23 +134,39 @@ const drawPowerEcharts = (item) => {
textStyle: {
color: "#DDFFFD",
},
+ // 使用formatter格式化y轴的标签
+ formatter: function (value) {
+ // 如果数值大于1000,则以千位分隔
+ if (value >= 1000) {
+ return value / 10000 + "万";
+ } else if (value >= 10000000) {
+ return value / 100000000 + "亿";
+ } else {
+ return value;
+ }
+ },
},
axisTick: { show: false },
},
],
series: [
{
- name: "异常流量",
+ name: "用电量",
type: "line",
smooth: true, //是否平滑曲线显示
- // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆
- symbolSize: 0,
-
+ symbol: "circle", // 默认是空心圆(中间是白色的),改成实心圆
+ // symbolSize: 8,
+ showSymbol: true,
lineStyle: {
normal: {
color: "#5BFAF1", // 线条颜色
},
},
+ itemStyle: {
+ normal: {
+ color: "#5BFAF1",
+ },
+ },
areaStyle: {
//区域填充样式
normal: {
@@ -175,7 +201,15 @@ const drawPowerEcharts = (item) => {
});
};
const drawRankEcharts = (data) => {
- let myChart = echarts.init(document.getElementById("rank"));
+ let total = 0;
+ data.forEach((el) => {
+ total += el.EH;
+ });
+ let dom = document.getElementById("rank");
+ dom.removeAttribute("_echarts_instance_");
+ let myChart;
+ myChart = echarts.init(dom);
+ // let myChart = echarts.init(document.getElementById("rank"));
let option = {
grid: {
left: "5%",
@@ -196,16 +230,15 @@ const drawRankEcharts = (data) => {
"" +
params[0].seriesName +
" : " +
- Number(
- (params[0].value.toFixed(4) / 10000).toFixed(2)
- ).toLocaleString() +
- " 万元
- {{ item.value }}
+ {{
+ item.value
+ }}
{{ item.unit }}
"
+ Number(params[0].value).toLocaleString() +
+ " kWh
"
);
},
},
xAxis: {
show: false,
type: "value",
+ max: total,
},
yAxis: [
{
@@ -247,7 +280,7 @@ const drawRankEcharts = (data) => {
inside: true,
textStyle: {},
formatter: function (value) {
- return "{a|" + (value / 10000).toLocaleString() + "}" + "{b|kWh}";
+ return "{a|" + value + "}" + "{b|kWh}";
},
rich: {
a: {
@@ -269,7 +302,7 @@ const drawRankEcharts = (data) => {
],
series: [
{
- name: "金额",
+ name: "用电",
type: "bar",
zlevel: 1,
itemStyle: {
@@ -295,8 +328,10 @@ const drawRankEcharts = (data) => {
type: "bar",
barWidth: 10,
barGap: "-115%",
- data: [50000000, 50000000, 50000000, 50000000, 50000000],
+ data: [total, total, total, total, total],
itemStyle: {
+ borderColor:'rgba(4, 24, 44, 1)',
+ borderWidth:2,
color: "rgba(5, 33, 31, 0.32)",
},
},
@@ -394,7 +429,11 @@ function getCarbonEmissionEcahrts(data) {
["rgba(0, 255, 140, 1)", "rgba(0, 255, 140,0)"],
["rgba(0, 255, 140, 1)", "rgba(0, 255, 140,0)"],
];
- let myChart = echarts.init(document.getElementById("carbonEmission"));
+ let dom = document.getElementById("carbonEmission");
+ dom.removeAttribute("_echarts_instance_");
+ let myChart;
+ myChart = echarts.init(dom);
+ // let myChart = echarts.init(document.getElementById("carbonEmission"));
const option = {
tooltip: {
trigger: "axis",
@@ -417,13 +456,15 @@ function getCarbonEmissionEcahrts(data) {
type: "category",
data: xAxisData,
axisLine: {
+ //坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
- width: 1,
- type: "solid",
- color: "rgba(255, 255, 255, 0.20)",
+ // type:'dashed',
+ color: "#557775",
+ // color: "#233e64",
},
},
+
axisTick: {
show: false,
},
@@ -446,7 +487,7 @@ function getCarbonEmissionEcahrts(data) {
},
yAxis: {
type: "value",
- name: "单位:kWh",
+ name: "单位:tCO₂",
nameTextStyle: {
color: "#DDFFFD",
padding: [0, 5, 0, 0],
@@ -461,7 +502,7 @@ function getCarbonEmissionEcahrts(data) {
show: true,
lineStyle: {
type: "dashed",
- color: "rgba(1, 39, 37, 0.30)",
+ color: "rgba(255, 255, 255, 0.20)",
},
},
// y轴刻度线
@@ -472,6 +513,17 @@ function getCarbonEmissionEcahrts(data) {
axisLabel: {
fontSize: 12,
color: "#DDFFFD",
+ // 使用formatter格式化y轴的标签
+ formatter: function (value) {
+ // 如果数值大于1000,则以千位分隔
+ if (value >= 1000) {
+ return value / 10000 + "万";
+ } else if (value >= 10000000) {
+ return value / 100000000 + "亿";
+ } else {
+ return value;
+ }
+ },
},
},
series: [
@@ -594,7 +646,7 @@ const powerInterface = () => {
};
getPower(params).then((res) => {
// 渲染用电量图表
- drawPowerEcharts(res.data);
+ drawPowerEcharts(res.data.slice(-10));
});
};
// 获取实时负荷
@@ -614,10 +666,19 @@ const realtimeLoadInterface = () => {
// 获取气象站数据
const stationInterface = () => {
getMeteorologicalStation().then((res) => {
+ res.data.forEach((el) => {
+ if (el.name === "空气温度") {
+ emit("getHeart", el.value);
+ }
+ });
weatherStation.value.forEach((item) => {
res.data.forEach((el) => {
if (el.name.indexOf(item.name) !== -1) {
- item.value = el.value;
+ if (el.name === "光照度") {
+ item.value = (el.value / 10000).toFixed(2);
+ } else {
+ item.value = el.value;
+ }
}
});
});
@@ -638,7 +699,6 @@ const CarbonEmissionInterface = () => {
getCarbonEmissionEcahrts(res.data);
});
};
-
@@ -704,9 +764,11 @@ const CarbonEmissionInterface = () => {
v-for="(item, index) in realTimeLoad"
:style="'background-image:url(' + item.pic + ')'"
>
- {{ item.name }}
+ {{ item.name }}
- {{ item.value }}{{ item.unit }} + {{ item.value }} + + {{ windList[index] }} + + {{ item.unit }}
@@ -757,7 +831,7 @@ const CarbonEmissionInterface = () => { box-sizing: border-box; .value { margin-right: 0.7rem; - font-size: 1.5rem; + font-size: 1.875rem; font-weight: 700; color: rgba(91, 250, 241, 1); } diff --git a/vite.config.js b/vite.config.js index d12589f..4682708 100644 --- a/vite.config.js +++ b/vite.config.js @@ -23,7 +23,7 @@ export default defineConfig({ proxy: { // https://cn.vitejs.dev/config/#server-proxy '/dev-api': { - target: 'http://172.16.1.134:8021/', + target: 'http://172.16.1.253:1234/', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') }