给更多页添加头部和底部并修改本地userid

This commit is contained in:
熊丽君
2021-08-25 11:37:15 +08:00
parent d4417af232
commit febfa87c94
13 changed files with 440 additions and 250 deletions

View File

@ -1,57 +1,84 @@
<template>
<div class="portrait_page content">
<div class="header" v-if="type == 'policy'">
<span class="span">{{ val }}</span>
<el-radio
v-model="queryParams.labelId"
v-for="item in portraitList"
:key="item.id"
:label="item.id"
border
@change="handleClick"
>{{ item.name }}</el-radio
>
</div>
<div class="header" v-else-if="type == 'policyRead'">
<span class="span">{{ val }}</span>
<el-radio
v-model="queryParams.attributeId"
v-for="item in attributeOptions"
:key="item.value"
:label="item.value"
border
@change="handleClick"
>{{ item.label }}</el-radio
>
</div>
<div class="screen_l_b" v-for="item in portraitData" :key="item.id">
<div class="title text_hidden_one pointer">
<router-link
target="_blank"
:to="{
path: '/result',
query: { key: type, id: item.id }
}"
<div class="portrait_page">
<headerPage />
<div class="padding-top content min_h_241">
<div class="search">
<div class="search_input" style="display:flex">
<span v-if="type == 'policy'">政策画像检索</span>
<span v-if="type == 'policyRead'">政策解读检索</span>
<span v-if="type == 'information'">资讯快报检索</span>
<el-input
v-model="queryParams.title"
placeholder="请输入搜索关键字"
@keyup.enter.native="getPortraitList"
></el-input>
<el-button type="warning" @click="getPortraitList">搜索</el-button>
</div>
</div>
<div class="header" v-if="type == 'policy'">
<span class="span">{{ val }}</span>
<el-radio
v-model="queryParams.labelId"
v-for="item in portraitList"
:key="item.id"
:label="item.id"
border
@change="handleClick"
>{{ item.name }}</el-radio
>
{{ item.title }}
</router-link>
</div>
<div class="info" v-if="type != 'information'">
<span>来源{{ item.source }}</span>
<span>发布{{ item.listDate }}</span>
<div class="header" v-else-if="type == 'policyRead'">
<span class="span">{{ val }}</span>
<el-radio
v-model="queryParams.attribute"
v-for="item in attributeOptions"
:key="item.value"
:label="item.value"
border
@change="handleClick"
>{{ item.label }}</el-radio
>
</div>
<div class="info" style="justify-content: flex-end;" v-else>
<span>发布{{ item.createTime }}</span>
<div class="screen_l_b" v-for="item in portraitData" :key="item.id">
<div class="title text_hidden_one pointer">
<router-link
target="_blank"
:to="{
path: '/result',
query: { key: type, id: item.id }
}"
>
{{ item.title }}
</router-link>
</div>
<div class="info" v-if="type != 'information'">
<span>来源{{ item.source }}</span>
<span>发布{{ item.listDate }}</span>
</div>
<div class="info" style="justify-content: flex-end;" v-else>
<span>发布{{ item.createTime }}</span>
</div>
</div>
<div style="text-align: center;margin:30px 0" v-show="!total">
<div style="height:210px;display: inline-block;color:#999">
<img
style="width:100%;height:100%;"
src="@/assets/image/empty.png"
alt=""
/>
暂无数据
</div>
</div>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getPortraitList"
/>
</div>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getPortraitList"
/>
<footerPage />
</div>
</template>
@ -59,8 +86,14 @@
import { getPolicyMatch } from '@/api/home/notice';
import { mapGetters } from 'vuex';
import { userInfo, getLabelSetting } from '@/api/home/info';
import { getPolicyRead, getInformation } from '@/api/home/home';
import { getPolicyRead2, getInformation2 } from '@/api/home/home';
import footerPage from './components/footer';
import headerPage from './components/header';
export default {
components: {
footerPage,
headerPage
},
data() {
return {
type: '',
@ -106,12 +139,12 @@ export default {
this.total = data.total;
});
} else if (this.type == 'policyRead') {
getPolicyRead(this.queryParams).then(({ data }) => {
getPolicyRead2(this.queryParams).then(({ data }) => {
this.portraitData = data.list;
this.total = data.total;
});
} else if (this.type == 'information') {
getInformation(this.queryParams).then(({ data }) => {
getInformation2(this.queryParams).then(({ data }) => {
this.portraitData = data.list;
this.total = data.total;
});
@ -152,7 +185,7 @@ export default {
}
});
} else if (key == 'policyRead') {
this.queryParams.attributeId = this.attributeOptions[0].value;
this.queryParams.attribute = this.attributeOptions[0].value;
this.getPortraitList();
} else if (key == 'information') {
this.getPortraitList();
@ -168,39 +201,74 @@ export default {
<style lang="scss" scoped>
.portrait_page {
margin-top: 30px;
.header {
display: flex;
align-items: center;
height: 90px;
padding: 30px;
background-color: #f5f5f5;
.el-tabs {
margin-left: 20px;
/deep/.el-tabs__nav-wrap::after {
height: 0;
.padding-top {
padding-top: 70px;
.search {
text-align: center;
margin-bottom: 26px;
.search_input {
display: flex;
justify-content: center;
align-items: center;
/deep/.el-input--medium .el-input__inner {
height: 40px;
line-height: 40px;
border-radius: 6px 0 0 6px;
border: 1px solid #ffa32c;
border-right: 0;
}
span:nth-child(1) {
color: #333;
font-size: 24px;
margin-right: 21px;
}
.el-input {
width: 304px;
}
.el-button {
border-radius: 0 6px 6px 0;
background-color: #ffa32c;
font-size: 18px;
}
}
}
/deep/.el-radio__input {
display: none;
}
}
.screen_l_b {
height: 110px;
line-height: 45px;
margin-top: 20px;
padding: 0 20px;
border-bottom: 1px solid #e3e3e3;
.title {
font-size: 18px;
color: #333;
// text-align: left;
}
.info {
font-size: 16px;
color: #999;
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 90px;
padding: 30px;
background-color: #f5f5f5;
.el-tabs {
margin-left: 20px;
/deep/.el-tabs__nav-wrap::after {
height: 0;
}
}
/deep/.el-radio__input {
display: none;
}
}
.screen_l_b {
padding: 0 20px;
height: 110px;
display: flex;
flex-direction: column;
justify-content: center;
border-bottom: 1px solid #e3e3e3;
.title {
font-size: 18px;
color: #333;
margin-bottom: 16px;
text-align: left;
}
.info {
font-size: 16px;
color: #999;
display: flex;
justify-content: space-between;
}
}
}
}