File tree Expand file tree Collapse file tree 5 files changed +22
-5
lines changed
Expand file tree Collapse file tree 5 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 622622 "excel" : " Excel" ,
623623 "picture" : " Image" ,
624624 "add_to_dashboard" : " Add to Dashboard" ,
625- "add_to_dataV_en " : " Add to Canvas" ,
625+ "add_to_dataV " : " Add to Canvas" ,
626626 "full_screen" : " Full Screen" ,
627627 "exit_full_screen" : " Exit Full Screen" ,
628628 "sql_generation" : " Generate SQL" ,
Original file line number Diff line number Diff line change 622622 "excel" : " Excel" ,
623623 "picture" : " 이미지" ,
624624 "add_to_dashboard" : " 대시보드에 추가" ,
625- "add_to_dataV_ko " : " 캔버스에 추가" ,
625+ "add_to_dataV " : " 캔버스에 추가" ,
626626 "full_screen" : " 전체 화면" ,
627627 "exit_full_screen" : " 전체 화면 종료" ,
628628 "sql_generation" : " SQL 생성" ,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ interface AssistantState {
2020 certificate : string
2121 online : boolean
2222 pageEmbedded ?: boolean
23+ platform : string
2324 history : boolean
2425 requestPromiseMap : Map < string , PendingRequest >
2526}
@@ -35,6 +36,7 @@ export const AssistantStore = defineStore('assistant', {
3536 certificate : '' ,
3637 online : false ,
3738 pageEmbedded : false ,
39+ platform : '' ,
3840 history : true ,
3941 requestPromiseMap : new Map < string , PendingRequest > ( ) ,
4042 }
@@ -49,6 +51,9 @@ export const AssistantStore = defineStore('assistant', {
4951 getToken ( ) : string {
5052 return this . token
5153 } ,
54+ getPlatform ( ) : string {
55+ return this . platform
56+ } ,
5257 getAssistant ( ) : boolean {
5358 return this . assistant
5459 } ,
@@ -132,6 +137,9 @@ export const AssistantStore = defineStore('assistant', {
132137 setPageEmbedded ( embedded ?: boolean ) {
133138 this . pageEmbedded = ! ! embedded
134139 } ,
140+ setPlatform ( platform : string ) {
141+ this . platform = platform
142+ } ,
135143 setOnline ( online : boolean ) {
136144 this . online = ! ! online
137145 } ,
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ const isCompletePage = computed(() => !assistantStore.getAssistant || assistantS
6565
6666const isAssistant = computed (() => assistantStore .getAssistant )
6767
68+ const isDataEaseAssistant = computed (
69+ () => assistantStore .getAssistant && assistantStore .getPlatform === ' dataease'
70+ )
71+
6872const chartId = computed (() => props .message ?.record ?.id + (props .enlarge ? ' -fullscreen' : ' ' ))
6973
7074const data = computed (() => {
@@ -208,7 +212,6 @@ function showSql() {
208212}
209213
210214function addToResource() {
211- // @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
212215 const readyData = {
213216 eventName: ' sqlbot_add_to_resource' ,
214217 busi: props .message ?.record ?.sql_prase ,
@@ -434,7 +437,7 @@ watch(
434437 </div >
435438 </el-popover >
436439 </div >
437- <div v-if =" message?.record?.sql_prase" >
440+ <div v-if =" message?.record?.sql_prase && isDataEaseAssistant " >
438441 <el-tooltip effect =" dark" :content =" t('chat.add_to_dataV')" placement =" top" >
439442 <el-button class =" tool-btn" text @click =" addToResource" >
440443 <el-icon size =" 16" >
Original file line number Diff line number Diff line change 2727 :logo-assistant =" logo"
2828 />
2929 </div >
30- <div class =" drawer-assistant" @click =" openHistory" ></div >
30+ <div v-if = " !isDataeaseAssistant " class =" drawer-assistant" @click =" openHistory" ></div >
3131 </div >
3232</template >
3333<script setup lang="ts">
@@ -65,6 +65,7 @@ const validator = ref({
6565const appName = ref (' ' )
6666const loading = ref (true )
6767const eventName = ' sqlbot_assistant_event'
68+ const isDataeaseAssistant = ref (false )
6869const communicationCb = async (event : any ) => {
6970 if (event .data ?.eventName === eventName ) {
7071 if (event .data ?.messageId !== route .query .id ) {
@@ -139,6 +140,11 @@ onBeforeMount(async () => {
139140 ElMessage .error (' Miss assistant id, please check assistant url' )
140141 return
141142 }
143+ const platform = route .query .platform
144+ if (! platform ) {
145+ assistantStore .setPlatform (platform ?.toString () || ' ' )
146+ isDataeaseAssistant .value = platform === ' dataease'
147+ }
142148
143149 const online = route .query .online
144150 setFormatOnline (online )
You can’t perform that action at this time.
0 commit comments