修改
This commit is contained in:
@@ -1,20 +1,38 @@
|
||||
<!--
|
||||
filename: StdRateItem.vue
|
||||
author: liubin
|
||||
date: 2024-04-29 08:59:33
|
||||
description:
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-07 10:25:10
|
||||
* @LastEditTime: 2024-05-08 14:54:24
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="std-rate-item">
|
||||
<div v-if="period == '日'" class="std-rate-item">
|
||||
<CityName :value="city.name" />
|
||||
<div class="std-rate-item__value">
|
||||
<ProgressBar title="24年目标" :total="city.target" :value="city.target" />
|
||||
<ProgressBar
|
||||
title="24年累计"
|
||||
:total="city.target"
|
||||
:value="city.thisYear"
|
||||
/>
|
||||
<ProgressBar :title="title" :total="city.target" :value="city.target" />
|
||||
<!-- <ProgressBar title="24年累计" :total="city.target" :value="city.thisYear" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="period == '周'" class="std-rate-item">
|
||||
<CityName :value="city.name" />
|
||||
<div class="std-rate-item__value">
|
||||
<ProgressBar :title="title" :total="city.target" :value="city.target" />
|
||||
<!-- <ProgressBar title="24年累计" :total="city.target" :value="city.thisYear" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="period == '月'" class="std-rate-item">
|
||||
<CityName :value="city.name" />
|
||||
<div class="std-rate-item__value">
|
||||
<ProgressBar :title="titleEnd" :total="city.target" :value="city.target" />
|
||||
<ProgressBar :title="title" :total="city.target" :value="city.thisYear" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else="period == '年'" class="std-rate-item">
|
||||
<CityName :value="city.name" />
|
||||
<div class="std-rate-item__value">
|
||||
<ProgressBar :title="titleEnd" :total="city.target" :value="city.target" />
|
||||
<ProgressBar :title="title" :total="city.target" :value="city.thisYear" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -31,9 +49,55 @@ export default {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
period: {
|
||||
type: String,
|
||||
default: "日",
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
showDay:true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
switch (this.period) {
|
||||
case "日":
|
||||
return "今日"
|
||||
case "周":
|
||||
return "本周"
|
||||
case "月":
|
||||
const year = new Date().getFullYear();
|
||||
const month = new Date().getMonth() + 1;
|
||||
return `${year - 1}年${month}月累计`
|
||||
case "年": {
|
||||
const year = new Date().getFullYear();
|
||||
// return [
|
||||
return `${year - 1}年累计`
|
||||
// ];
|
||||
}
|
||||
default:
|
||||
return "今日"
|
||||
}
|
||||
},
|
||||
titleEnd() {
|
||||
switch (this.period) {
|
||||
// case "日":
|
||||
// return "今日"
|
||||
// case "周":
|
||||
// return "本周"
|
||||
case "月":
|
||||
const year = new Date().getFullYear();
|
||||
const month = new Date().getMonth() + 1;
|
||||
return `${year}年${month}月目标`
|
||||
case "年": {
|
||||
const year = new Date().getFullYear();
|
||||
// return [
|
||||
return `${year}年目标`
|
||||
// ];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user