commit
This commit is contained in:
@@ -270,65 +270,24 @@ public class SysHomeController {
|
|||||||
Document doc = Jsoup.connect(domain).get();
|
Document doc = Jsoup.connect(domain).get();
|
||||||
|
|
||||||
JSONObject root = new JSONObject();
|
JSONObject root = new JSONObject();
|
||||||
/*
|
|
||||||
// 1. 新闻快讯(来自 .list1)
|
|
||||||
List<JSONObject> newsArray = new ArrayList<>();
|
List<JSONObject> newsArray = new ArrayList<>();
|
||||||
Elements newsItems = doc.select(".group1 .list1 li");
|
Elements newsItems = doc.select("table[cellspacing=3] tr");
|
||||||
for (Element item : newsItems) {
|
for (Element item : newsItems) {
|
||||||
String date = item.select(".date").text().trim();
|
Element aElement = item.select("a").first();
|
||||||
Element link = item.select("a.text").first();
|
if(aElement == null) {
|
||||||
String title = link.select(".title").text().trim();
|
continue;
|
||||||
String url = link.attr("href").trim();
|
}
|
||||||
|
String date = item.select(".timestyle125262").text().trim();
|
||||||
|
String title = aElement.attr("title").trim();
|
||||||
|
String url = aElement.attr("href").trim();
|
||||||
|
|
||||||
JSONObject node = new JSONObject();
|
JSONObject node = new JSONObject();
|
||||||
node.set("title", title);
|
node.set("title", title);
|
||||||
node.set("date", date);
|
node.set("date", date);
|
||||||
node.set("url", domain + url);
|
node.set("url", "https://gh.hgu.edu.cn/" + url);
|
||||||
newsArray.add(node);
|
newsArray.add(node);
|
||||||
}
|
}
|
||||||
root.set("news", newsArray);
|
root.set("grassroots", newsArray);
|
||||||
|
|
||||||
// 2. 通知公告(来自 .list2)
|
|
||||||
List<JSONObject> noticesArray = new ArrayList<>();
|
|
||||||
Elements noticeItems = doc.select(".group2 .list2 li");
|
|
||||||
for (Element item : noticeItems) {
|
|
||||||
String date = item.select(".date").text().trim();
|
|
||||||
Element link = item.select("a.title").first();
|
|
||||||
String title = link.text().trim();
|
|
||||||
String url = link.attr("href").trim();
|
|
||||||
JSONObject node = new JSONObject();
|
|
||||||
node.set("title", title);
|
|
||||||
node.set("date", date);
|
|
||||||
node.set("url", domain + url);
|
|
||||||
noticesArray.add(node);
|
|
||||||
}
|
|
||||||
root.set("notices", noticesArray);
|
|
||||||
|
|
||||||
// 3. 基层风采(来自 .pic-list1)
|
|
||||||
List<JSONObject> grassrootsArray = new ArrayList<>();
|
|
||||||
Elements grassrootsItems = doc.select(".group3 .pic-list1 li");
|
|
||||||
for (Element item : grassrootsItems) {
|
|
||||||
Element link = item.select("a.img-scale").first();
|
|
||||||
String date = link.select(".date").text().trim();
|
|
||||||
String title = link.select(".title").text().trim();
|
|
||||||
String url = link.attr("href").trim();
|
|
||||||
String summary = link.select(".info").text().trim();
|
|
||||||
|
|
||||||
String imageUrl = "";
|
|
||||||
Element img = link.select("img").first();
|
|
||||||
if (img != null) {
|
|
||||||
imageUrl = img.attr("src").trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject node = new JSONObject();
|
|
||||||
node.set("title", title);
|
|
||||||
node.set("date", date);
|
|
||||||
node.set("url", domain + url);
|
|
||||||
node.set("summary", summary);
|
|
||||||
node.set("image", domain + imageUrl);
|
|
||||||
grassrootsArray.add(node);
|
|
||||||
}
|
|
||||||
root.set("grassroots", grassrootsArray);*/
|
|
||||||
return Result.success(root);
|
return Result.success(root);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
|
|||||||
@@ -20,13 +20,17 @@ const entry = {
|
|||||||
<!-- 应用块区域 -->
|
<!-- 应用块区域 -->
|
||||||
<div class="apps-container">
|
<div class="apps-container">
|
||||||
<div class="app-grid">
|
<div class="app-grid">
|
||||||
<div class="app-item" v-for="(item, index) in currentServices" :key="index"
|
<div v-if="currentServices && currentServices.length > 0" class="app-item" v-for="(item, index) in currentServices" :key="index"
|
||||||
@click="openService(item)">
|
@click="openService(item)">
|
||||||
<div class="app-icon">
|
<div class="app-icon">
|
||||||
<img :src="item.picIcon" alt="" />
|
<img :src="item.picIcon" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div class="app-name">{{ item.name }}</div>
|
<div class="app-name">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="currentServices.length === 0" class="no-entry-placeholder">
|
||||||
|
<div class="icon">📅</div>
|
||||||
|
<p>暂无数据</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -174,7 +178,7 @@ const entry = {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
max-height: calc(350px - 74px);
|
height: calc(350px - 74px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,5 +248,32 @@ const entry = {
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-entry-placeholder {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 40px 20px;
|
||||||
|
color: #94a3b8;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-entry-placeholder .icon {
|
||||||
|
font-size: 48px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-entry-placeholder p {
|
||||||
|
margin: 4px 0 0;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-entry-placeholder .subtext {
|
||||||
|
font-size: 13px;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
|
|
||||||
.entry-card {
|
.entry-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
/*align-items: center;*/
|
||||||
min-width: 320px;
|
min-width: 320px;
|
||||||
background: white;
|
background: white;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
@@ -72,7 +72,7 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="">
|
<div class="" style="padding-bottom: 20px">
|
||||||
<user></user>
|
<user></user>
|
||||||
|
|
||||||
<div class="home-grid">
|
<div class="home-grid">
|
||||||
@@ -86,7 +86,7 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <jcdt :list="websiteNews.grassroots"></jcdt>-->
|
<jcdt :list="websiteNews.grassroots"></jcdt>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ const jcdt = {
|
|||||||
template: /*language=HTML*/ `
|
template: /*language=HTML*/ `
|
||||||
<div class="jcdt-wrapper">
|
<div class="jcdt-wrapper">
|
||||||
<div class="jcdt-container">
|
<div class="jcdt-container">
|
||||||
<!-- <div class="jcdt-title">-->
|
<div class="jcdt-title">
|
||||||
<!-- <span>基层动态</span>-->
|
<span>基层动态</span>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
<div class="jcdt-content">
|
<div class="jcdt-content">
|
||||||
<div class="jcdt-list">
|
<div class="jcdt-list">
|
||||||
<div class="jcdt-item" v-for="item in list" :key="item.title" @click="onLink(item)">
|
<div class="jcdt-item" v-for="item in list" :key="item.title" @click="onLink(item)">
|
||||||
|
|||||||
Reference in New Issue
Block a user