修复了一些小bug

This commit is contained in:
clay
2022-09-29 15:40:10 +08:00
parent 1eb9631127
commit ae08b72bc2
11 changed files with 149 additions and 77 deletions

View File

@@ -3,7 +3,8 @@ ENV = 'development'
# EBTS/开发环境 # EBTS/开发环境
#VUE_APP_BASE_API = '/dev-api' #VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://localhost:8085/dev-api' #VUE_APP_BASE_API = 'http://localhost:8085/dev-api'
VUE_APP_BASE_API = 'http://sist.swjtu.edu.cn/dev-api'
SITE_TYPE = 'NEd5n92EMIpyyBslaNqsRgE' SITE_TYPE = 'NEd5n92EMIpyyBslaNqsRgE'
#VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api' #VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api'

View File

@@ -7,6 +7,7 @@
let vm = null let vm = null
import {info} from "@/api"; import {info} from "@/api";
export function setThis(that) { export function setThis(that) {
vm = that vm = that
} }
@@ -14,6 +15,7 @@ export function setThis(that) {
export function getParentNode(id) { export function getParentNode(id) {
try { try {
let menuList = JSON.parse(sessionStorage.getItem("menu")); let menuList = JSON.parse(sessionStorage.getItem("menu"));
console.log(menuList,"menuList")
for (let menu of menuList) { for (let menu of menuList) {
for (let child of menu.children) { for (let child of menu.children) {
if (id == child.encodeId) { if (id == child.encodeId) {
@@ -66,40 +68,42 @@ export function setLanguage() {
} }
export function toArticle(news,width) { export function toArticle(news, width) {
console.log(width,"width") console.log(width, "width")
info(news.id).then(res => { info(news.id).then(res => {
let info = null let info = null
try { try {
info = getParentNode(res.data.encodeId) info = getParentNode(res.data.encodeId)
console.log(info) console.log(info)
}catch (e){} } catch (e) {
if (info == null){ }
if (info == null) {
return return
} }
if (info.three == null) { if (info.three == null) {
if (width) { if (width) {
vm.$router.push("/pc/" + info.second.encodeId + "?id=" + news.id +"&type=" + info.second.type+ "&lang=" + sessionStorage.getItem("lang")); vm.$router.push("/pc/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else { } else {
vm.$router.push("/mobile/" + info.second.encodeId + "?id=" + news.id +"&type=" + info.second.type+ "&lang=" + sessionStorage.getItem("lang")); vm.$router.push("/mobile/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} }
} else { } else {
if (width) { if (width) {
vm.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "&id=" + news.id +"?type=" + info.second.type+ "&lang=" + sessionStorage.getItem("lang")); vm.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "&id=" + news.id + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else { } else {
vm.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "&id=" + news.id +"?type=" + info.second.type+ "&lang=" + sessionStorage.getItem("lang")); vm.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "&id=" + news.id + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} }
} }
}) })
} }
export function lookMoreComment(item,width) { export function lookMoreComment(item, width) {
info(item.id).then(res => { info(item.id).then(res => {
let info = null let info = null
try { try {
info = getParentNode(res.data.encodeId) info = getParentNode(res.data.encodeId)
}catch (e){} } catch (e) {
if (info == null){ }
if (info == null) {
return return
} }
if (info.three == null) { if (info.three == null) {
@@ -119,6 +123,32 @@ export function lookMoreComment(item,width) {
} }
export function lookMoreFixedComment(id, width) {
let info = null
try {
info = getParentNode(id)
console.log(info)
} catch (e) {
}
if (info == null) {
return
}
if (info.three == null) {
if (width) {
vm.$router.push("/pc/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else {
vm.$router.push("/mobile/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}
} else {
if (width) {
vm.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else {
vm.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}
}
}

View File

@@ -49,7 +49,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="value.pageNum" :current-page.sync="value.pageNum"
:page-sizes="[10,20, 30, 50, 100]" :page-sizes="[10,20, 30, 50, 100]"
:page-size="value.pageSize"
layout="prev, pager,next,sizes, jumper" layout="prev, pager,next,sizes, jumper"
:total="value.total"> :total="value.total">
</el-pagination> </el-pagination>
@@ -66,10 +65,12 @@ export default {
props: { props: {
value: { value: {
type: Object, type: Object,
default: { default() {
data: [{}], return{
pageNum: 1, data:[],
pageSize: 10, pageNum: 1,
pageSize: 10,
}
}, },
}, },
}, },
@@ -78,12 +79,16 @@ export default {
width: document.documentElement.clientWidth, width: document.documentElement.clientWidth,
small: document.documentElement.clientWidth <= 992, small: document.documentElement.clientWidth <= 992,
query: '', query: '',
pageSize:value.pageSize
} }
}, },
methods: { methods: {
getDateTime(date) { getDateTime(date) {
let time = new Date(date); let time = new Date(date);
return time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate(); let year = time.getFullYear();
let month = time.getMonth() + 1
let day = time.getDate();
return year + "-" + month + "-" + day;
}, },
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
@@ -120,6 +125,7 @@ export default {
if (this.type != null && this.type != 0) { if (this.type != null && this.type != 0) {
data.id = this.value.secondId data.id = this.value.secondId
} }
console.log(data,"data")
getNode(data).then(res => { getNode(data).then(res => {
this.value.data = res.rows this.value.data = res.rows
this.value.total = res.total this.value.total = res.total
@@ -131,7 +137,8 @@ export default {
}, },
getTime(time) { getTime(time) {
let date = new Date(time); let date = new Date(time);
return date.getFullYear() + "-" + date.getMonth() + 1 let month = date.getMonth() + 1;
return date.getFullYear() + "-" + month
} }
} }
} }

View File

@@ -78,10 +78,12 @@ export default {
props: { props: {
value: { value: {
type: Object, type: Object,
default: { default() {
data: [{}], return {
pageNum: 1, data: [],
pageSize: 5, pageNum: 1,
pageSize: 10,
}
}, },
}, },
}, },
@@ -124,7 +126,7 @@ export default {
} }
this.getData() this.getData()
}, },
getData(){ getData() {
let data = { let data = {
title: this.query, title: this.query,
id: this.value.navId, id: this.value.navId,
@@ -149,7 +151,8 @@ export default {
}, },
getTime(time) { getTime(time) {
let date = new Date(time); let date = new Date(time);
return date.getFullYear() + "-" + date.getMonth() + 1 let month = date.getMonth() + 1
return date.getFullYear() + "-" + month
} }
} }
} }
@@ -243,7 +246,9 @@ export default {
.tw_context_text { .tw_context_text {
margin-top: .8rem; margin-top: .8rem;
font-size: 1.6rem; font-size: 1.6rem;
height: 6rem;
font-weight: 400; font-weight: 400;
letter-spacing: 1px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; //作为弹性伸缩盒子模型显示。 display: -webkit-box; //作为弹性伸缩盒子模型显示。

View File

@@ -357,15 +357,13 @@ export default {
data: res.rows, data: res.rows,
total: res.total, total: res.total,
pageNum: data.pageNum, pageNum: data.pageNum,
pageSize: data.pageSize,
navId: menu.encodeId, navId: menu.encodeId,
secondId: this.secondId, secondId: this.secondId,
} }
} else if (this.type == 1) { } else if (this.type == 1) {
this.contextData = res.data this.contextData = res.data
} else if (this.type == 3) { } else if (this.type == 3) {
this.contextData = handleTree(res.data, "id", "pid", null, null) this.contextData = handleTree(res.data, "id", "pid", null, null)
console.log(this.contextData,"this.contextData") console.log(this.contextData,"this.contextData")
} }

View File

@@ -65,10 +65,10 @@
<div class="link_text_title"> <div class="link_text_title">
<span style="padding: 0 1.1rem;" v-show="$i18n.locale === 'cn'">{{ menu.title }}</span> <span style="padding: 0 1.1rem;" v-show="$i18n.locale === 'cn'">{{ menu.title }}</span>
<span style="padding: 0 .9rem" v-show="$i18n.locale === 'en'">{{ menu.englishTitle }}</span> <span style="padding: 0 .9rem" v-show="$i18n.locale === 'en'">{{ menu.englishTitle }}</span>
<div class="secondary"> <div class="secondary">
<ul style="text-align:left;"> <ul style="text-align:left;">
<li class="menu_list" v-for="(item,i) in menu.children" :key="i" @click="menuCut(item)"> <span v-for="(item,i) in menu.children" :key="i" @click="menuCut(item)">
<li class="menu_list" v-if="item.displayType != 4">
<div class="menu_suffix"> <div class="menu_suffix">
<div> <div>
<span v-show="$i18n.locale === 'cn'">{{ item.title }}</span> <span v-show="$i18n.locale === 'cn'">{{ item.title }}</span>
@@ -76,6 +76,7 @@
</div> </div>
</div> </div>
</li> </li>
</span>
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -96,6 +96,7 @@
<script> <script>
import {banner, getArticleList} from "@/api"; import {banner, getArticleList} from "@/api";
import {toArticle,lookMoreComment} from "@/utils/sist"; import {toArticle,lookMoreComment} from "@/utils/sist";
import {lookMoreFixedComment} from "../../../utils/sist";
export default { export default {
name: "news_center", name: "news_center",
@@ -119,7 +120,7 @@ export default {
toArticle(news,this.width) toArticle(news,this.width)
}, },
lookMore(news) { lookMore(news) {
lookMoreComment(news,this.width) lookMoreFixedComment("DpHktHeXJp3MX-FZoZdjz3w",this.width)
}, },
getList() { getList() {
getArticleList({ getArticleList({
@@ -203,7 +204,7 @@ export default {
} }
.news_context_text { .news_context_text {
height: 28%; height: 24%;
width: 80%; width: 80%;
font-size: 1.6rem; font-size: 1.6rem;
font-weight: 400; font-weight: 400;
@@ -211,8 +212,8 @@ export default {
color: #262626; color: #262626;
margin: 0 auto; margin: 0 auto;
padding: 1rem 0; padding: 1rem 0;
text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
display:-webkit-box; //作为弹性伸缩盒子模型显示。 display:-webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列 -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp:3; //显示的行 -webkit-line-clamp:3; //显示的行

View File

@@ -57,9 +57,9 @@
<div class="headline"> <div class="headline">
<!--<div style="background: #DA2D2D;color: #E6E6E6;" class="more">--> <!-- <div style="background: #DA2D2D;color: #E6E6E6;" class="more">-->
<!-- {{ $t('message.more') }}--> <!-- {{ $t('message.more') }}-->
<!--</div>--> <!-- </div>-->
<!--<div class="more_img">--> <!--<div class="more_img">-->
<!-- <img src="@/assets/index/party_building_activities/sy_icon_zhdh.png" alt="">--> <!-- <img src="@/assets/index/party_building_activities/sy_icon_zhdh.png" alt="">-->
<!--</div>--> <!--</div>-->
@@ -97,51 +97,67 @@
</el-col> </el-col>
<el-col :xs="18" :sm="18" :md="18" :lg="17" :xl="17" :span="17"> <el-col :xs="18" :sm="18" :md="18" :lg="17" :xl="17" :span="17">
<div class="phe_context" @click="getArticle(item)"> <div class="phe_context" @click="getArticle(item)">
<div class="phe_context_title">{{item.title}}</div> <div class="phe_context_title">{{ item.title }}</div>
<div class="phe_context_text" v-html="item.content"> <div class="phe_context_text" v-html="item.content">
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :xs="22" :sm="22" :md="22" :lg="3" :xl="3"> <el-col :xs="22" :sm="22" :md="22" :lg="3" :xl="3">
<div class="phe_time">{{getTitme(item.publishTime)}}</div> <div class="phe_time">{{ getTime(item.publishTime) }}</div>
</el-col> </el-col>
</el-row> </el-row>
<hr v-if="index != listData.length-1" style="border: 0.1rem solid #E6E6E6;" class="hr"> <hr v-if="index != listData.length-1" style="border: 0.1rem solid #E6E6E6;" class="hr">
</div> </div>
</el-col> </el-col>
</el-row> <!--更多-->
<el-row>
<el-col :xs="1" :sm="2" :md="4" :lg="6" :xl="6">
<div class="grid-content"></div>
</el-col>
<el-col class="headline" :xs="22" :sm="20" :md="16" :lg="12" :xl="12">
<div style="background: #DA2D2D;color: #E6E6E6;" class="more" @click="lookMore(listData[0])">
{{ $t('message.more') }}
</div>
<!-- <div class="more_img">-->
<!-- <img src="@/assets/index/sy_icon_zhdl.png" alt="">-->
<!-- </div>-->
</el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import SlideshowCard from './slideshow_card' import SlideshowCard from './slideshow_card'
import {getArticleList} from "@/api"; import {getArticleList} from "@/api";
import {toArticle,lookMoreComment} from "@/utils/sist"; import {toArticle, lookMoreComment} from "@/utils/sist";
import {lookMoreFixedComment} from "../../../utils/sist";
export default { export default {
name: "party_building_activities", name: "party_building_activities",
components: { components: {
SlideshowCard SlideshowCard
}, },
data(){ data() {
return{ return {
width: document.documentElement.clientWidth > 992, width: document.documentElement.clientWidth > 992,
listData:[], listData: [],
bgc: require("../../../assets/index/party_building_activities/sy_bj3.png") bgc: require("../../../assets/index/party_building_activities/sy_bj3.png")
} }
}, },
created() { created() {
this.getListData() this.getListData()
}, },
methods:{ methods: {
getArticle(item){ getArticle(item) {
toArticle(item,this.width) toArticle(item, this.width)
}, },
lookMore(item){ lookMore(item) {
lookMoreComment(item,this.width) // lookMoreComment(item,this.width)
lookMoreFixedComment("N8YFxHPHwy6PyHt7J-gIDCU", this.width)
}, },
getListData(){ getListData() {
getArticleList({ getArticleList({
type: "N6CfFGz2UWpQ9Uhk3uwiJAQ", type: "N6CfFGz2UWpQ9Uhk3uwiJAQ",
pageNum: 1, pageNum: 1,
@@ -150,9 +166,12 @@ export default {
this.listData = res.rows this.listData = res.rows
}) })
}, },
getTitme(time){ getTime(date) {
let date = new Date(time) let time = new Date(date);
return date.getFullYear() +"." + date.getMonth()+1 +"." + date.getDate() let year = time.getFullYear();
let month = time.getMonth() + 1
let day = time.getDate();
return year + "-" + month + "-" + day;
} }
} }
} }
@@ -160,19 +179,18 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.party_building_activities { .party_building_activities {
//background-image: url("../../../assets/index/party_building_activities/sy_bj3.png");
background-image: url("../../../assets/index/party_building_activities/sy_bj3.png"); background-image: url("../../../assets/index/party_building_activities/sy_bj3.png");
//background-image: url();
padding-top: 4rem; padding-top: 4rem;
padding-bottom: 2rem; padding-bottom: 2rem;
} }
.headline { .headline {
.hr_line_left,.hr_line_right{ .hr_line_left, .hr_line_right {
border-color: #DA2D2D !important; border-color: #DA2D2D !important;
} }
.hr_dot_left,.hr_dot_right{
.hr_dot_left, .hr_dot_right {
background-color: #DA2D2D !important; background-color: #DA2D2D !important;
} }
@@ -190,9 +208,10 @@ export default {
border: .1rem solid #D13C3C; border: .1rem solid #D13C3C;
} }
.phe_row{ .phe_row {
margin: 4rem 0; margin: 4rem 0;
} }
.phe { .phe {
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
margin-top: 4rem; margin-top: 4rem;
@@ -207,9 +226,9 @@ export default {
.phe_context { .phe_context {
.phe_context_title { .phe_context_title {
overflow:hidden; //超出的文本隐藏 overflow: hidden; //超出的文本隐藏
text-overflow:ellipsis; //溢出用省略号显示 text-overflow: ellipsis; //溢出用省略号显示
white-space:nowrap; //溢出不换行 white-space: nowrap; //溢出不换行
cursor: pointer; cursor: pointer;
font-size: 2rem; font-size: 2rem;
font-weight: 600; font-weight: 600;
@@ -224,14 +243,16 @@ export default {
.phe_context_text { .phe_context_text {
margin-top: 0.8rem; margin-top: 0.8rem;
font-size: 1.6rem; font-size: 1.6rem;
height: 6rem;
color: #565656; color: #565656;
letter-spacing: 1px; letter-spacing: 1px;
display:-webkit-box; //作为弹性伸缩盒子模型显示。 text-overflow: ellipsis;
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列 overflow: hidden;
-webkit-line-clamp:3; //显示的行 display: -webkit-box; //作为弹性伸缩盒子模型显示。
//color: inherit !important; -webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
span{ -webkit-line-clamp: 3; //显示的行
color: #565656 !important; span {
color: #565656 !important;
} }
} }
} }
@@ -246,5 +267,4 @@ export default {
} }
</style> </style>

View File

@@ -85,7 +85,7 @@
<!--更多--> <!--更多-->
<div class="headline"> <div class="headline">
<div style="background: #FFFFFF;color: #1956BC;" class="more" @click="lookMore(scientificData[0])"> <div style="background: #FFFFFF;color: #1956BC;" class="more" @click="lookMore('b4Lm82Ct_eaF2u5XDABv0TM')">
{{ $t('message.more') }} {{ $t('message.more') }}
</div> </div>
<div class="hr_div"> <div class="hr_div">
@@ -138,7 +138,7 @@
<div class="grid-content"></div> <div class="grid-content"></div>
</el-col> </el-col>
<el-col class="headline" :xs="22" :sm="20" :md="16" :lg="12" :xl="12"> <el-col class="headline" :xs="22" :sm="20" :md="16" :lg="12" :xl="12">
<div style="background: #FFFFFF;color: #1956BC;" class="more" @click="lookMore(academiaData[0])"> <div style="background: #FFFFFF;color: #1956BC;" class="more" @click="lookMore('47sdOe8NQs0B4EHmM-wFWjQ')">
{{ $t('message.more') }} {{ $t('message.more') }}
</div> </div>
<!-- <div class="more_img">--> <!-- <div class="more_img">-->
@@ -153,6 +153,7 @@
import {getArticleList, info} from "@/api"; import {getArticleList, info} from "@/api";
import {parseTime} from '@/utils/ebts' import {parseTime} from '@/utils/ebts'
import {toArticle,lookMoreComment} from "@/utils/sist"; import {toArticle,lookMoreComment} from "@/utils/sist";
import {lookMoreFixedComment} from "../../../utils/sist";
export default { export default {
name: "scientific_research_trends", name: "scientific_research_trends",
@@ -171,8 +172,8 @@ export default {
getArticle(news){ getArticle(news){
toArticle(news,this.width) toArticle(news,this.width)
}, },
lookMore(news) { lookMore(id) {
lookMoreComment(news,this.width) lookMoreFixedComment(id,this.width)
}, },
getScientificList() { getScientificList() {
getArticleList({ getArticleList({

View File

@@ -78,6 +78,7 @@
<script> <script>
import {getArticleList} from "@/api"; import {getArticleList} from "@/api";
import {toArticle,lookMoreComment} from "@/utils/sist"; import {toArticle,lookMoreComment} from "@/utils/sist";
import {lookMoreFixedComment} from "../../../utils/sist";
export default { export default {
name: "teaching_student", name: "teaching_student",
@@ -95,7 +96,8 @@ export default {
toArticle(news,this.width) toArticle(news,this.width)
}, },
lookMore(news) { lookMore(news) {
lookMoreComment(news,this.width) // lookMoreComment(news,this.width)
lookMoreFixedComment("KW_T7dJ2lt5sC-RJZSnPtk0",this.width)
}, },
getListData(){ getListData(){
@@ -110,9 +112,12 @@ export default {
getDay(time){ getDay(time){
return new Date(time).getDate() return new Date(time).getDate()
}, },
getTime(time){ getTime(date){
let date = new Date(time); let time = new Date(date);
return date.getFullYear() +"-" + date.getMonth()+1 let year = time.getFullYear();
let month = time.getMonth() + 1
let day = time.getDate();
return year + "-" + month + "-" + day;
} }
} }
} }
@@ -167,9 +172,11 @@ export default {
.tw_context_text { .tw_context_text {
margin-top: .8rem; margin-top: .8rem;
font-size: 1.6rem; font-size: 1.6rem;
height: 6.5rem;
font-weight: 400; font-weight: 400;
overflow: hidden;
color: #757575 !important; color: #757575 !important;
letter-spacing: 1px;
overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display:-webkit-box; //作为弹性伸缩盒子模型显示。 display:-webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列 -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列

View File

@@ -186,6 +186,7 @@ export default {
data: res.rows, data: res.rows,
total: res.total, total: res.total,
pageNum: data.pageNum, pageNum: data.pageNum,
pageSize: data.pageSize,
navId: this.navId, navId: this.navId,
secondId: this.secondId, secondId: this.secondId,
} }