|
@@ -12,15 +12,15 @@
|
|
|
:src="userStore.user.avatar + '?imageView2/1/w/80/h/80'"
|
|
|
/>
|
|
|
<div>
|
|
|
- <p>{{ greetings }}</p>
|
|
|
+ <p>欢迎您!</p>
|
|
|
<p class="text-sm text-gray">
|
|
|
- 今日天气晴朗,气温在15℃至25℃之间,东南风。
|
|
|
+ {{ greetings }}
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="6" :xs="24">
|
|
|
+<!-- <el-col :span="6" :xs="24">
|
|
|
<div class="flex h-full items-center justify-around">
|
|
|
<el-statistic :value="99">
|
|
|
<template #title>
|
|
@@ -50,7 +50,7 @@
|
|
|
</template>
|
|
|
</el-statistic>
|
|
|
</div>
|
|
|
- </el-col>
|
|
|
+ </el-col>-->
|
|
|
</el-row>
|
|
|
</el-card>
|
|
|
|
|
@@ -58,25 +58,15 @@
|
|
|
<el-row :gutter="10" class="mt-3">
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-card shadow="never">
|
|
|
- <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <span class="text-[var(--el-text-color-secondary)]">订单数</span>
|
|
|
<div class="flex items-center justify-between">
|
|
|
- <span class="text-[var(--el-text-color-secondary)]">访客数</span>
|
|
|
- <el-tag type="success">日</el-tag>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <div class="flex items-center justify-between mt-5">
|
|
|
- <div class="text-lg text-right">
|
|
|
- {{ Math.round(visitCountOutput) }}
|
|
|
+ <el-tag type="success">
|
|
|
+ <div class="text-lg text-right">
|
|
|
+ {{ Math.round(orderNumOutput) }}
|
|
|
+ </div>
|
|
|
+ </el-tag>
|
|
|
</div>
|
|
|
- <svg-icon icon-class="visit" size="2em" />
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="flex items-center justify-between mt-5 text-sm text-[var(--el-text-color-secondary)]"
|
|
|
- >
|
|
|
- <span> 总访客数 </span>
|
|
|
- <span> {{ Math.round(visitCountOutput * 15) }} </span>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -84,25 +74,15 @@
|
|
|
<!--消息数-->
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-card shadow="never">
|
|
|
- <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <span class="text-[var(--el-text-color-secondary)]">工单数</span>
|
|
|
<div class="flex items-center justify-between">
|
|
|
- <span class="text-[var(--el-text-color-secondary)]">IP数</span>
|
|
|
- <el-tag type="success">日</el-tag>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <div class="flex items-center justify-between mt-5">
|
|
|
- <div class="text-lg text-right">
|
|
|
- {{ Math.round(dauCountOutput) }}
|
|
|
+ <el-tag type="success">
|
|
|
+ <div class="text-lg text-right">
|
|
|
+ {{ Math.round(workOrderCountOutput) }}
|
|
|
+ </div>
|
|
|
+ </el-tag>
|
|
|
</div>
|
|
|
- <svg-icon icon-class="ip" size="2em" />
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="flex items-center justify-between mt-5 text-sm text-[var(--el-text-color-secondary)]"
|
|
|
- >
|
|
|
- <span> 总IP数 </span>
|
|
|
- <span> {{ Math.round(dauCountOutput) }} </span>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -110,25 +90,15 @@
|
|
|
<!--销售额-->
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-card shadow="never">
|
|
|
- <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <span class="text-[var(--el-text-color-secondary)]">物料数</span>
|
|
|
<div class="flex items-center justify-between">
|
|
|
- <span class="text-[var(--el-text-color-secondary)]">产品数</span>
|
|
|
- <el-tag>月</el-tag>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <div class="flex items-center justify-between mt-5">
|
|
|
- <div class="text-lg text-right">
|
|
|
- {{ Math.round(amountOutput) }}
|
|
|
+ <el-tag type="success">
|
|
|
+ <div class="text-lg text-right">
|
|
|
+ {{ Math.round(materialCountOutput) }}
|
|
|
+ </div>
|
|
|
+ </el-tag>
|
|
|
</div>
|
|
|
- <svg-icon icon-class="money" size="2em" />
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="flex items-center justify-between mt-5 text-sm text-[var(--el-text-color-secondary)]"
|
|
|
- >
|
|
|
- <span> 总产品数 </span>
|
|
|
- <span> {{ Math.round(amountOutput * 15) }} </span>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -136,25 +106,15 @@
|
|
|
<!--订单量-->
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-card shadow="never">
|
|
|
- <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <span class="text-[var(--el-text-color-secondary)]">设备数</span>
|
|
|
<div class="flex items-center justify-between">
|
|
|
- <span class="text-[var(--el-text-color-secondary)]">订单量</span>
|
|
|
- <el-tag type="danger">季</el-tag>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <div class="flex items-center justify-between mt-5">
|
|
|
- <div class="text-lg text-right">
|
|
|
- {{ Math.round(orderCountOutput) }}
|
|
|
+ <el-tag type="success">
|
|
|
+ <div class="text-lg text-right">
|
|
|
+ {{ Math.round(deviceCountOutput) }}
|
|
|
+ </div>
|
|
|
+ </el-tag>
|
|
|
</div>
|
|
|
- <svg-icon icon-class="order" size="2em" />
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="flex items-center justify-between mt-5 text-sm text-[var(--el-text-color-secondary)]"
|
|
|
- >
|
|
|
- <span> 总订单量 </span>
|
|
|
- <span> {{ Math.round(orderCountOutput * 15) }} </span>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -162,42 +122,46 @@
|
|
|
|
|
|
<!-- Echarts 图表 -->
|
|
|
<el-row :gutter="10" class="mt-3">
|
|
|
- <el-col :sm="24" :lg="8" class="mb-2">
|
|
|
+ <el-col :sm="24" :lg="24" class="mb-2">
|
|
|
<BarChart
|
|
|
id="barChart"
|
|
|
height="400px"
|
|
|
width="100%"
|
|
|
class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ :indexSum="indexSum"
|
|
|
/>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" class="mb-2">
|
|
|
+<!-- <el-col :xs="24" :sm="12" :lg="12" class="mb-2">
|
|
|
<PieChart
|
|
|
id="pieChart"
|
|
|
height="400px"
|
|
|
width="100%"
|
|
|
- class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ class="bg-[var(--el-bg-color-overlay)]"
|
|
|
/>
|
|
|
- </el-col>
|
|
|
+ </el-col>-->
|
|
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" class="mb-2">
|
|
|
+<!-- <el-col :xs="24" :sm="12" :lg="8" class="mb-2">
|
|
|
<RadarChart
|
|
|
id="radarChart"
|
|
|
height="400px"
|
|
|
width="100%"
|
|
|
- class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ class="bg-[var(--el-bg-color-overlay)]"
|
|
|
/>
|
|
|
- </el-col>
|
|
|
+ </el-col>-->
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import * as echarts from "echarts";
|
|
|
+
|
|
|
defineOptions({
|
|
|
name: "Dashboard",
|
|
|
inheritAttrs: false,
|
|
|
});
|
|
|
|
|
|
+import {queryIndex} from "@/api/process"
|
|
|
import { useUserStore } from "@/store/modules/user";
|
|
|
import { useTransition, TransitionPresets } from "@vueuse/core";
|
|
|
|
|
@@ -209,49 +173,56 @@ const greetings = computed?.(() => {
|
|
|
if (hours >= 6 && hours < 8) {
|
|
|
return "晨起披衣出草堂,轩窗已自喜微凉🌅!";
|
|
|
} else if (hours >= 8 && hours < 12) {
|
|
|
- return "上午好!";
|
|
|
+ return "上午的阳光,如细丝般穿透云层,轻轻拂过沉睡的大地,唤醒万物生机。";
|
|
|
} else if (hours >= 12 && hours < 18) {
|
|
|
- return "下午好!";
|
|
|
+ return "当下午的阳光悄悄的倾斜,天空被渲染上了一层淡金的色彩,这时的世界是如此的宁静与和谐,让人心生向往。";
|
|
|
} else if (hours >= 18 && hours < 24) {
|
|
|
- return "晚上好!";
|
|
|
+ return "夜晚的美丽如同黑色的丝绸,神秘而深邃,繁星如明珠般镶嵌在天空,月光如同一把柔和的画笔,描绘出了一幅宁静致远的画卷。";
|
|
|
} else if (hours >= 0 && hours < 6) {
|
|
|
return "偷偷向银河要了一把碎星,只等你闭上眼睛撒入你的梦中,晚安🌛!";
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+const indexSum = ref(null)
|
|
|
const duration = 5000;
|
|
|
|
|
|
// 销售额
|
|
|
-const amount = ref(0);
|
|
|
-const amountOutput = useTransition(amount, {
|
|
|
+const orderCount = ref(0);
|
|
|
+const orderNumOutput = useTransition(orderCount, {
|
|
|
duration: duration,
|
|
|
transition: TransitionPresets.easeOutExpo,
|
|
|
});
|
|
|
-amount.value = 2000;
|
|
|
|
|
|
// 访客数
|
|
|
-const visitCount = ref(0);
|
|
|
-const visitCountOutput = useTransition(visitCount, {
|
|
|
+const workOrderCount = ref(0);
|
|
|
+const workOrderCountOutput = useTransition(workOrderCount, {
|
|
|
duration: duration,
|
|
|
transition: TransitionPresets.easeOutExpo,
|
|
|
});
|
|
|
-visitCount.value = 2000;
|
|
|
|
|
|
// IP数
|
|
|
-const dauCount = ref(0);
|
|
|
-const dauCountOutput = useTransition(dauCount, {
|
|
|
+const materialCount = ref(0);
|
|
|
+const materialCountOutput = useTransition(materialCount, {
|
|
|
duration: duration,
|
|
|
transition: TransitionPresets.easeOutExpo,
|
|
|
});
|
|
|
-dauCount.value = 2000;
|
|
|
|
|
|
// 订单量
|
|
|
-const orderCount = ref(0);
|
|
|
-const orderCountOutput = useTransition(orderCount, {
|
|
|
+const deviceCount = ref(0);
|
|
|
+const deviceCountOutput = useTransition(deviceCount, {
|
|
|
duration: duration,
|
|
|
transition: TransitionPresets.easeOutExpo,
|
|
|
});
|
|
|
-orderCount.value = 2000;
|
|
|
+onMounted(() => {
|
|
|
+ queryIndex().then((res)=>{
|
|
|
+ deviceCount.value = res.data.deviceNum
|
|
|
+ orderCount.value = res.data.orderNum
|
|
|
+ workOrderCount.value = res.data.workOrderNum
|
|
|
+ materialCount.value = res.data.materialNum
|
|
|
+ indexSum.value = res.data
|
|
|
+ });
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|