Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
4d4ad3f0
提交
4d4ad3f0
authored
3月 26, 2026
作者:
安云鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化写报
上级
32803e52
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
36 行增加
和
18 行删除
+36
-18
useMarkdownStream.js
src/hooks/useMarkdownStream.js
+1
-1
writtingAsstaintStore.js
src/stores/writtingAsstaintStore.js
+4
-3
WrittingBottom.vue
src/views/writtingAsstaint/components/WrittingBottom.vue
+1
-1
WrittingHeader.vue
src/views/writtingAsstaint/components/WrittingHeader.vue
+9
-3
WrittingLeftBox.vue
src/views/writtingAsstaint/components/WrittingLeftBox.vue
+4
-5
WrittingMainBox.vue
src/views/writtingAsstaint/components/WrittingMainBox.vue
+1
-1
WrittingMind.vue
src/views/writtingAsstaint/components/WrittingMind.vue
+9
-0
index.vue
src/views/writtingAsstaint/index.vue
+7
-4
没有找到文件。
src/hooks/useMarkdownStream.js
浏览文件 @
4d4ad3f0
...
@@ -300,7 +300,7 @@ export function useMarkdownStream() {
...
@@ -300,7 +300,7 @@ export function useMarkdownStream() {
// content = content.replace(/==(\d+)、==/g, (match, p1) => {
// content = content.replace(/==(\d+)、==/g, (match, p1) => {
// return `<button class="clause-ref-btn" data-clause="${p1}">${p1}</button>`
// return `<button class="clause-ref-btn" data-clause="${p1}">${p1}</button>`
// })
// })
console
.
log
(
content
,
11223
)
content
=
content
.
replace
(
/==
\s
*
(\d
+
)
、.*
?
==/g
,
(
match
,
p1
)
=>
{
content
=
content
.
replace
(
/==
\s
*
(\d
+
)
、.*
?
==/g
,
(
match
,
p1
)
=>
{
return
`<button class="clause-ref-btn" data-clause="
${
match
.
replace
(
/==/g
,
''
)
}
">
${
p1
}
</button>`
;
return
`<button class="clause-ref-btn" data-clause="
${
match
.
replace
(
/==/g
,
''
)
}
">
${
p1
}
</button>`
;
});
});
...
...
src/stores/writtingAsstaintStore.js
浏览文件 @
4d4ad3f0
...
@@ -134,6 +134,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
...
@@ -134,6 +134,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
this
.
writeProgressNum
=
0
,
//写报 假进度
this
.
writeProgressNum
=
0
,
//写报 假进度
this
.
tabList
[
1
].
active
=
false
this
.
tabList
[
1
].
active
=
false
this
.
tabList
[
2
].
active
=
false
this
.
tabList
[
2
].
active
=
false
this
.
reportContent
=
''
},
},
backToInputAndClear
()
{
backToInputAndClear
()
{
...
@@ -209,7 +210,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
...
@@ -209,7 +210,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
// 停止写报
// 停止写报
writeGenerateState
(){
writeGenerateState
(){
// this.bottomProgressNum=100
// this.bottomProgressNum=100
store
.
headerTabType
=
'translate'
this
.
headerTabType
=
'translate'
this
.
writeProgressNum
=
0
this
.
writeProgressNum
=
0
this
.
processWriteLog
=
''
this
.
processWriteLog
=
''
this
.
tabList
[
2
].
active
=
false
this
.
tabList
[
2
].
active
=
false
...
@@ -564,6 +565,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
...
@@ -564,6 +565,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
updateFlushIndexByBoundary
();
updateFlushIndexByBoundary
();
flushToReport
(
false
);
flushToReport
(
false
);
console
.
log
(
streamBuffer
,
456
)
console
.
log
(
streamBuffer
,
456
)
console
.
log
(
msgData
,
'data'
)
}
else
{
}
else
{
// 结束时把剩余内容强制 flush
// 结束时把剩余内容强制 flush
flushToReport
(
true
);
flushToReport
(
true
);
...
@@ -621,7 +623,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
...
@@ -621,7 +623,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
// ========== 业务入口 ==========
// ========== 业务入口 ==========
async
generateReport
()
{
async
generateReport
()
{
console
.
log
(
77777
)
this
.
bottomProgressNum
=
1
this
.
bottomProgressNum
=
1
if
(
Object
.
keys
(
this
.
routeQuery
).
length
!==
0
)
{
if
(
Object
.
keys
(
this
.
routeQuery
).
length
!==
0
)
{
// 路由参数优先
// 路由参数优先
...
@@ -646,7 +647,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
...
@@ -646,7 +647,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
}
}
// 兼容:若仅有 routeQuery 但无 fileId,则直接走原生成接口
// 兼容:若仅有 routeQuery 但无 fileId,则直接走原生成接口
console
.
log
(
99999
)
const
params
=
{
const
params
=
{
query
:
this
.
writtingTitle
,
query
:
this
.
writtingTitle
,
desc
:
this
.
descText
,
desc
:
this
.
descText
,
...
...
src/views/writtingAsstaint/components/WrittingBottom.vue
浏览文件 @
4d4ad3f0
<
template
>
<
template
>
<div
class=
"writtingBottom"
>
<div
class=
"writtingBottom"
>
<!-- 文档停止解析 -->
<!-- 文档停止解析 -->
<div
class=
"parsed"
v-if=
"store.bottomProgressNum>0&&store.bottomProgressNum!=100&&store.writeProgressNum
<10
"
>
<div
class=
"parsed"
v-if=
"store.bottomProgressNum>0&&store.bottomProgressNum!=100&&store.writeProgressNum
<10
"
>
<div
class=
"analysis"
@
click=
"store.resetGenerateState"
>
<div
class=
"analysis"
@
click=
"store.resetGenerateState"
>
<div
class=
"icon"
></div>
<div
class=
"icon"
></div>
...
@@ -93,6 +92,7 @@ const onWriteClick=()=>{
...
@@ -93,6 +92,7 @@ const onWriteClick=()=>{
emit
(
"write"
);
emit
(
"write"
);
}
}
const
{
renderedProcess
,
updateProcess
,
clearContent
}
=
useStream
();
const
{
renderedProcess
,
updateProcess
,
clearContent
}
=
useStream
();
const
processContainerRef
=
ref
(
null
);
const
processContainerRef
=
ref
(
null
);
// 监听 store.processLog 变化,更新步骤内容并滚动
// 监听 store.processLog 变化,更新步骤内容并滚动
...
...
src/views/writtingAsstaint/components/WrittingHeader.vue
浏览文件 @
4d4ad3f0
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</div>
</div>
<div
v-else
>
<div
v-else
>
<el-button
@
click=
"
store.exportConten
t"
>
导出
</el-button>
<el-button
@
click=
"
onExpor
t"
>
导出
</el-button>
</div>
</div>
</div>
</div>
...
@@ -36,16 +36,22 @@ import { onMounted, onUnmounted, ref, nextTick ,computed,watch} from "vue";
...
@@ -36,16 +36,22 @@ import { onMounted, onUnmounted, ref, nextTick ,computed,watch} from "vue";
import
{
useRoute
}
from
"vue-router"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
useWrittingAsstaintStore
}
from
"@/stores/writtingAsstaintStore"
;
import
{
useWrittingAsstaintStore
}
from
"@/stores/writtingAsstaintStore"
;
const
emit
=
defineEmits
([
"onExport"
]);
// 子组件直接获取Pinia Store(核心优化)
// 子组件直接获取Pinia Store(核心优化)
const
store
=
useWrittingAsstaintStore
();
const
store
=
useWrittingAsstaintStore
();
const
onTabListClick
=
(
type
,
active
)
=>
{
const
onTabListClick
=
(
type
,
active
)
=>
{
console
.
log
(
0
)
if
(
!
active
)
return
if
(
!
active
)
return
console
.
log
(
1
)
store
.
handleHeaderTab
(
type
)
store
.
handleHeaderTab
(
type
)
}
}
const
onExport
=
()
=>
{
if
(
store
.
headerTabType
==
'mind'
){
emit
(
'onExport'
)
}
else
if
(
store
.
headerTabType
==
'message'
){
store
.
exportContent
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/views/writtingAsstaint/components/WrittingLeftBox.vue
浏览文件 @
4d4ad3f0
...
@@ -243,8 +243,10 @@ const { renderedProcess, updateProcess, clearContent } = useStream();
...
@@ -243,8 +243,10 @@ const { renderedProcess, updateProcess, clearContent } = useStream();
watch
(
watch
(
()
=>
store
.
highlightClauseId
,
()
=>
store
.
highlightClauseId
,
async
(
newId
)
=>
{
async
(
newId
)
=>
{
if
(
!
newId
||
!
translationContentRef
.
value
)
return
;
console
.
log
(
'789'
)
await
nextTick
();
await
nextTick
();
if
(
!
newId
||
!
translationContentRef
.
value
)
return
;
const
container
=
translationContentRef
.
value
;
const
container
=
translationContentRef
.
value
;
const
result
=
newId
.
replace
(
/^
\d
+、/
,
''
);
const
result
=
newId
.
replace
(
/^
\d
+、/
,
''
);
...
@@ -265,7 +267,7 @@ watch(
...
@@ -265,7 +267,7 @@ watch(
const
delta
=
itemRect
.
top
-
containerRect
.
top
;
const
delta
=
itemRect
.
top
-
containerRect
.
top
;
const
targetTop
=
container
.
scrollTop
+
delta
;
const
targetTop
=
container
.
scrollTop
+
delta
;
console
.
log
(
delta
)
// 让高亮条款的“标题区域”贴到容器顶部
// 让高亮条款的“标题区域”贴到容器顶部
container
.
scrollTo
({
container
.
scrollTo
({
top
:
Math
.
max
(
0
,
targetTop
),
top
:
Math
.
max
(
0
,
targetTop
),
...
@@ -300,10 +302,7 @@ function findTextInElement(element, targetText ) {
...
@@ -300,10 +302,7 @@ function findTextInElement(element, targetText ) {
// 清理后的文字(无标点)
// 清理后的文字(无标点)
const
nodeClean
=
cleanText
(
originalText
);
const
nodeClean
=
cleanText
(
originalText
);
const
targetClean
=
cleanText
(
targetText
);
const
targetClean
=
cleanText
(
targetText
);
console
.
log
(
nodeClean
)
console
.
log
(
targetClean
)
console
.
log
(
nodeClean
.
includes
(
targetClean
))
// 用干净文字对比
// 用干净文字对比
if
(
nodeClean
.
includes
(
targetClean
))
{
if
(
nodeClean
.
includes
(
targetClean
))
{
...
...
src/views/writtingAsstaint/components/WrittingMainBox.vue
浏览文件 @
4d4ad3f0
...
@@ -41,8 +41,8 @@ const handleGlobalClick = (e) => {
...
@@ -41,8 +41,8 @@ const handleGlobalClick = (e) => {
const
clauseId
=
btn
.
getAttribute
(
'data-clause'
);
const
clauseId
=
btn
.
getAttribute
(
'data-clause'
);
if
(
clauseId
)
{
if
(
clauseId
)
{
store
.
highlightClauseId
=
clauseId
;
store
.
highlightClauseId
=
clauseId
;
store
.
isShowSteps
=
true
;
// 翻译栏一直显示,所以这里只需要确保它在视图内
// 翻译栏一直显示,所以这里只需要确保它在视图内
store
.
isShowSteps
=
true
;
console
.
log
(
store
.
highlightClauseId
)
console
.
log
(
store
.
highlightClauseId
)
}
}
}
}
...
...
src/views/writtingAsstaint/components/WrittingMind.vue
浏览文件 @
4d4ad3f0
...
@@ -196,6 +196,15 @@ onMounted(() => {
...
@@ -196,6 +196,15 @@ onMounted(() => {
})
})
onUnmounted
(()
=>
graph
?.
destroy
())
onUnmounted
(()
=>
graph
?.
destroy
())
function
exportGraph
()
{
if
(
!
graph
)
return
graph
.
downloadFullImage
(
'思维导图.png'
)
}
defineExpose
({
exportGraph
});
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
src/views/writtingAsstaint/index.vue
浏览文件 @
4d4ad3f0
...
@@ -29,18 +29,17 @@
...
@@ -29,18 +29,17 @@
<IntelligenceLeftTabBar></IntelligenceLeftTabBar>
<IntelligenceLeftTabBar></IntelligenceLeftTabBar>
<!-- 主体区域:子组件 -->
<!-- 主体区域:子组件 -->
<div
style=
"width: 100%;"
>
<div
style=
"width: 100%;"
>
<WrittingHeader></WrittingHeader>
<WrittingHeader
@
onExport=
"onExport"
></WrittingHeader>
<div
class=
"writting-main"
>
<div
class=
"writting-main"
>
<!-- 左侧子组件:绑定ref -->
<!-- 左侧子组件:绑定ref -->
<!--
<writtingleftBox
ref=
"leftBoxRef"
@
generate=
"handleGenerate"
/>
-->
<!--
<writtingleftBox
ref=
"leftBoxRef"
@
generate=
"handleGenerate"
/>
-->
<WrittingLeftBox
ref=
"leftBoxRef"
/>
<WrittingLeftBox
ref=
"leftBoxRef"
/>
{{
store
.
isShowClauseTranslation
}}
-
{{
store
.
isGenerating
}}
<!-- 翻译 -->
<!-- 翻译 -->
<WrittingTranslate
v-if=
"store.isShowClauseTranslation&&store.headerTabType=='translate'"
></WrittingTranslate>
<WrittingTranslate
v-if=
"store.isShowClauseTranslation&&store.headerTabType=='translate'"
></WrittingTranslate>
<!-- 思维导图 " -->
<!-- 思维导图 " -->
<WrittingMind
v-else-if=
"store.isShowClauseTranslation&&store.headerTabType=='mind' "
></WrittingMind>
<WrittingMind
v-else-if=
"store.isShowClauseTranslation&&store.headerTabType=='mind' "
ref=
"mindRef"
></WrittingMind>
<!-- 写报 -->
<!-- 写报 -->
<WrittingMessage
v-else-if=
"store.isShowClauseTranslation&&store.headerTabType=='message'"
></WrittingMessage>
<WrittingMessage
v-else-if=
"store.isShowClauseTranslation&&store.headerTabType=='message'"
></WrittingMessage>
<!-- 无数据时显示占位图 -->
<!-- 无数据时显示占位图 -->
...
@@ -82,7 +81,11 @@ import WrittingMessage from "./components/WrittingMessage.vue"; //写报
...
@@ -82,7 +81,11 @@ import WrittingMessage from "./components/WrittingMessage.vue"; //写报
const
route
=
useRoute
();
const
route
=
useRoute
();
// 获取Pinia Store实例
// 获取Pinia Store实例
const
leftBoxRef
=
ref
(
null
);
// 左侧子组件ref
const
leftBoxRef
=
ref
(
null
);
// 左侧子组件ref
const
mindRef
=
ref
(
null
)
//思维导图ref
const
onExport
=
()
=>
{
mindRef
.
value
.
exportGraph
()
}
const
store
=
useWrittingAsstaintStore
();
const
store
=
useWrittingAsstaintStore
();
// 2. 核心:触发生成流程
// 2. 核心:触发生成流程
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论