File tree Expand file tree Collapse file tree 4 files changed +37
-5
lines changed
Expand file tree Collapse file tree 4 files changed +37
-5
lines changed Original file line number Diff line number Diff line change 118118 "earlier" : " Earlier" ,
119119 "no_time" : " No Time" ,
120120 "rename_conversation_title" : " Rename conversation title" ,
121- "conversation_title" : " Conversation title"
121+ "conversation_title" : " Conversation title" ,
122+ "copied" : " Copied"
122123 },
123124 "ds" : {
124125 "title" : " Data Source" ,
513514 "back_community" : " Restore to Community Edition" ,
514515 "confirm_tips" : " Are you sure to restore to Community Edition?"
515516 }
516- }
517+ }
Original file line number Diff line number Diff line change 121121 "earlier" : " 更早以前" ,
122122 "no_time" : " 没有时间" ,
123123 "rename_conversation_title" : " 重命名对话标题" ,
124- "conversation_title" : " 对话标题"
124+ "conversation_title" : " 对话标题" ,
125+ "copied" : " 已复制"
125126 },
126127 "ds" : {
127128 "title" : " 数据源" ,
525526 "back_community" : " 还原至社区版" ,
526527 "confirm_tips" : " 确定还原至社区版?"
527528 }
528- }
529+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import icon_export_outlined from '@/assets/svg/icon_export_outlined.svg'
1515import icon_into_item_outlined from ' @/assets/svg/icon_into-item_outlined.svg'
1616import icon_window_max_outlined from ' @/assets/svg/icon_window-max_outlined.svg'
1717import icon_window_mini_outlined from ' @/assets/svg/icon_window-mini_outlined.svg'
18+ import icon_copy_outlined from ' @/assets/svg/icon_copy_outlined.svg'
1819import { useI18n } from ' vue-i18n'
1920import SQLComponent from ' @/views/chat/component/SQLComponent.vue'
2021
@@ -189,6 +190,13 @@ function showSql() {
189190function addToDashboard() {
190191 console .log (' todo' )
191192}
193+
194+ function copy() {
195+ if (props .message ?.record ?.sql ) {
196+ navigator .clipboard .writeText (props .message .record .sql )
197+ ElMessage .info (t (' qa.copied' ))
198+ }
199+ }
192200 </script >
193201
194202<template >
@@ -318,12 +326,17 @@ function addToDashboard() {
318326 direction =" rtl"
319327 body-class =" chart-sql-drawer-body"
320328 >
321- <div >
329+ <div class = " sql-block " >
322330 <SQLComponent
323331 v-if =" message.record?.sql"
324332 :sql =" message.record?.sql"
325333 style =" margin-top : 12px "
326334 />
335+ <el-button v-if =" message.record?.sql" circle class =" input-icon" @click =" copy" >
336+ <el-icon size =" 16" >
337+ <icon _copy_outlined />
338+ </el-icon >
339+ </el-button >
327340 </div >
328341 </el-drawer >
329342 </div >
@@ -490,4 +503,18 @@ function addToDashboard() {
490503 margin-top : 16px ;
491504 }
492505}
506+
507+ .sql-block {
508+ position : relative ;
509+
510+ .input-icon {
511+ min-width : unset ;
512+ position : absolute ;
513+ top : 12px ;
514+ right : 12px ;
515+
516+ border-color : #dee0e3 ;
517+ box-shadow : 0px 4px 8px 0px #1f23291a ;
518+ }
519+ }
493520 </style >
You can’t perform that action at this time.
0 commit comments