首个数据图表

This commit is contained in:
MTrunning
2020-03-17 01:58:10 +08:00
parent 93d7e98cee
commit 8736047933
8 changed files with 650 additions and 2 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

+98
View File
@@ -0,0 +1,98 @@
// 颜色
$colors: (
"primary": #db9e3f,
"info-1": #4394e4,
"info": #4b67af,
"white": #ffffff,
"light": #f9f9f9,
"grey-1": #999999,
"grey": #666666,
"dark-1": #5f5f5f,
"dark": #222222,
"black-1": #171823,
"black": #000000,
);
// 字体大小
$base-font-size: 1rem;
$font-sizes: (
xxs: 0.6154,
//8px
xs: 0.7692,
//10px
sm: 0.9231,
//12px
md: 1 ,
//13px
lg: 1.0769 ,
//14px
xl: 1.2308 ,
//16px
xxl: 1.3846 ,
//18px
xxxl: 1.5385
//20px
);
// 宽高
.w-100 {
width: 100%;
}
.h-100 {
height: 100%;
}
//flex
.d-flex {
display: flex;
}
.flex-column {
flex-direction: column;
}
.flex-wrap {
flex-wrap: wrap;
}
.flex-nowrap {
flex-wrap: nowrap;
}
$flex-jc: (
start: flex-start,
end: flex-end,
center: center,
between: space-between,
around: space-around,
evenly: space-evenly
);
$flex-ai: (
start: flex-start,
end: flex-end,
center: center,
stretch: stretch
);
.flex-1 {
flex: 1;
}
//.mt-1 => margin top
//spacing
$spacing-types: (
m: margin,
p: padding
);
$spacing-directions: (
t: top,
r: right,
b: bottom,
l: left
);
$spacing-base-size: 1rem;
$spacing-sizes: (
0: 0,
1: 0.25,
2: 0.5,
3: 1,
4: 1.5,
5: 3
);
+110
View File
@@ -0,0 +1,110 @@
#index {
* {
color: #D3D6DD;
}
background-color: #000000;
width: 100%;
height: 100vh;
.bg {
padding: 1rem;
background-image: url("../assets/pageBg.png");
}
.title {
position: relative;
width: 500px;
text-align: center;
background-size: cover;
background-repeat: no-repeat;
.title-text {
font-size: 2rem;
position: absolute;
bottom: 0px;
left: 50%;
transform: translate(-50%);
}
.title-bototm {
position: absolute;
bottom: -30px;
left: 50%;
transform: translate(-50%);
}
}
// 平行四边形
.react-left {
cursor: pointer;
font-size: 1.3rem;
width: 300px;
height: 50px;
line-height: 50px;
text-align: center;
transform: skewX(-45deg);
.react-after {
position: absolute;
right: -25px;
top: 0px;
height: 50px;
width: 50px;
background-color: #0f1325;
transform: skewX(45deg);
}
.text {
display: inline-block;
transform: skewX(45deg);
}
}
.react-right {
cursor: pointer;
font-size: 1.3rem;
width: 300px;
height: 50px;
line-height: 50px;
text-align: center;
transform: skewX(45deg);
.react-before {
position: absolute;
left: -25px;
top: 0px;
height: 50px;
width: 50px;
background-color: #0f1325;
transform: skewX(-45deg);
}
.text {
display: inline-block;
transform: skewX(-45deg);
}
}
.body-box {
margin-top: 1rem;
display: flex;
flex-direction: column;
//下方区域的布局
.content-box {
display: grid;
grid-template-columns: 2fr 3fr 5fr 3fr 2fr;
}
// 底部数据
.bototm-box {
margin-top: 1rem;
display: grid;
grid-template-columns: repeat(2, 50%);
}
}
}
+186
View File
@@ -0,0 +1,186 @@
@import "./variables";
// 全局样式
* {
margin: 0;
padding: 0;
list-style-type: none;
box-sizing: border-box;
outline: none;
}
html {
font-size: 13px;
margin: 0;
padding: 0;
}
body {
font-family: Arial, Helvetica, sans-serif;
line-height: 1.2em;
background-color: #f1f1f1;
margin: 0;
padding: 0;
}
a {
color: #343440;
text-decoration: none;
}
.clearfix {
&::after {
content: "";
display: table;
height: 0;
line-height: 0;
visibility: hidden;
clear: both;
}
}
//浮动
.float-r {
float: right;
}
//浮动
.float-l {
float: left;
}
// 字体加粗
.fw-b {
font-weight: bold;
}
//文章一行显示,多余省略号显示
.title-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.bg-color-black {
background-color: #0f1325;
}
.bg-color-blue {
background-color: #1A5CD7;
}
.colorBlack {
color: #272727 !important;
&:hover {
color: #272727 !important;
}
}
.colorText {
color: #D3D6DD !important;
&:hover {
color: #D3D6DD !important;
}
}
.colorBlue {
color: #1A5CD7 !important;
&:hover {
color: #1A5CD7 !important;
}
}
//颜色
@each $colorkey,
$color in $colors {
.text-#{$colorkey} {
color: $color;
}
.bg-#{$colorkey} {
background-color: $color;
}
}
//对齐
@each $var in (left, center, right) {
.text-#{$var} {
text-align: $var !important;
}
}
//flex
@each $key,
$value in $flex-jc {
.jc-#{$key} {
justify-content: $value;
}
}
@each $key,
$value in $flex-ai {
.ai-#{$key} {
align-items: $value;
}
}
//字体
@each $fontkey,
$fontvalue in $font-sizes {
.fs-#{$fontkey} {
font-size: $fontvalue * $base-font-size;
}
}
//.mt-1 => margin top
//spacing
@each $typekey,
$type in $spacing-types {
//.m-1
@each $sizekey,
$size in $spacing-sizes {
.#{$typekey}-#{$sizekey} {
#{$type}: $size * $spacing-base-size;
}
}
//.mx-1
@each $sizekey,
$size in $spacing-sizes {
.#{$typekey}x-#{$sizekey} {
#{$type}-left: $size * $spacing-base-size;
#{$type}-right: $size * $spacing-base-size;
}
.#{$typekey}y-#{$sizekey} {
#{$type}-top: $size * $spacing-base-size;
#{$type}-bottom: $size * $spacing-base-size;
}
}
//.mt-1
@each $directionkey,
$direction in $spacing-directions {
@each $sizekey,
$size in $spacing-sizes {
.#{$typekey}#{$directionkey}-#{$sizekey} {
#{$type}-#{$direction}: $size * $spacing-base-size;
}
}
}
.#{$typekey} {
#{$type}: 0;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

