123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- 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.getHours() >= 10 ? tempDate.getHours() : '0' + tempDate.getHours()
- let days = tempDate.getMinutes() >= 10 ? tempDate.getMinutes() : '0' + tempDate.getMinutes()
- 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('attendanceOutType', 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: '合奏班',
- HIGH: '基础技能班',
- VIP: 'VIP',
- DEMO: '试听',
- SNAP: "临时班"
- }
- 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]
- })
|