This commit is contained in:
lb 2023-10-30 16:17:25 +08:00
parent 6e90cf3718
commit a3ba9926ce
2 changed files with 18 additions and 3 deletions

View File

@ -43,6 +43,10 @@ export default {
runtime: "0012".split(""), runtime: "0012".split(""),
} }
}, },
mounted() {
this.getRuntime();
setInterval(this.getRuntime, 1000 * 60 * 30);
},
watch: { watch: {
fireDirection: function (val) { fireDirection: function (val) {
this.$set(this.rdata[0], "value", val); this.$set(this.rdata[0], "value", val);
@ -73,6 +77,17 @@ export default {
computed: { computed: {
...mapState(["fireDirection", "lastFireChangeTime", "fireChangeTime", "kilnPressure"]), ...mapState(["fireDirection", "lastFireChangeTime", "fireChangeTime", "kilnPressure"]),
}, },
methods: {
getRuntime() {
const diff = Date.now() - new Date("2023-5-7 8:00:00");
const days = parseInt(diff / 1000 / 60 / 60 / 24);
const hours = parseInt(
(diff - days * 24 * 60 * 60 * 1000) / 1000 / 60 / 60
);
console.log("days", days);
this.runtime = (days + "").padStart(4, "0");
},
}
} }
</script> </script>

View File

@ -83,15 +83,15 @@ header {
.header--logo { .header--logo {
width: 648px; width: 648px;
height: 280px; height: 280px;
margin-right: 100px; margin-right: 16px;
background: url(../../assets/logo.png) center/contain no-repeat; background: url(../../assets/logo.png) center/contain no-repeat;
} }
h1 { h1 {
font-size: 128px; font-size: 144px;
line-height: 330px; line-height: 330px;
margin: 0; margin: 0;
letter-spacing: 24px; letter-spacing: 16px;
user-select: none; user-select: none;
font-weight: 600; font-weight: 600;
color: $main-color; color: $main-color;