Skip to content

Commit 4ba8696

Browse files
committed
fix: bug fix
1 parent 1d633e1 commit 4ba8696

File tree

9 files changed

+78
-47
lines changed

9 files changed

+78
-47
lines changed

frontend/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"AI Model Configuration": "AI Model Configuration"
77
},
88
"common": {
9+
"as_default_model": "Set as Default Model",
910
"no_model_yet": "No model yet",
1011
"intelligent_questioning_platform": "Welcome to the SQLBot Intelligent Questioning Platform",
1112
"login": "Login",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"AI Model Configuration": "模型配置"
77
},
88
"common": {
9+
"as_default_model": "设为默认模型",
910
"no_model_yet": "暂无模型",
1011
"intelligent_questioning_platform": "欢迎使用 SQLBot 智能问数平台",
1112
"login": "账号登录",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ const handleEmbedded = () => {
7676
border-radius: 12px;
7777
&:hover {
7878
box-shadow: 0px 6px 24px 0px #1f232914;
79+
.methods {
80+
display: block;
81+
}
7982
}
8083
8184
.name-icon {
@@ -124,6 +127,7 @@ const handleEmbedded = () => {
124127
125128
.methods {
126129
margin-top: 16px;
130+
display: none;
127131
}
128132
}
129133
</style>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,13 @@ const saveHandler = () => {
588588
<template #title> {{ $t('embedded.basic_information') }} </template>
589589
</el-step>
590590
<el-step>
591-
<template #title> {{ $t('embedded.set_data_source') }} </template>
591+
<template #title>
592+
{{
593+
currentEmbedded.type === 1
594+
? $t('embedded.configure_interface')
595+
: $t('embedded.set_data_source')
596+
}}
597+
</template>
592598
</el-step>
593599
</el-steps>
594600
</div>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const deleteBatchUser = () => {
6666
}).then(() => {
6767
ElMessage({
6868
type: 'success',
69-
message: t('dashboard.delete_success'),
69+
message: t('workspace.removed_successfully'),
7070
})
7171
multipleSelectionAll.value = []
7272
search()
@@ -85,9 +85,10 @@ const deleteHandler = (row: any) => {
8585
workspaceUwsDelete({
8686
uid_list: [row.id],
8787
}).then(() => {
88+
multipleSelectionAll.value = multipleSelectionAll.value.filter((ele) => row.id !== ele.id)
8889
ElMessage({
8990
type: 'success',
90-
message: t('workspace.remove'),
91+
message: t('workspace.removed_successfully'),
9192
})
9293
search()
9394
})

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

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts" setup>
22
import delIcon from '@/assets/svg/icon_delete.svg'
3+
import icon_embedded_outlined from '@/assets/svg/icon-setting.svg'
34
import edit from '@/assets/svg/icon_edit_outlined.svg'
45
import { get_supplier } from '@/entity/supplier'
56
import { computed, ref } from 'vue'
@@ -37,16 +38,20 @@ const showErrorMask = (msg?: string) => {
3738
errorMsg.value = ''
3839
}, 3000)
3940
}
40-
const emits = defineEmits(['edit', 'del'])
41+
const emits = defineEmits(['edit', 'del', 'default'])
4142
42-
const handleEdit = () => {
43-
emits('edit')
43+
const handleDefault = () => {
44+
emits('default')
4445
}
4546
4647
const handleDel = () => {
4748
emits('del', { id: props.id, name: props.name, default_model: props.isDefault })
4849
}
4950
51+
const handleEdit = () => {
52+
emits('edit')
53+
}
54+
5055
defineExpose({ showErrorMask })
5156
</script>
5257

@@ -71,25 +76,32 @@ defineExpose({ showErrorMask })
7176
<span class="value"> {{ baseModel }}</span>
7277
</div>
7378
<div class="methods">
74-
<el-tooltip :offset="14" effect="dark" :content="$t('datasource.edit')" placement="top">
75-
<el-icon size="16" @click="handleEdit">
79+
<el-button secondary @click="handleDefault">
80+
<el-icon style="margin-right: 4px" size="16">
81+
<icon_embedded_outlined></icon_embedded_outlined>
82+
</el-icon>
83+
{{ $t('common.as_default_model') }}
84+
</el-button>
85+
<el-button secondary @click="handleEdit">
86+
<el-icon style="margin-right: 4px" size="16">
7687
<edit></edit>
7788
</el-icon>
78-
</el-tooltip>
79-
<span class="divide"></span>
80-
<el-tooltip :offset="14" effect="dark" :content="$t('dashboard.delete')" placement="top">
81-
<el-icon size="16" @click="handleDel">
89+
{{ $t('dashboard.edit') }}
90+
</el-button>
91+
<el-button secondary @click="handleDel">
92+
<el-icon style="margin-right: 4px" size="16">
8293
<delIcon></delIcon>
8394
</el-icon>
84-
</el-tooltip>
95+
{{ $t('dashboard.delete') }}
96+
</el-button>
8597
</div>
8698
</div>
8799
</template>
88100

89101
<style lang="less" scoped>
90102
.card {
91103
width: 100%;
92-
height: 160px;
104+
height: 176px;
93105
border: 1px solid #dee0e3;
94106
padding: 16px;
95107
border-radius: 12px;
@@ -139,33 +151,8 @@ defineExpose({ showErrorMask })
139151
.methods {
140152
margin-top: 16px;
141153
align-items: center;
142-
justify-content: flex-end;
143154
display: none;
144155
145-
.ed-icon {
146-
position: relative;
147-
cursor: pointer;
148-
149-
&::after {
150-
content: '';
151-
background-color: #1f23291a;
152-
position: absolute;
153-
border-radius: 6px;
154-
width: 24px;
155-
height: 24px;
156-
transform: translate(-50%, -50%);
157-
top: 50%;
158-
left: 50%;
159-
display: none;
160-
}
161-
162-
&:hover {
163-
&::after {
164-
display: block;
165-
}
166-
}
167-
}
168-
169156
.divide {
170157
height: 14px;
171158
width: 1px;

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,26 @@ const handleEditModel = (row: any) => {
191191
})
192192
}
193193
194+
const handleDefault = (row: any) => {
195+
if (row.default_model) return
196+
ElMessageBox.confirm(t('model.system_default_model', { msg: row.name }), {
197+
confirmButtonType: 'primary',
198+
tip: t('model.operate_with_caution'),
199+
confirmButtonText: t('datasource.confirm'),
200+
cancelButtonText: t('common.cancel'),
201+
customClass: 'confirm-no_icon',
202+
autofocus: false,
203+
callback: (val: string) => {
204+
if (val === 'confirm') {
205+
modelApi.setDefault(row.id).then(() => {
206+
ElMessage.success(t('model.set_successfully'))
207+
search()
208+
})
209+
}
210+
},
211+
})
212+
}
213+
194214
const deleteHandler = (item: any) => {
195215
if (item.default_model) {
196216
ElMessageBox.confirm(t('model.del_default_tip', { msg: item.name }), {
@@ -370,6 +390,7 @@ const submit = (item: any) => {
370390
:is-default="ele['default_model']"
371391
@edit="handleEditModel(ele)"
372392
@del="deleteHandler"
393+
@default="handleDefault(ele)"
373394
></card>
374395
</el-col>
375396
</el-row>

frontend/src/views/system/permission/Card.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ const setUser = () => {
8383
border-radius: 12px;
8484
&:hover {
8585
box-shadow: 0px 6px 24px 0px #1f232914;
86+
.methods {
87+
display: block;
88+
}
8689
}
8790
8891
.name-icon {
@@ -116,6 +119,7 @@ const setUser = () => {
116119
117120
.methods {
118121
margin-top: 16px;
122+
display: none;
119123
}
120124
}
121125
</style>

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ const next = () => {
447447
}
448448
})
449449
}
450-
450+
const saveLoading = ref(false)
451451
const save = () => {
452452
const { id, name, permissions, users } = cloneDeep(currentPermission)
453453
@@ -481,14 +481,20 @@ const save = () => {
481481
if (!id) {
482482
delete obj.id
483483
}
484-
savePermissions(obj).then(() => {
485-
ElMessage({
486-
type: 'success',
487-
message: t('common.save_success'),
484+
if (saveLoading.value) return
485+
saveLoading.value = true
486+
savePermissions(obj)
487+
.then(() => {
488+
ElMessage({
489+
type: 'success',
490+
message: t('common.save_success'),
491+
})
492+
beforeClose()
493+
handleSearch()
494+
})
495+
.finally(() => {
496+
saveLoading.value = false
488497
})
489-
beforeClose()
490-
handleSearch()
491-
})
492498
}
493499
const savePermission = () => {
494500
if (!isCreate.value && activeStep.value === 0) {

0 commit comments

Comments
 (0)