Merge pull request 'dev' (#125) from dev into master

Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/125
This commit is contained in:
odjbin
2023-12-14 08:16:53 +00:00
6 changed files with 507 additions and 380 deletions

View File

@@ -16,6 +16,7 @@ a {
html, body, #app, .el-container, .el-aside, .el-main {
height: 100%;
}
.tunnel-title {
width: 2330px;
height: 156px;
@@ -26,6 +27,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
margin-left: -1165px;
background-image: url('../images/topAndDown/sp_tb.png');
}
.box-top {
.manage-btn {
display: flex;
@@ -125,7 +127,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
background-image: url('../images/topAndDown/sp_icon_zyc.png');
}
.tunnel-length{
.tunnel-length {
position: absolute;
top: 13%;
left: 36%;
@@ -242,3 +244,130 @@ html, body, #app, .el-container, .el-aside, .el-main {
transform: rotate(180deg);
}
}
//弹窗样式
.digital-tunnel {
#container {
height: 650px;
width: 1300px;
}
#containerEle {
height: 564px;
width: 1300px;
}
.el-dialog {
display: flex;
flex-direction: column;
height: 785px;
border: 2px solid #0F82AF;
background: rgba(6, 34, 71, 0.78);
border-radius: 20px;
padding: 47px 30px;
box-sizing: border-box;
margin: 588px auto 0 auto;
.el-dialog__header {
padding:0 0 25px 0;
//display: none;
.el-dialog__title {
font-size: 32px;
font-weight: bold;
color: #D6F1FA;
}
.el-dialog__close {
color: #05FEFF;
font-size: 35px;
}
}
.el-dialog__body {
padding: 0;
}
}
.left-top-icon {
position: absolute;
top: -3px;
left: -3px;
width: 41px;
height: 41px;
background-image: url(@/assets/images/badGasInfo/sp_jz.png);
}
.right-top-icon {
position: absolute;
top: -3px;
right: -3px;
width: 41px;
height: 41px;
background-image: url(@/assets/images/badGasInfo/sp_jz.png);
transform: rotate(90deg);
}
.time-select {
position: absolute;
top: 47px;
right: 119px;
}
.left-bottom-icon {
position: absolute;
bottom: -3px;
left: -3px;
width: 41px;
height: 41px;
background-image: url(@/assets/images/badGasInfo/sp_jz.png);
transform: rotate(-90deg);
}
.right-bottom-icon {
position: absolute;
bottom: -3px;
right: -3px;
width: 41px;
height: 41px;
background-image: url(@/assets/images/badGasInfo/sp_jz.png);
transform: rotate(180deg);
}
//用电量
.top-tag {
display: flex;
justify-content: center;
.allUsedEle {
width: 240px;
height: 149px;
border-radius: 10px;
border: 2px solid #0F82AF;
display: flex;
flex-direction: column;
align-items: center;
&:nth-child(2) {
margin-left: 39px;
}
.use-title {
display: flex;
justify-content: center;
align-items: center;
width: 240px;
height: 50px;
background: #264A78;
font-size: 26px;
color: #FFFFFF;
}
.value {
margin-top: 20px;
font-size: 40px;
font-family: MicrosoftYaHei;
color: #FFFFFF;
}
}
}
}

View File

@@ -4,129 +4,40 @@
<div class="info-list">
<gas-info-item v-for="item in badGasList" :key="item.equipmentId" :gasInfo="item" @click="handleOpenChart"/>
</div>
<el-dialog v-model="isVisited" title="有害气体监控数据" width="1996px" :modal="false">
<div class="left-icon"></div>
<div class="right-icon"></div>
<div id="container" ref="chart" @click.stop></div>
<div class="time-select">
</div>
</el-dialog>
<div class="digital-tunnel">
<el-dialog v-model="isVisited" title="有害气体监控数据" width="1365px" :modal="false">
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div id="container"></div>
<div class="time-select">
<time-range-btn
:buttonList="timeList"
v-model="selectTimeButton"
@select="timeSelect"
width="124px"
/>
</div>
<div class="left-bottom-icon"></div>
<div class="right-bottom-icon"></div>
</el-dialog>
</div>
</div>
</template>
<script setup>
import GasInfoItem from "./childComps/GasInfoItem.vue";
import * as echarts from 'echarts';
import TimeRangeBtn from "@/components/timeRangeBtn/index.vue"
const props = defineProps({
list: Array,
badGasData: Array
});
const timeList = ref(["年", "月", "日"]);
const selectTimeButton = ref(0);
const isVisited = ref(false);
const badGasList = ref([])
const chart = ref(null);
let myEcharts = reactive({});
const option = reactive({
//图例
legend: {
left: 0,
textStyle:{
color:'#FFFFFF',
fontSize:28
},
// itemWidth: 20,
// itemHeight: 20
},
//离容器四侧的距离
grid: {
left: 45, // 左边距
// right: 60, // 右边距
top: 60, // 顶边距
bottom: 40, // 底边距
// containLabel: true,
},
//提示框组件
tooltip: {
show: true,
trigger: 'axis'
},
//X轴
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisLabel: {
textStyle: {
fontSize: 24,
color:'#D6F1FA'
},
},
},
//Y轴
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
fontSize: 24,
color:'#D6F1FA'
},
},
},
//配置项
series: [
{
name: '二氧化碳',
data: [5, 9, 10, 7, 8, 15, 12],
type: 'line',
smooth: true,
symbolSize:24,
lineStyle:{
width:5
}
},
{
name: '一氧化碳',
data: [8, 15, 5, 9, 10, 7, 12],
type: 'line',
smooth: true,
symbolSize:24,
lineStyle:{
width:5
}
},
{
name: '二氧化氮',
data: [5, 15, 1, 9, 10, 7, 8],
type: 'line',
smooth: true,
symbolSize:24,
lineStyle:{
width:5
}
},
{
name: '二氧化硫',
data: [8, 15, 12, 5, 9, 2, 7],
type: 'line',
smooth: true,
symbolSize:24,
lineStyle:{
width:5
}
},
{
name: '硫化氢',
data: [2, 9, 10, 15, 12, 7, 8,],
type: 'line',
smooth: true,
symbolSize:24,
lineStyle:{
width:5
}
},
]
})
watch(() => props.list, (now) => {
badGasList.value.forEach(item => {
@@ -141,13 +52,16 @@ watch(() => props.list, (now) => {
watch(() => props.badGasData, (now) => {
getBadGasInfo(now.sensorList)
}, {deep: true});
onMounted(() => {
nextTick(() => {
initChart()
})
})
const timeSelect = (index) => {
console.log('选择时间', index)
if(index===0){
console.log('--年')
}else if(index===1){
console.log('--月')
}else if(index===2){
console.log('--日')
}
};
const getBadGasInfo = (now) => {
let windPressureObj = {}
let windPressureArr = []
@@ -172,16 +86,117 @@ const changeData = (item) => {
const handleOpenChart = () => {
console.log('有害气体弹窗')
isVisited.value = true
initChart()
nextTick(() => {
initChart()
})
}
/**
* 初始化echarts实例方法
*/
const initChart = () => {
//3.初始化container容器
myEcharts = echarts.init(chart.value);
myEcharts = echarts.init(document.getElementById('container'));
//5.传入数据
myEcharts.setOption(option, true);
let option = {
//图例
legend: {
left: 0,
textStyle: {
color: '#FFFFFF',
fontSize: 28
},
// itemWidth: 20,
// itemHeight: 20
},
//离容器四侧的距离
grid: {
left: 0, // 左边距
right: 0, // 右边距
top: 80, // 顶边距
bottom: 0, // 底边距
containLabel: true,
},
//提示框组件
tooltip: {
show: true,
trigger: 'axis'
},
//X轴
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisLabel: {
textStyle: {
fontSize: 24,
color: '#D6F1FA'
},
},
},
//Y轴
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
fontSize: 24,
color: '#D6F1FA'
},
},
},
//配置项
series: [
{
name: '二氧化碳',
data: [5, 9, 10, 7, 8, 15, 12],
type: 'line',
smooth: true,
symbolSize: 24,
lineStyle: {
width: 5
}
},
{
name: '一氧化碳',
data: [8, 15, 5, 9, 10, 7, 12],
type: 'line',
smooth: true,
symbolSize: 24,
lineStyle: {
width: 5
}
},
{
name: '二氧化氮',
data: [5, 15, 1, 9, 10, 7, 8],
type: 'line',
smooth: true,
symbolSize: 24,
lineStyle: {
width: 5
}
},
{
name: '二氧化硫',
data: [8, 15, 12, 5, 9, 2, 7],
type: 'line',
smooth: true,
symbolSize: 24,
lineStyle: {
width: 5
}
},
{
name: '硫化氢',
data: [2, 9, 10, 15, 12, 7, 8,],
type: 'line',
smooth: true,
symbolSize: 24,
lineStyle: {
width: 5
}
},
]
}
myEcharts.setOption(option);
//图表大小自适应窗口大小变化
window.onresize = () => {
myEcharts.resize();
@@ -191,37 +206,6 @@ const initChart = () => {
</script>
<style lang="scss" scoped>
#container {
box-sizing: border-box;
height: 754px;
width: 1996px;
margin: 0 auto;
}
:deep(.el-dialog) {
border: 2px solid #0F82AF;
background: rgba(6, 34, 71, 0.78);
border-radius: 20px;
padding: 47px 30px;
box-sizing: border-box;
margin: 588px auto 0 auto;
.el-dialog__header {
padding: 0;
//display: none;
.el-dialog__title {
font-size: 32px;
font-weight: bold;
color: #D6F1FA;
}
.el-dialog__close {
color: #05FEFF;
font-size: 35px;
}
}
}
#bad-gas-info {
position: absolute;
z-index: 100;
@@ -231,34 +215,7 @@ const initChart = () => {
right: 72px;
background-image: url(@/assets/images/badGasInfo/bg.png);
.left-icon {
position: absolute;
top: -3px;
left: -3px;
width: 41px;
height: 41px;
background-image: url(@/assets/images/badGasInfo/sp_jz.png);
}
.right-icon {
position: absolute;
top: -3px;
right: -3px;
width: 41px;
height: 41px;
background-image: url(@/assets/images/badGasInfo/sp_jz.png);
transform: rotate(90deg);
}
.time-select{
position: absolute;
top: 47px;
right: 119px;
//display: flex;
width: 204px;
height: 68px;
border-radius: 10px;
border: 2px solid #0F82AF;
}
.title {
width: 128px;
height: 45px;

View File

@@ -98,53 +98,53 @@
</div>
</div>
</div>
<div class="fan-item">
<!-- echarts -->
<div class="echart" ref="info3"></div>
<!-- 风机名称 -->
<div class="fan-name">三号风机</div>
<!-- 功能 -->
<div class="option-nav">
<div class="state" :class="{ 'blue-state': isStartTwo }">
<div :class="{ stopColor: !stateTwo }">
<div :style="{ backgroundImage: 'url(' +getImageUrl(stateIconTwo)+')' }" class="state-icon"></div>
状态{{ stateTwo ? '运行' : '故障' }}
</div>
<div class="switch">
<div
:class="{ active: isStartTwo }"
@click="isStartTwo = true"
>
启动
</div>
<div
:class="{ active: !isStartTwo }"
@click="isStartTwo = false"
>
停止
</div>
</div>
</div>
<div class="power">
<div class="check-box">
<el-radio-group v-model="isSAuto2" class="radio-group">
<el-radio label="true">自动</el-radio>
<el-radio label="false">手动</el-radio>
</el-radio-group>
</div>
<div class="edit-power">
<span style="color: white">当前功率</span>
<span class="units"
><input
type="number"
min="0"
v-model="powerThree"
:disabled="isSAuto2 === 'true'"
/></span>
</div>
</div>
</div>
</div>
<!-- <div class="fan-item">-->
<!-- &lt;!&ndash; echarts &ndash;&gt;-->
<!-- <div class="echart" ref="info3"></div>-->
<!-- &lt;!&ndash; 风机名称 &ndash;&gt;-->
<!-- <div class="fan-name">三号风机</div>-->
<!-- &lt;!&ndash; 功能 &ndash;&gt;-->
<!-- <div class="option-nav">-->
<!-- <div class="state" :class="{ 'blue-state': isStartTwo }">-->
<!-- <div :class="{ stopColor: !stateTwo }">-->
<!-- <div :style="{ backgroundImage: 'url(' +getImageUrl(stateIconTwo)+')' }" class="state-icon"></div>-->
<!-- 状态{{ stateTwo ? '运行' : '故障' }}-->
<!-- </div>-->
<!-- <div class="switch">-->
<!-- <div-->
<!-- :class="{ active: isStartTwo }"-->
<!-- @click="isStartTwo = true"-->
<!-- >-->
<!-- 启动-->
<!-- </div>-->
<!-- <div-->
<!-- :class="{ active: !isStartTwo }"-->
<!-- @click="isStartTwo = false"-->
<!-- >-->
<!-- 停止-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="power">-->
<!-- <div class="check-box">-->
<!-- <el-radio-group v-model="isSAuto2" class="radio-group">-->
<!-- <el-radio label="true">自动</el-radio>-->
<!-- <el-radio label="false">手动</el-radio>-->
<!-- </el-radio-group>-->
<!-- </div>-->
<!-- <div class="edit-power">-->
<!-- <span style="color: white">当前功率</span>-->
<!-- <span class="units"-->
<!-- ><input-->
<!-- type="number"-->
<!-- min="0"-->
<!-- v-model="powerThree"-->
<!-- :disabled="isSAuto2 === 'true'"-->
<!-- /></span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</template>
@@ -461,119 +461,6 @@ const handleOnMounted = () => {
],
}
Echarts_info2.setOption(fan02_option);
//三号风机
Echarts_info3 = echarts.init(info3.value);
fan03_option = {
series: [
{
type: "gauge",
startAngle: -120,
endAngle: -420,
pointer: {
show: false,
},
progress: {
show: true,
overlap: false,
roundCap: true,
clip: false,
itemStyle: {
borderWidth: 10,
borderColor: {
type: "linear",
x: 0,
y: 1,
x2: 0,
y2: 0,
colorStops: [
{
offset: 0,
color: "#4BB10E", // 0% 处的颜色
},
{
offset: 0.25,
color: "#B1AD0E", // 100% 处的颜色
},
{
offset: 0.75,
color: "#B1880E", // 100% 处的颜色
},
{
offset: 1,
color: "#D77E01", // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
color: {
type: "linear",
x: 0,
y: 1,
x2: 0,
y2: 0,
colorStops: [
{
offset: 0,
color: "#4BB10E", // 0% 处的颜色
},
{
offset: 0.25,
color: "#B1AD0E", // 100% 处的颜色
},
{
offset: 0.75,
color: "#B1880E", // 100% 处的颜色
},
{
offset: 1,
color: "#D77E01", // 100% 处的颜色
},
],
global: false, // 缺省为 false
}
},
},
max: 1000,
splitLine: {
show: false,
},
axisTick: {
show: true,
splitNumber: 1,
length: 10,
},
axisLabel: {
show: false,
},
data: [
{
value: powerThree.value,
fontSize: 2100,
detail: {
valueAnimation: true,
offsetCenter: ["0%", "0%"],
fontSize: 40,
color: "white",
},
},
],
axisLine: {
lineStyle: {
width: 3,
color: [[1, "#155F7C"]],
},
},
detail: {
width: 100,
height: 14,
fontSize: 26,
color: "inherit",
formatter: "{value}",
},
},
],
}
Echarts_info3.setOption(fan03_option);
}
const getImageUrl = (name) => {

View File

@@ -1,23 +1,6 @@
<template>
<div id="transducer-list">
<div v-for="item in transducerData" :key="item.equipmentId">
<!-- <div class="transducer-item">-->
<!-- <img src="@/assets/images/transducer/sp_icon_dy.png"/>-->
<!-- <div class="info">-->
<!-- <div class="name-state">-->
<!-- <div class="name">{{index===1?'二':'一'}}号变频器</div>-->
<!-- <div class="state">-->
<!-- <img src="@/assets/images/transducer/greenLight.png"/>-->
<!-- <span>正常</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="one-item">-->
<!-- <div>A相电压:{{ item.phaseVoltageA }}V</div>-->
<!-- <div>B相电压:{{ item.phaseVoltageB }}V</div>-->
<!-- <div>C相电压:{{ item.phaseVoltageC }}V</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="transducer-item">
<img src="@/assets/images/transducer/sp_icon_dl.png" alt=""/>
<div class="info">
@@ -121,19 +104,19 @@ const getBasicData = (data) => {
tranArr.push(tranObj)
})
//mock数据
let newObj = {
equipmentId: 0,
equipmentName:'3号变频器',
phaseCurrentA: 210,
phaseCurrentAThreshold: 200,
phaseCurrentB: 231,
phaseCurrentBThreshold: 300,
phaseCurrentC: 154,
phaseCurrentCThreshold:200,
frequencySetting: 23,
frequencyFeedback: 34,
}
tranArr.push(newObj)
// let newObj = {
// equipmentId: 0,
// equipmentName:'3号变频器',
// phaseCurrentA: 210,
// phaseCurrentAThreshold: 200,
// phaseCurrentB: 231,
// phaseCurrentBThreshold: 300,
// phaseCurrentC: 154,
// phaseCurrentCThreshold:200,
// frequencySetting: 23,
// frequencyFeedback: 34,
// }
// tranArr.push(newObj)
transducerData.value = tranArr
}
</script>

View File

@@ -1,6 +1,6 @@
<template>
<div id="used-ele">
<div class="content">
<div class="content" @click="handleOpenChart">
<div class="item">
<div></div>
<span>当月用电量{{ electricityConsumptionMonthly }}v</span>
@@ -10,17 +10,44 @@
<span>当月节省量{{ monthlySavings }}v</span>
</div>
</div>
<div class="digital-tunnel">
<el-dialog v-model="isVisited" width="1365px" :modal="false">
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div class="top-tag">
<div class="allUsedEle">
<div class="use-title">
12月总用电量
</div>
<div class="value">2345v</div>
</div>
<div class="allUsedEle">
<div class="use-title">
当月节省量
</div>
<div class="value">345v</div>
</div>
</div>
<div id="containerEle"></div>
<div class="left-bottom-icon"></div>
<div class="right-bottom-icon"></div>
</el-dialog>
</div>
</div>
</template>
<script setup>
import * as echarts from 'echarts';
const props = defineProps({
list: Array,
eleData: Array
});
let myEcharts = reactive({});
const isVisited = ref(false);
const eleData = ref([])
const electricityConsumptionMonthly=ref()
const monthlySavings=ref(55555)
const electricityConsumptionMonthly = ref()
const monthlySavings = ref(55555)
watch(() => props.eleData, (now) => {
getBasicData(now.frequencyChangerList)
}, {deep: true});
@@ -29,7 +56,7 @@ watch(() => props.list, (now) => {
now.forEach(newItem => {
if (item.equipmentId === newItem.equipmentId) {
if (newItem.electricityConsumptionDay) {
electricityConsumptionMonthly.value=newItem.electricityConsumptionMonthly
electricityConsumptionMonthly.value = newItem.electricityConsumptionMonthly
// item.electricityConsumptionDay = newItem.electricityConsumptionDay
// item.electricityConsumptionMonthly = newItem.electricityConsumptionMonthly
// item.electricityConsumptionTotal = newItem.electricityConsumptionTotal
@@ -42,18 +69,92 @@ const getBasicData = (data) => {
let tranObj = {}
let tranArr = []
data.map(item => {
electricityConsumptionMonthly.value=item.electricityConsumptionMonthly,
tranObj = {
equipmentId: item.equipmentId,
// equipmentName: item.equipmentName,
// electricityConsumptionDay: item.electricityConsumptionDay,
// electricityConsumptionMonthly: item.electricityConsumptionMonthly,
// electricityConsumptionTotal: item.electricityConsumptionTotal,
}
electricityConsumptionMonthly.value = item.electricityConsumptionMonthly,
tranObj = {
equipmentId: item.equipmentId,
// equipmentName: item.equipmentName,
// electricityConsumptionDay: item.electricityConsumptionDay,
// electricityConsumptionMonthly: item.electricityConsumptionMonthly,
// electricityConsumptionTotal: item.electricityConsumptionTotal,
}
tranArr.push(tranObj)
})
eleData.value = tranArr
}
const handleOpenChart = () => {
console.log('用电量弹窗')
isVisited.value = true
nextTick(() => {
initChart()
})
}
/**
* 初始化echarts实例方法
*/
const initChart = () => {
//3.初始化container容器
myEcharts = echarts.init(document.getElementById('containerEle'));
//5.传入数据
let option = {
//图例
legend: {
left: 0,
textStyle: {
color: '#FFFFFF',
fontSize: 28
},
// itemWidth: 20,
// itemHeight: 20
},
//离容器四侧的距离
grid: {
left: 0, // 左边距
right: 20, // 右边距
// top: 80, // 顶边距
bottom: 20, // 底边距
containLabel: true,
},
//提示框组件
tooltip: {
show: true,
trigger: 'axis'
},
//X轴
xAxis: {
type: 'category',
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
axisLabel: {
textStyle: {
fontSize: 24,
color: '#D6F1FA'
},
},
},
//Y轴
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
fontSize: 24,
color: '#D6F1FA'
},
},
},
//配置项
series: [
{
data: [120, 200, 150, 80, 70, 110, 130, 100, 140, 130, 160, 150, 90, 130, 110, 120, 150, 140, 130, 120, 110, 100, 90, 80, 100, 140, 130, 160, 150, 24, 50],
type: 'bar'
},
]
}
myEcharts.setOption(option);
//图表大小自适应窗口大小变化
window.onresize = () => {
myEcharts.resize();
}
}
</script>
<style lang="scss" scoped>
@@ -82,6 +183,7 @@ const getBasicData = (data) => {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
.item {
height: 37px;

View File

@@ -0,0 +1,69 @@
<template>
<div class="time-range-group">
<div
class="time-range-button"
:class="{ 'time-range-button-active': selectButton == index }"
@click="select(index)"
v-for="(item, index) in buttonList"
:key="index"
>
<div class="time-range-text">{{ item }}</div>
</div>
</div>
</template>
<script setup>
const props = defineProps({
// 按钮列表
buttonList: {
type: Array,
default: () => [],
},
// 按钮选中的值
modelValue: {
type: Number,
default: 0,
},
width: {
type: String,
default: "auto",
},
});
const emit = defineEmits(["update:modelValue", "select"]);
const selectButton = ref(props.modelValue);
const select = (index) => {
if (selectButton.value === index) return;
selectButton.value = index;
emit("update:modelValue", index);
emit("select", index);
};
watchEffect(() => {
selectButton.value = props.modelValue;
});
</script>
<style scoped lang="scss">
.time-range-group {
width: 204px;
height: 68px;
border: 2px solid #0F82AF;
border-radius: 10px;
background: #062247;
display: flex;
font-size: 28px;
.time-range-button {
cursor: pointer;
padding: 15px 20px;
box-sizing: border-box;
color: #FFFFFF;
&.time-range-button-active {
background: #264A78;
border-radius: 10px;
color: #FFFFFF;
}
}
}
</style>