mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix: bug fix
This commit is contained in:
@@ -3,6 +3,7 @@ import type { ChatMessage } from '@/api/chat.ts'
|
||||
import DisplayChartBlock from '@/views/chat/component/DisplayChartBlock.vue'
|
||||
import ChartPopover from '@/views/chat/chat-block/ChartPopover.vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import { concat } from 'lodash-es'
|
||||
import type { ChartTypes } from '@/views/chat/component/BaseChart.ts'
|
||||
import ICON_BAR from '@/assets/svg/chart/icon_bar_outlined.svg'
|
||||
@@ -39,6 +40,7 @@ const props = withDefaults(
|
||||
}
|
||||
)
|
||||
|
||||
const { copy } = useClipboard()
|
||||
const loading = ref<boolean>(false)
|
||||
const { t } = useI18n()
|
||||
const addViewRef = ref(null)
|
||||
@@ -224,10 +226,11 @@ function showSql() {
|
||||
// addViewRef.value?.optInit(recordeInfo)
|
||||
// }
|
||||
|
||||
function copy() {
|
||||
function copyText() {
|
||||
if (props.message?.record?.sql) {
|
||||
navigator.clipboard.writeText(props.message.record.sql)
|
||||
ElMessage.success(t('embedded.copy_successful'))
|
||||
copy(props.message.record.sql).then(() => {
|
||||
ElMessage.success(t('embedded.copy_successful'))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,7 +458,7 @@ watch(
|
||||
:sql="message.record?.sql"
|
||||
style="margin-top: 12px"
|
||||
/>
|
||||
<el-button v-if="message.record?.sql" circle class="input-icon" @click="copy">
|
||||
<el-button v-if="message.record?.sql" circle class="input-icon" @click="copyText">
|
||||
<el-icon size="16">
|
||||
<icon_copy_outlined />
|
||||
</el-icon>
|
||||
|
||||
@@ -10,6 +10,7 @@ import floating_window from '@/assets/embedded/window.png'
|
||||
import icon_edit_outlined from '@/assets/svg/icon_edit_outlined.svg'
|
||||
import icon_delete from '@/assets/svg/icon_delete.svg'
|
||||
import icon_copy_outlined from '@/assets/embedded/icon_copy_outlined.svg'
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
|
||||
import Card from './Card.vue'
|
||||
import { workspaceList } from '@/api/workspace'
|
||||
@@ -19,6 +20,8 @@ import { useI18n } from 'vue-i18n'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { copy } = useClipboard()
|
||||
|
||||
const keywords = ref('')
|
||||
const activeStep = ref(0)
|
||||
const ruleConfigvVisible = ref(false)
|
||||
@@ -380,8 +383,7 @@ const handleEmbedded = (row: any) => {
|
||||
})()`
|
||||
}
|
||||
const copyJsCode = () => {
|
||||
navigator.clipboard
|
||||
.writeText(jsCodeElement.value)
|
||||
copy(jsCodeElement.value)
|
||||
.then(function () {
|
||||
ElMessage.success(t('embedded.copy_successful'))
|
||||
})
|
||||
@@ -390,8 +392,7 @@ const copyJsCode = () => {
|
||||
})
|
||||
}
|
||||
const copyCode = () => {
|
||||
navigator.clipboard
|
||||
.writeText(scriptElement.value)
|
||||
copy(scriptElement.value)
|
||||
.then(function () {
|
||||
ElMessage.success(t('embedded.copy_successful'))
|
||||
})
|
||||
|
||||
@@ -29,6 +29,7 @@ const { t } = useI18n()
|
||||
const keywords = ref('')
|
||||
const defaultModelKeywords = ref('')
|
||||
const modelConfigvVisible = ref(false)
|
||||
const searchLoading = ref(false)
|
||||
const editModel = ref(false)
|
||||
const activeStep = ref(0)
|
||||
const activeName = ref('')
|
||||
@@ -255,9 +256,15 @@ const setCardRef = (el: any, index: number) => {
|
||||
}
|
||||
}
|
||||
const search = () => {
|
||||
modelApi.queryAll().then((res: any) => {
|
||||
modelList.value = res
|
||||
})
|
||||
searchLoading.value = true
|
||||
modelApi
|
||||
.queryAll()
|
||||
.then((res: any) => {
|
||||
modelList.value = res
|
||||
})
|
||||
.finally(() => {
|
||||
searchLoading.value = false
|
||||
})
|
||||
}
|
||||
search()
|
||||
|
||||
@@ -367,7 +374,7 @@ const submit = (item: any) => {
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<template v-if="!keywords && !modelListWithSearch.length">
|
||||
<template v-if="!keywords && !modelListWithSearch.length && !searchLoading">
|
||||
<EmptyBackground
|
||||
class="datasource-yet"
|
||||
:description="$t('common.no_model_yet')"
|
||||
|
||||
@@ -377,6 +377,9 @@ import { workspaceList } from '@/api/workspace'
|
||||
import { formatTimestamp } from '@/utils/date'
|
||||
import { ClickOutside as vClickOutside } from 'element-plus-secondary'
|
||||
import icon_warning_filled from '@/assets/svg/icon_warning_filled.svg'
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
|
||||
const { copy } = useClipboard()
|
||||
|
||||
const { t } = useI18n()
|
||||
const keyword = ref('')
|
||||
@@ -503,8 +506,7 @@ const setPopoverRef = (el: any, row: any) => {
|
||||
}
|
||||
|
||||
const copyText = () => {
|
||||
navigator.clipboard
|
||||
.writeText('SQLBot@123456')
|
||||
copy('SQLBot@123456')
|
||||
.then(function () {
|
||||
ElMessage.success(t('embedded.copy_successful'))
|
||||
})
|
||||
|
||||
@@ -84,7 +84,7 @@ const fieldListWithSearch = computed(() => {
|
||||
ele.name.toLowerCase().includes(keywordsMember.value.toLowerCase())
|
||||
)
|
||||
})
|
||||
const currentTable = ref<any>({})
|
||||
const currentTable = ref<any>({ id: 1, name: '' })
|
||||
const init = () => {
|
||||
workspaceList().then((res) => {
|
||||
tableList.value = res
|
||||
|
||||
Reference in New Issue
Block a user