Commit a1f76e47 by Lyan

全文搜索

parent 755af626
......@@ -110,6 +110,11 @@ const relatedLinks = (params = {}) => {
return GET(`${Prefix}/office/news/api/relatedLinks`, params)
}
// 全局搜索
const getSearchInfo = (params = {}) => {
return POST(`${Prefix}/office/news/api/getSearchInfo`, params);
}
export default {
pictureList,
......@@ -135,5 +140,6 @@ export default {
relatedLinks,
dsxxjyTop8,
gzzdTop7,
centerTop6
centerTop6,
getSearchInfo
}
......@@ -12,6 +12,7 @@
<div @click="handelMore" class="more float-end"><span>了解更多</span><img src="../../../assets/image/home/more-arrow.png" alt=""></div>
</div>
</div>
<p style="text-align:center;padding:30px" v-if="list.length===0">没有符合条件的记录!</p>
</div>
</template>
<script>
......
<template>
<ul class="sousuoList">
<li v-for="(tmp, i) in 10" :key="i">
<li v-for="(tmp, i) in list" :key="i" >
<div class="sousuoList-top">
<span>【资讯动态】山东省条码印刷品质量检验站通过</span>
<span>CNAS评审组现场评审</span>
<span>【资讯动态】</span>
<span v-html="tmp.title" @click="handelMsg(tmp.urlid)"></span>
</div>
<div class="sousuoList-middle">中国合格评定国家认可委员会(CNAS)派遣2名评审员组成评审组就所申请一维条码符号、二维条码符号、行业应用软件、移动智能终端应用软件和移动智能终端应用软件(个人信息安全保护…</div>
<div class="sousuoList-middle" v-html="changeText(tmp.content)"></div>
<div class="sousuoList-bottom">
<div>
<span>日期:</span>
<span>2021-07-07</span>
<span>{{tmp.date}}</span>
</div>
<div>
<span>来自:</span>
<span>中国物品编码中心山东分中心</span>
<span>{{tmp.source}}</span>
</div>
</div>
</li>
<p style="text-align:center;padding:30px" v-if="list.length===0">没有符合条件的记录!</p>
</ul>
</template>
<script>
export default {
props: ['list'],
methods: {
handelMsg(id) {
this.$router.push({
path: '/News/Msg',
query:{id:id}
});
},
changeText(val){
val=(val ||'').replace(/<[^>]+>/g,"").replace(/<br\/>/g, '\n').replace(/&nbsp;/g, '');
return val
}
},
}
</script>
<style lang="scss" scoped>
.sousuoList{
margin: 0;
......@@ -30,22 +49,33 @@
padding-top: 0;
}
.sousuoList-top{
padding-bottom: 20px;
font-size: 18px;
span{
&:nth-child(1) {
color: rgba(65, 67, 69, 1);
}
&:nth-child(2) {
color: rgba(242, 99, 53, 1);
cursor: pointer;
&:hover,&:active{
color: rgba(242, 99, 53, 1);
}
}
}
}
.sousuoList-middle{
width: 95%;
height: 21px;
font-size: 14px;
color: #666666;
padding: 20px 0;
// padding: 20px 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.sousuoList-bottom{
padding-top: 20px;
display: flex;
flex-wrap: wrap;
font-size: 13px;
......
......@@ -7,22 +7,24 @@
placeholder="请输入内容"
clearable
v-model="search.keywords"
@input="e => search.keywords = validSpecialZf(e)"
></el-input>
<div class="top-form-btn">
<div class="top-form-btn" @click="initListFn(1,'')">
<img src="../../assets/image/home/sousuo-ico1.png" alt="" />
</div>
</div>
<div class="hot">
<!-- 迭代 -->
<!-- <div class="hot">
<span>热词:</span>
<span>我要续展</span>
<span>申请条码</span>
</div>
</div> -->
</div>
</div>
<div class="sousuo-bottom">
<div class="container">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<li class="nav-item" role="presentation" @click="initListFn(1,'')">
<button
class="nav-link active"
id="home-tab"
......@@ -36,7 +38,35 @@
<span>全部问题</span>
</button>
</li>
<li class="nav-item" role="presentation">
<li class="nav-item" role="presentation" @click="initListFn(1,'1')">
<button
class="nav-link"
id="profile-tab"
data-bs-toggle="tab"
data-bs-target="#profile"
type="button"
role="tab"
aria-controls="profile"
aria-selected="false"
>
<span>标准科研</span>
</button>
</li>
<li class="nav-item" role="presentation" @click="initListFn(1,'2')">
<button
class="nav-link"
id="profile-tab"
data-bs-toggle="tab"
data-bs-target="#profile"
type="button"
role="tab"
aria-controls="profile"
aria-selected="false"
>
<span>政策法规</span>
</button>
</li>
<li class="nav-item" role="presentation" @click="initListFn(1,'3,31,32')">
<button
class="nav-link"
id="profile-tab"
......@@ -50,10 +80,41 @@
<span>资讯动态</span>
</button>
</li>
<li class="nav-item" role="presentation" @click="initListFn(1,'5')">
<button
class="nav-link"
id="profile-tab"
data-bs-toggle="tab"
data-bs-target="#profile"
type="button"
role="tab"
aria-controls="profile"
aria-selected="false"
>
<span>应用领域</span>
</button>
</li>
<li class="nav-item" role="presentation" @click="initListFn(1,'6')">
<button
class="nav-link"
id="profile-tab"
data-bs-toggle="tab"
data-bs-target="#profile"
type="button"
role="tab"
aria-controls="profile"
aria-selected="false"
>
<span>技术知识</span>
</button>
</li>
</ul>
<div class="sousuo-bottom-solt">
<div class="sousuo-total">相关结果1209个</div>
<el-date-picker
<div class="sousuo-total">相关结果{{pageParams.totalCount}}</div>
<!-- 迭代 -->
<!-- <el-date-picker
type="daterange"
align="right"
unlink-panels
......@@ -63,7 +124,7 @@
size="mini"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-date-picker> -->
</div>
<div class="tab-content" id="myTabContent">
<div
......@@ -72,12 +133,7 @@
role="tabpanel"
aria-labelledby="home-tab"
>
<sousuoList />
<pages
:currPage="pageParams.currPage"
:pageSize="pageParams.pageSize"
:total="pageParams.total"
/>
</div>
<div
class="tab-pane fade"
......@@ -85,11 +141,20 @@
role="tabpanel"
aria-labelledby="profile-tab"
>
<sousuoList />
</div>
</div>
<sousuoList :list="pageParams.list" />
<pages
:currPage="pageParams.currPage"
:pageSize="pageParams.pageSize"
:total="pageParams.totalCount"
@getLimit='initListFn'
/>
</div>
</div>
</div>
</template>
<script>
......@@ -107,9 +172,10 @@ export default {
keywords: "",
},
pageParams: {
list:[],
currPage: 1,
pageSize: 10,
total: 0,
totalCount: 0,
},
pickerOptions: {
shortcuts: [
......@@ -144,12 +210,40 @@ export default {
},
};
},
created() {
this.initListFn(this.pageParams.currPage);
},
methods:{
// 列表
async initListFn(page,type) {
const params = {
page: page,
size: this.pageParams.pageSize,
type:type,
name:this.search.keywords
};
const listRes =
await this.$api.news.getSearchInfo(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.pageParams = data
}
},
validSpecialZf(valInput){
valInput = valInput.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,./;'~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, '').replace(/\s/g, '').replace(/[^\w_^\u4E00-\u9FA5]/g,'');
return valInput;
}
}
};
</script>
<style lang="scss">
.sousuo {
.sousuo-top-form {
@include elInput(50px, #333, #666, #fff, #cfdcea);
padding-bottom: 30px;
.el-input__inner {
border-right: 0;
border-radius: 4px 0 0 4px;
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -37,6 +38,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 行业应用
async initListFn(page,limit) {
const params = {
......@@ -57,6 +61,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "行业应用",
path: "/News/Application",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -25,6 +25,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -52,6 +53,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods: {
...mapMutations({
setMatche: "setMatche",
}),
// 查看更多
lookMore() {
window.open('/News/PicNews', '_target');
......@@ -77,6 +81,14 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "活动中心",
path: "/News/Center",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -36,6 +37,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -58,6 +62,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "综合报道",
path: "/News/Composite",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -36,6 +37,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -58,6 +62,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "深度资讯",
path: "/News/DepthTopics",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -41,7 +41,7 @@
</p>
<div class="list-style">
<ul >
<li v-for="(tmp, i) in tableResult.list" :key="i"><a :href="tmp" target="_blank">{{tmp.title}}</a></li>
<li v-for="(tmp, i) in tableResult.list" :key="i"><span>{{tmp.title}}</span></li>
</ul>
</div>
......@@ -269,6 +269,7 @@ export default {
.more{
font-size: 12px;
float: right;
cursor: pointer;
}
}
ul{
......@@ -280,6 +281,7 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
white-space:nowrap;
cursor: pointer;
}
li::before{
content: "●";
......
......@@ -45,6 +45,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import Title from "../comps/title.vue";
import list from "./comps/list.vue";
......@@ -154,6 +155,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods: {
...mapMutations({
setMatche: "setMatche",
}),
// 食品追溯
async initListFn(page,limit) {
const params = {
......@@ -173,6 +177,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "食品安全追溯",
path: "/News/FoodSafety",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -36,6 +37,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -58,6 +62,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "国际追踪",
path: "/News/International",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -14,6 +14,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -45,6 +46,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -67,6 +71,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "物联网",
path: "/News/IoT",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -36,6 +37,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -58,6 +62,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "地方动态",
path: "/News/Local",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -9,6 +9,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -37,6 +38,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 通知公告
async initListFn(page,limit) {
const params = {
......@@ -57,6 +61,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "公告通知",
path: "/News/Notice",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -20,6 +20,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import Title from "../comps/title.vue";
import list from "./comps/list.vue";
......@@ -63,6 +64,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 其他
async initListFn(page,limit) {
const params = {
......@@ -81,6 +85,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "其他",
path: "/News/Other",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -4,12 +4,12 @@
<cate :father="tpzxCate"></cate>
<div class="container">
<ul class="picNews-ul">
<li v-for="(tmp, i) in 4" :key="i" @click="jump">
<li v-for="(tmp, i) in pictureListArr" :key="i" @click="getInfo(tmp.pictureid,tmp.jumppath)">
<div class="picNews-li-tp">
<img src="../../assets/image/news/tpzx-tp1.jpg" alt="" />
<img :src="tmp.picFile" alt="" />
</div>
<div class="picNews-li-bt">
中国物品编码中心应邀出席食品安全智慧监管研讨会
{{tmp.title}}
</div>
</li>
</ul>
......@@ -34,7 +34,6 @@
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import pages from "../comps/pages2.vue";
export default {
......@@ -65,18 +64,6 @@ export default {
...mapMutations({
setMatche: "setMatche",
}),
jump() {
const matche = [
{
name: "图片资讯",
path: "/News/PicNews",
},
];
this.setMatche(matche);
this.$router.push({
path: "/News/msg",
});
},
// 图片资讯列表
async initListFn(page,limit) {
const params = {
......@@ -107,6 +94,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "图片资讯",
path: "/News/PicNews",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -36,6 +37,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -58,6 +62,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "标准科研动态",
path: "/News/Research",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -8,6 +8,7 @@
</div>
</template>
<script>
import { mapMutations } from "vuex";
import cate from "../comps/cate.vue";
import list from "./comps/list.vue";
import pages from "../comps/pages2.vue";
......@@ -36,6 +37,9 @@ export default {
this.initListFn(this.tableResult.currPage);
},
methods:{
...mapMutations({
setMatche: "setMatche",
}),
// 列表
async initListFn(page,limit) {
const params = {
......@@ -58,6 +62,13 @@ export default {
if(directpath&&directpath!==''&& directpath.length>0){
window.open(directpath,'_blank');
}else{
const matche = [
{
name: "精彩视频",
path: "/News/Video",
}
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/news/msg?id=${id}`,
});
......
......@@ -7,6 +7,7 @@
</div>
<div class="col-lg-2 list-right">{{tmp.showtime}}</div>
</div>
<p style="text-align:center;padding:30px" v-if="list.length===0">没有符合条件的记录</p>
</div>
</template>
<script>
......
......@@ -30,7 +30,7 @@
<div class="container">
<div class="cate">
<span>相关连接</span>
<span>更多>></span>
<!-- <span>更多>></span> -->
</div>
<list :list="xgljListArr" @getInfo='getInfo' />
</div>
......@@ -131,7 +131,6 @@ export default {
this.newsTop10()
this.announceList()
this.zttjList()
this.xgljList()
},
methods: {
async InfoFn() {
......@@ -149,10 +148,12 @@ export default {
this.source=data.source
this.editor=data.editor
this.breadcrumb = this.breadcrumb.concat(this.matche);
this.breadcrumb.push({
this.breadcrumb.push(
{
name: this.title,
});
this.$store.commit("system/SET_BREADCRUMB", this.breadcrumb);
this.xgljList(data.keyword)
}
},
......@@ -198,10 +199,10 @@ export default {
},
// 相关链接
async xgljList() {
async xgljList(keyword) {
const params = {
id:9979,
keyword:'GS1'
keyword:keyword
};
const listRes =
await this.$api.news.relatedLinks(params);
......
......@@ -15,7 +15,7 @@
</el-select>
</div>
</div>
<div class="pages-middle">
<div class="pages-middle" v-if="total!=0">
<button class="pages-btn" v-if="false">首页</button>
<el-pagination
:page-size="pageSize"
......
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