提交 8b28a867 authored 作者: 张烨's avatar 张烨

feat:政令影响分析增加产业链关系图

上级 403bb405
......@@ -22,9 +22,26 @@ export function getDecreehylyList() {
// 获取受影响实体列表
export function getDecreeEntities(params) {
return request({
method: 'POST',
url: `/api/administrativeOrderInfo/relatedEntities`,
data: params
})
}
// 获取实体产业链列表
export function getDecreeRelatedChain(params) {
return request({
method: 'GET',
url: `/api/administrativeOrderInfo/relatedChain/${params.id}`,
})
}
// 获取产业链节点列表
export function getDecreeChainNodes(params) {
return request({
method: 'GET',
url: `/api/administrativeOrderInfo/relatedEntities/${params.id}`,
url: `/api/administrativeOrderInfo/relatedChainNodes/${params.id}`,
})
}
......
......@@ -5,13 +5,13 @@
<div class="box1-main">
<div class="data-filter">
<div class="filter-select">
<el-select v-model="areaInfo.id" :empty-values="[null, undefined]" style="width: 100%">
<el-select v-model="areaInfo.id" :empty-values="[null, undefined]" @change="onDecreeEntities()" style="width:100%">
<el-option label="全部领域" value="" />
<el-option v-for="item in areaInfo.list" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</div>
<div class="filter-input">
<el-input v-model="entityInfo.keyword" @keyup.enter="onDecreeEntities(1)" :suffix-icon="Search" placeholder="搜索实体" />
<el-input v-model="entityInfo.keyword" @keyup.enter="onDecreeEntities()" :suffix-icon="Search" placeholder="搜索实体" />
</div>
</div>
<div class="data-title">实体名称</div>
......@@ -19,7 +19,7 @@
<el-empty v-if="!entityInfo.list?.length" style="padding: 60px 0;" description="暂无数据" :image-size="100" />
<el-scrollbar height="100%" always>
<div class="list-data">
<div class="list-item" v-for="item in entityInfo.list" :key="item.id" :class="{ 'item-active': entityInfo.id==item.id }" @click="handleToCompanyDetail(item)">
<div class="list-item" v-for="item in entityInfo.list" :key="item.id" :class="{ 'item-active': entityInfo.id==item.id }" @click="onDecreeRelatedChain(item)">
<div class="item-icon">
<img :src="defaultIcon2" alt="" class="item-img" />
</div>
......@@ -68,7 +68,7 @@
</div>
</div>
<div class="title-right" v-if="contentType==1">
<el-select v-model="industryChain.id" style="width: 100%">
<el-select v-model="industryChain.id" style="width: 100%" @change="onDecreeChainNodes">
<el-option v-for="item in industryChain.list" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</div>
......@@ -92,7 +92,7 @@
import { ref, onMounted, reactive } from "vue";
import { useRoute } from "vue-router";
import { Search } from '@element-plus/icons-vue'
import { getDecreehylyList, getDecreeEntities } from "@/api/decree/influence";
import { getDecreehylyList, getDecreeEntities, getDecreeRelatedChain, getDecreeChainNodes } from "@/api/decree/influence";
import ChartChain from "./com/ChartChain.vue";
import AiTips from "./com/AiTips.vue";
import GraphChart from "@/components/base/GraphChart/index.vue";
......@@ -137,19 +137,20 @@ const entityInfo = reactive({
const onDecreeEntities = async (page=1) => {
entityInfo.pageNum = page;
try {
const res = await getDecreeEntities({id: route.query.id});
let { pageSize, pageNum, keyword } = entityInfo;
const res = await getDecreeEntities({id: route.query.id, pageSize, pageNum:pageNum-1, keyword});
console.log("受影响实体:", res);
if (res.code === 200 && res.data) {
entityInfo.list = res.data.companies;
entityInfo.total = res.data.companies.length;
if (res.code === 200) {
entityInfo.list = res.data.companyInfos;
entityInfo.total = res.data.total;
if (entityInfo.total && entityInfo.list.every(item => item.id!=entityInfo.id)) {
onDecreeRelatedChain(entityInfo.list[0])
}
}
} catch (error) {
console.log("获取受影响实体失败", error);
}
};
const handleToCompanyDetail = (item) => {
entityInfo.id = item.id;
};
const contentType = ref(1);
const headerContentType = (type) => {
......@@ -161,13 +162,52 @@ const industryChain = reactive({
list: [],
id: "",
})
const onDecreeRelatedChain = async ({ id }) => {
entityInfo.id = id;
try {
const res = await getDecreeRelatedChain({ id });
console.log("产业链:", res);
if (res.code === 200) {
industryChain.id = "";
industryChain.list = res.data;
if (industryChain.list.length) onDecreeChainNodes(industryChain.list[0].id)
}
} catch (error) {
console.log("获取产业链失败", error);
}
};
// 产业链鱼骨图
const fishbone = reactive({
list: [],
base: {},
base: [],
})
const onDecreeChainNodes = async (id) => {
industryChain.id = id;
fishbone.list = []
fishbone.base = []
try {
const res = await getDecreeChainNodes({ id });
console.log("产业链鱼骨图:", res);
if (res.code === 200) {
let obj = res.data.chains.reduce((result, item) => {
result['chain-'+item.id] = {...item, children: []};
return result;
}, {});
res.data.children.forEach(item => {
if (obj['chain-'+item.chainId]?.children?.length < 10) {
obj['chain-'+item.chainId].children.push(item)
}
})
fishbone.list = Object.values(obj);
fishbone.base = res.data.levelInfos.map((item, index) => {
return {...item, name: ['上游', '中游', '下游'][index]}
});
}
} catch (error) {
console.log("获取产业链鱼骨图失败", error);
}
};
// 实体关系
const graphInfo = reactive({
......
......@@ -66,12 +66,11 @@
<AnalysisBox title="报告内容摘要" :showAllBtn="false">
<el-empty v-if="false" style="margin: 20px 0;" description="暂无数据" :image-size="100" />
<div class="box5-main">
<div class="box5-back">
<div class="box5-top">
<div class="box5-image"></div>
</div>
<div class="box5-text text-align-justify">{{ box1Data }}</div>
</div>
<AiSummary>
<template #summary-content>
<div class="box5-text">{{ box1Data }}</div>
</template>
</AiSummary>
</div>
</AnalysisBox>
</div>
......@@ -170,6 +169,7 @@ import {
getDecreeIssueOrganization
} from "@/api/decree/introduction";
import { getDecreeRelatedEvent } from "@/api/decree/background";
import AiSummary from '@/components/base/Ai/AiSummary/index.vue'
import DefaultIcon1 from "@/assets/icons/default-icon1.png";
import DefaultIcon2 from "@/assets/icons/default-icon2.png";
......@@ -456,30 +456,14 @@ onMounted(() => {
}
.box5-main {
padding: 10px 22px 22px;
.box5-back {
border: solid 1px #E7F3FF;
.box5-top {
display: flex;
padding: 18px 20px;
background: linear-gradient(rgb(137, 193, 255, 0.1), rgb(255, 255, 255));
.box5-image {
width: 199px;
height: 32px;
font-size: 0px;
background-image: url('./assets/images/title-image.png');
background-size: 100% 100%;
cursor: pointer;
}
}
.box5-text {
padding: 0 20px 20px;
font-family: "Source Han Sans CN";
font-weight: 400;
font-size: 16px;
line-height: 30px;
min-height: 300px;
}
padding: 0px 22px 22px;
.box5-text {
padding-bottom: 20px;
font-family: "Source Han Sans CN";
font-weight: 400;
font-size: 16px;
line-height: 30px;
min-height: 300px;
}
}
......
......@@ -52,8 +52,8 @@ export default defineConfig({
},
'/api': {
target: 'http://8.140.26.4:9085/',
// target: 'http://172.20.10.3:28080/',
// target: 'http://8.140.26.4:9085/',
target: 'http://172.20.10.3:28080/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论