项目新需求修改

This commit is contained in:
wcq 2023-08-21 17:05:05 +08:00
parent 97a4d6efc2
commit 3165ac0763
3 changed files with 116 additions and 6 deletions

View File

@ -1,11 +1,11 @@
const { VITE_HIDE_HOME } = import.meta.env;
const {VITE_HIDE_HOME} = import.meta.env;
const Layout = () => import("@/layout/index.vue");
export default {
path: "/",
name: "Home",
component: Layout,
redirect: "/welcome",
redirect: "/dashboard",
meta: {
icon: "homeFilled",
title: "首页",
@ -13,13 +13,22 @@ export default {
},
children: [
{
path: "/welcome",
name: "Welcome",
component: () => import("@/views/welcome/index.vue"),
path: "/dashboard",
name: "dashboard",
component: () => import("@/views/dashboard/dashboard.vue"),
meta: {
title: "首页",
showLink: VITE_HIDE_HOME === "true" ? false : true
}
}
},
// {
// path: "/welcome",
// name: "Welcome",
// component: () => import("@/views/welcome/index.vue"),
// meta: {
// title: "首页",
// showLink: VITE_HIDE_HOME === "true" ? false : true
// }
// }
]
} as RouteConfigsTable;

View File

@ -0,0 +1,11 @@
<script setup lang="ts">
</script>
<template>
</template>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,90 @@
<template>
<div class="grid grid-cols-4 items-center gap-4">
<el-card v-for="(item,key) in dashboardData"
v-if="['七日评级申请趋势数据','已披露企业评级等级扇形数据'].indexOf(key)==-1" class="num-data-item"
:style="{color:itemColorConfig[key]}">
<div>
<div class="num-data-item__num">{{ item }}</div>
<div class="num-data-item__title">{{ key }}</div>
</div>
</el-card>
</div>
</template>
<script setup lang="ts">
import {api} from "@/api/api";
import {ElMessage} from "element-plus";
import {onMounted, ref} from "vue";
defineOptions({
name: "dashboard"
})
type RateLevel = "AAA" | "AA" | "A" | "B" | "c"
interface DashboardData {
企业总数: number,
昨日新增: number,
待处理申请: number,
申请企业数: number,
待评级企业: number,
总申请数: number,
待披露企业: number,
披露企业数: number,
七日评级申请趋势数据: [Date, number][],
已披露企业评级等级扇形数据: [RateLevel, number][]
}
const itemColorConfig = {
企业总数: "rgb(218,30,255)",
昨日新增: "rgb(255,245,51)",
待处理申请: "rgb(190,255,64)",
申请企业数: "rgb(168,86,255)",
待评级企业: "rgb(255,60,221)",
总申请数: "rgb(107,255,201)",
待披露企业: "rgb(246,203,255)",
披露企业数: "rgb(130,170,255)",
}
const dashboardData = ref<DashboardData>({
七日评级申请趋势数据: [],
企业总数: 0,
已披露企业评级等级扇形数据: [],
待处理申请: 0,
待披露企业: 0,
待评级企业: 0,
总申请数: 0,
披露企业数: 0,
昨日新增: 0,
申请企业数: 0
})
const getData = () => {
api.post<any, { data: DashboardData }>('/wd-smebiz/smebiz_rate/company_rate/get_dashboard_data', {}).then(res => {
dashboardData.value = res.data
}).catch(e => {
ElMessage.warning(e.response?.data?.detail || e.response?.statusText)
})
}
onMounted(() => getData())
</script>
<style scoped lang="scss">
.num-data-item {
border: 2px solid #77777780;
border-radius: 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 9rem;
max-height: 9rem;
font-size: 1.25rem;
}
.num-data-item__num {
//font-family: Din pro,Din alternate;
text-align: center;
font-size: 2rem;
font-style: normal;
font-weight: 600;
}
</style>