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:
@@ -6,6 +6,7 @@
|
||||
"AI Model Configuration": "AI Model Configuration"
|
||||
},
|
||||
"common": {
|
||||
"as_default_model": "Set as Default Model",
|
||||
"no_model_yet": "No model yet",
|
||||
"intelligent_questioning_platform": "Welcome to the SQLBot Intelligent Questioning Platform",
|
||||
"login": "Login",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"AI Model Configuration": "模型配置"
|
||||
},
|
||||
"common": {
|
||||
"as_default_model": "设为默认模型",
|
||||
"no_model_yet": "暂无模型",
|
||||
"intelligent_questioning_platform": "欢迎使用 SQLBot 智能问数平台",
|
||||
"login": "账号登录",
|
||||
|
||||
@@ -76,6 +76,9 @@ const handleEmbedded = () => {
|
||||
border-radius: 12px;
|
||||
&:hover {
|
||||
box-shadow: 0px 6px 24px 0px #1f232914;
|
||||
.methods {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.name-icon {
|
||||
@@ -124,6 +127,7 @@ const handleEmbedded = () => {
|
||||
|
||||
.methods {
|
||||
margin-top: 16px;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -588,7 +588,13 @@ const saveHandler = () => {
|
||||
<template #title> {{ $t('embedded.basic_information') }} </template>
|
||||
</el-step>
|
||||
<el-step>
|
||||
<template #title> {{ $t('embedded.set_data_source') }} </template>
|
||||
<template #title>
|
||||
{{
|
||||
currentEmbedded.type === 1
|
||||
? $t('embedded.configure_interface')
|
||||
: $t('embedded.set_data_source')
|
||||
}}
|
||||
</template>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
|
||||
@@ -66,7 +66,7 @@ const deleteBatchUser = () => {
|
||||
}).then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('dashboard.delete_success'),
|
||||
message: t('workspace.removed_successfully'),
|
||||
})
|
||||
multipleSelectionAll.value = []
|
||||
search()
|
||||
@@ -85,9 +85,10 @@ const deleteHandler = (row: any) => {
|
||||
workspaceUwsDelete({
|
||||
uid_list: [row.id],
|
||||
}).then(() => {
|
||||
multipleSelectionAll.value = multipleSelectionAll.value.filter((ele) => row.id !== ele.id)
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('workspace.remove'),
|
||||
message: t('workspace.removed_successfully'),
|
||||
})
|
||||
search()
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import delIcon from '@/assets/svg/icon_delete.svg'
|
||||
import icon_embedded_outlined from '@/assets/svg/icon-setting.svg'
|
||||
import edit from '@/assets/svg/icon_edit_outlined.svg'
|
||||
import { get_supplier } from '@/entity/supplier'
|
||||
import { computed, ref } from 'vue'
|
||||
@@ -37,16 +38,20 @@ const showErrorMask = (msg?: string) => {
|
||||
errorMsg.value = ''
|
||||
}, 3000)
|
||||
}
|
||||
const emits = defineEmits(['edit', 'del'])
|
||||
const emits = defineEmits(['edit', 'del', 'default'])
|
||||
|
||||
const handleEdit = () => {
|
||||
emits('edit')
|
||||
const handleDefault = () => {
|
||||
emits('default')
|
||||
}
|
||||
|
||||
const handleDel = () => {
|
||||
emits('del', { id: props.id, name: props.name, default_model: props.isDefault })
|
||||
}
|
||||
|
||||
const handleEdit = () => {
|
||||
emits('edit')
|
||||
}
|
||||
|
||||
defineExpose({ showErrorMask })
|
||||
</script>
|
||||
|
||||
@@ -71,17 +76,24 @@ defineExpose({ showErrorMask })
|
||||
<span class="value"> {{ baseModel }}</span>
|
||||
</div>
|
||||
<div class="methods">
|
||||
<el-tooltip :offset="14" effect="dark" :content="$t('datasource.edit')" placement="top">
|
||||
<el-icon size="16" @click="handleEdit">
|
||||
<el-button secondary @click="handleDefault">
|
||||
<el-icon style="margin-right: 4px" size="16">
|
||||
<icon_embedded_outlined></icon_embedded_outlined>
|
||||
</el-icon>
|
||||
{{ $t('common.as_default_model') }}
|
||||
</el-button>
|
||||
<el-button secondary @click="handleEdit">
|
||||
<el-icon style="margin-right: 4px" size="16">
|
||||
<edit></edit>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<span class="divide"></span>
|
||||
<el-tooltip :offset="14" effect="dark" :content="$t('dashboard.delete')" placement="top">
|
||||
<el-icon size="16" @click="handleDel">
|
||||
{{ $t('dashboard.edit') }}
|
||||
</el-button>
|
||||
<el-button secondary @click="handleDel">
|
||||
<el-icon style="margin-right: 4px" size="16">
|
||||
<delIcon></delIcon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
{{ $t('dashboard.delete') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -89,7 +101,7 @@ defineExpose({ showErrorMask })
|
||||
<style lang="less" scoped>
|
||||
.card {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
height: 176px;
|
||||
border: 1px solid #dee0e3;
|
||||
padding: 16px;
|
||||
border-radius: 12px;
|
||||
@@ -139,33 +151,8 @@ defineExpose({ showErrorMask })
|
||||
.methods {
|
||||
margin-top: 16px;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
display: none;
|
||||
|
||||
.ed-icon {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
background-color: #1f23291a;
|
||||
position: absolute;
|
||||
border-radius: 6px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
transform: translate(-50%, -50%);
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&::after {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.divide {
|
||||
height: 14px;
|
||||
width: 1px;
|
||||
|
||||
@@ -191,6 +191,26 @@ const handleEditModel = (row: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleDefault = (row: any) => {
|
||||
if (row.default_model) return
|
||||
ElMessageBox.confirm(t('model.system_default_model', { msg: row.name }), {
|
||||
confirmButtonType: 'primary',
|
||||
tip: t('model.operate_with_caution'),
|
||||
confirmButtonText: t('datasource.confirm'),
|
||||
cancelButtonText: t('common.cancel'),
|
||||
customClass: 'confirm-no_icon',
|
||||
autofocus: false,
|
||||
callback: (val: string) => {
|
||||
if (val === 'confirm') {
|
||||
modelApi.setDefault(row.id).then(() => {
|
||||
ElMessage.success(t('model.set_successfully'))
|
||||
search()
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const deleteHandler = (item: any) => {
|
||||
if (item.default_model) {
|
||||
ElMessageBox.confirm(t('model.del_default_tip', { msg: item.name }), {
|
||||
@@ -370,6 +390,7 @@ const submit = (item: any) => {
|
||||
:is-default="ele['default_model']"
|
||||
@edit="handleEditModel(ele)"
|
||||
@del="deleteHandler"
|
||||
@default="handleDefault(ele)"
|
||||
></card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -83,6 +83,9 @@ const setUser = () => {
|
||||
border-radius: 12px;
|
||||
&:hover {
|
||||
box-shadow: 0px 6px 24px 0px #1f232914;
|
||||
.methods {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.name-icon {
|
||||
@@ -116,6 +119,7 @@ const setUser = () => {
|
||||
|
||||
.methods {
|
||||
margin-top: 16px;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -447,7 +447,7 @@ const next = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const saveLoading = ref(false)
|
||||
const save = () => {
|
||||
const { id, name, permissions, users } = cloneDeep(currentPermission)
|
||||
|
||||
@@ -481,14 +481,20 @@ const save = () => {
|
||||
if (!id) {
|
||||
delete obj.id
|
||||
}
|
||||
savePermissions(obj).then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('common.save_success'),
|
||||
if (saveLoading.value) return
|
||||
saveLoading.value = true
|
||||
savePermissions(obj)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('common.save_success'),
|
||||
})
|
||||
beforeClose()
|
||||
handleSearch()
|
||||
})
|
||||
.finally(() => {
|
||||
saveLoading.value = false
|
||||
})
|
||||
beforeClose()
|
||||
handleSearch()
|
||||
})
|
||||
}
|
||||
const savePermission = () => {
|
||||
if (!isCreate.value && activeStep.value === 0) {
|
||||
|
||||
Reference in New Issue
Block a user