forked from WinmezzZ/react-antd-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Winme
committed
Jan 31, 2020
1 parent
488ff49
commit 2af833b
Showing
30 changed files
with
247 additions
and
562 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { request } from '../request' | ||
import { GetRoleResult } from '~/interface/permission/role.interface' | ||
|
||
/** get role list api */ | ||
export const apiGetRoleList = () => request<GetRoleResult>('get', '/permission/role') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Language } from '~/interface' | ||
|
||
const en_US = { | ||
tableFrom: { | ||
search: 'Query', | ||
reset: 'Reset', | ||
collapsed: 'Expand', | ||
expand: 'Collapse', | ||
inputPlaceholder: 'Please enter', | ||
selectPlaceholder: 'Please select' | ||
}, | ||
alert: { | ||
clear: 'Clear' | ||
}, | ||
tableToolBar: { | ||
leftPin: 'Pin to left', | ||
rightPin: 'Pin to right', | ||
noPin: 'Unpinned', | ||
leftFixedTitle: 'Fixed the left', | ||
rightFixedTitle: 'Fixed the right', | ||
noFixedTitle: 'Not Fixed', | ||
reset: 'Reset', | ||
columnDisplay: 'Column Display', | ||
columnSetting: 'Settings', | ||
fullScreen: 'Full Screen', | ||
exitFullScreen: 'Exit Full Screen', | ||
reload: 'Refresh', | ||
density: 'Density', | ||
densityLarger: 'Default', | ||
densityMiddle: 'Middle', | ||
densitySmall: 'Compact' | ||
} | ||
} | ||
|
||
const zh_CN = { | ||
tableFrom: { | ||
search: '查询', | ||
reset: '重置', | ||
collapsed: '展开', | ||
expand: '收起', | ||
inputPlaceholder: '请输入', | ||
selectPlaceholder: '请选择' | ||
}, | ||
alert: { | ||
clear: '清空' | ||
}, | ||
tableToolBar: { | ||
leftPin: '固定到左边', | ||
rightPin: '固定到右边', | ||
noPin: '取消固定', | ||
leftFixedTitle: '固定在左侧', | ||
rightFixedTitle: '固定在右侧', | ||
noFixedTitle: '不固定', | ||
reset: '重置', | ||
columnDisplay: '列展示', | ||
columnSetting: '列设置', | ||
fullScreen: '全屏', | ||
exitFullScreen: '退出全屏', | ||
reload: '刷新', | ||
density: '密度', | ||
densityLarger: '正常', | ||
densityMiddle: '中等', | ||
densitySmall: '紧凑' | ||
} | ||
} | ||
|
||
export default function useProTableLocale(lang: Language) { | ||
if (lang === 'zh_CN') return zh_CN | ||
if (lang === 'en_US') return en_US | ||
return zh_CN | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface Locales<T = any> { | ||
/** Chinese */ | ||
zh_CN: T | ||
/** English */ | ||
en_US: T | ||
} | ||
|
||
export type Language = keyof Locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export type RoleStatus = 'enabled' | 'disabled' | 'all' | ||
|
||
export interface Role { | ||
name: { | ||
zh_CN: string | ||
en_US: string | ||
} | ||
code: string | ||
id: number | ||
status: RoleStatus | ||
} | ||
|
||
export type GetRoleResult = Role[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const enUS_permissionRole = { | ||
'app.permission.role.name': 'Role Name', | ||
'app.permission.role.code': 'Role Code', | ||
'app.permission.role.status': 'Status', | ||
'app.permission.role.status.all': 'All', | ||
'app.permission.role.status.enabled': 'Enabled', | ||
'app.permission.role.status.disabled': 'Disabled' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const zhCN_permissionRole = { | ||
'app.permission.role.name': '角色名称', | ||
'app.permission.role.code': '角色编码', | ||
'app.permission.role.status': '状态', | ||
'app.permission.role.status.all': '全部', | ||
'app.permission.role.status.enabled': '启用', | ||
'app.permission.role.status.disabled': '禁用' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
import './user' | ||
import './permission' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './role.mock' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { mock, intercepter } from '../config' | ||
import { Role } from '~/interface/permission/role.interface' | ||
|
||
const roles: Role[] = [ | ||
{ | ||
name: { | ||
zh_CN: '访客', | ||
en_US: 'Guest' | ||
}, | ||
code: 'role_guest', | ||
id: 0, | ||
status: 'enabled' | ||
}, | ||
{ | ||
name: { | ||
zh_CN: '管理员', | ||
en_US: 'Admin' | ||
}, | ||
code: 'role_admin', | ||
id: 1, | ||
status: 'enabled' | ||
} | ||
] | ||
|
||
mock.mock('/permission/role', 'get', intercepter(roles)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.