Skip to content

Commit e072a2b

Browse files
committed
fix: bug fix
1 parent 0b414a9 commit e072a2b

File tree

5 files changed

+47
-16
lines changed

5 files changed

+47
-16
lines changed

frontend/src/i18n/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@
458458
"add_interface_credentials": "Add interface credentials",
459459
"edit_interface_credentials": "Edit interface credentials",
460460
"duplicate_name": "Duplicate name",
461+
"duplicate_name_": "Duplicate name",
462+
"duplicate_account": "Duplicate account",
463+
"duplicate_email": "Duplicate email",
461464
"interface_credentials": "Interface credentials",
462465
"no_credentials_yet": "No credentials yet",
463466
"intelligent_customer_service": "SQLBot Intelligent Customer Service"
@@ -506,4 +509,4 @@
506509
"back_community": "Restore to Community Edition",
507510
"confirm_tips": "Are you sure to restore to Community Edition?"
508511
}
509-
}
512+
}

frontend/src/i18n/zh-CN.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@
463463
"add_interface_credentials": "添加接口凭证",
464464
"edit_interface_credentials": "编辑接口凭证",
465465
"duplicate_name": "重复名称",
466+
"duplicate_name_": "重复姓名",
467+
"duplicate_account": "重复账号",
468+
"duplicate_email": "重复邮箱",
466469
"interface_credentials": "接口凭证",
467470
"no_credentials_yet": "暂无凭证",
468471
"intelligent_customer_service": "SQLBot 智能客服",
@@ -518,4 +521,4 @@
518521
"back_community": "还原至社区版",
519522
"confirm_tips": "确定还原至社区版?"
520523
}
521-
}
524+
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ function addToDashboard() {
209209
<div class="chart-select-container">
210210
<el-tooltip effect="dark" :content="t('chat.type')" placement="top">
211211
<ChartPopover
212-
:chartTypeList="chartTypeList"
213-
:chartType="chartType"
214-
:title="t('chat.type')"
215-
@typeChange="onTypeChange"
216212
v-if="chartTypeList.length > 0"
213+
:chart-type-list="chartTypeList"
214+
:chart-type="chartType"
215+
:title="t('chat.type')"
216+
@type-change="onTypeChange"
217217
></ChartPopover>
218218
</el-tooltip>
219219

frontend/src/views/ds/DataTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ const btnSelectClick = (val: any) => {
335335
</el-button>
336336
</div>
337337

338-
<div class="preview-or-schema" v-if="!loading">
338+
<div v-if="!loading" class="preview-or-schema">
339339
<div v-if="btnSelect === 'd'" class="table-content_preview">
340340
<el-table :data="fieldListComputed" style="width: 100%">
341341
<el-table-column

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

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ import IconLock from '@/assets/svg/icon-key_outlined.svg'
312312
import IconOpeEdit from '@/assets/svg/icon_edit_outlined.svg'
313313
import IconOpeDelete from '@/assets/svg/icon_delete.svg'
314314
import iconFilter from '@/assets/svg/icon-filter_outlined.svg'
315-
import ccmUpload from '@/assets/svg/icon_ccm-upload_outlined.svg'
315+
// import ccmUpload from '@/assets/svg/icon_ccm-upload_outlined.svg'
316316
import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
317317
import { userApi } from '@/api/user'
318318
import { workspaceList } from '@/api/workspace'
@@ -451,9 +451,9 @@ const handleEditPassword = (id: any) => {
451451
})
452452
}
453453
454-
const handleUserImport = () => {
455-
userImportRef.value.showDialog()
456-
}
454+
// const handleUserImport = () => {
455+
// userImportRef.value.showDialog()
456+
// }
457457
458458
const handleConfirmPassword = () => {
459459
passwordRef.value.validate((val: any) => {
@@ -661,14 +661,39 @@ const editTerm = () => {
661661
})
662662
})
663663
}
664+
665+
const duplicateName = async () => {
666+
const res = await userApi.pager({}, 1, 1000)
667+
const arr = res.filter((ele: any) => ele.id !== state.form.id)
668+
const names = arr.map((ele: any) => ele.name)
669+
const accounts = arr.map((ele: any) => ele.account)
670+
const emails = arr.map((ele: any) => ele.email)
671+
if (names.includes(state.form.name)) {
672+
ElMessage.error(t('embedded.duplicate_name_'))
673+
return
674+
}
675+
676+
if (accounts.includes(state.form.account)) {
677+
ElMessage.error(t('embedded.duplicate_account'))
678+
return
679+
}
680+
681+
if (emails.includes(state.form.email)) {
682+
ElMessage.error(t('embedded.duplicate_email'))
683+
return
684+
}
685+
686+
if (state.form.id) {
687+
editTerm()
688+
} else {
689+
addTerm()
690+
}
691+
}
692+
664693
const saveHandler = () => {
665694
termFormRef.value.validate((res: any) => {
666695
if (res) {
667-
if (state.form.id) {
668-
editTerm()
669-
} else {
670-
addTerm()
671-
}
696+
duplicateName()
672697
}
673698
})
674699
}

0 commit comments

Comments
 (0)