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

feat:更新数据资源库

上级 152adc61
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="icon"> <div class="icon">
<img :src="item.icon" alt="" /> <img :src="item.icon" alt="" />
</div> </div>
<div class="title">{{ item.title }}</div> <div class="title" :class="{ 'active-title': item.active }">{{ item.title }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -157,57 +157,68 @@ const menuList = ref([ ...@@ -157,57 +157,68 @@ const menuList = ref([
{ {
title: "科技法案", title: "科技法案",
icon: Menu2, icon: Menu2,
path: "/billHome" path: "/billHome",
active: false
}, },
{ {
title: "科技政令", title: "科技政令",
icon: Menu3, icon: Menu3,
path: "/decree" path: "/decree",
active: false
}, },
{ {
title: "美国科技智库", title: "美国科技智库",
icon: Menu4, icon: Menu4,
path: "/thinkTank" path: "/thinkTank",
active: false
}, },
{ {
title: "出口管制", title: "出口管制",
icon: Menu5, icon: Menu5,
path: "/exportControl" path: "/exportControl",
active: false
}, },
{ {
title: "科研合作限制", title: "科研合作限制",
icon: Menu6, icon: Menu6,
path: "/cooperationRestrictions" path: "/cooperationRestrictions",
active: false
}, },
{ {
title: "投融资限制", title: "投融资限制",
icon: Menu7, icon: Menu7,
path: "/finance" path: "/finance",
active: false
}, },
{ {
title: "市场准入限制", title: "市场准入限制",
icon: Menu8, icon: Menu8,
path: "/marketAccessRestrictions" path: "/marketAccessRestrictions",
active: false
}, },
{ {
title: "规则限制", title: "规则限制",
icon: Menu9, icon: Menu9,
path: "/ruleRestrictions" path: "/ruleRestrictions",
active: false
}, },
{ {
title: "美国科技人物观点", title: "美国科技人物观点",
icon: Menu10, icon: Menu10,
path: "/technologyFigures" path: "/technologyFigures",
active: false
}, },
{ {
title: "美国主要创新主体动向", title: "美国主要创新主体动向",
icon: Menu11, icon: Menu11,
path: "/innovationSubject" path: "/innovationSubject",
active: false
}, },
{ {
title: "美国科研资助体系", title: "美国科研资助体系",
icon: Menu12, icon: Menu12,
path: "/scientificFunding" path: "/scientificFunding",
active: false
} }
]); ]);
...@@ -235,6 +246,7 @@ const handleToModule = (item, index) => { ...@@ -235,6 +246,7 @@ const handleToModule = (item, index) => {
window.sessionStorage.setItem('homeActiveTitleIndex', index) window.sessionStorage.setItem('homeActiveTitleIndex', index)
if (index === 1) { if (index === 1) {
homeActiveTitleIndex.value = index homeActiveTitleIndex.value = index
item.active = true
router.push({ router.push({
path: item.path path: item.path
}) })
...@@ -253,7 +265,7 @@ const handleToModule = (item, index) => { ...@@ -253,7 +265,7 @@ const handleToModule = (item, index) => {
}; };
const handleClickTitle = (item, index) => { const handleClickTitle = (item, index) => {
if (index === 0 || index === 3) { if (index === 0 || index === 3) {
window.sessionStorage.setItem('homeActiveTitleIndex', index) window.sessionStorage.setItem('homeActiveTitleIndex', index)
homeActiveTitleIndex.value = index homeActiveTitleIndex.value = index
...@@ -497,6 +509,11 @@ onUnmounted(() => { ...@@ -497,6 +509,11 @@ onUnmounted(() => {
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
} }
.active-title {
color: var(--color-main-active) !important;
font-size: 20px !important;
}
} }
} }
} }
...@@ -528,6 +545,8 @@ onUnmounted(() => { ...@@ -528,6 +545,8 @@ onUnmounted(() => {
display: flex; display: flex;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
.title { .title {
color: var(--color-main-active); color: var(--color-main-active);
...@@ -557,6 +576,11 @@ onUnmounted(() => { ...@@ -557,6 +576,11 @@ onUnmounted(() => {
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
} }
.active-title {
color: var(--color-main-active) !important;
font-size: 20px !important;
}
} }
} }
} }
......
const getQuarterRange = (quatarNum) => {
const quarters = {
1: ['2025-01-01', '2025-03-31'],
2: ['2025-04-01', '2025-06-30'],
3: ['2025-07-01', '2025-09-30'],
4: ['2025-10-01', '2025-12-31']
};
return quarters[quatarNum];
}
export default getQuarterRange
\ No newline at end of file
// 绘制echarts图表 // 绘制echarts图表
import getMonthRange from './getMonthRange' import getMonthRange from './getMonthRange'
import getQuarterRange from './getQuarterRange';
import * as echarts from 'echarts' import * as echarts from 'echarts'
import 'echarts-wordcloud'; import 'echarts-wordcloud';
import router from '@/router/index' import router from '@/router/index'
...@@ -77,6 +78,26 @@ const setChart = (option, chartId, allowClick, selectParam) => { ...@@ -77,6 +78,26 @@ const setChart = (option, chartId, allowClick, selectParam) => {
} }
} }
break
case '政令':
if (params.componentType === 'series' && params.seriesType === 'pie') {
selectParam.domains = params.name
const route = router.resolve({
path: "/dataLibrary/dataDecree",
query: selectParam
});
window.open(route.href, "_blank");
} else if (params.componentType === 'series' && params.seriesType === 'bar') {
const quatarNum = Number(params.name[params.name.length - 1])
selectParam.selectedDate = JSON.stringify(getQuarterRange(quatarNum))
const route = router.resolve({
path: "/dataLibrary/dataDecree",
query: selectParam
});
window.open(route.href, "_blank");
}
} }
......
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, watch, onMounted, nextTick } from 'vue' import { ref, computed, watch, onMounted, nextTick, onBeforeUnmount } from 'vue'
import ChartContainer from '../../components/ChartContainer/index.vue' import ChartContainer from '../../components/ChartContainer/index.vue'
import ChartHeader from '../../components/ChartHeader/index.vue' import ChartHeader from '../../components/ChartHeader/index.vue'
import ActiveTag from '../../components/ActiveTag/index.vue' import ActiveTag from '../../components/ActiveTag/index.vue'
...@@ -171,6 +171,10 @@ import getDateRange from '@/utils/getDateRange' ...@@ -171,6 +171,10 @@ import getDateRange from '@/utils/getDateRange'
const route = useRoute(); const route = useRoute();
const timer1 = ref(null)
const timer2 = ref(null)
const timer3 = ref(null)
// 图表/数据 // 图表/数据
const isShowChart = ref(false) const isShowChart = ref(false)
// 点击切换数据/图表 // 点击切换数据/图表
...@@ -180,7 +184,7 @@ const handleSwitchChartData = () => { ...@@ -180,7 +184,7 @@ const handleSwitchChartData = () => {
const curDemensionItem = staticsDemensionList.value.filter(item => { const curDemensionItem = staticsDemensionList.value.filter(item => {
return item.name === curDemension.value return item.name === curDemension.value
})[0] })[0]
setTimeout(() => { timer1.value = setTimeout(() => {
activeChart.value = curDemensionItem.chartTypeList[0] activeChart.value = curDemensionItem.chartTypeList[0]
curChartData.value = curDemensionItem.data curChartData.value = curDemensionItem.data
}) })
...@@ -267,7 +271,7 @@ const handleClickDemensionItem = (val) => { ...@@ -267,7 +271,7 @@ const handleClickDemensionItem = (val) => {
}) })
val.active = true val.active = true
curDemension.value = val.name curDemension.value = val.name
setTimeout(() => { timer2.value = setTimeout(() => {
activeChart.value = val.chartTypeList[0] activeChart.value = val.chartTypeList[0]
curChartData.value = val.data curChartData.value = val.data
}) })
...@@ -702,8 +706,8 @@ const statusList = ref([ ...@@ -702,8 +706,8 @@ const statusList = ref([
id: '参议院通过' id: '参议院通过'
}, },
{ {
name: '双院通过', name: '分歧已解决',
id: '双院通过' id: '分歧已解决'
}, },
]) ])
...@@ -778,8 +782,8 @@ const selectedCount = computed(() => selectedMap.value.size) ...@@ -778,8 +782,8 @@ const selectedCount = computed(() => selectedMap.value.size)
// 获取表格数据(示例) // 获取表格数据(示例)
const fetchTableData = async () => { const fetchTableData = async () => {
isSelectedAll.value = false // isSelectedAll.value = false
selectedMap.value.clear() // selectedMap.value.clear()
// 调用接口获取数据... // 调用接口获取数据...
const params = { const params = {
page: currentPage.value, page: currentPage.value,
...@@ -793,8 +797,8 @@ const fetchTableData = async () => { ...@@ -793,8 +797,8 @@ const fetchTableData = async () => {
originChamber: selectedCongress.value === '全部议院' ? null : selectedCongress.value, originChamber: selectedCongress.value === '全部议院' ? null : selectedCongress.value,
originDepart: selectedOrg.value === '全部委员会' ? null : selectedOrg.value, originDepart: selectedOrg.value === '全部委员会' ? null : selectedOrg.value,
sponsorPersonName: selectedmember.value === '全部议员' ? null : selectedmember.value, sponsorPersonName: selectedmember.value === '全部议员' ? null : selectedmember.value,
status: selectedStatus.value === '通过' ? 1 : 0, status: selectedStatus.value === '全部阶段' ? null : selectedStatus.value,
isInvolveCn: isInvolveCn ? 'Y' : 'N', isInvolveCn: isInvolveCn.value ? 'Y' : 'N',
sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序 sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序
} }
try { try {
...@@ -836,7 +840,7 @@ const fetchTableData = async () => { ...@@ -836,7 +840,7 @@ const fetchTableData = async () => {
return item.name === curDemension.value return item.name === curDemension.value
})[0] })[0]
setTimeout(() => { timer3.value = setTimeout(() => {
activeChart.value = curDemensionItem.chartTypeList[0] activeChart.value = curDemensionItem.chartTypeList[0]
curChartData.value = curDemensionItem.data curChartData.value = curDemensionItem.data
}) })
...@@ -877,7 +881,7 @@ const fetchAllData = async () => { ...@@ -877,7 +881,7 @@ const fetchAllData = async () => {
originDepart: selectedOrg.value === '全部委员会' ? null : selectedOrg.value, originDepart: selectedOrg.value === '全部委员会' ? null : selectedOrg.value,
sponsorPersonName: selectedmember.value === '全部议员' ? null : selectedmember.value, sponsorPersonName: selectedmember.value === '全部议员' ? null : selectedmember.value,
status: selectedStatus.value === '通过' ? 1 : 0, status: selectedStatus.value === '通过' ? 1 : 0,
isInvolveCn: isInvolveCn ? 'Y' : 'N', isInvolveCn: isInvolveCn.value ? 'Y' : 'N',
sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序 sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序
} }
try { try {
...@@ -1116,14 +1120,21 @@ const handleExport = () => { ...@@ -1116,14 +1120,21 @@ const handleExport = () => {
onMounted(async () => { onMounted(async () => {
handleGetOrgList() handleGetOrgList()
handleGetMemberList() handleGetMemberList()
initParam() initParam()
// 初始化 // 初始化
await fetchTableData() await fetchTableData()
})
onBeforeUnmount(() => {
if (timer1.value) {
clearTimeout(timer1.value)
}
if (timer2.value) {
clearTimeout(timer2.value)
}
if (timer3.value) {
clearTimeout(timer3.value)
}
}) })
</script> </script>
...@@ -1239,10 +1250,11 @@ onMounted(async () => { ...@@ -1239,10 +1250,11 @@ onMounted(async () => {
.data-main-box { .data-main-box {
width: 1568px; width: 1568px;
height: 810px; min-height: 810px;
border-radius: 10px; border-radius: 10px;
background: var(--bg-white-100); background: var(--bg-white-100);
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px;
overflow: hidden; overflow: hidden;
.data-main-box-header { .data-main-box-header {
...@@ -1274,8 +1286,7 @@ onMounted(async () => { ...@@ -1274,8 +1286,7 @@ onMounted(async () => {
.data-main-box-main { .data-main-box-main {
width: 1520px; width: 1520px;
// height: 633px; min-height: 680px;
height: 680px;
border-radius: 10px; border-radius: 10px;
border: 1px solid var(--bg-black-5); border: 1px solid var(--bg-black-5);
margin: 0 auto; margin: 0 auto;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<slot name="chart-box"></slot> <slot name="chart-box"></slot>
</div> </div>
<div class="tip-box"> <div class="tip-box">
<TipTab /> <TipTab text="数据来源:美国国会官网" />
</div> </div>
</div> </div>
</div> </div>
...@@ -176,8 +176,7 @@ const chartItemList = computed(() => { ...@@ -176,8 +176,7 @@ const chartItemList = computed(() => {
.tip-box { .tip-box {
height: 54px; height: 54px;
box-sizing: border-box; box-sizing: border-box;
padding-top: 10px; padding: 15px 600px;
// background: orange;
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="select-wrapper" :class="{ 'select-wrapper-custom': selectValue === '自定义' }"> <div class="select-wrapper" :class="{ 'select-wrapper-custom': selectValue === '自定义' }">
<div class="select-left text-tip-1">{{ selectTitle + ':' }}</div> <div class="select-left text-tip-1">{{ selectTitle + ':' }}</div>
<div class="select-right" :class="{ 'select-right-custom': selectValue === '自定义' }"> <div class="select-right" :class="{ 'select-right-custom': selectValue === '自定义' }">
<el-select v-model="selectValue" :placeholder="placeholderName" style="width: 240px"> <el-select v-model="selectValue" :placeholder="placeholderName" filterable style="width: 240px">
<!-- <el-option label="全部领域" value="全部领域" /> --> <!-- <el-option label="全部领域" value="全部领域" /> -->
<el-option v-for="item in selectList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in selectList" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</template> </template>
<script setup> <script setup>
import { computed, onMounted, ref } from 'vue' import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
import Icon1 from './assets/icons/sider-icon1.svg' import Icon1 from './assets/icons/sider-icon1.svg'
import Icon2 from './assets/icons/sider-icon2.svg' import Icon2 from './assets/icons/sider-icon2.svg'
import Icon3 from './assets/icons/sider-icon3.svg' import Icon3 from './assets/icons/sider-icon3.svg'
...@@ -398,6 +398,8 @@ const handleClickTab = (tab) => { ...@@ -398,6 +398,8 @@ const handleClickTab = (tab) => {
}) })
} }
const timer = ref(null)
// 关闭当前标签页 // 关闭当前标签页
const handleCloseCurTab = (tab, index) => { const handleCloseCurTab = (tab, index) => {
...@@ -416,7 +418,7 @@ const handleCloseCurTab = (tab, index) => { ...@@ -416,7 +418,7 @@ const handleCloseCurTab = (tab, index) => {
}) })
if (index === openedTabList.value.length - 1) { if (index === openedTabList.value.length - 1) {
tagsViewStore.delView(tab) tagsViewStore.delView(tab)
setTimeout(() => { timer.value = setTimeout(() => {
tagsViewStore.visitedViews[tagsViewStore.visitedViews.length - 1].active = true tagsViewStore.visitedViews[tagsViewStore.visitedViews.length - 1].active = true
activeTab = tagsViewStore.visitedViews[tagsViewStore.visitedViews.length - 1] activeTab = tagsViewStore.visitedViews[tagsViewStore.visitedViews.length - 1]
router.push({ router.push({
...@@ -593,6 +595,11 @@ onMounted(() => { ...@@ -593,6 +595,11 @@ onMounted(() => {
}) })
onBeforeUnmount(() => {
if(timer.value) {
clearTimeout(timer.value)
}
})
</script> </script>
......
...@@ -896,7 +896,25 @@ const handleBox5 = async () => { ...@@ -896,7 +896,25 @@ const handleBox5 = async () => {
let chart1 = getBarChart(chart1Data.value.dataX, chart1Data.value.dataY); let chart1 = getBarChart(chart1Data.value.dataX, chart1Data.value.dataY);
chart1.yAxis.name = "数量"; chart1.yAxis.name = "数量";
chart1.yAxis.nameTextStyle = { align: 'right' } chart1.yAxis.nameTextStyle = { align: 'right' }
setChart(chart1, "chart1"); let org = '全部机构'
if(box5Params.proposeName) {
org = keyOrganizationList.value.filter(item => {
return item.orgId === box5Params.proposeName
})[0].orgName
}
let domain = '全部领域'
if(box5Params.domainId) {
domain = areaList.value.filter(item => {
return item.id === box5Params.domainId
})[0].name
}
const selectParam = {
moduleType: '政令',
orgnizationName: org,
domains: domain,
selectDate: box5Params.year
}
setChart(chart1, "chart1", true, selectParam);
}; };
// 政令科技领域 // 政令科技领域
...@@ -943,8 +961,19 @@ const handleGetDecreeArea = async () => { ...@@ -943,8 +961,19 @@ const handleGetDecreeArea = async () => {
}; };
const handleBox6 = async () => { const handleBox6 = async () => {
await handleGetDecreeArea(); await handleGetDecreeArea();
let org = '全部机构'
if(box6Params.proposeName) {
org = keyOrganizationList.value.filter(item => {
return item.orgId === box6Params.proposeName
})[0].orgName
}
const selectParam = {
moduleType: '政令',
orgnizationName: org,
selectedDate: JSON.stringify([box6Params.year+'-01-01', box6Params.year+'-12-31'])
}
let chart2 = getPieChart(chart2Data.value); let chart2 = getPieChart(chart2Data.value);
setChart(chart2, "chart2"); setChart(chart2, "chart2", true, selectParam);
}; };
const handleBox6YearChange = () => { const handleBox6YearChange = () => {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<router-view /> <router-view />
</div> </div>
</div> </div>
<div class="right-btn" @click="handleClickToolBox"> <div class="right-btn" v-if="isShowToolBox" @click="handleClickToolBox">
<div class="item"> <div class="item">
<div class="icon"> <div class="icon">
<img src="@/assets/icons/overview/domain.png" alt="" /> <img src="@/assets/icons/overview/domain.png" alt="" />
...@@ -22,20 +22,7 @@ ...@@ -22,20 +22,7 @@
</div> </div>
</div> </div>
<div class="tool-box"> <div class="tool-box" v-if="isShowToolBox">
<!-- <div class="tool-item">
<img src="@/assets/icons/tool-item-icon1.png" alt="" />
</div>
<div class="tool-item">
<img src="@/assets/icons/tool-item-icon2.png" alt="" />
</div>
<div class="tool-item">
<img src="@/assets/icons/tool-item-icon3.png" alt="" />
</div>
<div class="tool-item">
<img src="@/assets/icons/tool-item-icon4.png" alt="" />
</div> -->
<el-tooltip content="智能写报" placement="left" :offset="10"> <el-tooltip content="智能写报" placement="left" :offset="10">
<div class="tool-item" @click="handleOpenPage('znxb')"> <div class="tool-item" @click="handleOpenPage('znxb')">
<img src="@/assets/icons/tool-item-icon1.png" alt="" /> <img src="@/assets/icons/tool-item-icon1.png" alt="" />
...@@ -96,6 +83,11 @@ import { ElMessage } from "element-plus"; ...@@ -96,6 +83,11 @@ import { ElMessage } from "element-plus";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const isShowToolBox = computed(() => {
const isShow = route.fullPath.includes('dataLibrary') ? false : true
return isShow
})
const isShowHeader = computed(() => { const isShowHeader = computed(() => {
const isShow = route.meta.isShowHeader const isShow = route.meta.isShowHeader
return isShow? true : false return isShow? true : false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论