+8
View File
@@ -5,6 +5,14 @@ import store from './store'
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)
// 引入vue-awesome
import Icon from 'vue-awesome/components/Icon'
import 'vue-awesome/icons/index.js'
// 全局注册
Vue.component('icon', Icon)
import './assets/scss/style.scss'
Vue.config.productionTip = false
new Vue({
+156
View File
@@ -0,0 +1,156 @@
<template>
<div id="centreLeft1" class="bg-color-black">
<div class="d-flex">
<span style="color:#5cd9e8">
<icon name="chart-bar"></icon>
</span>
<div class="d-flex">
<span class="fs-xl text mx-2">构建通过率</span>
<dv-decoration-3 style="width:100px;height:20px; position:relative;top:-3px;" />
</div>
</div>
<div class="d-flex jc-center">
<dv-active-ring-chart class="chart-box" :config="config" />
</div>
<!-- 4个主要的数据 -->
<div class="bottom-data">
<div class="item-box" v-for="(item,index) in numberData" :key="index">
<div class="d-flex">
<span class="coin">¥</span>
<dv-digital-flop :config="item.number" style="width:200px;height:50px;" />
</div>
<p class="text" style="text-align: center;">
{{item.text}}
<span class="colorYellow">(件)</span>
</p>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
config: {
lineWidth: 30,
activeRadius: "80%",
radius: "75%",
activeTimeGap: 2000,
data: [
{
name: "周口",
value: 55
},
{
name: "南阳",
value: 120
},
{
name: "西峡",
value: 78
},
{
name: "驻马店",
value: 66
},
{
name: "新乡",
value: 80
}
]
},
numberData: [
{
number: {
number: [15],
toFixed: 1,
content: "{nt}"
},
text: "今日构建总量"
},
{
number: {
number: [1144],
toFixed: 1,
content: "{nt}"
},
text: "总共完成数量"
},
{
number: {
number: [361],
toFixed: 1,
content: "{nt}"
},
text: "正在编译数量"
},
{
number: {
number: [157],
toFixed: 1,
content: "{nt}"
},
text: "未通过数量"
}
]
};
},
mounted() {
this.changeTiming();
},
methods: {
changeTiming() {
setInterval(() => {
this.changeNumber();
}, 3000);
},
changeNumber() {
this.numberData.forEach(item => {
item.number.number[0] += 1;
item.number = { ...item.number };
});
}
}
};
</script>
<style lang="scss">
#centreLeft1 {
padding: 1rem;
height: 400px;
min-width: 300px;
border-radius: 5px;
.text {
color: #c3cbde;
}
.chart-box {
margin-top: 1rem;
width: 170px;
height: 170px;
.active-ring-name {
padding-top: 10px;
}
}
.bottom-data {
.item-box {
float: right;
position: relative;
width: 50%;
color: #d3d6dd;
// 金币
.coin {
position: absolute;
left: 0px;
top: 17px;
font-size: 2rem;
color: #ffc107;
}
.colorYellow {
color: yellowgreen;
}
}
}
}
</style>
+92 -2
View File
@@ -1,10 +1,100 @@
<template>
<div>主页</div>
<div id="index">
<dv-full-screen-container class="bg">
<dv-loading v-if="loading">Loading...</dv-loading>
<div class="host-body">
<div class="d-flex jc-center">
<dv-decoration-10 style="width:33.3%;height:5px;" />
<div class="d-flex jc-center">
<dv-decoration-8 :color="['#568aea', '#000000']" style="width:200px;height:50px;" />
<div class="title">
<span class="title-text">SKCI数据可视化平台</span>
<dv-decoration-6
class="title-bototm"
:reverse="true"
:color="['#50e3c2', '#67a1e5']"
style="width:250px;height:8px;"
/>
</div>
<dv-decoration-8
:reverse="true"
:color="['#568aea', '#000000']"
style="width:200px;height:50px;"
/>
</div>
<dv-decoration-10 style="width:33.3%;height:5px;" />
</div>
<!-- 第二行 -->
<div class="d-flex jc-between mt-2 px-2">
<div class="d-flex" style="width: 40%">
<div class="react-right bg-color-black ml-4" style="width: 500px; ">
<span class="react-before"></span>
<span class="text">构建数据分析</span>
</div>
<div class="react-right bg-color-black ml-3">
<span class="text colorBlue">构建数据分析</span>
</div>
</div>
<div style="width: 40%" class="d-flex">
<div class="react-left bg-color-black bg-color-blue mr-3">
<span class="text fw-b">构建数据分析</span>
</div>
<div class="react-left bg-color-black mr-4" style="width: 500px;">
<span class="react-after"></span>
<span class="text colorBlue">2020年03月16日</span>
</div>
</div>
</div>
<div class="body-box">
<!-- 第三行数据 -->
<div class="content-box">
<div>
<dv-border-box-12>
<centreLeft1 />
</dv-border-box-12>
</div>
<div></div>
<div class="bg-color-blue"></div>
<div></div>
<div class="bg-color-blue"></div>
<div></div>
</div>
<!-- 第四行数据 -->
<div class="bototm-box">
<div></div>
<div></div>
</div>
</div>
</div>
</dv-full-screen-container>
</div>
</template>
<script>
export default {};
import centreLeft1 from "./centreLeft1";
export default {
data() {
return {
loading: false
};
},
components: { centreLeft1 },
mounted() {
this.cancelLoading();
},
methods: {
cancelLoading() {
setTimeout(() => {
this.loading = false;
}, 2000);
}
}
};
</script>
<style lang="scss" scoped>
@import "../assets/scss/index.scss";
</style>