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 { html, body, #app, .el-container, .el-aside, .el-main {
height: 100%; height: 100%;
} }
.tunnel-title { .tunnel-title {
width: 2330px; width: 2330px;
height: 156px; height: 156px;
@@ -26,6 +27,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
margin-left: -1165px; margin-left: -1165px;
background-image: url('../images/topAndDown/sp_tb.png'); background-image: url('../images/topAndDown/sp_tb.png');
} }
.box-top { .box-top {
.manage-btn { .manage-btn {
display: flex; display: flex;
@@ -125,7 +127,7 @@ html, body, #app, .el-container, .el-aside, .el-main {
background-image: url('../images/topAndDown/sp_icon_zyc.png'); background-image: url('../images/topAndDown/sp_icon_zyc.png');
} }
.tunnel-length{ .tunnel-length {
position: absolute; position: absolute;
top: 13%; top: 13%;
left: 36%; left: 36%;
@@ -242,3 +244,130 @@ html, body, #app, .el-container, .el-aside, .el-main {
transform: rotate(180deg); 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"> <div class="info-list">
<gas-info-item v-for="item in badGasList" :key="item.equipmentId" :gasInfo="item" @click="handleOpenChart"/> <gas-info-item v-for="item in badGasList" :key="item.equipmentId" :gasInfo="item" @click="handleOpenChart"/>
</div> </div>
<el-dialog v-model="isVisited" title="有害气体监控数据" width="1996px" :modal="false"> <div class="digital-tunnel">
<div class="left-icon"></div> <el-dialog v-model="isVisited" title="有害气体监控数据" width="1365px" :modal="false">
<div class="right-icon"></div> <div class="left-top-icon"></div>
<div id="container" ref="chart" @click.stop></div> <div class="right-top-icon"></div>
<div class="time-select"> <div id="container"></div>
<div class="time-select">
</div> <time-range-btn
</el-dialog> :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> </div>
</template> </template>
<script setup> <script setup>
import GasInfoItem from "./childComps/GasInfoItem.vue"; import GasInfoItem from "./childComps/GasInfoItem.vue";
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import TimeRangeBtn from "@/components/timeRangeBtn/index.vue"
const props = defineProps({ const props = defineProps({
list: Array, list: Array,
badGasData: Array badGasData: Array
}); });
const timeList = ref(["年", "月", "日"]);
const selectTimeButton = ref(0);
const isVisited = ref(false); const isVisited = ref(false);
const badGasList = ref([]) const badGasList = ref([])
const chart = ref(null);
let myEcharts = reactive({}); 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) => { watch(() => props.list, (now) => {
badGasList.value.forEach(item => { badGasList.value.forEach(item => {
@@ -141,13 +52,16 @@ watch(() => props.list, (now) => {
watch(() => props.badGasData, (now) => { watch(() => props.badGasData, (now) => {
getBadGasInfo(now.sensorList) getBadGasInfo(now.sensorList)
}, {deep: true}); }, {deep: true});
const timeSelect = (index) => {
onMounted(() => { console.log('选择时间', index)
nextTick(() => { if(index===0){
initChart() console.log('--年')
}) }else if(index===1){
}) console.log('--月')
}else if(index===2){
console.log('--日')
}
};
const getBadGasInfo = (now) => { const getBadGasInfo = (now) => {
let windPressureObj = {} let windPressureObj = {}
let windPressureArr = [] let windPressureArr = []
@@ -172,16 +86,117 @@ const changeData = (item) => {
const handleOpenChart = () => { const handleOpenChart = () => {
console.log('有害气体弹窗') console.log('有害气体弹窗')
isVisited.value = true isVisited.value = true
initChart() nextTick(() => {
initChart()
})
} }
/** /**
* 初始化echarts实例方法 * 初始化echarts实例方法
*/ */
const initChart = () => { const initChart = () => {
//3.初始化container容器 //3.初始化container容器
myEcharts = echarts.init(chart.value); myEcharts = echarts.init(document.getElementById('container'));
//5.传入数据 //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 = () => { window.onresize = () => {
myEcharts.resize(); myEcharts.resize();
@@ -191,37 +206,6 @@ const initChart = () => {
</script> </script>
<style lang="scss" scoped> <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 { #bad-gas-info {
position: absolute; position: absolute;
z-index: 100; z-index: 100;
@@ -231,34 +215,7 @@ const initChart = () => {
right: 72px; right: 72px;
background-image: url(@/assets/images/badGasInfo/bg.png); 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 { .title {
width: 128px; width: 128px;
height: 45px; height: 45px;

View File

@@ -98,53 +98,53 @@
</div> </div>
</div> </div>
</div> </div>
<div class="fan-item"> <!-- <div class="fan-item">-->
<!-- echarts --> <!-- &lt;!&ndash; echarts &ndash;&gt;-->
<div class="echart" ref="info3"></div> <!-- <div class="echart" ref="info3"></div>-->
<!-- 风机名称 --> <!-- &lt;!&ndash; 风机名称 &ndash;&gt;-->
<div class="fan-name">三号风机</div> <!-- <div class="fan-name">三号风机</div>-->
<!-- 功能 --> <!-- &lt;!&ndash; 功能 &ndash;&gt;-->
<div class="option-nav"> <!-- <div class="option-nav">-->
<div class="state" :class="{ 'blue-state': isStartTwo }"> <!-- <div class="state" :class="{ 'blue-state': isStartTwo }">-->
<div :class="{ stopColor: !stateTwo }"> <!-- <div :class="{ stopColor: !stateTwo }">-->
<div :style="{ backgroundImage: 'url(' +getImageUrl(stateIconTwo)+')' }" class="state-icon"></div> <!-- <div :style="{ backgroundImage: 'url(' +getImageUrl(stateIconTwo)+')' }" class="state-icon"></div>-->
状态{{ stateTwo ? '运行' : '故障' }} <!-- 状态{{ stateTwo ? '运行' : '故障' }}-->
</div> <!-- </div>-->
<div class="switch"> <!-- <div class="switch">-->
<div <!-- <div-->
:class="{ active: isStartTwo }" <!-- :class="{ active: isStartTwo }"-->
@click="isStartTwo = true" <!-- @click="isStartTwo = true"-->
> <!-- >-->
启动 <!-- 启动-->
</div> <!-- </div>-->
<div <!-- <div-->
:class="{ active: !isStartTwo }" <!-- :class="{ active: !isStartTwo }"-->
@click="isStartTwo = false" <!-- @click="isStartTwo = false"-->
> <!-- >-->
停止 <!-- 停止-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="power"> <!-- <div class="power">-->
<div class="check-box"> <!-- <div class="check-box">-->
<el-radio-group v-model="isSAuto2" class="radio-group"> <!-- <el-radio-group v-model="isSAuto2" class="radio-group">-->
<el-radio label="true">自动</el-radio> <!-- <el-radio label="true">自动</el-radio>-->
<el-radio label="false">手动</el-radio> <!-- <el-radio label="false">手动</el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</div> <!-- </div>-->
<div class="edit-power"> <!-- <div class="edit-power">-->
<span style="color: white">当前功率</span> <!-- <span style="color: white">当前功率</span>-->
<span class="units" <!-- <span class="units"-->
><input <!-- ><input-->
type="number" <!-- type="number"-->
min="0" <!-- min="0"-->
v-model="powerThree" <!-- v-model="powerThree"-->
:disabled="isSAuto2 === 'true'" <!-- :disabled="isSAuto2 === 'true'"-->
/></span> <!-- /></span>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</div> </div>
</div> </div>
</template> </template>
@@ -461,119 +461,6 @@ const handleOnMounted = () => {
], ],
} }
Echarts_info2.setOption(fan02_option); 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) => { const getImageUrl = (name) => {

View File

@@ -1,23 +1,6 @@
<template> <template>
<div id="transducer-list"> <div id="transducer-list">
<div v-for="item in transducerData" :key="item.equipmentId"> <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"> <div class="transducer-item">
<img src="@/assets/images/transducer/sp_icon_dl.png" alt=""/> <img src="@/assets/images/transducer/sp_icon_dl.png" alt=""/>
<div class="info"> <div class="info">
@@ -121,19 +104,19 @@ const getBasicData = (data) => {
tranArr.push(tranObj) tranArr.push(tranObj)
}) })
//mock数据 //mock数据
let newObj = { // let newObj = {
equipmentId: 0, // equipmentId: 0,
equipmentName:'3号变频器', // equipmentName:'3号变频器',
phaseCurrentA: 210, // phaseCurrentA: 210,
phaseCurrentAThreshold: 200, // phaseCurrentAThreshold: 200,
phaseCurrentB: 231, // phaseCurrentB: 231,
phaseCurrentBThreshold: 300, // phaseCurrentBThreshold: 300,
phaseCurrentC: 154, // phaseCurrentC: 154,
phaseCurrentCThreshold:200, // phaseCurrentCThreshold:200,
frequencySetting: 23, // frequencySetting: 23,
frequencyFeedback: 34, // frequencyFeedback: 34,
} // }
tranArr.push(newObj) // tranArr.push(newObj)
transducerData.value = tranArr transducerData.value = tranArr
} }
</script> </script>

View File

@@ -1,6 +1,6 @@
<template> <template>
<div id="used-ele"> <div id="used-ele">
<div class="content"> <div class="content" @click="handleOpenChart">
<div class="item"> <div class="item">
<div></div> <div></div>
<span>当月用电量{{ electricityConsumptionMonthly }}v</span> <span>当月用电量{{ electricityConsumptionMonthly }}v</span>
@@ -10,17 +10,44 @@
<span>当月节省量{{ monthlySavings }}v</span> <span>当月节省量{{ monthlySavings }}v</span>
</div> </div>
</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> </div>
</template> </template>
<script setup> <script setup>
import * as echarts from 'echarts';
const props = defineProps({ const props = defineProps({
list: Array, list: Array,
eleData: Array eleData: Array
}); });
let myEcharts = reactive({});
const isVisited = ref(false);
const eleData = ref([]) const eleData = ref([])
const electricityConsumptionMonthly=ref() const electricityConsumptionMonthly = ref()
const monthlySavings=ref(55555) const monthlySavings = ref(55555)
watch(() => props.eleData, (now) => { watch(() => props.eleData, (now) => {
getBasicData(now.frequencyChangerList) getBasicData(now.frequencyChangerList)
}, {deep: true}); }, {deep: true});
@@ -29,7 +56,7 @@ watch(() => props.list, (now) => {
now.forEach(newItem => { now.forEach(newItem => {
if (item.equipmentId === newItem.equipmentId) { if (item.equipmentId === newItem.equipmentId) {
if (newItem.electricityConsumptionDay) { if (newItem.electricityConsumptionDay) {
electricityConsumptionMonthly.value=newItem.electricityConsumptionMonthly electricityConsumptionMonthly.value = newItem.electricityConsumptionMonthly
// item.electricityConsumptionDay = newItem.electricityConsumptionDay // item.electricityConsumptionDay = newItem.electricityConsumptionDay
// item.electricityConsumptionMonthly = newItem.electricityConsumptionMonthly // item.electricityConsumptionMonthly = newItem.electricityConsumptionMonthly
// item.electricityConsumptionTotal = newItem.electricityConsumptionTotal // item.electricityConsumptionTotal = newItem.electricityConsumptionTotal
@@ -42,18 +69,92 @@ const getBasicData = (data) => {
let tranObj = {} let tranObj = {}
let tranArr = [] let tranArr = []
data.map(item => { data.map(item => {
electricityConsumptionMonthly.value=item.electricityConsumptionMonthly, electricityConsumptionMonthly.value = item.electricityConsumptionMonthly,
tranObj = { tranObj = {
equipmentId: item.equipmentId, equipmentId: item.equipmentId,
// equipmentName: item.equipmentName, // equipmentName: item.equipmentName,
// electricityConsumptionDay: item.electricityConsumptionDay, // electricityConsumptionDay: item.electricityConsumptionDay,
// electricityConsumptionMonthly: item.electricityConsumptionMonthly, // electricityConsumptionMonthly: item.electricityConsumptionMonthly,
// electricityConsumptionTotal: item.electricityConsumptionTotal, // electricityConsumptionTotal: item.electricityConsumptionTotal,
} }
tranArr.push(tranObj) tranArr.push(tranObj)
}) })
eleData.value = tranArr 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -82,6 +183,7 @@ const getBasicData = (data) => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
cursor: pointer;
.item { .item {
height: 37px; 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>