批量更新
This commit is contained in:
+4
-15
@@ -10,7 +10,7 @@ import request from "@/utils/request";
|
||||
*/
|
||||
export function getBabyList() {
|
||||
return request({
|
||||
url: '/admin/baby/list',
|
||||
url: '/admin/babys/list',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -168,23 +168,12 @@ export function deleteUser(id) {
|
||||
*************************************************/
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* dashborad总体输出
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getUserCounts() {
|
||||
export function getDashborad() {
|
||||
return request({
|
||||
url: "/admin/babyhealthDashborad/users",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取宝贝列表
|
||||
* @returns {Promise}
|
||||
*/
|
||||
export function getBabyCounts() {
|
||||
return request({
|
||||
url: "/admin/babyhealthDashborad/babys",
|
||||
url: "/admin/babyhealthDashborad/dashborad",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" viewBox="0 0 400 400" fill="none"><path d="M77.08 90L15 90L89.64 239.51L89.64 310L145.07 310L145.07 239.51L196.406 137.69L275.435 137.69L203.574 276.92L203.574 310L386.005 310L386.005 262.31L272.464 262.31L345.085 123.08L345.085 90L157.64 90L116.99 180.63L77.08 90Z" fill-rule="evenodd" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 425 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" viewBox="0 0 400 400" fill="none"><path d="M77.08 90L15 90L89.64 239.51L89.64 310L145.07 310L145.07 239.51L196.406 137.69L275.435 137.69L203.574 276.92L203.574 310L386.005 310L386.005 262.31L272.464 262.31L345.085 123.08L345.085 90L157.64 90L116.99 180.63L77.08 90Z" fill-rule="evenodd" fill="#000000" ></path></svg>
|
||||
|
After Width: | Height: | Size: 425 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 496 B |
@@ -25,14 +25,6 @@ const staticRoutes = [
|
||||
component: () => import("@/views/home/index.vue"),
|
||||
meta: { requiresAuth: true, title: "系统导航", isStandalone: true }
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
name: "Main",
|
||||
component: () => import("@/views/Main.vue"),
|
||||
redirect: "/dashboard",
|
||||
meta: { requiresAuth: true },
|
||||
children: staticMainChildren
|
||||
},
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
name: "NotFound",
|
||||
|
||||
+10
-1
@@ -1,8 +1,17 @@
|
||||
import axios from 'axios';
|
||||
|
||||
// 获取API基础URL,添加调试信息
|
||||
const apiBaseURL = import.meta.env.VITE_API_BASE_URL;
|
||||
if (!apiBaseURL) {
|
||||
console.error('警告: VITE_API_BASE_URL 环境变量未设置!');
|
||||
console.log('当前环境变量:', import.meta.env);
|
||||
} else {
|
||||
console.log('API基础URL:', apiBaseURL);
|
||||
}
|
||||
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL,
|
||||
baseURL: apiBaseURL,
|
||||
timeout: 10000,
|
||||
withCredentials: false // JWT 不需要 Cookie
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ onUnmounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.statistics-container {
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, shallowRef, nextTick } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { getBabyCounts, getUserCounts } from '@/api/babyhealth';
|
||||
import { getDashborad } from '@/api/babyhealth';
|
||||
|
||||
// --- 类型定义 ---
|
||||
interface SummaryItem {
|
||||
@@ -87,43 +87,47 @@ const userData = ref<SummaryItem[]>([
|
||||
{ title: '母亲数', value: 0, icon: 'fa-solid fa-person-dress', color: '#F56C6C', percentage: 0, isUp: false }
|
||||
]);
|
||||
|
||||
// 调用宝贝统计接口
|
||||
async function fetchGetBabyDatas() {
|
||||
const res = await getBabyCounts();
|
||||
|
||||
if (res.code === 200 && res.data) {
|
||||
const { total, male, female } = res.data;
|
||||
|
||||
// 更新 babyData
|
||||
babyData.value = [
|
||||
{ title: '总宝贝数', value: total, icon: 'fa-solid fa-baby', color: '#67C23A', percentage: 0, isUp: false },
|
||||
{ title: '男宝宝数', value: male !== undefined ? male : 0, icon: 'fa-solid fa-person', color: '#409EFF', percentage: 0, isUp: false },
|
||||
{ title: '女宝宝数', value: female !== undefined ? female : 0, icon: 'fa-solid fa-person-dress', color: '#F56C6C', percentage: 0, isUp: false }
|
||||
];
|
||||
|
||||
// 更新宝贝柱状图
|
||||
updateBabyChart(total, male, female);
|
||||
// 调用总输出接口
|
||||
async function fetchGetDashborad() {
|
||||
try {
|
||||
const res = await getDashborad();
|
||||
if (res.code === 200 && res.data) {
|
||||
const { userCounts, babyCounts } = res.data;
|
||||
|
||||
// 更新宝贝数据
|
||||
if (babyCounts) {
|
||||
babyData.value[0].value = babyCounts.total || 0; // 总宝贝数
|
||||
babyData.value[1].value = babyCounts.male || 0; // 男宝宝数
|
||||
babyData.value[2].value = babyCounts.female || 0; // 女宝宝数
|
||||
|
||||
// 更新宝贝图表
|
||||
updateBabyChart(
|
||||
babyCounts.total || 0,
|
||||
babyCounts.male || 0,
|
||||
babyCounts.female || 0
|
||||
);
|
||||
}
|
||||
|
||||
// 更新用户数据
|
||||
if (userCounts) {
|
||||
userData.value[0].value = userCounts.total || 0; // 总用户数
|
||||
userData.value[1].value = userCounts.father || 0; // 父亲数
|
||||
userData.value[2].value = userCounts.mother || 0; // 母亲数
|
||||
|
||||
// 更新用户图表
|
||||
updateUserChart(
|
||||
userCounts.total || 0,
|
||||
userCounts.father || 0,
|
||||
userCounts.mother || 0
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取仪表盘数据失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 调用用户统计接口
|
||||
async function fetchGetUserDatas() {
|
||||
const res = await getUserCounts();
|
||||
|
||||
if (res.code === 200 && res.data) {
|
||||
const { total, father, mother } = res.data;
|
||||
|
||||
// 更新 userData
|
||||
userData.value = [
|
||||
{ title: '总用户数', value: total, icon: 'fa-solid fa-users', color: '#3973FF', percentage: 0, isUp: false },
|
||||
{ title: '父亲数', value: father !== undefined ? father : 0, icon: 'fa-solid fa-person', color: '#409EFF', percentage: 0, isUp: false },
|
||||
{ title: '母亲数', value: mother !== undefined ? mother : 0, icon: 'fa-solid fa-person-dress', color: '#F56C6C', percentage: 0, isUp: false }
|
||||
];
|
||||
|
||||
// 更新用户柱状图
|
||||
updateUserChart(total, father, mother);
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化宝贝柱状图
|
||||
const initBabyChart = () => {
|
||||
@@ -219,11 +223,12 @@ const handleResize = () => {
|
||||
userChartInstance.value?.resize();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
initBabyChart();
|
||||
initUserChart();
|
||||
fetchGetBabyDatas();
|
||||
fetchGetUserDatas();
|
||||
// 等待图表初始化完成后再加载数据
|
||||
await nextTick();
|
||||
await fetchGetDashborad();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
@@ -234,7 +239,7 @@ onUnmounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.statistics-container {
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
<script setup></script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@@ -185,7 +185,7 @@ onUnmounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.content-stats-container {
|
||||
min-height: 100vh;
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.category-manager {
|
||||
min-height: 100vh;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ const handleRowClick = () => {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.category-node-wrapper {
|
||||
.category-item {
|
||||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||
|
||||
@@ -525,7 +525,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.editor-container {
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
|
||||
@@ -118,7 +118,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.article-preview {
|
||||
padding: 20px;
|
||||
|
||||
|
||||
@@ -630,7 +630,7 @@ onMounted(async () => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.cms-articles {
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
|
||||
<script setup></script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<template>这是cate</template>
|
||||
<script lang="ts" setup></script>
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="less" scoped></style>
|
||||
@@ -1,3 +1,3 @@
|
||||
<template>这是list</template>
|
||||
<script lang="ts" setup></script>
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="less" scoped></style>
|
||||
@@ -164,7 +164,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.exam-workbench {
|
||||
padding: 20px;
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.darkbg{
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ defineExpose({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.form-tip {
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -74,7 +74,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.container-box {
|
||||
padding: 20px;
|
||||
border-radius: 4px;
|
||||
|
||||
@@ -158,7 +158,7 @@ defineExpose({
|
||||
fetchRoles();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.user-preview {
|
||||
padding: 20px;
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ defineExpose({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.form-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
|
||||
+11
-11
@@ -299,12 +299,12 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
// 定义一些可复用的变量(可选,建议根据项目规范调整)
|
||||
$primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
$bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
|
||||
$text-main: #1a1a2e;
|
||||
$text-regular: #606266;
|
||||
@primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
@bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
|
||||
@text-main: #1a1a2e;
|
||||
@text-regular: #606266;
|
||||
|
||||
.home-container {
|
||||
min-height: 100vh;
|
||||
@@ -332,7 +332,7 @@ $text-regular: #606266;
|
||||
.system-name {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: $text-main;
|
||||
color: @text-main;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ $text-regular: #606266;
|
||||
.toolbar-btn {
|
||||
background: #f5f7fa;
|
||||
border-color: #e4e7ed;
|
||||
color: $text-regular;
|
||||
color: @text-regular;
|
||||
|
||||
&:hover {
|
||||
background: #f0f2f5;
|
||||
@@ -374,7 +374,7 @@ $text-regular: #606266;
|
||||
|
||||
.user-name {
|
||||
font-size: 14px;
|
||||
color: $text-regular;
|
||||
color: @text-regular;
|
||||
max-width: 80px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -392,7 +392,7 @@ $text-regular: #606266;
|
||||
|
||||
.welcome-section {
|
||||
position: relative;
|
||||
background: $primary-gradient;
|
||||
background: @primary-gradient;
|
||||
border-radius: 20px;
|
||||
padding: 48px 56px;
|
||||
margin-bottom: 40px;
|
||||
@@ -476,7 +476,7 @@ $text-regular: #606266;
|
||||
.category-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: $text-main;
|
||||
color: @text-main;
|
||||
margin: 0 0 20px 0;
|
||||
padding-left: 4px;
|
||||
border-left: 4px solid #667eea;
|
||||
@@ -518,7 +518,7 @@ $text-regular: #606266;
|
||||
.card-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: $text-main;
|
||||
color: @text-main;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,22 +3,7 @@
|
||||
<div class="login-card">
|
||||
<div class="login-side">
|
||||
<div class="brand">
|
||||
<svg width="48" height="48" viewBox="0 0 48 48" fill="none">
|
||||
<rect width="48" height="48" rx="18" fill="#eef8fc" />
|
||||
<circle cx="24" cy="24" r="14" fill="#52a8ff" opacity="0.15" />
|
||||
<circle cx="24" cy="24" r="9" fill="#3b7ddd" opacity="0.12" />
|
||||
<text
|
||||
x="24"
|
||||
y="30"
|
||||
text-anchor="middle"
|
||||
fill="#2d5fa7"
|
||||
font-size="16"
|
||||
font-family="Arial"
|
||||
font-weight="bold"
|
||||
>
|
||||
Mete
|
||||
</text>
|
||||
</svg>
|
||||
<img src="@/assets/svgs/logo-w.svg" alt="Logo" style="color: white;width: 50px;" />
|
||||
<span class="brand-title">后台管理系统</span>
|
||||
</div>
|
||||
<div class="illus">
|
||||
@@ -45,7 +30,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
<!-- 版权信息 -->
|
||||
<div class="copyright">© 2026 Mete 管理系统</div>
|
||||
<div class="copyright">© 2026 Yunzer 管理系统</div>
|
||||
</div>
|
||||
<div class="login-panel">
|
||||
<h2 class="login-title">欢迎登录</h2>
|
||||
|
||||
@@ -298,7 +298,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.category-container {
|
||||
.card-header {
|
||||
display: flex;
|
||||
|
||||
@@ -433,7 +433,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.modules-container {
|
||||
padding: 0;
|
||||
margin-top: 50px;
|
||||
|
||||
@@ -266,7 +266,7 @@ defineExpose({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.upload-demo {
|
||||
width: 100%;
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.publish-container {
|
||||
.card-header {
|
||||
display: flex;
|
||||
|
||||
@@ -203,7 +203,7 @@ onMounted(async () => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.container-box {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ const handleClose = () => {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.upload-container {
|
||||
:deep(.el-upload) {
|
||||
width: 100%;
|
||||
|
||||
@@ -985,7 +985,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.file-manager-container {
|
||||
.card-header {
|
||||
display: flex;
|
||||
|
||||
@@ -389,7 +389,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang="less">
|
||||
.container-box {
|
||||
padding: 20px;
|
||||
background: var(--el-bg-color);
|
||||
|
||||
@@ -188,7 +188,7 @@ defineExpose({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.log-detail {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.container-box {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user