yanjinhui
10 天以前 c5de0d98241f8c8349fa38851b77efcfc61e4d26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import request from '@/axios'
import type { UserType } from './types'
 
interface RoleParams {
  roleName: string
}
 
export const loginApi = (data: UserType): Promise<IResponse<UserType>> => {
  return request.post({ url: '/api/User/login', data })
}
 
export const loginOutApi = (): Promise<IResponse> => {
  return request.get({ url: '/mock/user/loginOut' })
}
 
export const getUserListApi = ({ params }: AxiosConfig) => {
  return request.get<{
    code: string
    data: {
      list: UserType[]
      total: number
    }
  }>({ url: '/mock/user/list', params })
}
 
export const getAdminRoleApi = (
  params: RoleParams
): Promise<IResponse<AppCustomRouteRecordRaw[]>> => {
  return {
    code: 0,
    data: [
      {
        path: '/dashboard',
        component: '#',
        redirect: '/dashboard/analysis',
        name: 'Dashboard',
        meta: {
          title: 'router.dashboard',
          icon: 'vi-ant-design:dashboard-filled',
          alwaysShow: true
        },
        children: [
          {
            path: 'analysis',
            component: 'views/Dashboard/Analysis',
            name: 'Analysis',
            meta: {
              title: 'router.analysis',
              noCache: true,
              affix: true
            }
          }
        ]
      },
      {
        path: '/tts',
        component: '#',
        redirect: '/tts/PickAndDrop',
        name: 'tts',
        meta: {
          title: 'router.function',
          icon: 'vi-ri:function-fill',
          alwaysShow: true
        },
        children: [
          {
            path: 'PickAndDrop',
            component: 'views/tts/PickAndDrop/PickAndDrop',
            name: 'PickAndDrop',
            meta: {
              title: '接送车'
            }
          },
          // {
          //   path: 'Maintenancemanagement',
          //   component: 'views/tts/Maintenancemanagement/Maintenancemanagement',
          //   name: 'Maintenancemanagement',
          //   meta: {
          //     title: '检修管理'
          //   }
          // },
          {
            path: 'AlarmReset',
            component: 'views/tts/AlarmReset/AlarmReset',
            name: 'AlarmReset',
            meta: {
              title: '报警复位'
            }
          },
          {
            path: 'Datalogging',
            component: 'views/tts/Datalogging/Datalogging',
            name: 'Datalogging',
            meta: {
              title: '数据记录'
            }
          }
        ]
      },
      {
        path: '/authorization',
        component: '#',
        redirect: '/authorization/user',
        name: 'Authorization',
        meta: {
          title: 'router.authorization',
          icon: 'vi-eos-icons:role-binding',
          alwaysShow: true
        },
        children: [
          // { //部门
          //   path: 'department',
          //   component: 'views/Authorization/Department/Department',
          //   name: 'Department',
          //   meta: {
          //     title: 'router.department'
          //   }
          // },
          {
            path: 'user',
            component: 'views/Authorization/User/User',
            name: 'User',
            meta: {
              title: 'router.user'
            }
          },
          {
            path: 'role',
            component: 'views/Authorization/Role/Role',
            name: 'Role',
            meta: {
              title: 'router.role'
            }
          },
          {
            path: 'Team',
            component: 'views/Authorization/Team/Team',
            name: 'Team',
            meta: {
              title: '班组管理'
            }
          },
          {
            path: 'Unit',
            component: 'views/Authorization/Unit/Unit',
            name: 'Unit',
            meta: {
              title: '单位管理'
            }
          },
          {
            path: 'iPaddress',
            component: 'views/Authorization/iPaddress/iPaddress',
            name: 'iPaddress',
            meta: {
              title: '检修道管理'
            }
          }
        ]
      }
    ]
  }
}
 
export const getTestRoleApi = (params: RoleParams): Promise<IResponse<string[]>> => {
  return request.get({ url: '/mock/role/list2', params })
}