This commit is contained in:
Paidax
2025-11-06 15:33:35 +08:00
parent 2f9a27d2a0
commit 6efa654957
8 changed files with 456 additions and 474 deletions
@@ -67,10 +67,11 @@ public class SysV4AppsController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
m.id, m.id,
m.name, m.`name`,
m.href, m.href,
m.icon, m.icon,
m.picIcon, m.picIcon,
sm.`name` AS moduleName,
CASE CASE
WHEN f.userId IS NOT NULL THEN WHEN f.userId IS NOT NULL THEN
1 ELSE 0 1 ELSE 0
@@ -79,6 +80,7 @@ public class SysV4AppsController {
sys_menu m sys_menu m
LEFT JOIN sys_user_favorite_app f ON m.id = f.appId LEFT JOIN sys_user_favorite_app f ON m.id = f.appId
AND f.userId = @userId AND f.userId = @userId
LEFT JOIN sys_module sm ON sm.id = m.moduleId
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
@@ -138,10 +140,11 @@ public class SysV4AppsController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
m.id, m.id,
m.name, m.`name`,
m.href, m.href,
m.icon, m.icon,
m.picIcon, m.picIcon,
sm.`name` AS moduleName,
1 AS isFavorite 1 AS isFavorite
FROM FROM
sys_user_favorite_app f sys_user_favorite_app f
@@ -149,6 +152,7 @@ public class SysV4AppsController {
sys_menu m sys_menu m
ON ON
f.appId = m.id f.appId = m.id
LEFT JOIN sys_module sm ON sm.id = m.moduleId
WHERE WHERE
f.userId = @userId f.userId = @userId
AND m.platform = 'PC' AND m.platform = 'PC'
@@ -159,6 +159,7 @@ layout("/layouts/v4/baseLayout.html"){
align-items: center; align-items: center;
padding: 15px; padding: 15px;
position: relative; position: relative;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
} }
.app-card:hover { .app-card:hover {
@@ -193,7 +194,7 @@ layout("/layouts/v4/baseLayout.html"){
.favorite-icon { .favorite-icon {
position: absolute; position: absolute;
bottom: 10px; top: 10px;
right: 10px; right: 10px;
cursor: pointer; cursor: pointer;
transition: all 0.3s; transition: all 0.3s;
@@ -380,7 +381,7 @@ layout("/layouts/v4/baseLayout.html"){
</div> </div>
<div class="app-info"> <div class="app-info">
<div class="app-title">{{ app.name }}</div> <div class="app-title">{{ app.name }}</div>
<div class="app-desc" v-if="app.department">{{ app.department }}</div> <div class="app-desc" v-if="app.moduleName">{{ app.moduleName }}</div>
</div> </div>
<div class="app-status" v-if="app.status">{{ app.status }}</div> <div class="app-status" v-if="app.status">{{ app.status }}</div>
<div <div
+11 -20
View File
@@ -3,11 +3,6 @@ const act = {
<!-- 活动 --> <!-- 活动 -->
<div class="section-wrapper"> <div class="section-wrapper">
<div class="section-act"> <div class="section-act">
<!-- 标题 -->
<div class="section-act-title">
<span>工会活动</span>
</div>
<!-- Swiper容器 --> <!-- Swiper容器 -->
<div class="activity-swiper-container"> <div class="activity-swiper-container">
<!-- 活动数据 - Swiper --> <!-- 活动数据 - Swiper -->
@@ -86,13 +81,13 @@ const act = {
}, },
breakpoints: { breakpoints: {
768: { 768: {
slidesPerView: 2, slidesPerView: 1,
}, },
1024: { 1024: {
slidesPerView: 3, slidesPerView: 2,
}, },
1200: { 1200: {
slidesPerView: 4, slidesPerView: 3,
} }
} }
}) })
@@ -125,12 +120,6 @@ const act = {
width: 100%; width: 100%;
} }
.section-act {
width: 80%;
max-width: 80%;
margin: 30px auto;
}
.section-act .section-act-title span { .section-act .section-act-title span {
font-size: 30px; font-size: 30px;
color: #000000; color: #000000;
@@ -172,12 +161,13 @@ const act = {
.activity-swiper-container { .activity-swiper-container {
position: relative; position: relative;
width: 100%; width: 100%;
margin-top: 30px; padding: 20px;
/*margin-top: 30px;*/
} }
.activity-swiper { .activity-swiper {
width: 100%; width: 100%;
padding: 0 50px 20px 50px; /*padding: 0 50px 20px 50px;*/
} }
.activity-swiper .swiper-slide { .activity-swiper .swiper-slide {
@@ -235,6 +225,7 @@ const act = {
.activity-swiper .swiper-slide .item .img-box { .activity-swiper .swiper-slide .item .img-box {
width: 100%; width: 100%;
height: 200px; height: 200px;
border-radius: 12px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
@@ -282,13 +273,13 @@ const act = {
} }
.activity-swiper .swiper-slide .item .time { .activity-swiper .swiper-slide .item .time {
margin-top: 8px; /*margin-top: 8px;*/
} }
.activity-swiper .swiper-slide .item .time p { .activity-swiper .swiper-slide .item .time p {
font-size: 14px; font-size: 13px;
margin: 0; margin: 0;
line-height: 1.5; /*line-height: 1.5;*/
color: #666; color: #666;
} }
@@ -297,4 +288,4 @@ const act = {
color: var(--color-primary); color: var(--color-primary);
} }
` `
} };
+105 -178
View File
@@ -1,41 +1,31 @@
const entry = { const entry = {
template: /*language=HTML*/ ` template: /*language=HTML*/ `
<div class="entry-wrapper"> <div class="entry-wrapper">
<div class="entry-title"> <!-- 标签页导航 -->
<span>常用入口</span> <div class="tabs">
</div> <div class="tab-item" :class="{ active: activeCategory === 'serv' }"
<div class="entry-container">
<!-- 左侧分类导航 -->
<div class="sidebar">
<div class="category" :class="{active: activeCategory === 'serv'}"
@click="setActiveCategory('serv')"> @click="setActiveCategory('serv')">
<i class="fa fa-star"></i> <i class="fa fa-star"></i> 推荐服务
<span>推荐服务</span>
</div> </div>
<div class="category" :class="{active: activeCategory === 'app'}" @click="setActiveCategory('app')"> <div class="tab-item" :class="{ active: activeCategory === 'app' }"
<i class="fa fa-fire"></i> @click="setActiveCategory('app')">
<span>推荐应用</span> <i class="fa fa-fire"></i> 推荐应用
</div> </div>
<div class="category" :class="{active: activeCategory === 'fav'}" <div class="tab-item" :class="{ active: activeCategory === 'fav' }"
@click="setActiveCategory('fav')"> @click="setActiveCategory('fav')">
<i class="fa fa-heart"></i> <i class="fa fa-heart"></i> 我的收藏
<span>收藏服务</span>
</div> </div>
</div> </div>
<!-- 右侧服务卡片区域 --> <!-- 应用块区域 -->
<div class="content"> <div class="apps-container">
<div class="services-grid"> <div class="app-grid">
<div class="service-card" v-for="(service, index) in currentServices" :key="index" <div class="app-item" v-for="(item, index) in currentServices" :key="index"
@click="openService(service)"> @click="openService(item)">
<div class="service-icon"> <div class="app-icon">
<img :src="service.picIcon"> <img :src="item.picIcon" alt="" />
</div>
<div class="service-info">
<h4 class="service-name">{{ service.name }}</h4>
</div>
</div> </div>
<div class="app-name">{{ item.name }}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -128,194 +118,131 @@ const entry = {
style: /*language=CSS*/ ` style: /*language=CSS*/ `
.entry-wrapper { .entry-wrapper {
width: 100%; width: 100%;
background-image: url(https://www.ncu.edu.cn/images/bbg1.jpg); box-sizing: border-box;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
} }
.entry-title { .tabs {
font-size: 30px; margin-top: 5px;
color: #000000;
display: block;
font-weight: bold;
position: relative;
text-align: center;
padding: 40px 0;
}
/deep/ .entry-title span::before {
content: '';
width: 24px;
height: 11px;
background: url(https://www.ncu.edu.cn/images/titl.svg) no-repeat center;
background-size: 24px 11px;
display: inline-block;
margin-right: 0;
vertical-align: middle;
}
/deep/ .entry-title span::after {
content: '';
width: 24px;
height: 11px;
background: url(https://www.ncu.edu.cn/images/titr.svg) no-repeat center;
background-size: 24px 11px;
display: inline-block;
margin-left: 0;
vertical-align: middle;
}
.entry-container {
width: 80%;
max-width: 80%;
margin: 0 auto;
padding: 20px;
display: flex; display: flex;
gap: 30px; gap: 20px;
overflow: hidden; margin-bottom: 20px;
border-bottom: 2px solid #e8e8e8;
padding-bottom: 10px;
} }
.sidebar { .tab-item {
width: 200px; display: flex;
flex-shrink: 0; align-items: center;
gap: 6px;
font-size: 14px;
color: #666;
cursor: pointer;
padding-bottom: 8px;
transition: color 0.2s ease;
}
.tab-item:hover {
color: #1890ff;
}
.tab-item.active {
color: #1890ff;
font-weight: bold;
border-bottom: 2px solid #1890ff;
}
.tab-item i {
font-size: 14px;
}
.apps-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between;
}
.category {
display: flex;
align-items: center;
padding: 12px 16px;
margin-bottom: 2px;
cursor: pointer;
transition: background-color 0.2s ease;
border-left: 3px solid transparent;
}
.category:hover {
}
.category.active {
color: var(--color-primary);
}
.category i {
font-size: 14px;
margin-right: 10px;
width: 16px;
text-align: center;
}
.category span {
font-size: 18px;
font-weight: 700;
}
.content {
flex: 1;
height: 164px;
}
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px; gap: 20px;
grid-template-rows: repeat(2, 1fr);
overflow: hidden;
} }
.service-card { .app-grid {
padding: 12px; display: grid;
height: 72px; /* 改为自适应列数:每格最小 80px,自动换行 */
cursor: pointer; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
transition: background-color 0.2s ease;
border: none; justify-items: center; /* 子项内容居中(图标和文字) */
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYEAAAB4CAYAAAAUs05BAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANrSURBVHgB7dzNapNZAMfh0zbNYGgosYql4wiCFEEZXLiYG3DrdryPuQbvpXMB7t24m4UOCiKuEtCKsaVNiTRaXhshLvyoSd/Yzf95oORA827PLycn5yxsdZ/crKql+6WG1uLy0d3Lm29Pes+jfm+1N9w/VwD4qXtXbmyf9P/Hu29Wng/6K6WOqnq6WACI1ZgM1pqt0Z31qztlBoMPh0sPXr+8OMsztzsbe9fanfcFgG9sdZ+tz/L+6+0LB7c6lw5meWZ7OGg+7HfPj8dWAgDBRAAgmAgABBMBgGAiABBMBACCiQBAsIV5nBiehXMCAD826zmBWpwYBsi2UFXV5vHrP6WGycnhae4QAuD0JncGneak8He8sBIACCYCAMEa//b+bx5vDJ/dRgQAtY2/EprDVdJ9KwGAYLWukgbgbI03g+tuCLtKGoDPRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEKwxGbwbDZtb3WfrpYbW4vLR3cubbwsAv8Tj3Tcrzwf9lTInVgIAwRp///Hn6Ph1u9Qw+HC49OD1y4sFgDNxvX3h4Fbn0kGpZ8dKACCYCAAEW9jqPrlZVUv3yymtNVujv9Y29qb9Ouh2Z2PvWrvzvgDwjWl+oLM/OlwefBw1fm+1682lVfXUSgAg2JefiI4/0d9Zv7oz7YPbw0HzYb97fjxuL/92dO/KjRM3lx/1e6u94f65AsBPnTSnTubfWeftr58fj60EAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgc71Kehr/7b5aHf8VAGqZx7xtJQAQ7BOP4saDQA2PwQAAAABJRU5ErkJggg==) no-repeat; justify-content: start; /* 整体网格靠左对齐,避免居中 */
background-size: 100% 100%;
display: flex;
align-items: center;
gap: 12px; gap: 12px;
padding: 12px;
background: #fff;
overflow-x: hidden;
max-height: calc(350px - 74px);
overflow-y: auto;
} }
.service-card:hover { .app-item {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 12px;
border-radius: 8px;
background: #fff;
width: 100%;
max-width: 100%;
transition: transform 0.2s ease, box-shadow 0.2s ease;
} }
.service-icon { .app-item:hover {
width: 32px; transform: translateY(-2px);
height: 32px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
flex-shrink: 0;
} }
.service-icon img { .app-icon {
width: 46px;
height: 46px;
margin-bottom: 8px;
}
.app-icon img {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 4px; object-fit: contain;
object-fit: cover;
} }
.service-info { .app-name {
flex: 1; font-size: 12px;
min-width: 0;
overflow: hidden;
}
.service-name {
font-size: 14px;
font-weight: 400;
color: #333; color: #333;
margin: 0;
line-height: 1.4; line-height: 1.4;
white-space: nowrap; word-break: break-word;
overflow: hidden; text-align: center;
text-overflow: ellipsis;
} }
/* 响应式设计 */ /* 响应式设计 */
@media (max-width: 768px) { @media (max-width: 768px) {
.entry-container { .tabs {
flex-direction: column; flex-wrap: wrap;
gap: 20px; gap: 10px;
} }
.sidebar { .tab-item {
width: 100%; padding: 8px 0;
display: flex; font-size: 12px;
overflow-x: auto;
gap: 0;
border-bottom: 1px solid #e8e8e8;
padding-bottom: 0;
} }
.category { .app-grid {
flex-shrink: 0; grid-template-columns: repeat(2, 1fr);
margin-bottom: 0; gap: 15px;
white-space: nowrap;
border-left: none;
border-bottom: 3px solid transparent;
} }
.category.active { .app-item {
border-left: none; padding: 12px;
border-bottom-color: #1890ff;
}
.services-grid {
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
} }
} }
@media (max-width: 480px) { @media (max-width: 480px) {
.services-grid { .app-grid {
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr;
} gap: 12px;
.service-card {
padding: 12px;
} }
} }
` `
} };
@@ -3,6 +3,7 @@ layout("/layouts/v4/baseLayout.html"){
#--> #-->
<style> <style>
.section-banner { .section-banner {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@@ -23,36 +24,69 @@ layout("/layouts/v4/baseLayout.html"){
width: 100%; width: 100%;
} }
.act-wrapper{ .home-grid {
width: 100%; width: 80%;
background-image: url(https://www.ncu.edu.cn/images/bbg1.jpg); margin: 20px auto;
background-size: cover; display: grid;
background-position: center center; grid-template-columns: 2.2fr 0.8fr;
background-repeat: no-repeat; gap: 24px;
align-items: stretch;
row-gap: 24px;
} }
.entry-card {
display: flex;
/*align-items: center;*/
min-width: 320px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
padding: 16px;
transition: transform 0.2s, box-shadow 0.2s;
}
.entry-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.act-card {
display: flex;
align-items: center;
min-width: 320px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
padding: 16px;
transition: transform 0.2s, box-shadow 0.2s;
}
</style> </style>
<div class="v4-container" id="v4-home-app"> <div class="v4-container" id="v4-home-app">
<!-- 首页banner --> <!-- 首页banner -->
<div class="section-banner"> <div class="section-banner">
<div class="banner-img"> <div class="banner-img">
<img src="${config.AppHomeImg!}" alt=""/> <img src="${config.AppHomeImg!}" alt=""/>
<stats></stats>
</div> </div>
</div> </div>
<div class="">
<user></user> <user></user>
<entry></entry> <div class="home-grid">
<div class="act-card">
<act></act>
</div>
<!-- 工会活动 --> <div class="entry-card">
<div class="section-wrapper act-wrapper"> <entry></entry>
<act/> </div>
</div> </div>
<jcdt :list="websiteNews.grassroots"></jcdt> <jcdt :list="websiteNews.grassroots"></jcdt>
</div>
</div> </div>
@@ -61,6 +95,9 @@ layout("/layouts/v4/baseLayout.html"){
<!--#include("jcdt.js"){}#--> <!--#include("jcdt.js"){}#-->
<!--#include("entry.js"){}#--> <!--#include("entry.js"){}#-->
<!--#include("user.js"){}#--> <!--#include("user.js"){}#-->
<!--#include("stats.js"){}#-->
new Vue({ new Vue({
el: '#v4-home-app', el: '#v4-home-app',
data(){ data(){
@@ -75,6 +112,7 @@ layout("/layouts/v4/baseLayout.html"){
'jcdt': jcdt, 'jcdt': jcdt,
'entry': entry, 'entry': entry,
'user': user, 'user': user,
'stats': stats,
}, },
mounted() { mounted() {
this.getWebSiteNews() this.getWebSiteNews()
@@ -39,7 +39,6 @@ const jcdt = {
style: /*language=CSS*/ ` style: /*language=CSS*/ `
.jcdt-wrapper { .jcdt-wrapper {
width: 100%; width: 100%;
background-image: url(/assets/platform/img/v4/home-bg.png);
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
@@ -58,7 +57,7 @@ const jcdt = {
font-weight: bold; font-weight: bold;
position: relative; position: relative;
text-align: center; text-align: center;
padding: 40px 0; padding: 20px 0;
} }
/deep/ .jcdt-container .jcdt-title span::before { /deep/ .jcdt-container .jcdt-title span::before {
@@ -162,4 +161,4 @@ const jcdt = {
} }
` `
} };
+142 -151
View File
@@ -1,8 +1,15 @@
const user = { const user = {
template: /*language=HTML*/ ` template: /*language=HTML*/ `
<div class="user-wrapper"> <div class="user-wrapper">
<!-- 用户容器:左右布局 -->
<div class="user-container"> <div class="user-container">
<div class="user-info-section"> <!-- 左侧:用户信息卡片 -->
<div class="user-info-card">
<div class="user-avatar">
<span class="initial">
${@auth.getPrincipalProperty('username')}
</span>
</div>
<div class="user-details"> <div class="user-details">
<div class="user-name">${@auth.getPrincipalProperty('username')}</div> <div class="user-name">${@auth.getPrincipalProperty('username')}</div>
<div class="user-meta"> <div class="user-meta">
@@ -30,220 +37,204 @@ const user = {
</div> </div>
</div> </div>
<div class="stats-section"> <!-- 右侧:待办中心 -->
<div class="stats-grid"> <div class="todo-center">
<div class="stat-item pending" @click="handleStatClick('todo')"> <!-- 标题和标签 -->
<div class="stat-icon"> <div class="header">
<i class="fa fa-clock-o"></i> <h3>待办中心</h3>
</div> <el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
<div class="stat-content"> <el-tab-pane label="待办事宜" name="pending"></el-tab-pane>
<div class="stat-label">待办</div> <el-tab-pane label="已办事宜" name="done"></el-tab-pane>
<div class="stat-number">{{ stats.todoCount }}</div> <el-tab-pane label="我的发起" name="initiation"></el-tab-pane>
</div> <el-tab-pane label="办结事务" name="completed"></el-tab-pane>
</el-tabs>
</div> </div>
<div class="stat-item completed" @click="handleStatClick('done')"> <!-- 表格 -->
<div class="stat-icon"> <el-table
<i class="fa fa-check-circle"></i> :data="todoList"
</div> style="width: 100%"
<div class="stat-content"> border
<div class="stat-label">已办</div> stripe
<div class="stat-number">{{ stats.doneCount }}</div> :cell-style="{ padding: '8px' }"
</div> :header-cell-style="{ background: '#f8f9fa', color: '#444', fontWeight: '500' }"
</div> >
<el-table-column prop="index" label="序号" width="60" align="center">
<div class="stat-item messages" @click="handleStatClick('notification')"> <template slot-scope="scope">
<div class="stat-icon"> {{ scope.$index + 1 }}
<i class="fa fa-bell"></i> </template>
</div> </el-table-column>
<div class="stat-content"> <el-table-column prop="platform" label="所属平台" width="100" align="center"></el-table-column>
<div class="stat-label">消息</div> <el-table-column prop="title" label="标题" min-width="300">
<div class="stat-number">{{ stats.notifications }}</div> <template slot-scope="scope">
</div> <el-tooltip effect="dark" :content="scope.row.title" placement="top">
</div> <span class="table-title">{{ scope.row.title }}</span>
</el-tooltip>
<div class="stat-item reminders" @click="handleStatClick('started')"> </template>
<div class="stat-icon"> </el-table-column>
<i class="fa fa-file-text"></i> <el-table-column prop="sender" label="发送人" width="120" align="center"></el-table-column>
</div> <el-table-column prop="date" label="发起日期" width="120" align="center"></el-table-column>
<div class="stat-content"> </el-table>
<div class="stat-label">发起</div> <!--#include("/layouts/pagination.html"){}#-->
<div class="stat-number">{{ stats.startedCount }}</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
`, `,
mixins: [initTableMixins],
data() { data() {
return { return {
stats: { activeTab: 'pending',
todoCount: 0, todoList: [
doneCount: 0, { platform: '教务系统', title: '关于2025年秋季学期课程安排的通知', sender: '教务处', date: '2025-10-31' },
notifications: 0, { platform: '科研管理系统', title: '项目经费报销申请审批', sender: '财务处', date: '2025-10-30' },
startedCount: 0 { platform: '人事系统', title: '职称评定材料提交提醒', sender: '人事处', date: '2025-10-29' },
} { platform: '后勤服务', title: '宿舍维修申请处理中', sender: '后勤处', date: '2025-10-28' },
} { platform: '工会系统', title: '年度体检报名通知', sender: '工会', date: '2025-10-27' }
]
};
}, },
methods: { methods: {
handleStatClick(type) { handleTabClick(tab) {
if (['todo', 'done', 'started'].includes(type)) { console.log('切换到:', tab.name);
window.open('/flow/todoCenter?status=' + type)
} else if (type === 'notification') {
window.open('/platform/v4/msg')
}
}, },
loadStats() {
this.$axios.post("/flow/todoCenter/statistics").then(res => {
if (res.code === 0) {
this.stats = res.data;
}
})
}
},
mounted() {
this.loadStats();
}, },
style: /*language=CSS*/ ` style: /*language=CSS*/ `
.user-wrapper { .user-wrapper {
width: 100%; width: 100%;
background-image: url(https://www.ncu.edu.cn/images/bbg1.jpg); background-color: #f5f7fa;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
} }
.user-container { .user-container {
width: 80%; width: 80%;
max-width: 80%; margin: 20px auto;
margin: 0 auto; display: grid;
padding: 20px; grid-template-columns: 0.5fr 2.5fr;
display: flex; gap: 24px;
gap: 30px; align-items: stretch;
overflow: hidden; row-gap: 24px;
} }
.user-info-section { /* 左侧用户卡片 */
.user-info-card {
display: flex; display: flex;
align-items: center; align-items: center;
min-width: 0; min-width: 320px;
width: 390px; background: white;
background-image: url(https://cdgh.ncu.edu.cn/images/index_bg2.png); border-radius: 12px;
background-size: cover; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
background-position: center; padding: 16px;
background-repeat: no-repeat; transition: transform 0.2s, box-shadow 0.2s;
padding: 12px; }
.user-info-card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.user-avatar {
width: 60px;
height: 60px;
background: linear-gradient(135deg, #1890ff, #0056b3);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
font-weight: bold;
margin-right: 16px;
flex-shrink: 0;
} }
.user-details { .user-details {
flex: 1; flex: 1;
min-width: 0;
} }
.user-name { .user-name {
font-size: 20px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #1a1a1a; color: #1a1a1a;
margin-bottom: 12px; margin: 0 0 8px 0;
} }
.user-meta { .user-meta {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px; gap: 4px;
font-size: 14px;
} }
.meta-item { .meta-item {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px;
} }
.meta-label { .meta-label {
color: #666; color: #666;
min-width: 60px; min-width: 50px;
flex-shrink: 0; flex-shrink: 0;
} }
.meta-value { .meta-value {
color: #333; color: #333;
font-weight: 500; font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
} }
/* 右侧统计区域 */ /* 右侧待办中心 */
.stats-section { .todo-center {
flex: 1; min-width: 320px;
min-width: 0; background: white;
} border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 32px;
height: 100%;
}
.stat-item {
display: flex;
align-items: flex-start;
gap: 12px;
cursor: pointer;
transition: all 0.3s ease;
padding: 16px; padding: 16px;
position: relative; transition: transform 0.2s, box-shadow 0.2s;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYEAAAB4CAYAAAAUs05BAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANrSURBVHgB7dzNapNZAMfh0zbNYGgosYql4wiCFEEZXLiYG3DrdryPuQbvpXMB7t24m4UOCiKuEtCKsaVNiTRaXhshLvyoSd/Yzf95oORA827PLycn5yxsdZ/crKql+6WG1uLy0d3Lm29Pes+jfm+1N9w/VwD4qXtXbmyf9P/Hu29Wng/6K6WOqnq6WACI1ZgM1pqt0Z31qztlBoMPh0sPXr+8OMsztzsbe9fanfcFgG9sdZ+tz/L+6+0LB7c6lw5meWZ7OGg+7HfPj8dWAgDBRAAgmAgABBMBgGAiABBMBACCiQBAsIV5nBiehXMCAD826zmBWpwYBsi2UFXV5vHrP6WGycnhae4QAuD0JncGneak8He8sBIACCYCAMEa//b+bx5vDJ/dRgQAtY2/EprDVdJ9KwGAYLWukgbgbI03g+tuCLtKGoDPRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEKwxGbwbDZtb3WfrpYbW4vLR3cubbwsAv8Tj3Tcrzwf9lTInVgIAwRp///Hn6Ph1u9Qw+HC49OD1y4sFgDNxvX3h4Fbn0kGpZ8dKACCYCAAEW9jqPrlZVUv3yymtNVujv9Y29qb9Ouh2Z2PvWrvzvgDwjWl+oLM/OlwefBw1fm+1682lVfXUSgAg2JefiI4/0d9Zv7oz7YPbw0HzYb97fjxuL/92dO/KjRM3lx/1e6u94f65AsBPnTSnTubfWeftr58fj60EAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgc71Kehr/7b5aHf8VAGqZx7xtJQAQ7BOP4saDQA2PwQAAAABJRU5ErkJggg==) no-repeat;
background-size: 100% 100%;
} }
.stat-item:hover { .header {
transform: translateY(-2px);
}
.stat-icon {
position: absolute;
top: 12px;
right: 12px;
width: 32px;
height: 32px;
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
justify-content: center; margin-bottom: 16px;
border-radius: 6px;
font-size: 16px;
color: #999;
} }
.stat-icon i { .header h3 {
font-size: 32px; font-size: 18px;
color: var(--color-primary-3);
}
.stat-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 8px;
}
.stat-label {
font-size: 16px;
color: #333; color: #333;
font-weight: 700; margin: 0;
line-height: 1; border-left: 4px solid #1890ff;
text-align: center; padding-left: 10px;
padding: 15px 0; font-weight: 600;
} }
.stat-number { .el-tabs {
font-size: 32px; margin-top: 10px;
font-weight: 700;
color: var(--color-primary);
line-height: 1;
flex: 1;
text-align: center;
} }
.table-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 280px;
display: inline-block;
}
.pagination {
margin-top: 20px;
text-align: right;
}
/* 响应式:小屏下堆叠 */
@media (max-width: 768px) {
.user-container {
flex-direction: column;
width: 95%;
}
.user-info-card, .todo-center {
min-width: 100%;
width: 100%;
}
}
` `
} };
@@ -34,41 +34,30 @@ const apps = {
<!-- 右侧内容 --> <!-- 右侧内容 -->
<div class="tree-content"> <div class="tree-content">
<!-- 应用列表 --> <!-- 应用列表 -->
<div class="app-list" v-if="applications.length > 0"> <div :class="['app-grid', { 'app-grid-single': applications.length === 1 }]"
<div v-if="applications.length > 0">
v-for="app in applications" <div v-for="app in applications"
:key="app.id" :key="app.id"
class="app-item" class="app-grid-item"
:class="{ 'is-favorite': app.isFavorite }"
@click="openApp(app)" @click="openApp(app)"
> @touchstart="onTouchStart(app)"
<div class="app-icon"> @touchend="onTouchEnd"
<van-image @touchmove="onTouchMove">
v-if="app.picIcon" <!-- 图标 -->
:src="app.picIcon" <div class="app-grid-icon">
fit="cover" <van-icon v-if="app.picIcon" :name="app.picIcon" size="64" style="border-radius: 12px; width: 64px; height: 64px;"></van-icon>
width="40" <van-icon v-else-if="app.icon" :name="app.icon" size="28"></van-icon>
height="40" <van-icon v-else name="apps-o" size="28"></van-icon>
radius="4"
></van-image>
<van-icon v-else-if="app.icon" :name="app.icon" size="24"></van-icon>
<van-icon v-else name="apps-o" size="24"></van-icon>
</div>
<div class="app-info">
<div class="app-title">{{ app.name }}</div>
<div class="app-desc" v-if="app.department">{{ app.department }}</div>
</div>
<div class="app-action">
<van-icon
:name="app.isFavorite ? 'star' : 'star-o'"
:class="['favorite-icon', app.isFavorite ? 'active' : '']"
@click.stop="toggleFavorite(app.id)"
></van-icon>
</div>
</div> </div>
<!-- 名称 -->
<div class="app-grid-name">{{ app.name }}</div>
</div> </div>
</div>
<!-- 空状态 --> <!-- 空状态 -->
<van-empty v-else description="暂无应用"></van-empty> <van-empty v-else description="暂无应用"></van-empty>
</div> </div>
</div> </div>
@@ -118,7 +107,10 @@ const apps = {
// 弹框相关 // 弹框相关
showMenuPopup: false, showMenuPopup: false,
currentApp: {}, currentApp: {},
currentMenus: [] currentMenus: [],
touchTimer: null,
isTouchMoved: false,
} }
}, },
computed: { computed: {
@@ -129,8 +121,7 @@ const apps = {
// 当前选中的分类ID // 当前选中的分类ID
currentCategoryId() { currentCategoryId() {
return this.allCategories[this.activeTab]?.id || "all" return this.allCategories[this.activeTab]?.id || "all"
}, }
}, },
mounted() { mounted() {
// 页面加载时获取分类和应用数据 // 页面加载时获取分类和应用数据
@@ -225,16 +216,38 @@ const apps = {
.then((result) => { .then((result) => {
if (result.code === 0) { if (result.code === 0) {
app.isFavorite = !app.isFavorite app.isFavorite = !app.isFavorite
this.$toast(app.isFavorite ? "收藏成功" : "取消收藏成功") this.$toast(app.isFavorite ? ('收藏成功:' + app.name) : ('取消收藏:' + app.name))
} else { } else {
console.error(app.isFavorite ? "取消收藏失败:" : "收藏失败:", result.msg) console.error(app.isFavorite ? ('取消收藏:' + app.name) : ('收藏失败:' + app.name), result.msg)
} }
}) })
.fail((error) => { .fail((error) => {
console.error(app.isFavorite ? "取消收藏异常:" : "收藏异常:", error) console.error(app.isFavorite ? ('取消收藏:' + app.name) : ('收藏异常:' + app.name), error)
}) })
}, },
// 长按开始
onTouchStart(app) {
this.isTouchMoved = false
this.touchTimer = setTimeout(() => {
this.toggleFavorite(app.id)
}, 800) // 长按 800ms 触发
},
// 触摸移动(判断是否滑动,避免误触长按)
onTouchMove() {
this.isTouchMoved = true
},
// 触摸结束(清除计时器)
onTouchEnd() {
if (this.touchTimer) {
clearTimeout(this.touchTimer)
this.touchTimer = null
}
},
// 搜索 // 搜索
onSearch() { onSearch() {
this.applications = [] this.applications = []
@@ -283,7 +296,7 @@ const apps = {
// 导航到菜单 // 导航到菜单
navigateToMenu(menu) { navigateToMenu(menu) {
// 关闭弹框 // 关闭弹框
this.showMenuPopup = false // this.showMenuPopup = false
if (menu.href) { if (menu.href) {
if(menu.href.startsWith('http://') || menu.href.startsWith('https://')){ if(menu.href.startsWith('http://') || menu.href.startsWith('https://')){
window.open(menu.href, '_blank') window.open(menu.href, '_blank')
@@ -295,6 +308,12 @@ const apps = {
} }
} }
}, },
// 初始加载消除长按收藏
beforeDestroy() {
if (this.touchTimer) {
clearTimeout(this.touchTimer)
}
},
style: /*language=CSS*/ ` style: /*language=CSS*/ `
.apps-container { .apps-container {
display: flex; display: flex;
@@ -385,66 +404,77 @@ const apps = {
background: #fff; background: #fff;
} }
.app-list { .app-grid {
flex: 1; display: grid;
overflow-y: auto; /* 改为自适应列数:每格最小 80px,自动换行 */
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
justify-items: center; /* 子项内容居中(图标和文字) */
justify-content: start; /* 整体网格靠左对齐,避免居中 */
gap: 12px;
padding: 12px;
background: #fff;
overflow-x: hidden;
} }
.app-item { .app-grid-single {
display: flex; display: flex;
align-items: center; justify-content: start;
padding: 12px 16px; padding: 16px 0;
background-color: #fff;
margin-bottom: 1px;
position: relative;
} }
.app-icon { .app-grid-single .app-grid-item {
width: 40px; max-width: 80px;
height: 40px; margin: 0 12px;
border-radius: 4px; }
background-color: #f2f3f5;
.app-grid-item {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 12px 4px;
border-radius: 8px;
background: #fff;
width: 100%;
max-width: 100%;
}
.app-grid-icon {
width: 64px;
height: 64px;
max-width: 64px;
max-height: 64px;
border-radius: 12px;
background: #f2f3f5;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 12px; margin-bottom: 6px;
overflow: hidden; overflow: hidden;
border: 2px solid transparent;
transition: all 0.2s ease;
} }
.app-info { .app-grid-name {
flex: 1; width: 100%;
}
.app-title {
font-size: 16px;
font-weight: 500;
margin-bottom: 4px;
color: #323233;
}
.app-desc {
font-size: 12px; font-size: 12px;
color: #969799; color: #323233;
}
.app-action {
padding: 0 8px;
}
.favorite-icon {
font-size: 20px;
color: #c8c9cc;
}
.favorite-icon.active {
color: #ff9800;
}
.loading-container {
padding: 20px 0;
text-align: center; text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.app-grid-item.is-favorite .app-grid-icon,
.app-grid-icon.is-favorite {
border-color: #ff9800;
box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}
/* 菜单弹框样式 */ /* 菜单弹框样式 */
/deep/ .menu-popup { /deep/ .menu-popup {
height: 100%; height: 100%;
@@ -546,5 +576,6 @@ const apps = {
font-size: 16px; font-size: 16px;
color: #c8c9cc; color: #c8c9cc;
} }
` `
} }