search results contain achievement and product

This commit is contained in:
cxc
2022-12-07 11:22:32 +08:00
parent 081ba02e40
commit 4ba7585aaa
17 changed files with 472 additions and 64 deletions

1
.yarnrc.yml Normal file
View File

@ -0,0 +1 @@
nodeLinker: node-modules

Binary file not shown.

BIN
cas_web_1107.7z Normal file

Binary file not shown.

11
src/api/admin/count.js Normal file
View File

@ -0,0 +1,11 @@
import request from "@/utils/request";
export const updateCount = (name) =>
request({
url: "/app/map/handleReadCount",
method: "GET",
params: {
name,
type: "2",
},
});

View File

@ -39,11 +39,8 @@
class="el-upload-list__item ele-upload-list__item-content"
v-for="(file, index) in fileList"
>
<el-link
:href="`${baseUrl}${file.url}`"
:underline="false"
target="_blank"
>
<!-- :href="`${baseUrl}${file.url}`" -->
<el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">

View File

@ -73,6 +73,14 @@ export const constantRoutes = [
searchType: 2,
},
},
{
path: "searchList/product/detail/:id",
component: () =>
import("../views/website/searchList/productDetail.vue"),
meta: {
searchType: 2,
},
},
{
path: "searchList/lab",
component: () => import("../views/website/searchList/lab.vue"),
@ -373,7 +381,7 @@ export const enterpriseRoutes = [
component: () => import("@/views/admin/enterprise/extension/results"),
hidden: true,
name: "Results",
meta: { title: "匹配结果", icon: "list" },
meta: { title: "匹配结果", icon: "list", isMatch: true },
},
{
path: "business",
@ -425,7 +433,7 @@ export const enterpriseRoutes = [
component: () => import("@/views/admin/enterprise/extension/results"),
hidden: true,
name: "results",
meta: { title: "匹配结果", icon: "list" },
meta: { title: "匹配结果", icon: "list", isMatch: true },
},
],
},
@ -534,7 +542,7 @@ export const expertRoutes = [
component: () => import("@/views/admin/enterprise/extension/results"),
hidden: true,
name: "Results",
meta: { title: "匹配结果", icon: "list" },
meta: { title: "匹配结果", icon: "list", isMatch: false },
},
{
path: "patent",

View File

@ -123,13 +123,14 @@ import { onActivated } from "vue";
import { demandCategoryList } from "@/utils/parameter";
// import { onActivated } from "vue";
import { useRoute, useRouter } from "vue-router";
import { updateCount } from "../../../../api/admin/count";
const router = useRouter();
const route = useRoute();
const data = reactive({
form: {
check: [],
status: 0,
status: 1,
},
queryParams: {
pageNum: 1,
@ -171,7 +172,9 @@ const submitForm = () => {
await insertDemand(form.value);
ElMessage.success("新增服务需求成功");
// router.back();
updateCount("service");
}
backToList();
}
});

View File

@ -190,6 +190,7 @@ import {
insertTechnologyDemand,
} from "@/api/admin/enterprise/demand";
import { onMounted } from "vue";
import { updateCount } from "../../../../api/admin/count";
const router = useRouter();
const route = useRoute();
const data = reactive({
@ -283,6 +284,7 @@ const submitForm = async (status) => {
await insertTechnologyDemand(form.value);
ElMessage.success("新增企业需求成功");
}
updateCount("technology");
backToList();
} else {
console.log("校验未通过");

View File

@ -25,6 +25,7 @@ import {
updateEnterpriseProduct,
} from "@/api/admin/enterprise/product";
import { reactive, toRefs } from "vue";
import { updateCount } from "@/api/admin/count";
const route = useRoute();
// const router = useRouter();
const labelWidth = 140;
@ -47,6 +48,9 @@ const submitForm = async (is_submit) => {
await insertEnterpriseProduct(form.value);
ElMessage.success("新增产品成功");
}
if (is_submit == "1") {
updateCount("product");
}
// router.go(-1);
tab.closeOpenPage({ path: "/extension/product" });
} else {

View File

@ -111,33 +111,33 @@ import TechnologyDemandItem from "@/views/website/searchList/components/technolo
import AchievementItem from "@/views/website/searchList/components/achievementItem.vue";
import { useRoute, useRouter } from "vue-router";
import useUserStore from "@/store/modules/user";
// import useUserStore from "@/store/modules/user";
import LaboratoryItem from "@/views/website/searchList/components/laboratoryItem.vue";
const route = useRoute();
const router = useRouter();
// const router = useRouter();
const dataList = ref([]);
const loading = ref(true);
const total = ref(0);
const userStore = useUserStore();
const queryType = computed(() => {
console.log(queryParams.value.searchType);
if (queryParams.value.searchType == 1) {
return 2;
} else if (queryParams.value.searchType == 2) {
return 1;
} else if (queryParams.value.searchType == 4) {
return 2;
} else if (queryParams.value.searchType == 5) {
return 2;
} else if (queryParams.value.searchType == 6) {
return 1;
} else if (queryParams.value.searchType == 7) {
return 1;
} else if (queryParams.value.searchType == 8) {
return 2;
}
});
// const userStore = useUserStore();
// const queryType = computed(() => {
// console.log(queryParams.value.searchType);
// if (queryParams.value.searchType == 1) {
// return 2;
// } else if (queryParams.value.searchType == 2) {
// return 2;
// } else if (queryParams.value.searchType == 4) {
// return 2;
// } else if (queryParams.value.searchType == 5) {
// return 2;
// } else if (queryParams.value.searchType == 6) {
// return 2;
// } else if (queryParams.value.searchType == 7) {
// return 2;
// } else if (queryParams.value.searchType == 8) {
// return 2;
// }
// });
const data = reactive({
queryParams: {
@ -145,26 +145,26 @@ const data = reactive({
pageSize: 10,
query: route.query.keyword,
searchType: "1",
queryType: queryType,
isMatch: true,
queryType: "2",
isMatch: route.meta.isMatch,
},
});
const { queryParams } = toRefs(data);
watch(
queryType,
(val) => {
router.replace({
path: route.path,
query: {
keyword: route.query.keyword,
queryType: val,
},
});
},
{ immediate: true }
);
// watch(
// queryType,
// (val) => {
// router.replace({
// path: route.path,
// query: {
// keyword: route.query.keyword,
// queryType: val,
// },
// });
// },
// { immediate: true }
// );
/** 查询列表 */
async function getList() {
const resp = await search(queryParams.value);

View File

@ -123,11 +123,12 @@ import tab from "@/plugins/tab";
// import CityOptions from "@/views/components/CityOptions";
import { ElMessage } from "element-plus";
import { useRoute, useRouter } from "vue-router";
import { updateCount } from "@/api/admin/count.js";
const data = reactive({
formData: {
check: [],
status: 0,
status: 1,
},
queryParams: {
pageNum: 1,
@ -190,6 +191,8 @@ async function submitForm() {
await insertDemand(formData.value);
ElMessage.success("新增成功");
}
updateCount("service");
tab.closeOpenPage({ path: "/demand/serviceDemand" });
}
function addCheck() {

View File

@ -148,7 +148,7 @@
</template>
<script setup>
import CityOptions from "@/views/components/CityOptions";
// import CityOptions from "@/views/components/CityOptions";
import FieldSingle from "@/views/components/FieldSingle";
import {
@ -157,12 +157,10 @@ import {
insertExpertWantEnterprise,
deleteExpertWantEnterpriseByIds,
} from "@/api/admin/expert/demand";
import dayjs from "dayjs";
// import dayjs from "dayjs";
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { cloneDeep } from "lodash-unified";
const router = useRouter();
const { proxy } = getCurrentInstance();
const dataList = ref([]);
const showEditDialog = ref(false);

View File

@ -24,6 +24,7 @@ import tab from "@/plugins/tab";
import { ElMessage } from "element-plus";
import { reactive, ref, toRefs } from "vue";
import { useRoute, useRouter } from "vue-router";
import { updateCount } from "../../../../api/admin/count";
import ReleaseForm from "../components/ReleaseForm";
const labelWidth = 140;
@ -61,6 +62,7 @@ const submitForm = async (status) => {
ElMessage.success("新增成果成功");
// router.back();
}
updateCount("achievement");
tab.closeOpenPage({ path: "/technology/achievement" });
} else {
console.log("校验未通过");

View File

@ -93,12 +93,12 @@
<div class="val">{{ state.data.expert_count }}</div>
<div class="des">专家数量</div>
</div>
<!-- <div>
<div>
<div class="val">
{{ state.data.patent_count + state.data.achievement_count }}
{{ state.data.laboratory_count }}
</div>
<div class="des">专利成果数量</div>
</div> -->
<div class="des">实验室数量</div>
</div>
<div>
<div class="val">{{ state.data.demand_count }}</div>
<div class="des">需求数量</div>

View File

@ -210,11 +210,7 @@ function getDataList() {
resp.data.district
);
loading.value = false;
// }
});
// .catch(() => {
// loading.value = false;
// });
}
</script>

View File

@ -4,16 +4,22 @@
<div class="img" v-if="data.image">
<el-image :src="data.image" alt="" style="height: 150px" />
</div>
<div v-else class="type">成果</div>
<div v-else-if="data.type == 1" class="type">产品</div>
<div v-else-if="data.type == 2" class="type">成果</div>
<div class="content">
<div class="tit" @click="handleDetail(data.id)">{{ data.title }}</div>
<div class="tit" @click="handleDetail(data.dataId)">
{{
data.type == 2 ? "成果名称" : data.type == 1 ? "产品名称" : ""
}}
{{ data.title }}
</div>
<slot name="des" />
<div v-if="data.industryStr" class="line">
所属领域
<!-- <span>{{ data.industrys[data.industrys.length - 1] }}</span> -->
<span>{{ data.industryStr }}</span>
</div>
<div class="line">
<!-- <div class="line">
所属专家
<span>{{ data.expertName }}</span>
</div>
@ -23,7 +29,7 @@
maturityOptions.find((el) => el.key == data.maturity)?.value ??
"未知"
}}</span>
</div>
</div> -->
<div class="line">
联系人
<span>中科云平台</span>
@ -58,6 +64,7 @@ import wordcloud from "./wordcloud.vue";
// import collectAndVisit from "./collectAndVisit.vue";
import { maturityOptions } from "@/utils/parameter.js";
import { useRoute, useRouter } from "vue-router";
import { toRefs } from "vue";
const route = useRoute();
const router = useRouter();
@ -67,10 +74,19 @@ const props = defineProps({
required: true,
},
});
const { data } = toRefs(props);
function handleDetail(id) {
console.log(data.value);
let path;
if (data.value.type == 1) {
path = `/searchList/product/detail/${id}`;
} else if (data.value.type == 2) {
path = `/searchList/achievement/detail/${id}`;
} else {
return;
}
let routeData = router.resolve({
path: `/searchList/achievement/detail/${id}`,
path,
query: {
keyword: route.query.keyword,
queryType: route.query.queryType,

View File

@ -0,0 +1,367 @@
<template>
<div v-loading="loading">
<searchContainer
bannerKey="首页>产品库>产品详情"
title="产品库"
@handleQuery="handleQuery"
>
<template v-slot>
<div class="head">
<el-breadcrumb separator="/">
<el-breadcrumb-item>
<span class="one">找产品</span>
</el-breadcrumb-item>
<el-breadcrumb-item>
<span>产品详情</span>
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<el-row type="flex" style="padding-bottom: 20px">
<div style="flex: 1">
<achievementItem :data="state.expertDetail">
<template v-slot:des>
<div>{{ state.expertDetail.introduce }}</div>
</template>
</achievementItem>
<div class="btns">
<div class="order" @click="showDocking = true">预约对接</div>
<div class="share">一键分享</div>
</div>
<div class="detail">
<div style="padding: 20px 0">
<div class="pointTit">产品简介</div>
</div>
<div class="html" v-html="state.expertDetail.description"></div>
<div style="padding: 20px 0">
<div class="pointTit">所属单位</div>
</div>
<section>
{{ state.expertDetail.unit }}
</section>
<div style="padding: 20px 0">
<div class="pointTit">产品领先性</div>
</div>
<section>
<div>
{{
leadOptions.find(
(el) => el.key == state.expertDetail.leadStandard
)?.value
}}
</div>
</section>
<div style="padding: 20px 0">
<div class="pointTit">合作模式</div>
</div>
<section>
<div>
{{
cooperationOptions.find(
(el) => el.key == state.expertDetail.cooperationMode
)?.value
}}
</div>
</section>
<div style="padding: 20px 0">
<div class="pointTit">应用客户</div>
</div>
<section>
<div>
{{ state.expertDetail.customer }}
</div>
</section>
<div style="padding: 20px 0">
<div class="pointTit">所在地</div>
</div>
<section>
{{ state.localtion }}
</section>
</div>
</div>
<div class="r">
<webContact />
</div>
</el-row>
</template>
</searchContainer>
<docking v-model:visible="showDocking"></docking>
</div>
</template>
<script setup>
import webContact from "@/components/webContact/index.vue";
import achievementItem from "./components/achievementItem.vue";
// import loadMore from "./components/loadMore.vue";
// import request from "@/utils/request";
// import { onMounted } from "vue";
import searchContainer from "./components/searchContainer.vue";
// import wordcloud from "./components/wordcloud.vue";
// import productItem from "./components/productItem.vue";
import { searchAchievementDetail } from "@/api/website/home";
import { useRoute, useRouter } from "vue-router";
import { reactive, ref } from "vue";
import docking from "./components/docking.vue";
import { getCity } from "@/utils/city";
import { leadOptions, cooperationOptions } from "@/utils/parameter";
const showDocking = ref(false);
const loading = ref(true);
// import {lead}
const state = reactive({
pageNum: 1,
pageSize: 4,
keyword: "",
val: 3,
expertDetail: {},
arr: [
{
name: "Cat",
value: 26,
},
{
name: "fish",
value: 19,
},
],
activeName: "first",
});
const router = useRouter();
const route = useRoute();
// const searchResults = ref([]);
// const total = ref(0);
// const queryParams = reactive({
// pageNum: 1,
// pageSize: 5,
// searchType: 5,
// queryType: route.query.queryType,
// query: route.query.keyword,
// });
// 建议 列表前4条
// function recommend() {
// return request({
// url: "/v1/search",
// method: "post",
// data: {
// mode: 5,
// page: state.pageNum,
// page_size: state.pageSize,
// keyword: state.keyword,
// },
// });
// }
// function createdData(arr) {
// let l = [];
// let snap = JSON.parse(JSON.stringify(arr));
// snap.map((e) => {
// l.push({ name: e, value: 30 });
// return { name: e, value: 30 };
// });
// return l;
// }
// function handleDetail(id) {
// let routeData = router.resolve({
// path: `/searchList/0/detail/${id}`,
// query: { keyword: state.keyword },
// });
// window.open(routeData.href, "_blank");
// }
function handleList(mode, keyword) {
router.push({
path: `/searchList/${mode}`,
query: { keyword, queryType: route.query.queryType },
});
}
// 首次加载数据,其后跳转页面
let flag = true;
function handleQuery(state) {
// queryParams.query = state.currentKeyword;
// queryParams.queryType = state.queryType;
if (flag) {
getDataList();
flag = false;
} else {
handleList("achievement", state.currentKeyword);
}
}
function getDataList() {
loading.value = true;
let id = route.params.id;
if (!id) return;
searchAchievementDetail(id)
// achievementDetail(id)
.then(async (resp) => {
// if (200 == res.code) {
console.log(resp.data);
state.expertDetail = resp.data;
state.localtion = await getCity(
resp.data.province,
resp.data.city,
resp.data.district
);
loading.value = false;
});
}
</script>
<style lang="scss" scoped>
:deep(.el-tabs) {
.el-tabs__item {
color: #666666;
font-size: 14px;
}
.el-tabs__item:hover {
opacity: 0.8;
}
.el-tabs__item.is-active {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.el-tabs__active-bar {
background-color: #333333;
height: 4px;
}
.el-tabs__nav-wrap::after {
background-color: transparent;
}
}
.head {
padding: 15px 0px;
span {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
.one {
color: #333333;
}
}
.r {
display: inline-block;
width: 325px;
margin-left: 14px;
min-height: 200px;
}
.detail {
width: 661px;
box-sizing: border-box;
padding: 20px;
background: #fff;
.describe {
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin-bottom: 5px;
}
}
.pointTit {
position: relative;
padding-left: 10px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
&:before {
content: "";
top: 8px;
left: 0px;
position: absolute;
display: block;
width: 5px;
height: 5px;
background: #0054ff;
}
}
.btns {
overflow: hidden;
padding: 0 20px 20px 20px;
width: 100%;
background-color: #fff;
margin-top: -20px;
div {
margin-top: 20px;
text-align: center;
float: right;
cursor: pointer;
user-select: none;
width: 101px;
height: 36px;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
line-height: 36px;
box-sizing: border-box;
&:hover {
opacity: 0.7;
}
}
.share {
color: #333333;
background: #f2f6ff;
border: 1px solid #dcdcdc;
margin-right: 10px;
}
.order {
background: #0054ff;
color: #ffffff;
border: none;
}
}
.achievementItem,
.loadMoreItem {
padding: 20px;
background-color: #fff;
margin-bottom: 10px;
.tit {
margin-left: -8px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.line {
margin: 10px 0;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
}
.patentItem {
padding: 20px;
background-color: #fff;
margin-bottom: 10px;
.tit {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.line {
padding-left: 8px;
margin: 10px 0;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
}
</style>