import Vue from 'vue' // 合并数组 Vue.filter('joinArray', (value, type) => { if (!type) { type = ' ' } if (typeof value == 'object' && value != null) { return value.join(type) } else { return value } }) // 合作单位 Vue.filter('branchType', (value) => { let template = { OWN: "自有", COOPERATION: "合作", LEASE: "租赁" } return template[value] }) // 商品类型 Vue.filter('shopType', (value) => { let template = { "INSTRUMENT": "乐器", "ACCESSORIES": "辅件", "TEACHING": "教材", "STAFF": "教谱", "OTHER": "其它", } return template[value] }) // 乐团状态 Vue.filter('musicGroupType', (value) => { let template = { APPLY: "报名中", PAY: "缴费中", PREPARE: "筹备中", PROGRESS: "进行中", CANCELED: '取消', PAUSE: '暂停', AUDIT: '审核中', DRAFT: '编辑中', AUDIT_FAILED: '审核失败' } return template[value] }) // 乐团学员状态 Vue.filter('musicGroupStudentType', (value) => { let template = { NORMAL: "在读", LEAVE: "请假", QUIT: "退团" } return template[value] }) // 乐团学员状态 Vue.filter('instrumentType', (value) => { let template = { GROUP: "团购", OWNED: "自备", LEASE: "租赁" } return template[value] }) // 课程类型 Vue.filter('coursesType', (value) => { let template = { NORMAL: '单技课', SINGLE: '单技课', MIX: "合奏课", HIGH: "基础技能课", VIP: "VIP课", DEMO: "试听课", COMPREHENSIVE: '综合课', PRACTICE: '练习课', ENLIGHTENMENT: '启蒙课', TRAINING: '集训课', TRAINING_SINGLE: '集训单技课', TRAINING_MIX: '集训合奏课', CLASSROOM: '课堂课' } return template[value] }) // 课程状态 Vue.filter('coursesStatus', (value) => { let template = { NOT_START: "未开始", UNDERWAY: "进行中", OVER: "已结束" } return template[value] }) // 考勤类型 Vue.filter('clockingIn', value => { let templateStatus = { NORMAL: "正常", TRUANT: "旷课", LEAVE: "请假", QUIT_SCHOOL: "休学", DROP_OUT: "退学" } return templateStatus[value] }) // 时间处理 Vue.filter('formatTimer', (value) => { if (value) { return value.split(' ')[0] } else { return value } }) // 时间处理 Vue.filter('timer', (value) => { if (value) { let tempDate = new Date(value) let month = tempDate.getMonth() + 1 >= 10 ? tempDate.getMonth() + 1 : '0' + tempDate.getMonth() + 1 let days = tempDate.getDate() >= 10 ? tempDate.getDate() : '0' + tempDate.getDate() return month + ':' + days } else { return value } }) // 格式化成星期 Vue.filter('formatWeek', date => { let nd = new Date(date) let temp = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] return temp[nd.getDay()] }) // 职位 Vue.filter('jobType', value => { let template = { ADVISER: "指导老师", ACADEMIC: "教务老师", TEACHING: "教学主管" } return template[value] }) // 工作类型 Vue.filter('jobNature', (value) => { let template = { PART_TIME: "兼职", FULL_TIME: "全职", TEMPORARY: "临时工" } return template[value] }) // 考勤状态 Vue.filter('attendanceType', value => { let template = { 0: "异常签到", 1: "正常签到", 3: "未签到" } return template[value] }) // 上课类型 Vue.filter('workType', value => { let template = { TEACHING: "助教", BISHOP: "主教" } return template[value] }) // 交易类型 Vue.filter('orderType', value => { let template = { APPLY: "报名", RENEW: "续费", OTHER: "其他", SMALL_CLASS_TO_BUY: "VIP购买" } return template[value] }) // Vue.filter('paymentChannelType', value => { let template = { PER: "个人", COM: "公司" } return template[value] }) // 交易状态 Vue.filter('dealStatus', value => { let template = { ING: "交易中", SUCCESS: "成功交易", FAILED: "交易失败", CLOSE: "交易关闭" } return template[value] }) // 交易状态 Vue.filter('returnStatus', value => { let template = { ING: "审核中", REJECT: "拒绝", WAIT_PAYMENT: "待支付", DONE: "完成" } return template[value] }) // 性别 Vue.filter('sex', value => { let template = ['女', '男'] return template[value] }) // 服从调剂 isAllowAdjust Vue.filter('isAllowAdjust', value => { let template = ['否', '是'] return template[value] }) // 学员缴费状态 paymentStatus Vue.filter('paymentStatus', value => { let template = ['未开启缴费', '开启缴费', '已缴费'] return template[value] }) // 乐团状态 Vue.filter('teamStatus', value => { let template = { APPLY: "报名中", PAY: "缴费中", PREPARE: "筹备中", PROGRESS: "进行中", CANCELED: '取消', PAUSE: '暂停', AUDIT: '审核中', DRAFT: '编辑中', AUDIT_FAILED: '审核失败' } return template[value] }) // 学生点名 Vue.filter('studentRecord', value => { let template = { NORMAL: "正常", TRUANT: "旷课", LEAVE: "请假", DROP_OUT: "退学" } return template[value] }) // 是否 Vue.filter('yesOrNo', value => { let template = ['否', '是'] return template[value] }) // 学员缴费状态 Vue.filter('studentPay', value => { let template = { PAID_COMPLETED: "完成缴费", NON_PAYMENT: "未缴费", PROCESSING: "缴费中", } return template[value] }) // 学员点名详情 Vue.filter('studentSign', value => { let template = { NORMAL: "正常", TRUANT: "旷课", LEAVE: "请假", DROP_OUT: '退学' } return template[value] }) // 班级类型 Vue.filter('classType', value => { let template = { NORMAL: "普通班级", MIX: '合奏班' } return template[value] }) Vue.filter('teachMode', value => { let template = { ONLINE: "线上课", OFFLINE: '线下课' } return template[value] }) // 老师状态 Vue.filter('teacherStatus', value => { let template = { "0": '正常', "1": '冻结', "9": '锁定' } return template[value] })