Commit 0926c470 by liudx

修改浏览记录bug

parent 7959ac4d
......@@ -27,6 +27,9 @@ export const structure = p=>get('/api/enterprise/structure/'+p.id)
export const jointApplication = p=>get('/api/enterprise/jointApplication/'+p.id)
//企业详情-技术合作 专利购买
export const patentPurchase = p=>get('/api/enterprise/patentPurchase/'+p.id)
//首页-企业技术合作榜单
export const technicalCooperation = p =>get('/api/enterprise/technicalCooperation',{})
......
......@@ -31,7 +31,7 @@
<a-pagination
v-model:current="currentPage"
@change="onChange"
:total="total"
:total="total0"
:showSizeChanger="false"
/>
</a-tab-pane>
......@@ -46,17 +46,15 @@
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex == 'action'">
<a-button
@click="exportPDF(record)"
@click="exportPDF(record)"
style="
background-color: #fa7f03;
color: #fff;
margin-right: 10%;
"
>
导出
</a-button>
>
导出
</a-button>
<a-button type="primary" @click="sendMail(record)"
>发送到邮箱</a-button
>
......@@ -71,7 +69,7 @@
</a-table>
<a-pagination
@change="onChange"
:total="total"
:total="total1"
v-model:current="currentPage"
:showSizeChanger="false"
/>
......@@ -96,12 +94,11 @@
</a-form-item>
</a-form>
</a-modal> -->
</div>
</template>
<script>
import { message } from "ant-design-vue";
import { userBrowse, ExportList,sendEmail } from "../../utils/userAPI";
import { userBrowse, ExportList, sendEmail } from "../../utils/userAPI";
export default {
name: "history",
data() {
......@@ -182,7 +179,7 @@ export default {
},
],
dataHistory: [],
dataExport:[]
dataExport: [],
};
},
components: {},
......@@ -211,16 +208,16 @@ export default {
//发送到邮箱
async sendMail(record) {
// this.visible = false;
let res = await sendEmail({
email:record.email,
name:record.name,
url:record.url
})
if(res.code==200){
message.success(res.msg)
}else{
message.error(res.msg)
}
let res = await sendEmail({
email: record.email,
name: record.name,
url: record.url,
});
if (res.code == 200) {
message.success(res.msg);
} else {
message.error(res.msg);
}
},
//打开弹窗
openModal() {
......@@ -241,13 +238,12 @@ export default {
}).then((res) => {
if (res.code == 0) {
this.dataHistory = res.data.data;
this.total = res.data.total;
if(this.dataHistory.length>0){
this.total0 = res.data.total;
if (this.dataHistory.length > 0) {
this.dataHistory.forEach((item, index) => {
item.index = (this.currentPage - 1) * 10 + index + 1;
});
item.index = (this.currentPage - 1) * 10 + index + 1;
});
}
} else {
message.error(res.msg);
}
......@@ -258,22 +254,21 @@ export default {
}).then((res) => {
if (res.code == 0) {
this.dataExport = res.data.data;
this.total = res.data.total;
if(this.dataExport.length>0){
this.dataExport.forEach((item, index) => {
item.index = (this.currentPage - 1) * 10 + index + 1;
});
this.total1 = res.data.total;
if (this.dataExport.length > 0) {
this.dataExport.forEach((item, index) => {
item.index = (this.currentPage - 1) * 10 + index + 1;
});
}
} else {
message.error(res.msg);
}
});
},
//导出pdf
exportPDF(record){
window.open(record.url)
}
exportPDF(record) {
window.open(record.url);
},
},
created() {
this.init();
......
......@@ -24,7 +24,6 @@
v-model:value="searchValue"
placeholder="请输入关键词"
@search="onSearch"
>
<!-- @input="onInput" -->
<template #enterButton>
......@@ -69,6 +68,7 @@
</div>
<div class="home_list">
<!-- 列表 -->
<!-- 科创能力 -->
<div class="ranking">
<div class="ranking_title">
<img src="@/static/home/index/icon-list01.png" alt="" />
......@@ -76,35 +76,38 @@
<span class="more" @click="openmore('1')">更多</span>
</div>
<!-- 判断是否有数据 -->
<ul v-if="innovateList.length !== 0">
<li
<div v-if="scientificInnovation.length !== 0">
<div
class="rank_item"
v-for="item in innovateList"
@click="openDetails"
v-for="item in scientificInnovation"
@click="openCompany(item)"
>
{{ item }}
</li>
</ul>
<div class="doat"></div>
<div>{{ item.company_name }}</div>
</div>
</div>
<div class="empty_img" v-else>
<img src="@/static/home/index/img-empty.png" alt="" />
<div class="nodata">暂无数据</div>
</div>
</div>
<!-- 技术合作 -->
<div class="ranking">
<div class="ranking_title">
<img src="@/static/home/index/icon-list02.png" alt="" />
<span class="title">&nbsp;企业技术合作榜单</span>
<span class="more" @click="openmore('2')">更多</span>
</div>
<ul v-if="innovateList.length !== 0">
<li
<div v-if="innovateList.length !== 0">
<div
class="rank_item"
v-for="item in innovateList"
@click="openDetails"
@click="openCompany(item)"
>
{{ item }}
</li>
</ul>
<div class="doat"></div>
<div>{{ item.company_name }}</div>
</div>
</div>
<div class="empty_img" v-else>
<img src="@/static/home/index/img-empty.png" alt="" />
<div class="nodata">暂无数据</div>
......@@ -116,15 +119,16 @@
<span class="title">&nbsp;浏览记录</span>
<span class="more" @click="openHistory">更多</span>
</div>
<ul v-if="historyList.length !== 0">
<li
<MenuDivider v-if="historyList.length !== 0">
<div
class="rank_item"
v-for="item in historyList"
@click="openDetails(item)"
>
{{ item.name }}
</li>
</ul>
<div class="doat"></div>
<div>{{ item.name }}</div>
</div>
</MenuDivider>
<div class="empty_img" v-else>
<img src="@/static/home/index/img-empty.png" alt="" />
<div class="nodata">暂无浏览记录</div>
......@@ -136,15 +140,16 @@
<span class="title">&nbsp;我的关注</span>
<span class="more" @click="openFollow">更多</span>
</div>
<ul v-if="followList.length !== 0">
<li
<div v-if="followList.length !== 0">
<div
class="rank_item"
v-for="item in followList"
@click="openDetails(item)"
>
{{ item.name }}
</li>
</ul>
<div class="doat"></div>
<div>{{ item.name }}</div>
</div>
</div>
<div class="empty_img" v-else>
<img src="@/static/home/index/img-empty.png" alt="" />
<div class="nodata">暂无关注数据</div>
......@@ -155,6 +160,8 @@
</template>
<script>
import { followList, userBrowse } from "../../utils/userAPI";
import { technicalCooperation } from "../../utils/indexApi";
export default {
name: "home",
data() {
......@@ -164,11 +171,8 @@ export default {
searchValue: "",
followList: [],
historyList: [],
innovateList: [
"山煤国际能源集团股份有限公司",
"山煤国际能源集团股份有限公司",
"山煤国际能源集团股份有限公司",
],
innovateList: [],
scientificInnovation:[],
search_result: [
"山煤国际能源集团股份有限公司1",
"山煤国际能源集团股份有限公司2",
......@@ -182,6 +186,7 @@ export default {
init() {
this.getFollow();
this.getHistory();
this.getTechnicalCooperation();
},
getFollow() {
followList({
......@@ -207,6 +212,14 @@ export default {
}
});
},
//获取技术合作榜单
getTechnicalCooperation() {
technicalCooperation().then((res) => {
if (res.code == 0) {
this.innovateList = res.data;
}
});
},
//打开历史记录
openHistory() {
this.$router.push({
......@@ -240,6 +253,16 @@ export default {
});
}
},
//打开企业技术/科创详情页面
openCompany(item){
this.$router.push({
path: "/companyDetails",
query: {
id: item.id,
name: item.company_name,
},
});
},
//打开榜单
openmore(id) {
if (id == "1") {
......@@ -485,11 +508,18 @@ export default {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
li::marker {
color: #ccc;
border-radius: 50%;
font-size: 18px;
// position: relative;
display: flex;
align-items: center;
.doat {
width: 5px;
height: 5px;
margin: 10px;
background-color: #ccc;
border-radius: 50%;
line-height: 40px;
}
}
}
}
......
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