File tree 3 files changed +26
-5
lines changed
3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ const props = defineProps<{
43
43
isGenerating: boolean // 是否正在生成
44
44
isStart: boolean // 开始状态,开始时需要清除 html
45
45
}>()
46
- const contentRef = ref <HTMLDivElement >() // 右侧出来header以下的区域
46
+ const contentRef = ref <HTMLDivElement >() // 右侧出来 header 以下的区域
47
47
const mdContainerRef = ref <HTMLDivElement >() // markdown 的容器,用来滚动到底下的
48
48
const mindMapRef = ref <HTMLDivElement >() // 思维导图的容器
49
49
const svgRef = ref <SVGElement >() // 思维导图的渲染 svg
@@ -106,8 +106,7 @@ const processContent = (text: string) => {
106
106
return arr .join (' \n ' )
107
107
}
108
108
109
- /** 下载图片 */
110
- // download SVG to png file
109
+ /** 下载图片:download SVG to png file */
111
110
const downloadImage = () => {
112
111
const svgElement = mindMapRef .value
113
112
// 将 SVG 渲染到图片对象
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const rightRef = ref<InstanceType<typeof Right>>() // 右边组件
40
40
41
41
/** 使用已有内容直接生成 **/
42
42
const directGenerate = (existPrompt : string ) => {
43
- isEnd .value = false // 先设置为false再设置为true,让子组建的watch能够监听到
43
+ isEnd .value = false // 先设置为 false 再设置为 true,让子组建的 watch 能够监听到
44
44
generatedContent .value = existPrompt
45
45
isEnd .value = true
46
46
}
Original file line number Diff line number Diff line change 70
70
width =" 180px"
71
71
/>
72
72
<el-table-column label =" 错误信息" align =" center" prop =" errorMessage" />
73
- <el-table-column label =" 操作" align =" center" width =" 100 " fixed =" right" >
73
+ <el-table-column label =" 操作" align =" center" width =" 120 " fixed =" right" >
74
74
<template #default =" scope " >
75
+ <el-button link type =" primary" @click =" openPreview(scope.row)" > 预览 </el-button >
75
76
<el-button
76
77
link
77
78
type =" danger"
91
92
@pagination =" getList"
92
93
/>
93
94
</ContentWrap >
95
+
96
+ <!-- 思维导图的预览 -->
97
+ <el-drawer v-model =" previewVisible" :with-header =" false" size =" 800px" >
98
+ <Right
99
+ ref =" rightRef"
100
+ :generatedContent =" previewContent"
101
+ :isEnd =" true"
102
+ :isGenerating =" false"
103
+ :isStart =" false"
104
+ />
105
+ </el-drawer >
94
106
</template >
95
107
96
108
<script setup lang="ts">
97
109
import { dateFormatter } from ' @/utils/formatTime'
98
110
import { AiMindMapApi , MindMapVO } from ' @/api/ai/mindmap'
99
111
import * as UserApi from ' @/api/system/user'
112
+ import Right from ' @/views/ai/mindmap/index/components/Right.vue'
100
113
101
114
/** AI 思维导图 列表 */
102
115
defineOptions ({ name: ' AiMindMapManager' })
@@ -154,6 +167,15 @@ const handleDelete = async (id: number) => {
154
167
} catch {}
155
168
}
156
169
170
+ // TODO 芋艿:预览会报错
171
+ /** 预览操作按钮 */
172
+ const previewVisible = ref (false )
173
+ const previewContent = ref (' ' )
174
+ const openPreview = (row : MindMapVO ) => {
175
+ previewContent .value = row .generatedContent
176
+ previewVisible .value = true
177
+ }
178
+
157
179
/** 初始化 **/
158
180
onMounted (async () => {
159
181
getList ()
You can’t perform that action at this time.
0 commit comments