Files

91 lines
2.0 KiB
Vue
Raw Normal View History

2022-10-27 13:39:36 +08:00
<template>
2023-07-21 16:45:30 +08:00
<el-row style="padding: 40px 20px" type="flex">
2022-10-27 13:39:36 +08:00
<div class="img">
<el-image :src="data.image" alt />
</div>
<div class="content">
<div class="tit" @click="handleDetail(data.id)">
<div class="text" style="flex: 1">{{ data.name }}</div>
</div>
<div class="line">
2023-07-28 17:28:29 +08:00
{{ "webSearch.companySize" }}
2023-07-31 17:27:13 +08:00
<span>{{
data.kind_title || t("webSearch.noDataFromBackground")
}}</span>
2022-10-27 13:39:36 +08:00
</div>
<div class="line">
2023-07-28 17:28:29 +08:00
{{ t("webSearch.coreProducts") }} <span>{{ data.product }}</span>
2022-10-27 13:39:36 +08:00
</div>
<div class="line">
2023-07-28 17:28:29 +08:00
{{ t("webSearch.companyWebsite") }}
2022-10-27 13:39:36 +08:00
<a :href="data.url"
2023-07-31 17:27:13 +08:00
><span>{{ data.url || t("webSearch.noDataFromBackground") }}</span></a
2022-10-27 13:39:36 +08:00
>
</div>
</div>
2023-07-21 16:45:30 +08:00
<div class="keywords" style="/*flex: 1; */ width: 360px">
2022-10-27 13:39:36 +08:00
<wordcloud
2023-07-21 16:45:30 +08:00
:width="360"
2022-10-27 13:39:36 +08:00
:data="createdData(data.keyword?.split(',') ?? [])"
></wordcloud>
</div>
</el-row>
</template>
<script setup>
import wordcloud from "./wordcloud.vue";
2022-10-31 17:46:09 +08:00
import { useRoute, useRouter } from "vue-router";
2023-07-28 17:28:29 +08:00
import { useI18n } from "vue-i18n";
2023-07-21 16:45:30 +08:00
2023-07-28 17:28:29 +08:00
const { t } = useI18n();
2022-10-31 17:46:09 +08:00
const route = useRoute();
2022-10-27 13:39:36 +08:00
const router = useRouter();
const props = defineProps({
data: {
type: Object,
required: true,
},
});
2023-07-21 16:45:30 +08:00
2022-10-27 13:39:36 +08:00
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;
}
2023-07-21 16:45:30 +08:00
2022-10-27 13:39:36 +08:00
function handleDetail(id) {
2022-10-31 17:46:09 +08:00
let routeData = router.resolve({
path: `/searchList/enterprise/detail/${id}`,
query: {
keyword: route.query.keyword,
queryType: route.query.queryType,
},
});
2022-10-27 13:39:36 +08:00
window.open(routeData.href, "_blank");
}
</script>
2023-07-21 16:45:30 +08:00
<style lang="scss" scoped>
2022-10-27 13:39:36 +08:00
.img {
width: 90px;
margin-right: 12px;
display: flex;
align-items: center;
justify-content: center;
2023-07-21 16:45:30 +08:00
2022-10-31 17:46:09 +08:00
:deep(.el-image) {
2022-10-27 13:39:36 +08:00
width: 90px;
height: 90px;
border-radius: 50%;
}
}
2023-07-21 16:45:30 +08:00
.content {
flex: 1;
}
2022-10-27 13:39:36 +08:00
</style>