邓洁: 用电量框样式

This commit is contained in:
邓洁
2023-12-23 12:23:08 +08:00
parent 6e58ac3d65
commit 94db596da6

View File

@@ -71,7 +71,7 @@ const bgImage = computed(() =>
); );
watch(() => props.eleData, (now) => { watch(() => props.eleData, (now) => {
getBasicData(now.frequencyChangerList) getBasicData(now.frequencyChangerList)
// setValue() setValue()
}, {deep: true}); }, {deep: true});
watch(() => props.list, (now) => { watch(() => props.list, (now) => {
eleData.value.forEach(item => { eleData.value.forEach(item => {
@@ -86,22 +86,19 @@ watch(() => props.list, (now) => {
} }
}) })
}) })
// setValue() setValue()
}, {deep: true}); }, {deep: true});
onMounted(()=>{ onMounted(()=>{
// setValue() setValueA()
setValueB()
}) })
const setValue=()=> { const setValueA=()=> {
let width = (electricityConsumptionMonthly.value * length.value.offsetHeight) / 10000; let width = (5000 * length.value.offsetHeight) / 10000;
console.log('width',electricityConsumptionMonthly.value,width)
valueA.value.style.height = `${width}px`; valueA.value.style.height = `${width}px`;
// let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max; }
// point.value.style.left = `${flag}px`; const setValueB=()=> {
// if (width >= flag) { let width = (8000 * length.value.offsetHeight) / 10000;
// value.value.style.background = "#F53839"; valueB.value.style.height = `${width}px`;
// } else {
// value.value.style.background = "#60DDDE";
// }
} }
const getBasicData = (data) => { const getBasicData = (data) => {
let tranObj = {} let tranObj = {}
@@ -232,23 +229,6 @@ const getImageUrl = (name) => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container {
width: 60px;
height: 210px;
border-radius: 31px;
border: 1px solid #0f82af;
position: relative;
margin-bottom: 20px;
.value {
width: 60px;
height: inherit;
background: #60ddde;
border-radius: 31px;
transition: width 0.5s linear 0s;
}
}
:deep(.el-dialog__header) { :deep(.el-dialog__header) {
padding: 0 !important; padding: 0 !important;
} }
@@ -284,14 +264,29 @@ const getImageUrl = (name) => {
.item { .item {
margin-top: 44px; margin-top: 44px;
height: 37px;
font-size: 28px; font-size: 28px;
color: #38CAFB; color: #38CAFB;
line-height: 37px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.container {
width: 60px;
height: 210px;
border-radius: 31px;
border: 1px solid #0f82af;
position: relative;
margin-bottom: 20px;
.value {
position: absolute;
bottom: 0;
width: 60px;
height: inherit;
background: #60ddde;
border-radius: 31px;
transition: width 0.5s linear 0s;
}
}
> div:nth-child(2) { > div:nth-child(2) {
display: flex; display: flex;