UNPKG

generator-hcy-system

Version:

hcy system layout and pages

155 lines (151 loc) 3.35 kB
import { FormattedMessage } from '@umijs/max'; import { Tag, Badge } from 'antd'; import { ManOutlined, WomanOutlined, QuestionOutlined } from '@ant-design/icons'; // 用户中心-部门管理-组织类型 export const teamType = [ { value: '1', label: <FormattedMessage id="companyMange.form.company" defaultMessage="公司" />, }, { value: '2', label: <FormattedMessage id="companyMange.form.department" defaultMessage="部门" />, }, { value: '3', label: <FormattedMessage id="companyMange.form.group" defaultMessage="小组" />, }, ]; // 性别 export const genderMessage = (code) => { switch (parseInt(code)) { case 0: return <FormattedMessage id="userMange.form.Man" defaultMessage="男" />; case 1: return <FormattedMessage id="userMange.form.Woman" defaultMessage="女" />; case 2: return <FormattedMessage id="userMange.text.NoSex" defaultMessage="未知" />; default: return '-'; } }; // 用户平台 export const userPlatForm = (code) => { switch (parseInt(code)) { case 10: return 'Windows 10'; default: return '--'; } }; // 账号状态 export const accountStatus = (code) => { switch (parseInt(code)) { case 0: return <Tag color="success"><FormattedMessage id="userMange.text.available" defaultMessage="可用" /></Tag>; case 1: return <Tag color="error"><FormattedMessage id="userMange.text.disable" defaultMessage="不可用" /></Tag>; default: return '-'; } }; // 账号状态 export const accountStatusByUser = (code) => { switch (code) { case 1: return ( <Badge text={ <span style={{ color: 'rgba(0, 0, 0, 25%)' }}> <FormattedMessage id="columns.handel.disabled" /> </span> } color="rgba(0, 0, 0, 10%)" /> ); case 0: return ( <Badge text={<FormattedMessage id="columns.handel.enable" />} color="#1677FF" /> ); case true: return ( <Badge text={ <span style={{ color: 'rgba(0, 0, 0, 25%)' }}> <FormattedMessage id="columns.handel.disabled" /> </span> } color="rgba(0, 0, 0, 10%)" /> ); case false: return ( <Badge text={<FormattedMessage id="columns.handel.enable" />} color="#1677FF" /> ); default: return '-'; } }; // 账号状态 export const sexTag = (code) => { switch (parseInt(code)) { case 0: return <ManOutlined style={{ color: 'blue' }} />; case 1: return <WomanOutlined style={{ color: '#eb2f96' }} />; case 2: return <QuestionOutlined />; default: return '-'; } }; // 性别 export const sexOption = [ { value: 0, label: <FormattedMessage id="userMange.form.male" />, }, { value: 1, label: <FormattedMessage id="userMange.form.female" />, }, { value: 2, label: <FormattedMessage id="userMange.form.Secrecy" />, }, ];