Commit f4da6662 authored by 纪泽龙's avatar 纪泽龙

增加企业数据监控页面的动画效果,数据缓存

parent 352522ad
This diff is collapsed.
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-25 17:15:31 * @Date: 2022-03-25 17:15:31
* @LastEditTime: 2022-03-26 17:14:12 * @LastEditTime: 2022-03-28 13:52:40
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<template> <template>
<div class="czcard"> <div class="czcard">
<my-collapse title="储罐" ref="myCollapse"> <my-collapse
title="储罐"
ref="myCollapse"
:listNum="czList.filter((item) => item.show).length"
>
<template v-slot:chackbox> <template v-slot:chackbox>
<div <div
class="filter" class="filter"
...@@ -34,8 +38,12 @@ ...@@ -34,8 +38,12 @@
:key="item.deviceName" :key="item.deviceName"
v-show="item.show" v-show="item.show"
> >
<div :title="item.companyName" class="left zzz">{{ item.companyName }}</div> <div :title="item.companyName" class="left zzz">
<div :class="`one-${item.state}`" class="state">{{ typeState[item.state - 1] }}</div> {{ item.companyName }}
</div>
<div :class="`one-${item.state}`" class="state">
{{ typeState[item.state - 1] }}
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -126,10 +134,6 @@ export default { ...@@ -126,10 +134,6 @@ export default {
this.deviceTypeArr.push(state); this.deviceTypeArr.push(state);
} }
this.filter(this.deviceTypeArr); this.filter(this.deviceTypeArr);
// 改变大小
this.$nextTick(() => {
this.$refs.myCollapse.getHeight();
});
}, },
// 过滤对象 // 过滤对象
filter(arr) { filter(arr) {
...@@ -235,7 +239,7 @@ $active: #06d7b1 !important; ...@@ -235,7 +239,7 @@ $active: #06d7b1 !important;
// margin-right: 45px; // margin-right: 45px;
width: 15%; width: 15%;
min-width: 190px; min-width: 190px;
margin-right: 1%; margin-right: 1.5%;
.left { .left {
margin-right: 4px; margin-right: 4px;
font-size: 14px; font-size: 14px;
...@@ -257,9 +261,9 @@ $active: #06d7b1 !important; ...@@ -257,9 +261,9 @@ $active: #06d7b1 !important;
border-radius: 2px; border-radius: 2px;
background-color: #ff6c68; background-color: #ff6c68;
} }
&.one-3{ &.one-3 {
color: #fff; color: #fff;
border: 1px solid #AAAAAA; border: 1px solid #aaaaaa;
border-radius: 2px; border-radius: 2px;
background-color: #bbbbbb; background-color: #bbbbbb;
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-25 17:15:31 * @Date: 2022-03-25 17:15:31
* @LastEditTime: 2022-03-26 17:12:04 * @LastEditTime: 2022-03-28 13:43:09
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<template> <template>
<div class="czcard"> <div class="czcard">
<my-collapse title="场站" ref="myCollapse"> <my-collapse
title="场站"
ref="myCollapse"
:listNum="czList.filter((item) => item.show).length"
>
<template v-slot:chackbox> <template v-slot:chackbox>
<div class="filter" v-for="item in filterList" :key="item.value"> <div class="filter" v-for="item in filterList" :key="item.value">
<span <span
...@@ -140,7 +144,6 @@ export default { ...@@ -140,7 +144,6 @@ export default {
show: true, show: true,
type: 4, type: 4,
}, },
], ],
}; };
}, },
...@@ -156,6 +159,7 @@ export default { ...@@ -156,6 +159,7 @@ export default {
methods: { methods: {
hide() { hide() {
this.carHide = !this.carHide; this.carHide = !this.carHide;
// this.myCollapse();
}, },
// 根据父子元素自动计算是否需要添加值start // 根据父子元素自动计算是否需要添加值start
changeAddStartNum() { changeAddStartNum() {
...@@ -185,10 +189,15 @@ export default { ...@@ -185,10 +189,15 @@ export default {
this.deviceTypeArr.push(type); this.deviceTypeArr.push(type);
} }
this.filter(this.deviceTypeArr); this.filter(this.deviceTypeArr);
// 改变大小 // 改变大小,因为动画原因加个延迟
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.myCollapse.getHeight(); // setTimeout(()=>{
}); // this.myCollapse()
// }, 300);
// });
},
myCollapse() {
// this.$refs.myCollapse.getHeight();
}, },
// 过滤对象 // 过滤对象
filter(arr) { filter(arr) {
...@@ -236,7 +245,7 @@ export default { ...@@ -236,7 +245,7 @@ export default {
} }
& > div { & > div {
margin-bottom: 20px; margin-bottom: 20px;
margin-left:1%; margin-left: 1%;
width: 24%; width: 24%;
min-width: 295px; min-width: 295px;
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-25 17:15:31 * @Date: 2022-03-25 17:15:31
* @LastEditTime: 2022-03-26 17:16:36 * @LastEditTime: 2022-03-28 13:52:32
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<template> <template>
<div class="czcard"> <div class="czcard">
<my-collapse title="阀门井" ref="myCollapse"> <my-collapse
title="阀门井"
ref="myCollapse"
:listNum="czList.filter((item) => item.show).length"
>
<template v-slot:chackbox> <template v-slot:chackbox>
<div <div
class="filter" class="filter"
...@@ -34,8 +38,12 @@ ...@@ -34,8 +38,12 @@
:key="item.deviceName" :key="item.deviceName"
v-show="item.show" v-show="item.show"
> >
<div :title="item.companyName" class="left zzz">{{ item.companyName }}</div> <div :title="item.companyName" class="left zzz">
<div :class="`one-${item.state}`" class="state">{{ typeState[item.state - 1] }}</div> {{ item.companyName }}
</div>
<div :class="`one-${item.state}`" class="state">
{{ typeState[item.state - 1] }}
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -126,10 +134,6 @@ export default { ...@@ -126,10 +134,6 @@ export default {
this.deviceTypeArr.push(state); this.deviceTypeArr.push(state);
} }
this.filter(this.deviceTypeArr); this.filter(this.deviceTypeArr);
// 改变大小
this.$nextTick(() => {
this.$refs.myCollapse.getHeight();
});
}, },
// 过滤对象 // 过滤对象
filter(arr) { filter(arr) {
...@@ -235,7 +239,7 @@ $active: #06d7b1 !important; ...@@ -235,7 +239,7 @@ $active: #06d7b1 !important;
// margin-right: 45px; // margin-right: 45px;
width: 15%; width: 15%;
min-width: 190px; min-width: 190px;
margin-right: 1%; margin-right: 1.5%;
.left { .left {
margin-right: 4px; margin-right: 4px;
font-size: 14px; font-size: 14px;
...@@ -257,9 +261,9 @@ $active: #06d7b1 !important; ...@@ -257,9 +261,9 @@ $active: #06d7b1 !important;
border-radius: 2px; border-radius: 2px;
background-color: #ff6c68; background-color: #ff6c68;
} }
&.one-3{ &.one-3 {
color: #fff; color: #fff;
border: 1px solid #AAAAAA; border: 1px solid #aaaaaa;
border-radius: 2px; border-radius: 2px;
background-color: #bbbbbb; background-color: #bbbbbb;
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-25 17:15:31 * @Date: 2022-03-25 17:15:31
* @LastEditTime: 2022-03-26 15:33:25 * @LastEditTime: 2022-03-28 13:46:49
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
> >
<div class="title flex"> <div class="title flex">
<div class="left"> <div class="left">
<div class="device">{{title}}</div> <div class="device">{{ title }}</div>
<slot name="chackbox" /> <slot name="chackbox" />
</div> </div>
<div class="right"> <div class="right">
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
</div> </div>
</div> </div>
<div ref="container"> <div ref="container">
<slot name="container" /> <transition name="fade" mode="out-in">
<div :key="listNum">
<slot name="container" />
</div>
</transition>
</div> </div>
</div> </div>
</div> </div>
...@@ -38,16 +42,22 @@ ...@@ -38,16 +42,22 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
props:{ props: {
title:String, title: String,
// 动画需求
listNum: {
type: Number,
default:"1"
},
}, },
data() { data() {
return { return {
carHide: true, carHide: true,
transitionHeight: "60px", transitionHeight: "60px",
}; };
}, },
computed: { computed: {
...mapGetters(["sidebar"]), ...mapGetters(["sidebar"]),
}, },
...@@ -56,6 +66,11 @@ export default { ...@@ -56,6 +66,11 @@ export default {
setTimeout(this.getHeight, 200); setTimeout(this.getHeight, 200);
// this.getHeight(); // this.getHeight();
}, },
listNum() {
setTimeout(() => {
this.getHeight();
}, 300);
},
}, },
mounted() { mounted() {
this.getHeight(); this.getHeight();
...@@ -67,14 +82,14 @@ export default { ...@@ -67,14 +82,14 @@ export default {
}, },
getHeight() { getHeight() {
const { height } = this.$refs?.container?.getBoundingClientRect(); const { height } = this.$refs?.container?.getBoundingClientRect();
if(!height){ if (!height) {
return; return;
} }
// 高度必须是一个指定的值才能过渡变化,这样就计算出了整个元素的指定高度,然后赋值 // 高度必须是一个指定的值才能过渡变化,这样就计算出了整个元素的指定高度,然后赋值
if (height > 0) { if (height > 0) {
this.transitionHeight = height + 60 + 18 + "px"; this.transitionHeight = height + 60 + 18 + "px";
}else{ } else {
this.transitionHeight="60px"; this.transitionHeight = "60px";
} }
}, },
}, },
...@@ -82,6 +97,13 @@ export default { ...@@ -82,6 +97,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
transition: all 0.25s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
.card { .card {
transition: all 0.5s; transition: all 0.5s;
// height: 212px; // height: 212px;
...@@ -92,7 +114,7 @@ export default { ...@@ -92,7 +114,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 15px 22px 18px 22px; padding: 15px 22px 18px 22px;
overflow: hidden; overflow: hidden;
margin-bottom:20px; margin-bottom: 20px;
&.hide { &.hide {
height: 60px !important; height: 60px !important;
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-25 17:15:31 * @Date: 2022-03-25 17:15:31
* @LastEditTime: 2022-03-26 17:16:52 * @LastEditTime: 2022-03-28 13:53:04
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData/CzCard.vue
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<template> <template>
<div class="czcard"> <div class="czcard">
<my-collapse title="调压箱" ref="myCollapse"> <my-collapse
title="调压箱"
ref="myCollapse"
:listNum="czList.filter((item) => item.show).length"
>
<template v-slot:chackbox> <template v-slot:chackbox>
<div <div
class="filter" class="filter"
...@@ -34,8 +38,12 @@ ...@@ -34,8 +38,12 @@
:key="item.deviceName" :key="item.deviceName"
v-show="item.show" v-show="item.show"
> >
<div :title="item.companyName" class="left zzz">{{ item.companyName }}</div> <div :title="item.companyName" class="left zzz">
<div :class="`one-${item.state}`" class="state">{{ typeState[item.state - 1] }}</div> {{ item.companyName }}
</div>
<div :class="`one-${item.state}`" class="state">
{{ typeState[item.state - 1] }}
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -126,10 +134,6 @@ export default { ...@@ -126,10 +134,6 @@ export default {
this.deviceTypeArr.push(state); this.deviceTypeArr.push(state);
} }
this.filter(this.deviceTypeArr); this.filter(this.deviceTypeArr);
// 改变大小
this.$nextTick(() => {
this.$refs.myCollapse.getHeight();
});
}, },
// 过滤对象 // 过滤对象
filter(arr) { filter(arr) {
...@@ -235,7 +239,7 @@ $active: #06d7b1 !important; ...@@ -235,7 +239,7 @@ $active: #06d7b1 !important;
// margin-right: 45px; // margin-right: 45px;
width: 15%; width: 15%;
min-width: 190px; min-width: 190px;
margin-right: 1%; margin-right: 1.5%;
.left { .left {
margin-right: 4px; margin-right: 4px;
font-size: 14px; font-size: 14px;
...@@ -257,9 +261,9 @@ $active: #06d7b1 !important; ...@@ -257,9 +261,9 @@ $active: #06d7b1 !important;
border-radius: 2px; border-radius: 2px;
background-color: #ff6c68; background-color: #ff6c68;
} }
&.one-3{ &.one-3 {
color: #fff; color: #fff;
border: 1px solid #AAAAAA; border: 1px solid #aaaaaa;
border-radius: 2px; border-radius: 2px;
background-color: #bbbbbb; background-color: #bbbbbb;
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-25 13:46:23 * @Date: 2022-03-25 13:46:23
* @LastEditTime: 2022-03-26 17:15:43 * @LastEditTime: 2022-03-28 13:50:56
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/component/charsData.vue
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.chars-data { .chars-data {
padding: 26px 108px 0 88px; // padding: 26px 108px 0 88px;
padding: 20px;
} }
</style> </style>
\ No newline at end of file
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-03-08 17:28:57 * @Date: 2022-03-08 17:28:57
* @LastEditTime: 2022-03-25 15:27:44 * @LastEditTime: 2022-03-28 13:54:22
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/index.vue * @FilePath: /gassafety-progress/gassafetyprogress-web/src/views/operationMonitor/monitorData/index.vue
...@@ -16,7 +16,11 @@ ...@@ -16,7 +16,11 @@
@click="isComChange(index)" @click="isComChange(index)"
></div> ></div>
</div> </div>
<component :is="currentTabComponent"></component> <transition name="fade-transform" mode="out-in">
<keep-alive>
<component :is="currentTabComponent"></component>
</keep-alive>
</transition>
</div> </div>
</template> </template>
...@@ -28,7 +32,7 @@ export default { ...@@ -28,7 +32,7 @@ export default {
return { return {
// currentTabComponent: tabledata, // currentTabComponent: tabledata,
changeIcon: [{ class: "icon-b" }, { class: "icon-a" }], changeIcon: [{ class: "icon-b" }, { class: "icon-a" }],
isCom: 1, isCom: 0,
}; };
}, },
computed: { computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment