style: 优化布局和交互(Loading/空状态/骨架屏)
This commit is contained in:
@@ -279,8 +279,8 @@ const submitEdit = () => {
|
||||
fd.append('id', sgId.value)
|
||||
fd.append('name', editForm.name)
|
||||
fd.append('direction', editForm.direction)
|
||||
fd.append('lock', editForm.lock)
|
||||
fd.append('drop_all', editForm.drop_all)
|
||||
fd.append('lock', editForm.lock ? 'true' : 'false')
|
||||
fd.append('drop_all', editForm.drop_all ? 'true' : 'false')
|
||||
const res = await updateSecurityGroup(fd)
|
||||
if (res?.data?.code === 200) { ElMessage.success('修改成功'); editDialogVisible.value = false; loadDetail() }
|
||||
else ElMessage.error(extractApiError(res?.data, '修改失败'))
|
||||
@@ -362,7 +362,7 @@ const handleSetShared = (shared) => {
|
||||
const fd = new FormData()
|
||||
fd.append('service_id', serviceId.value)
|
||||
fd.append('id', sgId.value)
|
||||
fd.append('shared', shared)
|
||||
fd.append('shared', shared ? 'true' : 'false')
|
||||
const res = await setSecurityGroupShared(fd)
|
||||
if (res?.data?.code === 200) { ElMessage.success(`${label}成功`); loadDetail() }
|
||||
else ElMessage.error(extractApiError(res?.data, `${label}失败`))
|
||||
|
||||
@@ -2306,8 +2306,8 @@ const submitSgCreate = () => {
|
||||
fd.append('name', sgCreateForm.name)
|
||||
fd.append('host_id', sgCreateForm.host_id)
|
||||
fd.append('direction', sgCreateForm.direction)
|
||||
if (sgCreateForm.lock) fd.append('lock', true)
|
||||
if (sgCreateForm.drop_all) fd.append('drop_all', true)
|
||||
fd.append('lock', sgCreateForm.lock ? 'true' : 'false')
|
||||
fd.append('drop_all', sgCreateForm.drop_all ? 'true' : 'false')
|
||||
const res = await createSecurityGroup(fd)
|
||||
if (res?.data?.code === 200) {
|
||||
ElMessage.success('创建成功')
|
||||
|
||||
Reference in New Issue
Block a user