Files
gr_report_web/src/views/Home/Index20.vue

358 lines
8.4 KiB
Vue
Raw Normal View History

2026-02-02 23:17:44 +08:00
2026-02-09 11:34:46 +08:00
<template>
<div class="app-container">
<!-- 头部区域 -->
<!-- <header class="app-header">
<h1 class="title">
<i class="el-icon-menu"></i>
</h1>
</header> -->
<!-- 搜索区域 -->
<!-- <div class="search-container">
<el-input
v-model="searchQuery"
placeholder="搜索应用..."
clearable
prefix-icon="el-icon-search"
class="search-input"
></el-input>
</div> -->
<!-- 空状态 -->
<div v-if="Object.keys(filteredCategories).length === 0" class="empty-state">
<i class="el-icon-warning empty-icon"></i>
<h3>未找到匹配的应用</h3>
<p>请尝试调整搜索关键词</p>
</div>
<!-- 分类应用展示 -->
<div
v-for="(category, categoryName) in filteredCategories"
:key="categoryName"
class="category-section">
<div class="category-header">
<h2 class="category-title">{{ categoryName }}</h2>
<el-tag size="small" class="app-count">{{ category.apps.length }} 个应用</el-tag>
</div>
<div class="apps-grid">
<div
v-for="app in category.apps"
:key="app.id"
class="app-card"
@click="handleAppClick(app)">
<div class="app-icon-wrapper">
<i :class="app.iconClass" class="app-icon"></i>
</div>
<div class="app-name">{{ app.name }}</div>
</div>
</div>
</div>
<!-- 应用详情对话框 -->
<el-dialog
v-model:visible="dialogVisible"
title="应用详情"
width="30%"
custom-class="app-dialog">
<div v-if="selectedApp" class="dialog-content">
<div class="dialog-icon-wrapper">
<i :class="selectedApp.iconClass" class="dialog-app-icon"></i>
</div>
<h3 class="dialog-app-name">{{ selectedApp.name }}</h3>
<p class="dialog-app-id">ID: {{ selectedApp.id }}</p>
<p class="dialog-app-category" v-if="selectedApp.category">分类: {{ selectedApp.category }}</p>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirmLaunch">启动</el-button>
</span>
</template>
</el-dialog>
</div>
2026-02-02 23:17:44 +08:00
</template>
2026-02-09 11:34:46 +08:00
<script>
export default {
name: 'AppManager',
data() {
return {
searchQuery: '',
dialogVisible: false,
selectedApp: null,
appsData: {
统计报表: [
{id: 'office1', name: '文档编辑器', iconClass: 'el-icon-document'},
{id: 'office2', name: '电子表格', iconClass: 'el-icon-tickets'},
{id: 'office3', name: '演示文稿', iconClass: 'el-icon-present'},
{id: 'office4', name: 'PDF阅读器', iconClass: 'el-icon-notebook-2'}
],
工业互联网: [
{id: 'dev1', name: 'IDE Pro', iconClass: 'el-icon-setting'},
{id: 'dev2', name: 'Git 工具箱', iconClass: 'el-icon-share'},
{id: 'dev3', name: 'API测试工具', iconClass: 'el-icon-connection'},
{id: 'dev4', name: '数据库管理', iconClass: 'el-icon-data-line'}
],
数据中心: [
{id: 'fun1', name: '音乐播放器', iconClass: 'el-icon-headset'},
{id: 'fun2', name: '视频观看', iconClass: 'el-icon-video-play'},
{id: 'fun3', name: '游戏中心', iconClass: 'el-icon-game'},
{id: 'fun4', name: '阅读器', iconClass: 'el-icon-reading'}
],
系统工具: [
{id: 'sys1', name: '系统监控', iconClass: 'el-icon-monitor'},
{id: 'sys2', name: '磁盘清理', iconClass: 'el-icon-delete-solid'},
{id: 'sys3', name: '网络诊断', iconClass: 'el-icon-mobile-phone'},
{id: 'sys4', name: '安全防护', iconClass: 'el-icon-lock'}
]
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
};
},
computed: {
categorizedApps() {
const result = {};
for (const [category, apps] of Object.entries(this.appsData)) {
result[category] = {
apps: apps.map(app => ({...app, category}))
};
}
return result;
},
filteredCategories() {
if (!this.searchQuery.trim()) {
return this.categorizedApps;
}
const query = this.searchQuery.toLowerCase();
const result = {};
for (const [categoryName, categoryData] of Object.entries(this.categorizedApps)) {
const filteredApps = categoryData.apps.filter(app =>
app.name.toLowerCase().includes(query) ||
app.category.toLowerCase().includes(query)
);
if (filteredApps.length > 0) {
result[categoryName] = {...categoryData, apps: filteredApps};
}
}
return result;
},
totalApps() {
return Object.values(this.appsData).reduce((total, apps) => total + apps.length, 0);
},
categoriesCount() {
return Object.keys(this.appsData).length;
},
visibleCategories() {
return Object.keys(this.filteredCategories).length;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
},
methods: {
handleAppClick(app) {
this.selectedApp = app;
this.dialogVisible = true;
},
confirmLaunch() {
this.$message.success(`正在启动 ${this.selectedApp.name}...`);
this.dialogVisible = false;
2026-02-02 23:17:44 +08:00
}
}
2026-02-09 11:34:46 +08:00
};
</script>
2026-02-02 23:17:44 +08:00
2026-02-09 11:34:46 +08:00
<style scoped>
2026-02-02 23:17:44 +08:00
2026-02-09 11:34:46 +08:00
/* 头部样式 */
.app-header {
padding: 30px 0;
color: white;
text-align: center;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.title {
margin-bottom: 10px;
font-size: 2.5rem;
text-shadow: 0 2px 4px rgb(0 0 0 / 10%);
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.subtitle {
font-size: 1.1rem;
opacity: 0.9;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
/* 统计信息样式 */
.stats-container {
display: flex;
padding: 20px;
margin-bottom: 30px;
background: rgb(255 255 255 / 20%);
border-radius: 15px;
justify-content: space-around;
backdrop-filter: blur(10px);
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.stat-card {
color: white;
text-align: center;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.stat-value {
margin-bottom: 5px;
font-size: 2rem;
font-weight: bold;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.stat-label {
font-size: 0.9rem;
opacity: 0.9;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
/* 搜索区域样式 */
.search-container {
max-width: 500px;
margin: 0 auto 30px;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.search-input ::v-deep .el-input__inner {
padding-left: 40px;
border-radius: 25px;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
/* 空状态样式 */
.empty-state {
padding: 60px 20px;
margin-bottom: 30px;
color: rgb(255 255 255 / 80%);
text-align: center;
background: rgb(255 255 255 / 10%);
border-radius: 15px;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.empty-icon {
display: block;
margin-bottom: 15px;
font-size: 3rem;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
/* 分类区域样式 */
.category-section {
padding: 25px;
margin-bottom: 30px;
2026-02-02 23:17:44 +08:00
background: white;
2026-02-09 11:34:46 +08:00
border-radius: 15px;
box-shadow: 0 10px 30px rgb(0 0 0 / 10%);
animation: fadeIn 0.5s ease-out;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.category-header {
2026-02-02 23:17:44 +08:00
display: flex;
align-items: center;
2026-02-09 11:34:46 +08:00
justify-content: space-between;
2026-02-02 23:17:44 +08:00
margin-bottom: 20px;
}
2026-02-09 11:34:46 +08:00
.category-title {
padding-left: 15px;
margin: 0;
font-size: 1.5rem;
color: #303133;
border-left: 5px solid #409EFF;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.app-count {
color: #409eff;
background: #ecf5ff;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
/* 应用网格样式 */
.apps-grid {
2026-02-02 23:17:44 +08:00
display: grid;
2026-02-09 11:34:46 +08:00
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 25px;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.app-card {
padding: 20px 15px;
2026-02-02 23:17:44 +08:00
text-align: center;
cursor: pointer;
2026-02-09 11:34:46 +08:00
background: #f8f9fa;
border-radius: 12px;
box-shadow: 0 2px 10px rgb(0 0 0 / 5%);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.app-card:hover {
color: white;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
transform: translateY(-5px);
box-shadow: 0 10px 25px rgb(64 158 255 / 20%);
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.app-icon-wrapper {
2026-02-02 23:17:44 +08:00
display: flex;
2026-02-09 11:34:46 +08:00
width: 60px;
height: 60px;
margin: 0 auto 12px;
font-size: 28px;
line-height: 60px;
color: white;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 50%;
2026-02-02 23:17:44 +08:00
align-items: center;
2026-02-09 11:34:46 +08:00
justify-content: center;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.app-name {
overflow: hidden;
2026-02-02 23:17:44 +08:00
font-size: 14px;
2026-02-09 11:34:46 +08:00
font-weight: 500;
text-overflow: ellipsis;
white-space: nowrap;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
/* 对话框样式 */
::v-deep .app-dialog .el-dialog__body {
padding: 30px 20px;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.dialog-content {
text-align: center;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.dialog-icon-wrapper {
display: flex;
width: 80px;
height: 80px;
margin: 0 auto 20px;
font-size: 36px;
line-height: 80px;
color: white;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 50%;
align-items: center;
justify-content: center;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.dialog-app-name {
margin: 0 0 10px;
font-size: 1.5rem;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
.dialog-app-id,
.dialog-app-category {
margin: 5px 0;
2026-02-02 23:17:44 +08:00
color: #909399;
}
2026-02-09 11:34:46 +08:00
.dialog-footer {
text-align: right;
2026-02-02 23:17:44 +08:00
}
2026-02-09 11:34:46 +08:00
</style>