Files
UNION_HUTB/target/classes/views/platform/sys/home.html
T
2026-09-09 09:14:28 +08:00

760 lines
30 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
background-color: rgb(245, 245, 245);
padding: 10px;
}
.el-col {
position: relative;
}
.header-welcome {
height: auto;
width: 100%;
}
.header-item {
line-height: 20px;
background-color: white;
border-radius: 7px;
padding: 10px 15px 0;
position: relative;
transition: all 500ms;
cursor: pointer;
margin-top: 25px;
box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
}
.header-item-title {
text-align: center;
font-size: 14px;
font-weight: bold;
}
.header-item-num {
height: 60px;
line-height: 70px;
font-size: 28px;
color: #409EFF
}
.header-item-label {
height: 40px;
line-height: 40px;
font-size: 14px;
color: rgb(180, 180, 180);
width: 100%;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.header-item:hover {
box-shadow: 0 0 20px rgb(220, 220, 220);
}
.header-item-icon {
position: absolute;
height: 60px;
width: 60px;
display: flex;
justify-content: center;
align-items: center;
right: 10px;
top: 0;
bottom: 0;
margin: auto;
}
.header-item-icon .fa {
font-size: 46px;
color: #409EFF;
}
.v-header .el-col {
margin-bottom: 15px;
}
.v-item {
border-radius: 7px;
background-color: white;
min-height: 100%;
padding: 0 15px;
}
.v-item-title {
width: 100%;
height: 50px;
line-height: 50px;
font-size: 14px;
color: rgb(120, 120, 120);
}
.v-item-col {
display: flex;
justify-content: center;
align-items: center;
height: 140px;
}
.v-item-handle {
width: 120px;
height: 120px;
background-color: rgb(248, 248, 248);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
transition: all 500ms;
color: #0779e4;
cursor: pointer;
border-radius: 5px;
}
.v-item-handle .fa {
font-size: 66px;
color: #0779e4;
transition: all 500ms;
}
.v-item-handle-label {
font-size: 14px;
margin-top: 5px;
}
.v-item-handle:hover {
transform: scale(1.1);
box-shadow: 0 0 20px rgb(220, 220, 220);
}
/*.v-item-handle:hover .fa {
color: white !important;
}*/
.v-item-handle span {
transition: all 500ms;
}
/*.v-item-handle:hover span {
color: white !important;
}*/
.el-carousel__button {
background-color: #c8c8cc !important;
opacity: .24;
}
.user-info-label {
font-size: 14px;
height: 50px;
line-height: 50px;
color: rgb(120, 120, 120);
}
.user-info-val {
font-size: 14px;
height: 50px;
line-height: 50px;
color: #409EFF;
}
.el-calendar-table .current {
height: 5px !important;
}
#calendar .el-calendar-table .el-calendar-day {
-webkit-box-sizing: border-box;
box-sizing: border-box;
height: calc(((1080px - 100vh) / 1080) * 40 + 45px);
border-radius: 50%;
}
.el-calendar__body {
padding: 0;
}
.el-calendar__header {
display: -webkit-box;
display: -ms-flexbox;
display: none;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
padding: 12px 20px;
border-bottom: 1px solid #EBEEF5;
}
#bgrl .el-calendar-table .current {
height: 120px !important;
}
.none {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column
}
.none .none_title {
margin-top: -40px;
font-size: 14px;
color: rgb(160, 160, 160);
}
.avatar {
position: absolute;
right: 9.55vw;
top: 70px;
width: 6vw;
height: 6vw;
}
</style>
<div id="app" v-cloak>
<transition name="el-zoom-in-center">
<div v-show="v=='index'" style="width: 100%;">
<!-- <el-row :gutter="15" class="v-header">-->
<!-- <el-col :span="24">-->
<!-- <div class="header-welcome">-->
<!-- <img src="/nuaa_logo.gif" width="100%" height="100%">-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row :gutter="15" type="flex" style=" align-items: stretch; ">
<el-col :span="16">
<div class="v-item">
<div class="v-item-title">快速入口</div>
<el-carousel v-if="handleItems.length" :autoplay="false" :height="handleHeight">
<el-carousel-item v-for="index in Math.ceil(handleItems.length/12)" :key="index">
<el-row style="padding: 0" id="handle">
<el-col v-for="v in handleItems.slice((index-1)*12,index*12)" :sm="{span:8}"
:md="{span:8}"
:lg="{span:6}"
:xl="{span:4}"
class="v-item-col">
<div class="v-item-handle" @click="JumpPjaxUrl(v.href)">
<img :src="CREATE_PREVIEW_URL(v.iconClass)" style="width: 80px; height: 70px"/>
<span class="v-item-handle-label"
:style="'color: '+v.color"
>{{ v.name }}</span>
</div>
</el-col>
</el-row>
</el-carousel-item>
</el-carousel>
<div class="none" v-else>
<img class="none_img" src="/none.png">
<div class="none_title">暂无快速入口</div>
</div>
</div>
</el-col>
<el-col :span="9">
<div class="v-item" id="calendar">
<el-tabs v-model="activityAndRl" @tab-click="handleClick">
<el-tab-pane label="日历" name="rl">
<el-calendar>
<template slot="dateCell" slot-scope="{date, data}">
<p :class="data.isSelected ? 'is-selected' : ''" @click="v = 'calendar'">
{{ data.day.split('-').slice(1)[1] }}
<br/>
<span style="display: flex;justify-content: center">
<i v-for="item in noticeData"
v-if="data.day.toString()==moment(item.startTime).format('YYYY-MM-DD')"
style="color: #20A0FF;margin-right: 5px"
class="fa fa-dot-circle-o"></i>
</span>
</p>
</template>
</el-calendar>
</el-tab-pane>
<!--<el-tab-pane label="最新消息通知" name="xl">
<div style="text-align: right">
<el-radio-group v-model="pageForm.ywd" size="mini" @change="pageData">
<el-radio-button label="read">已读</el-radio-button>
<el-radio-button label="unread">未读</el-radio-button>
</el-radio-group>
</div>
<el-table :data="activityTableData" style="width: 100%;" v-loading="tableLoading"
size="mini">
<el-table-column prop="note" label="活动名称">
<template slot-scope="scope">
<el-link type="primary" @click="isYy(scope.row)">
{{scope.row.note}}
</el-link>
</template>
</el-table-column>
<el-table-column prop="activitytime" label="活动时间"></el-table-column>
<el-table-column prop="cz" label="操作" width="80px">
<template slot-scope="scope">
<el-button
v-if="!scope.row.status"
size="mini"
type="primary"
@click="isYy(scope.row)">查看
</el-button>
<el-button
v-else
size="mini"
type="primary"
@click="clickXlUrl(scope.row.url)">查看
</el-button>
</template>
</el-table-column>
</el-table>
<div class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</div>
</el-tab-pane>-->
</el-tabs>
</div>
</el-col>
</el-row>
<el-row :gutter="15" type="flex" style=" align-items: stretch;margin-top: 15px ">
<el-col :span="16">
<div class="v-item">
<div class="v-item-title">待办事项</div>
<el-carousel v-if="needItems.length" :autoplay="false" :height="needHeight">
<el-carousel-item v-for="index in Math.ceil(needItems.length/12)" :key="index">
<el-row style="padding:0 10px" id="need">
<el-col style="padding: 0 12px"
v-for="item in needItems.slice((index-1)*12,index*12)"
:xs="{span:12}" :sm="{span:12}" :md="{span:12}" :lg="{span:6}"
:xl="{span:6}">
<div class="header-item" @click="JumpPjaxUrl(item.href)">
<div class="header-item-title">【{{ item.title }}】</div>
<div class="header-item-num">{{ item.count }}</div>
<div class="header-item-label">{{ item.name }}</div>
<div class="header-item-icon">
<img :src="CREATE_PREVIEW_URL(item.iconClass)" style="width: 60px; height: 60px"/>
</div>
</div>
</el-col>
</el-row>
</el-carousel-item>
</el-carousel>
<div class="none" v-else>
<img class="none_img" src="/none.png">
<div class="none_title">暂无待办事项</div>
</div>
</div>
</el-col>
<el-col :span="9">
<div class="v-item" style="padding-bottom: 15px;">
<div class="v-item-title">个人信息</div>
<div style="height: 40px;line-height: 40px;font-weight: bolder;color: #409EFF;font-size: 16px;margin-top: 40px">
<span>${@shiro.getPrincipalProperty('username')}${@shiro.getPrincipalProperty('sex')}</span>
</div>
<div style="height: 40px;line-height: 30px;color: rgb(180,180,180)">
<span>
<!--#if(@shiro.getPrincipalProperty('unit')!=null){#-->
${@shiro.getPrincipalProperty('unit').getName()}
<!--#}else{#-->
暂无单位信息
<!--#}#-->
</span>
</div>
<el-image
class="avatar"
:src="avatar"
fit="cover">
<div slot="error" class="image-slot" style="width: 100%;height: 100%">
<div class="el-image__error">暂无照片</div>
</div>
</el-image>
<!-- <el-avatar shape="circle " :size="100" fit="cover" :src="avatar"></el-avatar>-->
<el-row style="margin-top: 60px">
<el-col :span="12">
<span class="user-info-label">&emsp;&emsp;号:</span>
<span class="user-info-val">${@shiro.getPrincipalProperty('loginname')}</span>
</el-col>
<el-col :span="12">
<span class="user-info-label">&emsp;&emsp;会:</span>
<span class="user-info-val"
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
<!--#if(@shiro.getPrincipalProperty('union')!=null){#-->
${@shiro.getPrincipalProperty('union').getUnionname()}
<!--#}#-->
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<span class="user-info-label">联系电话:</span>
<span class="user-info-val">${@shiro.getPrincipalProperty('mobile')}</span>
</el-col>
<el-col :span="12">
<span class="user-info-label">&emsp;&emsp;务:</span>
<span class="user-info-val">
<span class="user-info-val">${@shiro.getPrincipalProperty('position')}</span>
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<span class="user-info-label">在职状态:</span>
<span class="user-info-val">${@shiro.getPrincipalProperty('userState')}</span>
</el-col>
<el-col :span="12">
<span class="user-info-label">&emsp;&emsp;族:</span>
<span class="user-info-val">
<span class="user-info-val">${@shiro.getPrincipalProperty('nation')}</span>
</span>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<span class="user-info-label">用户身份:</span>
<span class="user-info-val" style="color: #f56c6c">
<!--#
for(role in @shiro.getPrincipalProperty('roles')){
#-->
${@role.getName()}
<!--#
}
#-->
</span>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
<el-row :gutter="15" style="margin-top: 15px" style=" align-items: stretch; ">
</el-row>
</div>
</transition>
<transition name="el-zoom-in-center">
<div v-show="v=='calendar'" class="transition-item transition-item2">
<el-card class="box-card v-box guava-card" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'" style="font-size: 16px">返回
</el-button>
</div>
<div id="bgrl">
<el-calendar>
<template slot="dateCell" slot-scope="{date, data}">
<p :class="data.isSelected ? 'is-selected' : ''">
{{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : ''}}
</p>
<div v-for="item in noticeData">
<div v-if="data.day.toString()==moment(item.startTime).format('YYYY-MM-DD')">
<el-link
v-if="item.activityType===40001||item.activityType===40002||item.activityType===40003"
style="font-size: 8px" type="primary" target="_blank" @click="doLink(item)">
{{item.name}}
</el-link>
<el-link v-if="item.type===1" style="font-size: 8px" type="primary"
target="_blank"
@click="doLink(item)">
{{item.name}}
</el-link>
<el-link v-if="item.type===2" style="font-size: 8px" type="primary"
target="_blank"
@click="doLink(item)">
{{item.name}}
</el-link>
</div>
</div>
</template>
</el-calendar>
</div>
</el-card>
</div>
</transition>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
tableLoading: true,
pageForm: {
ywd: "unread",
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 5,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
activityTableData: [],
activityAndRl: "rl",
noticeData: [],
noticeKey: new Date().getTime(),
avatar: "/avatar_boy.png",
colors: ['#409EFF', '#67C23A', '#E6A23C', '#F56C6C', '#00a2ae', '#7265e6', '#ffbf00', '#00a854'],
handleItems: [],
needItems: [],
handleHeight: '350px',
needHeight: '420px',
v: "index",
day: "",
}
},
methods: {
async pageData() {
sublime.showLoadingbar();
this.tableLoading = true
const data = await $.post("/platform/sys/msg/user/data/" + this.pageForm.ywd, this.pageForm)
sublime.closeLoadingbar();//关闭loading
if (data.code === 0) {
this.activityTableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
this.tableLoading = false
},
pageNumberChange(val) {
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {
this.pageForm.pageSize = val;
this.pageData();
},
async isYy(row) {
let ids = []
ids.push(row.id)
const resp = await $.get("/platform/sys/msg/user/status/read", {ids: JSON.stringify(ids)})
this.clickXlUrl(row.url)
},
clickXlUrl(url) {
if (url) {
if (url === "/platform/evaluate/apply") {
sublime.jumpPagePjax(url)
} else if ("${@shiro.hasRole('H04')}" === 'true' || "${@shiro.hasRole('sysadmin')}" === 'true' || "${@shiro.hasRole('H10')}" === 'true') {
sublime.jumpPagePjax(url)
} else {
if ("${@shiro.hasRole('club01')}" === 'true' && url === "/platform/activity/info/mange/club") {
sublime.jumpPagePjax(url)
} else {
this.pageData();
this.$notify({
title: '警告',
message: '您已阅读,如需报名请前往手机端智慧工会!!',
type: 'warning'
});
}
}
} else {
this.pageData();
this.$notify({
title: '警告',
message: '您已阅读,如需报名请前往手机端智慧工会!!',
type: 'warning'
});
}
},
handleClick(val) {
this.pageData();
},
doLink(item) {
if (item.activityType) {
this.$notify.warning('如需报名请前往手机端智慧工会')
}
if (item.type === 1) {
if ("${@shiro.hasRole('H04')}" === 'false' && "${@shiro.hasRole('sysadmin')}" === 'false' && item.applyWay.includes("1")) {
this.$notify.warning('如需报名请前往手机端智慧工会')
} else {
if ("${@shiro.hasRole('H04')}" === 'true' || "${@shiro.hasRole('sysadmin')}" === 'true') {
this.JumpPjaxUrl('/platform/activity/apply')
} else {
this.$notify.warning('当前活动不支持个人报名,如需报名请联系分工会管理员!')
}
}
}
if (item.type === 2) {
this.$notify.warning('如需报名请前往健身走小程序')
}
},
setSize() {
this.$nextTick(() => {
this.handleHeight = $('#handle').height() + 50 + 'px';
this.needHeight = $('#need').height() + 50 + 'px';
})
},
/**
* 获取日历信息
*/
/*async getCalendarNotice() {
const activityData = await this.getActivityData()
const fitnessData = await this.getFitnessData()
const activityWyData = await this.getWyActivityData()
const noticeData = activityData.concat(fitnessData ? fitnessData : [])
this.noticeData = noticeData.concat(activityWyData)
},*/
/**
* 获取校级活动报名信息
*/
async getActivityData() {
const {data} = await $.get(base + "/platform/activity/calendar/getData")
if (data && data.length > 0) {
data.forEach(v => {
v.type = 1
})
}
return data
},
/**
* 获取活动报名信息
*/
async getWyActivityData() {
const {data} = await $.get(base + "/platform/activity/calendar/getWyData")
return data
},
/**
* 获取健身走活动报名信息
*/
async getFitnessData() {
const {data} = await $.get("/platform/jsz/hdMange/getFitnessData")
if (data && data.length > 0) {
data.forEach(v => {
v.startTime = v.start_time
v.type = 2
})
}
return data
},
/**
* 快速入口
* @returns {Promise<void>}
*/
async getQuickentry() {
const {data, code} = await $.get("/platform/quickEntry/getQuickentry")
if (code == 0) {
this.handleItems = data;
this.setSize()
}
},
async findMaxParenMenuId(menu) {
const resp = await $.get('/platform/sys/entranceModule/getFirstMenus')
if (resp.code !== 0) return
if (!menu.path) return null
const parentMenuPath = menu.path.substr(0, 4)
const firstMenus = resp.data
const parentMenu = firstMenus.find(v => v.path === parentMenuPath)
if (parentMenu) {
return parentMenu.id
}
return null
},
async getNeedItems() {
const { data, code } = await $.get('/platform/needItems/getNeedItems')
if (code === 0) {
this.needItems = data
this.setSize()
}
},
async JumpPjaxUrl(url) {
const secondMenus = headerNavBarVueApp.secondMenus
const allMenus = Object.values(secondMenus).reduce((a, b) => a.concat(b))
const jumpMenu = allMenus.find(v => v.href === url)
//找出在哪一个模块当中
const entranceModules = headerNavBarVueApp.entranceModules
//找到这个菜单的一级父亲菜单
const maxParenMenuId = await this.findMaxParenMenuId(jumpMenu)
const module = entranceModules.find(v => v.containsMenu.includes(maxParenMenuId))
if (module) {
headerNavBarVueApp.selectEntranceModule = module
const resp = await $.get('/platform/sys/entranceModule/getFirstMenus', {entranceModuleId:module.id})
if (resp.code === 0) {
headerNavBarVueApp.firstMenus = resp.data
headerNavBarVueApp.setAttr(()=>{
sublime.jumpPagePjax(url)
})
}
/*setTimeout(()=>{
sublime.jumpPagePjax(url)
},0)*/
} else {
$.pjax({
url: url,
container: '#container',
fragment: '#container',
timeout: 8000
});
}
}
},
beforeMount() {
window.addEventListener('resize', () => {
// this.setSize()
}, false);
},
mounted() {
this.setSize()
const userAvatar = "${@shiro.getPrincipalProperty('avatar')}"
const sex = "${@shiro.getPrincipalProperty('sex')}"
if (userAvatar) {
this.avatar = APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS +'?id=' + "${@shiro.getPrincipalProperty('avatar')}"
} else {
this.avatar = sex === '女' ? '/avatar_girl.png' : '/avatar_boy.png'
}
},
async created() {
await this.getQuickentry()
await this.getNeedItems()
//await this.getCalendarNotice()
this.pageData()
}
})
</script>
<!--# } #-->