Browse Source

部分bug修改

master
song 3 years ago
parent
commit
2af486497e
  1. 1
      src/components/Carousel/Carousel.vue
  2. 4
      src/components/LeftNav/LeftNav.vue
  3. 12
      src/components/RichText/RichText.vue
  4. 8
      src/config/api.js
  5. 14
      src/views/OtherPages/Department.vue
  6. 14
      src/views/OtherPages/Information.vue

1
src/components/Carousel/Carousel.vue

@ -35,7 +35,6 @@ export default {
this.route = val;
},
'$route.query.code'(val) {
console.log('val: ', val);
if (val) {
this.code = val;
} else {

4
src/components/LeftNav/LeftNav.vue

@ -58,7 +58,6 @@ export default {
methods: {
changeQuery(code, url, item) {
console.log('code, url, item: ', code, url, item);
let childCode = code;
if (item && item.children && item.children.length) {
childCode = item.children[0].code;
@ -69,7 +68,8 @@ export default {
this.$emit('chanegCode', code);
this.childCode = code;
} else if (code === this.code) {
this.$emit('resetData');
const path = window.location.href.split('?')
window.location.href= path[0]+`?code=${code}`
}
} else {
if (url === '/') {

12
src/components/RichText/RichText.vue

@ -16,8 +16,12 @@
<template v-if="richObj && richObj.title">
<div v-if="richObj.editor" class="mt-5" style="text-align: right">[责编: {{ richObj.editor }}]</div>
</template>
<template v-if="richObj && richObj.jumpUrl">
<div>附件<a :href="richObj.jumpUrl" target="_blank">{{ richObj.title }}</a></div>
</template>
</div>
</template>
<script>
export default {
props: {
@ -31,7 +35,6 @@ export default {
},
watch: {
richObj(val) {
console.log('val: ', val);
if (val.jumpUrl) {
window.open(val.jumpUrl);
}
@ -40,13 +43,10 @@ export default {
mounted() {
this.code = this.$route.query.code;
},
created() {
if (this.richObj.jumpUrl) {
window.open(this.richObj.jumpUrl);
}
},
};
</script>
<style scoped>
.content-size {
/* font-family: '宋体'; */

8
src/config/api.js

@ -15,15 +15,15 @@ export const carouselQuery = params => axios.post(`${carousel}/query`, params);
// 官网首页列表查询
export const getContent = params =>
axios.get(
`${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}
&pageNum=${params.pageNum}&pageSize=${params.pageSize}&title=${params.title || ''}`,
`${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${
params.pageSize
}&title=${params.title || ''}`,
);
// 查询图片新闻列表
export const getContentImg = params =>
axios.get(
`${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}
&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
`${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
);
// 官网内容详情查询

14
src/views/OtherPages/Department.vue

@ -678,8 +678,18 @@ export default {
//
getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) {
if (val === this.list.children[i].code) {
this.defaultTitle = this.list.children[i].title;
const firstChild = this.list.children[i];
if (val === firstChild.code) {
this.defaultTitle = firstChild.title;
}else{
if(firstChild.children && firstChild.children.length){
for (let j = 0; j < firstChild.children.length; j++) {
const secondChild = firstChild.children[j];
if (val === secondChild.code) {
this.defaultTitle = secondChild.title;
}
}
}
}
}
},

14
src/views/OtherPages/Information.vue

@ -119,8 +119,18 @@ export default {
//
getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) {
if (val === this.list.children[i].code) {
this.defaultTitle = this.list.children[i].title;
const firstChild = this.list.children[i];
if (val === firstChild.code) {
this.defaultTitle = firstChild.title;
}else{
if(firstChild.children && firstChild.children.length){
for (let j = 0; j < firstChild.children.length; j++) {
const secondChild = firstChild.children[j];
if (val === secondChild.code) {
this.defaultTitle = secondChild.title;
}
}
}
}
}
},

Loading…
Cancel
Save