2023-03-08 00:56:38 +08:00
|
|
|
<!--
|
|
|
|
* @Author: Kane
|
|
|
|
* @Date: 2023-03-07 23:22:13
|
|
|
|
* @LastEditors: Kane
|
|
|
|
* @FilePath: /task_schedule/src/components/ArchievementCompleteRateComponent.vue
|
|
|
|
* @Description: 业绩完成率组件
|
2023-03-17 18:53:13 +08:00
|
|
|
*
|
|
|
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
2023-03-08 00:56:38 +08:00
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<div class="complete-rate-wrapper">
|
2023-03-17 14:40:04 +08:00
|
|
|
<el-progress
|
|
|
|
type="circle"
|
|
|
|
:percentage="ui.percentage"
|
|
|
|
>
|
|
|
|
<template #default>
|
2023-03-08 10:29:35 +08:00
|
|
|
<span class="percentage-label">{{ ui.indicator }}</span>
|
2023-03-08 00:56:38 +08:00
|
|
|
<span class="percentage-value">{{ percentage }}%</span>
|
|
|
|
</template>
|
|
|
|
</el-progress>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2023-03-08 10:29:35 +08:00
|
|
|
import { reactive } from "vue";
|
2023-03-08 00:56:38 +08:00
|
|
|
export default {
|
|
|
|
name: "ArchievementCompleteRateComponent",
|
2023-03-08 10:29:35 +08:00
|
|
|
props: {
|
|
|
|
percentage: {
|
|
|
|
type: String,
|
|
|
|
require: true,
|
2023-03-17 18:53:13 +08:00
|
|
|
default: () => "0",
|
2023-03-08 10:29:35 +08:00
|
|
|
},
|
|
|
|
indicator: {
|
|
|
|
type: String,
|
|
|
|
default: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props)
|
2023-03-08 00:56:38 +08:00
|
|
|
{
|
2023-03-08 10:29:35 +08:00
|
|
|
const percentage = Number(props.percentage).valueOf();
|
2023-03-08 00:56:38 +08:00
|
|
|
|
2023-03-08 10:29:35 +08:00
|
|
|
const ui = reactive({
|
2023-03-17 18:53:13 +08:00
|
|
|
percentage,
|
2023-03-08 10:29:35 +08:00
|
|
|
indicator: props.indicator,
|
2023-03-08 00:56:38 +08:00
|
|
|
});
|
|
|
|
|
2023-03-08 10:29:35 +08:00
|
|
|
return { ui, };
|
2023-03-08 00:56:38 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.complete-rate-wrapper {
|
2023-03-08 10:29:35 +08:00
|
|
|
// display: flex;
|
|
|
|
// flex-direction: column;
|
|
|
|
// justify-content: center;
|
|
|
|
// align-items: center;
|
2023-03-08 00:56:38 +08:00
|
|
|
|
|
|
|
span {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
2023-03-08 10:29:35 +08:00
|
|
|
.el-progress {
|
2023-03-08 13:24:12 +08:00
|
|
|
margin: 5px;
|
2023-03-08 10:29:35 +08:00
|
|
|
}
|
|
|
|
|
2023-03-08 00:56:38 +08:00
|
|
|
.percentage-value {
|
|
|
|
display: block;
|
|
|
|
margin-top: 10px;
|
|
|
|
font-size: 28px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.percentage-label {
|
|
|
|
display: block;
|
|
|
|
margin-top: 10px;
|
|
|
|
font-size: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-17 18:53:13 +08:00
|
|
|
</style>
|