fixed some bugs

This commit is contained in:
cxc
2022-04-14 11:40:12 +08:00
parent d3c6372089
commit 7ac57bbebc
4 changed files with 105 additions and 59 deletions

BIN
jiace(414).zip Normal file

Binary file not shown.

View File

@ -2,26 +2,26 @@ import { handlePic } from '@/api/home/notice';
export let urlList = [ export let urlList = [
'http://ahchjkq.hefei.gov.cn/', 'http://ahchjkq.hefei.gov.cn/',
'http://bhkxc.hefei.gov.cn/', 'http://bhkxc.hefei.gov.cn/',
'http://cxjsj.hefei.gov.cn/index.html', 'http://cxjsj.hefei.gov.cn/',
'http://drc.hefei.gov.cn/', 'http://drc.hefei.gov.cn/',
'http://gxq.hefei.gov.cn/', 'http://gxq.hefei.gov.cn/',
'http://hetda.hefei.gov.cn/', 'http://hetda.hefei.gov.cn/',
'http://hfxz.hefei.gov.cn/index.html', 'http://hfxz.hefei.gov.cn/',
'http://jxj.hefei.gov.cn/index.html', 'http://jxj.hefei.gov.cn/',
'http://kjj.hefei.gov.cn/', 'http://kjj.hefei.gov.cn/',
'http://rsj.hefei.gov.cn/', 'http://rsj.hefei.gov.cn/',
'http://swj.hefei.gov.cn/', 'http://swj.hefei.gov.cn/',
'http://sjzyj.hefei.gov.cn/', 'http://sjzyj.hefei.gov.cn/',
'http://www.ahfeixi.gov.cn/', 'http://www.ahfeixi.gov.cn/',
'http://www.ahhfly.gov.cn/index.html', 'http://www.ahhfly.gov.cn/',
'http://www.baohe.gov.cn/index.html', 'http://www.baohe.gov.cn/',
'http://www.changfeng.gov.cn/', 'http://www.changfeng.gov.cn/',
'http://www.chaohu.gov.cn/', 'http://www.chaohu.gov.cn/',
'http://www.feidong.gov.cn/index.html', 'http://www.feidong.gov.cn/',
'http://www.hefei.gov.cn/', 'http://www.hefei.gov.cn/',
'http://wlj.hefei.gov.cn/index.html', 'http://wlj.hefei.gov.cn/',
'http://www.hfyaohai.gov.cn/', 'http://www.hfyaohai.gov.cn/',
'http://www.hfss.gov.cn/index.html', 'http://www.hfss.gov.cn/',
'http://www.lj.gov.cn/' 'http://www.lj.gov.cn/'
]; ];
export function formatRichText(dowUrl, id, url) { export function formatRichText(dowUrl, id, url) {

View File

@ -3,7 +3,7 @@
<headerPage /> <headerPage />
<div class="padding-top content min_h_241"> <div class="padding-top content min_h_241">
<div class="search"> <div class="search">
<div class="search_input" style="display:flex"> <div class="search_input" style="display: flex">
<span v-if="type == 'policy'">企业画像检索</span> <span v-if="type == 'policy'">企业画像检索</span>
<span v-if="type == 'policyRead'">政策解读检索</span> <span v-if="type == 'policyRead'">政策解读检索</span>
<span v-if="type == 'information'">资讯快报检索</span> <span v-if="type == 'information'">资讯快报检索</span>
@ -28,7 +28,8 @@
:label="item.id" :label="item.id"
border border
@change="handleClick" @change="handleClick"
>{{ item.name }}</el-radio> >{{ item.name }}</el-radio
>
</div> </div>
<div class="header" v-else-if="type == 'policyRead'"> <div class="header" v-else-if="type == 'policyRead'">
<span class="span">{{ val }}</span> <span class="span">{{ val }}</span>
@ -40,7 +41,8 @@
:label="item.value" :label="item.value"
border border
@change="handleClick" @change="handleClick"
>{{ item.label }}</el-radio> >{{ item.label }}</el-radio
>
</div> </div>
<div class="header" v-else-if="type == 'policyNotice'"> <div class="header" v-else-if="type == 'policyNotice'">
<span class="span">{{ val }}</span> <span class="span">{{ val }}</span>
@ -52,7 +54,8 @@
:label="item.value" :label="item.value"
border border
@change="handleClick" @change="handleClick"
>{{ item.label }}</el-radio> >{{ item.label }}</el-radio
>
</div> </div>
<div class="screen_l_b" v-for="item in portraitData" :key="item.id"> <div class="screen_l_b" v-for="item in portraitData" :key="item.id">
<div class="title pointer"> <div class="title pointer">
@ -64,10 +67,11 @@
path: '/result', path: '/result',
query: { query: {
key: type == 'policyNotice' ? 'policy' : type, key: type == 'policyNotice' ? 'policy' : type,
id: item.id id: item.id,
} },
}" }"
>{{ removeBr(item.title) }}</router-link> >{{ removeBr(item.title) }}</router-link
>
<span class="info"> <span class="info">
<span v-if="type != 'information'">{{ item.listDate }}</span> <span v-if="type != 'information'">{{ item.listDate }}</span>
<span v-else>{{ item.createTime }}</span> <span v-else>{{ item.createTime }}</span>
@ -82,9 +86,13 @@
<span>发布{{ item.createTime }}</span> <span>发布{{ item.createTime }}</span>
</div>--> </div>-->
</div> </div>
<div style="text-align: center;margin:30px 0" v-show="!total"> <div style="text-align: center; margin: 30px 0" v-show="!total">
<div style="height:210px;display: inline-block;color:#999"> <div style="height: 210px; display: inline-block; color: #999">
<img style="width:100%;height:100%;" src="@/assets/image/empty.png" alt /> <img
style="width: 100%; height: 100%"
src="@/assets/image/empty.png"
alt
/>
暂无数据 暂无数据
</div> </div>
</div> </div>
@ -108,10 +116,11 @@ import { userInfo, getLabelSetting } from '@/api/home/info';
import { getPolicy, getPolicyRead2, getInformation2 } from '@/api/home/home'; import { getPolicy, getPolicyRead2, getInformation2 } from '@/api/home/home';
import footerPage from './components/footer'; import footerPage from './components/footer';
import headerPage from './components/header'; import headerPage from './components/header';
import { Stream } from 'stream';
export default { export default {
components: { components: {
footerPage, footerPage,
headerPage headerPage,
}, },
data() { data() {
return { return {
@ -119,27 +128,27 @@ export default {
val: '', val: '',
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 15 pageSize: 15,
}, },
total: 0, total: 0,
portraitList: [], // 企业画像 portraitList: [], // 企业画像
policyNoticeOptions: [ policyNoticeOptions: [
{ {
value: '1415156808053559296', value: '1415156808053559296',
label: '政策法规' label: '政策法规',
}, },
{ {
value: '1415156963146338304', value: '1415156963146338304',
label: '申报通知' label: '申报通知',
}, },
{ {
value: '1415157002090450944', value: '1415157002090450944',
label: '政府公示' label: '政府公示',
}, },
{ {
value: '1415157026115424256', value: '1415157026115424256',
label: '公告' label: '公告',
} },
// { // {
// value: '1415157049267982336', // value: '1415157049267982336',
// label: '其他' // label: '其他'
@ -149,35 +158,41 @@ export default {
attributeOptions: [ attributeOptions: [
{ {
value: '', value: '',
label: '不限' label: '不限',
}, },
{ {
value: 'KJJ', value: 'KJJ',
label: '科技' label: '科技',
}, },
{ {
value: 'JXJ', value: 'JXJ',
label: '经信' label: '经信',
}, },
{ {
value: 'FGW', value: 'FGW',
label: '发改' label: '发改',
}, },
{ {
value: 'OTHER', value: 'OTHER',
label: '其他' label: '其他',
} },
], ],
portraitData: [], // 企业画像绑定的政策列表 portraitData: [], // 企业画像绑定的政策列表
portraitTotal: 0 portraitTotal: 0,
}; };
}, },
computed: { computed: {
...mapGetters(['token']) ...mapGetters(['token']),
}, },
methods: { methods: {
removeBr(str) { removeBr(str) {
return str && str.replaceAll('<br>', '') if (str) {
str = str
.replaceAll('<br>', '')
.replaceAll('[', '【')
.replaceAll(']', '】');
}
return str;
}, },
// 获取企业画像数据列表 // 获取企业画像数据列表
getPortraitList() { getPortraitList() {
@ -205,7 +220,7 @@ export default {
}, },
handleClick() { handleClick() {
this.getPortraitList(); this.getPortraitList();
} },
}, },
created() { created() {
// if (this.token) { // if (this.token) {
@ -225,10 +240,12 @@ export default {
// : '' // : ''
// : undefined // : undefined
// ); // );
const arrs = data.map(item => const arrs = data.map((item) =>
item.labelList ? item.labelList.filter(v => v.isHas) : undefined item.labelList
? item.labelList.filter((v) => v.isHas)
: undefined
); );
arrs.map(item => { arrs.map((item) => {
this.portraitList = [...this.portraitList, ...item]; this.portraitList = [...this.portraitList, ...item];
}); });
this.queryParams.labelId = this.portraitList[0].id; this.queryParams.labelId = this.portraitList[0].id;
@ -244,7 +261,7 @@ export default {
this.getPortraitList(); this.getPortraitList();
} else if (key == 'policyNotice') { } else if (key == 'policyNotice') {
if (this.$route.query.labelId) { if (this.$route.query.labelId) {
this.queryParams.labelId = this.$route.query.labelId this.queryParams.labelId = this.$route.query.labelId;
} else { } else {
this.queryParams.labelId = this.policyNoticeOptions[0].value; this.queryParams.labelId = this.policyNoticeOptions[0].value;
} }
@ -255,7 +272,7 @@ export default {
// } else { // } else {
// this.msgError('请先登录'); // this.msgError('请先登录');
// } // }
} },
}; };
</script> </script>

View File

@ -35,10 +35,14 @@
<div class="my_main content p0-100 min_h_285" style="display: flex"> <div class="my_main content p0-100 min_h_285" style="display: flex">
<div class="l" style="width: 77%; background-color: #fff; padding: 30px"> <div class="l" style="width: 77%; background-color: #fff; padding: 30px">
<h2 style="text-align:center">{{ removeBr(formData.title) }}</h2> <h2 style="text-align: center">{{ removeBr(formData.title) }}</h2>
<div class="info" v-if="type != 'information'"> <div class="info" v-if="type != 'information'">
<span v-if="type != 'companyNeed' && type != 'scienceResult'">来源{{ formData.source }}</span> <span v-if="type != 'companyNeed' && type != 'scienceResult'"
<span v-if="type == 'companyNeed'">价格{{ setNumber(formData.price) }}</span> >来源{{ formData.source }}</span
>
<span v-if="type == 'companyNeed'"
>价格{{ setNumber(formData.price) }}</span
>
<el-image <el-image
v-if="type == 'scienceResult'" v-if="type == 'scienceResult'"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
@ -52,11 +56,21 @@
}} }}
</span> </span>
<span v-if="token && type == 'policy'"> <span v-if="token && type == 'policy'">
<el-button type="primary" size="mini" v-if="formData.collected == 0" @click="addItem"> <el-button
type="primary"
size="mini"
v-if="formData.collected == 0"
@click="addItem"
>
<i class="el-icon-star-on"></i> <i class="el-icon-star-on"></i>
<span>收藏</span> <span>收藏</span>
</el-button> </el-button>
<el-button type="info" size="mini" v-if="formData.collected == 1" @click="cancelItem"> <el-button
type="info"
size="mini"
v-if="formData.collected == 1"
@click="cancelItem"
>
<i class="el-icon-star-on"></i> <i class="el-icon-star-on"></i>
<span>取消收藏</span> <span>取消收藏</span>
</el-button> </el-button>
@ -97,12 +111,16 @@
</div> </div>
<div class="list"> <div class="list">
<ul> <ul>
<li class="text_hidden_one pointer" v-for="item in noticeList" :key="item.id"> <li
class="text_hidden_one pointer"
v-for="item in noticeList"
:key="item.id"
>
<router-link <router-link
target="_blank" target="_blank"
:to="{ :to="{
path: '/result', path: '/result',
query: { key: 'policy', id: item.id } query: { key: 'policy', id: item.id },
}" }"
> >
<span></span> <span></span>
@ -126,7 +144,7 @@ import {
getPolicyReadInfo, getPolicyReadInfo,
getInfo, getInfo,
getInfo2, getInfo2,
getInfo3 getInfo3,
} from '@/api/search'; } from '@/api/search';
import { getPolicyList, getRead } from '@/api/home/notice'; import { getPolicyList, getRead } from '@/api/home/notice';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
@ -140,7 +158,7 @@ export default {
components: { components: {
Editor, Editor,
headerPage, headerPage,
footerPage footerPage,
// headerPage2 // headerPage2
}, },
data() { data() {
@ -149,7 +167,7 @@ export default {
type: '', type: '',
formData: {}, formData: {},
noticeList: [], noticeList: [],
total: {} total: {},
}; };
}, },
watch: { watch: {
@ -166,12 +184,23 @@ export default {
} else { } else {
this.formData.text = this.formData.text.replaceAll('&nbsp;', ' '); this.formData.text = this.formData.text.replaceAll('&nbsp;', ' ');
} }
} this.$nextTick(() => {
if (this.formData.captureSource === 'TL_FGW') {
document
.getElementById('text')
.querySelectorAll('img')
.forEach((item) => {
// console.log(item.src);
item.src = item.src.replace('./', '/');
});
}
});
},
}, },
deep: true deep: true,
}, },
computed: { computed: {
...mapGetters(['token']) ...mapGetters(['token']),
}, },
methods: { methods: {
setNumber(val) { setNumber(val) {
@ -181,26 +210,26 @@ export default {
if (!this.input.length) return this.msgError('请输入搜索关键字'); if (!this.input.length) return this.msgError('请输入搜索关键字');
let routerJump = this.$router.resolve({ let routerJump = this.$router.resolve({
path: '/search', path: '/search',
query: { val: this.input } query: { val: this.input },
}); });
window.open(routerJump.href, '_blank'); window.open(routerJump.href, '_blank');
}, },
addItem() { addItem() {
add({ policyId: this.formData.id }).then(res => { add({ policyId: this.formData.id }).then((res) => {
this.formData.collected = 1; this.formData.collected = 1;
this.msgSuccess('操作成功'); this.msgSuccess('操作成功');
}); });
}, },
cancelItem() { cancelItem() {
cancel({ policyId: this.formData.id }).then(res => { cancel({ policyId: this.formData.id }).then((res) => {
this.formData.collected = 0; this.formData.collected = 0;
this.msgSuccess('操作成功'); this.msgSuccess('操作成功');
}); });
}, },
removeBr(str) { removeBr(str) {
console.log(str); console.log(str);
return str && str.replaceAll('<br>', '') return str && str.replaceAll('<br>', '');
} },
}, },
created() { created() {
let { key, id } = this.$route.query; let { key, id } = this.$route.query;
@ -242,7 +271,7 @@ export default {
getPolicyList({ pageNum: 1, pageSize: 5 }).then(({ data }) => { getPolicyList({ pageNum: 1, pageSize: 5 }).then(({ data }) => {
this.noticeList = data.list; this.noticeList = data.list;
}); });
} },
}; };
</script> </script>