first commit
This commit is contained in:
@@ -0,0 +1,335 @@
|
||||
const act = {
|
||||
template: /*language=HTML*/ `
|
||||
<!-- 活动 -->
|
||||
<div class="section-wrapper">
|
||||
<div class="section-act">
|
||||
<!-- Swiper容器 -->
|
||||
|
||||
<div v-if="actList && actList.length > 0" class="activity-swiper-container">
|
||||
<div class="activity-swiper-container">
|
||||
<!-- 活动数据 - Swiper -->
|
||||
<div class="swiper activity-swiper">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide" v-for="(activity, index) in actList" :key="activity.id">
|
||||
<div class="item" @click="go(activity)">
|
||||
<div class="img-box">
|
||||
<img :src="activity.cover || 'https://www.ncu.edu.cn/__local/8/52/2C/644986B4C9A030F7B65300178A6_8679CB08_18467.jpg'"
|
||||
alt="">
|
||||
<span class="status">
|
||||
{{getStatusText(activity)}}
|
||||
</span>
|
||||
</div>
|
||||
<h4 class="title">
|
||||
{{ activity.name}}
|
||||
</h4>
|
||||
<!--报名时间-->
|
||||
<div class="time">
|
||||
<p>
|
||||
<i class="fa fa-clock-o"></i>
|
||||
时间:{{ activity.startDate }}至{{ activity.endDate }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 导航按钮 -->
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
|
||||
<!-- 进度条 -->
|
||||
<div class="swiper-pagination"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="no-activity-placeholder">
|
||||
<div class="icon">📅</div>
|
||||
<p>暂无近期活动</p>
|
||||
<p class="subtext">敬请关注后续通知</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
actList: [],
|
||||
swiper: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/*查询活动*/
|
||||
listAct() {
|
||||
this.$axios.post("/platform/home/listHomeActivity").then((res) => {
|
||||
if (res.code === 0) {
|
||||
// for (let i = 0; i < 10; i++) {
|
||||
// this.actList = this.actList.concat(res.data)
|
||||
// }
|
||||
this.actList = res.data
|
||||
// 数据加载完成后初始化Swiper
|
||||
this.$nextTick(() => {
|
||||
this.initSwiper()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/*初始化Swiper*/
|
||||
initSwiper() {
|
||||
this.swiper = new Swiper('.activity-swiper', {
|
||||
slidesPerView: 'auto',
|
||||
spaceBetween: 30,
|
||||
centeredSlides: false,
|
||||
loop: false,
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
type: 'progressbar',
|
||||
},
|
||||
breakpoints: {
|
||||
768: {
|
||||
slidesPerView: 1,
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 2,
|
||||
},
|
||||
1200: {
|
||||
slidesPerView: 3,
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 活动状态
|
||||
getStatusText(item) {
|
||||
if (this.$moment().unix() > this.$moment(item.endDate).unix()) {
|
||||
return "已结束"
|
||||
} else if (this.$moment().unix() < this.$moment(item.startDate).unix()) {
|
||||
return "未开始"
|
||||
} else {
|
||||
return "进行中"
|
||||
}
|
||||
},
|
||||
|
||||
go(act) {
|
||||
if (!act.url) {
|
||||
this.$message.warning("管理员未配置活动链接")
|
||||
return
|
||||
}
|
||||
if (act.url === "/platform/activity/apply"
|
||||
&& !this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_WENTI_SPORTS"])) {
|
||||
return this.$message.warning("PC端暂未开放报名,请前往移动端报名!")
|
||||
|
||||
}
|
||||
window.open(act.url)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listAct()
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.section-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.section-act .section-act-title span {
|
||||
font-size: 30px;
|
||||
color: #000000;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
}
|
||||
|
||||
/*.section-act .section-act-title span:hover {
|
||||
color: var(--color-primary);
|
||||
cursor: pointer;
|
||||
}*/
|
||||
|
||||
/deep/ .section-act .section-act-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/ .section-act .section-act-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;
|
||||
}
|
||||
|
||||
/* Swiper容器样式 */
|
||||
.activity-swiper-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
/*margin-top: 30px;*/
|
||||
}
|
||||
|
||||
.activity-swiper {
|
||||
width: 100%;
|
||||
/*padding: 0 50px 20px 50px;*/
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* 导航按钮样式 */
|
||||
.activity-swiper-container .swiper-button-next,
|
||||
.activity-swiper-container .swiper-button-prev {
|
||||
color: var(--color-primary);
|
||||
background: white;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.activity-swiper-container .swiper-button-next:hover,
|
||||
.activity-swiper-container .swiper-button-prev:hover {
|
||||
background: var(--color-primary);
|
||||
color: white;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/deep/ .activity-swiper-container .swiper-button-next::after,
|
||||
/deep/ .activity-swiper-container .swiper-button-prev::after {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 进度条样式 */
|
||||
.activity-swiper-container .swiper-pagination {
|
||||
position: relative;
|
||||
margin-top: 30px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
.activity-swiper-container .swiper-pagination-progressbar {
|
||||
background: #e0e0e0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.activity-swiper-container .swiper-pagination-progressbar-fill {
|
||||
background: var(--color-primary);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item {
|
||||
height: auto;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item .img-box {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item .img-box .status {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: #c11623;
|
||||
padding: 6px 2px;
|
||||
min-width: 50px;
|
||||
color: #ffffff;
|
||||
border-radius: 0 0 50% 0;
|
||||
}
|
||||
|
||||
|
||||
.activity-swiper .swiper-slide .item .img-box img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item:hover .img-box img {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item h4 {
|
||||
font-size: 20px;
|
||||
margin-top: 10px;
|
||||
height: 60px;
|
||||
color: #333;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item:hover h4 {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item .time {
|
||||
/*margin-top: 8px;*/
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item .time p {
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
/*line-height: 1.5;*/
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.activity-swiper .swiper-slide .item .time i {
|
||||
margin-right: 5px;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
|
||||
/* 无活动占位提示 */
|
||||
.no-activity-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 40px 20px;
|
||||
color: #94a3b8;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.no-activity-placeholder .icon {
|
||||
font-size: 48px;
|
||||
margin-bottom: 12px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.no-activity-placeholder p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.no-activity-placeholder .subtext {
|
||||
font-size: 13px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
`
|
||||
};
|
||||
@@ -0,0 +1,247 @@
|
||||
const entry = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="entry-wrapper">
|
||||
<!-- 标签页导航 -->
|
||||
<div class="tabs">
|
||||
<div class="tab-item" :class="{ active: activeCategory === 'serv' }"
|
||||
@click="setActiveCategory('serv')">
|
||||
<i class="fa fa-star"></i> 推荐服务
|
||||
</div>
|
||||
<div class="tab-item" :class="{ active: activeCategory === 'app' }"
|
||||
@click="setActiveCategory('app')">
|
||||
<i class="fa fa-fire"></i> 推荐应用
|
||||
</div>
|
||||
<div class="tab-item" :class="{ active: activeCategory === 'fav' }"
|
||||
@click="setActiveCategory('fav')">
|
||||
<i class="fa fa-heart"></i> 我的收藏
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 应用块区域 -->
|
||||
<div class="apps-container">
|
||||
<div class="app-grid">
|
||||
<div class="app-item" v-for="(item, index) in currentServices" :key="index"
|
||||
@click="openService(item)">
|
||||
<div class="app-icon">
|
||||
<img :src="item.picIcon" alt="" />
|
||||
</div>
|
||||
<div class="app-name">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
activeCategory: 'serv',
|
||||
hasMore: true,
|
||||
entries: {
|
||||
serv: [],
|
||||
app: [],
|
||||
fav: []
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentServices() {
|
||||
return this.entries[this.activeCategory] || [];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getRecommendService()
|
||||
this.getRecommendApp()
|
||||
this.getFavorite()
|
||||
},
|
||||
methods: {
|
||||
setActiveCategory(category) {
|
||||
this.activeCategory = category;
|
||||
},
|
||||
|
||||
// 查询推荐服务
|
||||
async getRecommendService() {
|
||||
this.$axios.post('/platform/home/listRecommendService', {platform: "PC"}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.entries.serv = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取推荐应用
|
||||
async getRecommendApp() {
|
||||
this.$axios.post('/platform/home/listRecommendApp', {platform: "PC"}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.entries.app = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取我的收藏
|
||||
async getFavorite() {
|
||||
this.$axios.post('/platform/home/listFavorite', {platform: "PC"}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.entries.fav = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 点击服务
|
||||
openService(service) {
|
||||
if(this.activeCategory === 'serv'){
|
||||
if(!service.href) this.$message.error('无效的链接地址')
|
||||
window.open(service.href)
|
||||
return
|
||||
}
|
||||
|
||||
if(this.activeCategory === 'app'){
|
||||
// 储存到缓存
|
||||
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(service))
|
||||
// 新标签页打开
|
||||
window.open("/platform/v4/subApp?appId=" + service.id, "_blank")
|
||||
return
|
||||
}
|
||||
|
||||
if(this.activeCategory === 'fav'){
|
||||
if(!service.href) this.$message.error('无效的链接地址')
|
||||
window.open(service.href)
|
||||
return
|
||||
|
||||
if(!service.parentId){
|
||||
// 储存到缓存
|
||||
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(app))
|
||||
// 新标签页打开
|
||||
window.open("/platform/v4/subApp?appId=" + app.id, "_blank")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.entry-wrapper {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
margin-top: 5px;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
border-bottom: 2px solid #e8e8e8;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: flex;
|
||||
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;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.app-grid {
|
||||
display: grid;
|
||||
/* 改为自适应列数:每格最小 80px,自动换行 */
|
||||
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
|
||||
|
||||
justify-items: center; /* 子项内容居中(图标和文字) */
|
||||
justify-content: start; /* 整体网格靠左对齐,避免居中 */
|
||||
|
||||
gap: 4px;
|
||||
padding: 12px 4px;
|
||||
background: #fff;
|
||||
overflow-x: hidden;
|
||||
|
||||
max-height: calc(350px - 74px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.app-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 6px;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.app-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.app-icon {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.app-icon img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.app-name {
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
word-break: break-word;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.tabs {
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
padding: 8px 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.app-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.app-item {
|
||||
padding: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.app-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
`
|
||||
};
|
||||
@@ -0,0 +1,135 @@
|
||||
<!--#
|
||||
layout("/layouts/v4/baseLayout.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.section-banner {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.section-banner .banner-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.section-banner .banner-img img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
/*object-fit: cover;*/
|
||||
}
|
||||
|
||||
.section-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.home-grid {
|
||||
width: 80%;
|
||||
margin: 20px auto;
|
||||
display: grid;
|
||||
grid-template-columns: 2.2fr 0.8fr;
|
||||
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>
|
||||
|
||||
<div class="v4-container" id="v4-home-app">
|
||||
<!-- 首页banner -->
|
||||
<div class="section-banner">
|
||||
<div class="banner-img">
|
||||
<img src="${config.AppHomeImg!}" alt=""/>
|
||||
<stats></stats>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="" style="padding-bottom: 20px">
|
||||
<user></user>
|
||||
|
||||
<div class="home-grid">
|
||||
<div class="act-card">
|
||||
<act></act>
|
||||
</div>
|
||||
|
||||
<div class="entry-card">
|
||||
<entry></entry>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<jcdt :list="websiteNews.notices"></jcdt>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("act.js"){}#-->
|
||||
<!--#include("jcdt.js"){}#-->
|
||||
<!--#include("entry.js"){}#-->
|
||||
<!--#include("user.js"){}#-->
|
||||
|
||||
<!--#include("stats.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: '#v4-home-app',
|
||||
data(){
|
||||
return{
|
||||
websiteNews:{
|
||||
notices:[],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'act': act,
|
||||
'jcdt': jcdt,
|
||||
'entry': entry,
|
||||
'user': user,
|
||||
'stats': stats,
|
||||
},
|
||||
mounted() {
|
||||
this.getWebSiteNews()
|
||||
},
|
||||
methods: {
|
||||
getWebSiteNews(){
|
||||
this.$axios.post('/platform/home/getNews').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.websiteNews = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,178 @@
|
||||
const jcdt = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="jcdt-wrapper">
|
||||
<div class="jcdt-container">
|
||||
<div class="jcdt-title">
|
||||
<span>综合新闻</span>
|
||||
</div>
|
||||
<div class="jcdt-content">
|
||||
<div class="jcdt-list">
|
||||
<div class="jcdt-item" v-for="item in list" :key="item.title" @click="onLink(item)">
|
||||
<div class="date" v-if="item.date">{{item.date}}</div>
|
||||
<div style="display: flex; align-items: center">
|
||||
<div >
|
||||
<el-image style="width: 30px" src="/assets/platform/img/v4/xw.png" ></el-image>
|
||||
</div>
|
||||
<div class="title">{{item.title}}</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="image">
|
||||
<img v-if="item.image" :src="item.image" alt="">
|
||||
<img v-else src="/assets/platform/img/v4/not-image.png" alt="">
|
||||
</div>-->
|
||||
<!-- <div class="summary">{{item.summary}}</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onLink(item) {
|
||||
if(!item.url) return
|
||||
window.open(item.url)
|
||||
},
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.jcdt-wrapper {
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.jcdt-container {
|
||||
width: 80%;
|
||||
max-width: 80%;
|
||||
margin: 0 auto;
|
||||
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
margin-bottom: 10px;
|
||||
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.jcdt-title{
|
||||
font-size: 30px;
|
||||
color: #000000;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
/deep/ .jcdt-container .jcdt-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/ .jcdt-container .jcdt-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;
|
||||
}
|
||||
|
||||
.jcdt-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.jcdt-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 16px;
|
||||
border: none;
|
||||
border-bottom: 3px solid transparent;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
height: auto;
|
||||
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.jcdt-item:hover{
|
||||
background: #ffffff;
|
||||
border-bottom-color: var(--color-primary);
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.jcdt-item .date {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
margin-bottom: 8px;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.jcdt-item .title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
/*margin-bottom: 12px;*/
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
/*height: 45px;*/
|
||||
}
|
||||
|
||||
.jcdt-item .image {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
margin: 0 0 16px 0;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: #f5f5f5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.jcdt-item .image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.jcdt-item .summary {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-align: justify;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
`
|
||||
};
|
||||
@@ -0,0 +1,213 @@
|
||||
const stats = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="stats-section">
|
||||
<div class="stats-family">
|
||||
<img src="/assets/platform/img/home/family.png"/>
|
||||
</div>
|
||||
<div class="stats-grid">
|
||||
<!-- 待办 -->
|
||||
<div
|
||||
class="stat-item pending"
|
||||
@click="handleStatClick('todo')"
|
||||
@mouseenter="onMouseEnter"
|
||||
@mouseleave="onMouseLeave"
|
||||
>
|
||||
<div class="stat-icon">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-label">待办</div>
|
||||
<div class="stat-number">{{ stats.todoCount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 已办 -->
|
||||
<div
|
||||
class="stat-item completed"
|
||||
@click="handleStatClick('done')"
|
||||
@mouseenter="onMouseEnter"
|
||||
@mouseleave="onMouseLeave"
|
||||
>
|
||||
<div class="stat-icon">
|
||||
<i class="fa fa-check-circle"></i>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-label">已办</div>
|
||||
<div class="stat-number">{{ stats.doneCount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 消息 -->
|
||||
<div
|
||||
class="stat-item messages"
|
||||
@click="handleStatClick('notification')"
|
||||
@mouseenter="onMouseEnter"
|
||||
@mouseleave="onMouseLeave"
|
||||
>
|
||||
<div class="stat-icon">
|
||||
<i class="fa fa-bell"></i>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-label">消息</div>
|
||||
<div class="stat-number">{{ stats.notifications }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 发起 -->
|
||||
<div
|
||||
class="stat-item reminders"
|
||||
@click="handleStatClick('started')"
|
||||
@mouseenter="onMouseEnter"
|
||||
@mouseleave="onMouseLeave"
|
||||
>
|
||||
<div class="stat-icon">
|
||||
<i class="fa fa-file-text"></i>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<div class="stat-label">发起</div>
|
||||
<div class="stat-number">{{ stats.startedCount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
stats: {
|
||||
todoCount: 0,
|
||||
doneCount: 0,
|
||||
notifications: 0,
|
||||
startedCount: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleStatClick(type) {
|
||||
if (['todo', 'done', 'started'].includes(type)) {
|
||||
window.open('/flow/todoCenter?status=' + type)
|
||||
} else if (type === 'notification') {
|
||||
window.open('/platform/v4/msg')
|
||||
}
|
||||
},
|
||||
|
||||
onMouseEnter(event) {
|
||||
event.target.style.transform = 'translateY(-2px)';
|
||||
event.target.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)';
|
||||
},
|
||||
onMouseLeave(event) {
|
||||
event.target.style.transform = 'none';
|
||||
event.target.style.boxShadow = '0 2px 6px rgba(0,0,0,0.08)';
|
||||
},
|
||||
|
||||
loadStats() {
|
||||
this.$axios.post("/flow/todoCenter/statistics").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.stats = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadStats();
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/* 右侧统计区域 */
|
||||
.stats-section {
|
||||
/*background: white;*/
|
||||
color: #333;
|
||||
padding: 20px;
|
||||
border-radius: 12px;
|
||||
z-index: 10;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: -130px auto 0;
|
||||
/*border: 1px solid #e8e8e8;*/
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16px;
|
||||
width: 32%;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
background: #f8f9fa;
|
||||
color: #495057;
|
||||
padding: 14px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.08);
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
|
||||
.stat-icon {
|
||||
font-size: 30px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: #e6f7ff;
|
||||
color: #1890ff;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.stat-item.pending .stat-icon,
|
||||
.stat-item.completed .stat-icon,
|
||||
.stat-item.messages .stat-icon,
|
||||
.stat-item.reminders .stat-icon {
|
||||
background: #e6f7ff;
|
||||
color: #1890ff;
|
||||
}
|
||||
|
||||
.stat-item.completed .stat-icon {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
.stat-item.messages .stat-icon {
|
||||
color: #faad14;
|
||||
}
|
||||
|
||||
.stat-item.reminders .stat-icon {
|
||||
color: #13c2c2;
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 15px;
|
||||
opacity: 0.7;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.stat-number {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.stats-family {
|
||||
width: 68%;
|
||||
}
|
||||
|
||||
.stats-family img {
|
||||
height: 190px !important;
|
||||
border-radius: 30px;
|
||||
}
|
||||
`
|
||||
};
|
||||
@@ -0,0 +1,532 @@
|
||||
const user = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="user-wrapper">
|
||||
<!-- 用户容器:左右布局 -->
|
||||
<div class="user-container">
|
||||
<!-- 左侧:用户信息卡片 -->
|
||||
<div class="user-info-card">
|
||||
<div class="user-details">
|
||||
<div class="user-name">${@auth.getPrincipalProperty('username')}</div>
|
||||
|
||||
<div class="user-meta-grid">
|
||||
<div class="meta-row">
|
||||
<span class="meta-icon">🆔</span>
|
||||
<div>
|
||||
<span class="meta-label">工号</span>
|
||||
<span class="meta-value">${@auth.getPrincipalProperty('loginname')}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="meta-row">
|
||||
<span class="meta-icon">🏢</span>
|
||||
<div>
|
||||
<span class="meta-label">单位信息</span>
|
||||
<span class="meta-value">
|
||||
<!--#if(!isEmpty(@auth.getPrincipalProperty('unit'))){#-->
|
||||
${@auth.getPrincipalProperty('unit').getName()}
|
||||
<!--#}#-->
|
||||
(
|
||||
<!--#if(!isEmpty(@auth.getPrincipalProperty('union'))){#-->
|
||||
${@auth.getPrincipalProperty('union').getName()}
|
||||
<!--#}#-->
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="meta-row">
|
||||
<span class="meta-icon">🎭</span>
|
||||
<div>
|
||||
<span class="meta-label">角色</span>
|
||||
<span class="meta-value">{{ roleNames || '—' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 天气区域 -->
|
||||
<div v-if="weatherData" class="weather-section" :class="weatherData.bgClass">
|
||||
<div style="display: flex; justify-content: space-around">
|
||||
<div class="weather-header">
|
||||
<span class="weather-location">{{ weatherData.name }}</span>
|
||||
<span class="weather-text">{{ weatherData.text }}</span>
|
||||
</div>
|
||||
<div class="weather-main">
|
||||
<span class="weather-emoji">{{ weatherData.emoji }}</span>
|
||||
<span class="weather-temp">{{ weatherData.temp }}°</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="weather-tip">{{ weatherData.tip }}</div>
|
||||
</div>
|
||||
<div v-else-if="weatherError" class="weather-error">
|
||||
🌤️ 天气服务暂时不可用
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:待办中心 -->
|
||||
<div class="todo-center">
|
||||
<!-- 标题和标签 -->
|
||||
<div class="header">
|
||||
<h3>待办中心</h3>
|
||||
<el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
|
||||
<el-tab-pane label="待办事宜" name="todo"></el-tab-pane>
|
||||
<el-tab-pane label="已办事宜" name="done"></el-tab-pane>
|
||||
<el-tab-pane label="我的发起" name="started"></el-tab-pane>
|
||||
<el-tab-pane label="办结事务" name="completed"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
:data="todoList"
|
||||
style="width: 100%"
|
||||
border
|
||||
stripe
|
||||
v-loading="loading"
|
||||
:cell-style="{ padding: '8px' }"
|
||||
:header-cell-style="{ background: '#f8f9fa', color: '#444', fontWeight: '500' }"
|
||||
>
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="100px"></el-table-column>
|
||||
<el-table-column prop="categoryName" label="流程分类" width="100"></el-table-column>
|
||||
<el-table-column prop="title" label="流程名称" min-width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip effect="dark" :content="scope.row.instanceName" placement="top">
|
||||
<span class="table-title">{{ scope.row.instanceName }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sender" label="申请人" width="120">
|
||||
<template slot-scope="{row}">{{row.variable.initiatorName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="date" label="发起日期" width="120">
|
||||
<template slot-scope="{row}">
|
||||
{{$moment(row.createdAt).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="openView(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'todo',
|
||||
todoList: [],
|
||||
loading: false,
|
||||
pageForm: {
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
totalCount: 0
|
||||
},
|
||||
// 🔆 天气相关数据
|
||||
weatherData: null,
|
||||
weatherError: false,
|
||||
// 🔑 和风天气 API Key(请替换为你自己的)
|
||||
QWEATHER_KEY: 'f916578cbb0e4b55b778b0de5847ecf5', // ←← 务必替换!
|
||||
roleNames: ""
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getWeatherInfo(iconCode, temp) {
|
||||
const info = {
|
||||
emoji: '🌤️',
|
||||
tip: '今日天气宜人,心情也该放晴啦!',
|
||||
bgClass: 'weather-sunny' // 用于 CSS 类
|
||||
};
|
||||
|
||||
const tempNum = parseFloat(temp);
|
||||
const isCold = tempNum < 10;
|
||||
const isHot = tempNum > 28;
|
||||
|
||||
// 按照和风天气 iconCode 分类
|
||||
if (['100'].includes(iconCode)) {
|
||||
info.emoji = '☀️';
|
||||
info.tip = isHot ? '高温预警!注意防暑降温,多喝水~' : '阳光灿烂,适合外出走走!';
|
||||
info.bgClass = 'weather-sunny';
|
||||
} else if (['101', '102', '103', '104'].includes(iconCode)) {
|
||||
info.emoji = ['101', '103'].includes(iconCode) ? '⛅' : '☁️';
|
||||
info.tip = isCold ? '天凉加衣,别让感冒找上门!' : '云层温柔,适合静心工作。';
|
||||
info.bgClass = 'weather-cloudy';
|
||||
} else if (['300', '301', '302', '305', '306', '399'].some(code => code === iconCode)) {
|
||||
info.emoji = '🌧️';
|
||||
info.tip = '🌧️ 下雨啦!记得带伞,小心路滑~';
|
||||
info.bgClass = 'weather-rainy';
|
||||
} else if (['307', '308', '309', '310'].includes(iconCode)) {
|
||||
info.emoji = '⛈️';
|
||||
info.tip = '⛈️ 雷雨天气,请减少外出,注意安全!';
|
||||
info.bgClass = 'weather-storm';
|
||||
} else if (['400', '401', '402', '403'].includes(iconCode)) {
|
||||
info.emoji = '❄️';
|
||||
info.tip = '❄️ 天寒地冻,保暖最重要!';
|
||||
info.bgClass = 'weather-snowy';
|
||||
} else if (['404', '405', '406', '407', '408', '409', '410'].includes(iconCode)) {
|
||||
info.emoji = '🌫️';
|
||||
info.tip = '🌫️ 能见度较低,出行请注意安全。';
|
||||
info.bgClass = 'weather-foggy';
|
||||
} else if (['500', '501', '502', '504'].includes(iconCode)) {
|
||||
info.emoji = '🌀';
|
||||
info.tip = '🌀 极端天气预警!请关注官方通知。';
|
||||
info.bgClass = 'weather-extreme';
|
||||
} else {
|
||||
info.emoji = '🌤️';
|
||||
info.tip = '今日天气未知,但愿你心情晴朗!';
|
||||
info.bgClass = 'weather-default';
|
||||
}
|
||||
|
||||
return info;
|
||||
},
|
||||
async getConfigKey(key) {
|
||||
const resp = await this.$axios.post("/open/common/getConfigKey", { key })
|
||||
return resp.data
|
||||
},
|
||||
// 🔆 获取天气
|
||||
async fetchWeather() {
|
||||
try {
|
||||
// 存localStorage 112.13,32.01 广州 113.27,23.14
|
||||
const AppMapCenterPointX = await this.getConfigKey("AppMapCenterPointX")
|
||||
const AppMapCenterPointY = await this.getConfigKey("AppMapCenterPointY")
|
||||
if (!AppMapCenterPointX || !AppMapCenterPointY){
|
||||
return
|
||||
}
|
||||
|
||||
// 1. 先通过城市名获取 locationId
|
||||
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/geo/v2/city/lookup?location=" + AppMapCenterPointX + "," + AppMapCenterPointY + "&key=" + this.QWEATHER_KEY).then((geoRes) => {
|
||||
if (geoRes.code !== '200' || !geoRes.location?.[0]) {
|
||||
console.log('城市未找到')
|
||||
}
|
||||
const locationId = geoRes.location[0].id;
|
||||
|
||||
// 2. 获取当前天气
|
||||
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/v7/weather/now?location=" + locationId + "&key=" + this.QWEATHER_KEY).then((weatherRes) => {
|
||||
if (weatherRes.code !== '200') {
|
||||
console.warn('天气数据异常:', weatherRes);
|
||||
}
|
||||
const weatherInfo = this.getWeatherInfo(weatherRes.now.icon, weatherRes.now.temp);
|
||||
this.weatherData = {
|
||||
...weatherInfo,
|
||||
temp: weatherRes.now.temp,
|
||||
text: weatherRes.now.text,
|
||||
name: geoRes.location[0].name
|
||||
};
|
||||
this.weatherError = false;
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
console.warn('天气加载失败:', err);
|
||||
this.weatherError = true;
|
||||
this.weatherData = null;
|
||||
}
|
||||
},
|
||||
// 获取任务列表
|
||||
async getTasks() {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await $.post("/flow/todoCenter/" + this.activeTab, this.pageForm)
|
||||
if (res.code === 0) {
|
||||
this.todoList = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error("获取任务列表失败")
|
||||
console.error("获取任务列表失败:", error)
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
pageData() {
|
||||
this.getTasks()
|
||||
},
|
||||
handleTabClick(tab) {
|
||||
this.pageData()
|
||||
console.log('切换到:', tab.name);
|
||||
},
|
||||
// 处理任务
|
||||
async openView(task) {
|
||||
console.log(task)
|
||||
const {taskId, taskKey, taskState, instanceId, businessNo, formKey} = task
|
||||
if (!formKey) {
|
||||
this.$message.warning("当前流程没有配置地址")
|
||||
return
|
||||
}
|
||||
window.open(formKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey + "&tab=" + this.activeTab)
|
||||
},
|
||||
getRoleNames() {
|
||||
$.post("/platform/sys/role/getRoleNames").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.roleNames = res.data.roleNames
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.getRoleNames()
|
||||
},
|
||||
mounted() {
|
||||
this.fetchWeather()
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.user-wrapper {
|
||||
width: 100%;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.user-container {
|
||||
width: 80%;
|
||||
margin: 20px auto;
|
||||
display: grid;
|
||||
grid-template-columns: 0.7fr 2.3fr;
|
||||
gap: 24px;
|
||||
align-items: stretch;
|
||||
row-gap: 24px;
|
||||
}
|
||||
|
||||
.user-info-card {
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
transition: transform 0.25s ease, box-shadow 0.25s ease;
|
||||
}
|
||||
|
||||
.user-info-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 头像占位符 */
|
||||
.user-avatar-placeholder {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #409eff, #1877f2);
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 4px 10px rgba(24, 127, 255, 0.3);
|
||||
}
|
||||
|
||||
/* 用户名 */
|
||||
.user-name {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #1f2937;
|
||||
text-align: center;
|
||||
margin: 8px 0 0;
|
||||
}
|
||||
|
||||
/* 元信息网格 */
|
||||
.user-meta-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.meta-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.meta-icon {
|
||||
font-size: 18px;
|
||||
min-width: 24px;
|
||||
text-align: center;
|
||||
color: #409eff;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.meta-row > div {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.meta-label {
|
||||
font-size: 12px;
|
||||
color: #6b7280;
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.meta-value {
|
||||
font-size: 15px;
|
||||
color: #1f2937;
|
||||
font-weight: 600;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* === 天气卡片 - 情感化设计 === */
|
||||
.weather-section {
|
||||
border-radius: 16px;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
background: linear-gradient(135deg, #a8edea, #fed6e3); /* 默认柔和渐变 */
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* 不同天气的背景主题 */
|
||||
.weather-sunny {
|
||||
background: linear-gradient(135deg, #FFD700, #FFA500);
|
||||
color: #2c3e50;
|
||||
}
|
||||
.weather-cloudy {
|
||||
background: linear-gradient(135deg, #B0C4DE, #708090);
|
||||
color: white;
|
||||
}
|
||||
.weather-rainy {
|
||||
background: linear-gradient(135deg, #4A6FA5, #1E3F66);
|
||||
color: white;
|
||||
}
|
||||
.weather-storm {
|
||||
background: linear-gradient(135deg, #2F2F2F, #0D0D0D);
|
||||
color: #FFD700;
|
||||
}
|
||||
.weather-snowy {
|
||||
background: linear-gradient(135deg, #E0F7FA, #B3E5FC);
|
||||
color: #01579B;
|
||||
}
|
||||
.weather-foggy {
|
||||
background: linear-gradient(135deg, #D7CCC8, #A1887F);
|
||||
color: white;
|
||||
}
|
||||
.weather-extreme {
|
||||
background: linear-gradient(135deg, #FF5252, #B71C1C);
|
||||
color: white;
|
||||
}
|
||||
.weather-default {
|
||||
background: linear-gradient(135deg, #E0E0E0, #90A4AE);
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 天气头部:城市 + 描述 */
|
||||
.weather-header {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.weather-location {
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
display: block;
|
||||
}
|
||||
.weather-text {
|
||||
font-size: 13px;
|
||||
opacity: 0.9;
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* 主体:图标 + 温度 */
|
||||
.weather-main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
position: relative;
|
||||
bottom: 8px;
|
||||
}
|
||||
.weather-emoji {
|
||||
font-size: 36px;
|
||||
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
|
||||
}
|
||||
.weather-temp {
|
||||
font-size: 28px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
/* 贴心提示语 */
|
||||
.weather-tip {
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
opacity: 0.95;
|
||||
margin-top: 8px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
/* 错误状态 */
|
||||
.weather-error {
|
||||
text-align: center;
|
||||
color: #94a3b8;
|
||||
font-size: 14px;
|
||||
padding: 16px;
|
||||
background: #f8fafc;
|
||||
border-radius: 12px;
|
||||
border: 1px dashed #cbd5e1;
|
||||
}
|
||||
|
||||
/* 右侧待办中心 */
|
||||
.todo-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;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.header h3 {
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
border-left: 4px solid #1890ff;
|
||||
padding-left: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.el-tabs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.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%;
|
||||
}
|
||||
}
|
||||
`
|
||||
};
|
||||
Reference in New Issue
Block a user