Browse Source

网站细节修改

master
aBin 3 years ago
parent
commit
43d2dcd40e
  1. 8
      src/components/BayWindow/BayWindow.vue
  2. 17
      src/components/Carousel/Carousel.vue
  3. 12
      src/components/Footer/Footer.vue
  4. 24
      src/components/HeadNav/HeadNav.vue
  5. 24
      src/components/LeftNav/LeftNav.vue
  6. BIN
      src/components/LeftNav/title-bg.png
  7. 47
      src/components/ListPage/ListPage.vue
  8. 42
      src/components/Location/Location.vue
  9. 38
      src/components/RichText/Relevant.vue
  10. 6
      src/components/RichText/RichText.vue
  11. 10
      src/config/api.js
  12. 12
      src/router/index.js
  13. 15
      src/store/modules/home/actions.js
  14. 47
      src/views/FirstPages/FirstPage.vue
  15. 52
      src/views/NewPages/NewPages.vue
  16. 15
      src/views/OtherPages/Department.vue
  17. 15
      src/views/OtherPages/Information.vue
  18. 24
      src/views/OtherPages/NoticeNotice.vue
  19. 24
      src/views/OtherPages/PartyBuilding.vue
  20. 133
      src/views/OtherPages/PilePages.vue
  21. 24
      src/views/OtherPages/SafeProduction.vue
  22. 141
      src/views/OtherPages/Search.vue
  23. 15
      src/views/OtherPages/System.vue

8
src/components/BayWindow/BayWindow.vue

@ -2,7 +2,7 @@
<div>
<div id="bay" @mouseout="mouseout" @mouseover="mouseover">
<a-icon class="bay-icon" type="close-circle" @click="close" />
<div class="bay-content">
<div class="bay-content" @click="openPage">
<div class="d-flex justify-center align-center bay-title">
<!-- {{ content.content.source }} -->
<div class="title-bg" v-for="(item, index) in content.contentValue" :key="index">{{ item }}</div>
@ -84,6 +84,12 @@ export default {
close() {
this.$emit('closeBay');
},
openPage() {
this.$router.push({
path: '/notice',
query: { code: '0505' },
});
},
},
};
</script>

17
src/components/Carousel/Carousel.vue

