config.js 1.53 KB
import { t } from '@/plugins/index.js'
export function getDetailOptions(isDetail = false) {
	const baseList = [
		{
			label: t('VideoShopTour.monitoringScene'), //'监控场景',
			key: 'scene'
		},
		{
			label: t('app.inspection.inspector'),
			key: 'inspectedPerson',
		},
		{
			label: t('app.inspection.handlingPerson'),
			key: 'handlerName',
		},
		{
			label: t('VideoShopTour.numberIssues'),
			key: 'noQualified',
		},
		{
			label: t('maintenance.common.createTime'),
			key: 'createTime',
		},
	]
	
	if (isDetail) {
		return baseList
		/* return baseList.concat({
			label: '备注信息',
			key: 'remark',
		}) */
	} else {
		return baseList.concat({
			label: t('maintenance.monitor.project.shopName'),
			key: 'name',
		})
	}
}

export function getStatusOptions() {
	return [
		{
			indexName: t('maintenance.monitor.project.indexStatus.all'),
			indexKey: '',
		},
		{
			indexName: t('dictionary.pending'),
			indexKey: '1',
		},
		{
			indexName: t('dictionary.reexamine'),
			indexKey: '2',
		},
		{
			indexName: t('dictionary.completed'),
			indexKey: '3',
		},
	]
}

export function getDetailValueByKey(key, data) {
	switch (key){
		case 'name':
			return data.mallName
		case 'scene':
			return data.gateName
		case 'createTime':
			return data.createTime
		case 'updateTime':
			return data.modifyTime
		case 'inspectedPerson':
			return data.createByName
		case 'noQualified':
			return data.noQualified
		case 'handlerName':
			return data.handlerName || '-'
		case 'remark':
			return data.remark || '-'
		default:
			return ''
	}
}