You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
465 B
TypeScript
13 lines
465 B
TypeScript
import { DictValueEnumObj } from "@/components/DictTag";
|
|
import { ProSchemaValueEnumObj, ProSchemaValueEnumType } from "@ant-design/pro-components";
|
|
|
|
export function getValueEnumLabel(options: DictValueEnumObj | ProSchemaValueEnumObj, val: string | number | undefined, value?: string) {
|
|
if (val !== undefined) {
|
|
const data = options[val] as ProSchemaValueEnumType;
|
|
if(data) {
|
|
return data.text;
|
|
}
|
|
}
|
|
return value?value:val;
|
|
}
|