This commit is contained in:
parent
1ad3d7379f
commit
c07b0128c8
|
|
@ -100,6 +100,8 @@ const responseInterceptor = <T = unknown>(response: AxiosResponse<ApiResponse<T>
|
|||
} else {
|
||||
switch (data.code) {
|
||||
case 1:
|
||||
// 跳转到注册页
|
||||
router.push('/user/register')
|
||||
if (!data.msg) {
|
||||
data.msg = '未知的错误!'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ const staticMenuList = ref<ElMenuItem[]>([
|
|||
{
|
||||
id: 33,
|
||||
label: '做市商管理',
|
||||
path: '/account/market-maker', // index="3-3"
|
||||
path: '/account/marketMaker', // index="3-3"
|
||||
icon: '',
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -132,9 +132,9 @@ const routes = [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: 'market-maker',
|
||||
path: 'marketMaker',
|
||||
name: 'MarketMaker',
|
||||
component: () => import('@/views/account/market-maker/index.vue'),
|
||||
component: () => import('@/views/account/marketMaker/index.vue'),
|
||||
meta: {
|
||||
title: '做市商管理', // 左侧菜单显示的标题
|
||||
},
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ onMounted(async () => {
|
|||
@description: 处理菜单编辑/删除/状态切换
|
||||
**/
|
||||
const handleEditMenu = (row: any) => {
|
||||
console.log('编辑菜单', row)
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '编辑菜单'
|
||||
dialogType.value = 'edit'
|
||||
|
|
@ -140,6 +141,7 @@ const handleEditMenu = (row: any) => {
|
|||
id: row.id, // 菜单id
|
||||
parentName: row.name,
|
||||
status: row.status ?? 1, // 默认是启用状态
|
||||
api: row.api, // 后端路由
|
||||
}
|
||||
}
|
||||
const handleDeleteMenu = async (row: any) => {
|
||||
|
|
@ -163,7 +165,7 @@ const handleSubmit = async () => {
|
|||
name: menuForm.value.name, // 菜单名称
|
||||
parent_id: menuForm.value.parentName, // 上级菜单id
|
||||
path: menuForm.value.path, // 路由路径
|
||||
api: menuForm.value.api, // 后端路由
|
||||
api: menuForm.value.api , // 后端路由
|
||||
icon: menuForm.value.icon, // 图标名称
|
||||
sort: menuForm.value.sort ?? 1, // 排序(默认1)
|
||||
type: menuForm.value.type ?? 1, // 默认是菜单类型
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ export const menuTableColumns = [
|
|||
export const menuFormItemOptions = [
|
||||
{ prop: 'name', label: '菜单名称', type: 'input' as const,placeholder: '请输入菜单名称' },
|
||||
{ prop: 'parentName', label: '父级菜单', type: 'select' as const, placeholder: '请选择父级菜单' },
|
||||
{ prop: 'path', label: '路由路径', type: 'input' as const, placeholder: '请输入路由路径' },
|
||||
{ prop: 'path', label: '前端路由', type: 'input' as const, placeholder: '请输入前端路由路径' },
|
||||
{ prop: 'api', label: '后端路由', type: 'input' as const, placeholder: '请输入后端路由' },
|
||||
{ prop: 'icon', label: '图标名称', type: 'select' as const, placeholder: '请选择图标名称' },
|
||||
{ prop: 'sort', label: '排序', type: 'number' as const, placeholder: '请输入排序,数字越小越靠前' },
|
||||
{ prop: 'type', label: '菜单类型', type: 'radio' as const, placeholder: '请选择菜单类型' },
|
||||
|
|
|
|||
|
|
@ -12,8 +12,12 @@ export const rules = (menuForm: any, iconOptions: any[]): FormRules => {
|
|||
],
|
||||
// 3. 路由路径:必填 + 格式校验(以/开头,仅包含字母/数字/下划线/斜杠)
|
||||
path: [
|
||||
{ required: true, message: '请输入路由路径', trigger: 'blur' },
|
||||
{ pattern: /^\/[a-zA-Z0-9_\/]+$/, message: '路由路径必须以/开头,仅包含字母、数字、下划线和斜杠', trigger: 'blur' }
|
||||
{ required: true, message: '请输入前端路由路径', trigger: 'blur' },
|
||||
{ pattern: /^\/[a-zA-Z0-9_\/]+$/, message: '前端路由路径必须以/开头,仅包含字母、数字、下划线和斜杠', trigger: 'blur' }
|
||||
],
|
||||
// 4. 后端路由:可选,但填了就必须是指定范围(匹配你提供的后端路由列表)
|
||||
api: [
|
||||
{required: true, message: '请输入后端路由', trigger: 'blur' }
|
||||
],
|
||||
// 5. 图标名称:可选,但填了就必须是指定范围(匹配你提供的图标列表)
|
||||
icon: [
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export const DialogFormItem = [
|
|||
// 交易状态
|
||||
{ prop: 'tradeStatus', label: '交易状态', type: 'switch' as const },
|
||||
// 是否默认
|
||||
{ prop: 'isDefault', label: '', type: 'slot' as const, slotName: 'isDefault' },
|
||||
{ prop: 'isDefault', label: '是否默认', type: 'slot' as const, slotName: 'isDefault' },
|
||||
// 上传图片地址
|
||||
{ prop: 'imageUrl', slotName: 'upload', label: '上传图片', type: 'upload' as const },
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue