clay fix : 关闭一系列bug

This commit is contained in:
clay
2022-10-04 17:17:55 +08:00
parent 698adad066
commit 65e7a1ad86
7 changed files with 122 additions and 82 deletions

View File

@@ -2,6 +2,11 @@ import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
Vue.use(VueRouter) Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const routes = [ const routes = [
// { // {

View File

@@ -3,8 +3,8 @@
<el-row> <el-row>
<el-col> <el-col>
<div class="context"> <div class="context">
<div class="title">{{value.title}}</div> <div v-if="value" class="title">{{ value.title }}</div>
<div class="text" v-html="value.content"></div> <div v-if="value" class="text" v-html="value.content"></div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@@ -15,17 +15,30 @@
export default { export default {
name: "Introduction", name: "Introduction",
props: { props: {
value: { introduction: {
type: Object, type: Object,
default: { default() {
title:"12", return {
content:"12" }
}, },
}, },
}, },
data() { data() {
return{} return {
introductionData : this.value
} }
},
watch:{
value(val){
this.introductionData = val
}
},
created() {
this.value = {
title: "12",
content: "12"
}
},
} }
</script> </script>
@@ -33,12 +46,14 @@ export default {
.Introduction { .Introduction {
width: 100%; width: 100%;
} }
.tab { .tab {
margin-left: 1.9rem; margin-left: 1.9rem;
margin-top: 1.5rem; margin-top: 1.5rem;
font-weight: 400; font-weight: 400;
font-size: 1.4rem !important; font-size: 1.4rem !important;
} }
.context { .context {
margin: 3rem 4rem; margin: 3rem 4rem;
@@ -54,7 +69,8 @@ export default {
margin-top: 2rem; margin-top: 2rem;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: 400; font-weight: 400;
color: #3C3C3C;word-break: break-word; /* 文本行的任意字内断开 */ color: #3C3C3C;
word-break: break-word; /* 文本行的任意字内断开 */
word-wrap: break-word; /* IE */ word-wrap: break-word; /* IE */
white-space: -moz-pre-wrap; /* Mozilla */ white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP printers */ white-space: -hp-pre-wrap; /* HP printers */

View File

@@ -3,30 +3,28 @@
<el-row v-for="(dire,index) in value" :key="index"> <el-row v-for="(dire,index) in value" :key="index">
<!--正文内容--> <!--正文内容-->
<el-col class="context"> <el-col class="context" :span="23">
<el-row class="context_el-row"> <el-row class="context_el-row">
<el-col :span="2" :offset="1"> <el-col :span="1" :offset="1">
<img class="context_img" src="@/assets/teaching_staff/eji_icon_ys.png" alt=""> <img class="context_img" src="@/assets/teaching_staff/eji_icon_ys.png" alt="">
</el-col> </el-col>
<el-col :span="3" class="context_name">{{ dire.name }}</el-col> <el-col :span="4" class="context_name">{{ dire.name }}</el-col>
<el-col :span="16"> <el-col :span="16">
<hr class="context_hr"> <hr class="context_hr">
</el-col> </el-col>
</el-row>
<el-row v-for="(chile,index) in dire.children" :key="index"> <el-row v-for="(chile,index) in dire.children" :key="index">
<el-col class="name" :offset="1" :span="23"> <el-col class="name" :offset="1" :span="23">
{{ chile.name }}<span v-if="chile.children.length>1">({{chile.children.length}})</span> {{ chile.name }}<span v-if="chile.children.length>1">({{chile.children.length}})</span>
</el-col> </el-col>
<el-row>
<el-col class="text" :offset="1" :span="23"> <el-col class="text" :offset="1" :span="23">
<div v-for="(item,index) in chile.children" :key="index"> <div v-for="(item,index) in chile.children" :key="index">
<a style="text-decoration: none" :href="item.link"> <a :href="item.link">
{{ item.name }} {{ item.name }}
</a> </a>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-row>
</el-row>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@@ -68,7 +66,7 @@ export default {
margin: 3rem 2rem; margin: 3rem 2rem;
padding-bottom: 3rem; padding-bottom: 3rem;
//width: 84.3rem; //width: 84.3rem;
background: #FFFFFF; //background: #FFFFFF;
.context_el-row { .context_el-row {
margin-top: 2rem; margin-top: 2rem;
@@ -89,6 +87,7 @@ export default {
line-height: 2.2rem; line-height: 2.2rem;
margin-top: 1.1rem; margin-top: 1.1rem;
border: #1956BC solid 0.1rem; border: #1956BC solid 0.1rem;
background-color: #1956BC;
} }
} }
@@ -96,16 +95,25 @@ export default {
margin-top: 2rem; margin-top: 2rem;
font-size: 1.6rem; font-size: 1.6rem;
font-weight: 600; font-weight: 600;
color: #1956BC; //color: #1956BC;
} }
.text { .text {
font-size: 1.4rem; font-size: 1.4rem;
color: #3C3C3C; //color: #3C3C3C;
clear: left; clear: left;
div { div {
float: left; float: left;
margin-top: .4rem; margin-top: .4rem;
width: 7.4%; //width: 7.4%;
margin-left: 1rem;
margin-right: 1rem;
a{
color: #000000;
text-decoration: none
}
a:hover{
color: #1956BC;
}
} }
} }
} }

View File

@@ -21,8 +21,8 @@
</div> </div>
<div> <div>
<!--正文内容--> <!--正文内容-->
<div class="context"> <div class="context" v-if="listData">
<div v-for="(item,index) in value.data" class="tw"> <div v-for="(item,index) in listData.data" class="tw">
<el-row> <el-row>
<el-col :xs="6" :sm="6" :md="5" :lg="4" :xl="4"> <el-col :xs="6" :sm="6" :md="5" :lg="4" :xl="4">
<div class="tw_time"> <div class="tw_time">
@@ -48,21 +48,21 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<hr v-if="index != value.data.length-1" style="border: 0.1rem solid #E6E6E6;" class="hr"> <hr v-if="index != listData.data.length-1" style="border: 0.1rem solid #E6E6E6;" class="hr">
</div> </div>
</div> </div>
<el-row> <el-row>
<el-col class="pagination_p"> <el-col class="pagination_p">
<el-pagination class="pagination" <el-pagination class="pagination" v-if="listData"
:small="small" :small="small"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page.sync="value.pageNum" :current-page.sync="listData.pageNum"
:page-sizes="[5,10,20, 30, 50, 100]" :page-sizes="[5,10,20, 30, 50, 100]"
:page-size="4" :page-size="4"
layout="prev, pager, next,sizes, jumper" layout="prev, pager, next,sizes, jumper"
:total="value.total"> :total="listData.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
</el-row> </el-row>
@@ -76,7 +76,7 @@ import {getNode} from "@/api";
export default { export default {
name: "list", name: "list",
props: { props: {
value: { list: {
type: Object, type: Object,
default() { default() {
return { return {
@@ -89,11 +89,17 @@ export default {
}, },
data() { data() {
return { return {
listData : this.list,
width: document.documentElement.clientWidth, width: document.documentElement.clientWidth,
small: document.documentElement.clientWidth <= 992, small: document.documentElement.clientWidth <= 992,
query: '', query: '',
} }
}, },
watch:{
list(val){
this.listData = val
}
},
methods: { methods: {
getContext(context) { getContext(context) {
let type = this.$route.query && this.$route.query.type let type = this.$route.query && this.$route.query.type
@@ -101,50 +107,50 @@ export default {
if (type != null) { if (type != null) {
router = "?id=" + context.id + '&type=' + type + "&lang=" + sessionStorage.getItem("lang") router = "?id=" + context.id + '&type=' + type + "&lang=" + sessionStorage.getItem("lang")
} else { } else {
router = "/" + this.value.navId + "?id=" + context.id + "&lang=" + sessionStorage.getItem("lang") router = "/" + this.listData.navId + "?id=" + context.id + "&lang=" + sessionStorage.getItem("lang")
} }
let routeData = null; let routeData = null;
if (this.width <= 992) { if (this.width <= 992) {
routeData = this.$router.resolve({path: "/mobile/" + this.value.secondId + router}); routeData = this.$router.resolve({path: "/mobile/" + this.listData.secondId + router});
} else { } else {
routeData = this.$router.resolve({path: "/pc/" + this.value.secondId + router}); routeData = this.$router.resolve({path: "/pc/" + this.listData.secondId + router});
} }
window.open(routeData.href,"_blank") window.open(routeData.href,"_blank")
}, },
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
if (val === -1) { if (val === -1) {
this.value.pageSize = 1 this.listData.pageSize = 1
} else { } else {
this.value.pageSize = val this.listData.pageSize = val
} }
this.getData() this.getData()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
if (val === -1) { if (val === -1) {
this.value.pageNum = 1 this.listData.pageNum = 1
} else { } else {
this.value.pageNum = val this.listData.pageNum = val
} }
this.getData() this.getData()
}, },
getData() { getData() {
let data = { let data = {
title: this.query, title: this.query,
id: this.value.navId, id: this.listData.navId,
pageNum: this.value.pageNum, pageNum: this.listData.pageNum,
pageSize: this.value.pageSize pageSize: this.listData.pageSize
} }
this.type = this.$route.query && this.$route.query.type this.type = this.$route.query && this.$route.query.type
if (this.type != null && this.type !== 0) { if (this.type != null && this.type !== 0) {
data.id = this.value.secondId data.id = this.listData.secondId
} else { } else {
console.log(this.value); console.log(this.listData);
} }
console.log(data); // console.log(data);
getNode(data).then(res => { getNode(data).then(res => {
this.value.data = res.rows this.listData.data = res.rows
this.value.total = res.total this.listData.total = res.total
}) })
}, },
getDay(time) { getDay(time) {

View File

@@ -22,7 +22,7 @@
</el-col> </el-col>
<el-col v-if="$i18n.locale === 'cn'" v-show="width" :md="6" :lg="6" :xl="4"> <el-col v-if="$i18n.locale === 'cn'" v-show="width" :md="6" :lg="6" :xl="4">
<div class="left_lab" ref="lab"> <div class="left_lab" ref="lab">
<div class="lab"> <div class="lab" v-if="navList">
<div v-for="(nav,index) in navList" class="lab_div"> <div v-for="(nav,index) in navList" class="lab_div">
<div v-if="index === showIndex" class="lab_list lab_select" @click="navClick(nav,index)"> <div v-if="index === showIndex" class="lab_list lab_select" @click="navClick(nav,index)">
<div class="lab_img"> <div class="lab_img">
@@ -99,8 +99,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col> <el-col>
<Introduction :value="contextData" v-if="type === 1"/> <Introduction :introduction="contextData" v-if="type === 1"/>
<List :value="contextData" v-if="type === 2"/> <List :list="contextData" v-if="type === 2"/>
<FileList :value="contextData" v-if="type === 4"/> <FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type === 3 && organizationType == '1'"/> <DireData :value="contextData" v-if="type === 3 && organizationType == '1'"/>
<Organization :value="contextData" v-if="type === 3 && organizationType == '2'"/> <Organization :value="contextData" v-if="type === 3 && organizationType == '2'"/>
@@ -138,8 +138,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col> <el-col>
<Introduction :value="contextData" v-if="type === 1"/> <Introduction :introduction="contextData" v-if="type === 1"/>
<List :value="contextData" v-if="type === 2"/> <List :list="contextData" v-if="type === 2"/>
<FileList :value="contextData" v-if="type === 4"/> <FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type === 3 && organizationType == '1'"/> <DireData :value="contextData" v-if="type === 3 && organizationType == '1'"/>
<Organization :value="contextData" v-if="type === 3 && organizationType == '2'"/> <Organization :value="contextData" v-if="type === 3 && organizationType == '2'"/>
@@ -366,7 +366,7 @@ export default {
getNode(data).then(res => { getNode(data).then(res => {
console.log(res, "res值") console.log(res, "res值")
console.log(this.type); console.log(this.type);
if (null == res.data){ if (null == res.data && null == res.rows) {
this.contextData = null this.contextData = null
console.log("将值设为null", this.contextData) console.log("将值设为null", this.contextData)
this.type = 0 this.type = 0
@@ -397,7 +397,6 @@ export default {
}, },
/** /**
* 菜单点击,路由切换 * 菜单点击,路由切换
* @param nav * @param nav
@@ -468,7 +467,8 @@ export default {
.lab_div { .lab_div {
border-bottom: 0.1rem solid #94BCFF !important; border-bottom: 0.1rem solid #94BCFF !important;
margin-left: 1rem; //margin-left: 1rem;
width: 100%;
} }
.lab_div:last-child { .lab_div:last-child {
@@ -479,7 +479,7 @@ export default {
.lab_list { .lab_list {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
width: 19rem; //width: 19rem;
height: 8rem; height: 8rem;
clear: left; clear: left;
line-height: 8rem; line-height: 8rem;
@@ -490,7 +490,7 @@ export default {
width: 1.4rem; width: 1.4rem;
height: 1.4rem; height: 1.4rem;
display: none; display: none;
margin-left: 3rem; margin-left: 1rem;
img { img {
width: 100%; width: 100%;
@@ -500,7 +500,7 @@ export default {
.lab_title { .lab_title {
color: #1956BC; color: #1956BC;
float: left; float: left;
margin-left: 5rem; margin-left: 3rem;
} }
} }

View File

@@ -95,8 +95,8 @@
<!--<div class="secondary" v-if="index == 5">--> <!--<div class="secondary" v-if="index == 5">-->
</div> </div>
</span> </span>
<div class="iconfont"><img src="@/assets/header/denglu.png" alt=""></div> <div class="iconfont" @click="login"><img src="@/assets/header/denglu.png" alt=""></div>
<div class="switchLang"><img src="@/assets/header/en.png" alt=""></div> <div class="switchLang" @click="switchLang"><img src="@/assets/header/en.png" alt=""></div>
</div> </div>
</el-col> </el-col>
</div> </div>
@@ -141,6 +141,10 @@ export default {
console.log(menu); console.log(menu);
this.$router.push("/pc/" + menu.encodeId + "?type=" + menu.type + "&lang=" + sessionStorage.getItem("lang")); this.$router.push("/pc/" + menu.encodeId + "?type=" + menu.type + "&lang=" + sessionStorage.getItem("lang"));
}, },
login(){
let routeData = this.$router.resolve("/admin");
window.open(routeData.href,"_blank")
},
switchLang() { switchLang() {
let lang = ""; let lang = "";
if (this.$i18n.locale === "en") { if (this.$i18n.locale === "en") {

View File

@@ -32,8 +32,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col> <el-col>
<Introduction :value="contextData" v-if="type === 1"/> <Introduction :introduction="contextData" v-if="type === 1"/>
<List :value="contextData" v-if="type === 2"/> <List :list="contextData" v-if="type === 2"/>
<FileList :value="contextData" v-if="type === 4"/> <FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type === 3"/> <DireData :value="contextData" v-if="type === 3"/>
<Details :value="detailsData" v-if="type == null"/> <Details :value="detailsData" v-if="type == null"/>
@@ -233,7 +233,8 @@ export default {
.lab_div { .lab_div {
border-bottom: 0.1rem solid #94BCFF !important; border-bottom: 0.1rem solid #94BCFF !important;
margin-left: 1rem; //margin-left: 1rem;
width: 100%;
} }
.lab_div:last-child { .lab_div:last-child {