UNPKG

@jonas.yans/volunteer

Version:

volunteer common data

762 lines (754 loc) 17.8 kB
export enum LeaveStatus { Submit = "1", Cancel = "2", } export enum AttendanceStatus { /** * 非出勤 */ None = 0, /** * 出勤 */ Attendance = 1, /** * 请假 */ Leave = 2, } export enum DailyStatus { /** * 未到校:00000000 0 */ None = 0, /** * 接到孩子:00000001 1 */ TakeOver = 1 << 0, /** * 入校:00000010 2 */ SignIn = 1 << 1, /** * 作业已完成:00000100 4 */ HomeWork = 1 << 2, /** * 申请接孩子: 00001000 8 */ ApplySignOut = 1 << 3, /** * 同意接走:00010000 16 */ AgreeSignOut = 1 << 4, /** * 孩子已经接走:00100000 32 */ SignOut = 1 << 5, /** * 老师已反馈:01000000 64 */ TeacherFeedback = 1 << 6, } export function hasDailyStatus(target:DailyStatus,p:DailyStatus) { return (target & p) === p } export enum TeacherType { Teacher="1", VicePrincipal="2", Principal="3", } export function getTeacherTypeLable(value: any): string { const type = value as TeacherType; switch (type) { case TeacherType.Teacher: return '老师'; case TeacherType.VicePrincipal: return '副校长'; case TeacherType.Principal: return '校长'; } return ''; } export function getTeacherTypeOptions():any[] { return [ { label: '老师', value: TeacherType.Teacher }, { label: '副校长', value: TeacherType.VicePrincipal }, { label: '校长', value: TeacherType.Principal }, ]; } export enum ParentsRelationshipType { Father="1", Mother="2", Grandpa="3", Grandmother="4", Grandpa2="5", Grandmother2="6", } export function getParentsRelationshipLable(value: any): string { const type = value as ParentsRelationshipType; switch (type) { case ParentsRelationshipType.Father: return '父亲'; case ParentsRelationshipType.Mother: return '母亲'; case ParentsRelationshipType.Grandpa: return '爷爷 '; case ParentsRelationshipType.Grandmother: return '奶奶'; case ParentsRelationshipType.Grandpa2: return '姥爷'; case ParentsRelationshipType.Grandmother2: return '姥姥'; } return ''; } export function getParentsRelationshipTypeOptions():any[] { return [ { label: '父亲', value: ParentsRelationshipType.Father }, { label: '母亲', value: ParentsRelationshipType.Mother }, { label: '爷爷', value: ParentsRelationshipType.Grandpa }, { label: '奶奶', value: ParentsRelationshipType.Grandmother }, { label: '姥爷', value: ParentsRelationshipType.Grandpa2 }, { label: '姥姥', value: ParentsRelationshipType.Grandmother2 }, ]; } export enum SexType { Male = "1", FeMale = "2" } export function getSexTypeLable(value: any): string { const type = value as SexType; switch (type) { case SexType.Male: return '男'; case SexType.FeMale: return '女'; } return '未知'; } export function getSexTypeOptions():any[] { return [ { label: '男', value: SexType.Male }, { label: '女', value: SexType.FeMale }, ]; } export enum PersonType { Teacher = "1", Parents = "2", Student = "3" } export function getPersonTypeLable(value: any): string { const type = value as PersonType; switch (type) { case PersonType.Teacher : return '教师'; case PersonType.Parents : return '家长'; case PersonType.Student : return '学生'; } return ''; } export function getPersonTypeOptions():any[] { return [ { label: '教师', value: PersonType.Teacher }, { label: '家长', value: PersonType.Parents }, ]; } export enum SubjectType { Chinese = "1", Math= "2", English = "3", } export function getSubjectTypeLable(value: any): string { const type = value as SubjectType; switch (type) { case SubjectType.Chinese: return '语文'; case SubjectType.Math: return '数学'; case SubjectType.English: return '英语'; } return ''; } export function getSubjectTypeOptions():any[] { return [ { label: '语文', value: SubjectType.Chinese }, { label: '数学', value: SubjectType.Math }, { label: '英语', value: SubjectType.English }, ]; } export enum FeedbackStatus { /** * 未发布 */ None = 0, /** * 提交审核 */ Submit = 1, /** * 通过 */ Approved = 2, /** * 驳回 */ Reject = 3, } export function getFeedbackStatusOptions():any[] { return [ { label: '提交审核', value: FeedbackStatus.Submit }, { label: '通过', value: FeedbackStatus.Approved }, { label: '驳回', value: FeedbackStatus.Reject }, ]; } export function getFeedbackStatusLable(value: any): string { const type = value as FeedbackStatus; switch (type) { case FeedbackStatus.Submit: return '提交审核'; case FeedbackStatus.Approved: return '通过'; case FeedbackStatus.Reject: return '驳回'; } return ''; } export enum FeedbackType { /** * 语文 */ Chinese = 1, /** * 数学 */ Math = Chinese+1, /** * 英语 */ English = Math+1, /** * 英语语法 */ EnglishGrammar = English+1, /** * 美文 */ Beautify = EnglishGrammar+1, /** * 激励 */ Inspirit = Beautify+1, /** * 批评 */ Criticize = Inspirit+1, /** * 其它 */ Other= Criticize+1, } export function getFeedbackTypeOptions():any[] { return [ { label: '语文', value: FeedbackType.Chinese }, { label: '数学', value: FeedbackType.Math }, { label: '英语', value: FeedbackType.English }, { label: '英语语法', value: FeedbackType.EnglishGrammar }, { label: '美文', value: FeedbackType.Beautify }, { label: '激励', value: FeedbackType.Inspirit }, { label: '批评', value: FeedbackType.Criticize }, { label: '其它', value: FeedbackType.Other }, ]; } export function getFeedbackTypeLable(value: any): string { const type = value as FeedbackType; switch (type) { case FeedbackType.Chinese: return '语文'; case FeedbackType.Math: return '数学'; case FeedbackType.English: return '英语'; case FeedbackType.EnglishGrammar: return '英语语法'; case FeedbackType.Beautify: return '美文'; case FeedbackType.Inspirit: return '激励'; case FeedbackType.Criticize: return '批评'; case FeedbackType.Other: return '其它'; } return ''; } export enum SchoolStage { PrimarySchool="1", JuniorSchool="2", HighSchool="3", } export function getSchoolStageOptions():any[] { return [ { label: '小学', value: SchoolStage.PrimarySchool }, { label: '初中', value: SchoolStage.JuniorSchool }, { label: '高中', value: SchoolStage.HighSchool }, ]; } export function getSchoolStageLable(value: any): string { const type = value as SchoolStage; switch (type) { case SchoolStage.PrimarySchool: return '小学'; case SchoolStage.JuniorSchool: return '初中'; case SchoolStage.HighSchool: return '高中'; } return ''; } export enum PayCycle { /**按日 */ ByDay="1", /**按月 */ ByMonth="2", /**按次 */ ByTimes="3", } export function getPayCycleOptions():any[] { return [ { label: '按日', value: PayCycle.ByDay }, { label: '按月', value: PayCycle.ByMonth }, { label: '按次', value: PayCycle.ByTimes }, ]; } export function getPayCycleLable(value: any): string { const type = value as PayCycle; switch (type) { case PayCycle.ByDay: return '按日'; case PayCycle.ByMonth: return '按月'; case PayCycle.ByTimes: return '按次'; } return ''; } export enum PayType { /**托管费 */ Custody="1", /**餐费 */ Meal="2", /**其它 */ Other="3", } export function getPayTypeOptions():any[] { return [ { label: '托管费', value: PayType.Custody }, { label: '餐费', value: PayType.Meal }, { label: '其它', value: PayType.Other }, ]; } export function getPayTypeLable(value: any): string { const type = value as PayType; switch (type) { case PayType.Custody: return '托管费'; case PayType.Meal: return '餐费'; case PayType.Other: return '其它'; } return ''; } export enum SemesterType { /**上学期:1*/ First=1, /**下学期:2*/ Second=2, } export function getSemesterTypeOptions():any[] { return [ { label: '上学期', value: SemesterType.First }, { label: '下学期', value: SemesterType.Second }, ]; } export function getSemesterTypeLable(value: any): string { const type = value as SemesterType; switch (type) { case SemesterType.First: return '上学期'; case SemesterType.Second: return '下学期'; } return '未知'; } export enum WrongType { ChineseDictation = 1, ChinesePinyin= ChineseDictation+1, EnglishDictation = 201, EnglishRead = EnglishDictation+1, } export function getWrongTypeOptions():any[] { return [ { label: '语文默写', value: WrongType.ChineseDictation }, { label: '语文拼音', value: WrongType.ChinesePinyin }, { label: '英语默写', value: WrongType.EnglishDictation }, { label: '英语阅读', value: WrongType.EnglishRead }, ]; } export function getWrongTypeLable(value: any): string { const type = value as WrongType; switch (type) { case WrongType.ChineseDictation: return '语文默写'; case WrongType.ChinesePinyin: return '语文拼音'; case WrongType.EnglishDictation: return '英语默写'; case WrongType.EnglishRead: return '英语阅读'; } return '未知'; } /** * 民族 */ export enum NationType { /** * 汉族 */ Nation01 = 1, /** * 满族 */ Nation02 = Nation01 + 1, /** * 蒙古族 */ Nation03 = Nation02 + 1, /** * 回族 */ Nation04 = Nation03 + 1, /** * 藏族 */ Nation05 = Nation04 + 1, /** * 维吾尔族 */ Nation06 = Nation05 + 1, /** * 苗族 */ Nation07 = Nation06 + 1, /** * 彝族 */ Nation08 = Nation07 + 1, /** * 壮族 */ Nation09 = Nation08 + 1, /** * 布依族 */ Nation10 = Nation09 + 1, /** * 侗族 */ Nation11 = Nation10 + 1, /** * 瑶族 */ Nation12 = Nation11 + 1, /** * 白族 */ Nation13 = Nation12 + 1, /** * 土家族 */ Nation14 = Nation13 + 1, /** * 哈尼族 */ Nation15 = Nation14 + 1, /** * 哈萨克族 */ Nation16 = Nation15 + 1, /** * 傣族 */ Nation17 = Nation16 + 1, /** * 黎族 */ Nation18 = Nation17 + 1, /** * 傈僳族 */ Nation19 = Nation18 + 1, /** * 佤族 */ Nation20 = Nation19 + 1, /** * 畲族 */ Nation21 = Nation20 + 1, /** * 高山族 */ Nation22 = Nation21 + 1, /** * 拉祜族 */ Nation23 = Nation22 + 1, /** * 水族 */ Nation24 = Nation23 + 1, /** * 东乡族 */ Nation25 = Nation24 + 1, /** * 纳西族 */ Nation26 = Nation25 + 1, /** * 景颇族 */ Nation27 = Nation26 + 1, /** * 柯尔克孜族 */ Nation28 = Nation27 + 1, /** * 土族 */ Nation29 = Nation28 + 1, /** * 达斡尔族 */ Nation30 = Nation29 + 1, /** * 仫佬族 */ Nation31 = Nation30 + 1, /** * 羌族 */ Nation32 = Nation31 + 1, /** * 布朗族 */ Nation33 = Nation32 + 1, /** * 撒拉族 */ Nation34 = Nation33 + 1, /** * 毛南族 */ Nation35 = Nation34 + 1, /** * 仡佬族 */ Nation36 = Nation35 + 1, /** * 锡伯族 */ Nation37 = Nation36 + 1, /** * 阿昌族 */ Nation38 = Nation37 + 1, /** * 普米族 */ Nation39 = Nation38 + 1, /** * 塔吉克族 */ Nation40 = Nation39 + 1, /** * 怒族 */ Nation41 = Nation40 + 1, /** * 乌孜别克族 */ Nation42 = Nation41 + 1, /** * 俄罗斯族 */ Nation43 = Nation42 + 1, /** * 鄂温克族 */ Nation44 = Nation43 + 1, /** * 德昂族 */ Nation45 = Nation44 + 1, /** * 保安族 */ Nation46 = Nation45 + 1, /** * 裕固族 */ Nation47 = Nation46 + 1, /** * 京族 */ Nation48 = Nation47 + 1, /** * 塔塔尔族 */ Nation49 = Nation48 + 1, /** * 独龙族 */ Nation50 = Nation49 + 1, /** * 鄂伦春族 */ Nation51 = Nation50 + 1, /** * 赫哲族 */ Nation52 = Nation51 + 1, /** * 门巴族 */ Nation53 = Nation52 + 1, /** * 珞巴族 */ Nation54 = Nation53 + 1, /** * 基诺族 */ Nation55 = Nation54 + 1, /** * 朝鲜族 */ Nation56 = Nation55 + 1, } const NationMap =new Map() as Map<NationType,string> function initNationMap(){ NationMap.set(NationType.Nation01 ,"汉族"); NationMap.set(NationType.Nation02 ,"满族"); NationMap.set(NationType.Nation03 ,"蒙古族"); NationMap.set(NationType.Nation04 ,"回族"); NationMap.set(NationType.Nation05 ,"藏族"); NationMap.set(NationType.Nation06 ,"维吾尔族"); NationMap.set(NationType.Nation07 ,"苗族"); NationMap.set(NationType.Nation08 ,"彝族"); NationMap.set(NationType.Nation09 ,"壮族"); NationMap.set(NationType.Nation10 ,"布依族"); NationMap.set(NationType.Nation11 ,"侗族"); NationMap.set(NationType.Nation12 ,"瑶族"); NationMap.set(NationType.Nation13 ,"白族"); NationMap.set(NationType.Nation14 ,"土家族"); NationMap.set(NationType.Nation15 ,"哈尼族"); NationMap.set(NationType.Nation16 ,"哈萨克族"); NationMap.set(NationType.Nation17 ,"傣族"); NationMap.set(NationType.Nation18 ,"黎族"); NationMap.set(NationType.Nation19 ,"傈僳族"); NationMap.set(NationType.Nation20 ,"佤族"); NationMap.set(NationType.Nation21 ,"畲族"); NationMap.set(NationType.Nation22 ,"高山族"); NationMap.set(NationType.Nation23 ,"拉祜族"); NationMap.set(NationType.Nation24 ,"水族"); NationMap.set(NationType.Nation25 ,"东乡族"); NationMap.set(NationType.Nation26 ,"纳西族"); NationMap.set(NationType.Nation27 ,"景颇族"); NationMap.set(NationType.Nation28 ,"柯尔克孜族"); NationMap.set(NationType.Nation29 ,"土族"); NationMap.set(NationType.Nation30 ,"达斡尔族"); NationMap.set(NationType.Nation31 ,"仫佬族"); NationMap.set(NationType.Nation32 ,"羌族"); NationMap.set(NationType.Nation33 ,"布朗族"); NationMap.set(NationType.Nation34 ,"撒拉族"); NationMap.set(NationType.Nation35 ,"毛南族"); NationMap.set(NationType.Nation36 ,"仡佬族"); NationMap.set(NationType.Nation37 ,"锡伯族"); NationMap.set(NationType.Nation38 ,"阿昌族"); NationMap.set(NationType.Nation39 ,"普米族"); NationMap.set(NationType.Nation40 ,"塔吉克族"); NationMap.set(NationType.Nation41 ,"怒族"); NationMap.set(NationType.Nation42 ,"乌孜别克族"); NationMap.set(NationType.Nation43 ,"俄罗斯族"); NationMap.set(NationType.Nation44 ,"鄂温克族"); NationMap.set(NationType.Nation45 ,"德昂族"); NationMap.set(NationType.Nation46 ,"保安族"); NationMap.set(NationType.Nation47 ,"裕固族"); NationMap.set(NationType.Nation48 ,"京族"); NationMap.set(NationType.Nation49 ,"塔塔尔族"); NationMap.set(NationType.Nation50 ,"独龙族"); NationMap.set(NationType.Nation51 ,"鄂伦春族"); NationMap.set(NationType.Nation52 ,"赫哲族"); NationMap.set(NationType.Nation53 ,"门巴族"); NationMap.set(NationType.Nation54 ,"珞巴族"); NationMap.set(NationType.Nation55 ,"基诺族"); NationMap.set(NationType.Nation56 ,"朝鲜族"); } initNationMap(); export function getNationTypeOptions():any[] { const list = []; for (const item of NationMap) { list.push({ label: item[1], value: item[0] }) } return list; } export function getNationTypeLable(value: any): string { const type = value as NationType; const item = NationMap.get(type); if(item){ return item; } return '未知'; } /** * 政治面貌 */ export enum PoliticalType { /**群众 */ Mass=1, /** 党员*/ PartyMembers=Mass+1, /**团员 */ LeagueMembers=PartyMembers+1, /**民主党派 */ Democratic=LeagueMembers+1, } export function getPoliticalTypeOptions():any[] { return [ { label: '群众', value: PoliticalType.Mass }, { label: '党员', value: PoliticalType.PartyMembers }, { label: '团员', value: PoliticalType.LeagueMembers }, { label: '民主党派', value: PoliticalType.Democratic }, ]; } export function getPoliticalTypeLable(value: any): string { const type = value as PoliticalType; switch (type) { case PoliticalType.Mass: return '群众'; case PoliticalType.PartyMembers: return '党员'; case PoliticalType.LeagueMembers: return '团员'; case PoliticalType.Democratic: return '民主党派'; } return '未知'; }