bt-xtgxq-population-bigdata/src/components/process/Process.vue

102 lines
2.5 KiB
Vue
Raw Normal View History

2023-11-19 17:34:02 +08:00
<template>
<div class="container">
2023-11-20 17:56:43 +08:00
<div class="left">
<img :src="iconSrc"/>
2023-11-19 17:34:02 +08:00
</div>
<div class="right">
<div class="top">
<div class="title">{{ props.title }}</div>
<div class="sub-title">{{ props.value }}</div>
</div>
<div class="bottom">
<div class="process">
2023-11-20 17:56:43 +08:00
<div class="value" :style="{width: (props.process * 200) + 'px'}"></div>
2023-11-19 17:34:02 +08:00
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, defineProps } from 'vue';
const props = defineProps({
2023-11-20 17:56:43 +08:00
iconType: {
type: Number,
default: 1
2023-11-19 17:34:02 +08:00
},
color: {
type: String,
default: 'rgba(0, 0, 255)'
},
bgColor: {
type: String,
default: 'rgba(0, 0, 255, 0.3)'
},
title: {
type: String,
default: '标题'
},
value: {
type: String,
default: '0'
},
process: {
type: Number,
2023-11-20 17:56:43 +08:00
default: 0
2023-11-19 17:34:02 +08:00
}
});
const color = ref(props.color)
const bgColor = ref(props.bgColor)
2023-11-20 17:56:43 +08:00
const iconSrc = ref('assets/imgs/icon/shbz1.png');
if(props.iconType === 2) {
iconSrc.value = 'assets/imgs/icon/shbz2.png';
} else if(props.iconType === 3) {
iconSrc.value = 'assets/imgs/icon/shbz3.png';
} else if(props.iconType === 4) {
iconSrc.value = 'assets/imgs/icon/shbz4.png';
}
2023-11-19 17:34:02 +08:00
</script>
<style lang="stylus" scoped>
.container
display flex
.left
2023-11-20 17:56:43 +08:00
margin-top 5px
2023-11-19 17:34:02 +08:00
margin-right 10px
img
2023-11-20 17:56:43 +08:00
width 30px
height 30px
2023-11-19 17:34:02 +08:00
.right
display flex
flex-direction column
.top
display flex
justify-content space-between
align-items center
2023-11-20 17:56:43 +08:00
height 18px
2023-11-19 17:34:02 +08:00
margin 5px 0
.title
2023-11-20 17:56:43 +08:00
font-size 14px
2023-11-19 17:34:02 +08:00
.sub-title
font-size 12px
color v-bind(color)
.bottom
2023-11-20 17:56:43 +08:00
width 200px
2023-11-19 17:34:02 +08:00
.process
background-color v-bind(bgColor)
width 100%
2023-11-20 17:56:43 +08:00
height 6px
2023-11-19 17:34:02 +08:00
position relative
.value
background linear-gradient(90deg, v-bind(color), #FFF)
box-shadow 0 0 3px rgba(0, 0, 0, 0.3)
position absolute
top 0
left 0
width 120px
2023-11-20 17:56:43 +08:00
height 6px
2023-11-19 17:34:02 +08:00
border-radius 0 5px 5px 0
</style>