|
|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
|
<el-row :gutter="16" justify="space-between">
|
|
|
|
|
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
|
|
|
|
<el-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
<el-avatar :src="avatar" :size="70" class="mr-16px">
|
|
|
|
|
<img src="@/assets/imgs/avatar.gif" alt="" />
|
|
|
|
|
@ -12,43 +12,33 @@
|
|
|
|
|
<div class="text-20px">
|
|
|
|
|
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt-10px text-14px text-gray-500">
|
|
|
|
|
{{ t('workplace.toady') }},20℃ - 32℃!
|
|
|
|
|
<div v-if="weatherData.isEnable" class="mt-10px text-14px text-gray-500">
|
|
|
|
|
{{ weatherData.city }},白天{{ todayWeather.dayweather }},晚上{{ todayWeather.nightweather }}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="weatherData.isEnable" class="mt-10px text-14px text-gray-500">
|
|
|
|
|
气温{{ todayWeather.daytemp }}°C~{{ todayWeather.nighttemp }}°C ,{{ todayWeather.daywind }}风{{ todayWeather.daypower }}级
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
|
|
|
|
<div class="h-70px flex items-center justify-end lt-sm:mt-10px">
|
|
|
|
|
<div class="px-8px text-right">
|
|
|
|
|
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
|
|
|
|
|
<CountTo
|
|
|
|
|
class="text-20px"
|
|
|
|
|
:start-val="0"
|
|
|
|
|
:end-val="totalSate.project"
|
|
|
|
|
:duration="2600"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-divider direction="vertical" />
|
|
|
|
|
<div class="px-8px text-right">
|
|
|
|
|
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
|
|
|
|
|
<CountTo
|
|
|
|
|
class="text-20px"
|
|
|
|
|
:start-val="0"
|
|
|
|
|
:end-val="totalSate.todo"
|
|
|
|
|
:duration="2600"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
<div class="px-8px text-right">
|
|
|
|
|
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
|
|
|
|
|
<CountTo
|
|
|
|
|
class="text-20px"
|
|
|
|
|
:start-val="0"
|
|
|
|
|
:end-val="totalSate.access"
|
|
|
|
|
:duration="2600"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
<el-col v-for="item in weatherList.slice(1, 4)" :key="item.date" :xl="12" :lg="12" :md="12" :sm="12" :xs="12">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="text-16px">
|
|
|
|
|
{{ item.date }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt-10px text-14px text-gray-500">
|
|
|
|
|
白天{{ item.dayweather }},晚上{{ item.nightweather }},气温{{ item.daytemp }}°C~{{ item.nighttemp }}°C
|
|
|
|
|
,{{ item.daywind }}风{{ item.daypower }}级
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :xl="8" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
@ -180,6 +170,8 @@ import { useUserStore } from '@/store/modules/user'
|
|
|
|
|
import { useWatermark } from '@/hooks/web/useWatermark'
|
|
|
|
|
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
|
|
|
|
|
import { pieOptions, barOptions } from './echarts-data'
|
|
|
|
|
import {HomeApi} from "@/api/home/info";
|
|
|
|
|
import {WeatherVO} from "@/api/home/info";
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'Home' })
|
|
|
|
|
|
|
|
|
|
@ -197,6 +189,18 @@ let totalSate = reactive<WorkplaceTotal>({
|
|
|
|
|
todo: 0
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const weatherList = ref<WeatherVO[]>([])
|
|
|
|
|
let weatherData = null
|
|
|
|
|
let todayWeather = null
|
|
|
|
|
/** 初始化 **/
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
// 加载
|
|
|
|
|
weatherData = await HomeApi.getWeatherInfo()
|
|
|
|
|
weatherList.value = weatherData.casts
|
|
|
|
|
if(weatherData.isEnable && weatherList)
|
|
|
|
|
todayWeather = weatherList.value[0];
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const getCount = async () => {
|
|
|
|
|
const data = {
|
|
|
|
|
project: 40,
|
|
|
|
|
|