@ -2,7 +2,7 @@
<div>
<a-carousel autoplay :dots="false">
<div v-for="item in imgList" :key="item.id">
<img style="height: 380px;cursor: pointer;" :src="item.url" @click="openImg(item.url)" />
<img style="height: 380px;cursor: pointer" :src="item.url" @click="openImg(item.url)" />
</div>
</a-carousel>
<div class="slogan">
@ -26,15 +26,28 @@ export default {
return {
imgList: [],
str: '',
code: '0000',
};
},
watch: {
'$route.query.code'(val) {
console.log('val: ', val);
if (val) {
this.code = val;
} else {
this.code = '0000';
}
this.getImg();
},
},
created() {
this.code = this.$route.query.code || '0000';
this.getImg();
},
methods: {
async getImg() {
try {
const params = { param: { showPage: '0000' } };
const params = { param: { showPage: this.code } };
const res = await carouselQuery(params);
const { data, code, msg } = res.data;
this.imgList = [...data];

12
src/components/Footer/Footer.vue

@ -11,7 +11,7 @@
<div class="d-flex" style="margin-top:20px" :class="isTrue ? '' : 'justify-center'">
<div class="footer-title">
<p style="font-size:24px;rgb(51,51,51);font-weight:bold;">网上展厅</p>
<p style="font-size:18px;rgb(102,102,102)">公示公告</p>
<p style="font-size:18px;rgb(102,102,102)" @click="jumpPage('notice', '0503')">公示公告</p>
<p style="font-size:18px;rgb(102,102,102)">数字大唐</p>
</div>
<div class="footer-title">
@ -22,7 +22,7 @@
<div class="footer-title">
<p style="font-size:24px;rgb(51,51,51);font-weight:bold;">资料下载</p>
<p style="font-size:18px;rgb(102,102,102)">责任报告</p>
<p style="font-size:18px;rgb(102,102,102)">企业VI</p>
<p style="font-size:18px;rgb(102,102,102)" @click="jumpPage('profile', '0104')">企业VI</p>
</div>
<img src="./erweima.png" style="width:164px;height:94px" alt="" />
</div>
@ -79,7 +79,6 @@ export default {
async getData() {
try {
const res = await getLink();
console.log(res.data.data);
const { code, msg, data } = res.data;
if (code === 200) {
const obj = {
@ -93,6 +92,13 @@ export default {
openPage(url) {
window.open(url);
},
jumpPage(url, code) {
// this.$router.push({
// path: url,
// query: { code },
// });
window.open(`http://${window.location.host}/${url}?code=${code}`);
},
},
};
</script>

24
src/components/HeadNav/HeadNav.vue

@ -396,6 +396,19 @@ export default {
showPage: 0,
};
},
watch: {
'$route.path'(val) {
for (let i = 0; i < this.tabList.length; i++) {
const item = this.tabList[i];
if (val === item.url) {
this.showPage = i;
return;
} else {
this.showPage = 99;
}
}
},
},
created() {
setTimeout(() => {
for (let i = 0; i < this.tabList.length; i++) {
@ -406,8 +419,8 @@ export default {
}, 100);
},
methods: {
onSearch() {
console.log('点击了搜索按钮,但是没有搜索事件');
onSearch(e) {
window.open(`http://${window.location.host}/search?text=${e}`);
},
jumpPage(index, url, children) {
if (this.showPage === index) {
@ -507,13 +520,16 @@ export default {
color: #cc2626;
}
/deep/.ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) {
border-color: #d9d9d9;
border-color: #ae0002;
border-right-width: 1px !important;
}
/deep/.ant-input:focus {
border-color: #d9d9d9;
border-color: #ae0002;
border-right-width: 1px !important;
outline: 0;
box-shadow: 0 0 0 2px rgb(217 217 217 /20%);
}
/* /deep/.ant-input {
border-color: #ae0002;
} */
</style>

24
src/components/LeftNav/LeftNav.vue

@ -1,6 +1,6 @@
<template>
<div>
<div class="left-title left-nav d-flex align-center justify-center">
<div class="left-title d-flex align-center justify-center">
{{ list.title }}
</div>
<div
@ -8,7 +8,7 @@
:key="item.code"
class="left-nav left-child d-flex align-center justify-center"
:class="code === item.code ? 'active' : ''"
@click="changeQuery(item.code)"
@click="changeQuery(item.code, item.url)"
>
{{ item.title }}
</div>
@ -32,12 +32,18 @@ export default {
},
methods: {
changeQuery(code) {
if (code !== this.code) {
changeQuery(code, url) {
if (this.code && code !== this.code) {
this.$router.push({
query: { code },
});
this.$emit('chanegCode', code);
} else {
if (url === '/') {
window.open(`http://${window.location.host}`);
} else {
window.open(`http://${window.location.host}${url}?code=${code}`);
}
}
},
},
@ -49,11 +55,17 @@ export default {
color: #fff;
font-size: 24px;
font-weight: bold;
width: 240px;
height: 56px;
border-bottom: 1px solid rgba(112, 112, 112, 0.1);
background-image: url('./title-bg.png');
background-size: 100% 100%;
}
.left-nav {
width: 240px;
height: 56px;
border-bottom: 1px solid rgba(112, 112, 112, 0.1);
margin-bottom: 1px;
}
.left-child {
background-color: #fff;
@ -62,12 +74,12 @@ export default {
transition: all 0.2s;
}
.left-nav:hover {
background-color: rgba(174, 0, 2, 0.4);
background-color: #b54343;
border-left: 4px solid rgb(174, 0, 2);
color: #fff;
}
.active {
background-color: rgba(174, 0, 2, 0.4);
background-color: #b54343;
border-left: 4px solid rgb(174, 0, 2);
color: #fff;
}

BIN
src/components/LeftNav/title-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

47
src/components/ListPage/ListPage.vue

@ -1,22 +1,42 @@
<template>
<div style="position:relative;min-height: 300px;">
<div class="year-box">
<div style="position:relative;min-height: 500px;">
<div class="year-box" v-if="code !== 'search'">
<span :class="year - 0 === item.year - 0 ? 'active' : ''" v-for="item in yearList" :key="item.year" @click="changeYear(item.year)">{{
item.year
}}</span>
</div>
<template v-if="code !== '0204' && code !== '0207'">
<ul v-if="content.total - 0" style="max-width: 892px">
<li v-for="item in content.list" :key="item.introId" class="mb-5" @click="openPage(item.introId)">
<div class="d-flex justify-space-between align-center">
<div style="max-width: 680px" class="one-text">{{ item.title }}{{ item.title }}</div>
<div style="max-width: 680px" class="one-text">{{ item.title }}</div>
<div style="width: 110px">[{{ $moment(item.publishTime).format('YYYY - HH - DD') }}]</div>
</div>
</li>
</ul>
</template>
<template v-else>
<div class="d-flex flex-wrap" style="max-width: 892px">
<div
v-for="item in content.list"
:key="item.introId"
style="margin:0 6.5px 16px 6.5px"
class="mb-4"
@click="openPage(item.introId)"
>
<!-- <div> -->
<img v-if="code === '0204'" :src="item.titleUrl" style="width:210px;height:140px" />
<video v-if="code === '0207'" :src="item.titleUrl" style="width:210px;height:140px" />
<div class="mt-2"><span class="mr-2">发表时间: </span> {{ $moment(item.publishTime).format('YYYY-HH-DD') }}</div>
<div><span class="mr-2">作者: </span> {{ item.author }}</div>
<!-- </div> -->
</div>
</div>
</template>
<div v-else style="height: 100%" class="d-flex justify-center align-center">
<a-empty />
</div>
<div style="position:absolute;bottom:16px;width:100%" class="d-flex justify-center align-center">
<div v-if="content.total - 0 > 10" style="position:absolute;right:0;bottom:-20px;" class="d-flex justify-center align-center">
<a-pagination show-quick-jumper :default-current="1" :total="content.total - 0" @change="onChange" />
</div>
</div>
@ -38,29 +58,28 @@ export default {
data() {
return {
yearList: [
{
year: 2020,
},
{
year: 2021,
},
{
year: 2022,
},
],
year: '2020',
year: '2022',
};
},
watch: {
code(val) {
if (val !== 'search') {
this.getYear();
}
},
},
created() {
if (this.code !== 'search') {
this.getYear();
}
},
methods: {
onChange(pageNumber) {
console.log('pageNumber: ', pageNumber);
this.$emit('getData', pageNumber);
},
openPage(id) {
@ -74,10 +93,14 @@ export default {
try {
const params = { showPage: this.code };
const res = await getCondition(params);
console.log('res: ', res);
const { code, msg, data } = res.data;
if (code === 200) {
if (data && data[0]) {
this.yearList = data;
this.year = data[0].year;
} else {
this.year = '2022';
}
} else {
console.error(msg);
}

42
src/components/Location/Location.vue

@ -7,8 +7,13 @@
<img src="@/assets/location.png" alt="" />
您当前位置:
<span class="ml-4" style="cursor: pointer;" @click="backFirst"> 首页 </span>
<span> > {{ titleName }} </span>
<template v-if="title !== '关键词'">
<span @click="backTitle" style="cursor: pointer;"> > {{ titleName }} </span>
<span> > {{ titleTwo }} </span>
</template>
<template v-else>
<span> > {{ title }} </span>
</template>
</div>
</div>
</template>
@ -350,6 +355,20 @@ export default {
},
],
},
{
title: '首页专题',
url: '/pile',
children: [
{
title: '光荣榜',
code: '9902',
},
{
title: '今天我出镜',
code: '9903',
},
],
},
],
titleName: '',
titleTwo: '',
@ -380,7 +399,26 @@ export default {
}
},
backFirst() {
// this.$router.push('/');
this.$router.push('/');
},
backTitle() {
for (let i = 0; i < this.tabList.length; i++) {
const item = this.tabList[i];
if (item.children && item.children.length) {
for (let k = 0; k < item.children.length; k++) {
const itemC = item.children[k];
if (this.title === itemC.title && k !== 0) {
this.$router.push({
path: this.tabList[i].url,
query: {
code: item.children[0].code,
},
});
return;
}
}
}
}
},
},
};

38
src/components/RichText/Relevant.vue

@ -0,0 +1,38 @@
<template>
<div>
<div style="color:#AE0002;font-size:22px">
相关新闻
</div>
<div v-for="item in data.relations" :key="item.introId" class="d-flex justify-space-between article-box my-4">
<div class="article-title one-text" @click="openPages(item.introId)"><span class="mr-4">>></span>{{ item.title }}</div>
<div class="ml-4">[{{ $moment(item.publishTime - 0).format('YYYY - MM - DD') }}]</div>
</div>
</div>
</template>
<script>
export default {
props: {
data: {
default: {},
type: Object,
},
},
data() {
return {};
},
methods: {
openPages(id) {
window.open(`http://${window.location.host}${this.$route.path}?code=${this.$route.query.code}&introId=${id}`);
},
},
};
</script>
<style scoped>
.article-box {
width: 892px;
cursor: pointer;
}
.article-title {
width: 750px;
}
</style>

6
src/components/RichText/RichText.vue

@ -3,9 +3,9 @@
<template v-if="richObj && richObj.title">
<div class="title">{{ richObj.title }}</div>
<div class="source-time d-flex justify-center">
<div class="mr-4">{{ richObj.source }}</div>
<div class="mr-4">{{ richObj.author }}</div>
<div>{{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}</div>
<div class="mr-4">来源: {{ richObj.source }}</div>
<div class="mr-4">作者: {{ richObj.author }}</div>
<div>发表日期: {{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}</div>
</div>
</template>
<div class="mt-4" v-dompurify-html="richObj.content"></div>

10
src/config/api.js

@ -15,9 +15,13 @@ 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}`,
`${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
);
// 查询图片新闻列表
export const getContentImg = params =>
axios.get(
`${content}/list?showPage=0201&showPage=0202&showPage=0203&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
);
// 官网内容详情查询

12
src/router/index.js

@ -60,6 +60,18 @@ const routes = [
name: 'Department',
component: () => import('@/views/OtherPages/Department.vue'),
},
// 首页其它
{
path: '/pile',
name: 'PilePages',
component: () => import('@/views/OtherPages/PilePages.vue'),
},
// 搜索界面
{
path: '/search',
name: 'Search',
component: () => import('@/views/OtherPages/Search.vue'),
},
// // 关于我们界面
// {
// path: '/About/Introduce',

15
src/store/modules/home/actions.js

@ -1,6 +1,6 @@
import axios from 'axios';
import { message } from 'ant-design-vue';
import { getContent, getDetail } from 'config/api';
import { getContent, getDetail, getContentImg } from 'config/api';
const actions = {
/**
@ -22,6 +22,19 @@ const actions = {
message.error('提交失败');
}
},
async getContentImg({ commit, rootState }, param) {
try {
const res = await getContentImg(param);
const { data, code, msg } = res.data;
if (code === 200) {
return data;
} else {
message.error(msg);
}
} catch (error) {
message.error('提交失败');
}
},
/**
* 官网内容详情查询
* @param {any} commit

47
src/views/FirstPages/FirstPage.vue

@ -62,6 +62,7 @@
</div>
</div>
</div>
<!-- 十六字方针 -->
<div class="mt-4 policy">
<img src="@/assets/16fangzhen.png" alt="" />
<p>
@ -147,20 +148,20 @@
</div>
</div>
<!-- 专题报道 光荣榜 今天我出镜 -->
<div class="honor-box mt-4 p-4 d-flex justify-space-between">
<div class="honor-box mt-4 d-flex justify-space-between">
<div class="flex-1 flex-column content-honor mr-4 p-4">
<div class="honor-title d-flex justify-space-between">
<div style="font-size:22px">
<img style="height:26px" src="@/assets/honor-title.png" alt="" />
专题报道
</div>
<div class="d-flex align-center" style="cursor: pointer;">
<div class="d-flex align-center" style="cursor: pointer;" @click="jumpPage('news', '0205')">
更多>
</div>
</div>
<div class="flex-1 flex-column justify-space-between pt-4">
<div v-for="item in specialList" :key="item.introId" class="d-flex justify-space-between">
<div class="one-text" style="cursor: pointer;">{{ item.title }}</div>
<div class="one-text" style="cursor: pointer;" @click="jumpDetail('news', '0205', item.introId)">{{ item.title }}</div>
<div class="ml-4">{{ $moment(item.publishTime).format('MM/DD') }}</div>
</div>
</div>
@ -171,13 +172,13 @@
<img style="height:26px" src="@/assets/honor-title.png" alt="" />
光荣榜
</div>
<div class="d-flex align-center" style="cursor: pointer;">
<div class="d-flex align-center" style="cursor: pointer;" @click="jumpPage('pile', '9902')">
更多>
</div>
</div>
<div class="flex-1 flex-column justify-space-between pt-4">
<div v-for="item in gloryList" :key="item.introId" class="d-flex justify-space-between">
<div class="one-text" style="cursor: pointer;">{{ item.title }}</div>
<div class="one-text" style="cursor: pointer;" @click="jumpDetail('pile', '9902', item.introId)">{{ item.title }}</div>
<div class="ml-4">{{ $moment(item.publishTime).format('MM/DD') }}</div>
</div>
</div>
@ -188,13 +189,13 @@
<img style="height:26px" src="@/assets/honor-title.png" alt="" />
今天我出镜
</div>
<div class="d-flex align-center" style="cursor: pointer;">
<div class="d-flex align-center" style="cursor: pointer;" @click="jumpPage('pile', '9903')">
更多>
</div>
</div>
<div class="flex-1 flex-column justify-space-between pt-4">
<div v-for="item in exitList" :key="item.introId" class="d-flex justify-space-between">
<div class="one-text" style="cursor: pointer;">{{ item.title }}</div>
<div class="one-text" style="cursor: pointer;" @click="jumpDetail('pile', '9903', item.introId)">{{ item.title }}</div>
<div class="ml-4">{{ $moment(item.publishTime).format('MM/DD') }}</div>
</div>
</div>
@ -272,7 +273,7 @@ export default {
this.getData('0202', 'ImgNews2', '1');
this.getData('0203', 'ImgNews3', '1');
this.getData('0210', 'sceneStyle', '1');
this.getData('9901', 'specialList', '0');
this.getData('0205', 'specialList', '0');
this.getData('9902', 'gloryList', '0');
this.getData('9903', 'exitList', '0');
this.getBayData();
@ -298,12 +299,12 @@ export default {
openPage(path, code, id) {
window.open(`${window.location.href}${path}?code=${code}&introId=${id}`);
},
//
async getBayData() {
try {
const res = await getBay();
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data);
const obj = {
title: data.code,
content: JSON.parse(data.value),
@ -315,22 +316,40 @@ export default {
}
} catch (error) {}
},
//
closeBay() {
this.content = null;
},
//
jumpPage(url, code) {
// this.$router.push({
// path: url,
// query: { code },
// });
window.open(`${window.location.href}${url}?code=${code}`);
},
//
jumpDetail(url, code, introId) {
// this.$router.push({
// path: url,
// query: { code, introId },
// });
window.open(`${window.location.href}${url}?code=${code}&introId=${introId}`);
},
},
};
</script>
<style scoped>
.content-honor {
box-shadow: 0 0 10px 1px rgba(33, 79, 159, 0.15);
/* box-shadow: 0 0 10px 1px rgba(33, 79, 159, 0.15); */
flex: 1;
width: 340px;
background-color: #fff;
/* padding: 16px 0 0 0; */
}
.honor-box {
height: 320px;
background-color: #fff;
/* background-color: #fff; */
}
.honor-title {
height: 46px;
@ -339,18 +358,18 @@ export default {
.policy {
position: relative;
color: rgba(210, 15, 16, 0.85);
font-size: 30px;
font-size: 50px;
}
.policy >>> p {
font-weight: bold;
height: 40px;
width: 600px;
width: 850px;
line-height: 40px;
text-align: center;
margin-bottom: 0;
position: absolute;
left: 50%;
margin-left: -300px;
margin-left: -425px;
top: 50%;
margin-top: -20px;
}

52
src/views/NewPages/NewPages.vue

@ -10,6 +10,9 @@
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
<RichText v-else :rich-obj="introContent" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
</div>
@ -22,9 +25,10 @@ import LeftNav from '@/components/LeftNav/LeftNav.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import Relevant from '@/components/RichText/Relevant.vue';
export default {
components: { LeftNav, ListPage, Location, RichText },
components: { LeftNav, ListPage, Location, RichText, Relevant },
data() {
return {
code: '0201',
@ -75,28 +79,29 @@ export default {
},
],
},
year: '2020',
year: '2022',
content: {},
pageNum: 1,
introId: '',
introContent: {},
showType: '0',
};
},
watch: {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getType(this.code);
this.getDetault(val);
this.getContentData();
this.introContent = {};
}
},
},
created() {
this.code = this.$route.query.code;
this.getType(this.code);
this.getDetault(this.code);
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
@ -104,18 +109,41 @@ export default {
this.getContentData();
},
methods: {
...mapActions('home', ['getContent', 'getDetail']),
...mapActions('home', ['getContent', 'getDetail', 'getContentImg']),
// showType
getType(code) {
if (code === '0201' || code === '0202' || code === '0203') {
this.showType = '0';
} else if (code === '0207') {
this.showType = '2';
} else {
this.showType = '1';
}
},
//
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;
}
}
},
async getContentData() {
try {
const param = {
let param = {
showPage: this.code,
year: this.year,
showType: '1',
showType: this.showType,
pageNum: this.pageNum,
pageSize: 10,
};
const data = await this.getContent(param);
console.log('data: ', data);
let data = null;
if (this.showType === '1' && this.code === '0204') {
param.pageSize = 12;
data = await this.getContentImg(param);
} else {
data = await this.getContent(param);
}
this.content = data;
} catch (error) {}
},

15
src/views/OtherPages/Department.vue

@ -104,21 +104,26 @@ export default {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getDetault(val);
this.getData(this.code);
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
this.getData(this.code);
},
methods: {
...mapActions('home', ['getDetail']),
//
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;
}
}
},
async getData(showPage) {
try {
const param = {

15
src/views/OtherPages/Information.vue

@ -60,21 +60,26 @@ export default {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getDetault(val);
this.getData(this.code);
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
this.getData(this.code);
},
methods: {
...mapActions('home', ['getDetail']),
//
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;
}
}
},
async getData(showPage) {
try {
const param = {

24
src/views/OtherPages/NoticeNotice.vue

@ -10,6 +10,9 @@
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
<RichText v-else :rich-obj="introContent" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
</div>
@ -22,9 +25,10 @@ import LeftNav from '@/components/LeftNav/LeftNav.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import Relevant from '@/components/RichText/Relevant.vue';
export default {
components: { LeftNav, ListPage, Location, RichText },
components: { LeftNav, ListPage, Location, RichText, Relevant },
data() {
return {
code: '0501',
@ -55,7 +59,7 @@ export default {
},
],
},
year: '2020',
year: '2022',
content: {},
pageNum: 1,
introId: '',
@ -66,17 +70,15 @@ export default {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getDetault(val);
this.getContentData();
this.introContent = {};
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
@ -85,6 +87,14 @@ export default {
},
methods: {
...mapActions('home', ['getContent', 'getDetail']),
//
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;
}
}
},
async getContentData() {
try {
const param = {

24
src/views/OtherPages/PartyBuilding.vue

@ -10,6 +10,9 @@
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
<RichText v-else :rich-obj="introContent" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
</div>
@ -22,9 +25,10 @@ import LeftNav from '@/components/LeftNav/LeftNav.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import Relevant from '@/components/RichText/Relevant.vue';
export default {
components: { LeftNav, ListPage, Location, RichText },
components: { LeftNav, ListPage, Location, RichText, Relevant },
data() {
return {
code: '0301',
@ -59,7 +63,7 @@ export default {
},
],
},
year: '2020',
year: '2022',
content: {},
pageNum: 1,
introId: '',
@ -70,17 +74,15 @@ export default {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getDetault(val);
this.getContentData();
this.introContent = {};
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
@ -89,6 +91,14 @@ export default {
},
methods: {
...mapActions('home', ['getContent', 'getDetail']),
//
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;
}
}
},
async getContentData() {
try {
const param = {

133
src/views/OtherPages/PilePages.vue

@ -0,0 +1,133 @@
<template>
<div class="bg-bottom">
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }">
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
<RichText v-else :rich-obj="introContent" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapActions } from 'vuex';
import LeftNav from '@/components/LeftNav/LeftNav.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import Relevant from '@/components/RichText/Relevant.vue';
export default {
components: { LeftNav, ListPage, Location, RichText, Relevant },
data() {
return {
code: '9902',
defaultTitle: '光荣榜',
list: {
title: '其它',
url: '/pile',
children: [
{
title: '光荣榜',
code: '9902',
},
{
title: '今天我出镜',
code: '9903',
},
],
},
year: '2022',
content: {},
pageNum: 1,
introId: '',
introContent: {},
};
},
watch: {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = val;
this.getDetault(val);
this.getContentData();
this.introContent = {};
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
}
this.getContentData();
},
methods: {
...mapActions('home', ['getContent', 'getDetail']),
//
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;
}
}
},
async getContentData() {
try {
const param = {
showPage: this.code,
year: this.year,
showType: '0',
pageNum: this.pageNum,
pageSize: 10,
};
const data = await this.getContent(param);
console.log('data: ', data);
this.content = data;
} catch (error) {}
},
//
async getIntroContent() {
try {
const param = {
showPage: '',
introId: this.introId,
};
const data = await this.getDetail(param);
this.introContent = data;
} catch (error) {
console.error('error: ', error);
}
},
chanegCode(code) {
this.code = code;
this.introId = '';
},
changeYear(year) {
this.year = year;
this.getContentData();
},
getData(pageNum) {
console.log('pageNum: ', pageNum);
this.pageNum = pageNum;
this.getContentData();
},
},
};
</script>
<style scoped>
.content-detail {
background: #fff;
}
</style>

24
src/views/OtherPages/SafeProduction.vue

@ -10,6 +10,9 @@
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" />
<RichText v-else :rich-obj="introContent" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
</div>
@ -22,9 +25,10 @@ import LeftNav from '@/components/LeftNav/LeftNav.vue';
import ListPage from '@/components/ListPage/ListPage.vue';
import RichText from '@/components/RichText/RichText.vue';
import Location from '@/components/Location/Location.vue';
import Relevant from '@/components/RichText/Relevant.vue';
export default {
components: { LeftNav, ListPage, Location, RichText },
components: { LeftNav, ListPage, Location, RichText, Relevant },
data() {
return {
code: '0401',
@ -55,7 +59,7 @@ export default {
},
],
},
year: '2020',
year: '2022',
content: {},
pageNum: 1,
introId: '',
@ -69,17 +73,15 @@ export default {
console.log('this.list.url: ', this.list.url);
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getDetault(val);
this.getContentData();
this.introContent = {};
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
@ -88,6 +90,14 @@ export default {
},
methods: {
...mapActions('home', ['getContent', 'getDetail']),
//
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;
}
}
},
async getContentData() {
try {
const param = {

141
src/views/OtherPages/Search.vue

@ -0,0 +1,141 @@
<template>
<div class="bg-bottom">
<div class="bg-top">
<div class="content-1180">
<div class="d-flex pt-4">
<LeftNav :list="tabList" class="mr-4" />
<div class="flex-1 flex-column">
<Location :title="defaultTitle" />
<div class="content-detail p-4" :style="{ 'min-height': tabList.children.length * 56 + 'px' }">
<ListPage v-if="!introId" code="search" :content="content" @getData="getData" />
<RichText v-else :rich-obj="introContent" />
</div>
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4">
<Relevant :data="introContent" />
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapActions } from 'vuex';
import LeftNav from 'components/LeftNav/LeftNav.vue';
import Location from 'components/Location/Location.vue';
import ListPage from 'components/ListPage/ListPage.vue';
export default {
components: { LeftNav, Location, ListPage },
data() {
return {
tabList: {
title: '搜索关联',
children: [
{
title: '首页',
url: '/',
},
{
title: '公司概况',
url: '/profile',
code: '0101',
},
{
title: '新闻中心',
url: '/news',
code: '0201',
},
{
title: '党的建设',
url: '/building',
code: '0301',
},
{
title: '安全生产',
url: '/production',
code: '0401',
},
{
title: '通知公告',
url: '/notice',
code: '0501',
},
{
title: '信息公开',
url: '/information',
code: '0601',
},
{ title: '审批事项' },
{
title: '制度资料',
url: '/system',
code: '0801',
},
{
title: '部门首页',
url: '/department',
code: '0901',
},
],
},
content: {},
defaultTitle: '关键词',
text: '',
pageNum: 1,
pageSize: 10,
introId: '',
introContent: {},
};
},
created() {
this.title = this.$route.query.text;
if (this.$route.query.introId) {
this.introId = this.$route.query.introId;
this.getIntroContent();
}
this.getSearchData();
},
methods: {
...mapActions('home', ['getContent', 'getDetail']),
async getSearchData() {
try {
const param = {
showPage: '',
year: '',
showType: '',
pageNum: this.pageNum,
pageSize: this.pageSize,
title: this.title,
};
console.log('param: ', param);
const res = await this.getContent(param);
this.content = res;
} catch (error) {}
},
//
async getIntroContent() {
try {
const param = {
showPage: '',
introId: this.introId,
};
const data = await this.getDetail(param);
this.introContent = data;
} catch (error) {
console.error('error: ', error);
}
},
getData(pageNum) {
console.log('pageNum: ', pageNum);
this.pageNum = pageNum;
this.getSearchData();
},
},
};
</script>
<style scoped>
.content-detail {
background: #fff;
}
</style>

15
src/views/OtherPages/System.vue

@ -72,21 +72,26 @@ export default {
'$route.query.code'(val) {
if (this.$route.path === this.list.url) {
this.code = 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;
}
}
this.getDetault(val);
this.getData(this.code);
}
},
},
created() {
this.code = this.$route.query.code;
this.getDetault(this.code);
this.getData(this.code);
},
methods: {
...mapActions('home', ['getDetail']),
//
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;
}
}
},
async getData(showPage) {
try {
const param = {

Loading…
Cancel
Save