fix : 细节优化

This commit is contained in:
2024-03-04 17:29:06 +08:00
parent c64c0fc8e4
commit 07739421e8

View File

@@ -67,7 +67,7 @@
<div style="width: 1px;"></div> <div style="width: 1px;"></div>
</div> </div>
<div class="time-select"> <div class="time-select">
<choose-month v-if="selectTimeButton===1" ref="chooseMonthRef" @select="monthSelect" /> <choose-month v-if="selectTimeButton===1" ref="chooseMonthRef" @select="monthSelect"/>
<time-range-btn <time-range-btn
:buttonList="timeList" :buttonList="timeList"
v-model="selectTimeButton" v-model="selectTimeButton"
@@ -85,6 +85,7 @@ import * as echarts from 'echarts';
import TimeRangeBtn from "@/components/timeRangeBtn/index.vue" import TimeRangeBtn from "@/components/timeRangeBtn/index.vue"
import ChooseMonth from "@/components/chooseMonth/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue"
import {getEleEchartsInfo} from "@/api/largeScreen"; import {getEleEchartsInfo} from "@/api/largeScreen";
const props = defineProps({ const props = defineProps({
list: Array, list: Array,
eleData: Array eleData: Array
@@ -115,11 +116,11 @@ const bgImage = computed(() =>
); );
watch(() => props.eleData, (now) => { watch(() => props.eleData, (now) => {
if (now) { if (now) {
let fanObj={} let fanObj = {}
now.frequencyChangerList.forEach(item=>{ now.frequencyChangerList.forEach(item => {
fanObj={ fanObj = {
value: item.equipmentId, value: item.equipmentId,
label:changeNum(item.equipmentId) label: changeNum(item.equipmentId)
} }
fanList.value.push(fanObj) fanList.value.push(fanObj)
}) })
@@ -154,7 +155,7 @@ const setValueA = () => {
if (electricityConsumptionMonthly.value === 0 || length.value === null) { if (electricityConsumptionMonthly.value === 0 || length.value === null) {
valueA.value.style.height = `0px`; valueA.value.style.height = `0px`;
} }
let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) /40000; let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) / 40000;
valueA.value.style.height = `${width}px`; valueA.value.style.height = `${width}px`;
} }
const setValueB = () => { const setValueB = () => {
@@ -171,7 +172,7 @@ const getBasicData = (data) => {
const monthSelect = (val) => { const monthSelect = (val) => {
monthValue.value = val monthValue.value = val
getFanInfo(openEquipmentId.value, 'month',val) getFanInfo(openEquipmentId.value, 'month', val)
} }
const changeDate = (index) => { const changeDate = (index) => {
switch (index) { switch (index) {
@@ -182,12 +183,12 @@ const changeDate = (index) => {
} }
} }
const timeSelect = (index) => { const timeSelect = (index) => {
monthValue.value='' monthValue.value = ''
getFanInfo(openEquipmentId.value, changeDate(index)) getFanInfo(openEquipmentId.value, changeDate(index))
}; };
const changeFanData = (val) => { const changeFanData = (val) => {
selectTimeButton.value=1 selectTimeButton.value = 1
openEquipmentId.value=val openEquipmentId.value = val
getFanInfo(val, 'month', monthValue.value) getFanInfo(val, 'month', monthValue.value)
} }
const getFanInfo = (equipmentId, type = 'month', time = '') => { const getFanInfo = (equipmentId, type = 'month', time = '') => {
@@ -196,10 +197,10 @@ const getFanInfo = (equipmentId, type = 'month', time = '') => {
getEleEchartsInfo(equipmentId, time, type).then(res => { getEleEchartsInfo(equipmentId, time, type).then(res => {
if (res?.code === 1000) { if (res?.code === 1000) {
showLoading.value = false showLoading.value = false
totalElectricityConsumption.value=res.data.totalElectricityConsumption totalElectricityConsumption.value = res.data.totalElectricityConsumption
saveElectricity.value=res.data.saveElectricity saveElectricity.value = res.data.saveElectricity
nextTick(() => { nextTick(() => {
initChart(res.data.dates,res.data.consumptionValues,res.data.saveElectricityValues) initChart(res.data.dates, res.data.consumptionValues, res.data.saveElectricityValues)
}) })
} }
}) })
@@ -208,11 +209,11 @@ const getFanInfo = (equipmentId, type = 'month', time = '') => {
}) })
} }
const handleOpenChart = () => { const handleOpenChart = () => {
selectTimeButton.value=1 selectTimeButton.value = 1
isVisited.value = true isVisited.value = true
openEquipmentId.value=fanList.value[0].value openEquipmentId.value = fanList.value[0].value
chooseChartFan.value=fanList.value[0].value chooseChartFan.value = fanList.value[0].value
nextTick(()=>{ nextTick(() => {
chooseMonthRef.value.clearData() chooseMonthRef.value.clearData()
}) })
getFanInfo(openEquipmentId.value, 'month') getFanInfo(openEquipmentId.value, 'month')
@@ -289,7 +290,7 @@ const initChart = (type, valueA, valueB) => {
xAxis: { xAxis: {
type: 'category', 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'], // 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'],
data:type, data: type,
axisLabel: { axisLabel: {
textStyle: { textStyle: {
fontSize: 45, fontSize: 45,
@@ -333,13 +334,16 @@ const initChart = (type, valueA, valueB) => {
<style lang="scss"> <style lang="scss">
.user-select { .user-select {
margin-bottom: 126px; margin-bottom: 126px;
.el-input{
.el-input {
width: 300px; width: 300px;
.el-input__wrapper{
.el-input__wrapper {
background-color: transparent; background-color: transparent;
box-shadow: none; box-shadow: none;
border-radius: 10px; border-radius: 10px;
border: 2px solid #0F82AF; border: 2px solid #0F82AF;
.el-input__inner { .el-input__inner {
height: 80px; height: 80px;
font-size: 40px; font-size: 40px;
@@ -348,13 +352,11 @@ const initChart = (type, valueA, valueB) => {
} }
} }
.el-select__wrapper {
min-height: 75px; .el-select__placeholder {
height: auto !important; height: 54px;
background-color: transparent; line-height: 54px;
border: 1px solid #08B7B8; color: #FFFFFF;
font-size: 35px;
width: 476px;
} }
.el-select__placeholder.is-transparent { .el-select__placeholder.is-transparent {
@@ -399,11 +401,22 @@ const initChart = (type, valueA, valueB) => {
.el-form-item.is-error .el-input__wrapper { .el-form-item.is-error .el-input__wrapper {
box-shadow: none; box-shadow: none;
} }
.el-select__wrapper {
min-height: 75px;
height: auto !important;
background-color: transparent;
border: 1px solid #08B7B8;
font-size: 35px;
width: 213px!important;
}
.el-select__popper { .el-select__popper {
margin-top: -12px !important; margin-top: -12px !important;
background: #072247 !important; background: #072247 !important;
border: 1px solid #0F82AF !important; border: 1px solid #0F82AF !important;
//width: 476px!important;
.el-select-dropdown{
width: auto;
}
} }
.el-popper { .el-popper {
@@ -523,6 +536,7 @@ const initChart = (type, valueA, valueB) => {
position: relative; position: relative;
margin-bottom: 20px; margin-bottom: 20px;
padding: 1px; padding: 1px;
.value { .value {
position: absolute; position: absolute;
bottom: 0; bottom: 0;