Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
2c66e151
提交
2c66e151
authored
4月 02, 2026
作者:
张伊明
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'zym-dev' 到 'pre'
feat 重构法案界面样式 查看合并请求
!300
上级
a28ac5be
bf2b68ca
流水线
#307
已通过 于阶段
in 4 分 9 秒
变更
13
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
849 行增加
和
262 行删除
+849
-262
bill-tokens.scss
src/styles/bill-tokens.scss
+35
-0
BILL_LAYOUT_UNIFICATION_PLAN.md
src/views/bill/BILL_LAYOUT_UNIFICATION_PLAN.md
+201
-0
index.vue
src/views/bill/background/index.vue
+127
-101
BillHeader.vue
src/views/bill/billLayout/components/BillHeader.vue
+6
-4
index.vue
src/views/bill/billLayout/index.vue
+34
-5
BillPageShell.vue
src/views/bill/components/layout/BillPageShell.vue
+51
-0
BillPanel.vue
src/views/bill/components/layout/BillPanel.vue
+117
-0
BillTwoColumn.vue
src/views/bill/components/layout/BillTwoColumn.vue
+108
-0
index.js
src/views/bill/components/layout/index.js
+9
-0
index.vue
src/views/bill/deepDig/processAnalysis/index.vue
+9
-6
index.vue
src/views/bill/deepDig/processOverview/index.vue
+6
-11
index.vue
src/views/bill/introdoction/index.vue
+25
-14
index.vue
src/views/bill/template/index.vue
+121
-121
没有找到文件。
src/styles/bill-tokens.scss
0 → 100644
浏览文件 @
2c66e151
// Bill layout & visual tokens
// 统一用于 bill 板块布局改造,后续可并入全局设计变量体系
// spacing
$bill-space-8
:
8px
;
$bill-space-12
:
12px
;
$bill-space-16
:
16px
;
$bill-space-24
:
24px
;
$bill-space-30
:
30px
;
// layout
$bill-column-gap
:
16px
;
$bill-left-column-width
:
1064px
;
$bill-right-column-width
:
520px
;
// typography
$bill-title-font-size
:
16px
;
$bill-title-font-weight
:
600
;
$bill-body-font-size
:
14px
;
$bill-body-font-weight
:
400
;
// surface
$bill-panel-radius
:
8px
;
$bill-panel-border-color
:
#e8ecf3
;
$bill-panel-shadow
:
0
2px
8px
rgba
(
15
,
35
,
95
,
0
.06
);
$bill-panel-bg
:
#ffffff
;
// text & color
$bill-text-primary
:
#1f2a44
;
$bill-text-secondary
:
#5b6b88
;
$bill-text-muted
:
#8b97ad
;
$bill-color-accent
:
#2f66ff
;
$bill-color-success
:
#19be6b
;
$bill-color-warning
:
#ff9f43
;
$bill-color-danger
:
#f56c6c
;
src/views/bill/BILL_LAYOUT_UNIFICATION_PLAN.md
0 → 100644
浏览文件 @
2c66e151
# Bill 板块布局统一改造计划
> 目标:统一 `@src/views/bill` 下页面布局与视觉风格,解决“底部 30px 留白不稳定”问题,并沉淀可复用布局组件,便于后续新会话直接接续执行。
## 1. 背景与问题
当前
`bill`
板块存在以下共性问题:
1.
页面布局实现不统一(外层滚动、内层滚动、固定高度混用)。
2.
多数页面为“左右两列 + 多卡片”结构,但容器命名、间距、宽高策略不一致。
3.
`30px`
底部留白在不同页面生效机制不同,容易出现:
-
某页不生效
-
增加占位后挤压布局
-
Header(Tab/操作按钮)受影响
4.
样式硬编码较多(固定宽高、局部 margin/padding),复用性低。
## 2. 总体改造策略
采用“
**分层统一 + 渐进迁移**
”策略,避免一次性大改风险:
-
**第一层:板块承载层统一**
-
统一滚动、内容宽度、底部安全留白机制。
-
**第二层:页面布局骨架统一**
-
抽象“页面壳 + 双列布局 + 卡片容器”组件。
-
**第三层:业务页迁移**
-
先迁移典型页,再批量替换。
## 3. 分阶段计划
### 阶段 A:基线确认与止血(进行中)
-
修复当前试错引入的结构问题(例如模板闭合错误、布局挤压)。
-
保证关键页面可用:
-
`background`
-
`processAnalysis`
-
`introdoction`
### 阶段 B:新增通用布局组件(进行中)
#### 完成备注(2026-04-02)
-
[
x
]
第一步已完成并通过验收:完成布局组件目录与基础文件脚手架
-
`src/views/bill/components/layout/BillPageShell.vue`
-
`src/views/bill/components/layout/BillTwoColumn.vue`
-
`src/views/bill/components/layout/BillPanel.vue`
-
`src/views/bill/components/layout/index.js`
-
[
x
]
第二步已完成并通过验收:实现
`BillPageShell`
滚动容器与底部
`30px`
安全留白机制
-
[
x
]
第三步已完成并通过验收:实现
`BillTwoColumn`
统一双列布局(1064/520 + gap 16 + 响应式堆叠)
-
[
x
]
第四步已完成并通过验收:实现
`BillPanel`
统一卡片结构与基础样式(header/body/footer + 可配置边框/圆角/阴影)
-
[
x
]
第五步已完成并通过验收:
`bill-tokens.scss`
接入
`BillPageShell/BillTwoColumn/BillPanel`
并替换关键样式硬编码
-
[
x
]
第六步已完成并通过验收:试点页
`background/index.vue`
已迁移到统一布局骨架(
`BillPageShell + BillTwoColumn`
)
-
[
x
]
第六步修正项(验收反馈已落实):
-
修正 1:移除
`.right-panel`
的
`margin-left/margin-right`
,避免右列偏移与原样式不一致
-
修正 2:
`BillPageShell`
不再使用内部滚动容器;页面滚动回到外层
`layout-main`
,确保 Header 与内容一起滚动
-
[
x
]
第七步已完成并通过验收:
`introdoction/index.vue`
迁移到统一布局骨架(
`BillPageShell + BillTwoColumn`
)
-
[
x
]
第七步修正项(验收反馈已落实):
-
修正 1:移除
`.introduction-wrap-right`
的
`margin-left/margin-right`
,消除右列偏移
-
修正 2:在
`.introduction-wrap-content`
增加
`margin-bottom: 30px`
,确保外层滚动时可见底部留白
-
[
x
]
第八步已完成并通过验收:
`template/index.vue`
迁移到统一布局骨架(
`BillPageShell + BillTwoColumn`
)
-
[
x
]
第八步注意点(已沉淀):
-
删除
`page-bottom-gap`
占位节点,避免与统一留白策略重复
-
在双列容器
`.content-row`
增加
`margin-bottom: 30px`
,适配“外层
`layout-main`
滚动”模式
-
迁移后需检查未使用变量并清理,避免 lint 噪音影响后续页面迁移
-
[
x
]
第九步已完成并通过验收:
`deepDig/processOverview/index.vue`
迁移到统一页面壳(
`BillPageShell`
)
-
[
x
]
第九步注意点(已沉淀):
-
保留页面内部横向滚动容器(
`.main`
),仅替换页面根壳,避免时间轴布局回归风险
-
删除
`page-bottom-gap`
,改用页面容器底部留白(
`margin-bottom: 30px`
)适配外层滚动
-
[
x
]
第十步已完成并通过验收:
`deepDig/processAnalysis/index.vue`
迁移到统一页面壳(
`BillPageShell`
)
-
[
x
]
第十步注意点(已沉淀):
-
保持原双列业务结构与内部滚动策略不变,仅替换页面根壳
-
页面底部留白统一为容器
`margin-bottom: 30px`
,与外层
`layout-main`
滚动机制一致
新增组件建议放在:
`src/views/bill/components/layout/`
#### 计划新增组件索引
1.
`src/views/bill/components/layout/BillPageShell.vue`
-
作用:统一页面根容器、内容区、底部留白(30px)机制。
2.
`src/views/bill/components/layout/BillTwoColumn.vue`
-
作用:统一左右列布局(默认 1064 / 520)、列间距、响应式策略。
3.
`src/views/bill/components/layout/BillPanel.vue`
-
作用:统一卡片容器(header/body/footer)结构、间距、基础样式。
4.
`src/views/bill/components/layout/index.js`
-
作用:导出布局组件,便于页面统一引入。
> 可选(后续):
> - `BillPanelGroup.vue`(同列多卡片统一间距)
> - `BillPageSection.vue`(统一页面内 section 标题与辅助动作区)
### 阶段 C:样式 Token 统一(计划)
新增:
`src/styles/bill-tokens.scss`
(或接入现有变量体系)
-
间距:
`8/12/16/24/30`
-
列间距:
`16`
-
标题字号/字重
-
卡片边框、阴影、圆角
-
统一颜色 token(主文字、次文字、强调色)
### 阶段 D:页面迁移(计划)
按“先典型、后批量”执行:
1.
试点页(先迁移)
-
`background/index.vue`
(典型双列 + 卡片 + 多交互)
2.
法案概况组
-
`introdoction/index.vue`
-
`template/index.vue`
-
`background/index.vue`
3.
深度挖掘组
-
`deepDig/processOverview/index.vue`
-
`deepDig/processAnalysis/index.vue`
-
`deepDig/poliContribution/index.vue`
4.
影响分析组
-
`influence/industry/index.vue`
-
`influence/scientificResearch/index.vue`
-
`influence/index.vue`
(承载层)
### 阶段 E:收口与回归(计划)
-
清理临时样式补丁(历史试错
`gap/margin-bottom`
等)。
-
回归检查:
1.
所有页面底部留白可见
2.
无横向滚动条
3.
Header 不丢失
4.
双列不挤压
## 4. 现有页面索引(改造范围)
### 4.1 板块承载与导航层
-
`src/views/bill/billLayout/index.vue`
-
`src/views/bill/billLayout/components/BillHeader.vue`
-
`src/views/bill/index.vue`
-
`src/views/bill/deepDig/index.vue`
-
`src/views/bill/influence/index.vue`
### 4.2 法案概况(Bill)
-
`src/views/bill/introdoction/index.vue`
-
`src/views/bill/background/index.vue`
-
`src/views/bill/template/index.vue`
-
`src/views/bill/billOriginalText/index.vue`
### 4.3 深度挖掘(DeepDig)
-
`src/views/bill/deepDig/processOverview/index.vue`
-
`src/views/bill/deepDig/processAnalysis/index.vue`
-
`src/views/bill/deepDig/poliContribution/index.vue`
### 4.4 影响分析(Influence)
-
`src/views/bill/influence/industry/index.vue`
-
`src/views/bill/influence/scientificResearch/index.vue`
-
`src/views/bill/influence/ProgressForecast/index.vue`
### 4.5 其他相关页面
-
`src/views/bill/relevantCircumstance/index.vue`
-
`src/views/bill/versionCompare/index.vue`
-
`src/views/bill/billHome/index.vue`
## 5. 迁移原则(执行时必须遵守)
1.
不改变业务逻辑(API、状态、路由行为)
2.
先替换布局骨架,再替换样式细节
3.
每次只迁移少量页面,保证可回滚
4.
对“固定高度 + 内部滚动”页面优先保守改造
5.
若页面是横向 flex 主体,禁止直接插入会改变横向布局的占位节点
## 6. 验收标准
1.
`@bill`
目标页面滚动到底统一可见
`30px`
留白
2.
页面核心布局(左右列、卡片)不变形
3.
`BillHeader`
的 Tab 与功能按钮稳定显示
4.
不新增横向滚动条
5.
关键路由刷新后视觉一致
## 7. 新会话接续建议
新会话可直接按以下顺序继续:
1.
先读取本文件:
-
`src/views/bill/BILL_LAYOUT_UNIFICATION_PLAN.md`
2.
先完成组件脚手架:
-
`BillPageShell.vue`
-
`BillTwoColumn.vue`
-
`BillPanel.vue`
3.
首个迁移页:
-
`src/views/bill/background/index.vue`
4.
迁移完成后逐页扩展到
`introdoction/template/processOverview/processAnalysis`
---
最后更新:2026-04-02
src/views/bill/background/index.vue
浏览文件 @
2c66e151
<
template
>
<div
class=
"background-wrap"
>
<div
class=
"background-wrap-left"
>
<AnalysisBox
class=
"left-box left-box--background"
title=
"立法背景"
:showAllBtn=
"false"
:devTip=
"true"
>
<template
#
header-btn
>
<div
class=
"header-btn-box"
>
<el-button
:type=
"box1Btn1Type"
plain
@
click=
"handleClickBox1Btn(1)"
>
涉华背景
</el-button>
<el-button
:type=
"box1Btn2Type"
plain
@
click=
"handleClickBox1Btn(2)"
>
全部背景
</el-button>
</div>
</
template
>
<div
class=
"box1-main"
v-loading=
"backgroundLoading"
>
<div
class=
"box1-main-center"
>
<div
class=
"box1-main-item"
v-for=
"item in backgroundDisplayList"
:key=
"item.id"
>
<div
class=
"id"
>
{{ item.displayIndex }}
</div>
<div
class=
"title"
>
{{ item.backgroundTitle }}
</div>
<div
class=
"share"
>
<img
src=
"./assets/icons/open.png"
alt=
"打开"
/>
<BillPageShell
class=
"background-page"
>
<BillTwoColumn
class=
"background-content"
:stack-on-narrow=
"false"
>
<template
#
left
>
<div
class=
"background-wrap-left"
>
<AnalysisBox
class=
"left-box left-box--background"
title=
"立法背景"
:showAllBtn=
"false"
:devTip=
"true"
>
<template
#
header-btn
>
<div
class=
"header-btn-box"
>
<el-button
:type=
"box1Btn1Type"
plain
@
click=
"handleClickBox1Btn(1)"
>
涉华背景
</el-button>
<el-button
:type=
"box1Btn2Type"
plain
@
click=
"handleClickBox1Btn(2)"
>
全部背景
</el-button>
</div>
</
template
>
<div
class=
"box1-main"
v-loading=
"backgroundLoading"
>
<div
class=
"box1-main-center"
>
<div
class=
"box1-main-item"
v-for=
"item in backgroundDisplayList"
:key=
"item.id"
>
<div
class=
"id"
>
{{ item.displayIndex }}
</div>
<div
class=
"title"
>
{{ item.backgroundTitle }}
</div>
<div
class=
"share"
>
<img
src=
"./assets/icons/open.png"
alt=
"打开"
/>
</div>
</div>
</div>
<div
class=
"box1-main-footer"
>
<div
class=
"info"
>
{{ totalText }}
</div>
<el-pagination
background
layout=
"prev, pager, next"
:total=
"total"
v-model:current-page=
"currentPage"
@
current-change=
"handleGetBillBackground"
/>
</div>
</div>
</div>
<div
class=
"box1-main-footer"
>
<div
class=
"info"
>
{{ totalText }}
</div>
<el-pagination
background
layout=
"prev, pager, next"
:total=
"total"
v-model:current-page=
"currentPage"
@
current-change=
"handleGetBillBackground"
/>
</div>
</div>
</AnalysisBox>
</AnalysisBox>
<AnalysisBox
class=
"left-box left-box--event"
title=
"相关事件"
:showAllBtn=
"false"
:devTip=
"true"
>
<div
class=
"box2-main"
>
<div
class=
"box2-main-item"
v-for=
"item in eventDisplayList"
:key=
"item.id"
@
click=
"handleClickEvent(item)"
>
<div
class=
"left"
>
<img
:src=
"item.imgSrc"
@
error=
"handleNewsImgError"
alt=
""
/>
</div>
<div
class=
"center"
>
<CommonPrompt
:content=
"item.sjbt"
>
<div
class=
"title"
>
{{ item.sjbt }}
</div>
</CommonPrompt>
<CommonPrompt
:content=
"item.sjnr"
>
<div
class=
"content"
>
{{ item.sjnr }}
</div>
</CommonPrompt>
<AnalysisBox
class=
"left-box left-box--event"
title=
"相关事件"
:showAllBtn=
"false"
:devTip=
"true"
>
<div
class=
"box2-main"
>
<div
class=
"box2-main-item"
v-for=
"item in eventDisplayList"
:key=
"item.id"
@
click=
"handleClickEvent(item)"
>
<div
class=
"left"
>
<img
:src=
"item.imgSrc"
@
error=
"handleNewsImgError"
alt=
""
/>
</div>
<div
class=
"center"
>
<CommonPrompt
:content=
"item.sjbt"
>
<div
class=
"title"
>
{{ item.sjbt }}
</div>
</CommonPrompt>
<CommonPrompt
:content=
"item.sjnr"
>
<div
class=
"content"
>
{{ item.sjnr }}
</div>
</CommonPrompt>
</div>
<div
class=
"right"
>
{{ item.sjsj }}
</div>
</div>
</div>
<div
class=
"right"
>
{{ item.sjsj }}
</div>
</div>
</div>
</AnalysisBox>
</div>
<AnalysisBox
class=
"right-panel"
title=
"议员相关性分析"
:showAllBtn=
"false"
:devTip=
"true"
>
<
template
#
header-btn
>
<div
class=
"header-btn-box"
>
<el-button
:type=
"box2Btn1Type"
plain
@
click=
"handleClickBox2Btn(1)"
>
赞成议员
</el-button>
<el-button
:type=
"box2Btn2Type"
plain
@
click=
"handleClickBox2Btn(2)"
>
反对议员
</el-button>
</AnalysisBox>
</div>
</template>
<div
class=
"background-wrap-right-main"
>
<div
class=
"right-box1"
>
<div
class=
"right-box1-main-top"
>
<el-icon
class=
"nav-icon"
size=
"20"
:color=
"prevIconColor"
@
click=
"handlePrev"
>
<CaretLeft
/>
</el-icon>
<div
class=
"user-list-container"
>
<div
class=
"user-list-wrapper"
:style=
"userListWrapperStyle"
>
<div
class=
"user-box"
v-for=
"item in personList"
:key=
"item.id"
@
click=
"handleClickUser(item)"
>
<div
class=
"img-box"
>
<img
:src=
"item.image"
alt=
""
/>
<div
class=
"icon1"
>
<img
:src=
"item.icon"
alt=
""
/>
</div>
<div
class=
"icon2"
>
<img
:src=
"item.icon1"
alt=
""
/>
<
template
#
right
>
<AnalysisBox
class=
"right-panel"
title=
"议员相关性分析"
:showAllBtn=
"false"
:devTip=
"true"
>
<template
#
header-btn
>
<div
class=
"header-btn-box"
>
<el-button
:type=
"box2Btn1Type"
plain
@
click=
"handleClickBox2Btn(1)"
>
赞成议员
</el-button>
<el-button
:type=
"box2Btn2Type"
plain
@
click=
"handleClickBox2Btn(2)"
>
反对议员
</el-button>
</div>
</
template
>
<div
class=
"background-wrap-right-main"
>
<div
class=
"right-box1"
>
<div
class=
"right-box1-main-top"
>
<el-icon
class=
"nav-icon"
size=
"20"
:color=
"prevIconColor"
@
click=
"handlePrev"
>
<CaretLeft
/>
</el-icon>
<div
class=
"user-list-container"
>
<div
class=
"user-list-wrapper"
:style=
"userListWrapperStyle"
>
<div
class=
"user-box"
v-for=
"item in personList"
:key=
"item.id"
@
click=
"handleClickUser(item)"
>
<div
class=
"img-box"
>
<img
:src=
"item.image"
alt=
""
/>
<div
class=
"icon1"
>
<img
:src=
"item.icon"
alt=
""
/>
</div>
<div
class=
"icon2"
>
<img
:src=
"item.icon1"
alt=
""
/>
</div>
</div>
<CommonPrompt
:content=
"item.name"
>
<div
class=
"name"
>
{{ item.name }}
</div>
</CommonPrompt>
</div>
</div>
<CommonPrompt
:content=
"item.name"
>
<div
class=
"name"
>
{{ item.name }}
</div>
</CommonPrompt>
</div>
<el-icon
class=
"nav-icon"
size=
"20"
:color=
"nextIconColor"
@
click=
"handleNext"
>
<CaretRight
/>
</el-icon>
</div>
<div
class=
"right-box1-main-bottom"
>
<WordCloudMap
:data=
"wordCloudData"
:selectedName=
"selectedIndustryName"
shape=
"circle"
@
wordClick=
"handleWordClick"
/>
</div>
</div>
<el-icon
class=
"nav-icon"
size=
"20"
:color=
"nextIconColor"
@
click=
"handleNext"
>
<CaretRight
/>
</el-icon>
</div>
<div
class=
"right-box1-main-bottom"
>
<WordCloudMap
:data=
"wordCloudData"
:selectedName=
"selectedIndustryName"
shape=
"circle"
@
wordClick=
"handleWordClick"
/>
</div>
</div>
<div
class=
"right-box2"
>
<div
class=
"right-box2-header"
>
<div
class=
"title"
>
<span
class=
"title-active"
>
"{{ selectedIndustryName }}"
</span>
涉及议员动态 >
</div>
</div>
<div
class=
"right-box2-center"
>
<div
class=
"user-box"
v-for=
"item in aboutUserList"
:key=
"item.id"
@
click=
"handleClickUser(item)"
>
<div
class=
"user-left"
>
<div
class=
"img-box"
>
<img
:src=
"item.img"
alt=
""
/>
<div
class=
"right-box2"
>
<div
class=
"right-box2-header"
>
<div
class=
"title"
>
<span
class=
"title-active"
>
"{{ selectedIndustryName }}"
</span>
涉及议员动态 >
</div>
</div>
<div
class=
"user-right"
>
<div
class=
"name"
>
{{ item.name }}
</div>
<CommonPrompt
:content=
"item.content"
>
<div
class=
"content"
>
{{ item.content }}
</div>
</CommonPrompt>
<div
class=
"right-box2-center"
>
<div
class=
"user-box"
v-for=
"item in aboutUserList"
:key=
"item.id"
@
click=
"handleClickUser(item)"
>
<div
class=
"user-left"
>
<div
class=
"img-box"
>
<img
:src=
"item.img"
alt=
""
/>
</div>
</div>
<div
class=
"user-right"
>
<div
class=
"name"
>
{{ item.name }}
</div>
<CommonPrompt
:content=
"item.content"
>
<div
class=
"content"
>
{{ item.content }}
</div>
</CommonPrompt>
</div>
</div>
</div>
</div>
</div>
</
div
>
</
div
>
</
AnalysisBox
>
</
div
>
</
AnalysisBox
>
</
template
>
</
BillTwoColumn
>
</
BillPageShell
>
</template>
<
script
setup
>
...
...
@@ -119,6 +130,7 @@ import { computed, onMounted, ref } from "vue";
import
{
useRoute
,
useRouter
}
from
"vue-router"
;
import
WordCloudMap
from
"./WordCloudMap.vue"
;
import
CommonPrompt
from
"../commonPrompt/index.vue"
;
import
{
BillPageShell
,
BillTwoColumn
}
from
"../components/layout"
;
import
userIcon
from
"./assets/icons/user-icon.png"
;
import
userIcon1
from
"./assets/icons/user-icon1.png"
;
import
userIcon2
from
"./assets/icons/user-icon2.png"
;
...
...
@@ -400,16 +412,31 @@ onMounted(() => {
}
}
.background-
wrap
{
.background-
page
{
width
:
100%
;
height
:
100%
;
box-sizing
:
border-box
;
display
:
flex
;
}
.background-content
{
width
:
100%
;
height
:
auto
;
box-sizing
:
border-box
;
align-items
:
flex-start
;
:deep
(
.bill-two-column__left
)
{
width
:
1064px
;
}
:deep
(
.bill-two-column__right
)
{
width
:
520px
;
margin-right
:
18px
;
}
.background-wrap-left
{
width
:
1064px
;
margin-top
:
16px
;
margin-bottom
:
30px
;
.left-box
{
width
:
1064px
;
...
...
@@ -600,9 +627,8 @@ onMounted(() => {
}
}
.right-panel
{
margin-right
:
18px
;
margin-left
:
16px
;
margin-top
:
16px
;
width
:
520px
;
max-height
:
824px
;
...
...
src/views/bill/billLayout/components/BillHeader.vue
浏览文件 @
2c66e151
...
...
@@ -61,7 +61,7 @@
</div>
<div
class=
"right-box-bottom"
v-if=
"showActions"
>
<div
class=
"btn2"
@
click=
"emit('open-analysis', 'forsee')"
>
<div
class=
"btn2"
v-if=
"showForsee"
@
click=
"emit('open-analysis', 'forsee')"
>
<div
class=
"icon"
>
<img
:src=
"btnIconForsee"
alt=
""
/>
</div>
...
...
@@ -108,6 +108,10 @@ const props = defineProps({
showActions
:
{
type
:
Boolean
,
default
:
true
},
showForsee
:
{
type
:
Boolean
,
default
:
true
}
});
...
...
@@ -154,9 +158,7 @@ const emit = defineEmits(["tab-click", "open-analysis"]);
}
.header-main
{
position
:
sticky
;
top
:
0
;
z-index
:
1000
;
position
:
relative
;
width
:
100%
;
background-color
:
#fff
;
box-shadow
:
0px
4px
10px
0px
rgba
(
0
,
0
,
0
,
0
.05
);
...
...
src/views/bill/billLayout/index.vue
浏览文件 @
2c66e151
...
...
@@ -4,7 +4,8 @@
<div
class=
"layout-main"
>
<BillHeader
:billInfo=
"billInfoGlobal"
:defaultLogo=
"USALogo"
:tabs=
"mainHeaderBtnList"
:activeTitle=
"activeTitle"
:showTabs=
"showHeaderTabs"
:showActions=
"showHeaderActions"
@
tab-click=
"handleClickMainHeaderBtn"
@
open-analysis=
"handleAnalysisClick"
/>
:showForsee=
"showForseeAction"
@
tab-click=
"handleClickMainHeaderBtn"
@
open-analysis=
"handleAnalysisClick"
/>
<div
class=
"layout-main-center"
>
<router-view
/>
...
...
@@ -14,10 +15,10 @@
</
template
>
<
script
setup
>
import
{
ref
,
onMounted
,
watch
}
from
"vue"
;
import
{
ref
,
onMounted
,
watch
,
computed
}
from
"vue"
;
import
router
from
"@/router"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
getBillInfoGlobal
}
from
"@/api/bill"
;
import
{
getBillInfoGlobal
,
getBillInfo
}
from
"@/api/bill"
;
import
BillHeader
from
"./components/BillHeader.vue"
;
const
route
=
useRoute
();
...
...
@@ -77,6 +78,25 @@ const activeTitle = ref("法案概况");
const
showHeaderTabs
=
ref
(
true
);
const
showHeaderActions
=
ref
(
true
);
const
billBasicInfo
=
ref
({});
const
getBillBasicInfoFn
=
async
()
=>
{
const
billId
=
route
.
query
.
billId
;
if
(
!
billId
)
return
;
try
{
const
res
=
await
getBillInfo
({
id
:
billId
});
billBasicInfo
.
value
=
res
?.
data
||
{};
}
catch
(
error
)
{
console
.
error
(
error
);
billBasicInfo
.
value
=
{};
}
};
const
showForseeAction
=
computed
(()
=>
{
const
stageList
=
Array
.
isArray
(
billBasicInfo
.
value
?.
stageList
)
?
billBasicInfo
.
value
.
stageList
:
[];
const
latestStage
=
stageList
.
length
?
String
(
stageList
[
stageList
.
length
-
1
]
||
""
).
trim
()
:
""
;
return
!
latestStage
.
includes
(
"完成立法"
);
});
const
getActiveTitleByRoutePath
=
path
=>
{
if
(
path
.
startsWith
(
"/billLayout/deepDig"
))
return
"深度挖掘"
;
if
(
path
.
startsWith
(
"/billLayout/influence"
))
return
"影响分析"
;
...
...
@@ -132,6 +152,7 @@ const handleAnalysisClick = analysisType => {
onMounted
(()
=>
{
getBillInfoGlobalFn
();
getBillBasicInfoFn
();
// 以当前路由为准,避免 sessionStorage 造成高亮错乱
syncHeaderStateFromRoute
();
// 兜底:如果未来出现未知路由且有缓存,再用缓存
...
...
@@ -143,6 +164,14 @@ watch(
()
=>
route
.
path
,
()
=>
{
syncHeaderStateFromRoute
();
}
);
watch
(
()
=>
route
.
query
.
billId
,
()
=>
{
getBillInfoGlobalFn
();
getBillBasicInfoFn
();
},
{
immediate
:
true
}
);
...
...
@@ -160,12 +189,12 @@ watch(
width
:
100%
;
height
:
100vh
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
.layout-main-center
{
// height: calc(100% - 137px);
width
:
1600px
;
max-width
:
100%
;
margin
:
0
auto
;
padding-bottom
:
20px
;
}
}
}
...
...
src/views/bill/components/layout/BillPageShell.vue
0 → 100644
浏览文件 @
2c66e151
<
template
>
<div
class=
"bill-page-shell"
:class=
"shellClass"
:style=
"shellStyle"
>
<div
class=
"bill-page-shell__content"
:class=
"contentClass"
>
<slot
/>
</div>
</div>
</
template
>
<
script
>
const
BILL_DEFAULT_BOTTOM_SAFE_SPACE
=
30
export
default
{
name
:
'BillPageShell'
,
props
:
{
bottomSafeSpace
:
{
type
:
Number
,
default
:
BILL_DEFAULT_BOTTOM_SAFE_SPACE
},
shellClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
},
contentClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
}
},
computed
:
{
shellStyle
()
{
return
{
paddingBottom
:
`
${
this
.
bottomSafeSpace
}
px`
}
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
@import
'@/styles/bill-tokens.scss'
;
.bill-page-shell
{
width
:
100%
;
min-height
:
0
;
box-sizing
:
border-box
;
}
.bill-page-shell__content
{
width
:
100%
;
color
:
$bill-text-primary
;
}
</
style
>
src/views/bill/components/layout/BillPanel.vue
0 → 100644
浏览文件 @
2c66e151
<
template
>
<section
class=
"bill-panel"
:class=
"panelClass"
:style=
"panelStyle"
>
<header
v-if=
"$slots.header"
class=
"bill-panel__header"
:class=
"headerClass"
:style=
"sectionStyle"
>
<slot
name=
"header"
/>
</header>
<div
class=
"bill-panel__body"
:class=
"bodyClass"
:style=
"sectionStyle"
>
<slot
/>
</div>
<footer
v-if=
"$slots.footer"
class=
"bill-panel__footer"
:class=
"footerClass"
:style=
"sectionStyle"
>
<slot
name=
"footer"
/>
</footer>
</section>
</
template
>
<
script
>
const
BILL_DEFAULT_PANEL_PADDING
=
16
const
BILL_DEFAULT_PANEL_RADIUS
=
8
export
default
{
name
:
'BillPanel'
,
props
:
{
panelClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
},
headerClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
},
bodyClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
},
footerClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
},
padding
:
{
type
:
Number
,
default
:
BILL_DEFAULT_PANEL_PADDING
},
borderRadius
:
{
type
:
Number
,
default
:
BILL_DEFAULT_PANEL_RADIUS
},
bordered
:
{
type
:
Boolean
,
default
:
true
},
shadow
:
{
type
:
Boolean
,
default
:
false
},
background
:
{
type
:
String
,
default
:
'#fff'
}
},
computed
:
{
panelStyle
()
{
return
{
background
:
this
.
background
,
borderRadius
:
`
${
this
.
borderRadius
}
px`
,
border
:
this
.
bordered
?
'1px solid #e8ecf3'
:
'none'
,
boxShadow
:
this
.
shadow
?
'0 2px 8px rgba(15, 35, 95, 0.06)'
:
'none'
}
},
sectionStyle
()
{
return
{
padding
:
`
${
this
.
padding
}
px`
}
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
@import
'@/styles/bill-tokens.scss'
;
.bill-panel
{
width
:
100%
;
box-sizing
:
border-box
;
color
:
$bill-text-primary
;
}
.bill-panel__header
,
.bill-panel__body
,
.bill-panel__footer
{
width
:
100%
;
box-sizing
:
border-box
;
}
.bill-panel__header
{
padding-bottom
:
$bill-space-12
;
}
.bill-panel__footer
{
padding-top
:
$bill-space-12
;
}
.bill-panel__header
:empty
,
.bill-panel__footer
:empty
{
display
:
none
;
}
</
style
>
src/views/bill/components/layout/BillTwoColumn.vue
0 → 100644
浏览文件 @
2c66e151
<
template
>
<div
class=
"bill-two-column"
:class=
"wrapperClass"
:style=
"wrapperStyle"
>
<div
class=
"bill-two-column__left"
:style=
"leftStyle"
>
<slot
name=
"left"
/>
</div>
<div
class=
"bill-two-column__right"
:style=
"rightStyle"
>
<slot
name=
"right"
/>
</div>
</div>
</
template
>
<
script
>
const
BILL_DEFAULT_LEFT_WIDTH
=
1064
const
BILL_DEFAULT_RIGHT_WIDTH
=
520
const
BILL_DEFAULT_COLUMN_GAP
=
16
const
BILL_DEFAULT_MIN_STACK_WIDTH
=
1660
export
default
{
name
:
'BillTwoColumn'
,
props
:
{
leftWidth
:
{
type
:
Number
,
default
:
BILL_DEFAULT_LEFT_WIDTH
},
rightWidth
:
{
type
:
Number
,
default
:
BILL_DEFAULT_RIGHT_WIDTH
},
gap
:
{
type
:
Number
,
default
:
BILL_DEFAULT_COLUMN_GAP
},
minStackWidth
:
{
type
:
Number
,
default
:
BILL_DEFAULT_MIN_STACK_WIDTH
},
stackOnNarrow
:
{
type
:
Boolean
,
default
:
true
},
wrapperClass
:
{
type
:
[
String
,
Array
,
Object
],
default
:
''
}
},
computed
:
{
shouldStack
()
{
if
(
!
this
.
stackOnNarrow
||
typeof
window
===
'undefined'
)
{
return
false
}
return
window
.
innerWidth
<
this
.
minStackWidth
},
wrapperStyle
()
{
if
(
this
.
shouldStack
)
{
return
{
display
:
'flex'
,
flexDirection
:
'column'
,
gap
:
`
${
this
.
gap
}
px`
}
}
return
{
display
:
'grid'
,
gridTemplateColumns
:
`
${
this
.
leftWidth
}
px
${
this
.
rightWidth
}
px`
,
columnGap
:
`
${
this
.
gap
}
px`
,
alignItems
:
'start'
}
},
leftStyle
()
{
if
(
this
.
shouldStack
)
{
return
{
width
:
'100%'
}
}
return
{
minWidth
:
'0'
}
},
rightStyle
()
{
if
(
this
.
shouldStack
)
{
return
{
width
:
'100%'
}
}
return
{
minWidth
:
'0'
}
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
@import
'@/styles/bill-tokens.scss'
;
.bill-two-column
{
width
:
100%
;
min-width
:
0
;
color
:
$bill-text-primary
;
}
.bill-two-column__left
,
.bill-two-column__right
{
min-width
:
0
;
}
</
style
>
src/views/bill/components/layout/index.js
0 → 100644
浏览文件 @
2c66e151
import
BillPageShell
from
'./BillPageShell.vue'
import
BillTwoColumn
from
'./BillTwoColumn.vue'
import
BillPanel
from
'./BillPanel.vue'
export
{
BillPageShell
,
BillTwoColumn
,
BillPanel
}
src/views/bill/deepDig/processAnalysis/index.vue
浏览文件 @
2c66e151
<
template
>
<
div
class=
"wrap"
>
<
BillPageShell
class=
"wrap"
>
<div
class=
"left"
>
<div
class=
"box1"
>
<!--
<div
class=
"box-header"
>
...
...
@@ -31,7 +31,7 @@
</div>
</div>
</div>
-->
<AnalysisBox
title=
"典型阶段耗时"
>
<AnalysisBox
title=
"典型阶段耗时
分析
"
>
<div
class=
"analysis-ai-wrapper analysis-ai-wrapper--box1"
>
<div
class=
"box1-main"
:class=
"
{ 'box1-main--full': !timeFooterText }">
<div
class=
"box1-main-center"
id=
"chart1"
></div>
...
...
@@ -48,7 +48,7 @@
</div>
</div>
<div
v-if=
"!aiPaneVisible.box1"
class=
"analysis-ai-tip-row"
>
<TipTab
class=
"analysis-ai-tip"
/>
<TipTab
class=
"analysis-ai-tip"
:text=
"'与历史同类法案的典型阶段耗时对比分析,数据来源:美国国会官网'"
/>
<AiButton
class=
"analysis-ai-tip-action"
@
mouseenter=
"handleShowAiPane('box1')"
/>
</div>
<div
v-if=
"aiPaneVisible.box1"
class=
"analysis-ai-pane"
@
mouseleave=
"handleHideAiPane('box1')"
>
...
...
@@ -105,7 +105,7 @@
</div>
</div>
<div
v-if=
"!aiPaneVisible.box2"
class=
"analysis-ai-tip-row"
>
<TipTab
class=
"analysis-ai-tip"
/>
<TipTab
class=
"analysis-ai-tip"
:text=
"'与历史同类法案的修正案次数对比分析,数据来源:美国国会官网'"
/>
<AiButton
class=
"analysis-ai-tip-action"
@
mouseenter=
"handleShowAiPane('box2')"
/>
</div>
<div
v-if=
"aiPaneVisible.box2"
class=
"analysis-ai-pane"
@
mouseleave=
"handleHideAiPane('box2')"
>
...
...
@@ -716,7 +716,7 @@
<
/AnalysisBox
>
<
/div
>
<
/div
>
<
/
div
>
<
/
BillPageShell
>
<
/template
>
<
script
setup
>
...
...
@@ -728,6 +728,7 @@ import { getChartAnalysis } from "@/api/aiAnalysis/index";
import
TipTab
from
"@/components/base/TipTab/index.vue"
;
import
AiButton
from
"@/components/base/Ai/AiButton/index.vue"
;
import
AiPane
from
"@/components/base/Ai/AiPane/index.vue"
;
import
{
BillPageShell
}
from
"../../components/layout"
;
import
icon1
from
"./assets/images/icon1.png"
;
import
icon2
from
"./assets/images/icon2.png"
;
...
...
@@ -1160,7 +1161,7 @@ onMounted(async () => {
min
:
"最小次数"
,
current
:
"该法案修正案数量"
}
;
let
chart2
=
getBoxPlotChcart
(
chartData2
.
value
,
"
次
"
,
countLabels
);
let
chart2
=
getBoxPlotChcart
(
chartData2
.
value
,
"
项
"
,
countLabels
);
setChart
(
chart2
,
"chart2"
);
}
);
<
/script
>
...
...
@@ -1168,6 +1169,8 @@ onMounted(async () => {
<
style
lang
=
"scss"
scoped
>
.
wrap
{
display
:
flex
;
margin
-
bottom
:
30
px
;
.
box
-
header
{
height
:
56
px
;
...
...
src/views/bill/deepDig/processOverview/index.vue
浏览文件 @
2c66e151
<
template
>
<
div
class=
"process-overview-wrap"
>
<
BillPageShell
class=
"process-overview-wrap"
>
<AnalysisBox
title=
"流程概要"
:showAllBtn=
"false"
>
<div
class=
"main"
>
<div
class=
"left"
:style=
"
{ width: boardWidth + 'px' }">
...
...
@@ -194,7 +194,7 @@
:position=
"dialogPos"
@
close=
"handleClickDetail(false)"
/>
</
div
>
</
BillPageShell
>
</
template
>
<
script
setup
>
...
...
@@ -202,6 +202,7 @@ import { ref, onMounted, computed, nextTick } from "vue";
import
{
getBillDyqkSummary
}
from
"@/api/bill"
;
import
CommonPrompt
from
"../../commonPrompt/index.vue"
;
import
ProcessOverviewDetailDialog
from
"../../ProcessOverviewDetailDialog.vue"
;
import
{
BillPageShell
}
from
"../../components/layout"
;
const
actionList
=
ref
([]);
const
isShowDetailDialog
=
ref
(
false
);
...
...
@@ -499,6 +500,7 @@ const updateRightTop = () => {
width
:
1600px
;
height
:
848px
;
margin-top
:
16px
;
margin-bottom
:
30px
;
position
:
relative
;
.main
{
...
...
@@ -799,20 +801,13 @@ const updateRightTop = () => {
.text
{
width
:
240px
;
max-width
:
100%
;
color
:
rgb
(
59
,
65
,
75
);
font-size
:
16px
;
line-height
:
24px
;
display
:
-
webkit-box
;
line-clamp
:
2
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
height
:
48px
;
}
:deep
(
.text-ellipsis
)
{
white-space
:
normal
!
important
;
}
}
}
...
...
src/views/bill/introdoction/index.vue
浏览文件 @
2c66e151
<
template
>
<
div
class=
"introduction-wrap"
>
<
BillPageShell
class=
"introduction-wrap"
>
<WarningPane
v-if=
"riskSignal"
class=
"risk-signal-pane-top"
:warnningLevel=
"riskSignal.riskLevel"
:warnningContent=
"riskSignal.riskContent"
/>
<div
class=
"introduction-wrap-content"
>
<div
class=
"introduction-wrap-left"
>
<BillTwoColumn
class=
"introduction-wrap-content"
:stack-on-narrow=
"false"
>
<template
#
left
>
<div
class=
"introduction-wrap-left"
>
<div
class=
"introduction-wrap-left-box1"
>
<AnalysisBox
title=
"基本信息"
:showAllBtn=
"false"
>
...
...
@@ -69,10 +70,12 @@
<
/div
>
<
/AnalysisBox
>
<
/div
>
<
/div
>
<
div
class
=
"introduction-wrap-right"
>
<
AnalysisBox
title
=
"提出人"
:
showAllBtn
=
"false"
>
<
div
class
=
"introduction-wrap-right-main"
>
<
/div
>
<
/template
>
<
template
#
right
>
<
div
class
=
"introduction-wrap-right"
>
<
AnalysisBox
title
=
"提出人"
:
showAllBtn
=
"false"
>
<
div
class
=
"introduction-wrap-right-main"
>
<
div
class
=
"right-main-box1"
>
<
div
class
=
"name-box"
>
<
div
class
=
"person-box"
>
...
...
@@ -139,10 +142,11 @@
<
/div
>
<
/div
>
<
/div
>
<
/AnalysisBox
>
<
/div
>
<
/div
>
<
/div
>
<
/AnalysisBox
>
<
/div
>
<
/template
>
<
/BillTwoColumn
>
<
/BillPageShell
>
<
/template
>
<
script
setup
>
...
...
@@ -151,6 +155,7 @@ import { useRoute, useRouter } from "vue-router";
import
WordCloudMap
from
"./WordCloudMap.vue"
;
import
STimeline
from
"./STimeline.vue"
;
import
WarningPane
from
"@/components/base/WarningPane/index.vue"
;
import
{
BillPageShell
,
BillTwoColumn
}
from
"../components/layout"
;
import
{
getBillInfo
,
getBillPerson
,
getBillEvent
,
getBillDyqk
}
from
"@/api/bill"
;
import
{
getPersonSummaryInfo
}
from
"@/api/common/index"
;
import
defaultAvatar
from
"../assets/images/default-icon1.png"
;
...
...
@@ -338,6 +343,14 @@ onMounted(() => {
height
:
auto
;
display
:
flex
;
flex
-
direction
:
column
;
box
-
sizing
:
border
-
box
;
.
page
-
bottom
-
gap
{
height
:
30
px
;
width
:
100
%
;
flex
-
shrink
:
0
;
pointer
-
events
:
none
;
}
.
progress
-
header
-
btns
{
display
:
flex
;
...
...
@@ -432,6 +445,7 @@ onMounted(() => {
.
introduction
-
wrap
-
content
{
display
:
flex
;
margin
-
bottom
:
30
px
;
}
.
introduction
-
wrap
-
left
{
...
...
@@ -497,7 +511,6 @@ onMounted(() => {
flex
-
wrap
:
wrap
;
align
-
items
:
center
;
width
:
700
px
;
min
-
height
:
40
px
;
gap
:
8
px
;
.
right1
-
item
{
...
...
@@ -769,8 +782,6 @@ onMounted(() => {
.
introduction
-
wrap
-
right
{
margin
-
top
:
16
px
;
margin
-
left
:
16
px
;
margin
-
right
:
18
px
;
width
:
520
px
;
height
:
845
px
;
...
...
src/views/bill/template/index.vue
浏览文件 @
2c66e151
<
template
>
<
div
class=
"temp-wrap"
>
<
BillPageShell
class=
"temp-wrap"
>
<div
class=
"tools-row"
>
<div
class=
"tools-row-left"
>
<el-select
v-model=
"curBill"
placeholder=
"请选择版本"
@
change=
"handleChangeBill"
...
...
@@ -39,8 +39,9 @@
</div>
</div>
</div>
<div
class=
"content-row"
>
<div
class=
"side"
>
<BillTwoColumn
class=
"content-row"
:left-width=
"520"
:right-width=
"1064"
:stack-on-narrow=
"false"
>
<
template
#
left
>
<div
class=
"side"
>
<div
class=
"side-box side-box-domain"
>
<AnalysisBox
title=
"涉及领域"
width=
"520px"
height=
"415px"
v-loading=
"domainLoading"
>
<div
class=
"chart-ai-wrap"
>
...
...
@@ -93,8 +94,10 @@
</div>
</AnalysisBox>
</div>
</div>
<div
class=
"terms"
>
</div>
</
template
>
<
template
#
right
>
<div
class=
"terms"
>
<div
class=
"terms-switch"
>
<span
class=
"terms-switch-label"
>
高亮实体
</span>
<el-switch
...
...
@@ -103,6 +106,10 @@
active-text=
"开"
inactive-text=
"关"
/>
<span
v-if=
"termsEntityLoading"
class=
"terms-entity-loading"
>
<el-icon
class=
"is-loading"
><Loading
/></el-icon>
实体识别中(剩余
{{
termsEntityPendingCount
}}
条)
</span>
<span
class=
"terms-switch-divider"
></span>
<span
class=
"terms-switch-label"
>
显示原文
</span>
<el-switch
...
...
@@ -112,7 +119,7 @@
inactive-text=
"关"
/>
</div>
<AnalysisBox
title=
"主要条款"
:showAllBtn=
"false"
v-loading=
"termsLoading"
>
<AnalysisBox
title=
"主要条款"
:showAllBtn=
"false"
height=
"auto"
v-loading=
"termsLoading"
>
<div
class=
"left-main"
>
<div
class=
"left-main-item"
v-for=
"(term, index) in displayTermsList"
:key=
"getTermKey(term, index)"
>
<div
class=
"term-body"
>
...
...
@@ -120,11 +127,23 @@
<div
class=
"term-main"
>
<div
class=
"term-row term-row-cn"
>
<div
class=
"term-no-cn"
>
第
{{
term
.
tkxh
}}
条.
</div>
<div
class=
"term-content-cn"
v-html=
"getTermContentHtml(term, 'cn')"
></div>
<div
class=
"term-content-cn"
>
<IntelligentEntityText
:text=
"term?.fynr || ''"
:entities=
"termsHighlight ? getTermEntities(term, 'cn') : []"
@
on-entity-click=
"e => gotoSearchResults(e.text_span, '')"
/>
</div>
</div>
<div
class=
"term-row term-row-en"
v-if=
"termsShowOriginal"
>
<div
class=
"term-no-en"
>
Sec.
{{
term
.
tkxh
}}
</div>
<div
class=
"term-content-en"
v-html=
"getTermContentHtml(term, 'en')"
></div>
<div
class=
"term-content-en"
>
<IntelligentEntityText
:text=
"term?.ywnr || ''"
:entities=
"termsHighlight ? getTermEntities(term, 'en') : []"
@
on-entity-click=
"e => gotoSearchResults(e.text_span, '')"
/>
</div>
</div>
</div>
</div>
...
...
@@ -144,16 +163,17 @@
<
/div
>
<
/div
>
<
/AnalysisBox
>
</div>
</div>
</div>
<
/div
>
<
/template
>
<
/BillTwoColumn
>
<
/BillPageShell
>
<
/template
>
<
script
setup
>
import
{
ref
,
onMounted
,
onBeforeUnmount
,
computed
,
watch
}
from
"vue"
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
"vue-router"
;
import
*
as
echarts
from
"echarts"
;
import
{
Search
}
from
"@element-plus/icons-vue"
;
import
{
Search
,
Loading
}
from
"@element-plus/icons-vue"
;
import
getPieChart
from
"./utils/piechart"
;
import
{
getBillContentId
,
getBillContentTk
,
getBillContentXzfs
,
getBillHyly
}
from
"@/api/bill"
;
import
{
getChartAnalysis
}
from
"@/api/aiAnalysis/index"
;
...
...
@@ -162,9 +182,12 @@ import AiButton from "@/components/base/Ai/AiButton/index.vue";
import
AiPane
from
"@/components/base/Ai/AiPane/index.vue"
;
import
{
MUTICHARTCOLORS
}
from
"@/common/constant"
;
import
{
extractTextEntity
}
from
"@/api/intelligent/index"
;
import
{
useGotoSearchResults
}
from
"@/router/modules/comprehensiveSearch"
;
import
IntelligentEntityText
from
"@/components/base/texts/IntelligentEntityText.vue"
;
import
{
BillPageShell
,
BillTwoColumn
}
from
"../components/layout"
;
const
route
=
useRoute
();
const
gotoSearchResults
=
useGotoSearchResults
();
const
pageAbortController
=
new
AbortController
();
const
isRequestCanceled
=
error
=>
{
...
...
@@ -186,6 +209,8 @@ const stopCurrentPageRequests = () => {
hylyRequestToken
.
value
+=
1
;
entityRequestToken
.
value
+=
1
;
termsLoading
.
value
=
false
;
termsEntityLoading
.
value
=
false
;
termsEntityPendingCount
.
value
=
0
;
limitLoading
.
value
=
false
;
domainLoading
.
value
=
false
;
aiPaneLoading
.
value
=
{
domain
:
false
,
limit
:
false
}
;
...
...
@@ -214,16 +239,8 @@ const termsShowOriginal = ref(true);
const
entityRequestToken
=
ref
(
0
);
const
termEntityCache
=
ref
(
new
Map
());
const
escapeHtml
=
value
=>
{
const
str
=
String
(
value
??
""
);
return
str
.
replace
(
/&/g
,
"&"
)
.
replace
(
/</g
,
"<"
)
.
replace
(
/>/g
,
">"
)
.
replace
(
/"/g
,
"""
)
.
replace
(
/'/g
,
"'"
);
};
const
termsEntityLoading
=
ref
(
false
);
const
termsEntityPendingCount
=
ref
(
0
);
const
normalizeEntities
=
entities
=>
{
const
list
=
Array
.
isArray
(
entities
)
?
entities
:
[];
...
...
@@ -237,69 +254,23 @@ const normalizeEntities = entities => {
.
filter
(
item
=>
item
.
text_span
);
}
;
const
getEntityRanges
=
(
text
,
entities
)
=>
{
const
ranges
=
[];
const
rawText
=
String
(
text
??
""
);
if
(
!
rawText
)
return
ranges
;
const
list
=
normalizeEntities
(
entities
).
sort
((
a
,
b
)
=>
b
.
text_span
.
length
-
a
.
text_span
.
length
);
for
(
const
ent
of
list
)
{
let
startIndex
=
0
;
while
(
startIndex
<
rawText
.
length
)
{
const
idx
=
rawText
.
indexOf
(
ent
.
text_span
,
startIndex
);
if
(
idx
===
-
1
)
break
;
ranges
.
push
({
start
:
idx
,
end
:
idx
+
ent
.
text_span
.
length
,
ent
});
startIndex
=
idx
+
ent
.
text_span
.
length
;
}
}
ranges
.
sort
((
a
,
b
)
=>
a
.
start
-
b
.
start
||
b
.
end
-
a
.
end
);
const
merged
=
[];
let
lastEnd
=
0
;
for
(
const
r
of
ranges
)
{
if
(
r
.
start
<
lastEnd
)
continue
;
merged
.
push
(
r
);
lastEnd
=
r
.
end
;
}
return
merged
;
};
const
buildHighlightedHtml
=
(
text
,
entities
,
enableHighlight
)
=>
{
const
rawText
=
String
(
text
??
""
);
if
(
!
rawText
)
return
""
;
const
safeText
=
escapeHtml
(
rawText
).
replace
(
/
\n
/g
,
"<br />"
);
if
(
!
enableHighlight
)
return
safeText
;
const
ranges
=
getEntityRanges
(
rawText
,
entities
);
if
(
!
ranges
.
length
)
return
safeText
;
let
html
=
""
;
let
cursor
=
0
;
for
(
const
r
of
ranges
)
{
if
(
cursor
<
r
.
start
)
{
html
+=
escapeHtml
(
rawText
.
slice
(
cursor
,
r
.
start
));
}
const
spanText
=
rawText
.
slice
(
r
.
start
,
r
.
end
);
const
type
=
escapeHtml
(
r
.
ent
?.
type
??
""
);
html
+=
`<span class="term-entity" data-entity-type="
${
type
}
">
${
escapeHtml
(
spanText
)}
</span>`
;
cursor
=
r
.
end
;
}
if
(
cursor
<
rawText
.
length
)
{
html
+=
escapeHtml
(
rawText
.
slice
(
cursor
));
}
return
html
.
replace
(
/
\n
/g
,
"<br />"
);
};
const
getTermEntityKey
=
(
term
,
lang
)
=>
{
const
baseKey
=
getTermKey
(
term
,
-
1
);
return
`${baseKey
}
__${lang
}
`
;
}
;
const
ensureEntitiesForTerms
=
async
terms
=>
{
if
(
!
termsHighlight
.
value
)
return
;
if
(
!
termsHighlight
.
value
)
{
termsEntityLoading
.
value
=
false
;
termsEntityPendingCount
.
value
=
0
;
return
;
}
const
list
=
Array
.
isArray
(
terms
)
?
terms
:
[];
if
(
!
list
.
length
)
return
;
if
(
!
list
.
length
)
{
termsEntityLoading
.
value
=
false
;
termsEntityPendingCount
.
value
=
0
;
return
;
}
const
currentToken
=
++
entityRequestToken
.
value
;
...
...
@@ -314,30 +285,40 @@ const ensureEntitiesForTerms = async terms => {
tasks
.
push
({
key
:
enKey
,
text
:
term
.
ywnr
}
);
}
}
if
(
!
tasks
.
length
)
return
;
if
(
!
tasks
.
length
)
{
termsEntityLoading
.
value
=
false
;
termsEntityPendingCount
.
value
=
0
;
return
;
}
try
{
const
results
=
await
Promise
.
all
(
tasks
.
map
(
async
item
=>
{
const
res
=
await
extractTextEntity
(
item
.
text
,
{
signal
:
getPageSignal
()
});
const
entities
=
normalizeEntities
(
res
?.
result
??
res
?.
data
?.
result
??
res
?.
data
??
res
);
return
{
key
:
item
.
key
,
entities
};
})
);
if
(
currentToken
!==
entityRequestToken
.
value
)
return
;
for
(
const
r
of
results
)
{
termEntityCache
.
value
.
set
(
r
.
key
,
r
.
entities
);
termsEntityLoading
.
value
=
true
;
termsEntityPendingCount
.
value
=
tasks
.
length
;
const
fetchOne
=
async
item
=>
{
try
{
const
res
=
await
extractTextEntity
(
item
.
text
,
{
signal
:
getPageSignal
()
}
);
if
(
currentToken
!==
entityRequestToken
.
value
)
return
;
const
entities
=
normalizeEntities
(
res
?.
result
??
res
?.
data
?.
result
??
res
?.
data
??
res
);
const
nextCache
=
new
Map
(
termEntityCache
.
value
);
nextCache
.
set
(
item
.
key
,
entities
);
termEntityCache
.
value
=
nextCache
;
}
catch
(
error
)
{
if
(
currentToken
!==
entityRequestToken
.
value
)
return
;
}
finally
{
if
(
currentToken
!==
entityRequestToken
.
value
)
return
;
termsEntityPendingCount
.
value
=
Math
.
max
(
0
,
termsEntityPendingCount
.
value
-
1
);
if
(
termsEntityPendingCount
.
value
===
0
)
{
termsEntityLoading
.
value
=
false
;
}
}
}
catch
(
error
)
{
if
(
currentToken
!==
entityRequestToken
.
value
)
return
;
}
}
;
await
Promise
.
all
(
tasks
.
map
(
item
=>
fetchOne
(
item
)));
}
;
const
getTermContentHtml
=
(
term
,
lang
)
=>
{
const
raw
=
lang
===
"en"
?
term
?.
ywnr
:
term
?.
fynr
;
const
getTermEntities
=
(
term
,
lang
)
=>
{
const
key
=
getTermEntityKey
(
term
,
lang
);
const
entities
=
termEntityCache
.
value
.
get
(
key
)
||
[];
return
buildHighlightedHtml
(
raw
,
entities
,
termsHighlight
.
value
);
return
termEntityCache
.
value
.
get
(
key
)
||
[];
}
;
const
tkRequestToken
=
ref
(
0
);
...
...
@@ -347,10 +328,6 @@ const hylyRequestToken = ref(0);
const
mainTermsList
=
ref
([]);
const
domainFooterText
=
ref
(
""
);
const
limitFooterText
=
ref
(
""
);
const
btnActiveIndex
=
ref
(
1
);
const
handleSelectBtn
=
index
=>
{
btnActiveIndex
.
value
=
index
;
};
const
getTermKey
=
(
term
,
index
)
=>
{
return
term
?.
ywid
??
term
?.
id
??
term
?.
tkxh
??
index
;
...
...
@@ -576,7 +553,16 @@ const handleChangeCheckbox = val => {
handleGetBillHyly
();
}
;
/** 法案布局主区域可滚动容器(.layout-main)滚回顶部 */
const
scrollBillLayoutMainToTop
=
()
=>
{
const
mainEl
=
document
.
querySelector
(
".layout-main"
);
if
(
mainEl
)
{
mainEl
.
scrollTo
({
top
:
0
,
behavior
:
"smooth"
}
);
}
}
;
const
handleCurrentChange
=
val
=>
{
scrollBillLayoutMainToTop
();
currentPage
.
value
=
val
;
handleGetBillContentTk
(
checkedValue
.
value
?
"Y"
:
"N"
);
}
;
...
...
@@ -925,8 +911,11 @@ onBeforeUnmount(() => {
.
content
-
row
{
display
:
flex
;
align
-
items
:
flex
-
start
;
margin
-
bottom
:
30
px
;
}
.
box
-
header
{
display
:
flex
;
position
:
relative
;
...
...
@@ -988,9 +977,7 @@ onBeforeUnmount(() => {
.
terms
{
margin
-
top
:
16
px
;
margin-left
:
16px
;
width
:
1064
px
;
height
:
1232px
;
position
:
relative
;
.
terms
-
switch
{
...
...
@@ -1007,6 +994,14 @@ onBeforeUnmount(() => {
color
:
var
(
--
text
-
primary
-
65
-
color
);
}
.
terms
-
entity
-
loading
{
display
:
inline
-
flex
;
align
-
items
:
center
;
gap
:
4
px
;
font
-
size
:
12
px
;
color
:
var
(
--
text
-
primary
-
65
-
color
);
}
.
terms
-
switch
-
divider
{
display
:
inline
-
block
;
width
:
1
px
;
...
...
@@ -1022,17 +1017,21 @@ onBeforeUnmount(() => {
}
}
:
deep
(.
analysis
-
box
-
wrapper
)
{
height
:
auto
;
}
:
deep
(.
wrapper
-
main
)
{
display
:
flex
;
flex
-
direction
:
column
;
height
:
calc
(
100%
-
45px
);
gap
:
16px
;
height
:
auto
;
min
-
height
:
0
;
overflow
:
visible
;
gap
:
16
px
;
}
.
left
-
main
{
flex
:
1
;
min-height
:
0
;
overflow-y
:
auto
;
flex
:
0
0
auto
;
display
:
flex
;
flex
-
direction
:
column
;
gap
:
12
px
;
...
...
@@ -1112,12 +1111,12 @@ onBeforeUnmount(() => {
line
-
height
:
24
px
;
color
:
var
(
--
text
-
primary
-
80
-
color
);
:deep
(
.
term-entity
)
{
display
:
inline
;
padding
:
0
2px
;
border-radius
:
4px
;
background
:
rgba
(
255
,
213
,
79
,
0
.35
);
box-shadow
:
inset
0
0
0
1px
rgba
(
255
,
193
,
7
,
0
.25
)
;
:
deep
(.
entity
-
link
)
{
color
:
var
(
--
color
-
primary
-
100
)
;
}
:
deep
(.
entity
-
link
:
hover
)
{
cursor
:
pointer
;
}
}
...
...
@@ -1128,12 +1127,12 @@ onBeforeUnmount(() => {
line
-
height
:
24
px
;
color
:
var
(
--
text
-
primary
-
65
-
color
);
:deep
(
.
term-entity
)
{
display
:
inline
;
padding
:
0
2px
;
border-radius
:
4px
;
background
:
rgba
(
255
,
213
,
79
,
0
.28
);
box-shadow
:
inset
0
0
0
1px
rgba
(
255
,
193
,
7
,
0
.2
)
;
:
deep
(.
entity
-
link
)
{
color
:
var
(
--
color
-
primary
-
100
)
;
}
:
deep
(.
entity
-
link
:
hover
)
{
cursor
:
pointer
;
}
}
...
...
@@ -1196,6 +1195,7 @@ onBeforeUnmount(() => {
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
center
;
padding
-
left
:
20
px
;
}
.
overview
-
tip
-
action
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论