From 4d5264ead8c96c78c9928e22fc66b0af190ed180 Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Fri, 08 May 2026 11:06:42 +0800
Subject: [PATCH] 修改loading
---
src/views/work/menuIndex/index.vue | 121 +++++++++++++++++-----------------------
1 files changed, 51 insertions(+), 70 deletions(-)
diff --git a/src/views/work/menuIndex/index.vue b/src/views/work/menuIndex/index.vue
index cdc37ef..f0d689a 100644
--- a/src/views/work/menuIndex/index.vue
+++ b/src/views/work/menuIndex/index.vue
@@ -1,30 +1,5 @@
<template>
- <div class="system-select-container">
- <div class="user-info-bar">
- <div class="user-left"></div>
- <h3 class="user-details">欢迎访问多体系建设信息化系统</h3>
- <div class="avatar-container">
- <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
- <div class="avatar-wrapper" style="display: flex;align-items: center">
- <img src="../assets/images/avator.png" class="user-avatar" />
- <span style="font-size: 16px">{{userName}}({{userTypeName}})</span>
- <el-icon><caret-bottom /></el-icon>
- </div>
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item command="password">
- <span>修改密码</span>
- </el-dropdown-item>
- <el-dropdown-item divided command="logout">
- <span>退出登录</span>
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </div>
- </div>
-
- <!-- 重新布局的系统选择区域 -->
+ <div class="app-container">
<div class="systems-container">
<div class="layout-container">
<!-- 左侧列 -->
@@ -36,10 +11,20 @@
<span class="more-link" @click="toNoticeMng">更多 ></span>
</div>
<div class="notice-list">
- <div class="notice-item" v-for="item in noticeList" :key="item">
- <span class="notice-title" @click="openNoticeFile(item.filePath)">{{item.content}}</span>
- <span class="notice-date">{{item.publishDate}}</span>
- </div>
+
+ <template v-if="noticeLoading">
+ <div v-for="i in 6" :key="i" class="notice-item skeleton">
+ <div class="skeleton-title"></div>
+ <div class="skeleton-date"></div>
+ </div>
+ </template>
+
+ <template v-else>
+ <div class="notice-item" v-for="item in noticeList" :key="item.id">
+ <span class="notice-title" @click="openNoticeFile(item.filePath)">{{item.content}}</span>
+ <span class="notice-date">{{item.publishDate}}</span>
+ </div>
+ </template>
</div>
</div>
@@ -52,8 +37,8 @@
<div class="process-list" v-if="flowList && flowList.length>0">
<div class="process-item" v-for="process in flowList" :key="process.id">
<div class="process-info" @click="openDetail(process)">
- <span class="process-status" :class="{processing: process.type == 1,pending: process.type == 2,success: process.type == 3,normal: process.type == 4,seal: process.type == 5}">
- {{process.type == 1? '内审实施计划':process.type == 2? '培训计划':process.type == 3? '项目评审':process.type == 4?'年度检定计划':process.type == 5?'用章审批(申请)': '用章审批(待审批)'}}
+ <span class="process-status" :class="{processing: process.type == 1,pending: process.type == 2,success: process.type == 3,normal: process.type == 4,seal: process.type == 5,normal: process.type == 6,normal: process.type == 8}">
+ {{process.type == 1? '内审实施计划':process.type == 2? '培训计划':process.type == 3? '项目评审':process.type == 4?'年度检定计划':process.type == 5?'用章审批(申请)': process.type == 6? '用章审批(待审批)':process.type == 7?'颁布令':process.type == 8?'合同审批':'' }}
</span>
<span class="process-name">{{process.title}}</span>
</div>
@@ -123,8 +108,7 @@
>
<div class="card-content">
<div class="system-icon">
- <el-image v-if="getActualIndex(index) == 0" :src="system.platformPic"/>
- <el-image v-else :src="picUrl + system.platformPic"/>
+ <el-image :src="picUrl + system.platformPic"/>
</div>
<h3>{{ system.platformName }}</h3>
</div>
@@ -205,12 +189,6 @@
import userDialog from '@/views/build/conpanyFunctionConsult/staffManage/staffRegister/components/staffDialog.vue'
import editDialog from '@/views/build/conpanyFunctionConsult/infoPlatform/components/editDialog.vue'
import sealDialog from "@/views/work/sealManagement/apply/components/editDialog"
-import menu1 from '@/assets/icons/menu1.png'
-import menu2 from '@/assets/icons/menu2.png'
-import menu3 from '@/assets/icons/menu3.png'
-import menu4 from '@/assets/icons/menu4.png'
-import menu5 from '@/assets/icons/menu5.png'
-import menu6 from '@/assets/icons/menu6.png'
// 引入农历库
import * as lunarCalendar from 'lunar-calendar'
@@ -232,6 +210,8 @@
const calendarRef = ref()
const dialogRef = ref()
const noticeRef = ref();
+const noticeLoading = ref(true)
+
const userStore = useUserStore()
const state = reactive({
noticeParams: {
@@ -269,10 +249,13 @@
state.platformParams.companyId = userStore.companyId
state.isAdmin = false
}
- await getNoticeList()
- await getPlatformList()
- await getFlowList()
- await getMemo()
+ // 并行加载所有数据
+ await Promise.allSettled([
+ getNoticeList(),
+ getPlatformList(),
+ getFlowList(),
+ getMemo()
+ ])
state.platformList.forEach(system => {
cardStates.value[system.id] = {
mouseX: 0,
@@ -318,10 +301,17 @@
noticeRef.value.openDialog('review', data,state.companyList)
}
}
-function getNoticeList() {
- listNotice(state.noticeParams).then(res => {
- state.noticeList = res.data.list
- })
+async function getNoticeList() {
+ try {
+ noticeLoading.value = true
+ const res = await listNotice(state.noticeParams)
+ state.noticeList = res.data.list || []
+ } catch (error) {
+ console.error('获取通知公告失败:', error)
+ state.noticeList = []
+ } finally {
+ noticeLoading.value = false
+ }
}
const getCompanyList = async ()=>{
const queryParams = {
@@ -339,12 +329,12 @@
const getPlatformList = async () => {
const res = await getInfoPlatforms(state.platformParams)
if(res.code == 200){
- const originPlatform = {
- id: 0,
- platformName: '国军标9001C质量管理体系',
- platformPic: menu1
- }
- state.platformList = [originPlatform, ...(Array.isArray(res.data) ? res.data : [])]
+ // const originPlatform = {
+ // id: 0,
+ // platformName: '国军标9001C质量管理体系',
+ // platformPic: menu1
+ // }
+ state.platformList = Array.isArray(res.data) ? res.data : []
}else{
ElMessage.warning(res.message)
}
@@ -494,7 +484,7 @@
const lunar = lunarCalendar.solarToLunar(year, month, day)
if (lunar && lunar.lunarMonthName && lunar.lunarDayName) {
- return `${lunar.lunarMonthName}${lunar.lunarDayName}`
+ return `农历·${lunar.lunarMonthName}${lunar.lunarDayName}`
}
return ''
} catch (error) {
@@ -673,12 +663,12 @@
}
const enterSystem = (address,index) => {
- if(index == 0){
- router.push({ path: "/learn/standardSysTemp/sysStandardModule"})
- }else{
+ // if(index == 0){
+ // router.push({ path: "/learn/standardSysTemp/sysStandardModule"})
+ // }else{
window.open(address)
// ElMessage.warning('系统正在开发中...')
- }
+ // }
}
function getInfo() {
@@ -704,9 +694,6 @@
<style scoped lang="scss">
.system-select-container {
height: 100vh;
- display: flex;
- flex-direction: column;
- background-color: #f5f7fa;
}
.user-info-bar {
@@ -759,8 +746,6 @@
.systems-container {
flex: 1;
- padding: 20px;
- overflow-y: auto;
width: 100%;
}
@@ -768,7 +753,7 @@
display: flex;
gap: 20px;
width: 100%;
- height: 100%;
+ height: calc(100% - 60px);
max-width: none; /* 移除最大宽度限制 */
margin: 0; /* 移除居中margin */
}
@@ -1368,12 +1353,8 @@
// 超大屏幕优化
@media (min-width: 1920px) {
- .systems-container {
- padding: 30px 40px;
- }
-
.layout-container {
- gap: 30px;
+ gap: 20px;
}
.module-card {
--
Gitblit v1.9.2