123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- 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('jobNature', (value) => {
- let template = {
- PART_TIME: "兼职",
- FULL_TIME: "全职",
- TEMPORARY: "零时工"
- }
- return template[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: '筹备中',
- UNDERWAY: '进行中',
- CANCELED: '取消'
- }
- 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: "单技课",
- MIX: "合奏课",
- HIGH: "小班课",
- VIP: "VIP课",
- DEMO: "试听课"
- }
- 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
- }
- })
|