fetch(modify):修复API的URL
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m1s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m1s
This commit is contained in:
@@ -89,6 +89,12 @@
|
||||
<ElFormItem label="排序序号" prop="sort">
|
||||
<ElInputNumber v-model="form.sort" :min="0" :max="9999" style="width: 100%" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="状态" prop="status">
|
||||
<ElRadioGroup v-model="form.status">
|
||||
<ElRadio :value="1">启用</ElRadio>
|
||||
<ElRadio :value="0">禁用</ElRadio>
|
||||
</ElRadioGroup>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@@ -110,6 +116,8 @@
|
||||
ElMessage,
|
||||
ElMessageBox,
|
||||
ElTag,
|
||||
ElRadio,
|
||||
ElRadioGroup,
|
||||
type FormInstance,
|
||||
type FormRules
|
||||
} from 'element-plus'
|
||||
@@ -123,7 +131,9 @@
|
||||
PERMISSION_TYPE_OPTIONS,
|
||||
PERMISSION_TYPE_SELECT_OPTIONS,
|
||||
getPermissionTypeText,
|
||||
getPermissionTypeTag
|
||||
getPermissionTypeTag,
|
||||
CommonStatus,
|
||||
getStatusText
|
||||
} from '@/config/constants'
|
||||
|
||||
defineOptions({ name: 'Permission' })
|
||||
@@ -177,6 +187,7 @@
|
||||
{ label: '权限类型', prop: 'perm_type' },
|
||||
{ label: '菜单路径', prop: 'url' },
|
||||
{ label: '适用端口', prop: 'platform' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
{ label: '排序', prop: 'sort' },
|
||||
{ label: '操作', prop: 'operation' }
|
||||
]
|
||||
@@ -195,14 +206,15 @@
|
||||
|
||||
// 表单引用和数据
|
||||
const formRef = ref<FormInstance>()
|
||||
const form = reactive<CreatePermissionParams>({
|
||||
const form = reactive<CreatePermissionParams & { status?: number }>({
|
||||
perm_name: '',
|
||||
perm_code: '',
|
||||
perm_type: PermissionType.MENU,
|
||||
parent_id: undefined,
|
||||
url: '',
|
||||
platform: 'all',
|
||||
sort: 0
|
||||
sort: 0,
|
||||
status: CommonStatus.ENABLED
|
||||
})
|
||||
|
||||
// 表单验证规则
|
||||
@@ -261,6 +273,21 @@
|
||||
return platformMap[row.platform || 'all'] || row.platform
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 80,
|
||||
formatter: (row: PermissionTreeNode) => {
|
||||
const status = row.status ?? CommonStatus.ENABLED
|
||||
return h(
|
||||
ElTag,
|
||||
{
|
||||
type: status === CommonStatus.ENABLED ? 'success' : 'info'
|
||||
},
|
||||
() => getStatusText(status)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'sort',
|
||||
label: '排序',
|
||||
@@ -396,7 +423,8 @@
|
||||
parent_id: undefined, // 树结构中没有parent_id,需要从API获取
|
||||
url: row.url || '',
|
||||
platform: row.platform || 'all',
|
||||
sort: row.sort || 0
|
||||
sort: row.sort || 0,
|
||||
status: row.status ?? CommonStatus.ENABLED
|
||||
})
|
||||
} else {
|
||||
currentPermissionId.value = 0
|
||||
@@ -469,7 +497,8 @@
|
||||
parent_id: undefined,
|
||||
url: '',
|
||||
platform: 'all',
|
||||
sort: 0
|
||||
sort: 0,
|
||||
status: CommonStatus.ENABLED
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user