This commit is contained in:
Paidax
2024-11-25 15:00:16 +08:00
parent c8d75e0b61
commit 4fe13156ef
11 changed files with 1441 additions and 475 deletions
@@ -0,0 +1,44 @@
package io.v.nutz.sys.controllers.platform.sys;
import javax.net.ssl.*;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
public class SSLContextTrustAnyHostname {
public static void trustAllHosts() {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
};
SSLContext sc = null;
try {
sc = SSLContext.getInstance("SSL");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
try {
sc.init(null, trustAllCerts, new SecureRandom());
} catch (KeyManagementException e) {
e.printStackTrace();
}
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
// Create all-trusting host name verifier
HostnameVerifier allHostsValid = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
}
}
@@ -4,26 +4,41 @@ import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.enums.Env; import io.v.nutz.base.enums.Env;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.sys.models.Sys_menu; import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.services.SysMenuService; import io.v.nutz.sys.services.SysMenuService;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import org.apache.shiro.authz.annotation.RequiresAuthentication; 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.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.FieldFilter;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* Created by wizzer on 2016/6/23. * Created by wizzer on 2016/6/23.
@@ -40,8 +55,14 @@ public class SysHomeController {
@Inject @Inject
private BaseService baseService; private BaseService baseService;
@Inject
private Dao dao;
@Inject
private RedisService redisService;
@At("") @At("")
@Ok("beetl:/platform/sys/home2.html") @Ok("beetl:/platform/sys/home/index.html")
@RequiresAuthentication @RequiresAuthentication
public void home(HttpSession session, HttpServletRequest request) { public void home(HttpSession session, HttpServletRequest request) {
@@ -182,6 +203,44 @@ public class SysHomeController {
return Result.success(baseService.listMap(sql)); return Result.success(baseService.listMap(sql));
} }
@At
@Ok("json:full")
@RequiresAuthentication
public Result listHomeActivity() {
FieldFilter fieldFilter = FieldFilter.locked(Sys_home_activity.class, "classPath");
List<Sys_home_activity> list = Daos.ext(dao, fieldFilter).query(Sys_home_activity.class, Cnd.where("enable", "=", 1).desc("top"));
String userId = ShiroUtil.getUserId();
List<Sys_home_activity> allowActivityList = new ArrayList<>();
for (Sys_home_activity activity : list) {
Integer allowUserGroupId = activity.getAllowUserGroupId();
String allowUserSql = activity.getAllowUserSql();
activity.setAllowUserSql(null);
if (allowUserGroupId == null && StrUtil.isBlank(allowUserSql)) {
allowActivityList.add(activity);
continue;
}
if (allowUserGroupId != null) {
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", allowUserGroupId).and("userId", "=", userId));
if (count > 0) {
allowActivityList.add(activity);
continue;
}
}
if (StrUtil.isNotBlank(allowUserSql)) {
Sql sql = Sqls.create(allowUserSql).setParam("userId", userId);
NutMap nutMap = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
if (Lang.isNotEmpty(nutMap)) {
allowActivityList.add(activity);
}
}
}
return Result.success(allowActivityList);
}
@At("/403") @At("/403")
@Ok("re") @Ok("re")
@@ -231,5 +290,77 @@ public class SysHomeController {
return ">>:/error/AuthenticationError.html"; return ">>:/error/AuthenticationError.html";
} }
/**
* 工会网站新闻
*
* @return
*/
@At
@RequiresAuthentication
@Ok("json")
public Result getNews() {
try {
// String gonghuiNews = redisService.get("gonghui_news");
// if(Strings.isNotBlank(gonghuiNews)){
// List<HashMap> news = Json.fromJsonAsList(HashMap.class, gonghuiNews);
// return Result.success(news);
// }
SSLContextTrustAnyHostname.trustAllHosts();
String url = "https://gh.zufe.edu.cn/";
Document document = null;
document = Jsoup.connect(url).get();
Elements homeElements1 = document.select(".index .section1 .w12>div");
Elements homeElements2 = document.select(".index .section2 .w12>div");
List<Map<String, Object>> news1 = homeElements1.stream().map(homeElement -> {
//获取板块名称
String name = homeElement.selectFirst("div.tit>h2").text();
if (name.equals("新闻速递")) {
Elements liElements = homeElement.select(".s1-r ul li");
List<NutMap> notices = liElements.stream().map(liElement -> {
NutMap row = NutMap.NEW();
String href = liElement.selectFirst("a").attr("href");
String time = liElement.selectFirst("a span").text();
String title = liElement.selectFirst("a p").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);
}
return null;
}).collect(Collectors.toList());
List<Map<String, Object>> news2 = homeElements2.stream().map(homeElement -> {
//获取板块名称
String name = homeElement.selectFirst("div.tit>h2").text();
if (name.equals("通知公告")) {
Elements liElements = homeElement.select(".s2-l ul li");
List<NutMap> notices = liElements.stream().map(liElement -> {
NutMap row = NutMap.NEW();
String href = liElement.selectFirst("a").attr("href");
String time1 = liElement.selectFirst("a .date b").text();
String time2 = liElement.selectFirst("a .date span").text();
String title = liElement.selectFirst("a .info h3").text();
row.put("href", href);
row.put("time", time2 + "-" + time1);
row.put("text", title);
return row;
}).collect(Collectors.toList());
return Map.of("label", name, "value", notices);
}
return null;
}).collect(Collectors.toList());
if (Lang.isNotEmpty(news2)) {
news1.addAll(news2);
}
redisService.setex("gonghui_news", 60 * 60 * 24, Json.toJson(news1));
return Result.success(news1);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
} }
+131 -121
View File
@@ -1,34 +1,34 @@
<!DOCTYPE html> <!doctype html>
<html lang="${lang,escape}"> <html lang="${lang,escape}">
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1" />
<meta name="description" content="${AppName!}"> <meta name="description" content="${AppName!}" />
<title>${AppName!}</title> <title>${AppName!}</title>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta http-equiv="Expires" content="0"> <meta http-equiv="Expires" content="0" />
<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Cache-control" content="no-cache" />
<meta http-equiv="Cache" content="no-cache"> <meta http-equiv="Cache" content="no-cache" />
<!-- import CSS --> <!-- import CSS -->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/myframe/css/myframe.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/myframe/css/myframe.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css" />
<link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css"> <link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css" />
<link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css"> <link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css" />
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css"> <link rel="stylesheet" href="${base!}/assets/platform/css/common.css" />
<link rel="stylesheet" href="${base!}/assets/platform/css/main.css"> <link rel="stylesheet" href="${base!}/assets/platform/css/main.css" />
<link rel="stylesheet" href="${base!}/assets/platform/css/elmain.css"> <link rel="stylesheet" href="${base!}/assets/platform/css/elmain.css" />
<link rel="stylesheet" href="${base!}/assets/platform/css/panel.css"> <link rel="stylesheet" href="${base!}/assets/platform/css/panel.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/wangeditor/wangEditor.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/wangeditor/wangEditor.css" />
<link rel="stylesheet" type="text/css" href="${base!}/assets/platform/plugins/viewer/viewer.min.css"> <link rel="stylesheet" type="text/css" href="${base!}/assets/platform/plugins/viewer/viewer.min.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/wp-upload-vue/css/wpupload.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/wp-upload-vue/css/wpupload.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/wp-upload-vue/font/iconfont.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/wp-upload-vue/font/iconfont.css" />
<link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css" />
<link rel="stylesheet" href="${base!}/assets/platform/css/vivify.min.css"> <link rel="stylesheet" href="${base!}/assets/platform/css/vivify.min.css" />
<link href="${base!}/assets/platform/plugins/vue-cron/vcrontab.css" rel="stylesheet"/> <link href="${base!}/assets/platform/plugins/vue-cron/vcrontab.css" rel="stylesheet" />
<script src="${base!}/assets/platform/plugins/vue-cron/vcrontab.umd.min.js"></script> <script src="${base!}/assets/platform/plugins/vue-cron/vcrontab.umd.min.js"></script>
<!-- import Vue before Element --> <!-- import Vue before Element -->
@@ -60,22 +60,27 @@
<!--echars--> <!--echars-->
<script src="${base!}/assets/platform/plugins/echarts/echarts.min.js"></script> <script src="${base!}/assets/platform/plugins/echarts/echarts.min.js"></script>
<script src="${base!}/assets/platform/plugins/echarts/infographic.js"></script><!--主题--> <script src="${base!}/assets/platform/plugins/echarts/infographic.js"></script>
<script src="${base!}/assets/platform/plugins/echarts/westeros.js"></script><!--主题--> <!--主题-->
<script src="${base!}/assets/platform/plugins/echarts/walden.js"></script><!--主题--> <script src="${base!}/assets/platform/plugins/echarts/westeros.js"></script>
<script src="${base!}/assets/platform/plugins/echarts/macarons.js"></script><!--主题--> <!--主题-->
<script src="${base!}/assets/platform/plugins/echarts/walden.js"></script>
<!--主题-->
<script src="${base!}/assets/platform/plugins/echarts/macarons.js"></script>
<!--主题-->
<!-- <script src="https://cdn.staticfile.org/echarts/5.2.2/echarts.js"></script>--> <!-- <script src="https://cdn.staticfile.org/echarts/5.2.2/echarts.js"></script>-->
<!-- <script src="https://cdn.staticfile.org/echarts/5.2.2/i18n/langZH.js"></script>--> <!-- <script src="https://cdn.staticfile.org/echarts/5.2.2/i18n/langZH.js"></script>-->
<script src="${base!}/assets/platform/module/mixins/initTableMixins.js?v=1.0.3"></script> <script src="${base!}/assets/platform/module/mixins/initTableMixins.js?v=1.0.3"></script>
<script src="${base!}/assets/platform/js/includeModel.js?v=1.0.5"></script> <script src="${base!}/assets/platform/js/includeModel.js?v=1.0.5"></script>
<script src="${base!}/assets/platform/js/component.js?v=1.0.2"></script> <script src="${base!}/assets/platform/js/component.js?v=1.0.2"></script>
<script src="${base!}/assets/platform/js/v.js?v=1.0.5"></script> <script src="${base!}/assets/platform/js/v.js?v=1.0.5"></script>
<script src="${base!}/assets/platform/plugins/wangeditor/wangEditor.js"></script> <script src="${base!}/assets/platform/plugins/wangeditor/wangEditor.js"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/wangeditor@4.6.15/dist/wangEditor.min.js"></script>--> <!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/wangeditor@4.6.15/dist/wangEditor.min.js"></script>-->
<script type="text/javascript" <script
src="https://webapi.amap.com/maps?v=1.4.15&key=6ab3452804ba35050880b5e047436853&plugin=AMap.PolyEditor,AMap.PlaceSearch"></script> type="text/javascript"
src="https://webapi.amap.com/maps?v=1.4.15&key=6ab3452804ba35050880b5e047436853&plugin=AMap.PolyEditor,AMap.PlaceSearch"
></script>
<!--viewer--> <!--viewer-->
<script src="${base!}/assets/platform/plugins/viewer/viewer.min.js"></script> <script src="${base!}/assets/platform/plugins/viewer/viewer.min.js"></script>
@@ -83,7 +88,6 @@
<script src="${base!}/assets/platform/plugins/vue-loader/httpVueLoader.js"></script> <script src="${base!}/assets/platform/plugins/vue-loader/httpVueLoader.js"></script>
<script src="${base!}/assets/platform/plugins/vue-qrcode/vue-qrcode.min.js"></script> <script src="${base!}/assets/platform/plugins/vue-qrcode/vue-qrcode.min.js"></script>
<!-- pjax是异步加载html片段的工具,模拟前端路由机制 --> <!-- pjax是异步加载html片段的工具,模拟前端路由机制 -->
<script src="${base!}/assets/platform/plugins/pjax/jquery.pjax.js"></script> <script src="${base!}/assets/platform/plugins/pjax/jquery.pjax.js"></script>
<script src="${base!}/assets/platform/plugins/myframe/js/myframe.js"></script> <script src="${base!}/assets/platform/plugins/myframe/js/myframe.js"></script>
@@ -110,77 +114,79 @@
<script src="${base!}/components/plugins/sysDict/DictData.js"></script> <script src="${base!}/components/plugins/sysDict/DictData.js"></script>
<script type="text/javascript"> <script type="text/javascript">
const base = "${base!}"; const base = "${base!}"
const APP_DOMAIN = "${AppDomain!}"; const APP_DOMAIN = "${AppDomain!}"
const FILE_DOMAIN = "${AppFileDomain!}"; const FILE_DOMAIN = "${AppFileDomain!}"
const AppMapCenterPointX = "${config.AppMapCenterPointX!}"; const AppMapCenterPointX = "${config.AppMapCenterPointX!}"
const AppMapCenterPointY = "${config.AppMapCenterPointY!}"; const AppMapCenterPointY = "${config.AppMapCenterPointY!}"
const isDisPlayCode = "${config.isDisPlayCode!}" === 'true' const isDisPlayCode = "${config.isDisPlayCode!}" === "true"
var loginPjax = "${@shiro.getPrincipalProperty('loginPjax')}"; var loginPjax = "${@shiro.getPrincipalProperty('loginPjax')}"
const LOGO_URL = "${config.logoUrl!}" const LOGO_URL = "${config.logoUrl!}"
ELEMENT.locale(ELEMENT.lang['${lang,escape}']); ELEMENT.locale(ELEMENT.lang["${lang,escape}"])
Vue.component('vuedraggable', window.vuedraggable) Vue.component("vuedraggable", window.vuedraggable)
Vue.component('guava', httpVueLoader('/components/plugins/Guava.vue')) Vue.component("guava", httpVueLoader("/components/plugins/Guava.vue"))
Vue.component('sign', httpVueLoader('/components/sign/sign.vue?v=2.0.0')) Vue.component("sign", httpVueLoader("/components/sign/sign.vue?v=2.0.0"))
Vue.component('file-upload', httpVueLoader('/components/plugins/FileUpload.vue?v='+new Date().getTime())) Vue.component("file-upload", httpVueLoader("/components/plugins/FileUpload.vue?v=" + new Date().getTime()))
Vue.component('image-upload', httpVueLoader('/components/plugins/ImageUpload.vue')) Vue.component("image-upload", httpVueLoader("/components/plugins/ImageUpload.vue"))
Vue.component('dict-tag', httpVueLoader('/components/plugins/sysDict/DictTag.vue')) Vue.component("dict-tag", httpVueLoader("/components/plugins/sysDict/DictTag.vue"))
Vue.component('border-table', httpVueLoader('/components/plugins/BorderTable.vue')) Vue.component("border-table", httpVueLoader("/components/plugins/BorderTable.vue"))
Vue.component('text-editor', httpVueLoader('/components/plugins/TextEditor.vue')) Vue.component("text-editor", httpVueLoader("/components/plugins/TextEditor.vue"))
Vue.component('el-tab-plus', httpVueLoader('/components/plugins/ELTabPlus.vue')) Vue.component("el-tab-plus", httpVueLoader("/components/plugins/ELTabPlus.vue"))
Vue.component('dict-select', httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.1')) Vue.component("dict-select", httpVueLoader("/components/plugins/DictSelect.vue?v=1.0.1"))
Vue.component('enum-select', httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0')) Vue.component("enum-select", httpVueLoader("/components/plugins/EnumSelect.vue?v=1.0.0"))
Vue.component('custom-message', httpVueLoader('/components/plugins/CustomMessage.vue')) Vue.component("custom-message", httpVueLoader("/components/plugins/CustomMessage.vue"))
Vue.use(httpVueLoader) Vue.use(httpVueLoader)
Vue.component(VueQrcode.name, VueQrcode) Vue.component(VueQrcode.name, VueQrcode)
const viewImage = function (filepath) { const viewImage = function (filepath) {
let image = new Image(); let image = new Image()
image.src = APP_DOMAIN + FILE_STREAM_PREVIEW_ADDRESS + '?id=' + filepath; image.src = APP_DOMAIN + FILE_STREAM_PREVIEW_ADDRESS + "?id=" + filepath
let viewer = new Viewer(image); let viewer = new Viewer(image)
viewer.show(); viewer.show()
}; }
window.viewImage = viewImage; window.viewImage = viewImage
Vue.prototype.$viewImage = viewImage Vue.prototype.$viewImage = viewImage
</script> </script>
</head> </head>
<body> <body>
<div class="gallery-loader" style="background-color:transparent;"> <div class="gallery-loader" style="background-color: transparent">
<div class="loader"></div> <div class="loader"></div>
</div> </div>
<div id="mainApp" class="app"> <div id="mainApp" class="app">
<header class="header header-fixed navbar" id="headerNavbar"> <header class="header header-fixed navbar" id="headerNavbar">
<div class="brand"> <div class="brand">
<a href="javascript:;" data-pjax class="navbar-brand" @click="goHome"> <a href="javascript:;" data-pjax class="navbar-brand" @click="goHome">
<div :style="{'background-image':'url('+LOGO_URL+')'}" <div
style=" width: 240px; :style="{'background-image':'url('+LOGO_URL+')'}"
style="
width: 240px;
height: 80%; height: 80%;
margin-top: 5px; margin-top: 5px;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-size: contain;"></div> background-size: contain;
"
></div>
</a> </a>
</div> </div>
<ul class="nav navbar-nav" id="moduleCenter"> <ul class="nav navbar-nav" id="moduleCenter">
<li style="padding: 0 10px 0 20px" class="vivify popIn duration-1500"> <li style="padding: 0 10px 0 20px" class="vivify popIn duration-1500">
<el-popover <el-popover width="450" popper-class="appCenterPopover" placement="top-start" trigger="click">
width="450"
popper-class="appCenterPopover"
placement="top-start"
trigger="click">
<el-card shadow="never" class="appCenterCard"> <el-card shadow="never" class="appCenterCard">
<template #header> <template #header>
<el-row type="flex" justify="space-between"> <el-row type="flex" justify="space-between">
<div> <div>
<el-link :underline="false">应用中心</el-link> <el-link :underline="false">应用中心</el-link>
<a href="/platform/sys/entranceModule" data-pjax> <a href="/platform/sys/entranceModule" data-pjax>
<i class="el-icon-edit" style="cursor: pointer;color: #1867b0" <i
v-if="${@shiro.hasRole('sysadmin')}"></i> class="el-icon-edit"
style="cursor: pointer; color: #1867b0"
v-if="${@shiro.hasRole('sysadmin')}"
></i>
</a> </a>
</div> </div>
@@ -194,11 +200,12 @@
</template> </template>
<el-row :gutter="20" v-if="moduleMenus && moduleMenus.length>0"> <el-row :gutter="20" v-if="moduleMenus && moduleMenus.length>0">
<el-col v-for="item in moduleMenus" :key="item.id" :span="8" style="margin-bottom: 5px"> <el-col v-for="item in moduleMenus" :key="item.id" :span="8" style="margin-bottom: 5px">
<div class="entranceDetail" <div class="entranceDetail" @click="enterEntranceModules(item)">
@click="enterEntranceModules(item)">
<div class="entranceIcon"> <div class="entranceIcon">
<el-image :src="CREATE_PREVIEW_URL(item.icon[0].id)" <el-image
style="height: 50px;width: 50px;border-radius: 50%"></el-image> :src="CREATE_PREVIEW_URL(item.icon[0].id)"
style="height: 50px; width: 50px; border-radius: 50%"
></el-image>
</div> </div>
<a href="javascript:;">{{item.moduleName}}</a> <a href="javascript:;">{{item.moduleName}}</a>
</div> </div>
@@ -233,7 +240,6 @@
<!-- </el-breadcrumb-item>--> <!-- </el-breadcrumb-item>-->
<!-- </el-breadcrumb>--> <!-- </el-breadcrumb>-->
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li class="off-right"> <li class="off-right">
<a href="javascript:;" data-toggle="dropdown"> <a href="javascript:;" data-toggle="dropdown">
@@ -243,8 +249,7 @@
<li class="off-right"> <li class="off-right">
<a href="javascript:;" data-toggle="dropdown"> <a href="javascript:;" data-toggle="dropdown">
<span class="hidden-xs ml10"> <span class="hidden-xs ml10">
${@shiro.getPrincipalProperty('username')} ${@shiro.getPrincipalProperty('username')} (${@shiro.getPrincipalProperty('loginname')})
(${@shiro.getPrincipalProperty('loginname')})
</span> </span>
</a> </a>
</li> </li>
@@ -255,7 +260,7 @@
</li> </li>
</ul> </ul>
</header> </header>
<section class="layout" style="display: flex;"> <section class="layout" style="display: flex">
<!-- sidebar menu --> <!-- sidebar menu -->
<div id="asideMenu" class="sidebar"> <div id="asideMenu" class="sidebar">
<el-menu <el-menu
@@ -265,7 +270,8 @@
:default-openeds="openedMenus" :default-openeds="openedMenus"
background-color="#04436c" background-color="#04436c"
text-color="#fff" text-color="#fff"
active-text-color="#ab9be7"> active-text-color="#ab9be7"
>
<template v-for="firstMenu in leftMenus"> <template v-for="firstMenu in leftMenus">
<el-submenu :index="firstMenu.id" v-if="firstMenu.children.length>0"> <el-submenu :index="firstMenu.id" v-if="firstMenu.children.length>0">
<template slot="title"> <template slot="title">
@@ -299,7 +305,6 @@
<a :href="secondMenu.href" data-pjax v-else> <a :href="secondMenu.href" data-pjax v-else>
<el-menu-item :index="secondMenu.id"> <el-menu-item :index="secondMenu.id">
<i class="el-icon-menu"></i> <i class="el-icon-menu"></i>
<span slot="title">{{secondMenu.name}}</span> <span slot="title">{{secondMenu.name}}</span>
</el-menu-item> </el-menu-item>
@@ -309,7 +314,6 @@
<a :href="firstMenu.href" data-pjax v-else> <a :href="firstMenu.href" data-pjax v-else>
<el-menu-item :index="firstMenu.id"> <el-menu-item :index="firstMenu.id">
<i class="el-icon-menu"></i> <i class="el-icon-menu"></i>
<span slot="title">{{firstMenu.name}}</span> <span slot="title">{{firstMenu.name}}</span>
</el-menu-item> </el-menu-item>
@@ -319,20 +323,18 @@
</div> </div>
<!-- main content --> <!-- main content -->
<section class="main-content" id="container"> <section class="main-content" id="container">${layoutContent}</section>
${layoutContent}
</section> </section>
</section> </div>
</div>
<script> <script>
const moduleMenus = ${@shiro.userModuleMenus()} window.sessionStorage.setItem('moduleMenus', JSON.stringify(${@shiro.userModuleMenus()}))
const leftMenuApp = new Vue({ const leftMenuApp = new Vue({
el: '#asideMenu', el: '#asideMenu',
data() { data() {
return { return {
moduleMenus: moduleMenus, moduleMenus: JSON.parse(window.sessionStorage.getItem('moduleMenus')),
leftMenus: [], leftMenus: [],
activeMenuIndex: '', activeMenuIndex: '',
openedMenus: [] openedMenus: []
@@ -348,22 +350,6 @@
this.openedMenus = indexPath this.openedMenus = indexPath
window.sessionStorage.setItem('menuIndex', index) window.sessionStorage.setItem('menuIndex', index)
window.sessionStorage.setItem('menuIndexPath', JSON.stringify(indexPath)) window.sessionStorage.setItem('menuIndexPath', JSON.stringify(indexPath))
// const breadcrumbMenus = []
// let menus = headerApp.selectEntranceModule.menus
// for (let i = 0; i < indexPath.length; i++) {
// const menu = menus.find(v => v.id === indexPath[i])
// breadcrumbMenus.push({
// name: menu.name,
// href: menu.href,
// id: menu.id,
// type: menu.type
// })
// menus = menu.children
// }
//
// window.sessionStorage.setItem('breadcrumbMenus', JSON.stringify(breadcrumbMenus))
// headerApp.breadcrumbMenus = breadcrumbMenus
}, },
openFirstMenu() { openFirstMenu() {
@@ -406,7 +392,7 @@
const menuIndex = window.sessionStorage.getItem('menuIndex') const menuIndex = window.sessionStorage.getItem('menuIndex')
if (menuIndex) { if (menuIndex) {
this.activeMenuIndex = menuIndex this.activeMenuIndex = menuIndex
}else{ } else {
this.activeMenuIndex = '' this.activeMenuIndex = ''
} }
} }
@@ -444,17 +430,39 @@
el: '#headerNavbar', el: '#headerNavbar',
data() { data() {
return { return {
moduleMenus: moduleMenus, moduleMenus: JSON.parse(window.sessionStorage.getItem('moduleMenus')),
menuPopover: false, menuPopover: false,
selectEntranceModule: {}, selectEntranceModule: {},
breadcrumbMenus: [] breadcrumbMenus: [],
unReadMsgNum: 0,
appModuleId: "",
} }
}, },
methods: { methods: {
getUnReadMsgNum() {
$.get('/platform/sys/msg/user/unread_num').then(res => {
if (res.code === 0) {
const totalSum = Object.values(res.data).reduce(function (sum, value) {
return sum + value;
}, 0);
this.unReadMsgNum = totalSum
if (totalSum > 0) {
this.$notify.info({
title: '消息',
message: '您有' + totalSum + '条未读消息,点击查看。',
onClick: () => {
sublime.jumpPagePjax('/platform/sys/msg/user/unread')
}
});
}
}
})
},
toggleMenuPopover() { toggleMenuPopover() {
/*setTimeout(() => { setTimeout(() => {
this.menuPopover = !this.menuPopover this.menuPopover = !this.menuPopover
}, 300)*/ }, 300)
}, },
goSetAppCenter() { goSetAppCenter() {
@@ -507,29 +515,31 @@
return null; return null;
}, },
matchMenu(path = window.location.pathname) { matchMenu(path = window.location.pathname) {
const parentNodes = this.findParentNodes(moduleMenus.flatMap(v => v.menus), path) const parentNodes = this.findParentNodes(JSON.parse(window.sessionStorage.getItem('moduleMenus')).flatMap(v => v.menus), path)
if (parentNodes) { if (parentNodes) {
const menuIndexPath = parentNodes.map(v => v.id) const menuIndexPath = parentNodes.map(v => v.id)
const menuIndex = menuIndexPath[menuIndexPath.length - 1] const menuIndex = menuIndexPath[menuIndexPath.length - 1]
const menuParentIndex = menuIndexPath[0] const menuParentIndex = menuIndexPath[0]
const module = moduleMenus.find(v => v.containsMenu.includes(menuParentIndex)) const module = JSON.parse(window.sessionStorage.getItem('moduleMenus')).find(v => v.containsMenu.includes(menuParentIndex))
this.enterEntranceModules(module) this.enterEntranceModules(module)
this.appModuleId = module.id
window.sessionStorage.setItem('menuIndex', menuIndex) window.sessionStorage.setItem('menuIndex', menuIndex)
window.sessionStorage.setItem('menuIndexPath', JSON.stringify(menuIndexPath)) window.sessionStorage.setItem('menuIndexPath', JSON.stringify(menuIndexPath))
leftMenuApp.assignmentMenu() leftMenuApp.assignmentMenu()
} else { } else {
this.enterEntranceModules(moduleMenus[0]) this.appModuleId = JSON.parse(window.sessionStorage.getItem('moduleMenus'))[0].id
this.enterEntranceModules(JSON.parse(window.sessionStorage.getItem('moduleMenus'))[0])
window.sessionStorage.removeItem('menuIndex') window.sessionStorage.removeItem('menuIndex')
window.sessionStorage.removeItem('menuIndexPath') window.sessionStorage.removeItem('menuIndexPath')
leftMenuApp.assignmentMenu() leftMenuApp.assignmentMenu()
} }
}, }
}, },
created() { created() {
this.matchMenu() this.matchMenu()
this.getUnReadMsgNum()
} }
}) })
</script> </script>
</body>
</body>
</html> </html>
@@ -0,0 +1,66 @@
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)" 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.name}}
<el-tag type="danger" v-if="moment(item.endDate).valueOf()<moment().valueOf()" size="mini">报名已结束</el-tag>
</div>
<div style="font-size: 12px; line-height: 20px; color: #999">开始时间:{{moment(item.startDate).format('YYYY-MM-DD HH:mm')}}</div>
<div style="font-size: 12px; line-height: 20px; color: #999">结束时间:{{moment(item.endDate).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: {
listActivity() {
$.get("/platform/home/listHomeActivity").then((resp) => {
if (resp.code === 0) {
this.activityOptions = resp.data
}
})
},
enterActivity(item) {
if (item.url) {
sublime.jumpPagePjax(item.url)
} else if (item.url) {
this.$refs.openQRCode.openCode(item.url, "该活动只支持手机端报名,请使用手机扫描二维码报名!")
} else {
this.$message.warning("该活动不支持")
}
}
},
created() {
this.listActivity()
}
}
@@ -0,0 +1,42 @@
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: ""
}
},
computed: {
entranceModules() {
return JSON.parse(window.sessionStorage.getItem("moduleMenus"))
}
},
methods: {
enterEntranceModules(item) {
headerApp.appModuleId = item.id
this.id = item.id
leftMenuApp.loadMenu(item.id)
}
},
created() {
setTimeout(() => {
this.id = headerApp.appModuleId
}, 500)
}
}
@@ -0,0 +1,368 @@
<!--#
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;
}
</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: 10px;
}
.home-quick-entry .quickEntries .quickEntryItem img {
max-width: 50px;
}
.home-quick-entry .quickEntries .quickEntryItem {
font-size: 16px;
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;
border-radius: 10px;
}
.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: 50px;
line-height: 50px;
}
.home-news .el-tab-pane .news_text:hover {
color: #1867b0;
}
</style>
<style>
.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>
</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://gh.zufe.edu.cn/" + href
window.open(url)
},
isHttpOrHttps(url) {
return /^(http:\/\/|https:\/\/)/i.test(url)
}
},
async created() {
await this.getNews()
}
}
@@ -0,0 +1,39 @@
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">
<el-image :src="CREATE_PREVIEW_URL(item.iconClass)" alt="">
<div class="image-slot" slot="error">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
<span>{{item.name}}</span>
</div>
</div>
</el-card>
</div>
`,
data() {
return {
quickEntries: []
}
},
methods: {
listQuickEntry() {
$.get("/platform/quickEntry/getQuickentry").then((res) => {
if (res.code === 0) {
this.quickEntries = res.data
}
})
},
menuClick(item){
sublime.jumpPagePjax(item.href)
}
},
created() {
this.listQuickEntry()
}
}
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>CSS Grid 布局示例</title>
<style>
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr); /* 定义3列,每列宽度相等 */
grid-template-rows: repeat(3, 100px); /* 定义3行,每行高度为100px */
gap: 10px; /* 设置网格间距 */
width: 600px; /* 容器宽度 */
height: 400px; /* 容器高度 */
margin: 0 auto; /* 居中容器 */
}
.item {
background-color: #4CAF50;
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2em;
border-radius: 5px;
}
.item1 {
grid-column: 1 / 3; /* 元素1占据第1和第2列 */
grid-row: 1 / 2; /* 元素1占据第1行 */
}
.item2 {
grid-column: 3 / 4; /* 元素2占据第3列 */
grid-row: 1 / 3; /* 元素2跨越第1和第2行 */
}
.item3 {
grid-column: 1 / 3; /* 元素3占据第1和第2列 */
grid-row: 2 / 3; /* 元素3占据第2行 */
}
.item4,
.item5,
.item6 {
grid-column: span 1; /* 每个元素占据1列 */
grid-row: 3 / 4; /* 所有元素都在第3行 */
}
</style>
</head>
<body>
<div class="grid-container">
<div class="item item1">元素 1</div>
<div class="item item2">元素 2</div>
<div class="item item3">元素 3</div>
<div class="item item4">元素 4</div>
<div class="item item5">元素 5</div>
<div class="item item6">元素 6</div>
</div>
</body>
</html>
@@ -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
}
})
},
}
}