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

tj

上级 7157f6a4
...@@ -74,6 +74,9 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -74,6 +74,9 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
headerTabType:'translate', headerTabType:'translate',
// 底部 // 底部
bottomProgressNum:0, //文档解析 假进度 bottomProgressNum:0, //文档解析 假进度
resultWriteData:null, //文档分析结束之后 写报使用
// 写报
isWriteStart:false,// 写报以进行中
}), }),
getters: { getters: {
...@@ -156,14 +159,14 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -156,14 +159,14 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
async handleHeaderTab(type){ async handleHeaderTab(type){
this.headerTabType=type this.headerTabType=type
}, },
// 智能写报
async generateWrite(){ async generateWrite(){
console.log(3) this.isWriteStart=true
await this.fetchReportData({ await this.fetchReportData({
query: this.writtingTitle, query: this.writtingTitle,
desc: this.descText, desc: this.descText,
topic: this.curTempTitle, topic: this.curTempTitle,
result: this.clauseTranslationMessages[this.clauseTranslationMessages.length-1] result: this.resultWriteData
}); });
}, },
...@@ -389,9 +392,10 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -389,9 +392,10 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
result: jsonData result: jsonData
} }
) )
// 假进度完成
this.bottomProgressNum=100 this.bottomProgressNum=100 // 假进度完成
this.tabList[2].active=true //有结果之后放开写报按钮 this.tabList[2].active=true //有结果之后放开写报按钮
this.resultWriteData=jsonData //给写报使用
// await this.fetchReportData({ // await this.fetchReportData({
// query: this.writtingTitle, // query: this.writtingTitle,
// desc: this.descText, // desc: this.descText,
...@@ -434,7 +438,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -434,7 +438,6 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
// ========== AI 生成报文 SSE(更新报文内容 + 执行步骤) ========== // ========== AI 生成报文 SSE(更新报文内容 + 执行步骤) ==========
async fetchReportData(params) { async fetchReportData(params) {
console.log(7)
if (this.abortController) this.abortController.abort(); if (this.abortController) this.abortController.abort();
this.abortController = new AbortController(); this.abortController = new AbortController();
...@@ -497,6 +500,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', { ...@@ -497,6 +500,7 @@ export const useWrittingAsstaintStore = defineStore('writtingAsstaint', {
openWhenHidden: true, openWhenHidden: true,
onopen: (res) => { onopen: (res) => {
console.log('流式回答开始', res); console.log('流式回答开始', res);
}, },
onmessage: (res) => { onmessage: (res) => {
if (!res.data) return; if (!res.data) return;
......
...@@ -15,36 +15,36 @@ ...@@ -15,36 +15,36 @@
</div> </div>
</div> </div>
</div> </div>
<div class="parsed" v-else-if="store.isShowSteps&&store.bottomProgressNum>=100">
<div class="analysis" v-if="store.isWriteStart" @click="store.resetGenerateState">
<div class="icon"></div>
<div class="notParsed" v-else > <span class="text-tip-2-bold">停止</span>
<div class="parsedItem" v-if="store.bottomProgressNum<100">
<div class="analysis" @click="onAnalysisClick()">
<img src="@/assets/icons/aiBox/ai-logo.png" alt="">
<span class="text-tip-1">文档解析</span>
</div>
<div class="progress">
<img src="../assets/images/tips-icon.png" alt="">
<span class="text-tip-2">内容由AI生成,无法确保真实准确,仅供参考</span>
</div>
</div> </div>
<div class="parsedItem" v-else-if="store.bottomProgressNum>=100"> <div class="notAnalysis" v-else @click="onWriteClick()" >
<div class="analysis" @click="onWriteClick()">
<img src="@/assets/icons/aiBox/ai-logo.png" alt=""> <img src="@/assets/icons/aiBox/ai-logo.png" alt="">
<span class="text-tip-1">智能写报</span> <span class="text-tip-1">智能写报</span>
</div> </div>
<div class="progress"> <div class="progress">
<div class="login"> <div class="login">
<el-progress type="circle" :percentage="50" :width="24" :height="24" style="margin-right: 15px;" :show-text="false" color="rgb(5, 95, 194)"/> <el-progress type="circle" :percentage="store.bottomProgressNum" :width="24" :height="24" style="margin-right: 15px;" :show-text="false" color="rgb(5, 95, 194)"/>
<span class="text-tip-2-bold">智能写报</span> <span class="text-tip-2-bold">文档翻译</span>
</div> </div>
<div class="text-tip-2" > <div class="text-tip-2" >
<div ref="processContainerRef" v-html="renderedProcess"></div> <div ref="processContainerRef" v-html="renderedProcess"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="parsed" v-else >
<div class="notAnalysis" @click="onAnalysisClick()">
<img src="@/assets/icons/aiBox/ai-logo.png" alt="">
<span class="text-tip-1">文档解析</span>
</div>
<div class="notProgress">
<img src="../assets/images/tips-icon.png" alt="">
<span class="text-tip-2">内容由AI生成,无法确保真实准确,仅供参考</span>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -91,17 +91,12 @@ defineExpose({ ...@@ -91,17 +91,12 @@ defineExpose({
background: #fff; background: #fff;
box-shadow: 0px 0px 3px 0px #d2d2d2; box-shadow: 0px 0px 3px 0px #d2d2d2;
position: relative; position: relative;
.notParsed{ .parsed{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 64px; height: 64px;
.parsedItem{ .notAnalysis{
display: flex;
justify-content: space-between;
width: 100%;
}
.analysis{
margin-left: 22px; margin-left: 22px;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -118,7 +113,7 @@ defineExpose({ ...@@ -118,7 +113,7 @@ defineExpose({
margin-right: 12px; margin-right: 12px;
} }
} }
.progress{ .notProgress{
background-color: #fff; background-color: #fff;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -131,12 +126,6 @@ defineExpose({ ...@@ -131,12 +126,6 @@ defineExpose({
margin-right: 8px; margin-right: 8px;
} }
} }
}
.parsed{
display: flex;
justify-content: space-between;
align-items: center;
height: 64px;
.analysis{ .analysis{
border: 1px solid var(--color-primary-100); border: 1px solid var(--color-primary-100);
...@@ -171,7 +160,6 @@ defineExpose({ ...@@ -171,7 +160,6 @@ defineExpose({
margin-right: 10px; margin-right: 10px;
display: flex; display: flex;
} }
} }
} }
......
...@@ -36,8 +36,10 @@ import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore"; ...@@ -36,8 +36,10 @@ import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore";
// 子组件直接获取Pinia Store(核心优化) // 子组件直接获取Pinia Store(核心优化)
const store = useWrittingAsstaintStore(); const store = useWrittingAsstaintStore();
const onTabListClick= async (type,active)=>{ const onTabListClick= (type,active)=>{
console.log(0)
if(!active) return if(!active) return
console.log(1)
store.handleHeaderTab(type) store.handleHeaderTab(type)
} }
// 查找 // 查找
......
<template> <template>
<div > <div >
<!-- 右侧子组件:绑定ref --> <!-- 右侧子组件:绑定ref -->
<writtingMainBox ref="mainBoxRef" :report-content="store.reportContent" /> <writtingMainBox v-show="!!store.reportContent" :report-content="store.reportContent" />
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, watch, onMounted, onUnmounted } from "vue"; import { ref, watch, onMounted, onUnmounted } from "vue";
import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore";
import writtingMainBox from "./WrittingMainBox.vue";
const store = useWrittingAsstaintStore();
const mainBoxRef = ref(null); // 右侧子组件ref const mainBoxRef = ref(null); // 右侧子组件ref
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</div> </div>
<!-- 右侧子组件:绑定ref --> <!-- 右侧子组件:绑定ref -->
<writtingMainBox v-show="!!store.reportContent" ref="mainBoxRef" :report-content="store.reportContent" /> <!-- <writtingMainBox v-show="!!store.reportContent" ref="mainBoxRef" :report-content="store.reportContent" /> -->
</div> </div>
<WrittingBottom @generate="handleGenerate" @write="handleWrite"></WrittingBottom> <WrittingBottom @generate="handleGenerate" @write="handleWrite"></WrittingBottom>
...@@ -67,7 +67,7 @@ import { useRoute } from "vue-router"; ...@@ -67,7 +67,7 @@ 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";
import writtingleftBox from "./components/WrittingLeftBox.vue"; import writtingleftBox from "./components/WrittingLeftBox.vue";
import writtingMainBox from "./components/WrittingMainBox.vue";
import WrittingHeader from "./components/WrittingHeader.vue"; //头 import WrittingHeader from "./components/WrittingHeader.vue"; //头
import WrittingBottom from "./components/WrittingBottom.vue"; //底部 import WrittingBottom from "./components/WrittingBottom.vue"; //底部
import WrittingTranslate from "./components/WrittingTranslate.vue"; //翻译 import WrittingTranslate from "./components/WrittingTranslate.vue"; //翻译
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论