style(api): 统一代码格式化规范
- 调整 import 语句格式,统一空格和引号风格 - 修复函数参数跨行时的格式对齐问题 - 清理多余空行和注释中的空白字符 - 统一对象属性结尾逗号的使用规范 - 规范化字符串拼接和模板语法的格式 - 优化长参数列表的换行和缩进格式
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
:value-style="{ color: '#3f8600' }"
|
||||
>
|
||||
<template #prefix>
|
||||
<UserOutlined/>
|
||||
<UserOutlined />
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-card>
|
||||
@@ -24,7 +24,7 @@
|
||||
:value-style="{ color: '#1890ff' }"
|
||||
>
|
||||
<template #prefix>
|
||||
<AccountBookOutlined/>
|
||||
<AccountBookOutlined />
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-card>
|
||||
@@ -38,7 +38,7 @@
|
||||
:value-style="{ color: '#cf1322' }"
|
||||
>
|
||||
<template #prefix>
|
||||
<MoneyCollectOutlined/>
|
||||
<MoneyCollectOutlined />
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-card>
|
||||
@@ -53,7 +53,7 @@
|
||||
:value-style="{ color: '#722ed1' }"
|
||||
>
|
||||
<template #prefix>
|
||||
<ClockCircleOutlined/>
|
||||
<ClockCircleOutlined />
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-card>
|
||||
@@ -63,101 +63,105 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, onMounted} from 'vue';
|
||||
import {
|
||||
UserOutlined,
|
||||
CalendarOutlined,
|
||||
QrcodeOutlined,
|
||||
ShopOutlined,
|
||||
ClockCircleOutlined,
|
||||
SettingOutlined,
|
||||
AccountBookOutlined,
|
||||
FileTextOutlined,
|
||||
MoneyCollectOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import {getSiteInfo} from "@/api/layout";
|
||||
import {CmsWebsite} from "@/api/cms/cmsWebsite/model";
|
||||
import {pageUsers} from "@/api/system/user";
|
||||
import {pageShopOrder} from "@/api/shop/shopOrder";
|
||||
import {getPageTitle, openNew} from "@/utils/common";
|
||||
import {listCmsStatistics} from "@/api/cms/cmsStatistics";
|
||||
import { ref, onMounted } from 'vue';
|
||||
import {
|
||||
UserOutlined,
|
||||
CalendarOutlined,
|
||||
QrcodeOutlined,
|
||||
ShopOutlined,
|
||||
ClockCircleOutlined,
|
||||
SettingOutlined,
|
||||
AccountBookOutlined,
|
||||
FileTextOutlined,
|
||||
MoneyCollectOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { getSiteInfo } from '@/api/layout';
|
||||
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
|
||||
import { pageUsers } from '@/api/system/user';
|
||||
import { pageShopOrder } from '@/api/shop/shopOrder';
|
||||
import { getPageTitle, openNew } from '@/utils/common';
|
||||
import { listCmsStatistics } from '@/api/cms/cmsStatistics';
|
||||
|
||||
// 当前小程序项目
|
||||
const siteInfo = ref<CmsWebsite>({});
|
||||
// 当前小程序项目
|
||||
const siteInfo = ref<CmsWebsite>({});
|
||||
|
||||
// 系统信息
|
||||
const systemInfo = ref({
|
||||
name: '小程序开发',
|
||||
description: '基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台',
|
||||
version: '2.0.0',
|
||||
status: '运行中',
|
||||
logo: '/logo.png',
|
||||
environment: '生产环境',
|
||||
database: 'MySQL 8.0',
|
||||
server: 'Linux CentOS 7.9',
|
||||
expirationTime: '2024-01-01 09:00:00'
|
||||
});
|
||||
// 系统信息
|
||||
const systemInfo = ref({
|
||||
name: '小程序开发',
|
||||
description:
|
||||
'基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台',
|
||||
version: '2.0.0',
|
||||
status: '运行中',
|
||||
logo: '/logo.png',
|
||||
environment: '生产环境',
|
||||
database: 'MySQL 8.0',
|
||||
server: 'Linux CentOS 7.9',
|
||||
expirationTime: '2024-01-01 09:00:00'
|
||||
});
|
||||
|
||||
// 统计数据
|
||||
const statistics = ref({
|
||||
userCount: 0,
|
||||
orderCount: 0,
|
||||
todayVisit: 0,
|
||||
runDays: 365
|
||||
});
|
||||
// 统计数据
|
||||
const statistics = ref({
|
||||
userCount: 0,
|
||||
orderCount: 0,
|
||||
todayVisit: 0,
|
||||
runDays: 365
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
// 加载系统信息和统计数据
|
||||
loadSystemInfo();
|
||||
loadStatistics();
|
||||
});
|
||||
onMounted(() => {
|
||||
// 加载系统信息和统计数据
|
||||
loadSystemInfo();
|
||||
loadStatistics();
|
||||
});
|
||||
|
||||
const loadSystemInfo = async () => {
|
||||
// TODO: 调用API获取系统信息
|
||||
siteInfo.value = await getSiteInfo();
|
||||
if (siteInfo.value.createTime) {
|
||||
// 根据创建时间计算运行天数
|
||||
statistics.value.runDays = Math.floor((new Date().getTime() - new Date(siteInfo.value.createTime).getTime()) / (24 * 60 * 60 * 1000))
|
||||
}
|
||||
};
|
||||
const loadSystemInfo = async () => {
|
||||
// TODO: 调用API获取系统信息
|
||||
siteInfo.value = await getSiteInfo();
|
||||
if (siteInfo.value.createTime) {
|
||||
// 根据创建时间计算运行天数
|
||||
statistics.value.runDays = Math.floor(
|
||||
(new Date().getTime() - new Date(siteInfo.value.createTime).getTime()) /
|
||||
(24 * 60 * 60 * 1000)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const loadStatistics = async () => {
|
||||
// TODO: 调用API获取统计数据
|
||||
const users = await pageUsers({})
|
||||
const orders = await pageShopOrder({})
|
||||
if (users) {
|
||||
console.log(users.count)
|
||||
statistics.value.userCount = users.count
|
||||
}
|
||||
if (orders) {
|
||||
statistics.value.orderCount = orders.count
|
||||
}
|
||||
// 获取统计表数据
|
||||
const data = await listCmsStatistics({});
|
||||
if (data) {
|
||||
// 统计数据
|
||||
statistics.value.totalSales = data[0].totalSales;
|
||||
}
|
||||
};
|
||||
const loadStatistics = async () => {
|
||||
// TODO: 调用API获取统计数据
|
||||
const users = await pageUsers({});
|
||||
const orders = await pageShopOrder({});
|
||||
if (users) {
|
||||
console.log(users.count);
|
||||
statistics.value.userCount = users.count;
|
||||
}
|
||||
if (orders) {
|
||||
statistics.value.orderCount = orders.count;
|
||||
}
|
||||
// 获取统计表数据
|
||||
const data = await listCmsStatistics({});
|
||||
if (data) {
|
||||
// 统计数据
|
||||
statistics.value.totalSales = data[0].totalSales;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.system-info h2 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.system-info h2 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
text-align: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.stat-card {
|
||||
text-align: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.stat-card :deep(.ant-statistic-title) {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
.stat-card :deep(.ant-statistic-title) {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.stat-card :deep(.ant-statistic-content) {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.stat-card :deep(.ant-statistic-content) {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user