邓洁: 接口及细节优化
This commit is contained in:
@@ -238,8 +238,7 @@ const initChart = (type, values) => {
|
||||
let content = `
|
||||
<div style="background: linear-gradient(180deg, #254062 0%, rgba(20,36,51,0.3) 100%);;border: 2px solid #6087BA;border-radius: 4px;padding: 8px 16px;">
|
||||
<div style="font-size: 52px;font-family: PingFang SC-Regular, PingFang SC;font-weight: 400;color: #EFEEEE;margin-bottom: 8px;">${params[0].name}</div>
|
||||
<div style="font-size: 48px;line-height: 48px;font-family: Bebas Neue-Regular, Bebas Neue;font-weight: 400;"><span style="color: #FFFFFF">进风口: </span><span style="background: linear-gradient(180deg, #F5B85F 0%, #FFFFFF 100%);-webkit-background-clip: text;-webkit-text-fill-color: transparent;">${params[0].value}</span></div>
|
||||
<div style="font-size: 48px;line-height: 48px;font-family: Bebas Neue-Regular, Bebas Neue;font-weight: 400;margin-top: 30px"><span style="color: #FFFFFF">出风口: </span><span style="background: linear-gradient(180deg, #F5B85F 0%, #FFFFFF 100%);-webkit-background-clip: text;-webkit-text-fill-color: transparent;">${params[1].value}</span></div>
|
||||
<div style="font-size: 48px;line-height: 48px;font-family: Bebas Neue-Regular, Bebas Neue;font-weight: 400;"><span style="background: linear-gradient(180deg, #F5B85F 0%, #FFFFFF 100%);-webkit-background-clip: text;-webkit-text-fill-color: transparent;">${params[0].value}</span></div>
|
||||
</div>`;
|
||||
return content;
|
||||
},
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
<div
|
||||
id="auto"
|
||||
:class="{ active: item.running }"
|
||||
@click="item.running = true"
|
||||
@click="item.running = true;editOperate(item)"
|
||||
>
|
||||
启动
|
||||
</div>
|
||||
<div
|
||||
id="stop"
|
||||
:class="{ active: !item.running }"
|
||||
@click="item.running = false"
|
||||
@click="item.running = false;editOperate(item)"
|
||||
>
|
||||
停止
|
||||
</div>
|
||||
@@ -39,20 +39,27 @@
|
||||
</div>
|
||||
<div class="power">
|
||||
<div class="check-box">
|
||||
<el-radio-group v-model="item.autoMode">
|
||||
<el-radio-group v-model="item.autoMode" @change="changeModel(item)">
|
||||
<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="item.frequencySetting"
|
||||
:disabled="item.autoMode"
|
||||
/></span>
|
||||
<span style="color: white">给定频率</span>
|
||||
<!-- <span class="units"-->
|
||||
<!-- ><input-->
|
||||
<!-- type="number"-->
|
||||
<!-- min="0"-->
|
||||
<!-- v-model="item.frequencySetting"-->
|
||||
<!-- onchange="changeFrequency(item)"-->
|
||||
<!-- :disabled="item.autoMode"-->
|
||||
<!-- /></span>-->
|
||||
<el-input type="number" min="0" v-model="item.frequencySetting" :disabled="item.autoMode"
|
||||
@change="changeFrequency(item)">
|
||||
<template #suffix>
|
||||
<span>Hz</span>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,10 +115,16 @@
|
||||
<script setup>
|
||||
import * as echarts from "echarts";
|
||||
import FanInfoItem from "./FanInfoItem.vue";
|
||||
import {getFanEchartsInfo} from "../../../api/largeScreen";
|
||||
import {
|
||||
editFrequency,
|
||||
editFrequencyModelSwitch,
|
||||
editFrequencyOperationSwitch,
|
||||
getFanEchartsInfo
|
||||
} from "../../../api/largeScreen";
|
||||
|
||||
const props = defineProps({
|
||||
list: Array,
|
||||
tunnelId: Number,
|
||||
fanData: Array,
|
||||
transducerData: Array,
|
||||
loading: Number,
|
||||
@@ -145,6 +158,9 @@ let myEcharts = reactive({});
|
||||
watch(() => props.loading, (now) => {
|
||||
props.loading = now
|
||||
}, {deep: true});
|
||||
watch(() => props.tunnelId, (now) => {
|
||||
props.tunnelId = now
|
||||
}, {deep: true});
|
||||
watch(() => props.transducerData, (now) => {
|
||||
getTransData(now.frequencyChangerList)
|
||||
}, {deep: true});
|
||||
@@ -178,6 +194,47 @@ watch(() => props.list, (now) => {
|
||||
})
|
||||
handleOnMounted()
|
||||
}, {deep: true});
|
||||
const packageData = (item, type, flag) => {
|
||||
let number = 0
|
||||
if (item.equipmentType === "frequency1") {
|
||||
number = 1
|
||||
} else if (item.equipmentType === "frequency2") {
|
||||
number = 2
|
||||
}
|
||||
if (flag) {
|
||||
return {
|
||||
number: number,
|
||||
value: type,//浮点数
|
||||
tunnelId: props.tunnelId,
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
number: number,
|
||||
state: type === true ? 0 : 1,
|
||||
tunnelId: props.tunnelId,
|
||||
}
|
||||
}
|
||||
}
|
||||
//启动/停止
|
||||
const editOperate = (item) => {
|
||||
const data = packageData(item, item.running)
|
||||
editFrequencyOperationSwitch(data).then(res => {
|
||||
console.log('修改风机启动', res)
|
||||
})
|
||||
}
|
||||
const changeFrequency = (item) => {
|
||||
console.log()
|
||||
const data = packageData(item, item.frequencySetting, true)
|
||||
editFrequency(data).then(res => {
|
||||
console.log('修改风机频率', res)
|
||||
})
|
||||
}
|
||||
const changeModel = (item) => {
|
||||
const data = packageData(item, item.autoMode)
|
||||
editFrequencyModelSwitch(data).then(res => {
|
||||
console.log('修改自动模式', res)
|
||||
})
|
||||
}
|
||||
const getFanInfo = (equipmentId) => {
|
||||
isVisited.value = true
|
||||
showLoading.value = true
|
||||
@@ -242,11 +299,12 @@ const getBasicData = (data) => {
|
||||
data?.map(item => {
|
||||
tranObj = {
|
||||
equipmentId: item.equipmentId,
|
||||
equipmentType: item.equipmentType,
|
||||
autoMode: item.autoMode,//自动模式
|
||||
breakdown: item.breakdown,//故障
|
||||
running: item.running,//启动,
|
||||
frequencyFeedback: item.frequencyFeedback,//当前功率
|
||||
frequencySetting: item.frequencySetting//当前功率
|
||||
frequencyFeedback: item.frequencyFeedback,
|
||||
frequencySetting: item.frequencySetting
|
||||
}
|
||||
tranArr.push(tranObj)
|
||||
})
|
||||
@@ -795,34 +853,70 @@ input[type="number"] {
|
||||
|
||||
.edit-power {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
|
||||
.units {
|
||||
position: relative;
|
||||
> span:first-child {
|
||||
white-space: pre;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.units::after {
|
||||
content: "Hz";
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 28px;
|
||||
color: #38cafb;
|
||||
line-height: 37px;
|
||||
}
|
||||
|
||||
input {
|
||||
//:deep(.is-disabled) {
|
||||
// .el-input__inner{
|
||||
// color: #FFFFFF!important;
|
||||
// }
|
||||
//}
|
||||
:deep(.el-input__wrapper) {
|
||||
width: 130px;
|
||||
height: 44px;
|
||||
border: 2px solid #0f82af;
|
||||
background: transparent;
|
||||
margin-left: 14px;
|
||||
outline: none;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #38cafb;
|
||||
line-height: 37px;
|
||||
background-color: transparent;
|
||||
box-shadow: none;
|
||||
border: 1px solid #38CAFB;
|
||||
transform: none;
|
||||
transition: none;
|
||||
margin-right: 10px;
|
||||
|
||||
.el-input__inner {
|
||||
height: 44px;
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
color: #38CAFB;
|
||||
}
|
||||
|
||||
|
||||
.el-input__suffix-inner {
|
||||
font-size: 30px;
|
||||
color: #38CAFB;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
//.units {
|
||||
// position: relative;
|
||||
//}
|
||||
//
|
||||
//.units::after {
|
||||
// content: "Hz";
|
||||
// position: absolute;
|
||||
// right: 6px;
|
||||
// top: 50%;
|
||||
// transform: translateY(-50%);
|
||||
// font-size: 28px;
|
||||
// color: #38cafb;
|
||||
// line-height: 37px;
|
||||
//}
|
||||
//
|
||||
//input {
|
||||
// width: 130px;
|
||||
// height: 44px;
|
||||
// border: 2px solid #0f82af;
|
||||
// background: transparent;
|
||||
// margin-left: 14px;
|
||||
// outline: none;
|
||||
// font-size: 28px;
|
||||
// font-weight: bold;
|
||||
// color: #38cafb;
|
||||
// line-height: 37px;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user