提交 d88247e0 authored 作者: 安云鹏's avatar 安云鹏

写报

上级 4d4ad3f0
......@@ -134,7 +134,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
this.writeProgressNum=0, //写报 假进度
this.tabList[1].active=false
this.tabList[2].active=false
this.reportContent=''
this.reportContent='' //写报内容
},
backToInputAndClear() {
......@@ -390,6 +390,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
}
},
onmessage: async (event) => {
console.log(event)
if (!event || !event.data || event.data.trim() === '') return;
let jsonData = null;
......
......@@ -198,7 +198,7 @@
</div>
</div>
<!-- 步骤侧边栏显隐按钮 -->
<div class="toggle-steps-btn" @click="store.isShowSteps = !store.isShowSteps">
<div class="toggle-steps-btn" @click=" isShowSteps ">
<div class="arrow" :class="{ 'is-active': store.isShowSteps }"></div>
</div>
</div>
......@@ -223,6 +223,10 @@ const emit = defineEmits(["generate"]);
const triggerGenerate = () => {
emit("generate");
};
const isShowSteps=()=>{
store.isShowSteps = !store.isShowSteps
store.highlightClauseId=''
}
// 数字转中文序号
const getChineseNumber = (num) => {
......@@ -263,9 +267,8 @@ watch(
const location=findTextInElement(element, targetText);
const containerRect = container.getBoundingClientRect();
const itemRect = location;
const itemRect = item.getBoundingClientRect();
const delta = itemRect.top - containerRect.top;
const targetTop = container.scrollTop + delta;
// 让高亮条款的“标题区域”贴到容器顶部
......@@ -277,7 +280,7 @@ watch(
);
// 👇 核心:在 element 内部找文字位置
// =========================================
function findTextInElement(element, targetText ) {
const findTextInElement=(element, targetText )=> {
// 遍历标签内的所有内容
const nodes = element.childNodes;
let rect =''
......@@ -289,7 +292,7 @@ function findTextInElement(element, targetText ) {
const originalText = node.textContent;
function cleanText(str) {
const cleanText=(str)=> {
return str
.replace(/(/g, '(')
.replace(/)/g, ')')
......
......@@ -2,7 +2,6 @@
<div class="translation-content" ref="translationContentRef">
<!-- :class="{ active: store.highlightClauseId === item.payload?.clause_number }"
:data-clause-number="item.payload?.clause_number" -->
<!-- 查找 -->
<div class="searchFor" v-if="store.isSsearchFor">
<el-input v-model="keyword" style="width: 260px;" placeholder="查找原文内容" />
......
......@@ -110,7 +110,7 @@ const handleWrite=async ()=>{
try {
// // 等待DOM更新(确保子组件DOM已挂载)
store.tabList[2].active=true //写报生成之后放开写报按钮
store.headerTabType='translate'
store.headerTabType='message'
await nextTick();
await store.generateWrite()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论