fix home page

main
chenshuichuan 2 years ago
parent 93ee24b7ce
commit 94a5c1e2cb

@ -12,11 +12,12 @@
<div class="text-20px"> <div class="text-20px">
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }} {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
</div> </div>
<div v-if="weatherData.isEnable" class="mt-10px text-14px text-gray-500"> <div v-if="weatherEnable" class="mt-10px text-14px text-gray-500">
{{ weatherData.city }}白天{{ todayWeather.dayweather }}晚上{{ todayWeather.nightweather }} <span style="color: #2bb673">{{ weatherCity }}</span>: 白天{{ todayWeather.dayweather }}晚上{{ todayWeather.nightweather }}
</div> </div>
<div v-if="weatherData.isEnable" class="mt-10px text-14px text-gray-500"> <div v-if="weatherEnable" class="mt-10px text-14px text-gray-500">
气温{{ todayWeather.daytemp }}°C~{{ todayWeather.nighttemp }}°C {{ todayWeather.daywind }}{{ todayWeather.daypower }} 气温<span style="color: #e1820a">{{ todayWeather.daytemp }}°C~{{ todayWeather.nighttemp }}°C</span>
{{ todayWeather.daywind }}{{ todayWeather.daypower }}
</div> </div>
</div> </div>
</div> </div>
@ -29,7 +30,8 @@
{{ item.date }} {{ item.date }}
</div> </div>
<div class="mt-10px text-14px text-gray-500"> <div class="mt-10px text-14px text-gray-500">
白天{{ item.dayweather }}晚上{{ item.nightweather }}气温{{ item.daytemp }}°C~{{ item.nighttemp }}°C 白天{{ item.dayweather }}晚上{{ item.nightweather }}气温
<span style="color: #e1820a">{{ item.daytemp }}°C~{{ item.nighttemp }}°C</span>
{{ item.daywind }}{{ item.daypower }} {{ item.daywind }}{{ item.daypower }}
</div> </div>
</div> </div>
@ -38,7 +40,6 @@
</el-col> </el-col>
<el-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24"> <el-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
<div> <div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -51,7 +52,7 @@
<el-card shadow="never"> <el-card shadow="never">
<template #header> <template #header>
<div class="h-3 flex justify-between"> <div class="h-3 flex justify-between">
<span>{{ t('workplace.project') }}</span> <span>生产进度</span>
<el-link <el-link
type="primary" type="primary"
:underline="false" :underline="false"
@ -62,31 +63,29 @@
</el-link> </el-link>
</div> </div>
</template> </template>
<el-skeleton :loading="loading" animated> <div>
<el-row> <div class="demo-progress">
<el-col <el-progress :text-inside="true" :stroke-width="26" :percentage="70" />
v-for="(item, index) in projects" <el-progress
:key="`card-${index}`" :text-inside="true"
:xl="8" :stroke-width="24"
:lg="8" :percentage="100"
:md="8" status="success"
:sm="24" />
:xs="24" <el-progress
> :text-inside="true"
<el-card shadow="hover" class="mr-5px mt-5px"> :stroke-width="22"
<div class="flex items-center"> :percentage="80"
<Icon :icon="item.icon" :size="25" class="mr-8px" /> status="warning"
<span class="text-16px">{{ item.name }}</span> />
</div> <el-progress
<div class="mt-12px text-9px text-gray-400">{{ t(item.message) }}</div> :text-inside="true"
<div class="mt-12px flex justify-between text-12px text-gray-400"> :stroke-width="20"
<span>{{ item.personal }}</span> :percentage="50"
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span> status="exception"
</div> />
</el-card> </div>
</el-col> </div>
</el-row>
</el-skeleton>
</el-card> </el-card>
<el-card shadow="never" class="mt-8px"> <el-card shadow="never" class="mt-8px">
@ -190,15 +189,20 @@ let totalSate = reactive<WorkplaceTotal>({
}) })
const weatherList = ref<WeatherVO[]>([]) const weatherList = ref<WeatherVO[]>([])
let weatherData = null let weatherEnable = false
let todayWeather = null let todayWeather = null
let weatherCity = ""
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
// //
weatherData = await HomeApi.getWeatherInfo() const data = await HomeApi.getWeatherInfo()
weatherList.value = weatherData.casts weatherEnable = data.isEnable
if(weatherData.isEnable && weatherList) if(data.isEnable && weatherList){
todayWeather = weatherList.value[0]; weatherList.value = data.casts
todayWeather = weatherList.value[0]
weatherCity = data.city
}
}) })
const getCount = async () => { const getCount = async () => {
@ -393,3 +397,9 @@ const getAllApi = async () => {
getAllApi() getAllApi()
</script> </script>
<style scoped>
.demo-progress .el-progress--line {
margin-bottom: 15px;
max-width: 600px;
}
</style>

@ -0,0 +1,24 @@
<template>
<el-link :type="type" :underline="false" :@click="openUrl(href)" href="#" >
{{ title }}
</el-link>
</template>
<script setup lang="ts">/** 自定义页面跳转 */
import {propTypes} from "@/utils/propTypes";
defineOptions({ name: 'Link' })
const props = defineProps({
type: propTypes.string,
href: propTypes.string,
title: propTypes.string
})
const { t } = useI18n() //
const message = useMessage() //
// const { push } = useRouter()
// /** **/
// const openUrl = (url: number) => {
// push(url)
// }
</script>
Loading…
Cancel
Save