提交 d5eb651a authored 作者: coderBryanFu's avatar coderBryanFu

feat:新增通用组件AiSummary

上级 3dea68fc
...@@ -17,7 +17,7 @@ defineProps({ ...@@ -17,7 +17,7 @@ defineProps({
}) })
</script> </script>
<style scoped> <style lang="scss" scoped>
.action-button { .action-button {
height: 28px; height: 28px;
padding: 0 8px; padding: 0 8px;
...@@ -29,11 +29,16 @@ defineProps({ ...@@ -29,11 +29,16 @@ defineProps({
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
transition: all 0.3s; transition: all 0.3s;
} }
.action-button[type="normal"] { .action-button[type="normal"] {
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
color: rgba(59, 65, 75, 1); color: rgba(59, 65, 75, 1);
&:hover {
background: var(--color-primary-2);
}
} }
.action-button[type="active"] { .action-button[type="active"] {
...@@ -52,6 +57,4 @@ defineProps({ ...@@ -52,6 +57,4 @@ defineProps({
.action-button[type="active"]:hover { .action-button[type="active"]:hover {
background-color: #40a9ff; background-color: #40a9ff;
} */ } */
</style> </style>
\ No newline at end of file
<svg viewBox="0 0 1019 61" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1019.000000" height="61.000000" fill="none" customFrame="#000000">
<defs>
<linearGradient id="paint_linear_1" x1="7.60449219" x2="10.1398888" y1="-1.90734863e-06" y2="61.0955963" gradientUnits="userSpaceOnUse">
<stop stop-color="rgb(231,243,255)" offset="0" stop-opacity="1" />
<stop stop-color="rgb(231,243,255)" offset="1" stop-opacity="0" />
</linearGradient>
</defs>
<path id="矩形 5734" d="M0.000322558 0L1019 0L1019 31.5006L0 61.0008L0.000322558 0Z" fill="url(#paint_linear_1)" fill-rule="evenodd" />
</svg>
<svg viewBox="0 0 15 12" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15.000000" height="12.000000" fill="none" customFrame="url(#clipPath_0)">
<defs>
<clipPath id="clipPath_0">
<rect width="15.000000" height="12.000000" x="0.000000" y="0.000000" rx="6.000000" fill="rgb(255,255,255)" />
</clipPath>
<linearGradient id="paint_linear_0" x1="7.49999952" x2="7.49999952" y1="0" y2="10.5" gradientUnits="userSpaceOnUse">
<stop stop-color="rgb(5,95,194)" offset="0" stop-opacity="1" />
<stop stop-color="rgb(137,193,255)" offset="1" stop-opacity="1" />
</linearGradient>
</defs>
<rect id="AI-logo" width="15.000000" height="12.000000" x="0.000000" y="0.000000" rx="6.000000" />
<path id="合并" d="M12.2098 1.46629C12.9076 0.916637 13.2563 0 13.2563 0C13.2563 0 13.1693 0.916623 13.6052 1.46629C14.0411 2.01595 15 2.19866 15 2.19866C15 2.19866 13.9535 2.38224 13.2559 2.93288C12.5583 3.48351 12.2095 4.40121 12.2095 4.40121C12.2095 4.40121 12.2966 3.48353 11.8605 2.93288C11.4245 2.38222 10.4653 2.1986 10.4653 2.1986C10.4653 2.1986 11.5121 2.01594 12.2098 1.46629ZM8.176 2.20032L9.23888 10.5L6.83718 10.5L6.55783 8.24068L3.20908 8.24068L2.27565 10.5L0 10.5L3.08303 2.61208L2.68105 2.20032L8.176 2.20032ZM5.09297 3.60747L3.75415 6.83353L6.43179 6.83353L6.0298 3.60747L5.09297 3.60747ZM13.0741 10.4999L13.9839 4.57493L10.7578 4.57493L11.1632 5.13349L10.5361 10.4999L13.0741 10.4999Z" fill="url(#paint_linear_0)" fill-rule="evenodd" />
</svg>
<svg viewBox="0 0 6.70703 13.4102" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="6.707031" height="13.410156" fill="none" customFrame="#000000">
<rect id="容器 848" width="6.000000" height="11.997072" x="0.353516" y="0.707031" />
<path id="矢量 626" d="M0 0L2.99854 2.99854L6 0" stroke="rgb(5,95,194)" stroke-width="1.000000" transform="matrix(1,0,0,-1,0.353516,3.70508)" />
<path id="矢量 627" d="M0.353516 9.70508L3.35205 12.7036L6.35352 9.70508" stroke="rgb(5,95,194)" stroke-width="1.000000" />
</svg>
<template>
<div class="summary-wrapper">
<div class="summary-header">
<div class="icon1">
<img src="./icon1.svg" alt="">
</div>
<div class="text text-tip-1">{{ '智库报告总结摘要' }}</div>
<div class="icon2">
<img src="./icon2.svg" alt="">
</div>
</div>
<div class="summary-main">
<slot name="summary-content"></slot>
</div>
</div>
</template>
<style lang="scss">
.summary-wrapper {
width: 100%;
height: 100%;
// background: linear-gradient(90deg, var(--color-primary-10) 0%, var(--bg-white-100) 100%) ;
background: url('./bg.svg') no-repeat;
overflow: hidden;
border-radius: 4px;
border: 1px solid #E7F3FF;
.summary-header {
margin-top: 16px;
margin-left: 24px;
width: 199px;
height: 32px;
border: 1px solid var(--color-primary-100);
border-radius: 16px;
background: var(--color-primary-10);
display: flex;
justify-content: center;
align-items: center;
gap: 9px;
.icon1 {
width: 15px;
height: 12px;
img {
width: 100%;
height: 100%;
}
}
.text {
color: var(--color-primary-100);
}
.icon2 {
width: 6px;
height: 12px;
img {
width: 100%;
height: 100%;
}
}
}
.summary-main {
margin: 0 auto;
margin-top: 24px;
width: calc(100% - 52px);
height: calc(100% - 92px);
}
}
</style>
\ No newline at end of file
// 法案资源库 // 法案资源库
const CountryBill = () => import('@/views/dataLibrary/components/bill/countryBill/index.vue') const CountryBill = () => import('@/views/dataLibrary/bill/countryBill/index.vue')
const StateBill = () => import('@/views/dataLibrary/components/bill/stateBill/index.vue') const StateBill = () => import('@/views/dataLibrary/bill/stateBill/index.vue')
const dataBillRoutes = [ const dataBillRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const Decree = () => import('@/views/dataLibrary/components/decree/index.vue') const Decree = () => import('@/views/dataLibrary/decree/index.vue')
const dataDecreeRoutes = [ const dataDecreeRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const CommerceControlList = () => import('@/views/dataLibrary/components/exportControl/commerceControlList/index.vue') const CommerceControlList = () => import('@/views/dataLibrary/exportControl/commerceControlList/index.vue')
const CommerceControlListEvent = () => import('@/views/dataLibrary/components/exportControl/commerceControlListEvent/index.vue') const CommerceControlListEvent = () => import('@/views/dataLibrary/exportControl/commerceControlListEvent/index.vue')
const EntityList = () => import('@/views/dataLibrary/components/exportControl/entityList/index.vue') const EntityList = () => import('@/views/dataLibrary/exportControl/entityList/index.vue')
const EntityListEvent = () => import('@/views/dataLibrary/components/exportControl/entityListEvent/index.vue') const EntityListEvent = () => import('@/views/dataLibrary/exportControl/entityListEvent/index.vue')
const dataDecreeRoutes = [ const dataDecreeRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const MREList = () => import('@/views/dataLibrary/components/financeControl/mREList/index.vue') const MREList = () => import('@/views/dataLibrary/financeControl/mREList/index.vue')
const MREListEvent = () => import('@/views/dataLibrary/components/financeControl/mREListEvent/index.vue') const MREListEvent = () => import('@/views/dataLibrary/financeControl/mREListEvent/index.vue')
const SDNList = () => import('@/views/dataLibrary/components/financeControl/sDNList/index.vue') const SDNList = () => import('@/views/dataLibrary/financeControl/sDNList/index.vue')
const SDNListEvent = () => import('@/views/dataLibrary/components/financeControl/sDNListEvent/index.vue') const SDNListEvent = () => import('@/views/dataLibrary/financeControl/sDNListEvent/index.vue')
const dataDecreeRoutes = [ const dataDecreeRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const KeyLab = () => import('@/views/dataLibrary/components/innovationSubject/keyLab/index.vue') const KeyLab = () => import('@/views/dataLibrary/innovationSubject/keyLab/index.vue')
const ResearchUniversity = () => import('@/views/dataLibrary/components/innovationSubject/researchUniversity/index.vue') const ResearchUniversity = () => import('@/views/dataLibrary/innovationSubject/researchUniversity/index.vue')
const TechnologyCompany = () => import('@/views/dataLibrary/components/innovationSubject/technologyCompany/index.vue') const TechnologyCompany = () => import('@/views/dataLibrary/innovationSubject/technologyCompany/index.vue')
const dataDecreeRoutes = [ const dataDecreeRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const Case337 = () => import('@/views/dataLibrary/components/marketControl/case337/index.vue') const Case337 = () => import('@/views/dataLibrary/marketControl/case337/index.vue')
const Case232 = () => import('@/views/dataLibrary/components/marketControl/case232/index.vue') const Case232 = () => import('@/views/dataLibrary/marketControl/case232/index.vue')
const Case301 = () => import('@/views/dataLibrary/components/marketControl/case301/index.vue') const Case301 = () => import('@/views/dataLibrary/marketControl/case301/index.vue')
const dataDecreeRoutes = [ const dataDecreeRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const CongressMan = () => import('@/views/dataLibrary/components/technologyFigures/congressMan/index.vue') const CongressMan = () => import('@/views/dataLibrary/technologyFigures/congressMan/index.vue')
const Minister = () => import('@/views/dataLibrary/components/technologyFigures/minister/index.vue') const Minister = () => import('@/views/dataLibrary/technologyFigures/minister/index.vue')
const TechnologyLeader = () => import('@/views/dataLibrary/components/technologyFigures/technologyLeader/index.vue') const TechnologyLeader = () => import('@/views/dataLibrary/technologyFigures/technologyLeader/index.vue')
const ThinkTankResearcher = () => import('@/views/dataLibrary/components/technologyFigures/thinkTankResearcher/index.vue') const ThinkTankResearcher = () => import('@/views/dataLibrary/technologyFigures/thinkTankResearcher/index.vue')
const dataDecreeRoutes = [ const dataDecreeRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
// 法案资源库 // 法案资源库
const ThinkTank = () => import('@/views/dataLibrary/components/thinkTank/index.vue') const ThinkTank = () => import('@/views/dataLibrary/thinkTank/index.vue')
const dataThinkTankRoutes = [ const dataThinkTankRoutes = [
// 科技法案资源库路由 // 科技法案资源库路由
......
...@@ -5,31 +5,26 @@ ...@@ -5,31 +5,26 @@
{{ {{
` `
import AiButton from '@/components/base/AiButton/index.vue' import AiButton from '@/components/base/AiButton/index.vue'
<AiButton /> import AiPane from '@/components/base/AiPane/index.vue'
<div class="chart-box">
<div class="btn-box" @mouseenter="handleSwitchAiContentShow(true)">
<AiButton />
</div>
<div class="content-box" v-if="isShowAiContent" @mouseleave="handleSwitchAiContentShow(false)">
<AiPane :aiContent="aiContent" />
</div>
</div>
` `
}} }}
</pre> </pre>
<div class="chart-box"> <div class="chart-box">
<div class="btn-box"> <div class="btn-box" @mouseenter="handleSwitchAiContentShow(true)">
<AiButton /> <AiButton />
</div> </div>
<div class="content-box" v-if="isShowAiContent" @mouseleave="handleSwitchAiContentShow(false)">
</div>
</el-col>
<el-col :span="span">
<pre>
{{
`
import AiPane from '@/components/base/AiPane/index.vue'
<AiPane :aiContent="aiContent" />
`
}}
</pre>
<div class="chart-box">
<div class="content-box">
<AiPane :aiContent="aiContent" /> <AiPane :aiContent="aiContent" />
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -43,7 +38,13 @@ import AiButton from '@/components/base/Ai/AiButton/index.vue' ...@@ -43,7 +38,13 @@ import AiButton from '@/components/base/Ai/AiButton/index.vue'
import AiPane from '@/components/base/Ai/AiPane/index.vue' import AiPane from '@/components/base/Ai/AiPane/index.vue'
const span = 12 const span = 12
const aiContent = ref(`整个立法过程反映了美国政治的高度极化特点。民主党全员反对该法案,批评其"劫贫济富"。而共和党内部也有分歧,特别是在财政赤字问题上。马斯克多次公开批评该法案是"疯狂的支出计划"。`) const handleSwitchAiContentShow = (isShow) => {
isShowAiContent.value = isShow
}
const isShowAiContent = ref(false)
const aiContent = ref(`整个立法过程反映了美国政治的高度极化特点。民主党全员反对该法案,批评其"劫贫济富"。而共和党内部也有分歧,特别是在财政赤字问题上。马斯克多次公开批评该法案是"疯狂的支出计划"。整个立法过程反映了美国政治的高度极化特点。民主党全员反对该法案,批评其"劫贫济富"。而共和党内部也有分歧,特别是在财政赤字问题上。马斯克多次公开批评该法案是"疯狂的支出计划"。`)
</script> </script>
...@@ -60,7 +61,8 @@ const aiContent = ref(`整个立法过程反映了美国政治的高度极化特 ...@@ -60,7 +61,8 @@ const aiContent = ref(`整个立法过程反映了美国政治的高度极化特
right: 0; right: 0;
bottom: 18px; bottom: 18px;
} }
.content-box{
.content-box {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
......
<template>
<el-row class="wrapper layout-grid-line">
<el-col :span="span">
<pre>
{{
`
import AiSummary from '@/components/base/Ai/AiSummary/index.vue'
<div class="summary-box">
<AiSummary />
</div>
`
}}
</pre>
<div class="summary-box">
<AiSummary>
<template #summary-content>
<div class="content-box">
我是插槽内容区域(忽略背景色)
</div>
</template>
</AiSummary>
</div>
</el-col>
</el-row>
</template>
<script setup>
import { ref } from 'vue'
import '@/styles/common.scss'
import AiSummary from '@/components/base/Ai/AiSummary/index.vue'
const span = 24
const aiContent = ref(`整个立法过程反映了美国政治的高度极化特点。民主党全员反对该法案,批评其"劫贫济富"。而共和党内部也有分歧,特别是在财政赤字问题上。马斯克多次公开批评该法案是"疯狂的支出计划"。整个立法过程反映了美国政治的高度极化特点。民主党全员反对该法案,批评其"劫贫济富"。而共和党内部也有分歧,特别是在财政赤字问题上。马斯克多次公开批评该法案是"疯狂的支出计划"。`)
</script>
<style lang="scss" scoped>
.summary-box {
margin-left: 10px;
margin-bottom: 10px;
width: 1019px;
height: 453px;
.content-box{
width: 100%;
height: 100%;
background: var(--color-primary-2);
}
}
</style>
\ No newline at end of file
...@@ -46,6 +46,9 @@ ...@@ -46,6 +46,9 @@
<el-tab-pane label="Ai智能总结" lazy> <el-tab-pane label="Ai智能总结" lazy>
<AiInfo /> <AiInfo />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Ai内容摘要" lazy>
<AiSummary />
</el-tab-pane>
<el-tab-pane label="层级关系图" lazy> <el-tab-pane label="层级关系图" lazy>
<GraphChart /> <GraphChart />
</el-tab-pane> </el-tab-pane>
...@@ -87,6 +90,7 @@ import WordCloudChart from './WordCloudChart/index.vue' ...@@ -87,6 +90,7 @@ import WordCloudChart from './WordCloudChart/index.vue'
import NewsPage from './News/index.vue' import NewsPage from './News/index.vue'
import TimeTabPane from './TimeTabPane/index.vue' import TimeTabPane from './TimeTabPane/index.vue'
import AiInfo from './Ai/AiInfo/index.vue' import AiInfo from './Ai/AiInfo/index.vue'
import AiSummary from './Ai/AiSummary/index.vue'
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<svg viewBox="0 0 16 14" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.000000" height="14.000000" fill="none">
<rect id="降序 1" width="16.000000" height="14.000000" x="0.000000" y="0.000000" />
<path id="矢量 469" d="M5.19867 14C5.1619 14 5.12548 13.9955 5.08942 13.9865C5.05336 13.9776 5.01834 13.9643 4.98437 13.9467C4.9504 13.9291 4.91813 13.9076 4.88755 13.882C4.85698 13.8565 4.82869 13.8275 4.80269 13.795C4.77669 13.7625 4.75348 13.7271 4.73305 13.6889C4.71262 13.6507 4.69537 13.6103 4.6813 13.5679C4.66723 13.5254 4.65661 13.4816 4.64943 13.4366C4.64226 13.3915 4.63867 13.346 4.63867 13.3L4.63867 0.7C4.63867 0.654037 4.64226 0.608516 4.64943 0.563437C4.65661 0.518357 4.66723 0.474586 4.6813 0.432122C4.69537 0.389658 4.71262 0.349317 4.73305 0.311101C4.75348 0.272884 4.77669 0.237526 4.80269 0.205025C4.82869 0.172525 4.85698 0.143507 4.88755 0.117971C4.91813 0.0924358 4.9504 0.0708735 4.98437 0.0532843C5.01834 0.0356952 5.05336 0.0224172 5.08942 0.0134503C5.12548 0.00448343 5.1619 0 5.19867 0C5.23544 0 5.27186 0.00448343 5.30792 0.0134503C5.34399 0.0224172 5.379 0.0356952 5.41297 0.0532843C5.44695 0.0708735 5.47922 0.0924358 5.50979 0.117971C5.54036 0.143507 5.56865 0.172525 5.59465 0.205025C5.62065 0.237526 5.64387 0.272884 5.66429 0.311101C5.68472 0.349317 5.70197 0.389658 5.71604 0.432122C5.73012 0.474586 5.74074 0.518357 5.74791 0.563437C5.75508 0.608516 5.75867 0.654037 5.75867 0.7L5.75867 13.3C5.75867 13.346 5.75508 13.3915 5.74791 13.4366C5.74074 13.4816 5.73012 13.5254 5.71604 13.5679C5.70197 13.6103 5.68472 13.6507 5.66429 13.6889C5.64387 13.7271 5.62065 13.7625 5.59465 13.795C5.56865 13.8275 5.54036 13.8565 5.50979 13.882C5.47922 13.9076 5.44695 13.9291 5.41297 13.9467C5.379 13.9643 5.34399 13.9776 5.30792 13.9865C5.27186 13.9955 5.23544 14 5.19867 14L5.19867 14ZM11.1963 10.297L8.39627 13.797C8.34144 13.8593 8.27984 13.9083 8.21147 13.944C8.1433 13.979 8.07237 13.9965 7.99867 13.9965C7.92498 13.9965 7.85404 13.979 7.78587 13.944C7.71745 13.9085 7.65705 13.858 7.60467 13.7925C7.55228 13.727 7.51188 13.6515 7.48347 13.566C7.4545 13.481 7.43957 13.3924 7.43867 13.3L7.43867 0.7C7.43867 0.654037 7.44226 0.608516 7.44943 0.563437C7.4566 0.518357 7.46723 0.474586 7.4813 0.432122C7.49537 0.389658 7.51262 0.349317 7.53305 0.311101C7.55348 0.272884 7.57669 0.237526 7.60269 0.205025C7.62869 0.172525 7.65698 0.143507 7.68755 0.117971C7.71813 0.0924358 7.7504 0.0708735 7.78437 0.0532843C7.81834 0.0356952 7.85336 0.0224172 7.88942 0.0134503C7.92548 0.00448343 7.9619 0 7.99867 0C8.03544 0 8.07186 0.00448343 8.10792 0.0134503C8.14399 0.0224172 8.179 0.0356952 8.21297 0.0532843C8.24694 0.0708735 8.27922 0.0924358 8.30979 0.117971C8.34036 0.143507 8.36865 0.172525 8.39465 0.205025C8.42065 0.237526 8.44387 0.272884 8.46429 0.311101C8.48472 0.349317 8.50197 0.389658 8.51604 0.432122C8.53012 0.474586 8.54074 0.518357 8.54791 0.563437C8.55509 0.608516 8.55867 0.654037 8.55867 0.7L8.55867 11.613L10.4011 9.303C10.4272 9.27036 10.4556 9.24123 10.4863 9.21559C10.517 9.18995 10.5494 9.1683 10.5835 9.15064C10.6176 9.13298 10.6528 9.11964 10.689 9.11064C10.7252 9.10164 10.7618 9.09713 10.7987 9.09713C10.8356 9.09713 10.8722 9.10164 10.9084 9.11064C10.9446 9.11964 10.9797 9.13298 11.0139 9.15064C11.048 9.1683 11.0804 9.18995 11.1111 9.21559C11.1418 9.24123 11.1702 9.27036 11.1963 9.303C11.2224 9.33563 11.2457 9.37114 11.2662 9.40951C11.2867 9.44788 11.304 9.48839 11.3182 9.53102C11.3323 9.57366 11.343 9.61761 11.3502 9.66288C11.3574 9.70814 11.361 9.75385 11.361 9.8C11.361 9.84615 11.3574 9.89186 11.3502 9.93712C11.343 9.98238 11.3323 10.0263 11.3182 10.069C11.304 10.1116 11.2867 10.1521 11.2662 10.1905C11.2457 10.2289 11.2224 10.2644 11.1963 10.297L11.1963 10.297Z" fill="rgb(95,101,108)" fill-rule="nonzero" />
</svg>
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.000000" height="16.000000" fill="none" customFrame="#000000">
<rect id="Line/Download" width="16.000000" height="16.000000" x="0.000000" y="0.000000" />
<path id="形状" d="M7.90156 10.3281C7.95156 10.3922 8.04844 10.3922 8.09844 10.3281L9.84844 8.11406C9.9125 8.03281 9.85469 7.9125 9.75 7.9125L8.59219 7.9125L8.59219 2.625C8.59219 2.55625 8.53594 2.5 8.46719 2.5L7.52969 2.5C7.46094 2.5 7.40469 2.55625 7.40469 2.625L7.40469 7.91094L6.25 7.91094C6.14531 7.91094 6.0875 8.03125 6.15156 8.1125L7.90156 10.3281ZM12.7812 9.78125L13.7188 9.78125C13.7875 9.78125 13.8438 9.8375 13.8438 9.90625L13.8438 13C13.8438 13.2766 13.6203 13.5 13.3438 13.5L2.65625 13.5C2.37969 13.5 2.15625 13.2766 2.15625 13L2.15625 9.90625C2.15625 9.8375 2.2125 9.78125 2.28125 9.78125L3.21875 9.78125C3.2875 9.78125 3.34375 9.8375 3.34375 9.90625L3.34375 12.3125L12.6562 12.3125L12.6562 9.90625C12.6562 9.8375 12.7125 9.78125 12.7812 9.78125Z" fill="rgb(95,101,108)" fill-rule="evenodd" />
</svg>
<svg viewBox="0 0 12.7275 12.7266" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12.727539" height="12.726562" fill="none" customFrame="#000000">
<path id="合并" d="M5 4L5 0L4 0L4 4L0 4L0 5L4 5L4 9L5 9L5 5L9 5L9 4L5 4Z" fill="rgb(5,95,194)" fill-rule="evenodd" transform="matrix(0.707107,-0.707107,0.707107,0.707107,0,6.36328)" />
</svg>
<template>
<div class="wrapper">
<div class="text">{{ tagName }}</div>
<div class="icon" @click="handleClose">
<img src="./close.svg" alt="">
</div>
</div>
</template>
<script setup>
const props = defineProps({
tagName: {
type: String,
default: ''
}
})
const emit = defineEmits(['close'])
const handleClose = () => {
emit('close')
}
</script>
<style lang="scss" scoped>
.wrapper{
display: flex;
padding: 3px 4px 3px 8px;
align-items: center;
justify-content: flex-start;
gap: 4px;
border-radius: 4px;
border: 1px solid var(--color-primary-35);
background: var(--color-primary-2);
cursor: pointer;
}
</style>
\ No newline at end of file
import * as echarts from "echarts";
const getBarChart = (data) => {
const option = {
tooltip: {},
grid: {
top: '8%',
right: '3%',
bottom: '3%',
left: '3%',
containLabel: true
},
yAxis: {
type: 'value',
splitLine: {
show: true,
lineStyle: {
color: ['#DEE2E7'], // 线条颜色,可以是数组,用于不同间隔交替颜色
width: 1, // 线宽
type: 'dashed', // 类型:'solid'(实线), 'dashed'(虚线), 'dotted'(点线)
// opacity: 0.6 // 透明度
}
},
axisLine: {
show: false,
lineStyle: {
color: 'rgba(95, 101, 108, 1)',
}
},
show: true,
textStyle: {
color: 'rgba(95, 101, 108, 1)',
fontFamily: 'Microsoft YaHei',
fontsize: 14,
}
},
xAxis: {
type: 'category',
data: data.dataX,
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#e7f3ff',
}
},
axisLabel: {
show: true,
textStyle: {
color: 'rgba(95, 101, 108, 1)',
fontFamily: 'Microsoft YaHei',
fontsize: 14,
}
}
},
series: [{
type: 'bar',
data: data.dataY,
label: {
show: true,
position: 'top',
color: 'rgb(59, 65, 75)',
fontWeight: 'regular', // 文字加粗
fontSize: 16,
fontFamily: 'Source Han Sans CN',
formatter: function (params) {
return params.value
},
},
barWidth: 20,
itemStyle: {
color: function (params) {
return new echarts.graphic.LinearGradient(0, 1, 0, 0,
[{
offset: 0,
color: 'rgba(10, 87, 166, 0)'
},
{
offset: 1,
color: 'rgba(5, 95, 194, 1)'
}
]);
},
// barBorderRadius: 10,
}
}]
}
return option
}
export default getBarChart
\ No newline at end of file
<template>
<div class="bar-chart-wrapper" id="bar-chart"></div>
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import setChart from '@/utils/setChart';
import getBarChart from './barchart';
const props = defineProps({
barChartData: {
type: Array,
default: [
]
}
})
onMounted(() => {
const barChart = getBarChart(props.barChartData)
setChart(barChart, 'bar-chart', )
})
</script>
<style lang="scss">
.bar-chart-wrapper {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="chart-wrapper"> <div class="chart-wrapper">
<div class="header"> <div class="header">
<div class="header-left"> <div class="header-left">
<div class="chart-item" v-for="item, index in chartItemList" :key="index"> <div class="chart-item" v-for="item, index in chartItemList" :key="index" @click="handleClickChartItem(item)">
<img v-if="!item.active" :src="item.icon" alt=""> <img v-if="!item.active" :src="item.icon" alt="">
<img v-else :src="item.activeIcon" alt=""> <img v-else :src="item.activeIcon" alt="">
</div> </div>
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
</div> </div>
</div> </div>
<div class="main"> <div class="main">
<div class="chart-box" id="chart-box"></div> <div class="chart-box">
<slot name="chart-box"></slot>
</div>
<div class="tip-box"></div> <div class="tip-box"></div>
</div> </div>
</div> </div>
...@@ -56,6 +58,16 @@ const chartItemList = ref([ ...@@ -56,6 +58,16 @@ const chartItemList = ref([
}, },
]) ])
const emit = defineEmits('clickChartItem')
const handleClickChartItem = (item) => {
chartItemList.value.forEach(chart => {
chart.active = false
})
item.active = true
emit('clickChartItem', item)
}
const props = defineProps({ const props = defineProps({
chartTitle: { chartTitle: {
type: String, type: String,
...@@ -92,9 +104,11 @@ const props = defineProps({ ...@@ -92,9 +104,11 @@ const props = defineProps({
height: 32px; height: 32px;
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
&:hover{
&:hover {
background: var(--color-primary-2); background: var(--color-primary-2);
} }
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -108,13 +122,14 @@ const props = defineProps({ ...@@ -108,13 +122,14 @@ const props = defineProps({
height: 24px; height: 24px;
text-align: center; text-align: center;
left: 200px; left: 200px;
height: 12px; top: 12px;
color: var(--text-primary-80-color); color: var(--text-primary-80-color);
} }
.header-right { .header-right {
width: 32px; width: 32px;
height: 32px; height: 32px;
cursor: pointer;
img { img {
width: 100%; width: 100%;
...@@ -122,5 +137,16 @@ const props = defineProps({ ...@@ -122,5 +137,16 @@ const props = defineProps({
} }
} }
} }
.main {
.chart-box {
width: 1520px;
height: 580px;
}
.tip-box {
height: 54px;
}
}
} }
</style> </style>
\ No newline at end of file
<template>
<div class="wrapper">
<div class="left">
<div class="left-text text-tip-1">{{ '统计维度:' }}</div>
<div class="left-list">
<ActionButton
v-for="item, index in list"
:key="index"
:name="item.name"
:type="item.active ? 'active' : 'normal'"
@click="handleClickItem(item)"
/>
</div>
</div>
<div class="right">
<slot name="chart-header-right"></slot>
</div>
</div>
</template>
<script setup>
import ActionButton from '@/components/base/ActionButton/index.vue'
const props = defineProps({
list: {
type: Array,
default: [
{
name: '时间',
active: true
},
{
name: '领域',
active: false
},
{
name: '党派',
active: false
},
]
}
})
const emit = defineEmits(['clickItem'])
const handleClickItem = (item) => {
emit('clickItem', item)
}
</script>
<style lang="scss" scoped>
.wrapper {
width: 1520px;
height: 28px;
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
gap: 8px;
align-items: center;
justify-content: flex-start;
.left-text {
color: var(--text-primary-80-color);
}
.left-list {
display: flex;
gap: 8px;
align-items: center;
justify-content: flex-start;
}
}
}
</style>
\ No newline at end of file
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.000000" height="16.000000" fill="none" customFrame="#000000">
<rect id="Line/Up" width="16.000000" height="16.000000" x="0.000000" y="0.000000" transform="matrix(1,0,0,-1,0,16)" />
<path id="路径" d="M11.852 7.80156L6.34264 0.20625C6.14264 -0.06875 5.73327 -0.06875 5.53483 0.20625L0.0238932 7.80156C-0.0354818 7.88438 0.0223307 8 0.125456 8L1.29733 8C1.37702 8 1.45202 7.96094 1.49889 7.89687L5.93796 1.77813L10.377 7.89687C10.4239 7.96094 10.4989 8 10.5786 8L11.7505 8C11.852 8 11.9114 7.88438 11.852 7.80156L11.852 7.80156Z" fill="rgb(5,95,194)" fill-rule="evenodd" transform="matrix(1,0,0,-1,2.0625,12)" />
</svg>
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.000000" height="16.000000" fill="none" customFrame="#000000">
<rect id="Line/Up" width="16.000000" height="16.000000" x="0.000000" y="0.000000" />
<path id="路径" d="M13.9145 11.8016L8.40514 4.20625C8.20514 3.93125 7.79577 3.93125 7.59733 4.20625L2.08639 11.8016C2.02702 11.8844 2.08483 12 2.18796 12L3.35983 12C3.43952 12 3.51452 11.9609 3.56139 11.8969L8.00046 5.77812L12.4395 11.8969C12.4864 11.9609 12.5614 12 12.6411 12L13.813 12C13.9145 12 13.9739 11.8844 13.9145 11.8016L13.9145 11.8016Z" fill="rgb(5,95,194)" fill-rule="evenodd" />
</svg>
<template>
<div class="wrapper">
<div class="show" @click="handleSwitchShowAll">
<div class="text text-compact">{{ isShowAll ? '收起' : '展开全部' }}</div>
<div class="icon">
<img v-if="isShowAll" src="./arrow-up.svg" alt="">
<img v-else src="./arrow-down.svg" alt="">
</div>
</div>
<div class="clear text-tip-1" @click="handleClear">
{{ '清空条件' }}
</div>
<div class="confirm text-tip-1" @click="handleConfirm">
{{ '确定' }}
</div>
</div>
</template>
<script setup>
import {ref} from 'vue'
const isShowAll = ref(false)
const handleSwitchShowAll = () => {
isShowAll.value = !isShowAll.value
}
const emit = defineEmits(['clear', 'confirm'])
const handleClear = () => {
emit('clear')
}
const handleConfirm = () => {
emit('confirm')
}
</script>
<style lang="scss" scoped>
.wrapper {
height: 36px;
display: flex;
gap: 12px;
justify-content: flex-end;
align-items: center;
.show {
display: flex;
justify-content: center;
align-items: center;
gap: 4px;
cursor: pointer;
.text {
color: var(--color-primary-100);
}
.icon {
width: 16px;
height: 16px;
img {
width: 100%;
height: 100%;
}
}
}
.clear {
width: 98px;
height: 36px;
border-radius: 4px;
box-sizing: border-box;
border: 1px solid var(--bg-black-10);
text-align: center;
padding: 6px 16px;
color: var(--text-primary-65-color);
cursor: pointer;
}
.confirm {
width: 150px;
height: 36px;
border-radius: 4px;
box-sizing: border-box;
padding: 6px 59px;
background: var(--color-primary-100);
color: var(--bg-white-100);
text-align: center;
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template>
<div class="line-chart-wrapper" id="line-chart"></div>
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import setChart from '@/utils/setChart';
import getLineChart from './lineChart';
const props = defineProps({
lineChartData: {
type: Object,
default: {
dataX: [],
dataY: []
}
}
})
onMounted(() => {
const lineChart = getLineChart(props.lineChartData.dataX, props.lineChartData.dataY)
setChart(lineChart, 'line-chart', )
})
</script>
<style lang="scss">
.line-chart-wrapper {
width: 100%;
height: 100%;
// width: 1520px;
// height: 580px;
}
</style>
\ No newline at end of file
import * as echarts from 'echarts'
const getLineChart = (dataX, dataY) => {
return {
grid: {
left: 24,
top: 48,
right: 34,
bottom: 10,
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
splitLine: {
show: false
},
axisLine: {
show: false
},
data: dataX
},
yAxis: {
type: 'value',
splitLine: {
show: true,
lineStyle: {
color: ['#DEE2E7'], // 线条颜色,可以是数组,用于不同间隔交替颜色
width: 1, // 线宽
type: 'dashed', // 类型:'solid'(实线), 'dashed'(虚线), 'dotted'(点线)
// opacity: 0.6 // 透明度
}
},
axisLine: {
show: false
},
},
series: [
{
data: dataY,
type: 'line',
// showSymbol: false,
symbol: 'circle', // 圆形
symbolSize: 8, // 大小为8px
itemStyle: {
// color: 'rgba(5, 95, 194, 1)', // 填充为珊瑚红
color: '#fff',
borderColor: 'rgba(5, 95, 194, 1)',
borderWidth: 4,
// 不设置borderColor和borderWidth,即为纯实心
},
lineStyle: {
color: 'rgba(5, 95, 194, 1)'
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(5, 95, 194, 0.8)' // 起始颜色:深色
}, {
offset: 1,
color: 'rgba(5, 95, 194, 0)' // 结束颜色:浅色且透明度降低
}])
},
}
]
}
}
export default getLineChart;
\ No newline at end of file
<template>
<div class="pie-chart-wrapper" id="pie-chart"></div>
</template>
<script setup>
import { ref, onMounted, nextTick } from 'vue'
import setChart from '@/utils/setChart';
import getPieChart from './piechart';
const props = defineProps({
pieChartData: {
type: Array,
default: [
// {
// name: 'aaa',
// value: 12
// },
// {
// name: 'bbb',
// value: 8
// },
// {
// name: 'ccc',
// value: 15
// },
]
}
})
onMounted(() => {
const pieChart = getPieChart(props.pieChartData)
setChart(pieChart, 'pie-chart', )
})
</script>
<style lang="scss">
.pie-chart-wrapper {
width: 100%;
height: 100%;
// width: 1520px;
// height: 580px;
}
</style>
\ No newline at end of file
import { MUTICHARTCOLORS } from "@/common/constant";
const getPieChart = (data) => {
const colorList = MUTICHARTCOLORS
let option = {
color: colorList,
series: [
{
type: 'pie',
radius: [150, 175],
height: '100%',
left: 'center',
width: '98%',
itemStyle: {
borderColor: '#fff',
borderWidth: 1
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{time|{c} 条 {d}%}',
minMargin: 5,
edgeDistance: 10,
lineHeight: 25,
rich: {
name: {
color: 'rgba(59, 65, 75, 1)',
fontFamily: 'Microsoft YaHei',
fontSize: 16,
fontWeight: 'bold',
},
time: {
fontSize: 16,
fontFamily: 'Microsoft YaHei',
color: '#rgba(95, 101, 108, 1)'
}
}
},
labelLine: {
length: 15,
length2: 0,
maxSurfaceAngle: 80
},
labelLayout: function (params) {
const isLeft = params.labelRect.x < 556 / 2;
const points = params.labelLinePoints;
// Update the end point.
points[2][0] = isLeft
? params.labelRect.x
: params.labelRect.x + params.labelRect.width;
return {
labelLinePoints: points
};
},
data: data
}]
}
return option
}
export default getPieChart;
\ No newline at end of file
<template>
<div class="countrybill-wrapper">
<div class="header-box">我是国会法案</div>
<div class="main-box">
<div class="info-box">
<div class="switch-box" @click="handleSwitchChartData">
<img v-if="!isShowChart" src="@/views/dataLibrary/assets/icons/chart-active.svg" alt="">
<img v-else src="@/views/dataLibrary/assets/icons/data-active.svg" alt="">
</div>
<div class="num-box text-title-3-bold">
{{ `共 ${totalNum} 条数据` }}
</div>
</div>
<div class="content-box">
<ChartBox chartTitle="美国会法案提出数量随时间变化趋势" />
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import ChartBox from '../../chartBox/index.vue'
// 图表/数据
const isShowChart = ref(true)
const handleSwitchChartData = () => {
isShowChart.value = !isShowChart.value
}
// 总计数据
const totalNum = ref(12)
</script>
<style lang="scss" scoped>
.countrybill-wrapper {
width: 1600px;
height: 968px;
.headere-box {
width: 1568px;
height: 112px;
border-radius: 10px;
background: rgb(255, 255, 255);
border: 1px solid var(--bg-black-5);
margin: 16px auto;
}
.header-box {
width: 1568px;
height: 112px;
border-radius: 10px;
background: rgb(255, 255, 255);
border: 1px solid var(--bg-black-5);
margin: 16px auto;
}
.main-box {
.info-box {
margin: 0 auto;
width: 1568px;
height: 30px;
display: flex;
justify-content: space-between;
.switch-box {
width: 160px;
border-radius: 20px;
border: 1px solid var(--color-primary-100);
height: 30px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.num-box {
color: var(--color-red-100);
}
}
.content-box {
margin: 0 auto;
margin-top: 16px;
width: 1568px;
height: 766px;
border-radius: 10px;
background: rgba(255, 255, 255);
border: 1px solid var(--bg-black-5);
}
}
}
</style>
\ No newline at end of file
...@@ -316,13 +316,25 @@ const siderList = ref([ ...@@ -316,13 +316,25 @@ const siderList = ref([
const handleSiderItem = (item) => { const handleSiderItem = (item) => {
siderList.value.forEach(val => { siderList.value.forEach(val => {
val.active = false val.active = false
val.isExpanded = false
if(val.children && val.children.length) {
val.children.forEach(vall => {
vall.active = false
})
}
}) })
item.isExpanded = true
item.active = true item.active = true
item.isExpanded = !item.isExpanded
if (item.path) { if (item.path) {
router.push({ router.push({
path: item.path path: item.path
}) })
} else {
item.children[0].active = true
router.push({
path: item.children[0].path
})
} }
} }
...@@ -360,6 +372,7 @@ const handleClickTab = (tab) => { ...@@ -360,6 +372,7 @@ const handleClickTab = (tab) => {
) )
siderList.value.forEach(val => { siderList.value.forEach(val => {
val.active = false val.active = false
val.isExpanded = false
if (val.children && val.children.length) { if (val.children && val.children.length) {
val.children.forEach(vall => { val.children.forEach(vall => {
vall.active = false vall.active = false
...@@ -374,10 +387,12 @@ const handleClickTab = (tab) => { ...@@ -374,10 +387,12 @@ const handleClickTab = (tab) => {
return return
} }
} else { } else {
val.children.forEach(vall => { val.children.forEach(vall => {
if (vall.name === tab.meta.title) { if (vall.name === tab.meta.title) {
vall.active = true vall.active = true
val.active = true val.active = true
val.isExpanded = true
return return
} }
}) })
...@@ -480,6 +495,7 @@ const handleClickToolBox = () => { ...@@ -480,6 +495,7 @@ const handleClickToolBox = () => {
.data-library-wrapper { .data-library-wrapper {
width: 1920px; width: 1920px;
height: 1080px; height: 1080px;
overflow: hidden;
// background: orange; // background: orange;
.data-library-header { .data-library-header {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论