Browse Source

文章详情查询bug

master
aBin 3 years ago
parent
commit
fd0b951d0d
  1. 12
      .env.production
  2. BIN
      dist.zip
  3. 19
      src/components/RichText/RichText.vue
  4. 26
      src/views/OtherPages/Department.vue
  5. 26
      src/views/OtherPages/Information.vue

12
.env.production

@ -1,10 +1,10 @@
VUE_APP_MODE=production VUE_APP_MODE=production
VUE_APP_NODE_ENV=production VUE_APP_NODE_ENV=production
VUE_APP_SCENE=/datang/ VUE_APP_SCENE=/
VUE_APP_BASE_URL=https://test.tall.wiki VUE_APP_BASE_URL=http://10.119.190.12:8000
VUE_APP_API_URL=https://test.tall.wiki/datang/v1.0 VUE_APP_API_URL=http://10.119.190.12:8000/v1.0
VUE_APP_PROXY_URL=/datang/v1.0 VUE_APP_PROXY_URL=/v1.0
VUE_APP_PUBLIC_PATH=/datang VUE_APP_PUBLIC_PATH=
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://192.168.101.69:8000/websocket/message/v4.0/ws
VUE_APP_TITLE=大唐 VUE_APP_TITLE=大唐
VUE_APP_DESCRIPTION=大唐 VUE_APP_DESCRIPTION=大唐

BIN
dist.zip

Binary file not shown.

19
src/components/RichText/RichText.vue

@ -17,8 +17,9 @@
<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.files && richObj.files.length"> <template v-if="richObj && richObj.files && richObj.files.length">
<div>附件 <div>
<div v-for="file in richObj.files"> 附件
<div v-for="file in richObj.files" :key="file.path">
<a :href="file.path" target="_blank">{{ file.name }}</a> <a :href="file.path" target="_blank">{{ file.name }}</a>
</div> </div>
</div> </div>
@ -37,17 +38,15 @@ export default {
data() { data() {
return { code: '' }; return { code: '' };
}, },
watch: { watch: {},
// richObj(val) { // richObj(val) {
// if (val.jumpUrl) { // if (val.jumpUrl) {
// window.open(val.jumpUrl); // window.open(val.jumpUrl);
// } // }
// }, // },
},
mounted() { mounted() {
this.code = this.$route.query.code; this.code = this.$route.query.code;
}, },
}; };
</script> </script>

26
src/views/OtherPages/Department.vue

@ -10,7 +10,8 @@
<template <template
v-if=" v-if="
code.length === 6 && code.length === 6 &&
(code.split('')[5] === '4' || code.split('')[5] === '6' || code.split('')[5] === '7' || code.split('')[5] === '8') (code.split('')[5] === '4' || code.split('')[5] === '6' || code.split('')[5] === '7' || code.split('')[5] === '8') &&
!introId
" "
> >
<ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" /> <ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" />
@ -652,6 +653,7 @@ export default {
], ],
}, },
year: '2022', year: '2022',
introId: '',
pageNum: 1, pageNum: 1,
content: {}, content: {},
}; };
@ -672,12 +674,18 @@ export default {
} else { } else {
this.getData(this.code); this.getData(this.code);
} }
this.content = {};
} }
}, },
}, },
created() { created() {
this.code = this.$route.query.code; this.code = this.$route.query.code;
this.getDetault(this.code); this.getDetault(this.code);
if (this.$route.query.introId) {
console.log('this.$route.query.introId: ', this.$route.query.introId);
this.introId = this.$route.query.introId;
this.getIntroContent();
}
if ( if (
this.code.length === 6 && this.code.length === 6 &&
(this.code.split('')[5] === '4' || this.code.split('')[5] === '6' || this.code.split('')[5] === '7' || this.code.split('')[5] === '8') (this.code.split('')[5] === '4' || this.code.split('')[5] === '6' || this.code.split('')[5] === '7' || this.code.split('')[5] === '8')
@ -689,6 +697,22 @@ export default {
}, },
methods: { methods: {
...mapActions('home', ['getDetail', 'getContent']), ...mapActions('home', ['getDetail', 'getContent']),
//
async getIntroContent() {
try {
this.showLoading = true;
const param = {
showPage: '',
introId: this.introId,
};
const data = await this.getDetail(param);
this.showLoading = false;
this.content = data || {};
} catch (error) {
this.showLoading = false;
console.error('error: ', error);
}
},
// //
getDetault(val) { getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) { for (let i = 0; i < this.list.children.length; i++) {

26
src/views/OtherPages/Information.vue

@ -7,7 +7,7 @@
<div class="flex-1 flex-column"> <div class="flex-1 flex-column">
<Location :title="defaultTitle" /> <Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }"> <div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<template v-if="code.length === 6 && (code === '060101' || code === '060503')"> <template v-if="code.length === 6 && (code === '060101' || code === '060503') && !introId">
<RichText :rich-obj="content" /> <RichText :rich-obj="content" />
</template> </template>
<ListPage v-else :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" /> <ListPage v-else :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" />
@ -103,6 +103,7 @@ export default {
}, },
year: '2022', year: '2022',
pageNum: 1, pageNum: 1,
introId: '',
content: {}, content: {},
}; };
}, },
@ -116,12 +117,19 @@ export default {
} else { } else {
this.getContentData(this.code); this.getContentData(this.code);
} }
this.content = {};
} }
}, },
}, },
created() { created() {
this.code = this.$route.query.code; this.code = this.$route.query.code;
console.log('this.$route.query: ', this.$route.query);
this.getDetault(this.code); this.getDetault(this.code);
if (this.$route.query.introId) {
console.log('this.$route.query.introId: ', this.$route.query.introId);
this.introId = this.$route.query.introId;
this.getIntroContent();
}
if (this.code.length === 6 && (this.code === '060101' || this.code === '060503')) { if (this.code.length === 6 && (this.code === '060101' || this.code === '060503')) {
this.getContentData(this.code); this.getContentData(this.code);
} else { } else {
@ -130,6 +138,22 @@ export default {
}, },
methods: { methods: {
...mapActions('home', ['getDetail', 'getContent']), ...mapActions('home', ['getDetail', 'getContent']),
//
async getIntroContent() {
try {
this.showLoading = true;
const param = {
showPage: '',
introId: this.introId,
};
const data = await this.getDetail(param);
this.showLoading = false;
this.content = data || {};
} catch (error) {
this.showLoading = false;
console.error('error: ', error);
}
},
// //
getDetault(val) { getDetault(val) {
for (let i = 0; i < this.list.children.length; i++) { for (let i = 0; i < this.list.children.length; i++) {

Loading…
Cancel
Save