Skip to content

Commit 5fdc3ac

Browse files
committed
fix: bug fix
1 parent 8ba2ee8 commit 5fdc3ac

File tree

5 files changed

+28
-15
lines changed

5 files changed

+28
-15
lines changed

frontend/src/views/chat/chat-block/ChartBlock.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { ChatMessage } from '@/api/chat.ts'
33
import DisplayChartBlock from '@/views/chat/component/DisplayChartBlock.vue'
44
import ChartPopover from '@/views/chat/chat-block/ChartPopover.vue'
55
import { computed, ref, watch } from 'vue'
6+
import { useClipboard } from '@vueuse/core'
67
import { concat } from 'lodash-es'
78
import type { ChartTypes } from '@/views/chat/component/BaseChart.ts'
89
import ICON_BAR from '@/assets/svg/chart/icon_bar_outlined.svg'
@@ -39,6 +40,7 @@ const props = withDefaults(
3940
}
4041
)
4142
43+
const { copy } = useClipboard()
4244
const loading = ref<boolean>(false)
4345
const { t } = useI18n()
4446
const addViewRef = ref(null)
@@ -224,10 +226,11 @@ function showSql() {
224226
// addViewRef.value?.optInit(recordeInfo)
225227
// }
226228
227-
function copy() {
229+
function copyText() {
228230
if (props.message?.record?.sql) {
229-
navigator.clipboard.writeText(props.message.record.sql)
230-
ElMessage.success(t('embedded.copy_successful'))
231+
copy(props.message.record.sql).then(() => {
232+
ElMessage.success(t('embedded.copy_successful'))
233+
})
231234
}
232235
}
233236
@@ -455,7 +458,7 @@ watch(
455458
:sql="message.record?.sql"
456459
style="margin-top: 12px"
457460
/>
458-
<el-button v-if="message.record?.sql" circle class="input-icon" @click="copy">
461+
<el-button v-if="message.record?.sql" circle class="input-icon" @click="copyText">
459462
<el-icon size="16">
460463
<icon_copy_outlined />
461464
</el-icon>

frontend/src/views/system/embedded/index.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import floating_window from '@/assets/embedded/window.png'
1010
import icon_edit_outlined from '@/assets/svg/icon_edit_outlined.svg'
1111
import icon_delete from '@/assets/svg/icon_delete.svg'
1212
import icon_copy_outlined from '@/assets/embedded/icon_copy_outlined.svg'
13+
import { useClipboard } from '@vueuse/core'
1314
1415
import Card from './Card.vue'
1516
import { workspaceList } from '@/api/workspace'
@@ -19,6 +20,8 @@ import { useI18n } from 'vue-i18n'
1920
import { cloneDeep } from 'lodash-es'
2021
2122
const { t } = useI18n()
23+
const { copy } = useClipboard()
24+
2225
const keywords = ref('')
2326
const activeStep = ref(0)
2427
const ruleConfigvVisible = ref(false)
@@ -380,8 +383,7 @@ const handleEmbedded = (row: any) => {
380383
})()`
381384
}
382385
const copyJsCode = () => {
383-
navigator.clipboard
384-
.writeText(jsCodeElement.value)
386+
copy(jsCodeElement.value)
385387
.then(function () {
386388
ElMessage.success(t('embedded.copy_successful'))
387389
})
@@ -390,8 +392,7 @@ const copyJsCode = () => {
390392
})
391393
}
392394
const copyCode = () => {
393-
navigator.clipboard
394-
.writeText(scriptElement.value)
395+
copy(scriptElement.value)
395396
.then(function () {
396397
ElMessage.success(t('embedded.copy_successful'))
397398
})

frontend/src/views/system/model/Model.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const { t } = useI18n()
2929
const keywords = ref('')
3030
const defaultModelKeywords = ref('')
3131
const modelConfigvVisible = ref(false)
32+
const searchLoading = ref(false)
3233
const editModel = ref(false)
3334
const activeStep = ref(0)
3435
const activeName = ref('')
@@ -255,9 +256,15 @@ const setCardRef = (el: any, index: number) => {
255256
}
256257
}
257258
const search = () => {
258-
modelApi.queryAll().then((res: any) => {
259-
modelList.value = res
260-
})
259+
searchLoading.value = true
260+
modelApi
261+
.queryAll()
262+
.then((res: any) => {
263+
modelList.value = res
264+
})
265+
.finally(() => {
266+
searchLoading.value = false
267+
})
261268
}
262269
search()
263270
@@ -367,7 +374,7 @@ const submit = (item: any) => {
367374
</el-col>
368375
</el-row>
369376
</div>
370-
<template v-if="!keywords && !modelListWithSearch.length">
377+
<template v-if="!keywords && !modelListWithSearch.length && !searchLoading">
371378
<EmptyBackground
372379
class="datasource-yet"
373380
:description="$t('common.no_model_yet')"

frontend/src/views/system/user/User.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ import { workspaceList } from '@/api/workspace'
377377
import { formatTimestamp } from '@/utils/date'
378378
import { ClickOutside as vClickOutside } from 'element-plus-secondary'
379379
import icon_warning_filled from '@/assets/svg/icon_warning_filled.svg'
380+
import { useClipboard } from '@vueuse/core'
381+
382+
const { copy } = useClipboard()
380383
381384
const { t } = useI18n()
382385
const keyword = ref('')
@@ -503,8 +506,7 @@ const setPopoverRef = (el: any, row: any) => {
503506
}
504507
505508
const copyText = () => {
506-
navigator.clipboard
507-
.writeText('SQLBot@123456')
509+
copy('SQLBot@123456')
508510
.then(function () {
509511
ElMessage.success(t('embedded.copy_successful'))
510512
})

frontend/src/views/system/workspace/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const fieldListWithSearch = computed(() => {
8484
ele.name.toLowerCase().includes(keywordsMember.value.toLowerCase())
8585
)
8686
})
87-
const currentTable = ref<any>({})
87+
const currentTable = ref<any>({ id: 1, name: '' })
8888
const init = () => {
8989
workspaceList().then((res) => {
9090
tableList.value = res

0 commit comments

Comments
 (0)