export const resourceMixin = {
    data () {
        return {
            // 单位规模: 1-高危火灾单位,2-消防安全重点单位,3-一般单位,4-其他单位
            unitSize: [
                {
                    id: '1',
                    name: '高危火灾单位'
                },
                {
                    id: '2',
                    name: '消防安全重点单位'
                },
                {
                    id: '3',
                    name: '一般单位'
                },
                {
                    id: '4',
                    name: '其他单位'
                }
            ],
            // 场所类型:1-宾馆场所，2-餐饮场所
            placeType: [
                {
                    code: '1',
                    name: '宾馆场所'
                },
                {
                    code: '2',
                    name: '餐饮场所'
                }
            ],
            // 建筑类型:1-高层建筑,2-非高层建筑
            architectureType: [
                {
                    id: '1',
                    name: '高层建筑'
                },
                {
                    id: '2',
                    name: '非高层建筑'
                }
            ],
            // 0-不负责整栋楼，1-负责整栋楼
            responsibilityType: [
                {
                    id: '0',
                    name: '部分楼层'
                },
                {
                    id: '1',
                    name: '整栋楼'
                }
            ],
            // 检查状态：PASS-合格,NOT_PASS:不合格,CORRECT_IMMEDIATELY：不合格立即检查,DEADLINE_CORRECT:不合格，限期改正
            statusList: [
                {
                    id: 'PASS',
                    name: '合格'
                },
                {
                    id: 'NOT_PASS',
                    name: '不合格'
                },
                {
                    id: 'CORRECT_IMMEDIATELY',
                    name: '不合格，立即改正'
                },
                {
                    id: 'DEADLINE_CORRECT',
                    name: '不合格，限期改正'
                },
                {
                    id: 'OVERPASS',
                    name: '不检查'
                }
            ],
            filterStatusList: [
                {
                    id: '1',
                    name: '合格'
                },
                {
                    id: '2',
                    name: '不合格'
                },
                {
                    id: '3',
                    name: '不合格，立即改正'
                },
                {
                    id: '4',
                    name: '不合格，限期改正'
                },
                {
                    id: '5',
                    name: '不检查'
                },
            ],
            statusList2: [
                {
                    id: 'PASS',
                    name: '合格'
                },
                {
                    id: 'NOT_PASS',
                    name: '不合格'
                },
                {
                    id: 'OVERPASS',
                    name: '不检查'
                }
            ],
            // AUDIT-审核中,REJECT-已驳回,TODO-待执行,DOING-执行中,ARCHIVED-已归档
            jobList: [
                {
                    id: 'AUDIT',
                    name: '审核中'
                },
                {
                    id: 'REJECT',
                    name: '已驳回'
                },
                {
                    id: 'TODO',
                    name: '待执行'
                },
                {
                    id: 'DOING',
                    name: '执行中'
                },
                {
                    id: 'ARCHIVED',
                    name: '已归档'
                },
            ],
            // 经营状态
            operateStatus: [
                {
                    id: '0',
                    name: '正常'
                },
                {
                    id: '1',
                    name: '冻结'
                },
                {
                    id: '2',
                    name: '注销'
                },
            ],
            manageStatus: {
                '0': '正常',
                '1': '冻结',
                '2': '注销'
            }
        }
    },
    methods: {
        parseUnitSize(v) {
            if (v && v == 5) {
                return '九小场所';
            }
            const t = this.unitSize.filter(item => v == item.id)
            return t && t.length > 0 ? t[0].name : v
        },
        parsePlaceType(v) {
            const t = this.placeType.filter(item => v == item.code)
            return t && t.length > 0 ? t[0].name : v
        },
        parseArchitectureType(v) {
            const t = this.architectureType.filter(item => v == item.id)
            return t && t.length > 0 ? t[0].name : v
        },
        parseResponsibilityType(v) {
            const t = this.responsibilityType.filter(item => v == item.id)
            return t && t.length > 0 ? t[0].name : v
        },
        parseStatus(v) {
            const t = this.statusList.filter(item => v == item.id)
            return t && t.length > 0 ? t[0].name : v
        },
        parseJobStatus(v) {
            const t = this.jobList.filter(item => v == item.id)
            return t && t.length > 0 ? t[0].name : v
        },
    }
}
