feat(keys): auto-generate entity keys and remove manual key input from admin create forms
This commit is contained in:
@@ -93,9 +93,6 @@
|
||||
|
||||
<el-dialog v-model="showCreateGroup" title="新增群組" @close="resetCreateForm">
|
||||
<el-form :model="createForm" label-width="120px">
|
||||
<el-form-item label="Group Key">
|
||||
<el-input v-model="createForm.group_key" placeholder="group-001" />
|
||||
</el-form-item>
|
||||
<el-form-item label="群組名稱">
|
||||
<el-input v-model="createForm.name" placeholder="群組名稱" />
|
||||
</el-form-item>
|
||||
@@ -157,7 +154,7 @@ const members = ref([])
|
||||
|
||||
const showCreateGroup = ref(false)
|
||||
const creatingGroup = ref(false)
|
||||
const createForm = reactive({ group_key: '', name: '' })
|
||||
const createForm = reactive({ name: '' })
|
||||
|
||||
const showEditGroup = ref(false)
|
||||
const savingGroup = ref(false)
|
||||
@@ -198,7 +195,6 @@ const filteredModuleOptions = computed(() => {
|
||||
})
|
||||
|
||||
function resetCreateForm() {
|
||||
createForm.group_key = ''
|
||||
createForm.name = ''
|
||||
}
|
||||
|
||||
@@ -245,14 +241,14 @@ async function loadCatalogs() {
|
||||
}
|
||||
|
||||
async function handleCreateGroup() {
|
||||
if (!createForm.group_key || !createForm.name) {
|
||||
if (!createForm.name) {
|
||||
ElMessage.warning('請填寫完整資訊')
|
||||
return
|
||||
}
|
||||
creatingGroup.value = true
|
||||
try {
|
||||
await createPermissionGroup(createForm)
|
||||
ElMessage.success('新增成功')
|
||||
const res = await createPermissionGroup(createForm)
|
||||
ElMessage.success(`新增成功:${res.data?.group_key || ''}`)
|
||||
showCreateGroup.value = false
|
||||
resetCreateForm()
|
||||
await loadGroups()
|
||||
|
||||
Reference in New Issue
Block a user