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; this.route = val;
}, },
'$route.query.code'(val) { '$route.query.code'(val) {
console.log('val: ', val);
if (val) { if (val) {
this.code = val; this.code = val;
} else { } else {

4
src/components/LeftNav/LeftNav.vue

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

12
src/components/RichText/RichText.vue

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

8
src/config/api.js

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

14
src/views/OtherPages/Department.vue

@ -678,8 +678,18 @@ export default {
// //
getDetault(val) { getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) { for (let i = 0; i < this.list.children.length; i++) {
if (val === this.list.children[i].code) { const firstChild = this.list.children[i];
this.defaultTitle = this.list.children[i].title; 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) { getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) { for (let i = 0; i < this.list.children.length; i++) {
if (val === this.list.children[i].code) { const firstChild = this.list.children[i];
this.defaultTitle = this.list.children[i].title; 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