Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
05beb3ae
提交
05beb3ae
authored
3月 25, 2026
作者:
coderBryanFu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:更新数据资源库
上级
f835b3ed
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
1231 行增加
和
60 行删除
+1231
-60
setChart.js
src/utils/setChart.js
+21
-9
index.vue
src/views/bill/billHome/index.vue
+1
-1
multiLineChart.js
src/views/bill/billHome/utils/multiLineChart.js
+8
-8
index.vue
src/views/dataLibrary/bill/countryBill/index.vue
+136
-28
index.vue
src/views/dataLibrary/components/ChartContainer/index.vue
+6
-2
index.vue
src/views/dataLibrary/decree/index.vue
+1057
-11
index.vue
src/views/dataLibrary/index.vue
+2
-1
没有找到文件。
src/utils/setChart.js
浏览文件 @
05beb3ae
...
...
@@ -15,22 +15,29 @@ const setChart = (option, chartId, allowClick, selectParam) => {
chart
.
on
(
'click'
,
function
(
params
)
{
switch
(
selectParam
.
moduleType
)
{
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'
)
{
console
.
log
(
'点击的扇形名称:'
,
params
.
name
);
if
(
selectParam
.
key
===
'领域'
)
{
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
===
'议院委员会'
)
{
if
(
params
.
name
===
'众议院'
||
params
.
name
===
'参议院'
)
{
selectParam
.
selectedCongress
=
params
.
name
selectParam
.
selectedOrg
=
''
if
(
selectParam
.
selectedDate
.
length
===
4
)
{
selectParam
.
selectedDate
=
JSON
.
stringify
([
selectParam
.
selectedDate
+
'-01-01'
,
selectParam
.
selectedDate
+
'-12-31'
])
}
}
else
{
selectParam
.
selectedOrg
=
params
.
name
selectParam
.
selectedCongress
=
''
if
(
selectParam
.
selectedDate
.
length
===
4
)
{
selectParam
.
selectedDate
=
JSON
.
stringify
([
selectParam
.
selectedDate
+
'-01-01'
,
selectParam
.
selectedDate
+
'-12-31'
])
}
}
}
const
route
=
router
.
resolve
({
...
...
@@ -40,9 +47,12 @@ const setChart = (option, chartId, allowClick, selectParam) => {
window
.
open
(
route
.
href
,
"_blank"
);
}
else
if
(
params
.
componentType
===
'series'
&&
params
.
seriesType
===
'bar'
)
{
if
(
params
.
name
===
'已立法'
)
{
selectParam
.
selectedSta
ut
s
=
1
selectParam
.
selectedSta
tu
s
=
1
}
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
({
path
:
"/dataLibrary/countryBill"
,
...
...
@@ -52,11 +62,13 @@ const setChart = (option, chartId, allowClick, selectParam) => {
}
else
{
console
.
log
(
'当前点击'
,
selectParam
,
params
.
seriesName
,
params
.
name
);
if
(
params
.
seriesName
!==
'通过率'
)
{
selectParam
=
{
selectedDate
:
JSON
.
stringify
(
getMonthRange
(
params
.
name
)),
status
:
params
.
seriesName
===
'通过法案'
?
1
:
0
,
...
selectParam
selectParam
.
selectedDate
=
JSON
.
stringify
(
getMonthRange
(
params
.
name
))
if
(
params
.
seriesName
===
'通过法案'
)
{
selectParam
.
selectedStatus
=
1
}
else
{
selectParam
.
selectedStatus
=
null
}
const
route
=
router
.
resolve
({
path
:
"/dataLibrary/countryBill"
,
query
:
selectParam
...
...
src/views/bill/billHome/index.vue
浏览文件 @
05beb3ae
...
...
@@ -1006,7 +1006,7 @@ const handleBox9Data = async () => {
moduleType
:
'国会法案'
,
key
:
'领域'
,
selectedDate
:
box9selectetedTime
.
value
,
status
:
box9LegislativeStatus
.
value
===
'提出法案'
?
0
:
1
,
s
electedS
tatus
:
box9LegislativeStatus
.
value
===
'提出法案'
?
0
:
1
,
isInvolveCn
:
1
}
box9ChartInstance
=
setChart
(
box9Chart
,
"box9Chart"
,
true
,
selectParam
);
...
...
src/views/bill/billHome/utils/multiLineChart.js
浏览文件 @
05beb3ae
...
...
@@ -3,20 +3,20 @@ import * as echarts from 'echarts'
const
getMultiLineChart
=
(
dataX
,
dataY1
,
dataY2
,
dataY3
)
=>
{
return
{
tooltip
:
{
trigger
:
'
axis
'
,
trigger
:
'
item
'
,
axisPointer
:
{
type
:
'cross'
,
label
:
{
backgroundColor
:
'#6a7985'
}
},
formatter
:
function
(
params
)
{
let
res
=
params
[
0
].
name
+
'<br/>'
;
params
.
forEach
(
item
=>
{
res
+=
item
.
marker
+
item
.
seriesName
+
': '
+
item
.
value
+
(
item
.
seriesName
===
'通过率'
?
'%'
:
''
)
+
'<br/>'
;
});
return
res
;
}
//
formatter: function (params) {
//
let res = params[0].name + '<br/>';
//
params.forEach(item => {
//
res += item.marker + item.seriesName + ': ' + item.value + (item.seriesName === '通过率' ? '%' : '') + '<br/>';
//
});
//
return res;
//
}
},
grid
:
{
width
:
'96%'
,
...
...
src/views/dataLibrary/bill/countryBill/index.vue
浏览文件 @
05beb3ae
...
...
@@ -16,7 +16,7 @@
<SelectBox
v-if=
"isFolderAll"
:placeholder-name=
"memberPlaceHolder"
select-title=
"提出议员"
:select-list=
"memberList"
:select-name=
"selectedmember"
@
update:select-text=
"handleSelectMember"
/>
<SelectBox
v-if=
"isFolderAll"
:placeholder-name=
"statusPlaceHolder"
select-title=
"所处阶段"
:select-list=
"statusList"
:select-name=
"selectedSta
ut
s"
@
update:select-text=
"handleSelectStauts"
/>
:select-list=
"statusList"
:select-name=
"selectedSta
tu
s"
@
update:select-text=
"handleSelectStauts"
/>
<div
class=
"check-box"
>
<div
class=
"check-box-left text-tip-1"
>
{{
'是否涉华:'
}}
...
...
@@ -61,7 +61,7 @@
<
/ChartHeader
>
<
/div
>
<
div
class
=
"content-main"
>
<
ChartContainer
chartTitle
=
"美国会法案提出数量随时间变化趋势
"
:
chartTypeList
=
"curChartTypeList"
<
ChartContainer
:
chartTitle
=
"curChartTitle
"
:
chartTypeList
=
"curChartTypeList"
@
clickChartItem
=
"handleSwitchActiveChart"
>
<
template
#
chart
-
box
>
<
LineChart
v
-
if
=
"activeChart === '折线图'"
:
lineChartData
=
"curChartData"
/>
...
...
@@ -98,7 +98,7 @@
<
div
class
=
"icon"
>
<
img
src
=
"../../assets/icons/download.svg"
alt
=
""
>
<
/div
>
<
div
class
=
"text text-tip-1"
>
{{
'导出'
}}
<
/div
>
<
div
class
=
"text text-tip-1"
@
click
=
"handleExport"
>
{{
'导出'
}}
<
/div
>
<
/div
>
<
div
class
=
"header-right-item2 item2"
>
<
el
-
select
v
-
model
=
"curOperation"
placeholder
=
"批量操作"
style
=
"width: 120px"
>
...
...
@@ -123,7 +123,8 @@
<
el
-
table
-
column
type
=
"selection"
width
=
"40"
/>
<
el
-
table
-
column
label
=
"法案名称"
width
=
"455"
>
<
template
#
default
=
"scope"
>
<
span
class
=
"title-item text-compact-bold"
>
{{
scope
.
row
.
title
}}
<
/span
>
<
span
class
=
"title-item text-compact-bold"
@
click
=
"handleClickToDetail(scope.row)"
>
{{
scope
.
row
.
title
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"日期"
width
=
"120"
class
-
name
=
"date-column"
>
...
...
@@ -131,7 +132,8 @@
<
/el-table-column
>
<
el
-
table
-
column
label
=
"提出人"
width
=
"480"
>
<
template
#
default
=
"scope"
>
<
span
class
=
"person-item text-compact"
>
{{
scope
.
row
.
sponsorPersonName
}}
<
/span
>
<
span
class
=
"person-item text-compact"
@
click
=
"handlePerClick(scope.row)"
>
{{
scope
.
row
.
sponsorPersonName
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
property
=
"affiliation"
label
=
"所属党派"
width
=
"120"
/>
...
...
@@ -160,6 +162,7 @@ import BarChart from '../../components/BarChart/index.vue'
import
RaderChart
from
'../../components/RadarChart/idnex.vue'
import
SelectBox
from
'../../components/SelectBox/index.vue'
import
{
useRoute
}
from
"vue-router"
;
import
router
from
'@/router'
import
{
getPostOrgList
,
getPostMemberList
}
from
'@/api/bill/billHome'
import
{
search
}
from
'@/api/comprehensiveSearch'
...
...
@@ -167,15 +170,25 @@ import { ElMessage } from 'element-plus'
import
getDateRange
from
'@/utils/getDateRange'
const
route
=
useRoute
();
// 图表/数据
const
isShowChart
=
ref
(
false
)
// 点击切换数据/图表
const
handleSwitchChartData
=
()
=>
{
isShowChart
.
value
=
!
isShowChart
.
value
if
(
isShowChart
.
value
)
{
const
curDemensionItem
=
staticsDemensionList
.
value
.
filter
(
item
=>
{
return
item
.
name
===
curDemension
.
value
}
)[
0
]
setTimeout
(()
=>
{
activeChart
.
value
=
curDemensionItem
.
chartTypeList
[
0
]
curChartData
.
value
=
curDemensionItem
.
data
}
)
}
}
// 总计数据
const
totalNum
=
ref
(
12
)
const
totalNum
=
ref
(
0
)
// 统计维度列表
const
staticsDemensionList
=
ref
([
...
...
@@ -183,6 +196,7 @@ const staticsDemensionList = ref([
name
:
'提案时间'
,
active
:
true
,
chartTypeList
:
[
'折线图'
,
'柱状图'
],
chartTitle
:
'美国会法案提出数量随时间变化趋势'
,
data
:
{
dataX
:
[],
dataY
:
[]
...
...
@@ -192,30 +206,35 @@ const staticsDemensionList = ref([
name
:
'科技领域'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'美国会法案领域分布'
,
data
:
[]
}
,
{
name
:
'提出议院'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'美国会法案议院分布'
,
data
:
[]
}
,
{
name
:
'提出委员会'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'美国会法案委员会分布'
,
data
:
[]
}
,
{
name
:
'提出议员党派'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'美国会法案党派分布'
,
data
:
[]
}
,
{
name
:
'立法阶段'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'美国会法案立法阶段分布'
,
data
:
[]
}
,
])
...
...
@@ -226,6 +245,11 @@ const curChartTypeList = computed(() => {
return
arr
[
0
].
chartTypeList
}
)
const
curChartTitle
=
computed
(()
=>
{
let
arr
=
staticsDemensionList
.
value
.
filter
(
item
=>
item
.
active
)
return
arr
[
0
].
chartTitle
}
)
// 当前维度
const
curDemension
=
ref
(
'提案时间'
)
...
...
@@ -246,16 +270,16 @@ const handleClickDemensionItem = (val) => {
const
selectedTime
=
ref
(
'按月统计'
)
const
timeList
=
ref
([
{
label
:
'按年统计'
,
value
:
'按年统计'
label
:
'按年
度
统计'
,
value
:
'按年
度
统计'
}
,
{
label
:
'按季统计'
,
value
:
'按季统计'
label
:
'按季
度
统计'
,
value
:
'按季
度
统计'
}
,
{
label
:
'按月统计'
,
value
:
'按月统计'
label
:
'按月
度
统计'
,
value
:
'按月
度
统计'
}
,
])
...
...
@@ -280,8 +304,8 @@ const activeTagList = computed(() => {
if
(
selectedmember
.
value
&&
selectedmember
.
value
!==
'全部议员'
)
{
arr
.
push
(
selectedmember
.
value
)
}
if
(
selectedSta
uts
.
value
&&
selectedStaut
s
.
value
!==
'全部阶段'
)
{
arr
.
push
(
selectedSta
ut
s
.
value
)
if
(
selectedSta
tus
.
value
&&
selectedStatu
s
.
value
!==
'全部阶段'
)
{
arr
.
push
(
selectedSta
tu
s
.
value
)
}
if
(
isInvolveCn
.
value
)
{
const
involveStr
=
'涉华'
...
...
@@ -297,7 +321,7 @@ const handleCloseCurTag = (tag, index) => {
activeTagList
.
value
.
splice
(
index
,
1
)
}
const
activeChart
=
ref
(
''
)
const
activeChart
=
ref
(
''
)
// 当前激活的图表
const
handleSwitchActiveChart
=
val
=>
{
activeChart
.
value
=
val
.
name
...
...
@@ -574,7 +598,8 @@ const handleGetMemberList = async () => {
memberList
.
value
=
res
.
data
.
map
(
item
=>
{
return
{
name
:
item
.
memberName
,
id
:
item
.
memberName
id
:
item
.
memberName
,
memberId
:
item
.
memberId
}
}
)
memberList
.
value
=
[{
name
:
'全部议员'
,
id
:
'全部议员'
}
,
...
memberList
.
value
]
...
...
@@ -602,10 +627,10 @@ const statusList = ref([
}
])
const
selectedSta
ut
s
=
ref
(
'全部阶段'
)
const
selectedSta
tu
s
=
ref
(
'全部阶段'
)
const
statusPlaceHolder
=
ref
(
'请选择立法阶段'
)
const
handleSelectStauts
=
value
=>
{
selectedSta
ut
s
.
value
=
value
selectedSta
tu
s
.
value
=
value
}
// 是否涉华
...
...
@@ -621,7 +646,7 @@ const handleClear = () => {
selectedCongress
.
value
=
'全部议院'
selectedOrg
.
value
=
'全部委员会'
selectedmember
.
value
=
'全部议员'
selectedSta
ut
s
.
value
=
'全部阶段'
selectedSta
tu
s
.
value
=
'全部阶段'
isInvolveCn
.
value
=
false
ElMessage
.
success
(
'已清空条件!'
)
}
...
...
@@ -675,6 +700,8 @@ const selectedCount = computed(() => selectedMap.value.size)
// 获取表格数据(示例)
const
fetchTableData
=
async
()
=>
{
isSelectedAll
.
value
=
false
selectedMap
.
value
.
clear
()
// 调用接口获取数据...
const
params
=
{
page
:
currentPage
.
value
,
...
...
@@ -688,8 +715,8 @@ const fetchTableData = async () => {
originChamber
:
selectedCongress
.
value
===
'全部议院'
?
null
:
selectedCongress
.
value
,
originDepart
:
selectedOrg
.
value
===
'全部委员会'
?
null
:
selectedOrg
.
value
,
sponsorPersonName
:
selectedmember
.
value
===
'全部议员'
?
null
:
selectedmember
.
value
,
status
:
selectedSta
ut
s
.
value
===
'通过'
?
1
:
0
,
sleStatus
:
isInvolveCn
?
1
:
0
,
status
:
selectedSta
tu
s
.
value
===
'通过'
?
1
:
0
,
sleStatus
:
isInvolveCn
?
'Y'
:
'N'
,
sort
:
isSort
.
value
?
0
:
1
// 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序
}
try
{
...
...
@@ -867,25 +894,93 @@ const curChartData = ref(null)
// 跳转到当前页 初始化筛选条件
const
initParam
=
()
=>
{
const
hasQuery
=
Object
.
keys
(
route
.
query
).
length
>
0
;
if
(
hasQuery
)
{
selectedArea
.
value
=
route
.
query
.
domains
?
route
.
query
.
domains
:
'全部领域'
if
(
Array
.
isArray
(
JSON
.
parse
(
route
.
query
.
selectedDate
))
&&
JSON
.
parse
(
route
.
query
.
selectedDate
).
length
)
{
selectedDate
.
value
=
'自定义'
customTime
.
value
=
JSON
.
parse
(
route
.
query
.
selectedDate
)
// console.log('customTime', customTime.value);
}
isInvolveCn
.
value
=
route
.
query
.
isInvolveCn
?
true
:
false
if
(
route
.
query
.
s
tatus
)
{
selectedStauts
.
value
=
route
.
query
.
s
tatus
===
'1'
?
'通过'
:
'提出'
if
(
route
.
query
.
selectedS
tatus
)
{
selectedStatus
.
value
=
route
.
query
.
selectedS
tatus
===
'1'
?
'通过'
:
'提出'
}
else
{
selectedStaut
s
.
value
=
'全部阶段'
selectedStatu
s
.
value
=
'全部阶段'
}
selectedCongress
.
value
=
route
.
query
.
selectedCongress
?
route
.
query
.
selectedCongress
:
'全部议院'
selectedOrg
.
value
=
route
.
query
.
selectedOrg
?
route
.
query
.
selectedOrg
:
'全部委员会'
const
query
=
route
.
query
;
if
(
Object
.
keys
(
query
).
length
>
0
)
{
sessionStorage
.
setItem
(
'routeQuery'
,
JSON
.
stringify
(
query
));
}
}
else
{
const
savedQuery
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'routeQuery'
)
||
'{
}
'
);
selectedArea
.
value
=
savedQuery
.
domains
?
savedQuery
.
domains
:
'全部领域'
if
(
Array
.
isArray
(
JSON
.
parse
(
savedQuery
.
selectedDate
))
&&
JSON
.
parse
(
savedQuery
.
selectedDate
).
length
)
{
selectedDate
.
value
=
'自定义'
customTime
.
value
=
JSON
.
parse
(
savedQuery
.
selectedDate
)
}
isInvolveCn
.
value
=
savedQuery
.
isInvolveCn
?
true
:
false
if
(
savedQuery
.
selectedStatus
)
{
selectedStatus
.
value
=
savedQuery
.
selectedStatus
===
'1'
?
'通过'
:
'提出'
}
else
{
selectedStatus
.
value
=
'全部阶段'
}
selectedCongress
.
value
=
savedQuery
.
selectedCongress
?
savedQuery
.
selectedCongress
:
'全部议院'
selectedOrg
.
value
=
savedQuery
.
selectedOrg
?
savedQuery
.
selectedOrg
:
'全部委员会'
}
}
// 跳转法案详情
const
handleClickToDetail
=
(
curBill
)
=>
{
console
.
log
(
'curBill'
,
curBill
);
window
.
sessionStorage
.
setItem
(
"billId"
,
curBill
.
id
);
window
.
sessionStorage
.
setItem
(
"curTabName"
,
curBill
.
title
);
const
route
=
router
.
resolve
({
path
:
"/billLayout"
,
query
:
{
billId
:
curBill
.
id
}
}
);
window
.
open
(
route
.
href
,
"_blank"
);
}
;
// 跳转人物详情
const
handlePerClick
=
item
=>
{
window
.
sessionStorage
.
setItem
(
"curTabName"
,
item
.
sponsorPersonName
);
const
route
=
router
.
resolve
({
path
:
"/characterPage"
,
query
:
{
type
:
2
,
personId
:
item
.
personId
}
}
);
window
.
open
(
route
.
href
,
"_blank"
);
}
;
// 导出
const
handleExport
=
()
=>
{
console
.
log
(
selectedMap
.
value
);
const
arr
=
Array
.
from
(
selectedMap
.
value
);
const
jsonStr
=
JSON
.
stringify
(
arr
,
null
,
2
);
const
blob
=
new
Blob
([
jsonStr
],
{
type
:
'application/json'
}
);
const
url
=
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
link
.
href
=
url
;
link
.
download
=
'export.json'
;
link
.
click
();
URL
.
revokeObjectURL
(
url
);
}
;
onMounted
(
async
()
=>
{
handleGetOrgList
()
handleGetMemberList
()
...
...
@@ -1147,9 +1242,21 @@ onMounted(async () => {
.
title
-
item
{
color
:
var
(
--
text
-
primary
-
80
-
color
);
cursor
:
pointer
;
&
:
hover
{
color
:
var
(
--
color
-
primary
-
100
);
text
-
decoration
:
underline
;
}
}
.
person
-
item
{
color
:
var
(
--
color
-
primary
-
100
);
cursor
:
pointer
;
&
:
hover
{
font
-
weight
:
bold
;
text
-
decoration
:
underline
;
}
}
<
/style>
\ No newline at end of file
src/views/dataLibrary/components/ChartContainer/index.vue
浏览文件 @
05beb3ae
...
...
@@ -78,7 +78,7 @@ const props = defineProps({
type
:
String
,
default
:
''
},
chartTypeList
:
{
chartTypeList
:
{
type
:
Array
,
default
:
[]
}
...
...
@@ -88,15 +88,19 @@ const chartItemList = computed(() => {
let
arr
=
[]
props
.
chartTypeList
.
forEach
(
item
=>
{
defaultChartTypeList
.
forEach
(
val
=>
{
if
(
val
.
name
===
item
)
{
if
(
val
.
name
===
item
)
{
arr
.
push
(
val
)
}
})
})
arr
.
forEach
(
item
=>
{
item
.
active
=
false
})
arr
[
0
].
active
=
true
// console.log('arr', arr);
return
arr
})
...
...
src/views/dataLibrary/decree/index.vue
浏览文件 @
05beb3ae
<
template
>
<div
class=
"countrybill-wrapper"
>
<div
class=
"header-box"
>
我是政令
</div>
<div
class=
"main-box"
>
<div
class=
"header-box"
>
<div
class=
"header-top"
>
<SelectBox
:placeholder-name=
"areaPlaceHolder"
select-title=
"科技领域"
:select-list=
"areaList"
:select-name=
"selectedArea"
@
update:select-text=
"handleSelectArea"
/>
<SelectBox
:placeholder-name=
"DatePlaceHolder"
select-title=
"提出时间"
:select-list=
"dateList"
:select-name=
"selectedDate"
:custom-time=
"customTime"
@
update:select-text=
"handleSelectDate"
@
update:custom-time=
"handleCustomDate"
/>
<SelectBox
v-if=
"isFolderAll"
:placeholder-name=
"insPlaceHolder"
select-title=
"发布机构"
:select-list=
"institutionList"
:select-name=
"selectedIns"
@
update:select-text=
"handleSelectIns"
/>
<SelectBox
v-if=
"isFolderAll"
:placeholder-name=
"decreeTypePlaceHolder"
select-title=
"政令类型"
:select-list=
"decreeTypeList"
:select-name=
"selectedDecreeType"
@
update:select-text=
"handleSelectDecreeType"
/>
<div
class=
"check-box"
>
<div
class=
"check-box-left text-tip-1"
>
{{
'是否涉华:'
}}
</div>
<div
class=
"check-box-right"
>
<el-checkbox
v-model=
"isInvolveCn"
class=
"involve-checkbox"
@
change=
"handleInvolveCnChange"
>
{{
'只看涉华法案'
}}
</el-checkbox>
</div>
</div>
<div
class=
"check-box"
>
<div
class=
"check-box-left text-tip-1"
>
{{
'科技相关:'
}}
</div>
<div
class=
"check-box-right"
>
<el-checkbox
v-model=
"isInvolveTechnology"
class=
"involve-checkbox"
>
{{
'只看科技相关'
}}
</el-checkbox>
</div>
</div>
</div>
<div
class=
"header-footer"
>
<div
class=
"header-footer-left"
>
<ActiveTag
v-for=
"tag, index in activeTagList"
:key=
"index"
:tagName=
"tag"
@
close=
"handleCloseCurTag(tag, index)"
/>
</div>
<div
class=
"header-footer-right"
>
<HeaderBtnBox
:isShowAll=
"isFolderAll"
@
show-all=
"handleSwitchFolderAll"
@
clear=
"handleClear"
@
confirm=
"handleConfirm"
/>
</div>
</div>
</div>
<div
class=
"chart-main-box"
v-if=
"isShowChart"
>
<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=
""
>
<img
src=
"@/views/dataLibrary/assets/icons/chart-active.svg"
alt=
""
>
</div>
<div
class=
"num-box text-title-3-bold"
>
{{
`共 ${totalNum
}
条数据`
}}
<
/div
>
<
/div
>
<
div
class
=
"content-box"
>
<
div
class
=
"content-header"
>
<
ChartHeader
:
list
=
"staticsDemensionList"
@
clickItem
=
"handleClickDemensionItem"
>
<
template
#
chart
-
header
-
right
>
<
el
-
select
v
-
model
=
"selectedTime"
placeholder
=
"选择时间"
style
=
"width: 150px"
v
-
show
=
"curDemension === '提案时间'"
>
<
el
-
option
v
-
for
=
"item in timeList"
:
key
=
"item.value"
:
label
=
"item.label"
:
value
=
"item.value"
/>
<
/el-select
>
<
/template
>
<
/ChartHeader
>
<
/div
>
<
div
class
=
"content-main"
>
<
ChartContainer
:
chartTitle
=
"curChartTitle"
:
chartTypeList
=
"curChartTypeList"
@
clickChartItem
=
"handleSwitchActiveChart"
>
<
template
#
chart
-
box
>
<
LineChart
v
-
if
=
"activeChart === '折线图'"
:
lineChartData
=
"curChartData"
/>
<
PieChart
v
-
if
=
"activeChart === '饼状图'"
:
pieChartData
=
"curChartData"
/>
<
BarChart
v
-
if
=
"activeChart === '柱状图'"
:
barChartData
=
"curChartData"
/>
<
RaderChart
v
-
if
=
"activeChart === '雷达图'"
:
radarChartData
=
"curChartData"
/>
<
/template
>
<
/ChartContainer
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"data-main-box"
v
-
else
>
<
div
class
=
"data-main-box-header"
>
<
div
class
=
"switch-box"
@
click
=
"handleSwitchChartData"
>
<
img
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"
><
/div
>
<
div
class
=
"data-main-box-main"
>
<
div
class
=
"data-main-box-main-header"
>
<
div
class
=
"header-left"
>
<
div
class
=
"header-left-item1"
>
<
el
-
checkbox
v
-
model
=
"isSelectedAll"
label
=
"全选"
@
change
=
"handleSelectAllChange"
size
=
"large"
/>
<
/div
>
<
div
class
=
"header-left-item2 text-tip-1"
>
{{
`已选择${selectedCount
}
项`
}}
<
/div
>
<
div
class
=
"header-left-item2 text-tip-1 cancel"
@
click
=
"handleClearAll"
v
-
show
=
"selectedCount"
>
{{
'取消'
}}
<
/div
>
<
/div
>
<
div
class
=
"header-right"
>
<
div
class
=
"header-right-item item1"
>
<
div
class
=
"icon"
>
<
img
src
=
"../assets/icons/download.svg"
alt
=
""
>
<
/div
>
<
div
class
=
"text text-tip-1"
@
click
=
"handleExport"
>
{{
'导出'
}}
<
/div
>
<
/div
>
<
div
class
=
"header-right-item2 item2"
>
<
el
-
select
v
-
model
=
"curOperation"
placeholder
=
"批量操作"
style
=
"width: 120px"
>
<
el
-
option
v
-
for
=
"item in operationList"
:
key
=
"item.id"
:
label
=
"item.name"
:
value
=
"item.id"
/>
<
/el-select
>
<
/div
>
<
div
class
=
"header-right-item3 item3"
>
<
el
-
select
v
-
model
=
"isSort"
placeholder
=
"发布时间"
style
=
"width: 166px"
@
change
=
"handlePxChange"
>
<
template
#
prefix
>
<
div
style
=
"display: flex; align-items: center; height: 100%"
>
<
img
src
=
"../../assets/icons/desc-icon.svg"
style
=
"width: 14px; height: 14px"
/>
<
/div
>
<
/template
>
<
el
-
option
v
-
for
=
"item in releaseTimeList"
:
key
=
"item.value"
:
label
=
"item.label"
:
value
=
"item.value"
/>
<
/el-select
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"data-main-box-main-content"
>
<
el
-
table
ref
=
"tableRef"
:
data
=
"tableData"
row
-
key
=
"id"
@
selection
-
change
=
"handleSelectionChange"
@
select
=
"handleSelect"
@
select
-
all
=
"handleSelectAll"
style
=
"width: 100%"
:
row
-
style
=
"{ height: '52px'
}
"
>
<
el
-
table
-
column
type
=
"selection"
width
=
"40"
/>
<
el
-
table
-
column
label
=
"法案名称"
width
=
"455"
>
<
template
#
default
=
"scope"
>
<
span
class
=
"title-item text-compact-bold"
@
click
=
"handleClickToDetail(scope.row)"
>
{{
scope
.
row
.
title
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"日期"
width
=
"120"
class
-
name
=
"date-column"
>
<
template
#
default
=
"scope"
>
{{
scope
.
row
.
date
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"提出人"
width
=
"480"
>
<
template
#
default
=
"scope"
>
<
span
class
=
"person-item text-compact"
@
click
=
"handlePerClick(scope.row)"
>
{{
scope
.
row
.
sponsorPersonName
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
property
=
"affiliation"
label
=
"所属党派"
width
=
"120"
/>
<
el
-
table
-
column
property
=
"originDepart"
label
=
"提出委员会"
width
=
"180"
/>
<
el
-
table
-
column
property
=
"status"
label
=
"所处阶段"
width
=
"120"
/>
<
/el-table
>
<
/div
>
<
/div
>
<
div
class
=
"data-main-box-footer"
>
<
el
-
pagination
background
layout
=
"prev, pager, next"
:
total
=
"totalNum"
v
-
model
:
current
-
page
=
"currentPage"
:
page
-
size
=
"pageSize"
@
current
-
change
=
"handleCurrentChange"
/>
<
/div
>
<
/div
>
<
/div
>
<
/template
>
<
script
setup
>
import
{
ref
}
from
'vue'
import
{
ref
,
computed
,
watch
,
onMounted
,
nextTick
}
from
'vue'
import
ChartContainer
from
'../components/ChartContainer/index.vue'
import
ChartHeader
from
'../components/ChartHeader/index.vue'
import
ActiveTag
from
'../components/ActiveTag/index.vue'
import
HeaderBtnBox
from
'../components/HeaderBtnBox/index.vue'
import
LineChart
from
'../components/LineChart/index.vue'
import
PieChart
from
'../components/PieChart/index.vue'
import
BarChart
from
'../components/BarChart/index.vue'
import
RaderChart
from
'../components/RadarChart/idnex.vue'
import
SelectBox
from
'../components/SelectBox/index.vue'
import
{
useRoute
}
from
"vue-router"
;
import
router
from
'@/router'
// 图表/数据
const
isShowChart
=
ref
(
true
)
import
{
getPostOrgList
,
getPostMemberList
}
from
'@/api/bill/billHome'
import
{
search
}
from
'@/api/comprehensiveSearch'
import
{
ElMessage
}
from
'element-plus'
import
getDateRange
from
'@/utils/getDateRange'
const
route
=
useRoute
();
// 图表/数据
const
isShowChart
=
ref
(
false
)
// 点击切换数据/图表
const
handleSwitchChartData
=
()
=>
{
isShowChart
.
value
=
!
isShowChart
.
value
if
(
isShowChart
.
value
)
{
const
curDemensionItem
=
staticsDemensionList
.
value
.
filter
(
item
=>
{
return
item
.
name
===
curDemension
.
value
}
)[
0
]
setTimeout
(()
=>
{
activeChart
.
value
=
curDemensionItem
.
chartTypeList
[
0
]
curChartData
.
value
=
curDemensionItem
.
data
}
)
}
}
// 总计数据
const
totalNum
=
ref
(
12
)
const
totalNum
=
ref
(
0
)
// 统计维度列表
const
staticsDemensionList
=
ref
([
{
name
:
'发布时间'
,
active
:
true
,
chartTypeList
:
[
'折线图'
,
'柱状图'
],
chartTitle
:
'政令发布时间趋势变化'
,
data
:
{
dataX
:
[],
dataY
:
[]
}
}
,
{
name
:
'科技领域'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'政令科技领域分布'
,
data
:
[]
}
,
{
name
:
'发布机构'
,
active
:
false
,
chartTypeList
:
[
'饼状图'
],
chartTitle
:
'政令发布机构分布'
,
data
:
[]
}
])
// 当前维度下的图表列表
const
curChartTypeList
=
computed
(()
=>
{
let
arr
=
staticsDemensionList
.
value
.
filter
(
item
=>
item
.
active
)
return
arr
[
0
].
chartTypeList
}
)
// 当前图表标题
const
curChartTitle
=
computed
(()
=>
{
let
arr
=
staticsDemensionList
.
value
.
filter
(
item
=>
item
.
active
)
return
arr
[
0
].
chartTitle
}
)
// 当前维度
const
curDemension
=
ref
(
'提案时间'
)
// 点击维度item
const
handleClickDemensionItem
=
(
val
)
=>
{
activeChart
.
value
=
''
staticsDemensionList
.
value
.
forEach
(
item
=>
{
item
.
active
=
false
}
)
val
.
active
=
true
curDemension
.
value
=
val
.
name
setTimeout
(()
=>
{
activeChart
.
value
=
val
.
chartTypeList
[
0
]
curChartData
.
value
=
val
.
data
}
)
}
const
selectedTime
=
ref
(
'按月统计'
)
const
timeList
=
ref
([
{
label
:
'按年度统计'
,
value
:
'按年度统计'
}
,
{
label
:
'按季度统计'
,
value
:
'按季度统计'
}
,
{
label
:
'按月度统计'
,
value
:
'按月度统计'
}
,
])
// 激活的标签列表
const
activeTagList
=
computed
(()
=>
{
const
arr
=
[]
if
(
selectedArea
.
value
&&
selectedArea
.
value
!==
'全部领域'
)
{
arr
.
push
(
selectedArea
.
value
)
}
if
(
selectedDate
.
value
===
'自定义'
)
{
arr
.
push
(
customTime
.
value
.
join
(
'至'
))
}
if
(
selectedIns
.
value
&&
selectedIns
.
value
!==
'全部机构'
)
{
arr
.
push
(
selectedIns
.
value
)
}
if
(
selectedDecreeType
.
value
&&
selectedDecreeType
.
value
!==
'全部类型'
)
{
arr
.
push
(
selectedDecreeType
.
value
)
}
if
(
isInvolveCn
.
value
)
{
const
involveStr
=
'涉华'
arr
.
push
(
involveStr
)
}
return
arr
}
)
const
handleCloseCurTag
=
(
tag
,
index
)
=>
{
// alert(tag.name)
activeTagList
.
value
.
splice
(
index
,
1
)
}
const
activeChart
=
ref
(
''
)
const
handleSwitchActiveChart
=
val
=>
{
activeChart
.
value
=
val
.
name
}
const
radarChartData
=
ref
({
title
:
[
{
name
:
'航空航天'
,
max
:
10
}
,
{
name
:
'先进制造'
,
max
:
10
}
,
{
name
:
'量子科技'
,
max
:
10
}
,
{
name
:
'人工智能'
,
max
:
10
}
,
{
name
:
'新材料'
,
max
:
10
}
,
{
name
:
'集成电路'
,
max
:
10
}
,
],
data
:
[
{
name
:
"337调查"
,
value
:
[
10
,
5
,
2
,
8
,
5
,
7
]
}
,
{
name
:
"232调查"
,
value
:
[
2
,
5
,
3
,
8
,
10
,
2
]
}
,
{
name
:
"301调查"
,
value
:
[
5
,
8
,
2
,
9
,
1
,
5
]
}
]
}
)
// 数据- 是否全选
const
isSelectedAll
=
ref
(
false
)
const
curOperation
=
ref
(
''
)
const
operationList
=
ref
([
{
name
:
'aaa'
,
id
:
'aaa'
}
,
{
name
:
'bbb'
,
id
:
'bbb'
}
,
{
name
:
'ccc'
,
id
:
'ccc'
}
,
])
// 科技领域
const
areaPlaceHolder
=
ref
(
'请选择领域'
)
const
selectedArea
=
ref
(
'全部领域'
)
const
areaList
=
ref
([
{
name
:
'全部领域'
,
id
:
'全部领域'
}
,
{
name
:
'人工智能'
,
id
:
'人工智能'
}
,
{
name
:
'生物科技'
,
id
:
'生物科技'
}
,
{
name
:
'新一代通信网络'
,
id
:
'新一代通信网络'
}
,
{
name
:
'量子科技'
,
id
:
'量子科技'
}
,
{
name
:
'新能源'
,
id
:
'新能源'
}
,
{
name
:
'集成电路'
,
id
:
'集成电路'
}
,
{
name
:
'海洋'
,
id
:
'海洋'
}
,
{
name
:
'先进制造'
,
id
:
'先进制造'
}
,
{
name
:
'新材料'
,
id
:
'新材料'
}
,
{
name
:
'航空航天'
,
id
:
'航空航天'
}
,
{
name
:
'太空'
,
id
:
'太空'
}
,
{
name
:
'深海'
,
id
:
'深海'
}
,
{
name
:
'极地'
,
id
:
'极地'
}
,
{
name
:
'核'
,
id
:
'核'
}
,
{
name
:
'其他'
,
id
:
'其他'
}
,
])
const
handleSelectArea
=
(
value
)
=>
{
selectedArea
.
value
=
value
}
// 发布时间
const
DatePlaceHolder
=
ref
(
'请选择时间'
)
const
selectedDate
=
ref
(
''
)
const
dateList
=
ref
([
{
name
:
'自定义'
,
id
:
'自定义'
}
,
{
name
:
'近一年'
,
id
:
'近一年'
}
,
{
name
:
'近半年'
,
id
:
'近半年'
}
,
{
name
:
'近三月'
,
id
:
'近三月'
}
,
{
name
:
'近一月'
,
id
:
'近一月'
}
])
const
customTime
=
ref
([])
// 自定义时间
const
handleCustomDate
=
value
=>
{
// console.log('value', value);
customTime
.
value
=
value
}
const
handleSelectDate
=
(
value
)
=>
{
selectedDate
.
value
=
value
if
(
selectedDate
.
value
!==
'自定义'
)
{
customTime
.
value
=
getDateRange
(
selectedDate
.
value
)
}
}
// 发布机构 机构列表
const
institutionList
=
ref
([
{
name
:
'全部机构'
,
id
:
'全部机构'
}
,
{
name
:
'机构1'
,
id
:
'机构1'
}
,
{
name
:
'机构2'
,
id
:
'机构2'
}
,
{
name
:
'机构3'
,
id
:
'机构3'
}
,
])
const
selectedIns
=
ref
(
'全部机构'
)
const
insPlaceHolder
=
ref
(
'请选择机构'
)
const
handleSelectIns
=
value
=>
{
selectedIns
.
value
=
value
}
// 政令类型
const
decreeTypeList
=
ref
([
{
name
:
'全部类型'
,
id
:
'全部类型'
}
,
{
name
:
'行政命令'
,
id
:
'行政命令'
}
,
{
name
:
'备忘录'
,
id
:
'备忘录'
}
])
const
selectedDecreeType
=
ref
(
'全部类型'
)
const
decreeTypePlaceHolder
=
ref
(
'请选择议院'
)
const
handleSelectDecreeType
=
value
=>
{
selectedDecreeType
.
value
=
value
}
// 是否涉华
const
isInvolveCn
=
ref
(
false
)
const
handleInvolveCnChange
=
()
=>
{
}
// 是否科技相关
const
isInvolveTechnology
=
ref
(
false
)
// 清空条件
const
handleClear
=
()
=>
{
selectedArea
.
value
=
'全部领域'
selectedDate
.
value
=
''
selectedIns
.
value
=
'全部机构'
selectedDecreeType
.
value
=
'全部类型'
isInvolveCn
.
value
=
false
ElMessage
.
success
(
'已清空条件!'
)
}
// 确定
const
handleConfirm
=
()
=>
{
fetchTableData
()
}
// 展开全部 / 收起
const
isFolderAll
=
ref
(
false
)
const
handleSwitchFolderAll
=
()
=>
{
isFolderAll
.
value
=
!
isFolderAll
.
value
}
const
tableRef
=
ref
(
null
)
// 表格数据
const
tableData
=
ref
([
])
const
releaseTimeList
=
ref
([
{
label
:
"按发布时间倒序"
,
value
:
true
}
,
{
label
:
"按发布时间升序"
,
value
:
false
}
]);
const
isSort
=
ref
(
true
);
// true 倒序 false 升序
// const handleSwithSort = () =>
{
// isSort.value = !isSort.value;
//
}
;
const
handlePxChange
=
val
=>
{
fetchTableData
()
}
;
const
currentPage
=
ref
(
1
);
const
pageSize
=
ref
(
10
)
// 存储选中的数据(跨页)[citation:3][citation:8]
const
selectedMap
=
ref
(
new
Map
())
// 使用 Map 存储,key 为唯一 id
// 计算已选中的条数
const
selectedCount
=
computed
(()
=>
selectedMap
.
value
.
size
)
// 获取表格数据(示例)
const
fetchTableData
=
async
()
=>
{
isSelectedAll
.
value
=
false
selectedMap
.
value
.
clear
()
// 调用接口获取数据...
const
params
=
{
page
:
currentPage
.
value
,
size
:
pageSize
.
value
,
keyword
:
''
,
type
:
1
,
// type 1= 法案 2= 政令 3 =智库 4=智库报告 5=实体清单【制裁记录】 6= 人物 7= 机构 8=新闻 9= 社媒
domains
:
selectedArea
.
value
===
'全部领域'
?
null
:
[
selectedArea
.
value
],
proposedDateStart
:
customTime
.
value
[
0
],
proposedDateEnd
:
customTime
.
value
[
1
],
affiliation
:
selectedIns
.
value
===
'全部机构'
?
null
:
selectedIns
.
value
,
originChamber
:
selectedDecreeType
.
value
===
'全部类型'
?
null
:
selectedDecreeType
.
value
,
sleStatus
:
isInvolveCn
?
'Y'
:
'N'
,
sort
:
isSort
.
value
?
0
:
1
// 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序
}
try
{
const
res
=
await
search
(
params
)
console
.
log
(
'搜索结果'
,
res
);
if
(
res
.
code
===
200
&&
res
.
data
)
{
tableData
.
value
=
res
.
data
.
records
totalNum
.
value
=
res
.
data
.
total
staticsDemensionList
.
value
[
0
].
data
=
{
dataX
:
Object
.
keys
(
res
.
data
.
aggregationsDate
),
dataY
:
Object
.
values
(
res
.
data
.
aggregationsDate
).
map
(
value
=>
Number
(
value
))
}
staticsDemensionList
.
value
[
1
].
data
=
Object
.
entries
(
res
.
data
.
aggregationsDomain
).
map
(([
key
,
value
])
=>
({
name
:
key
,
value
:
Number
(
value
)
}
))
staticsDemensionList
.
value
[
2
].
data
=
Object
.
entries
(
res
.
data
.
aggregationsOriginChamber
).
map
(([
key
,
value
])
=>
({
name
:
key
,
value
:
Number
(
value
)
}
))
staticsDemensionList
.
value
[
3
].
data
=
Object
.
entries
(
res
.
data
.
aggregationsOriginDepart
).
map
(([
key
,
value
])
=>
({
name
:
key
,
value
:
Number
(
value
)
}
))
staticsDemensionList
.
value
[
4
].
data
=
Object
.
entries
(
res
.
data
.
aggregationsAffiliation
).
map
(([
key
,
value
])
=>
({
name
:
key
,
value
:
Number
(
value
)
}
))
staticsDemensionList
.
value
[
5
].
data
=
Object
.
entries
(
res
.
data
.
aggregationsStatus
).
map
(([
key
,
value
])
=>
({
name
:
key
===
'1'
?
'通过'
:
'提出'
,
value
:
Number
(
value
)
}
))
}
const
curDemensionItem
=
staticsDemensionList
.
value
.
filter
(
item
=>
{
return
item
.
name
===
curDemension
.
value
}
)[
0
]
setTimeout
(()
=>
{
activeChart
.
value
=
curDemensionItem
.
chartTypeList
[
0
]
curChartData
.
value
=
curDemensionItem
.
data
}
)
}
catch
(
error
)
{
}
// tableData.value = res.data
// total.value = res.total
// 数据加载后,回显已选中的行
nextTick
(()
=>
{
tableData
.
value
.
forEach
(
row
=>
{
if
(
selectedMap
.
value
.
has
(
row
.
id
))
{
tableRef
.
value
?.
toggleRowSelection
(
row
,
true
)
}
}
)
}
)
}
// 单选事件
const
handleSelect
=
(
selection
,
row
)
=>
{
if
(
selection
.
some
(
item
=>
item
.
id
===
row
.
id
))
{
// 选中:添加到 Map
selectedMap
.
value
.
set
(
row
.
id
,
row
)
}
else
{
// 取消选中:从 Map 移除
selectedMap
.
value
.
delete
(
row
.
id
)
}
}
// 全选/全不选事件
const
handleSelectAll
=
(
selection
)
=>
{
if
(
selection
.
length
>
0
)
{
// 全选:将当前页所有数据添加到 Map
tableData
.
value
.
forEach
(
row
=>
{
if
(
!
selectedMap
.
value
.
has
(
row
.
id
))
{
selectedMap
.
value
.
set
(
row
.
id
,
row
)
}
}
)
}
else
{
// 全不选:从 Map 中移除当前页的所有数据
tableData
.
value
.
forEach
(
row
=>
{
selectedMap
.
value
.
delete
(
row
.
id
)
}
)
}
}
// 处理选择变化(用于统计)
const
handleSelectionChange
=
(
val
)
=>
{
// 这里可以做一些额外的处理,但主要统计使用 selectedMap
console
.
log
(
'当前页选中数量:'
,
val
.
length
)
}
// 全选当前页按钮
const
handleSelectAllPage
=
()
=>
{
if
(
tableData
.
value
.
length
===
0
)
return
// 检查当前页是否已全选
const
currentPageSelected
=
tableData
.
value
.
every
(
row
=>
selectedMap
.
value
.
has
(
row
.
id
)
)
if
(
currentPageSelected
)
{
// 已全选,则取消当前页的全选
tableData
.
value
.
forEach
(
row
=>
{
tableRef
.
value
.
toggleRowSelection
(
row
,
false
)
selectedMap
.
value
.
delete
(
row
.
id
)
}
)
}
else
{
// 未全选,则全选当前页
tableData
.
value
.
forEach
(
row
=>
{
tableRef
.
value
.
toggleRowSelection
(
row
,
true
)
if
(
!
selectedMap
.
value
.
has
(
row
.
id
))
{
selectedMap
.
value
.
set
(
row
.
id
,
row
)
}
}
)
}
}
// 处理全选
const
handleSelectAllChange
=
()
=>
{
if
(
isSelectedAll
.
value
)
{
handleSelectAllPage
()
}
else
{
handleClearAll
()
}
// if (isSelectedAll.value)
{
// // 全选:将当前页所有数据添加到 Map
// tableData.value.forEach(row =>
{
// if (!selectedMap.value.has(row.id))
{
// selectedMap.value.set(row.id, row)
//
}
//
}
)
//
}
else
{
// // 全不选:从 Map 中移除当前页的所有数据
// tableData.value.forEach(row =>
{
// selectedMap.value.delete(row.id)
//
}
)
//
}
}
// 清空所有选择
const
handleClearAll
=
()
=>
{
selectedMap
.
value
.
clear
()
tableRef
.
value
?.
clearSelection
()
}
// 翻页
const
handleCurrentChange
=
(
val
)
=>
{
currentPage
.
value
=
val
fetchTableData
()
}
// 监听数据变化,回显选中状态 [citation:4][citation:8]
watch
(
tableData
,
()
=>
{
nextTick
(()
=>
{
tableData
.
value
.
forEach
(
row
=>
{
if
(
selectedMap
.
value
.
has
(
row
.
id
))
{
tableRef
.
value
?.
toggleRowSelection
(
row
,
true
)
}
}
)
}
)
}
)
// 当前图表数据
const
curChartData
=
ref
(
null
)
// 跳转到当前页 初始化筛选条件
const
initParam
=
()
=>
{
const
hasQuery
=
Object
.
keys
(
route
.
query
).
length
>
0
;
if
(
hasQuery
)
{
selectedArea
.
value
=
route
.
query
.
domains
?
route
.
query
.
domains
:
'全部领域'
if
(
Array
.
isArray
(
JSON
.
parse
(
route
.
query
.
selectedDate
))
&&
JSON
.
parse
(
route
.
query
.
selectedDate
).
length
)
{
selectedDate
.
value
=
'自定义'
customTime
.
value
=
JSON
.
parse
(
route
.
query
.
selectedDate
)
}
isInvolveCn
.
value
=
route
.
query
.
isInvolveCn
?
true
:
false
selectedDecreeType
.
value
=
route
.
query
.
selectedDecreeType
?
route
.
query
.
selectedDecreeType
:
'全部类型'
const
query
=
route
.
query
;
if
(
Object
.
keys
(
query
).
length
>
0
)
{
sessionStorage
.
setItem
(
'routeQuery'
,
JSON
.
stringify
(
query
));
}
}
else
{
const
savedQuery
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'routeQuery'
)
||
'{
}
'
);
selectedArea
.
value
=
savedQuery
.
domains
?
savedQuery
.
domains
:
'全部领域'
if
(
Array
.
isArray
(
JSON
.
parse
(
savedQuery
.
selectedDate
))
&&
JSON
.
parse
(
savedQuery
.
selectedDate
).
length
)
{
selectedDate
.
value
=
'自定义'
customTime
.
value
=
JSON
.
parse
(
savedQuery
.
selectedDate
)
}
isInvolveCn
.
value
=
savedQuery
.
isInvolveCn
?
true
:
false
selectedDecreeType
.
value
=
savedQuery
.
selectedDecreeType
?
savedQuery
.
selectedDecreeType
:
'全部类型'
}
}
// 跳转法案详情
const
handleClickToDetail
=
(
curBill
)
=>
{
console
.
log
(
'curBill'
,
curBill
);
window
.
sessionStorage
.
setItem
(
"billId"
,
curBill
.
id
);
window
.
sessionStorage
.
setItem
(
"curTabName"
,
curBill
.
title
);
const
route
=
router
.
resolve
({
path
:
"/billLayout"
,
query
:
{
billId
:
curBill
.
id
}
}
);
window
.
open
(
route
.
href
,
"_blank"
);
}
;
// 跳转人物详情
const
handlePerClick
=
item
=>
{
window
.
sessionStorage
.
setItem
(
"curTabName"
,
item
.
sponsorPersonName
);
const
route
=
router
.
resolve
({
path
:
"/characterPage"
,
query
:
{
type
:
2
,
personId
:
item
.
personId
}
}
);
window
.
open
(
route
.
href
,
"_blank"
);
}
;
// 导出
const
handleExport
=
()
=>
{
console
.
log
(
selectedMap
.
value
);
const
arr
=
Array
.
from
(
selectedMap
.
value
);
const
jsonStr
=
JSON
.
stringify
(
arr
,
null
,
2
);
const
blob
=
new
Blob
([
jsonStr
],
{
type
:
'application/json'
}
);
const
url
=
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
link
.
href
=
url
;
link
.
download
=
'export.json'
;
link
.
click
();
URL
.
revokeObjectURL
(
url
);
}
;
onMounted
(
async
()
=>
{
handleGetOrgList
()
handleGetMemberList
()
initParam
()
// 初始化
await
fetchTableData
()
}
)
<
/script
>
...
...
@@ -35,6 +879,8 @@ const totalNum = ref(12)
.
countrybill
-
wrapper
{
width
:
1600
px
;
height
:
968
px
;
overflow
:
hidden
;
overflow
-
y
:
auto
;
.
headere
-
box
{
width
:
1568
px
;
...
...
@@ -44,19 +890,53 @@ const totalNum = ref(12)
border
:
1
px
solid
var
(
--
bg
-
black
-
5
);
margin
:
16
px
auto
;
}
.
header
-
box
{
width
:
1568
px
;
height
:
112
px
;
min
-
height
:
112
px
;
border
-
radius
:
10
px
;
background
:
rgb
(
255
,
255
,
255
);
border
:
1
px
solid
var
(
--
bg
-
black
-
5
);
margin
:
16
px
auto
;
box
-
sizing
:
border
-
box
;
padding
:
16
px
24
px
;
.
header
-
top
{
min
-
height
:
28
px
;
display
:
flex
;
flex
-
wrap
:
wrap
;
gap
:
12
px
42
px
;
// transition: all ease 1s;
.
check
-
box
{
display
:
flex
;
width
:
348
px
;
height
:
28
px
;
align
-
items
:
center
;
gap
:
8
px
;
.
check
-
box
-
left
{
width
:
100
px
;
color
:
var
(
--
text
-
primary
-
65
-
color
);
}
}
}
.
main
-
box
{
.
header
-
footer
{
margin
-
top
:
16
px
;
display
:
flex
;
justify
-
content
:
space
-
between
;
.
header
-
footer
-
left
{
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
8
px
;
}
}
}
.
chart
-
main
-
box
{
.
info
-
box
{
margin
:
0
auto
;
width
:
1568
px
;
...
...
@@ -90,7 +970,172 @@ const totalNum = ref(12)
border
-
radius
:
10
px
;
background
:
rgba
(
255
,
255
,
255
);
border
:
1
px
solid
var
(
--
bg
-
black
-
5
);
.
content
-
header
{
margin
:
16
px
24
px
;
width
:
1520
px
;
height
:
28
px
;
}
.
content
-
main
{
width
:
1520
px
;
margin
:
0
auto
;
}
}
}
.
data
-
main
-
box
{
width
:
1568
px
;
height
:
810
px
;
border
-
radius
:
10
px
;
background
:
var
(
--
bg
-
white
-
100
);
margin
:
0
auto
;
overflow
:
hidden
;
.
data
-
main
-
box
-
header
{
margin
:
16
px
auto
;
width
:
1520
px
;
height
:
30
px
;
display
:
flex
;
justify
-
content
:
space
-
between
;
.
switch
-
box
{
width
:
160
px
;
border
-
radius
:
20
px
;
border
:
1
px
solid
var
(
--
color
-
primary
-
100
);
height
:
30
px
;
cursor
:
pointer
;
img
{
width
:
100
%
;
height
:
100
%
;
}
}
.
num
-
box
{
box
-
sizing
:
border
-
box
;
padding
:
2
px
0
;
color
:
var
(
--
color
-
red
-
100
);
}
}
.
data
-
main
-
box
-
main
{
width
:
1520
px
;
// height: 633px;
height
:
680
px
;
border
-
radius
:
10
px
;
border
:
1
px
solid
var
(
--
bg
-
black
-
5
);
margin
:
0
auto
;
.
data
-
main
-
box
-
main
-
header
{
height
:
48
px
;
background
:
var
(
--
bg
-
black
-
2
);
display
:
flex
;
justify
-
content
:
space
-
between
;
.
header
-
left
{
margin
-
left
:
16
px
;
height
:
48
px
;
display
:
flex
;
gap
:
16
px
;
align
-
items
:
center
;
.
header
-
left
-
item2
{
color
:
var
(
--
color
-
primary
-
100
);
}
.
cancel
{
cursor
:
pointer
;
}
}
.
header
-
right
{
margin
-
right
:
16
px
;
display
:
flex
;
gap
:
8
px
;
align
-
items
:
center
;
.
header
-
right
-
item
{
height
:
30
px
;
padding
:
5
px
16
px
;
border
:
1
px
solid
var
(
--
bg
-
black
-
10
);
border
-
radius
:
4
px
;
background
:
var
(
--
bg
-
white
-
100
);
cursor
:
pointer
;
}
.
item1
{
display
:
flex
;
gap
:
2
px
;
justify
-
content
:
center
;
align
-
items
:
center
;
&
:
hover
{
background
:
var
(
--
color
-
primary
-
2
);
}
.
icon
{
width
:
16
px
;
height
:
16
px
;
img
{
width
:
100
%
;
height
:
100
%
;
}
}
.
text
{
color
:
var
(
--
text
-
primary
-
65
-
color
);
}
}
.
item2
{
}
.
item3
{
}
}
}
.
data
-
main
-
box
-
main
-
content
{
}
}
.
data
-
main
-
box
-
footer
{
margin
:
16
px
auto
0
;
height
:
40
px
;
width
:
1520
px
;
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
flex
-
end
;
}
}
}
.
date
-
column
{
background
-
color
:
#
ecf5ff
;
}
.
date
-
column
.
cell
{
color
:
#
409
eff
!
important
;
font
-
weight
:
500
;
}
.
title
-
item
{
color
:
var
(
--
text
-
primary
-
80
-
color
);
cursor
:
pointer
;
&
:
hover
{
color
:
var
(
--
color
-
primary
-
100
);
text
-
decoration
:
underline
;
}
}
.
person
-
item
{
color
:
var
(
--
color
-
primary
-
100
);
cursor
:
pointer
;
&
:
hover
{
font
-
weight
:
bold
;
text
-
decoration
:
underline
;
}
}
<
/style>
\ No newline at end of file
src/views/dataLibrary/index.vue
浏览文件 @
05beb3ae
...
...
@@ -478,12 +478,13 @@ const handleClickToolBox = () => {
onMounted
(()
=>
{
const
path
=
route
.
path
console
.
log
(
decodeURI
(
route
.
fullPath
));
switch
(
path
)
{
case
'/dataLibrary/countryBill'
:
siderList
.
value
[
0
].
active
=
true
siderList
.
value
[
0
].
isExpanded
=
true
siderList
.
value
[
0
].
children
[
0
].
active
=
true
break
case
'/dataLibrary/stateBill'
:
siderList
.
value
[
0
].
active
=
true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论