mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-14 20:53:41 +08:00
feat(projects): page manage_role
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { $t } from '@/locales';
|
||||
|
||||
/**
|
||||
* Transform record to option
|
||||
*
|
||||
@@ -20,5 +22,17 @@ export function transformRecordToOption<T extends Record<string, string>>(record
|
||||
return Object.entries(record).map(([value, label]) => ({
|
||||
value,
|
||||
label
|
||||
})) as Common.Option<keyof T>[];
|
||||
})) as CommonType.Option<keyof T>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate options
|
||||
*
|
||||
* @param options
|
||||
*/
|
||||
export function translateOptions(options: CommonType.Option<string>[]) {
|
||||
return options.map(option => ({
|
||||
...option,
|
||||
label: $t(option.label as App.I18n.I18nKey)
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user