Commit 89b21baf by 莫晓莉

跳转连接

parent ecb2bad9
...@@ -66,3 +66,13 @@ export function getAllCourts(data) { ...@@ -66,3 +66,13 @@ export function getAllCourts(data) {
// data, // data,
// }) // })
// } // }
//搜索新闻
export function searchForNews(data) {
return request({
url: `websiteCluster/web/searchForNews`,
method: 'POST',
data,
})
}
...@@ -55,6 +55,12 @@ const constantRouterMap = [ ...@@ -55,6 +55,12 @@ const constantRouterMap = [
meta: { title: '栏目', icon: '' }, meta: { title: '栏目', icon: '' },
component: resolve => require(["@/views/manage"], resolve), component: resolve => require(["@/views/manage"], resolve),
}, },
{
path: "/search",
name: 'search',
meta: { title: '搜索', icon: '' },
component: resolve => require(["@/views/search"], resolve),
},
// { // {
// path: "/homePage", // path: "/homePage",
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
v-for="(item, index) in topList" v-for="(item, index) in topList"
:key="index" :key="index"
class="k-flex k-space-between top-list" class="k-flex k-space-between top-list"
> @click="seeParams(item)">
<div class="article-name"> <div class="article-name">
<span class="right-line"> <span class="right-line">
我为群众办实事 我为群众办实事
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
v-for="(item, index) in commentRankData" v-for="(item, index) in commentRankData"
:key="index" :key="index"
class="k-flex k-space-between top-list" class="k-flex k-space-between top-list"
> @click="seeParams(item)">
<div class="article-name"> <div class="article-name">
<span class="num" style="">{{ index + 1 }}</span> <span class="num" style="">{{ index + 1 }}</span>
<span class="right-line"> <span class="right-line">
...@@ -451,11 +451,20 @@ export default { ...@@ -451,11 +451,20 @@ export default {
//下载文件 //下载文件
downLoadFile(item){ downLoadFile(item){
// alert('111'); // alert('111');
console.log('下载附件==',item)
// 创建a标签 // 创建a标签
let a = document.createElement('a') // let a = document.createElement('a')
a.download = item.attachName; //下载后文件名 // a.download = item.attachName; //下载后文件名
a.setAttribute('href',item.attachPath) // a.setAttribute('href',item.downLoadFile)
a.click(); //点击下载 // a.click(); //点击下载
// 创建a标签
let link = document.createElement('a')
// href链接
link.download = item.attachName; //下载后文件名
link.setAttribute('href',item.downloadPath);
// 自执行点击事件
link.click();
}, },
getParams(){//接收函数 getParams(){//接收函数
...@@ -551,6 +560,18 @@ export default { ...@@ -551,6 +560,18 @@ export default {
// location.href = loginURL ; // location.href = loginURL ;
location.href = process.env.VUE_APP_LOGIN_API location.href = process.env.VUE_APP_LOGIN_API
}, },
// 查看详情
seeParams(val){
this.$router.push({
path:'/detail',//跳转路由
query:{//参数对象
newsId:val.newsId
}
});
this.getParams();
},
}, },
}; };
</script> </script>
......
...@@ -754,6 +754,7 @@ import { ...@@ -754,6 +754,7 @@ import {
newsFromBoard, newsFromBoard,
getSubLevelBoard, getSubLevelBoard,
getAllCourts,//获取全区法院 getAllCourts,//获取全区法院
// searchForNews,//搜索新闻
} from "@/api/homePage.js" } from "@/api/homePage.js"
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</div> </div>
<div class="k-flex seach-input k-align-center" style="width: 180px"> <div class="k-flex seach-input k-align-center" style="width: 180px">
<el-input placeholder="请输入内容" clearable> <el-input v-model="searchSubject" placeholder="请输入内容" clearable>
<i <i
@click="searchEvent" @click="searchEvent"
slot="suffix" slot="suffix"
...@@ -241,11 +241,13 @@ import items from "./items.vue"; ...@@ -241,11 +241,13 @@ import items from "./items.vue";
import { import {
getAllCourts, //获取全区法院 getAllCourts, //获取全区法院
getSubLevelBoard, //获取子栏目 getSubLevelBoard, //获取子栏目
searchForNews,//搜索新闻
} from "@/api/homePage.js"; } from "@/api/homePage.js";
export default { export default {
components: { sideItem, items }, components: { sideItem, items },
data() { data() {
return { return {
searchSubject:'',//搜索内容
allCourtsData: [], //全区法院 allCourtsData: [], //全区法院
childFlag: false, childFlag: false,
activeIndex: "/homePage", activeIndex: "/homePage",
...@@ -536,6 +538,19 @@ export default { ...@@ -536,6 +538,19 @@ export default {
// menuselected(){}, // menuselected(){},
searchEvent() { searchEvent() {
console.log("搜索"); console.log("搜索");
// searchForNews().then(res=>{
// if(res.success){
// this
// }
// });
this.$router.push({
path: "/search", //跳转路由
query: {
//参数对象
subject: this.searchSubject,
},
});
}, },
toNews() { toNews() {
console.log(4556); console.log(4556);
......
...@@ -139,21 +139,34 @@ ...@@ -139,21 +139,34 @@
width="50" width="50"
> >
</el-table-column> </el-table-column>
<el-table-column
label="操作"
width="50"
align="center"
>
<template slot-scope="scope">
<el-button
@click="setParams(scope.row)"
type="text"
size="mini">
查看
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<!-- <div style="margin-top: 10px"> <div style="margin-top:10px;">
<el-pagination <el-pagination
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
layout="total,sizes,prev, pager, next,jumper" layout="total,sizes,prev, pager, next,jumper"
:total="1000" :total="pageInfo.total"
page-sizes="" :page-size="pageInfo.size"
page-size="15" :current-page="pageInfo.page"
current-page="1" @current-change="pageChange"
@current-change="" @size-change="sizeChange"
@size-change=""
/> />
</div> --> </div>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -312,17 +325,34 @@ export default { ...@@ -312,17 +325,34 @@ export default {
console.log(res); console.log(res);
let {newsList,top}=res.data; let {newsList,top}=res.data;
this.newsList=newsList.records; this.newsList=newsList.records;
// this.pageInfo.total=newsList.total; this.pageInfo.total=newsList.total;
} }
}); });
}, },
handleNodeClick(data,node,obj){ handleNodeClick(data,node,obj){
console.log(data,node,obj); console.log(data,node,obj);
newsFromBoard({boardId:data.boardId,page:1,size:5}).then(res=>{ this.pageInfo.boardId=data.boardId;
newsFromBoard(this.pageInfo).then(res=>{
this.newsList= res.data.newsList.records this.newsList= res.data.newsList.records
}) })
}, },
pageChange(e) {
this.pageInfo.page = e;
this.newsFromBoard();
},
sizeChange(e) {
this.pageInfo.size = e;
this.pageChange(1);
},
// 查看详情
setParams(val){
this.$router.push({
path:'/detail',//跳转路由
query:{//参数对象
newsId:val.newsId
}
});
},
}, },
}; };
</script> </script>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div > <div >
<el-carousel style="border-radius:8px;" height="250px" :interval="4000"> <el-carousel style="border-radius:8px;" height="250px" :interval="4000">
<el-carousel-item style="border-radius:8px;" v-for="item in newestList" :key="item.newsId"> <el-carousel-item style="border-radius:8px;" v-for="item in newestList" :key="item.newsId">
<div class="carousel-div" style="border-radius:8px;"> <div class="carousel-div" style="border-radius:8px;" @click="setParams(item)">
<el-image :src="item.attInfoList.downloadPath" style="width:100%;height:100%;"></el-image> <el-image :src="item.attInfoList.downloadPath" style="width:100%;height:100%;"></el-image>
<div class="carousel-intro" style=""> <div class="carousel-intro" style="">
{{item.subject}} {{item.subject}}
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</div> </div>
<div>{{item.date}}</div> <div>{{item.date}}</div>
</div> --> </div> -->
<div v-for="(item,index) in newsRankList" :key="index" class="k-flex k-space-between top-list"> <div v-for="(item,index) in newsRankList" :key="index" class="k-flex k-space-between top-list" @click="setParams(item)">
<div class="article-name"> <div class="article-name">
<span class="right-line"> <span class="right-line">
{{ item.boardName }} {{ item.boardName }}
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<span>鹿心社与自治区级政法机关领导班子成立交付给来访登记过了多久</span> <span>鹿心社与自治区级政法机关领导班子成立交付给来访登记过了多久</span>
</div> </div>
</div> </div>
<div v-for="(item,index) in newestList" :key="index" class="k-flex k-space-between top-list"> <div v-for="(item,index) in newestList" :key="index" class="k-flex k-space-between top-list" @click="setParams(item)">
<div class="article-name"> <div class="article-name">
<span class="right-line"> <span class="right-line">
{{item.boardName}} {{item.boardName}}
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
</div> --> </div> -->
</div> </div>
<div v-if="activeItem==1" class="mt-10"> <div v-if="activeItem==1" class="mt-10">
<div v-for="(item,index) in newsConernList" :key="index" class="k-flex k-space-between top-list"> <div v-for="(item,index) in newsConernList" :key="index" class="k-flex k-space-between top-list" @click="setParams(item)">
<div class="article-name"> <div class="article-name">
<span class="right-line"> <span class="right-line">
{{item.boardName}} {{item.boardName}}
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
</div> </div>
</el-col > </el-col >
</el-row> </el-row>
<div v-for="(item,index) in topList" :key="index" class="k-flex k-space-between top-list"> <div v-for="(item,index) in topList" :key="index" class="k-flex k-space-between top-list" @click="setParams(item)">
<div class="article-name"> <div class="article-name">
<!--<span class="right-line">我为群众办实事</span>--> <!--<span class="right-line">我为群众办实事</span>-->
<span class="right-line">{{item.name}}</span> <span class="right-line">{{item.name}}</span>
...@@ -223,8 +223,8 @@ ...@@ -223,8 +223,8 @@
</div> </div>
</div> </div>
<el-row class="mt-15" :gutter="20"> <el-row class="mt-15" :gutter="20">
<el-col style="border-radius:5px;" :span="8" v-for="item in newsGanList" :key="item.id"> <el-col style="border-radius:5px;" :span="8" v-for="item in newsGanList" :key="item.id" >
<div class="imgs-div" style="width:100%;border-radius:8px;" > <div class="imgs-div" style="width:100%;border-radius:8px;" @click="setParams(item)">
<el-image :src="item.attInfoList[0].downloadPath" style="width:100%;display:block;border-radius:5px;"> <el-image :src="item.attInfoList[0].downloadPath" style="width:100%;display:block;border-radius:5px;">
</el-image> </el-image>
<div class="imgs-intro" style="width:100%;border-radius:0 0 5px 5px;"> <div class="imgs-intro" style="width:100%;border-radius:0 0 5px 5px;">
...@@ -523,6 +523,15 @@ export default { ...@@ -523,6 +523,15 @@ export default {
this.activeItem=i; this.activeItem=i;
this.fyxwfromCourt(i); this.fyxwfromCourt(i);
}, },
// 查看详情
setParams(val){
this.$router.push({
path:'/detail',//跳转路由
query:{//参数对象
newsId:val.newsId
}
});
},
} }
......
<template>
<div >
<el-row >
<el-col :span="18" :offset="3">
<!--<el-row class="top-info" style="">
<span class="fist-text" style=""></span>
<span>作信息</span>
<div style="float:right;">
<span>当前位置:</span>
<el-breadcrumb style="display:inline-block;" separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>活动管理</el-breadcrumb-item>
</el-breadcrumb>
</div>
</el-row>-->
<el-row class="mt-20" :gutter="20">
<!--左边栏目开始-->
<!-- <el-col :span="5">
<div class="list-container" style="">
<div class="list-title mb-10" style="">按分类查看</div>
<ul class="type-list">
<li><a href="#">最高法通报</a></li>
<li><a href="#">最高人民法院简报</a></li>
</ul>
</div>
</el-col> -->
<!--左边栏目结束-->
<!-- <el-col :span="19"> -->
<div class="zone-style">
<div style="min-height:76vh;">
<!-- <div style="">
<span>当前位置:</span>
<el-breadcrumb style="display:inline-block;" separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>活动管理</el-breadcrumb-item>
</el-breadcrumb>
</div> -->
<el-table
:header-cell-style="{'text-align':'center','font-size':'15px','color':'black'}"
:cell-style="{'font-size':'13px','border-bottom':'none'}"
:data="searchNewsList"
highlight-current-row
style="width: 100%">
<el-table-column
align="left"
property="subject"
label="标题">
</el-table-column>
<el-table-column
align="center"
property="newsTime"
label="时间"
width="150">
</el-table-column>
<el-table-column
align="center"
property="clickCount"
label="点击"
width="120">
</el-table-column>
<el-table-column
align="center"
property="commentCount"
label="评论"
width="50">
</el-table-column>
<el-table-column
label="操作"
width="50"
align="center"
>
<template slot-scope="scope">
<el-button
@click="setParams(scope.row)"
type="text"
size="mini">
查看
</el-button>
</template>
</el-table-column>
</el-table>
<div style="margin-top:10px;">
<el-pagination
prev-text="上一页"
next-text="下一页"
layout="total,sizes,prev, pager, next,jumper"
:total="pageInfo.total"
:page-size="pageInfo.size"
:current-page="pageInfo.page"
@current-change="pageChange"
@size-change="sizeChange"
/>
</div>
</div>
</div>
<!-- </el-col> -->
</el-row>
</el-col>
</el-row>
</div>
</template>
<script>
import {
searchForNews,//搜索新闻
} from "@/api/homePage.js";
export default {
name: "show",
data() {
return {
pageInfo:{
page:1,
size:10,
total:0
},
searchNewsList:[],//搜索出来的新闻
dataTreeFile: [{
label: '一级 1',
children: [{
label: '二级 1-1',
children: [{
label: '三级 1-1-1'
}]
}]
}, {
label: '一级 2',
children: [{
label: '二级 2-1',
children: [{
label: '三级 2-1-1'
}]
}, {
label: '二级 2-2',
children: [{
label: '三级 2-2-1'
}]
}]
}, {
label: '一级 3',
children: [{
label: '二级 3-1',
children: [{
label: '三级 3-1-1'
}]
}, {
label: '二级 3-2',
children: [{
label: '三级 3-2-1'
}]
}]
}],
defaultProps: {
children: 'children',
label: 'label'
},
tableData: [{
date: '2016-05-02 12:00:00',
name: '24',
address: '【广西高院队...】广西高院队伍整顿简报解放军过来了就收到了开花结果的工具打开两个换个角度思考和监控工具打开换个角度来看回家国家的客户给几个大客户就'
}, {
date: '2016-05-04 12:00:00',
name: '45',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01 12:00:00',
name: '67',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03 12:00:00',
name: '89',
address: '上海市普陀区金沙江路 1516 弄'
}],
}
},
created() {
this.searchForNews();//搜索新闻
},
//监听路由获取面包屑
watch: {
$route() {
if (this.$route.query.subject) {
this.searchForNews();//搜索新闻
}
},
},
methods:{
searchForNews(){
console.log("搜索");
let newsTitle=this.$route.query.subject;
this.pageInfo.subject=newsTitle;
searchForNews(this.pageInfo).then(res=>{
if(res.success){
this.searchNewsList=res.data.records;
this.pageInfo.total= res.data.total;
}
});
},
pageChange(e) {
this.pageInfo.page = e;
this.searchForNews();
},
sizeChange(e) {
this.pageInfo.size = e;
this.pageChange(1);
},
// 查看详情
setParams(val){
this.$router.push({
path:'/detail',//跳转路由
query:{//参数对象
newsId:val.newsId
}
});
},
}
}
</script>
<style lang="scss" scoped>
// 树形菜单图标start-----------------------
.el-tree{
background:transparent;
}
.el-tree /deep/ .el-tree-node__expand-icon.expanded
{
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
/*//有子节点 且未展开*/
.el-tree /deep/ .el-icon-caret-right:before
{
background: url("../../assets/wjjg.png") no-repeat 0 3px;
content: '';
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
}
/*//有子节点 且已展开*/
.el-tree /deep/ .el-tree-node__expand-icon.expanded.el-icon-caret-right:before
{
background: url("../../assets/wjjk.png") no-repeat 0 3px;
content: '';
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
}
/*//没有子节点*/
.el-tree /deep/ .el-tree-node__expand-icon.is-leaf::before
{
background: url("../../assets/wj.png") no-repeat 0 3px;
content: '';
display: block;
width: 16px;
height: 16px;
font-size: 16px;
background-size: 16px;
}
// 树形菜单图标end-----------------------
.top-info{
margin:15px 0;
border-bottom:2px solid #34bab2;
padding-bottom:15px;
}
.fist-text{
display:inline-block;
width:26px;
height:26px;
line-height:26px;
text-align:center;
font-size:15px;
color:#fff;
border-radius:50%;
background:#1a3784;
margin-right:3px;
}
.list-container{
// border:2px solid #34bab2;
// padding:15px 15px;
// margin-top:40px;
}
.list-title{
border-bottom:1px dashed #ccc;
line-height: 35px;
}
// 列表start
.type-list li{
list-style-type: square;
// color: #0099ff;
color: blue;
font-size: 16px;
line-height: 35px;
border-bottom: 1px dashed #ccc;
}
.type-list li a{
color: #333;
font-size: 14px;
text-decoration:none;
}
.type-list li:hover{
// color: #ff6900;
color: red;
}
.type-list li:hover a{
// color: #ff6900
color:red;
}
.type-list li:last-of-type{border-bottom:none;}
// 列表end
ul{
margin: 0px;
padding: 0px;
padding-left: 15px;
}
.zone-style{
background-color:#fff;
padding:15px 15px;
border-radius:5px;
box-shadow: -5px 0px 20px 5px rgba(0,0,0,0.05);
}
::v-deep{
.el-table th:first-child>.cell{
text-align:left!important;
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment