add 字体

This commit is contained in:
lb 2023-05-09 15:14:10 +08:00
parent d8f97dd8f4
commit 0ca11c2899
9 changed files with 171 additions and 28 deletions

BIN
src/assets/clock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

BIN
src/assets/fonts/zkqkhy.ttf Normal file

Binary file not shown.

View File

@ -1,12 +1,10 @@
<template> <template>
<!-- 窑炉运行时间 --> <!-- 窑炉运行时间 -->
<Container usage="NumberOrDate"> <Container usage="NumberOrDate">
<SubContainer title="窑炉运行时间" icon="clock"> <SubContainer title="窑炉运行时间" icon="clock" padding="17px">
<div class="flex flex-col"> <div class="flex flex-col">
<div class="time"> <div class="time flex flex-center">
<div class="time--item" v-for="(item, index) in time" :key="index"> <DigitalBox class="time--item" v-for="(item, index) in time" :key="index" :value="item" />
{{ item }}
</div>
</div> </div>
<div class="text"> <div class="text">
窑炉运行时间 窑炉运行时间
@ -19,27 +17,39 @@
<script> <script>
import Container from "../layout/Container.vue"; import Container from "../layout/Container.vue";
import SubContainer from "../layout/SubContainer.vue"; import SubContainer from "../layout/SubContainer.vue";
import DigitalBox from '../common/DigitalBox.vue'
export default { export default {
name: "KilnRuntime", name: "KilnRuntime",
components: { Container, SubContainer }, components: { Container, SubContainer, DigitalBox },
props: {}, props: {},
data() { data() {
return { return {
time: "2202天55时", time: "2202天55时",
}; };
}, },
created() {},
mounted() {},
methods: {},
}; };
</script> </script>
<style scoped> <style scoped lang="scss">
@import "../../assets/styles/functions";
.time {
// background: #eee;
margin: 12px 0;
}
.flex-center {
justify-content: center;
align-items: center;
}
.time--item { .time--item {
color: white;
/* background: ''; */ }
.time--item:not(:last-child) {
margin-right: 8px;
} }
.text {} .text {}

View File

@ -0,0 +1,48 @@
<template>
<div class="digit-box" :class="value in '0123456789'.split('') ? 'digit' : 'zhHans'">
{{ value }}
</div>
</template>
<script>
export default {
name: "DigitalBox",
props: {
value: {
type: String,
default: "0",
},
},
data() {
return {};
},
};
</script>
<style scoped lang="scss">
@import "../../assets/styles/functions";
.digit-box {
// height: h(80px);
// width: w(64px);
height: h(80px);
width: w(56px);
color: white;
background: url(../../assets/digit.png) no-repeat;
background-size: 100% 100%;
padding: 2px;
text-align: center;
user-select: none;
}
.digit {
font-family: '站酷庆科黄油体', sans-serif;
font-size: 32px;
line-height: 39px;
}
.zhHans {
font-size: 18px;
line-height: 48px;
}
</style>

View File

@ -15,7 +15,7 @@ export default {
}, },
padding: { padding: {
type: String, type: String,
default: "10px 10px 10px 10px", default: "0",
}, },
backgroundColor: { backgroundColor: {
type: String, type: String,

View File

@ -1,13 +1,21 @@
<template> <template>
<main> <main class="relative">
main content <AreaOne v-if="false" />
<AreaOne />
<!-- <Container :usage="'NumberOrDate'" /> <!-- <Container :usage="'NumberOrDate'" />
<Container :usage="'Table'" /> <Container :usage="'Table'" />
<Container :usage="'Charts'" /> <Container :usage="'Charts'" />
<Container :usage="'NumberAndChart'" /> --> <Container :usage="'NumberAndChart'" /> -->
<div class="absolute left kiln-runtime">
<KilnRuntime /> <KilnRuntime />
</div>
<div class="absolute left kiln-pressure">
<KilnRuntime />
</div>
<div class="absolute left fan-runtime">
<KilnRuntime />
</div>
<div class="right absolute"></div>
</main> </main>
</template> </template>
@ -37,4 +45,17 @@ main {
flex: 1; flex: 1;
// background: #eee2; // background: #eee2;
} }
.kiln-runtime {
top: 0;
}
.kiln-pressure {
top: 300px;
}
.fan-runtime {
top: 600px;
}
</style> </style>

View File

@ -2,7 +2,7 @@
<!-- 带标题的 container --> <!-- 带标题的 container -->
<div class="sub-container" :style="{ padding }"> <div class="sub-container" :style="{ padding }">
<div class="title"> <div class="title">
<span></span> <span class="icon" :class="iconClass[icon]"></span>
<span>{{ title }}</span> <span>{{ title }}</span>
</div> </div>
<div class="content"> <div class="content">
@ -29,18 +29,47 @@ export default {
}, },
}, },
data() { data() {
return {}; return {
}, iconClass: {
created() {}, clock: 'icon-clock'
mounted() {}, }
methods: {}, };
}
}; };
</script> </script>
<style scoped> <style scoped>
.sub-container {} .sub-container {
height: 100%;
display: flex;
flex-direction: column;
}
.icon {
height: 16px;
width: 16px;
margin-right: 8px;
}
.icon-clock {
background: url(../../assets/clock.png);
background-size: 100% 100%;
}
.title { .title {
/* margin: 12px 0; */
margin-bottom: 12px; margin-bottom: 12px;
font-size: 16px;
color: #72f2ff;
font-family: sans-serif;
user-select: none;
display: flex;
align-items: center;
}
.content {
height: 1px;
/* background: #eee; */
flex: 1;
} }
</style> </style>

View File

@ -1,3 +1,11 @@
@font-face {
font-family: "站酷庆科黄油体";
src: url(./assets/fonts/zkqkhy.ttf);
}
* {
box-sizing: border-box;
}
.relative { .relative {
position: relative; position: relative;
@ -7,3 +15,26 @@
position: absolute; position: absolute;
} }
.left {
left: 0;
}
.right {
right: 0;
}
.bottom {
bottom: 0;
}
.top {
top: 0;
}
.flex {
display: flex;
}
.flex-col {
flex-direction: column;
}

View File

@ -1,4 +1,8 @@
const { defineConfig } = require('@vue/cli-service') const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: true transpileDependencies: true,
devServer: {
host: '127.0.0.1',
port: 8000
}
}) })