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

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

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