import i18n from '../locale/index.js'
import Vue from 'vue'
import VueI18n from 'vue-i18n'

const PRIVATE_SPACE = 1024 * 1024 * 1024 * 1 //教师Blob个人空间
const SCHOOL_SPACE = 1024 * 1024 * 1024 * 10 //学校Blob空间
const DEFAULT_SCHOOL_CODE = 'SYSTEM_NO_SCHOOL' //尚未归属学校的默认学校编码
const BLOB_URL = 'https://teammodelstorage.blob.core.chinacloudapi.cn'  //（废弃） 大陆和国际站的host 不同，不能在这里统一获取，需要从登录信息里面获取

//文件类型，对应内容模块Blob目录
const CONTENT_TYPES = {
	'image': ['JPG', 'JPEG', 'PNG', 'GIF', 'SVG'],
	'video': ['AVI', 'MP4', 'WEBM'],
	'doc': ['PPT', 'PPTX', 'DOC', 'DOCX', 'PDF', 'XLS', 'XLSX', 'CSV'],
	'res': ['HTE', 'HTEX'],
	'audio': ['MP3', 'WAV', 'OGG']
}

//系统默认考试类型
const EXAM_TYPE = () => {
	return [{
		id: "100",
		name: i18n.t('global.examType1')
	},
	{
		id: "101",
		name: i18n.t('global.examType2')
	},
	{
		id: "200",
		name: i18n.t('global.examType3')
	}
	]
}
//系统固定评测类型
const EV_TYPE = () => {
	return [
		{
			value: 'regular',
			label: i18n.t('global.evType1')
		},
		{
			value: 'simulation',
			label: i18n.t('global.evType2')
		},
		{
			value: 'normal',
			label: i18n.t('global.evType3')
		}
	]
}
//系统固定评测类型
const EV_MODE = () => {
	return [
		{
			value: '0',
			label: i18n.t('global.evMode1')
		},
		{
			value: '1',
			label: i18n.t('global.evMode2')
		},
		{
			value: '2',
			label: i18n.t('global.evMode3')
		}
	]
}
//系统固定评测发布方式
const PUBLISH_TYPE = () => {
	return [
		{
			value: '0',
			label: i18n.t('global.publishType1')
		},
		{
			value: '1',
			label: i18n.t('global.publishType2')
		}
	]
}

/* 题目题型定义 */
const EXERCISE_TYPES = () => {
	return {
		single: i18n.t('evaluation.single'),
		multiple: i18n.t('evaluation.multiple'),
		judge: i18n.t('evaluation.judge'),
		complete: i18n.t('evaluation.complete'),
		subjective: i18n.t('evaluation.subjective'),
		connector: i18n.t('evaluation.connector'),
		correct: i18n.t('evaluation.correct'),
		compose: i18n.t('evaluation.compose')
	}
}

/* 题目难度定义 */
const EXERCISE_DIFFS = () => {
	return [
		i18n.t('evaluation.diff1'),
		i18n.t('evaluation.diff2'),
		i18n.t('evaluation.diff3'),
		i18n.t('evaluation.diff4'),
		i18n.t('evaluation.diff5')
	]
}

/* 题目认知层次定义 */
const EXERCISE_LEVELS = () => {
	return [
		i18n.t('evaluation.level1'),
		i18n.t('evaluation.level2'),
		i18n.t('evaluation.level3'),
		i18n.t('evaluation.level4'),
		i18n.t('evaluation.level5'),
		i18n.t('evaluation.level6')
	]
}

const GLOBAL = {
	CONTENT_TYPES,
	PRIVATE_SPACE,
	SCHOOL_SPACE,
	DEFAULT_SCHOOL_CODE,
	BLOB_URL,
	EXAM_TYPE,
	EXERCISE_TYPES,
	EXERCISE_DIFFS,
	EXERCISE_LEVELS,
	EV_TYPE,
	EV_MODE,
	PUBLISH_TYPE
}

const install = (Vue, options) => {
	Vue.use(VueI18n)
	Vue.prototype.$GLOBAL = GLOBAL
}

export default {
	install

}
export {GLOBAL}
