首页
This commit is contained in:
@@ -73,6 +73,7 @@ public class ActivityCalendarController {
|
||||
applyEndTime,
|
||||
startTime,
|
||||
endTime,
|
||||
cover,
|
||||
type activityType
|
||||
FROM
|
||||
activity_tissue
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.v.nutz.web.controllers.platform.sys;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.constant.Env;
|
||||
import io.v.nutz.sys.models.Sys_menu;
|
||||
@@ -8,27 +9,28 @@ import io.v.nutz.sys.services.SysMenuService;
|
||||
import io.v.nutz.util.ShiroUtil;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.http.Http;
|
||||
import org.nutz.integration.jedis.RedisService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by wizzer on 2016/6/23.
|
||||
@@ -42,11 +44,15 @@ public class SysHomeController {
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/sys/home.html")
|
||||
@RequiresAuthentication
|
||||
public void home(HttpSession session, HttpServletRequest request) {
|
||||
@Inject
|
||||
private RedisService redisService;
|
||||
|
||||
@At("")
|
||||
@Ok("re")
|
||||
@RequiresAuthentication
|
||||
public Object home(HttpSession session, HttpServletRequest request) {
|
||||
// return "beetl:/platform/sys/home.html";
|
||||
return "beetl:/platform/sys/home/index.html";
|
||||
}
|
||||
|
||||
@At
|
||||
@@ -215,4 +221,58 @@ public class SysHomeController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public Result getNews() {
|
||||
try {
|
||||
|
||||
String url = "https://gonghui.hhu.edu.cn/";
|
||||
Document document = null;
|
||||
document = Jsoup.connect(url).get();
|
||||
Elements homeElements = document.select(".main1 .inner .mod .mr>div");
|
||||
Elements homeElements2 = document.select(".main2 .inner .mod .ml>div");
|
||||
List<Map<String, Object>> news = homeElements.stream().map(homeElement -> {
|
||||
//获取板块名称
|
||||
String name = homeElement.selectFirst("div.tt .tit span").text();
|
||||
Elements liElements = homeElements.select(".con ul.news_list li.news");
|
||||
List<NutMap> notices = liElements.stream().map(liElement -> {
|
||||
NutMap row = NutMap.NEW();
|
||||
String href = liElement.selectFirst("a").attr("href");
|
||||
String time = liElement.selectFirst("div.news_meta").text();
|
||||
String title = liElement.selectFirst("a").text();
|
||||
row.put("href", href);
|
||||
row.put("time", time);
|
||||
row.put("text", title);
|
||||
return row;
|
||||
}).collect(Collectors.toList());
|
||||
return Map.of("label", name, "value", notices);
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
List<Map<String, Object>> news2 = homeElements2.stream().map(homeElement -> {
|
||||
//获取板块名称
|
||||
String name = homeElement.selectFirst("div.tt .tit span").text();
|
||||
Elements liElements = homeElements2.select(".con ul.news_list li.news");
|
||||
List<NutMap> notices = liElements.stream().map(liElement -> {
|
||||
NutMap row = NutMap.NEW();
|
||||
String href = liElement.selectFirst("a").attr("href");
|
||||
String time = liElement.selectFirst("div.news_meta").text();
|
||||
String title = liElement.selectFirst("a").text();
|
||||
row.put("href", href);
|
||||
row.put("time", time);
|
||||
row.put("text", title);
|
||||
return row;
|
||||
}).collect(Collectors.toList());
|
||||
return Map.of("label", name, "value", notices);
|
||||
|
||||
}).collect(Collectors.toList());
|
||||
news.addAll(news2);
|
||||
redisService.setex("gonghui_news", 60 * 60 * 24, Json.toJson(news));
|
||||
return Result.success(news);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
<div>
|
||||
|
||||
<el-dialog
|
||||
title="活动二维码"
|
||||
:title="title"
|
||||
:visible.sync="codeDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="40%">
|
||||
<span></span>
|
||||
<div style="width: 100%;">
|
||||
<div id="qrcode" style="width: 70%;left: 0;right: 0;margin: auto"></div>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="codeDialogVisible = false" type="primary">关 闭</el-button>
|
||||
<!-- <el-button type="primary" @click="dwn('活动二维码')">下 载</el-button>-->
|
||||
<!-- <el-button type="primary" @click="dwn('活动二维码')">下 载</el-button>-->
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -27,6 +28,7 @@ module.exports = {
|
||||
data() {
|
||||
return {
|
||||
codeDialogVisible: false,
|
||||
title: "活动二维码",
|
||||
|
||||
}
|
||||
},
|
||||
@@ -47,7 +49,10 @@ module.exports = {
|
||||
var filename = name + '_' + (new Date()).getTime() + '.' + type;
|
||||
this.saveFile(dataurl, filename);
|
||||
},
|
||||
openCode(url) {
|
||||
openCode(url,title) {
|
||||
if (title){
|
||||
this.title=this.title+"("+title+")"
|
||||
}
|
||||
this.codeDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
$("#qrcode").html("")
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const headerNavBarVueApp = new Vue({
|
||||
window.headerNavBarVueApp = new Vue({
|
||||
el: '#headerNavbar',
|
||||
data() {
|
||||
return {
|
||||
@@ -440,7 +440,8 @@
|
||||
firstMenus: [],
|
||||
secondMenus: {},
|
||||
userDefaultModuleId: null,
|
||||
menuPopover: false
|
||||
menuPopover: false,
|
||||
appModuleId:""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -609,6 +610,7 @@
|
||||
if (selectEntranceModuleStr) {
|
||||
this.selectEntranceModule = JSON.parse(selectEntranceModuleStr)
|
||||
}
|
||||
this.appModuleId=this.selectEntranceModule.id
|
||||
await this.getEntranceModule()
|
||||
await this.getFirstMenus(this.selectEntranceModule.id)
|
||||
await this.getSecondMenus()
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
const activity = {
|
||||
template: /*language=HTML*/`
|
||||
<div class="home-activity">
|
||||
<el-card shadow="never">
|
||||
<div class="card-title" slot="header">最新活动</div>
|
||||
<div v-if="activityOptions && activityOptions.length > 0" v-for="item in activityOptions" :key="item.id">
|
||||
<div style="width: 100%">
|
||||
<div style="background-color: #fff; position: relative; margin-bottom: 10px">
|
||||
<div style="display: flex; justify-content: center; align-items: center">
|
||||
<el-image :src="CREATE_PREVIEW_URL(item.cover.id)" alt="" fit="fill"
|
||||
style="margin: 3px 14px 0 0; width: 100px; height: 70px; border-radius: 8px">
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<div style="flex: 1">
|
||||
<div style="line-height: 22px; color: #111">
|
||||
<i class="el-icon-star-on" style="color: red; font-size: 17px"></i>{{item.activityName}}
|
||||
<el-tag type="danger" v-if="moment(item.activitySignUpEndTime).valueOf()<moment().valueOf()" size="mini">报名已结束</el-tag>
|
||||
</div>
|
||||
<div style="font-size: 12px; line-height: 20px; color: #999">开始时间:{{moment(item.activitySignUpStartTime).format('YYYY-MM-DD HH:mm')}}</div>
|
||||
<div style="font-size: 12px; line-height: 20px; color: #999">结束时间:{{moment(item.activitySignUpEndTime).format('YYYY-MM-DD HH:mm')}}</div>
|
||||
</div>
|
||||
<div @click="enterActivity(item)">
|
||||
<el-tag style="cursor: pointer">查看<i class="el-icon-s-promotion"></i></el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty v-if="activityOptions.length === 0" description="暂无活动"></el-empty>
|
||||
</el-card>
|
||||
<open-qr-code :url="activityH5Url" ref="openQRCode"></open-qr-code>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
activityOptions: [],
|
||||
activityH5Url: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"open-qr-code": httpVueLoader("/components/plugins/OpenQRCode.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取品牌活动信息
|
||||
*/
|
||||
async getTrainSingUpData() {
|
||||
const {data} = await $.get(base + "/platform/trainSingUp/manage/activity/pageData", {
|
||||
pageNumber: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
return data.list
|
||||
},
|
||||
/**
|
||||
* 获取活动报名信息
|
||||
*/
|
||||
async getWyActivityData() {
|
||||
const {data} = await $.get(base + "/platform/activity/calendar/getWyData")
|
||||
return data
|
||||
},
|
||||
async getCalendarNotice() {
|
||||
/* const activityData = await this.getActivityData()
|
||||
const fitnessData = await this.getFitnessData()*/
|
||||
/*const activityWyData = await this.getWyActivityData()
|
||||
const noticeData = activityData.concat(fitnessData ? fitnessData : [])*/
|
||||
const activityWyData = await this.getTrainSingUpData()
|
||||
this.activityOptions = activityWyData
|
||||
},
|
||||
listActivity() {
|
||||
$.get("/platform/home/listHomeActivity").then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.activityOptions = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
enterActivity(item) {
|
||||
this.$refs.openQRCode.openCode("/platform/mobile/trainSignUpActivity/trainList", "该活动只支持手机端报名,请使用手机扫描二维码报名!")
|
||||
/* sublime.jumpPagePjax(item.url)
|
||||
if (item.url) {
|
||||
sublime.jumpPagePjax(item.url)
|
||||
} else if (item.url) {
|
||||
this.$refs.openQRCode.openCode(item.url, "该活动只支持手机端报名,请使用手机扫描二维码报名!")
|
||||
} else {
|
||||
this.$message.warning("该活动不支持")
|
||||
}*/
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCalendarNotice()
|
||||
// this.listActivity()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
const appModule = {
|
||||
template: `
|
||||
<div class="home-app-module">
|
||||
<el-card shadow="never">
|
||||
<div class="card-title" slot="header">平台入口</div>
|
||||
<div style="display: flex;gap: 20px;overflow-x: auto">
|
||||
<template v-for="item in entranceModules">
|
||||
<div :key="item.id" class="v-item-handle" @click="enterEntranceModules(item)"
|
||||
:class="item.id===id?'appModuleCard':''">
|
||||
<el-image :src="CREATE_PREVIEW_URL(item.icon[0].id)" style="height: 50px;width: 50px;border-radius: 50%"></el-image>
|
||||
<span class="v-item-handle-label">
|
||||
{{ item.moduleName }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
id: "",
|
||||
entranceModules: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async enterEntranceModules(item) {
|
||||
headerNavBarVueApp.appModuleId = item.id
|
||||
this.id = item.id
|
||||
headerNavBarVueApp.enterEntranceModules(item)
|
||||
},
|
||||
async getEntranceModule() {
|
||||
const resp = await $.get('/platform/sys/entranceModule/getEntranceModule')
|
||||
if (resp.code === 0) {
|
||||
this.entranceModules = resp.data
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getEntranceModule()
|
||||
setTimeout(() => {
|
||||
this.id = headerNavBarVueApp.appModuleId
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,394 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<!--公共css-->
|
||||
<style>
|
||||
.el-card {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.image-slot {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f5f7fa;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.el-icon-picture-outline {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.ele-body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--个人信息css-->
|
||||
<style>
|
||||
.home-user-info .el-card {
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.home-user-info .info {
|
||||
line-height: 40px;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--待办css-->
|
||||
<style>
|
||||
.home-todo{
|
||||
background: #ffffff;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.home-todo .el-tabs {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.home-todo .el-tabs__content {
|
||||
height: calc(100% - 55px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.el-table__header,.el-table__body {
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!--快速入口css-->
|
||||
<style>
|
||||
.home-quick-entry .el-card {
|
||||
width: 100%;
|
||||
}
|
||||
.home-quick-entry .el-card .el-card__body{
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
height: calc(100% - 53.5px);
|
||||
}
|
||||
|
||||
|
||||
.home-quick-entry .quickEntries {
|
||||
overflow-y: auto;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
||||
gap: 50px;
|
||||
}
|
||||
|
||||
.home-quick-entry .quickEntries .quickEntryItem img {
|
||||
max-width: 50px;
|
||||
}
|
||||
|
||||
.home-quick-entry .quickEntries .quickEntryItem {
|
||||
border-radius: 10px;
|
||||
font-size: 27px;
|
||||
height: 90px;
|
||||
max-height: 90px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
transition: transform 0.3s ease-in-out,
|
||||
box-shadow 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.home-quick-entry .quickEntries .quickEntryItem span {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.home-quick-entry .quickEntries .quickEntryItem:hover {
|
||||
cursor: pointer;
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.home-quick-entry .quickEntries .quickEntryItem:hover {
|
||||
animation: shake 0.3s;
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
0% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
25% {
|
||||
transform: translateX(-5px);
|
||||
}
|
||||
50% {
|
||||
transform: translateX(5px);
|
||||
}
|
||||
75% {
|
||||
transform: translateX(-5px);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--活动css-->
|
||||
<style>
|
||||
.home-activity{
|
||||
min-width: 500px;
|
||||
}
|
||||
.home-activity .el-card {
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.home-activity .el-empty {
|
||||
padding: 40px 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--平台入口css-->
|
||||
<style>
|
||||
.home-app-module .el-card {
|
||||
width: 100%;
|
||||
}
|
||||
.home-app-module .el-card .el-card__body{
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
height: calc(100% - 53.5px);
|
||||
}
|
||||
|
||||
.v-item-handle {
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
border: 1px solid #f3efef;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
transition: all 500ms;
|
||||
color: #0779e4;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.v-item-handle-label {
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.v-item-handle .el-image {
|
||||
transition: width 0.3s ease,
|
||||
height 0.3s ease;
|
||||
transform-origin: center; /* 缩放的中心点 */
|
||||
}
|
||||
|
||||
.v-item-handle:hover .el-image {
|
||||
width: 60px !important;
|
||||
height: 60px !important;
|
||||
}
|
||||
|
||||
.v-item-handle:hover .fa {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.v-item-handle span {
|
||||
transition: all 500ms;
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
}
|
||||
.appModuleCard {
|
||||
border: 3px solid #409EFF;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--工会新闻css-->
|
||||
<style>
|
||||
.home-news {
|
||||
background: #ffffff;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.home-news .el-tabs {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.home-news .el-tabs__content {
|
||||
height: calc(100% - 55px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.home-news .el-tab-pane {
|
||||
line-height: 38px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.home-news .el-tab-pane .news_time {
|
||||
color: white;
|
||||
padding: 4px 10px;
|
||||
border-radius: 10px;
|
||||
background: #1867b0;
|
||||
}
|
||||
|
||||
.home-news .el-tab-pane div {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.home-news .el-tab-pane .news_text:hover {
|
||||
color: #1867b0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.el-card__header {
|
||||
padding: 15px 20px !important;
|
||||
}
|
||||
.layout-grid-container{
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(100px, 1fr));
|
||||
grid-template-rows: 220px 255px auto;
|
||||
gap: 10px;
|
||||
width: calc(100% - 20px);
|
||||
height: calc(100% - 20px);
|
||||
margin: 10px auto;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.layout-grid-container .grid-item {
|
||||
color: white;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.appModule-grid {
|
||||
grid-column: 1 / 3; /* 元素1占据第1和第2列 */
|
||||
grid-row: 1 / 2; /* 元素1占据第1行 */
|
||||
}
|
||||
|
||||
.activity-grid {
|
||||
grid-column: 3 / 4; /* 元素2占据第3列 */
|
||||
grid-row: 1 / 3; /* 元素2跨越第1和第2行 */
|
||||
}
|
||||
|
||||
.quickEntry-grid {
|
||||
grid-column: 1 / 3; /* 元素3占据第1和第2列 */
|
||||
grid-row: 2 / 3; /* 元素3占据第2行 */
|
||||
}
|
||||
|
||||
.news-grid,
|
||||
.todo-grid,
|
||||
.user-grid {
|
||||
grid-column: span 1; /* 每个元素占据1列 */
|
||||
grid-row: 3 / 4; /* 所有元素都在第3行 */
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div class="layout-grid-container">
|
||||
<app-module class="appModule-grid grid-item"></app-module>
|
||||
<quick-entry class="quickEntry-grid grid-item"></quick-entry>
|
||||
<activity class="activity-grid grid-item"></activity>
|
||||
<news class="news-grid grid-item"></news>
|
||||
<todo class="todo-grid grid-item"></todo>
|
||||
<user-info class="user-grid grid-item"></user-info>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <el-row type="flex" class="p10" style="column-gap: 10px;height: 100%">-->
|
||||
<!-- <el-col :span="16">-->
|
||||
<!-- <app-module class="appModule mb10"></app-module>-->
|
||||
<!-- <quick-entry class="quickEntry mb10"></quick-entry>-->
|
||||
<!-- <el-row :gutter="10">-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <news></news>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <todo></todo>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <activity class="mb10"></activity>-->
|
||||
<!-- <user-info></user-info>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("userInfo.js"){}#-->
|
||||
<!--#include("todo.js"){}#-->
|
||||
<!--#include("quickEntry.js"){}#-->
|
||||
<!--#include("activity.js"){}#-->
|
||||
<!--#include("appModule.js"){}#-->
|
||||
<!--#include("news.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
components: {
|
||||
"user-info": userInfo,
|
||||
todo,
|
||||
"quick-entry": quickEntry,
|
||||
activity,
|
||||
"app-module": appModule,
|
||||
news: news
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
quickEntries: [],
|
||||
activityOptions: [],
|
||||
processInstanceOptions: [],
|
||||
|
||||
icon: "alipay"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listQuickEntry() {
|
||||
$.post("/platform/home/listQuickEntry").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.quickEntries = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
listActivity() {
|
||||
$.post("/platform/h5/listHomeActivity").then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.activityOptions = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
enterActivity(item) {
|
||||
// this.$store.dispatch("pjaxRoute", item.url)
|
||||
},
|
||||
|
||||
//查询流程实例
|
||||
listProcessInstance() {
|
||||
$.post("/platform/wf/processInstance/page", {
|
||||
pageNumber: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.processInstanceOptions = resp.data.list
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
||||
<!--# } #-->
|
||||
@@ -0,0 +1,39 @@
|
||||
const news = {
|
||||
template: `
|
||||
<div class="home-news">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane v-for="(item,index) in newsData" :key="index" :label="item.label" :name="item.label" v-if="item.value.length > 0">
|
||||
<div v-for="(n,i) in item.value" :key="i" @click="openUrl(n.href)">
|
||||
<span v-if="n.time" class="news_time">{{ n.time }}</span>
|
||||
<span class="news_text">{{ n.text }}</span>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
newsData: [],
|
||||
activeName: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getNews() {
|
||||
const resp = await $.post("/platform/home/getNews")
|
||||
if (resp.data.length > 0) {
|
||||
this.activeName = resp.data[0].label
|
||||
}
|
||||
this.newsData = resp.data
|
||||
},
|
||||
openUrl(href) {
|
||||
const url = this.isHttpOrHttps(href) ? href : "https://gonghui.hhu.edu.cn/" + href
|
||||
window.open(url)
|
||||
},
|
||||
isHttpOrHttps(url) {
|
||||
return /^(http:\/\/|https:\/\/)/i.test(url)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getNews()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
const quickEntry = {
|
||||
template: `
|
||||
<div class="home-quick-entry">
|
||||
<el-card shadow="never">
|
||||
<div class="card-title" slot="header">快速入口</div>
|
||||
<div class="quickEntries">
|
||||
<div v-for="item in quickEntries" :key="item.id" @click="menuClick(item)" class="quickEntryItem"
|
||||
:style="'background-color: '+item.color">
|
||||
<el-image :src="item.imgUrl" alt="" >
|
||||
<div class="image-slot" slot="error">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span style="color: white; font-size: 16px">{{item.label}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
quickEntries: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listQuickEntry() {
|
||||
|
||||
$.get("/platfotm/agenda/getQuickentry").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.quickEntries = res.data
|
||||
}
|
||||
})
|
||||
/*$.get("/platform/quickEntry/getQuickentry").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.quickEntries = res.data
|
||||
}
|
||||
})*/
|
||||
},
|
||||
menuClick(item) {
|
||||
sublime.jumpPagePjax(item.url)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.listQuickEntry()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
const todo = {
|
||||
template: `
|
||||
<div class="home-todo">
|
||||
<el-tabs v-model="todoActive " @tab-click="handleClick">
|
||||
<el-tab-pane label="待处理" name="1">
|
||||
<el-table :data="todoList" v-loading="todoLoading">
|
||||
<el-table-column label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column label="标题" prop="processName" show-overflow-tooltip
|
||||
width="200"></el-table-column>
|
||||
<el-table-column label="发起人" prop="createdByUserName"
|
||||
width="140"></el-table-column>
|
||||
<el-table-column label="发起时间" prop="createdOn" v-if="todoActive==='3'"
|
||||
width="150"></el-table-column>
|
||||
<el-table-column label="我的处理环节" prop="taskNodeName"
|
||||
v-if="todoActive!=='3'"></el-table-column>
|
||||
<el-table-column label="流程流转环节" prop="nodeName"></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template scope="{row}">
|
||||
<el-button @click="sublime.jumpPagePjax(row.formUrl)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已处理" name="2">
|
||||
<el-table :data="todoList" v-loading="todoLoading">
|
||||
<el-table-column label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column label="标题" prop="processName" show-overflow-tooltip
|
||||
width="200"></el-table-column>
|
||||
<el-table-column label="发起人" prop="createdByUserName"
|
||||
width="140"></el-table-column>
|
||||
<el-table-column label="发起时间" prop="createdOn" v-if="todoActive==='3'"
|
||||
width="150"></el-table-column>
|
||||
<el-table-column label="我的处理环节" prop="taskNodeName"
|
||||
v-if="todoActive!=='3'"></el-table-column>
|
||||
<el-table-column label="流程流转环节" prop="nodeName"></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template scope="{row}">
|
||||
<el-button @click="sublime.jumpPagePjax(row.formUrl)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="我的发起" name="3">
|
||||
<el-table :data="todoList" v-loading="todoLoading">
|
||||
<el-table-column label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column label="标题" prop="processName" show-overflow-tooltip
|
||||
width="200"></el-table-column>
|
||||
<el-table-column label="发起人" prop="createdByUserName"
|
||||
width="140"></el-table-column>
|
||||
<el-table-column label="发起时间" prop="createdOn" v-if="todoActive==='3'"
|
||||
width="150"></el-table-column>
|
||||
<el-table-column label="我的处理环节" prop="taskNodeName"
|
||||
v-if="todoActive!=='3'"></el-table-column>
|
||||
<el-table-column label="流程流转环节" prop="nodeName"></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template scope="{row}">
|
||||
<el-button @click="sublime.jumpPagePjax(row.formUrl)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- <el-table :data="todoList" style="min-height: 250px" v-loading="todoLoading">-->
|
||||
<!-- <el-table-column label="序号" type="index" width="70"></el-table-column>-->
|
||||
<!-- <el-table-column label="标题" prop="processName" show-overflow-tooltip-->
|
||||
<!-- width="200"></el-table-column>-->
|
||||
<!-- <el-table-column label="发起人" prop="createdByUserName"-->
|
||||
<!-- width="140"></el-table-column>-->
|
||||
<!-- <el-table-column label="发起时间" prop="createdOn" v-if="todoActive==='3'"-->
|
||||
<!-- width="150"></el-table-column>-->
|
||||
<!-- <el-table-column label="我的处理环节" prop="taskNodeName"-->
|
||||
<!-- v-if="todoActive!=='3'"></el-table-column>-->
|
||||
<!-- <el-table-column label="流程流转环节" prop="nodeName"></el-table-column>-->
|
||||
<!-- <el-table-column label="操作" width="100">-->
|
||||
<!-- <template scope="{row}">-->
|
||||
<!-- <el-button @click="sublime.jumpPagePjax(row.formUrl)" size="mini" type="primary">查看</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
</div>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
todoActive: "1",
|
||||
todoList:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async handleClick() {
|
||||
this.todoLoading = true
|
||||
/* const {data, code} = await $.get("/platform/sys/localProcess/todoList", { mode: this.todoActive })
|
||||
this.todoList = data*/
|
||||
this.todoLoading = false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.handleClick()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
const userInfo = {
|
||||
template: `
|
||||
<div class="home-user-info">
|
||||
<el-card shadow="never">
|
||||
<div class="card-title" slot="header">个人信息</div>
|
||||
<div class="info">
|
||||
<div>👨🏫我的姓名:${@shiro.getPrincipalProperty('username')}</div>
|
||||
<div>🆔我的工号:${@shiro.getPrincipalProperty('loginname')}</div>
|
||||
<div>⭕我的性别:${@shiro.getPrincipalProperty('sex')}</div>
|
||||
<div>🟢我的单位:${@shiro.getPrincipalProperty('unit').getName()}</div>
|
||||
<div>🟤我的工会:${@shiro.getPrincipalProperty('union').getUnionname()}</div>
|
||||
<div>📕系统角色:
|
||||
<!--#for(role in @shiro.getPrincipalProperty('roles')){#-->
|
||||
<span style="font-size: 14px;color: #666;">${@role.getName()}</span>
|
||||
<!--#}#-->
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="signatureDialogVisible" title="我的签字" width="35%">
|
||||
<!-- <div class="flx">-->
|
||||
<!-- <div v-if="!showSignature" class="p10">-->
|
||||
<!-- <el-image style="width: 100%;border: 1px dashed #000" :src="userSignatureUrl" v-if="userSignatureUrl">-->
|
||||
<!-- <template slot="error">获取签名失败</template>-->
|
||||
<!-- </el-image>-->
|
||||
<!-- <el-empty v-else description="暂无签名"></el-empty>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="flx-center-center" style="flex-direction: column;">-->
|
||||
<!-- <qrcode :options="{ width: 126 }" :value="signatureAddress" class="signature-qrcode"></qrcode>-->
|
||||
<!-- <el-button icon="el-icon-refresh" size="small" type="primary" @click="getUserSignature(true)">刷新</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-alert title="扫描二维码可重新签名,手机上签名成功后可点击刷新查看。" type="success"></el-alert>-->
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
showSignature: false,
|
||||
userSignatureUrl: null,
|
||||
signatureDialogVisible: false,
|
||||
signatureAddress: window.location.origin + "/platform/signature/scanPcCode?origin=user",
|
||||
memberInfoDialogVisible:false
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
openSignature() {
|
||||
this.signatureDialogVisible = true
|
||||
this.getUserSignature()
|
||||
},
|
||||
getUserSignature(isRefresh = false) {
|
||||
$.post("/platform/signature/get").then((res) => {
|
||||
if (res.code === 0) {
|
||||
if (isRefresh) {
|
||||
this.$message.success("刷新成功")
|
||||
} else {
|
||||
if (!res.data.signature) {
|
||||
this.$message.warning("未获取到签字信息")
|
||||
}
|
||||
}
|
||||
this.userSignatureUrl = res.data.signature
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user