|
@@ -0,0 +1,148 @@
|
|
|
+<template>
|
|
|
+ <div class="dashboard-container">
|
|
|
+ <!-- 数据卡片 -->
|
|
|
+ <el-row :gutter="10" class="mt-3">
|
|
|
+ <el-col :xs="24" :sm="12" :lg="12">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <span class="text-[var(--el-text-color-secondary)]">总订单数</span>
|
|
|
+ <el-tag type="success">{{ amount1 }}</el-tag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="flex items-center justify-between mt-5 text-sm text-[var(--el-text-color-secondary)]"
|
|
|
+ >
|
|
|
+ <span> 超期订单 </span>
|
|
|
+ <el-tag type="error">{{outAmount1}}</el-tag>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <!--消息数-->
|
|
|
+ <el-col :xs="24" :sm="12" :lg="12">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <span class="text-[var(--el-text-color-secondary)]">总工单数</span>
|
|
|
+ <el-tag type="success">{{amount2}}</el-tag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="flex items-center justify-between mt-5 text-sm text-[var(--el-text-color-secondary)]"
|
|
|
+ >
|
|
|
+ <span> 超期工单 </span>
|
|
|
+ <el-tag type="error">{{outAmount2}}</el-tag>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- Echarts 图表 -->
|
|
|
+ <el-row :gutter="10" class="mt-3">
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" class="mb-2">
|
|
|
+ <PieChart1
|
|
|
+ id="pieChart1"
|
|
|
+ height="400px"
|
|
|
+ width="100%"
|
|
|
+ class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ :list="list1"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" class="mb-2">
|
|
|
+ <PieChart2
|
|
|
+ id="pieChart2"
|
|
|
+ height="400px"
|
|
|
+ width="100%"
|
|
|
+ class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ :list="list2"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" class="mb-2">
|
|
|
+ <PieChart3
|
|
|
+ id="pieChart3"
|
|
|
+ height="400px"
|
|
|
+ width="100%"
|
|
|
+ class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ :list="list3"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+defineOptions({
|
|
|
+ name: "Dashboard",
|
|
|
+ inheritAttrs: false,
|
|
|
+});
|
|
|
+import { useUserStore } from "@/store/modules/user";
|
|
|
+import {outTimeInfo} from "@/api/report"
|
|
|
+const userStore = useUserStore();
|
|
|
+const date: Date = new Date();
|
|
|
+
|
|
|
+const duration = 5000;
|
|
|
+
|
|
|
+const list1 = ref([])
|
|
|
+const list2 = ref([])
|
|
|
+const list3 = ref([])
|
|
|
+// 销售额
|
|
|
+const amount1 = ref(0);
|
|
|
+const amount2 = ref(0);
|
|
|
+
|
|
|
+
|
|
|
+const outAmount1 = ref(0);
|
|
|
+const outAmount2 = ref(0);
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ outTimeInfo("").then((res)=>{
|
|
|
+ amount1.value = res.data.orderNum;
|
|
|
+ amount2.value = res.data.workOrderNum;
|
|
|
+ outAmount1.value = res.data.outOrder;
|
|
|
+ outAmount2.value = res.data.outWorkOrder;
|
|
|
+ list1.value = res.data.orderRate;
|
|
|
+ list2.value = res.data.workOrderRate;
|
|
|
+ list3.value = res.data.reasons;
|
|
|
+ });
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.dashboard-container {
|
|
|
+ position: relative;
|
|
|
+ padding: 24px;
|
|
|
+
|
|
|
+ .user-avatar {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .github-corner {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ z-index: 1;
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .data-box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 20px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: var(--el-text-color-regular);
|
|
|
+ background: var(--el-bg-color-overlay);
|
|
|
+ border-color: var(--el-border-color);
|
|
|
+ box-shadow: var(--el-box-shadow-dark);
|
|
|
+ }
|
|
|
+
|
|
|
+ .svg-icon {
|
|
|
+ fill: currentcolor !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|