Commit 0926c470 by liudx

修改浏览记录bug

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