Skip to content

Commit 5ce2bb2

Browse files
committed
fix: bug fix
1 parent 4104b04 commit 5ce2bb2

File tree

1 file changed

+10
-1
lines changed
  • frontend/src/views/system/permission

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ const handleInitDsIdChange = (val: any) => {
219219
activeTable.value = null
220220
fieldListOptions.value = []
221221
columnForm.permissions = []
222-
authTreeRef.value.init({})
222+
if (authTreeRef.value) {
223+
authTreeRef.value.init({})
224+
}
223225
})
224226
}
225227
@@ -375,6 +377,13 @@ const closeForm = () => {
375377
const authTreeRef = ref()
376378
const saveHandler = () => {
377379
columnFormRef.value.validate((res: any) => {
380+
const names = currentPermission.permissions
381+
.filter((ele: any) => ele.id !== columnForm.id)
382+
.map((ele: any) => ele.name)
383+
if (names.includes(columnForm.name)) {
384+
ElMessage.error(t('embedded.duplicate_name'))
385+
return
386+
}
378387
if (res) {
379388
if (columnForm.type === 'row') {
380389
authTreeRef.value.submit()

0 commit comments

Comments
 (0)