shenzhen-dev #2

Merged
admin merged 614 commits from shenzhen-dev into master 2025-06-03 18:28:43 +08:00
12 changed files with 1718 additions and 59 deletions
Showing only changes of commit 3b6e3b20f0 - Show all commits

View File

@ -1,20 +1,177 @@
<template>
<Card title="短期用电趋势">
<div class="edge-top-left">123</div>
<div class="ai-top-left">
<div class="history-content">
<div>
<div class="select-right">
<div class="week selected" @click="getWeekData(1)" :class="checked == 1 ? 'active' : ''">近7日</div>
<div class="month selected" @click="getMonthData(2)" :class="checked == 2 ? 'active' : ''">本月</div>
</div>
</div>
<!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div>
-->
<greenLineEchart
:xData="xData"
:yData="yData"
:lineId="'electricityShortTrend'"
:lineSmooth="0"
style="width: 100%; height: 100%"
></greenLineEchart>
</div>
</div>
</Card>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import Card from "@/components/card.vue";
import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
import greenLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/greenLineEchart.vue";
import { GlobalStore } from "@/stores";
import mitts from "@/utils/bus"; //
const store = GlobalStore();
// x
let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any);
// Y
let unit = ref("单位:V" as any);
// Y
let yData = ref([10, 5, 20, 25, 15, 25, 12] as any);
//
let option = ref(null as any);
//
let checked = ref(1);
function getWeekData(type: any) {
checked.value = type;
let currentWeek = getRecentSevenDays();
// console.log(currentWeek, "");
//
xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35, 12];
}
function getMonthData(type: any) {
checked.value = type;
let currentWeek = getPassedDaysOfMonth();
// console.log(currentWeek.length, "");
let testyData: any = [];
for (let i = 0; i < currentWeek.length; i++) {
testyData.push((i % 2) + 10);
}
xData.value = currentWeek;
yData.value = testyData;
}
//
function getRecentSevenDays() {
const dates: any = [];
const millisecondsPerDay = 24 * 60 * 60 * 1000; //
const today = new Date(); //
for (let i = 0; i < 7; i++) {
const date = new Date(today.getTime() - i * millisecondsPerDay);
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);
dates.unshift(`${month}-${day}`);
}
return dates;
}
//
function getPassedDaysOfMonth() {
//
const dates: any = [];
//
const today = new Date();
//
const year = today.getFullYear();
//
const month = today.getMonth();
//
const startDate = new Date(year, month, 1); // 0 8 9
let currentDate = startDate;
//
while (currentDate <= today) {
const month = currentDate.getMonth() + 1;
const day = currentDate.getDate();
dates.push(`${("0" + month).slice(-2)}-${("0" + day).slice(-2)}`);
currentDate.setDate(currentDate.getDate() + 1);
}
return dates;
}
onMounted(async () => {});
// 线miits.on 7.14 by CJP
onBeforeUnmount(async () => {
mitts.off("devSn");
});
</script>
<style scoped lang="scss">
.edge-top-left {
<style lang="scss" scoped>
.ai-top-left {
width: 100%;
height: 100%;
margin-left: 3%;
position: relative;
display: flex;
flex-wrap: wrap;
.title {
height: 10%;
line-height: 33px;
text-align: left;
font-size: calc(100vw * 18 / 1920);
color: #ffffff;
background: url("@/assets/images/titleBig.webp") no-repeat;
background-size: 100% 100%;
i {
font-family: OPPOSansH;
margin-left: 6%;
}
}
.history-content {
height: 100%;
// background: url("@/assets/images/cardImg.png") no-repeat;
// background-size: 100% 100%;
position: relative;
.select-right {
width: 20%;
display: flex;
position: absolute;
z-index: 10;
color: #fff;
font-size: 10px;
text-align: center;
line-height: 20px;
right: -5%;
top: 5%;
.selected {
height: 5%;
background: url("@/assets/images/dustNoise/rightImg2.png") no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.week {
width: 30%;
margin-right: 5%;
z-index: 99;
}
.month {
width: 30%;
z-index: 99;
}
.active {
background: url("@/assets/images/dustNoise/rightImg.png") no-repeat;
background-size: 100% 100%;
}
}
}
}
::v-deep .el-input__wrapper {
background: #112d59;
}
::v-deep .el-input__inner {
color: #fff;
}
::v-deep .el-select .el-input .el-select__caret {
color: #fff;
}
</style>

View File

@ -1,20 +1,184 @@
<template>
<Card title="长期用电趋势">
<div class="edge-top-left">123</div>
<div class="ai-top-left">
<div class="history-content">
<div>
<div class="select-right">
<div class="week selected" @click="getHalfYearData(1)" :class="checked == 1 ? 'active' : ''">近半年</div>
<div class="month selected" @click="getFullYearData(2)" :class="checked == 2 ? 'active' : ''">近一年</div>
</div>
</div>
<blueLineEchart
:xData="xData"
:yData="yData"
:lineId="'electricityLongTrend'"
:lineSmooth="0"
style="width: 100%; height: 100%"
></blueLineEchart>
</div>
</div>
</Card>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import Card from "@/components/card.vue";
import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
import blueLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/blueLineEchart.vue";
import { GlobalStore } from "@/stores";
import mitts from "@/utils/bus"; //
const store = GlobalStore();
// x
let xData = ref(["2023-04", "2023-05", "2023-06", "2023-07", "2023-08", "2023-09"] as any);
// Y
let unit = ref("单位:V" as any);
// Y
let yData = ref([10, 5, 20, 25, 15, 25] as any);
//
let option = ref(null as any);
//
let checked = ref(1);
function getHalfYearData(type: any) {
checked.value = type;
let currentWeek = getLastSixMonths();
// console.log(currentWeek, "");
//
xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35];
}
function getFullYearData(type: any) {
checked.value = type;
let currentWeek = getLastTwelveMonths();
// // console.log(currentWeek.length, "");
xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35, 20, 15, 25, 15, 25, 35];
}
//
function getLastTwelveMonths() {
let currentDate = new Date();
let months = [];
for (let i = 12; i >= 1; i--) {
let year = currentDate.getFullYear();
let month: any = currentDate.getMonth() + 1;
//
if (month < 10) {
month = "0" + month;
}
// yyyy-mm
let formattedDate: any = year + "-" + month;
//
months.unshift(formattedDate);
//
currentDate.setMonth(currentDate.getMonth() - 1);
}
return months;
}
//
function getLastSixMonths() {
let currentDate = new Date();
let months = [];
for (let i = 6; i >= 1; i--) {
let year = currentDate.getFullYear();
let month: any = currentDate.getMonth() + 1;
//
if (month < 10) {
month = "0" + month;
}
// yyyy-mm
let formattedDate: any = year + "-" + month;
//
months.unshift(formattedDate);
//
currentDate.setMonth(currentDate.getMonth() - 1);
}
return months;
}
onMounted(async () => {});
// 线miits.on 7.14 by CJP
onBeforeUnmount(async () => {
mitts.off("devSn");
});
</script>
<style scoped lang="scss">
.edge-top-left {
<style lang="scss" scoped>
.ai-top-left {
width: 100%;
height: 100%;
margin-left: 3%;
position: relative;
display: flex;
flex-wrap: wrap;
.title {
height: 10%;
line-height: 33px;
text-align: left;
font-size: calc(100vw * 18 / 1920);
color: #ffffff;
background: url("@/assets/images/titleBig.webp") no-repeat;
background-size: 100% 100%;
i {
font-family: OPPOSansH;
margin-left: 6%;
}
}
.history-content {
height: 100%;
// background: url("@/assets/images/cardImg.png") no-repeat;
// background-size: 100% 100%;
position: relative;
.select-right {
width: 20%;
display: flex;
position: absolute;
z-index: 10;
color: #fff;
font-size: 10px;
text-align: center;
line-height: 20px;
right: -5%;
top: 5%;
.selected {
height: 5%;
background: url("@/assets/images/dustNoise/rightImg2.png") no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.week {
width: 30%;
margin-right: 5%;
z-index: 99;
}
.month {
width: 30%;
z-index: 99;
}
.active {
background: url("@/assets/images/dustNoise/rightImg.png") no-repeat;
background-size: 100% 100%;
}
}
}
}
::v-deep .el-input__wrapper {
background: #112d59;
}
::v-deep .el-input__inner {
color: #fff;
}
::v-deep .el-select .el-input .el-select__caret {
color: #fff;
}
</style>

View File

@ -43,20 +43,20 @@ export default {
display: flex;
margin-bottom: 1%;
.topLeft {
width: 33%;
width: 26%;
// background-color: orchid;
}
.topCenter {
margin: 0% 1%;
width: 33%;
width: 45%;
:deep(.h-card) {
// .content {
// margin-top: 1.5% !important;
// }
.content {
margin-top: 1.6% !important;
}
}
}
.topRight {
width: 33%;
width: 27%;
}
}
.bottom {
@ -64,16 +64,16 @@ export default {
height: 48%;
display: flex;
.bottomLeft {
width: 33%;
width: 50%;
margin-right: 1%;
:deep(.h-card) {
.content {
margin-top: 2% !important;
margin-top: 1% !important;
}
}
}
.bottomRight {
width: 66%;
width: 49%;
:deep(.h-card) {
.content {
margin-top: 1% !important;

View File

@ -1,6 +1,31 @@
<template>
<Card title="实时监测">
<div class="edge-top-left">123</div>
<div class="electricity-top-center">
<div class="left-box">
<div class="electricity-count">3308.84 kw·h</div>
<div class="electricity-icon">
<img src="@/assets/images/greenConstruct/electricity.png" alt="" />
</div>
</div>
<div class="right-box">
<div class="yesterday-use">
<div class="text">昨日用电(kw·h)</div>
<div class="num">4.06</div>
</div>
<div class="yesterday-chain">
<div class="text">环比</div>
<div class="num">3<span style="font-family: Source Han Sans CN-Medium, Source Han Sans CN">%</span></div>
</div>
<div class="month-use">
<div class="text">本月用电(kw·h)</div>
<div class="num">100.2</div>
</div>
<div class="month-chain">
<div class="text">环比</div>
<div class="num">12<span style="font-family: Source Han Sans CN-Medium, Source Han Sans CN">%</span></div>
</div>
</div>
</div>
</Card>
</template>
@ -9,12 +34,140 @@ import Card from "@/components/card.vue";
</script>
<style scoped lang="scss">
.edge-top-left {
.electricity-top-center {
width: 100%;
height: 100%;
margin-left: 3%;
position: relative;
display: flex;
flex-wrap: wrap;
.left-box {
width: 50%;
.electricity-count {
display: flex;
justify-content: center;
align-items: center;
width: 50%;
height: 10%;
margin: auto;
margin-top: 8%;
background: url("@/assets/images/listTitle.png") no-repeat;
background-size: 100% 100%;
font-size: 20px;
font-family: OPPOSans-Bold, OPPOSans;
font-weight: bold;
color: #ffffff;
}
.electricity-icon {
width: 60%;
height: 50%;
margin: auto;
margin-top: 15%;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
}
.right-box {
width: 50%;
margin-left: 3%;
display: flex;
flex-wrap: wrap;
text-align: center;
.yesterday-use {
width: 30%;
height: 30%;
margin-top: 10%;
margin-right: 15%;
background: url("@/assets/images/aIEarlyWarning/monthWarn.png") no-repeat;
background-size: 100% 100%;
.text {
font-size: 16px;
color: #65d7f9;
margin-top: 5%;
}
.num {
transform: skew(-5deg);
font-family: sadigitalNumber;
font-size: 24px;
margin-top: 7%;
font-weight: bold;
background: linear-gradient(180deg, #65d7f9 0%, #ffffff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.yesterday-chain {
width: 30%;
height: 30%;
margin-top: 10%;
margin-right: 15%;
background: url("@/assets/images/aIEarlyWarning/monthWarn.png") no-repeat;
background-size: 100% 100%;
.text {
font-size: 16px;
color: #65d7f9;
margin-top: 5%;
}
.num {
transform: skew(-5deg);
font-family: sadigitalNumber;
font-size: 24px;
margin-top: 7%;
font-weight: bold;
background: linear-gradient(180deg, #65d7f9 0%, #ffffff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.month-use {
width: 30%;
height: 30%;
margin-right: 15%;
background: url("@/assets/images/aIEarlyWarning/weekWarn.png") no-repeat;
background-size: 100% 100%;
.text {
font-size: 16px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #ffffff;
margin-top: 5%;
}
.num {
transform: skew(-5deg);
font-family: sadigitalNumber;
font-size: 24px;
margin-top: 7%;
font-weight: bold;
background: linear-gradient(180deg, #dad8b4 0%, #f4d065 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.month-chain {
width: 30%;
height: 30%;
background: url("@/assets/images/aIEarlyWarning/weekWarn.png") no-repeat;
background-size: 100% 100%;
.text {
margin-top: 5%;
font-size: 16px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #ffffff;
}
.num {
transform: skew(-5deg);
font-family: sadigitalNumber;
font-size: 24px;
margin-top: 7%;
font-weight: bold;
background: linear-gradient(180deg, #dad8b4 0%, #f4d065 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
}
</style>

View File

@ -1,20 +1,235 @@
<template>
<Card title="电表列表">
<div class="edge-top-left">123</div>
<div class="electricity-list">
<div class="list-content">
<div class="tab-list">
<div style="width: 60%">电表名称</div>
<div style="width: 20%">当前读数</div>
</div>
<el-scrollbar class="list-box">
<div v-for="(item, index) in list" class="listStyle" :key="item.id">
<!-- <div style="width: 5%">{{ index + 1 }}</div> -->
<div style="width: 60%">{{ item.waterName }}</div>
<div style="width: 20%">{{ item.currentNum }}</div>
</div>
<div class="not-data" v-if="list.length == 0">
<img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p>
</div>
</el-scrollbar>
</div>
</div>
</Card>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import Card from "@/components/card.vue";
import { reactive, ref, onMounted } from "vue";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
let showDialog = ref(false as any);
let rangeTime = ref("" as any);
const list = reactive([
{
id: 1,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 2,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 3,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 4,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 5,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 6,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 7,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 8,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 9,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 10,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 11,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 12,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 13,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 14,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 15,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 16,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 17,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 18,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 19,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 20,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 21,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 22,
waterName: "智能电表",
currentNum: 3308.84
},
{
id: 23,
waterName: "智能电表",
currentNum: 3308.84
}
]);
onMounted(async () => {});
</script>
<style scoped lang="scss">
.edge-top-left {
<style lang="scss" scoped>
//
:deep(.el-input__wrapper) {
width: 100%;
height: 1%;
background: #0d2956;
}
:deep(.el-range-separator) {
color: #ccc;
font-size: 10px;
}
:deep(.el-range-input) {
color: #ccc;
font-size: 10px;
}
.electricity-list {
width: 100%;
height: 100%;
margin-left: 3%;
box-sizing: border-box;
padding: 2%;
position: relative;
display: flex;
flex-wrap: wrap;
.list-content {
height: 95%;
width: 100%;
// background: url("@/assets/images/cardImg.png") no-repeat;
// background-size: 100% 100%;
.tab-list {
display: flex;
align-items: center;
width: 100%;
height: 12%;
background: url("@/assets/images/vehicleManagement/ListTitleImg.png") no-repeat;
background-size: 100% 100%;
// position: absolute;
left: 75.5%;
top: 75%;
color: #ccc;
font-size: 14px;
// justify-content: space-around;
div {
text-align: center;
white-space: nowrap;
}
}
.list-box {
height: 96%;
.list-style:nth-child(even) {
background: rgba(39, 88, 192, 0.06);
}
.listStyle {
display: flex;
align-items: center;
color: #fff;
font-size: 12px;
line-height: 45px;
div {
text-align: center;
white-space: nowrap;
}
}
.listStyle:hover {
background: #091f3f;
}
}
}
}
.not-data {
top: 73%;
width: 12%;
left: 44%;
position: absolute;
img {
width: 40%;
margin: 5% 30%;
}
p {
color: #fff;
font-size: calc(100vw * 14 / 1920);
margin: -6% 37%;
}
}
</style>

View File

@ -1,20 +1,207 @@
<template>
<Card title="昨日用电量">
<div class="edge-top-left">123</div>
<div class="center-top">
<div class="use-total">
昨日总用电量:
<span style="color: #65d7f9">222</span>
</div>
<div id="electricityTopRight" style="width: 100%; height: 100%"></div>
</div>
</Card>
</template>
<script setup lang="ts">
import Card from "@/components/card.vue";
import { onMounted } from "vue";
import * as echarts from "echarts";
import symbolIcon from "@/assets/images/lineSymbol.png";
function draw() {
let chartDom = document.getElementById("electricityTopRight");
if (chartDom) {
chartDom.removeAttribute("_echarts_instance_");
}
let echartsTest = echarts.init(document.getElementById("electricityTopRight"));
let option = {
tooltip: {
trigger: "axis",
axisPointer: {
//
type: "shadow" // 线'line' | 'shadow'
},
borderRadius: 5,
borderWidth: 5,
formatter: function (params) {
let dot =
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:#02C4DD"></span>';
return params[0].name + "<br>" + params[0].value;
}
},
grid: {
left: "4%",
right: "4%",
bottom: "5%",
top: "15%",
containLabel: true
},
xAxis: {
show: true,
data: ["智能电表", "智能电表2", "智能电表3", "智能电表4", "智能电表5"],
triggerEvent: true,
axisTick: {
show: false,
lineStyle: {
color: "red"
}
},
axisLine: {
show: true,
lineStyle: {
color: "#193c81"
}
},
axisLabel: {
show: true,
rotate: 0,
interval: 0,
textStyle: {
padding: [0, 0, 0, 0],
fontSize: 12,
color: "#fff"
}
}
},
yAxis: {
triggerEvent: true,
interval: 30,
nameTextStyle: {
color: "#fff",
fontSize: 10,
padding: [0, 0, 10, 0]
},
splitLine: {
show: true,
lineStyle: {
color: "#193c81"
}
},
axisTick: {
show: false
},
axisLine: {
show: true,
lineStyle: {
color: "#193c81"
}
},
axisLabel: {
show: true,
textStyle: {
color: "#fff",
fontSize: 12
}
}
},
// color: ["#e54035"],
series: [
{
name: "数量",
barMinHeight: 10,
type: "pictorialBar",
barCategoryGap: "5%",
// symbol: 'path://M0,10 L10,10 L5,0 L0,10 z',
symbol: "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
itemStyle: {
normal: {
//barBorderRadius: 5,
//
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 1,
color: "rgba(130, 251, 234, 0)"
},
{
offset: 0,
color: "rgba(130, 251, 234, 1)"
}
])
// color: function (params) {
// console.log(params, "");
// if (params.name === "2") {
// return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 1,
// color: "rgba(238, 169, 89, 0)"
// },
// {
// offset: 0,
// color: "rgba(238, 169, 89, 1)"
// }
// ]);
// } else {
// return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 1,
// color: "rgba(130, 251, 234, 0)"
// },
// {
// offset: 0,
// color: "rgba(130, 251, 234, 1)"
// }
// ]);
// }
// }
}
},
label: {
normal: {
show: true,
position: "top",
textStyle: {
color: "#fff",
fontSize: 12
}
}
},
data: [100, 200, 300, 100, 20, 60, 120],
z: 10
},
{
name: "hill",
type: "line",
color: "rgba(0,0,0,0)",
symbol: `image://${symbolIcon}`,
symbolSize: 20,
itemStyle: {
normal: {
// color: "rgba(11,47,68,.8)"
}
},
data: [100, 200, 300, 100, 20, 60, 120],
z: 9
}
]
};
echartsTest.setOption(option);
}
onMounted(() => {
draw();
});
</script>
<style scoped lang="scss">
.edge-top-left {
.center-top {
width: 100%;
height: 100%;
margin-left: 3%;
position: relative;
display: flex;
flex-wrap: wrap;
.use-total {
position: absolute;
top: 3%;
left: 5%;
font-size: 12px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
color: #ffffff;
}
}
</style>

View File

@ -0,0 +1,223 @@
<template>
<div class="blue-line-chart">
<div :id="props.lineId" :ref="props.lineId" style="width: 100%; height: 100%"></div>
</div>
</template>
<script lang="ts" setup>
import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, watch, ref, onBeforeUnmount } from "vue";
import * as echarts from "echarts";
// import { GlobalStore } from "@/stores";
// const store = GlobalStore();
import mitts from "@/utils/bus"; //
// ts
type Props = {
xData?: any; // x
yData?: any; // y
lineId?: any; // 线domid
lineSmooth?: any; // 线 0-1,(0:线 1:)
};
// withDefaults ()
const props = withDefaults(defineProps<Props>(), {
xData: ["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"],
yData: [10, 5, 20, 25, 15, 25, 12],
lineId: "waterShortTerm",
lineSmooth: 0
// num: () => [12, 13, 14] // 使
});
watch(
() => props.xData,
newVal => {
// console.log(newVal, "newVal");
if (newVal) {
// props.xData = newVal;
drawChart();
}
}
);
//
let option = ref(null as any);
function initOption() {
option.value = {
// backgroundColor: '#071c3a',
title: {
// text: '',
textStyle: {
align: "center",
color: "#fff",
fontSize: 20
},
top: "2%",
left: "center"
},
tooltip: {
trigger: "axis"
},
grid: {
top: "20%",
left: "6%",
right: "4%",
bottom: "10%"
// containLabel: true
},
xAxis: [
{
type: "category",
axisLine: {
show: true,
lineStyle: {
color: "#14346C"
}
},
splitArea: {
// show: true,
color: "#f00",
lineStyle: {
color: "#f00"
}
},
axisLabel: {
color: "#fff"
},
splitLine: {
show: false
},
boundaryGap: false,
data: props.xData
}
],
yAxis: [
{
type: "value",
// name: unit.value,
nameTextStyle: {
color: "#fff",
nameLocation: "start"
},
min: 0,
// max: 140,
splitNumber: 3,
splitLine: {
show: true,
lineStyle: {
color: "#14346C"
}
},
axisLine: {
show: true,
lineStyle: {
color: "#14346C"
}
},
axisLabel: {
show: true,
margin: 20,
textStyle: {
color: "#fff"
}
},
axisTick: {
show: true
}
}
],
series: [
{
type: "line",
// smooth: true, //
showAllSymbol: true,
symbol: `image://${symbolIcon}`,
// symbol: "circle",
smooth: props.lineSmooth,
symbolSize: 30,
label: {
show: false,
position: "top",
textStyle: {
color: "#fff"
}
},
itemStyle: {
color: "#97c6c8",
borderColor: "#97c6c8",
borderWidth: 5,
shadowColor: "rgba(0, 0, 0, .6)",
shadowBlur: 0,
lineStyle: {
width: 0.1,
normal: {
color: "#fff",
shadowBlur: 0
}
}
},
tooltip: {
show: true
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(74, 192, 243,1)"
},
{
offset: 0.9,
color: "rgba(74, 192, 243,0.2)"
},
{
offset: 1,
color: "rgba(74, 192, 243, 0.1)"
}
],
false
),
// shadowColor: "rgba(74, 192, 243, 0.1)",
shadowBlur: 20
}
},
data: props.yData
}
]
};
}
function drawChart() {
initOption();
// console.log("", props.yData);
let chartDom = document.getElementById(props.lineId);
if (chartDom) {
chartDom.removeAttribute("_echarts_instance_");
}
let waterShortTerm = echarts.init(document.getElementById(props.lineId));
waterShortTerm.setOption(option.value);
}
onMounted(async () => {
drawChart();
});
// 线miits.on 7.14 by CJP
onBeforeUnmount(async () => {
mitts.off("devSn");
});
</script>
<style lang="scss" scoped>
.blue-line-chart {
width: 100%;
height: 100%;
position: relative;
}
</style>

View File

@ -1,20 +1,177 @@
<template>
<Card title="短期用水趋势(t)">
<div class="edge-top-left">123</div>
<div class="ai-top-left">
<div class="history-content">
<div>
<div class="select-right">
<div class="week selected" @click="getWeekData(1)" :class="checked == 1 ? 'active' : ''">近7日</div>
<div class="month selected" @click="getMonthData(2)" :class="checked == 2 ? 'active' : ''">本月</div>
</div>
</div>
<!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div>
-->
<greenLineEchart
:xData="xData"
:yData="yData"
:lineId="'waterShortTrend'"
:lineSmooth="0"
style="width: 100%; height: 100%"
></greenLineEchart>
</div>
</div>
</Card>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import Card from "@/components/card.vue";
import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
import greenLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/greenLineEchart.vue";
import { GlobalStore } from "@/stores";
import mitts from "@/utils/bus"; //
const store = GlobalStore();
// x
let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any);
// Y
let unit = ref("单位:V" as any);
// Y
let yData = ref([10, 5, 20, 25, 15, 25, 12] as any);
//
let option = ref(null as any);
//
let checked = ref(1);
function getWeekData(type: any) {
checked.value = type;
let currentWeek = getRecentSevenDays();
// console.log(currentWeek, "");
//
xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35, 12];
}
function getMonthData(type: any) {
checked.value = type;
let currentWeek = getPassedDaysOfMonth();
// console.log(currentWeek.length, "");
let testyData: any = [];
for (let i = 0; i < currentWeek.length; i++) {
testyData.push((i % 2) + 10);
}
xData.value = currentWeek;
yData.value = testyData;
}
//
function getRecentSevenDays() {
const dates: any = [];
const millisecondsPerDay = 24 * 60 * 60 * 1000; //
const today = new Date(); //
for (let i = 0; i < 7; i++) {
const date = new Date(today.getTime() - i * millisecondsPerDay);
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);
dates.unshift(`${month}-${day}`);
}
return dates;
}
//
function getPassedDaysOfMonth() {
//
const dates: any = [];
//
const today = new Date();
//
const year = today.getFullYear();
//
const month = today.getMonth();
//
const startDate = new Date(year, month, 1); // 0 8 9
let currentDate = startDate;
//
while (currentDate <= today) {
const month = currentDate.getMonth() + 1;
const day = currentDate.getDate();
dates.push(`${("0" + month).slice(-2)}-${("0" + day).slice(-2)}`);
currentDate.setDate(currentDate.getDate() + 1);
}
return dates;
}
onMounted(async () => {});
// 线miits.on 7.14 by CJP
onBeforeUnmount(async () => {
mitts.off("devSn");
});
</script>
<style scoped lang="scss">
.edge-top-left {
<style lang="scss" scoped>
.ai-top-left {
width: 100%;
height: 100%;
margin-left: 3%;
position: relative;
display: flex;
flex-wrap: wrap;
.title {
height: 10%;
line-height: 33px;
text-align: left;
font-size: calc(100vw * 18 / 1920);
color: #ffffff;
background: url("@/assets/images/titleBig.webp") no-repeat;
background-size: 100% 100%;
i {
font-family: OPPOSansH;
margin-left: 6%;
}
}
.history-content {
height: 100%;
// background: url("@/assets/images/cardImg.png") no-repeat;
// background-size: 100% 100%;
position: relative;
.select-right {
width: 20%;
display: flex;
position: absolute;
z-index: 10;
color: #fff;
font-size: 10px;
text-align: center;
line-height: 20px;
right: -5%;
top: 5%;
.selected {
height: 5%;
background: url("@/assets/images/dustNoise/rightImg2.png") no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.week {
width: 30%;
margin-right: 5%;
z-index: 99;
}
.month {
width: 30%;
z-index: 99;
}
.active {
background: url("@/assets/images/dustNoise/rightImg.png") no-repeat;
background-size: 100% 100%;
}
}
}
}
::v-deep .el-input__wrapper {
background: #112d59;
}
::v-deep .el-input__inner {
color: #fff;
}
::v-deep .el-select .el-input .el-select__caret {
color: #fff;
}
</style>

View File

@ -1,20 +1,186 @@
<template>
<Card title="长期用水趋势(t)">
<div class="edge-top-left">123</div>
<div class="ai-top-left">
<div class="history-content">
<div>
<div class="select-right">
<div class="week selected" @click="getHalfYearData(1)" :class="checked == 1 ? 'active' : ''">近半年</div>
<div class="month selected" @click="getFullYearData(2)" :class="checked == 2 ? 'active' : ''">近一年</div>
</div>
</div>
<!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div>
-->
<blueLineEchart
:xData="xData"
:yData="yData"
:lineId="'waterLongTrend'"
:lineSmooth="0"
style="width: 100%; height: 100%"
></blueLineEchart>
</div>
</div>
</Card>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import Card from "@/components/card.vue";
import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
import blueLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/blueLineEchart.vue";
import { GlobalStore } from "@/stores";
import mitts from "@/utils/bus"; //
const store = GlobalStore();
// x
let xData = ref(["2023-04", "2023-05", "2023-06", "2023-07", "2023-08", "2023-09"] as any);
// Y
let unit = ref("单位:V" as any);
// Y
let yData = ref([10, 5, 20, 25, 15, 25] as any);
//
let option = ref(null as any);
//
let checked = ref(1);
function getHalfYearData(type: any) {
checked.value = type;
let currentWeek = getLastSixMonths();
// console.log(currentWeek, "");
//
xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35];
}
function getFullYearData(type: any) {
checked.value = type;
let currentWeek = getLastTwelveMonths();
// // console.log(currentWeek.length, "");
xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35, 20, 15, 25, 15, 25, 35];
}
//
function getLastTwelveMonths() {
let currentDate = new Date();
let months = [];
for (let i = 12; i >= 1; i--) {
let year = currentDate.getFullYear();
let month: any = currentDate.getMonth() + 1;
//
if (month < 10) {
month = "0" + month;
}
// yyyy-mm
let formattedDate: any = year + "-" + month;
//
months.unshift(formattedDate);
//
currentDate.setMonth(currentDate.getMonth() - 1);
}
return months;
}
//
function getLastSixMonths() {
let currentDate = new Date();
let months = [];
for (let i = 6; i >= 1; i--) {
let year = currentDate.getFullYear();
let month: any = currentDate.getMonth() + 1;
//
if (month < 10) {
month = "0" + month;
}
// yyyy-mm
let formattedDate: any = year + "-" + month;
//
months.unshift(formattedDate);
//
currentDate.setMonth(currentDate.getMonth() - 1);
}
return months;
}
onMounted(async () => {});
// 线miits.on 7.14 by CJP
onBeforeUnmount(async () => {
mitts.off("devSn");
});
</script>
<style scoped lang="scss">
.edge-top-left {
<style lang="scss" scoped>
.ai-top-left {
width: 100%;
height: 100%;
margin-left: 3%;
position: relative;
display: flex;
flex-wrap: wrap;
.title {
height: 10%;
line-height: 33px;
text-align: left;
font-size: calc(100vw * 18 / 1920);
color: #ffffff;
background: url("@/assets/images/titleBig.webp") no-repeat;
background-size: 100% 100%;
i {
font-family: OPPOSansH;
margin-left: 6%;
}
}
.history-content {
height: 100%;
// background: url("@/assets/images/cardImg.png") no-repeat;
// background-size: 100% 100%;
position: relative;
.select-right {
width: 20%;
display: flex;
position: absolute;
z-index: 10;
color: #fff;
font-size: 10px;
text-align: center;
line-height: 20px;
right: -5%;
top: 5%;
.selected {
height: 5%;
background: url("@/assets/images/dustNoise/rightImg2.png") no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.week {
width: 30%;
margin-right: 5%;
z-index: 99;
}
.month {
width: 30%;
z-index: 99;
}
.active {
background: url("@/assets/images/dustNoise/rightImg.png") no-repeat;
background-size: 100% 100%;
}
}
}
}
::v-deep .el-input__wrapper {
background: #112d59;
}
::v-deep .el-input__inner {
color: #fff;
}
::v-deep .el-select .el-input .el-select__caret {
color: #fff;
}
</style>

View File

@ -0,0 +1,223 @@
<template>
<div class="green-line-chart">
<div :id="props.lineId" :ref="props.lineId" style="width: 100%; height: 100%"></div>
</div>
</template>
<script lang="ts" setup>
import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, watch, ref, onBeforeUnmount } from "vue";
import * as echarts from "echarts";
// import { GlobalStore } from "@/stores";
// const store = GlobalStore();
import mitts from "@/utils/bus"; //
// ts
type Props = {
xData?: any; // x
yData?: any; // y
lineId?: any; // 线domid
lineSmooth?: any; // 线 0-1,(0:线 1:)
};
// withDefaults ()
const props = withDefaults(defineProps<Props>(), {
xData: ["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"],
yData: [10, 5, 20, 25, 15, 25, 12],
lineId: "waterShortTerm",
lineSmooth: 0
// num: () => [12, 13, 14] // 使
});
watch(
() => props.xData,
newVal => {
// console.log(newVal, "newVal");
if (newVal) {
// props.xData = newVal;
drawChart();
}
}
);
//
let option = ref(null as any);
function initOption() {
option.value = {
// backgroundColor: '#071c3a',
title: {
// text: '',
textStyle: {
align: "center",
color: "#fff",
fontSize: 20
},
top: "2%",
left: "center"
},
tooltip: {
trigger: "axis"
},
grid: {
top: "20%",
left: "6%",
right: "4%",
bottom: "10%"
// containLabel: true
},
xAxis: [
{
type: "category",
axisLine: {
show: true,
lineStyle: {
color: "#14346C"
}
},
splitArea: {
// show: true,
color: "#f00",
lineStyle: {
color: "#f00"
}
},
axisLabel: {
color: "#fff"
},
splitLine: {
show: false
},
boundaryGap: false,
data: props.xData
}
],
yAxis: [
{
type: "value",
// name: unit.value,
nameTextStyle: {
color: "#fff",
nameLocation: "start"
},
min: 0,
// max: 140,
splitNumber: 3,
splitLine: {
show: true,
lineStyle: {
color: "#14346C"
}
},
axisLine: {
show: true,
lineStyle: {
color: "#14346C"
}
},
axisLabel: {
show: true,
margin: 20,
textStyle: {
color: "#fff"
}
},
axisTick: {
show: true
}
}
],
series: [
{
type: "line",
// smooth: true, //
showAllSymbol: true,
symbol: `image://${symbolIcon}`,
// symbol: "circle",
smooth: props.lineSmooth,
symbolSize: 30,
label: {
show: false,
position: "top",
textStyle: {
color: "#fff"
}
},
itemStyle: {
color: "#97c6c8",
borderColor: "#97c6c8",
borderWidth: 5,
shadowColor: "rgba(0, 0, 0, .6)",
shadowBlur: 0,
lineStyle: {
width: 0.1,
normal: {
color: "#fff",
shadowBlur: 0
}
}
},
tooltip: {
show: true
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: "rgba(130, 251, 234,0.7)"
},
{
offset: 0.8,
color: "rgba(130, 251, 234,0.1)"
},
{
offset: 1,
color: "rgba(130, 251, 234, 0)"
}
],
false
),
// shadowColor: "rgba(130, 251, 234, 0.2)",
shadowBlur: 20
}
},
data: props.yData
}
]
};
}
function drawChart() {
initOption();
// console.log("", props.yData);
let chartDom = document.getElementById(props.lineId);
if (chartDom) {
chartDom.removeAttribute("_echarts_instance_");
}
let waterShortTerm = echarts.init(document.getElementById(props.lineId));
waterShortTerm.setOption(option.value);
}
onMounted(async () => {
drawChart();
});
// 线miits.on 7.14 by CJP
onBeforeUnmount(async () => {
mitts.off("devSn");
});
</script>
<style lang="scss" scoped>
.green-line-chart {
width: 100%;
height: 100%;
position: relative;
}
</style>

View File

@ -64,16 +64,16 @@ export default {
height: 48%;
display: flex;
.bottomLeft {
width: 33%;
width: 50%;
margin-right: 1%;
:deep(.h-card) {
.content {
margin-top: 2% !important;
margin-top: 1% !important;
}
}
}
.bottomRight {
width: 66%;
width: 49%;
:deep(.h-card) {
.content {
margin-top: 1% !important;

View File

@ -1,6 +1,11 @@
<template>
<Card title="昨日用水量(t)">
<div class="center-top">
<div class="use-total">
昨日总用水量:
<span style="color: #65d7f9">222</span>
</div>
<div id="educationCenterTop" style="width: 100%; height: 100%"></div>
</div>
</Card>
@ -189,5 +194,14 @@ onMounted(() => {
.center-top {
width: 100%;
height: 100%;
position: relative;
.use-total {
position: absolute;
top: 3%;
left: 5%;
font-size: 12px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
color: #ffffff;
}
}
</style>