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 @@ Unity WebGL Player | CD - \ No newline at end of file diff --git a/src/views/energyEfficiency/index.vue b/src/views/energyEfficiency/index.vue index fe71875..786d3eb 100644 --- a/src/views/energyEfficiency/index.vue +++ b/src/views/energyEfficiency/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/lighting/components/dialog.vue b/src/views/lighting/components/dialog.vue index 37540a7..6bc2acf 100644 --- a/src/views/lighting/components/dialog.vue +++ b/src/views/lighting/components/dialog.vue @@ -11,40 +11,40 @@ const toggleControl = (event) => { name: props.name, value: "全关", }; - lightControl.value.forEach((ele) => { - setSingleSwitch(dataMap) - .then((res) => { - if (res.code == 200) { + + setSingleSwitch(dataMap) + .then((res) => { + if (res.code == 200) { + lightControl.value.forEach((ele) => { ele.State = false; - } else { - return false; - } - }) - .catch((err) => { - console.log(err); - }); - }); + }); + } else { + return false; + } + }) + .catch((err) => { + console.log(err); + }); } else if (event.srcElement.className === "on") { controlBtn.value = "on"; - lightControl.value.forEach((ele) => { - let dataMap = { - name: props.name, - value: "全开", - }; - lightControl.value.forEach((ele) => { - setSingleSwitch(dataMap) - .then((res) => { - if (res.code == 200) { - ele.State = true; - } else { - return false; - } - }) - .catch((err) => { - console.log(err); + let dataMap = { + name: props.name, + value: "全开", + }; + + setSingleSwitch(dataMap) + .then((res) => { + if (res.code == 200) { + lightControl.value.forEach((ele) => { + ele.State = true; }); + } else { + return false; + } + }) + .catch((err) => { + console.log(err); }); - }); } }; const props = defineProps({ @@ -60,6 +60,7 @@ const props = defineProps({ type: Array, }, }); +console.log(props.name,props.show); const emit = defineEmits(["update"]); const closeDialog = () => { // 向父组件传值 @@ -105,12 +106,12 @@ watch( {{ props.name }}
- 全开 + > --> { } else if (item.name === "二层") { emit("sendVal", 7); } else if (item.name === "三层") { - emit("sendVal", 8); + emit("sendVal", 8); } else if (item.name === "负一层") { emit("sendVal", 5); } @@ -120,7 +120,7 @@ const drawFaultConditionsChart = (params) => { value: params[0].Normality, }, { - name: "故障", + name: "离线", value: params[0].Malfunction, }, ]; @@ -161,7 +161,12 @@ const drawFaultConditionsChart = (params) => { ); } var img = "/src/assets/images/energyMonitoring/loadClassification.png"; - let myChart = echarts.init(document.getElementById("faultConditions")); + + // let myChart = echarts.init(document.getElementById("faultConditions")); + let dom = document.getElementById("faultConditions"); + dom.removeAttribute("_echarts_instance_"); + let myChart; + myChart = echarts.init(dom); let option = { graphic: { elements: [ @@ -169,7 +174,7 @@ const drawFaultConditionsChart = (params) => { type: "image", z: 3, style: { - image: img, + image: getPath.loadClassification, width: 175, height: 175, }, @@ -183,19 +188,19 @@ const drawFaultConditionsChart = (params) => { title: [ { text: total, - x: "47%", + x: "48%", y: "42%", textAlign: "center", textStyle: { - fontFamily: "Verdana-Bold", - fontSize: "20", + fontFamily: "D-DIN-Bold", + fontSize: "24", fontWeight: "bold", color: "#FFF", }, }, { text: "个", - x: "58%", + x: "55%", y: "45%", textAlign: "center", textStyle: { @@ -205,7 +210,7 @@ const drawFaultConditionsChart = (params) => { }, }, { - text: "照明四路数量", + text: "照明回路数量", left: "49%", top: "55%", textAlign: "center", @@ -264,12 +269,14 @@ const drawFaultConditionsChart = (params) => { a0: { color: "rgba(1, 246, 139, 1)", padding: [0, 0, 10, 0], - fontSize: 15, + fontSize: 20, + fontFamily:'D-DIN-Bold', }, a1: { color: color[1], padding: [0, 0, 10, 0], - fontSize: 15, + fontSize: 20, + fontFamily:'D-DIN-Bold', }, s0: { color: "#fff", @@ -375,7 +382,11 @@ const drawHallLightingChart = (params) => { // 绿色渐变 // let colorArr = [["#12D5AF"], ["#0BC19D", "rgba(13,8,16,0)"], ["#68EFD4", "rgba(14,185,151,0)"]] let colorArr; - let myChart = echarts.init(document.getElementById("hallLighting")); + let dom = document.getElementById("hallLighting"); + dom.removeAttribute("_echarts_instance_"); + let myChart; + myChart = echarts.init(dom); + // let myChart = echarts.init(document.getElementById("hallLighting")); const option = { tooltip: { trigger: "axis", @@ -402,7 +413,7 @@ const drawHallLightingChart = (params) => { lineStyle: { width: 1, type: "solid", - color: "rgba(255, 255, 255, 0.20)", + color: "#557775", }, }, axisTick: { @@ -442,7 +453,7 @@ const drawHallLightingChart = (params) => { show: true, lineStyle: { type: "dashed", - color: "rgba(1, 39, 37, 0.30)", + color: "rgba(255, 255, 255, 0.30)", }, }, // y轴刻度线 @@ -582,6 +593,18 @@ const drawHallLightingChart = (params) => { }; // 照明负荷 const drawLightLoadChart = (params) => { + let boforeDate = + lightLoadDate.value == "year" + ? "去年" + : lightLoadDate.value == "month" + ? "上月" + : "昨日"; + let nowDate = + lightLoadDate.value == "year" + ? "今年" + : lightLoadDate.value == "month" + ? "本月" + : "今日"; let xData = []; let toDay = []; let lastDay = []; @@ -590,7 +613,11 @@ const drawLightLoadChart = (params) => { toDay.push(item.TP); lastDay.push(item.YP); }); - let myChart = echarts.init(document.getElementById("lightLoad")); + let dom = document.getElementById("lightLoad"); + dom.removeAttribute("_echarts_instance_"); + let myChart; + myChart = echarts.init(dom); + // let myChart = echarts.init(document.getElementById("lightLoad")); let option = { grid: { top: "18%", @@ -610,8 +637,9 @@ const drawLightLoadChart = (params) => { legend: [ { icon: "rect", - top: 5, - left: "right", + top: 10, + // left: "right", + right:10, orient: "horizontal", // data: ['进水量', '出水量'], borderRadius: 20, @@ -644,12 +672,20 @@ const drawLightLoadChart = (params) => { textStyle: { color: "#DDFFFD", //X轴文字颜色 }, + formatter: function (value) { + // 如果数值大于1000,则以千位分隔 + if (value >= 1000) { + return value / 10000 + "万"; + } else if (value >= 10000000) { + return value / 100000000 + "亿"; + } else { + return value; + } + }, }, }, yAxis: [ { - min: 0, - max: 500, type: "value", name: "单位/kW", nameTextStyle: { @@ -663,19 +699,29 @@ const drawLightLoadChart = (params) => { axisLabel: { color: "#DDFFFD", fontSize: 12, + formatter: function (value) { + // 如果数值大于1000,则以千位分隔 + if (value >= 1000) { + return value / 10000 + "万"; + } else if (value >= 10000000) { + return value / 100000000 + "亿"; + } else { + return value; + } + }, }, splitLine: { show: true, lineStyle: { type: "dashed", - color: "rgba(1, 39, 37, 0.30)", + color: "rgba(255, 255, 255, 0.30)", }, }, }, ], series: [ { - name: "昨日", + name: boforeDate, type: "line", //显示所有图形。 //标记的图形为实心圆 @@ -695,7 +741,7 @@ const drawLightLoadChart = (params) => { data: lastDay, }, { - name: "今日", + name: nowDate, type: "line", symbol: "none", itemStyle: { @@ -704,11 +750,11 @@ const drawLightLoadChart = (params) => { borderWidth: "2", borderColor: "#91cc75", normal: { - color: "#91cc75", //拐点颜色 + color: "rgba(1, 246, 139, 1)", //拐点颜色 }, }, lineStyle: { - color: "#91cc75", + color: "rgba(1, 246, 139, 1)", }, data: toDay, }, @@ -743,7 +789,8 @@ function lightingCircuit() { .then((res) => { if (res.code == 200) { res.data.forEach((item) => { - item.state = item.state == "0" ? false : true; + item.state = + item.state == "0" ? "0" : item.state == "255" ? "1" : "2"; }); lightDetail.value = res.data; } else { @@ -765,7 +812,7 @@ function lightingLoad() { getLightingLoad({ date }) .then((res) => { if (res.code == 200) { - drawLightLoadChart(res.data); + drawLightLoadChart(res.data.slice(-10)); } else { return false; } @@ -869,6 +916,7 @@ onMounted(() => { v-for="(item, index) in floorList" @click="toggleFloor(item, index)" :class="index === floorIndex ? 'floor-select' : 'floor-default'" + :key="index" > {{ item.name }}
@@ -914,7 +962,7 @@ onMounted(() => { > {{ item.name }} {{ item.location }} - + @@ -955,12 +1003,12 @@ onMounted(() => {
照明控制

- 全开 + > --> { 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() + - " 万元
" + 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); }); }; -