提交 05beb3ae authored 作者: coderBryanFu's avatar coderBryanFu

feat:更新数据资源库

上级 f835b3ed
...@@ -15,22 +15,29 @@ const setChart = (option, chartId, allowClick, selectParam) => { ...@@ -15,22 +15,29 @@ const setChart = (option, chartId, allowClick, selectParam) => {
chart.on('click', function (params) { chart.on('click', function (params) {
switch (selectParam.moduleType) { switch (selectParam.moduleType) {
case '国会法案': case '国会法案':
if(selectParam.selectedDate && selectParam.length === 4) {
selectParam.selectedDate = JSON.stringify([selectParam.selectedDate+'-01-01',selectParam.selectedDate+'-12-31'])
}
// 判断点击的是否为饼图的数据项 // 判断点击的是否为饼图的数据项
if (params.componentType === 'series' && params.seriesType === 'pie') { if (params.componentType === 'series' && params.seriesType === 'pie') {
console.log('点击的扇形名称:', params.name); console.log('点击的扇形名称:', params.name);
if (selectParam.key === '领域') { if (selectParam.key === '领域') {
selectParam.domains = params.name selectParam.domains = params.name
if (selectParam.selectedDate.length === 4) {
selectParam.selectedDate = JSON.stringify([selectParam.selectedDate + '-01-01', selectParam.selectedDate + '-12-31'])
}
} else if (selectParam.key === '议院委员会') { } else if (selectParam.key === '议院委员会') {
if (params.name === '众议院' || params.name === '参议院') { if (params.name === '众议院' || params.name === '参议院') {
selectParam.selectedCongress = params.name selectParam.selectedCongress = params.name
selectParam.selectedOrg = '' selectParam.selectedOrg = ''
if (selectParam.selectedDate.length === 4) {
selectParam.selectedDate = JSON.stringify([selectParam.selectedDate + '-01-01', selectParam.selectedDate + '-12-31'])
}
} else { } else {
selectParam.selectedOrg = params.name selectParam.selectedOrg = params.name
selectParam.selectedCongress = '' selectParam.selectedCongress = ''
if (selectParam.selectedDate.length === 4) {
selectParam.selectedDate = JSON.stringify([selectParam.selectedDate + '-01-01', selectParam.selectedDate + '-12-31'])
}
} }
} }
const route = router.resolve({ const route = router.resolve({
...@@ -40,9 +47,12 @@ const setChart = (option, chartId, allowClick, selectParam) => { ...@@ -40,9 +47,12 @@ const setChart = (option, chartId, allowClick, selectParam) => {
window.open(route.href, "_blank"); window.open(route.href, "_blank");
} else if (params.componentType === 'series' && params.seriesType === 'bar') { } else if (params.componentType === 'series' && params.seriesType === 'bar') {
if (params.name === '已立法') { if (params.name === '已立法') {
selectParam.selectedStauts = 1 selectParam.selectedStatus = 1
} else { } else {
selectParam.selectedStauts = 0 selectParam.selectedStatus = 0
}
if (selectParam.selectedDate.length === 4) {
selectParam.selectedDate = JSON.stringify([selectParam.selectedDate + '-01-01', selectParam.selectedDate + '-12-31'])
} }
const route = router.resolve({ const route = router.resolve({
path: "/dataLibrary/countryBill", path: "/dataLibrary/countryBill",
...@@ -52,11 +62,13 @@ const setChart = (option, chartId, allowClick, selectParam) => { ...@@ -52,11 +62,13 @@ const setChart = (option, chartId, allowClick, selectParam) => {
} else { } else {
console.log('当前点击', selectParam, params.seriesName, params.name); console.log('当前点击', selectParam, params.seriesName, params.name);
if (params.seriesName !== '通过率') { if (params.seriesName !== '通过率') {
selectParam = { selectParam.selectedDate = JSON.stringify(getMonthRange(params.name))
selectedDate: JSON.stringify(getMonthRange(params.name)), if (params.seriesName === '通过法案') {
status: params.seriesName === '通过法案' ? 1 : 0, selectParam.selectedStatus = 1
...selectParam } else {
selectParam.selectedStatus = null
} }
const route = router.resolve({ const route = router.resolve({
path: "/dataLibrary/countryBill", path: "/dataLibrary/countryBill",
query: selectParam query: selectParam
......
...@@ -1006,7 +1006,7 @@ const handleBox9Data = async () => { ...@@ -1006,7 +1006,7 @@ const handleBox9Data = async () => {
moduleType: '国会法案', moduleType: '国会法案',
key: '领域', key: '领域',
selectedDate: box9selectetedTime.value, selectedDate: box9selectetedTime.value,
status: box9LegislativeStatus.value === '提出法案' ? 0 : 1, selectedStatus: box9LegislativeStatus.value === '提出法案' ? 0 : 1,
isInvolveCn: 1 isInvolveCn: 1
} }
box9ChartInstance = setChart(box9Chart, "box9Chart", true, selectParam); box9ChartInstance = setChart(box9Chart, "box9Chart", true, selectParam);
......
...@@ -3,20 +3,20 @@ import * as echarts from 'echarts' ...@@ -3,20 +3,20 @@ import * as echarts from 'echarts'
const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => { const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => {
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'item',
axisPointer: { axisPointer: {
type: 'cross', type: 'cross',
label: { label: {
backgroundColor: '#6a7985' backgroundColor: '#6a7985'
} }
}, },
formatter: function (params) { // formatter: function (params) {
let res = params[0].name + '<br/>'; // let res = params[0].name + '<br/>';
params.forEach(item => { // params.forEach(item => {
res += item.marker + item.seriesName + ': ' + item.value + (item.seriesName === '通过率' ? '%' : '') + '<br/>'; // res += item.marker + item.seriesName + ': ' + item.value + (item.seriesName === '通过率' ? '%' : '') + '<br/>';
}); // });
return res; // return res;
} // }
}, },
grid: { grid: {
width: '96%', width: '96%',
......
...@@ -78,7 +78,7 @@ const props = defineProps({ ...@@ -78,7 +78,7 @@ const props = defineProps({
type: String, type: String,
default: '' default: ''
}, },
chartTypeList : { chartTypeList: {
type: Array, type: Array,
default: [] default: []
} }
...@@ -88,15 +88,19 @@ const chartItemList = computed(() => { ...@@ -88,15 +88,19 @@ const chartItemList = computed(() => {
let arr = [] let arr = []
props.chartTypeList.forEach(item => { props.chartTypeList.forEach(item => {
defaultChartTypeList.forEach(val => { defaultChartTypeList.forEach(val => {
if(val.name === item) { if (val.name === item) {
arr.push(val) arr.push(val)
} }
}) })
}) })
arr.forEach(item => { arr.forEach(item => {
item.active = false item.active = false
}) })
arr[0].active = true arr[0].active = true
// console.log('arr', arr);
return arr return arr
}) })
......
...@@ -478,12 +478,13 @@ const handleClickToolBox = () => { ...@@ -478,12 +478,13 @@ const handleClickToolBox = () => {
onMounted(() => { onMounted(() => {
const path = route.path const path = route.path
console.log(decodeURI(route.fullPath));
switch (path) { switch (path) {
case '/dataLibrary/countryBill': case '/dataLibrary/countryBill':
siderList.value[0].active = true siderList.value[0].active = true
siderList.value[0].isExpanded = true siderList.value[0].isExpanded = true
siderList.value[0].children[0].active = true siderList.value[0].children[0].active = true
break break
case '/dataLibrary/stateBill': case '/dataLibrary/stateBill':
siderList.value[0].active = true siderList.value[0].active = true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论