//根据生日和当前时间获取年龄
Vue.filter('getAge', function (value) {
    var now = new Date();
    var nowYear = now.getFullYear();
    var bd = new Date(value);
    var by = bd.getFullYear();
    return nowYear - by;
});
//生成时间年月日格式
Vue.filter('dateFormat', function (value) {
    var bd = new Date(value);
    var by = bd.getFullYear();
    var bm = bd.getMonth();
    var bd = bd.getDay();
    return by + "年" + bm + "月" + bd + "日";
});
//转换婚姻代码为文字
Vue.filter('cgMarriage', function (value) {
    switch (value) {
        case 0:
            return "未知、未提供";
        case 1:
            return "未婚";
        case 2:
            return "已婚";
        case 3:
            return "离异";
        case 4:
            return "丧偶";
        default:
            return value;
    }
});
//转换性别代码为文字
Vue.filter('cgGender', function (value) {
    switch (value) {
        case 0:
            return "未知、未提供";
        case 1:
            return "男";
        case 2:
            return "女";
        default:
            return value;
    }
});
//转换学历代码到文字
Vue.filter('cgEducation', function (value) {
    switch (value) {
        case 0:
            return "未知、未提供";
        case 1:
            return "文盲";
        case 2:
            return "女小学";
        case 3:
            return "中学";
        case 4:
            return "大学";
        default:
            return value;
    }
});
