update 基本完成国际化

Cette révision appartient à :
g7hoo 2022-09-02 14:09:41 +08:00
Parent 12556886b9
révision 076eaa5f2a
15 fichiers modifiés avec 503 ajouts et 85 suppressions

Voir le fichier

@ -455,7 +455,7 @@ export default {
.then(({ data: res }) => {
if (res && res.code === 0) {
this.$message({
message: btn.name === 'save' ? '添加成功!' : '更新成功!',
message: btn.name === 'save' ? i18n.t('prompt.success') : '更新成功!',
type: 'success',
duration: 1500,
onClose: () => {

Voir le fichier

@ -1,6 +1,8 @@
<template>
<div class="attr-form">
<h3>{{ title }} <el-button style="margin-left: 8px;" type="text" v-if="!isDetail && !showAddAttr" @click="showAddAttr = true">添加</el-button></h3>
<h3>
{{ title }} <el-button style="margin-left: 8px;" type="text" v-if="!isDetail && !showAddAttr" @click="showAddAttr = true">{{ $t('add') }}</el-button>
</h3>
<div v-if="!showAddAttr">
<component
key="sub-table"
@ -28,7 +30,7 @@
<el-row :gutter="20" style="padding: 0 24px;">
<el-col :span="attrFormFields.length > 6 ? 6 : 12" v-for="field in attrFormFields" :key="field.prop + 'col'">
<el-form-item :key="field.prop" :prop="field.prop" :label="field.name" style="width: 100%">
<el-input v-if="field.formType === 'input' || !field.formType" v-model="AttrForm[field.prop]" placeholder="请填写" clearable />
<el-input v-if="field.formType === 'input' || !field.formType" v-model="AttrForm[field.prop]" :placeholder="$t('hints.input')" clearable />
<el-select v-if="field.formType === 'select'" v-model="AttrForm[field.prop]" clearable>
<el-option v-for="opt in field.formOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
@ -51,7 +53,7 @@
import i18n from '@/i18n'
import BaseTable from '@/components/base-table'
import { pick } from 'lodash/object'
import { calcMaxHeight } from '@/utils'
export default {
name: 'AttrForm',
components: { BaseTable },
@ -91,6 +93,7 @@ export default {
},
data() {
return {
calcMaxHeight,
showAddAttr: false,
dataList: [],
pageIndex: 1,
@ -201,7 +204,7 @@ export default {
deleteHandle(id) {
var ids = id ? [id] : []
this.$confirm(`确定对id=${ids.join(',')}进行${id ? i18n.t('delete') : i18n.t('deleteBatch')}操作?`, i18n.t('prompt.title'), {
this.$confirm(`${i18n.t('prompt.info', { handle: id ? i18n.t('delete').toLowerCase() : i18n.t('deleteBatch').toLowerCase() })}`, i18n.t('prompt.title'), {
confirmButtonText: i18n.t('confirm'),
cancelButtonText: i18n.t('cancel'),
type: 'warning'

Voir le fichier

@ -110,7 +110,7 @@ import i18n from '@/i18n'
const title = {
detail: i18n.t('detail'),
add: i18n.t('add'),
edit: '编辑'
edit: i18n.t('edit')
}
//
@ -124,9 +124,9 @@ const btnType = {
const btnName = {
// for i18n
save: '保存',
update: '更新',
reset: '重置',
save: i18n.t('save'),
update: i18n.t('update'),
reset: i18n.t('reset'),
cancel: i18n.t('cancel')
// add more...
}
@ -207,7 +207,7 @@ export default {
},
mounted() {
/** 计算 defaultPlaceholders */
const prefix = '请输入'
const prefix = i18n.t('hints.input')
Object.entries(this.defaultNames).map(([key, value]) => {
this.defaultPlaceholders[key] = prefix + value
})
@ -251,7 +251,7 @@ export default {
if (item.required) {
const requiredRule = {
required: true,
message: '请输入必填项',
message: i18n.t('validate.required'),
trigger: 'change'
}
/** 检查是否已经存在该字段的规则 */
@ -296,19 +296,14 @@ export default {
this.configs.extraComponents &&
this.configs.extraComponents.forEach(item => {
if (Object.hasOwn(this.dataForm, [item.name])) {
console.log('有了!')
return
} else {
console.log('新建!')
this.$set(this.dataForm, [item.name], calDefault(item.fieldType))
}
console.log('component: ', item.component)
})
/** 单独设置 id */
this.$set(this.dataForm, 'id', null)
console.log('mounted: this.dataForm', JSON.stringify(this.dataForm))
})
},
@ -335,7 +330,7 @@ export default {
: this.defaultPlaceholders[opt.name]
? this.defaultPlaceholders[opt.name]
: opt.label
? (opt.type === 'select' ? i18n.t('choose') : '请输入') + opt.label
? (opt.type === 'select' ? i18n.t('choose') : i18n.t('hints.input')) + opt.label
: null
// : opt.type === 'select'
@ -402,7 +397,6 @@ export default {
this.fileForm[file.typeCode] = [file.id]
}
})
console.log('after分流', this.fileList)
}
}
})
@ -411,12 +405,12 @@ export default {
if (this.shouldWait)
this.shouldWait.then(() => {
if (this.tempForm.length) {
console.log('create new, tempform', JSON.stringify(this.tempForm.length))
// console.log('create new, tempform', JSON.stringify(this.tempForm.length))
this.tempForm.forEach(item => {
console.log('item data', item.data)
// console.log('item data', item.data)
this.dataForm[item.name] = item.data
})
console.log('create new, dataform', JSON.stringify(this.dataForm))
// console.log('create new, dataform', JSON.stringify(this.dataForm))
}
})
}
@ -427,9 +421,7 @@ export default {
this.$emit('select-change', { name, id })
},
handleEditorReady(val) {
console.log('editor rready..', val)
},
handleEditorReady(val) {},
handleClick(btn) {
/** 提取url */
@ -448,7 +440,6 @@ export default {
if (valid) {
/** 对于文件上传的单独处理(合并处理) */
if (Object.keys(this.fileForm).length) {
console.log('fileform 有值')
// LABEL: FILE_RELATED
let fileIds = []
for (const [key, item] of Object.entries(this.fileForm)) {
@ -471,7 +462,8 @@ export default {
.then(({ data: res }) => {
if (res && res.code === 0) {
this.$message({
message: btn.name === 'save' ? '添加成功!' : '更新成功!',
message: i18n.t('prompt.success'),
// message: btn.name === 'save' ? i18n.t('prompt.success') : '!',
type: 'success',
duration: 1500,
onClose: () => {
@ -512,7 +504,7 @@ export default {
// LABEL: FILE_RELATED
handleUploadListUpdate(filelist, typeCode = 'DefaultTypeCode') {
console.log('before handleUploadListUpdate(): ', JSON.parse(JSON.stringify(this.fileForm)))
// console.log('before handleUploadListUpdate(): ', JSON.parse(JSON.stringify(this.fileForm)))
// typeCode: EquipmentTypeFile
// typeCode: EquipmentInfoFile | EquipmentInfoImage
@ -529,7 +521,7 @@ export default {
typeCode,
filelist.map(item => item.id)
)
console.log('after handleUploadListUpdate(): ', this.fileForm)
// console.log('after handleUploadListUpdate(): ', this.fileForm)
},
handleClose() {

Voir le fichier

@ -1,11 +1,5 @@
/**
* @Author: lb
* @CreateDate: 2022.8.8
* @Modifier:
* @ModifiedDate:
* 表格里的文本组件
* 一般用途展示查看详情入口
*/
import i18n from '@/i18n'
export default {
name: 'TableTextComponent',
props: {
@ -17,12 +11,12 @@ export default {
data() {
return {
// for i18n inject:
defaultText: '查看详情'
defaultText: i18n.t('viewdetail')
}
},
methods: {
emitClick() {
console.log('inject data:' ,this.injectData)
// console.log('inject data:' ,this.injectData)
this.$emit('emit-data', {
type: this.injectData.head?.actionName || 'view-detail-action',
data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id

Voir le fichier

@ -1,11 +1,5 @@
/**
* @Author: lb
* @CreateDate: 2022.8.8
* @Modifier:
* @ModifiedDate:
* 表格里的操作组件
* 一般用途展示添加删除按钮
*/
import i18n from '@/i18n'
export default {
name: 'TableOperations',
props: {
@ -30,12 +24,12 @@ export default {
},
text: {
// TODO: i18n
edit: '编辑',
detail: '详情',
delete: '删除',
viewAttr: '查看属性',
preview: '预览',
design: '设计'
edit: i18n.t('edit'),
detail: i18n.t('detail'),
delete: i18n.t('delete'),
viewAttr: i18n.t('viewattr'),
preview: i18n.t('preview'),
design: i18n.t('design'),
// add more...
}
}

Voir le fichier

@ -13,7 +13,7 @@
<!-- :before-remove="beforeRemove" -->
<!-- accept="image/*" -->
<!-- <el-upload class="yd-upload" :action="$http.adornUrl(url)" multiple name="files" :data="extraParams" :file-list="fileList" :on-remove="handleRemove" :before-remove="beforeRemove"> -->
<el-button :disabled="readOnly" size="small" type="primary">{{ buttonContent }}</el-button>
<el-button :disabled="readOnly" type="primary">{{ buttonContent }}</el-button>
<div v-if="tip" slot="tip" class="el-upload__tip">{{ tip }}</div>
</el-upload>
</div>
@ -101,8 +101,6 @@ export default {
/** 大小验证,由配置文件开启 */
validateFile(file) {
console.log('[*] 验证文件大小')
const isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
// this.$message.error(this.$t('upload.picSizeAlarm'))
@ -156,7 +154,6 @@ export default {
alink.style.display = 'none'
alink.target = '_blank'
alink.href = URL.createObjectURL(blob)
console.log('下载地址:', alink.href)
document.body.appendChild(alink)
alink.click()
URL.revokeObjectURL(alink.href)
@ -184,11 +181,18 @@ export default {
margin-bottom: 20px;
}
.base-upload >>> .el-upload--text {
.base-upload >>> .el-button {
display: block;
width: 200px;
position: relative;
left: -100px;
}
/* .base-upload >>> .el-upload--text {
width: 100px;
position: relative;
left: -72px;
}
left: -100px;
} */
.base-upload >>> .el-upload__tip {
margin-top: 0;

Voir le fichier

@ -7,6 +7,7 @@ t.brand = {}
t.brand.lg = 'Monitoring System'
t.brand.mini = 'PMS'
t.save = 'Save'
t.add = 'Add'
t.delete = 'Delete'
t.deleteBatch = 'Delete Batch'
@ -68,7 +69,7 @@ t.enname = 'English Name'
t.collectOrNot = 'Collect or not'
t.min = 'Min Value'
t.max = 'Max Value'
t.status = 'Status',
t.status = 'Status'
t.normal = 'Normal'
t.addr = 'Address'
t.planStop = 'Plan to stop'
@ -76,18 +77,421 @@ t.startTime = 'Start Time'
t.endTime = 'End Time'
t.today = 'Today'
t.graph = 'Graph'
t.category = 'Category'
t.categoryName = 'Category Name'
t.categoryCode = 'Category Code'
t.rate = 'Rate'
t.link = 'Link Url'
t.refresh = 'Refresh'
t.abbr = 'Abbreviation'
t.detail = 'Details'
t.viewdetail = 'Details'
t.viewattr = 'View Attributions'
t.edit = 'Edit'
t.source = 'Source'
t.auto = 'Auto'
t.manual = 'Manually'
t.loaddone = 'Loaded'
t.produceTime = 'Date of manufacture'
t.enterTime = 'Enter Time'
t.manufacturer = 'Manufacturer'
t.success = 'success!'
t.all = 'All'
t.reset = 'Reset'
t.preview = 'Preview'
t.design = 'Design'
t.errors = {}
t.errors.nosection = 'There is no sections on this product line.'
t.errors.numsection = 'There are {num} sections on this product line.'
t.errors.nodata = 'Error, no data available!'
t.hints = {}
t.hints.input = 'Please input '
t.hints.select = 'Please select '
t.hints.date = 'Please select date'
t.hints.checktime = 'Please select inspection time'
t.hints.number = 'Please input correct number'
t.hints.addr = 'Please input address'
t.hints.upload2m = 'File size cannot be larger than 2mb (2048kb)'
t.hints.upload2mPic = 'Image files only. File size cannot be larger than 2mb (2048kb)'
t.factory = {}
t.factory.title = 'Factory'
t.factory.name = 'Factory Name'
t.factory.code = 'Factory Code'
t.prod = {}
t.prod.id = 'Product ID'
t.prod.name = 'Product Name'
t.prod.code = 'Product Code'
t.prod.type = 'Product Type'
t.prod.area = 'Area'
t.prod.spec = 'Product Specification'
t.prod.attr = 'Dynamic Attributes'
t.prod.attrcode = 'Attribute Code'
t.prod.attrcodeHints = 'Please input attribute code'
t.prod.attrname = 'Attribute Node'
t.prod.attrnameHints = 'Please input attribute name'
t.prod.attrvalueHints = 'Please input attribute value'
t.prod.descHints = 'Please input description'
t.prod.processTime = 'Processing Time'
t.prod.processTimeHints = 'Please input processing time'
t.prod.relatedPid = 'Related Product'
t.alarm = {}
t.alarm.name = 'Alarm'
t.alarm.info = 'Alarm Informations'
t.alarm.view = 'View Alarm'
t.alarm.eq = 'Alarm Equipment'
t.alarm.type = 'Alarm Type'
t.alarm.code = 'Alarm Code'
t.alarm.level = 'Alarm Level'
t.alarm.content = 'Alarm Content'
t.alarm.source = 'Alarm Source'
t.alarm.det = 'Alarm Details'
t.report = {}
t.report.name = 'Report Name'
t.report.det = 'Report Content'
t.report.type = 'Report Type'
t.report.code = 'Report Code'
t.report.lnk = 'Report Url'
t.inspect = {}
t.inspect.type = 'Inspection Type'
t.inspect.code = 'Inspection Code'
t.inspect.det = 'Inspection Details'
t.inspect.detcode = 'Inspection Content Code'
t.inspect.people = 'Inspector'
t.inspect.time = 'Inspection Time'
t.inspect.typetotal = 'Total Inspection Types'
t.inspect.typename = 'Inspection Type'
t.inspect.typecode = 'Inspection Code'
t.inspect.ioTotal = 'Data of input/output and total inspections'
t.inspect.plTotal = 'Inspection types per line'
t.inspect.inTotal = 'Up Sum'
t.inspect.outTotal = 'Down Sum'
t.inspect.checkTotal = 'Total Inspections'
t.inspect.rate = 'Rate'
t.inspect.typeCount = 'Data of inspection types'
t.realtime = {}
t.realtime.eq = 'Realtime data of equipments'
t.realtime.pl = 'Realtime data of product lines'
t.realtime.inspect = 'Realtime data of quality inspections'
t.realtime.in = 'in'
t.realtime.out = 'out'
t.realtime.data = 'scrap'
t.realtime.num = 'scrap quantity'
t.realtime.rate = 'scrap rate'
t.realtime.total = 'total production'
t.realtime.goodrate = 'Passed Rate'
t.ws = {}
t.ws.title = 'Work Section'
t.ws.id = 'Work Section ID'
t.ws.name = 'Work Section Name'
t.ws.code = 'Work Section Code'
t.ws.binded = 'Binded Equipments'
t.ws.unbind = 'Please select an equipment to bind.'
t.ws.sort = 'sort'
t.ws.setorder = 'Please input order of equipments in the work section.'
t.ws.bind = 'bind'
t.ws.eqbind = 'Binded Equipment(s)'
t.ws.belong = 'Product Line'
t.file = {}
t.file.title = 'File'
t.file.name = 'File Name'
t.file.code = 'File Code'
t.file.typeName = 'File Type'
t.file.typeCode = 'File Type Code'
t.eq = {}
t.eq.title = 'Equipment'
t.eq.id = 'Equipment ID'
t.eq.name = 'Equipment Name'
t.eq.code = 'Equipment Code'
t.eq.type = 'Equipment Type'
t.eq.grade = 'Specification of equipment'
t.eq.group = 'Equipment Group'
t.eq.groupname = 'Group Name'
t.eq.groupcode = 'Group Code'
t.eq.excode = 'External Code'
t.eq.input = 'Input Device'
t.eq.output = 'Output Device'
t.eq.tvalue = 'Device\'s TT Value'
t.eq.processingTime = 'Processing Time (s)'
t.eq.dtype = 'Data source'
t.eq.dtypenone = 'none'
t.eq.dtypeinput = 'Input Data Device'
t.eq.dtypeoutput = 'Output Data Device'
t.eq.upload = 'Upload'
t.eq.image = 'Equipment Pictures'
t.eq.viewattr = 'Equipment Attributions'
t.eq.plcbarcode = 'PLC Bar Code'
t.eq.plccode = 'PLC Code'
t.eq.plcname = 'PLC Name'
t.eq.port = 'Port'
t.eq.type = 'Type'
t.eq.typecode = 'Type Code'
t.eq.parent = 'Parent'
t.pl = {}
t.pl.title = 'Product Line'
t.pl.id = 'Product Line ID'
t.pl.name = 'Product Line Name'
t.pl.code = 'Product Line Code'
t.pl.status = 'Product Line Status'
t.pl.belong = 'Product Line'
t.pl.tvalue = 'TT Value'
t.pl.factoryHints = 'Please select a factory'
t.prompt = {}
t.prompt.title = 'Prompt'
t.prompt.info = 'Are you sure to {handle}?'
t.prompt.sure = 'Are you sure to delete this record?'
t.prompt.success = 'success'
t.prompt.failed = 'failed'
t.prompt.deleteBatch = 'Please choose items to delete.'
t.validate = {}
t.validate.required = 'This is required.'
t.validate.format = '{attr} has a wrong format.'
t.upload = {}
t.upload.title = 'Upload Assets'
t.upload.text = '将文件拖到此处,或<em>点击上传</em>'
t.upload.tip = 'Only support files with format: {format}'
t.upload.button = 'upload'
t.datePicker = {}
t.datePicker.range = 'to'
t.datePicker.start = 'Start Time'
t.datePicker.end = 'End Time'
t.fullscreen = {}
t.fullscreen.prompt = 'This operation is not supported by your browser.'
t.updatePassword = {}
t.updatePassword.title = 'Update Password'
t.updatePassword.username = 'Username'
t.updatePassword.password = 'Current Password'
t.updatePassword.newPassword = 'New Password'
t.updatePassword.confirmPassword = 'Confirm Password'
t.updatePassword.validate = {}
t.updatePassword.validate.confirmPassword = 'The two passwords are different. Please check again.'
t.contentTabs = {}
t.contentTabs.closeCurrent = 'Close current tab'
t.contentTabs.closeOther = 'Close other tabs'
t.contentTabs.closeAll = 'Close all tabs'
/* 页面 */
t.notFound = {}
t.notFound.desc = 'Sorry! The page you\'re looking is missing.'
t.notFound.back = 'Back'
t.notFound.home = 'Home Page'
t.login = {}
t.login.title = 'Login'
t.login.username = 'Username'
t.login.password = 'Password'
t.login.captcha = 'Validation Code'
t.login.captcha = 'Captcha'
t.login.demo = 'Demo'
t.login.copyright = 'CNBM'
t.login.copyright = 'Copyright @Intelligent Automation Research Institute Co., Ltd Version: 1.0'
t.prompt = {}
t.prompt.title = 'Prompt'
t.prompt.info = 'Are you sure to {handle}?'
t.schedule = {}
t.schedule.beanName = 'bean名称'
t.schedule.beanNameTips = 'spring bean名称, 如: testTask'
t.schedule.pauseBatch = 'Pause'
t.schedule.resumeBatch = 'Resume'
t.schedule.runBatch = 'Run'
t.schedule.log = '日志列表'
t.schedule.params = '参数'
t.schedule.cronExpression = 'cron expression'
t.schedule.cronExpressionTips = 'ex: 0 0 12 * * ?'
t.schedule.remark = 'Remark'
t.schedule.status = 'Status'
t.schedule.status0 = 'Pause'
t.schedule.status1 = 'Normal'
t.schedule.statusLog0 = 'Failed'
t.schedule.statusLog1 = 'Success'
t.schedule.pause = 'Pause'
t.schedule.resume = 'Resume'
t.schedule.run = 'Excute'
t.schedule.jobId = 'Job ID'
t.schedule.times = 'Time Cost (ms)'
t.schedule.createDate = '执行时间'
t.oss = {}
t.oss.config = '云存储配置'
t.oss.upload = '上传文件'
t.oss.url = 'URL地址'
t.oss.createDate = 'Create Time'
t.oss.type = '类型'
t.oss.type1 = '七牛'
t.oss.type2 = '阿里云'
t.oss.type3 = '腾讯云'
t.oss.qiniuDomain = '域名'
t.oss.qiniuDomainTips = '七牛绑定的域名'
t.oss.qiniuPrefix = '路径前缀'
t.oss.qiniuPrefixTips = '不设置默认为空'
t.oss.qiniuAccessKey = 'AccessKey'
t.oss.qiniuAccessKeyTips = '七牛AccessKey'
t.oss.qiniuSecretKey = 'SecretKey'
t.oss.qiniuSecretKeyTips = '七牛SecretKey'
t.oss.qiniuBucketName = '空间名'
t.oss.qiniuBucketNameTips = '七牛存储空间名'
t.oss.aliyunDomain = '域名'
t.oss.aliyunDomainTips = '阿里云绑定的域名http://cdn.renren.io'
t.oss.aliyunPrefix = '路径前缀'
t.oss.aliyunPrefixTips = '不设置默认为空'
t.oss.aliyunEndPoint = 'EndPoint'
t.oss.aliyunEndPointTips = '阿里云EndPoint'
t.oss.aliyunAccessKeyId = 'AccessKeyId'
t.oss.aliyunAccessKeyIdTips = '阿里云AccessKeyId'
t.oss.aliyunAccessKeySecret = 'AccessKeySecret'
t.oss.aliyunAccessKeySecretTips = '阿里云AccessKeySecret'
t.oss.aliyunBucketName = 'BucketName'
t.oss.aliyunBucketNameTips = '阿里云BucketName'
t.oss.qcloudDomain = '域名'
t.oss.qcloudDomainTips = '腾讯云绑定的域名'
t.oss.qcloudPrefix = '路径前缀'
t.oss.qcloudPrefixTips = '不设置默认为空'
t.oss.qcloudAppId = 'AppId'
t.oss.qcloudAppIdTips = '腾讯云AppId'
t.oss.qcloudSecretId = 'SecretId'
t.oss.qcloudSecretIdTips = '腾讯云SecretId'
t.oss.qcloudSecretKey = 'SecretKey'
t.oss.qcloudSecretKeyTips = '腾讯云SecretKey'
t.oss.qcloudBucketName = 'BucketName'
t.oss.qcloudBucketNameTips = '腾讯云BucketName'
t.oss.qcloudRegion = '所属地区'
t.oss.qcloudRegionTips = '请选择'
t.oss.qcloudRegionBeijing1 = '北京一区(华北)'
t.oss.qcloudRegionBeijing = '北京'
t.oss.qcloudRegionShanghai = '上海(华东)'
t.oss.qcloudRegionGuangzhou = '广州(华南)'
t.oss.qcloudRegionChengdu = '成都(西南)'
t.oss.qcloudRegionChongqing = '重庆'
t.oss.qcloudRegionSingapore = '新加坡'
t.oss.qcloudRegionHongkong = '香港'
t.oss.qcloudRegionToronto = '多伦多'
t.oss.qcloudRegionFrankfurt = '法兰克福'
t.dept = {}
t.dept.name = 'Department Name'
t.dept.parentName = 'Superior Department'
t.dept.sort = 'Sort'
t.dept.parentNameDefault = 'First tier department'
t.dept.chooseerror = 'Please select a department'
t.dept.title = 'Department Selection'
t.dict = {}
t.dict.dictName = 'Dictionary Name'
t.dict.dictType = 'Dictionary Type'
t.dict.dictLabel = 'Dictionary Label'
t.dict.dictValue = 'Dictionary Value'
t.dict.sort = 'Sort'
t.dict.remark = 'Remark'
t.dict.createDate = 'Create Time'
t.logError = {}
t.logError.requestUri = 'Request URI'
t.logError.requestMethod = 'Request Method'
t.logError.requestParams = 'Request Parameters'
t.logError.ip = 'IP'
t.logError.userAgent = 'User Agent'
t.logError.createDate = 'Create Time'
t.logError.errorInfo = 'Exceptions'
t.logLogin = {}
t.logLogin.creatorName = 'User Name'
t.logLogin.status = 'Status'
t.logLogin.status0 = 'Failed'
t.logLogin.status1 = 'Success'
t.logLogin.status2 = 'Account has been locked'
t.logLogin.operation = 'Operation Type'
t.logLogin.operation0 = 'Login'
t.logLogin.operation1 = 'Logout'
t.logLogin.ip = 'IP'
t.logLogin.userAgent = 'User-Agent'
t.logLogin.createDate = 'Create Time'
t.logOperation = {}
t.logOperation.status = 'Status'
t.logOperation.status0 = 'Failed'
t.logOperation.status1 = 'Success'
t.logOperation.creatorName = 'User Name'
t.logOperation.operation = 'User Operations'
t.logOperation.requestUri = 'Request URI'
t.logOperation.requestMethod = 'Request Method'
t.logOperation.requestParams = 'Request Parameters'
t.logOperation.requestTime = 'Request Duration'
t.logOperation.ip = 'IP'
t.logOperation.userAgent = 'User-Agent'
t.logOperation.createDate = 'Create Time'
t.menu = {}
t.menu.name = 'Name'
t.menu.icon = 'Icons'
t.menu.type = 'Type'
t.menu.type0 = 'Menu'
t.menu.type1 = 'Button'
t.menu.sort = 'Sort'
t.menu.url = 'Route'
t.menu.permissions = '授权标识'
t.menu.permissionsTips = '多个用逗号分隔sys:menu:save,sys:menu:update'
t.menu.parentName = '上级菜单'
t.menu.parentNameDefault = 'First tier menu'
t.menu.resource = '授权资源'
t.menu.resourceUrl = '资源URL'
t.menu.resourceMethod = 'Request methods'
t.menu.resourceAddItem = '添加一项'
t.params = {}
t.params.name = 'Parameter Name'
t.params.code = 'Parameter Code'
t.params.paramCode = 'Parameter Code'
t.params.paramValue = 'Parameter Value'
t.params.paramStdValue = 'Standard Parameter Code'
t.params.plctitle = 'PLC Collection Parameters'
t.params.plcid = 'PLC连接表ID'
t.params.remark = 'Remark'
t.role = {}
t.role.name = 'Role Name'
t.role.remark = 'Remark'
t.role.createDate = 'Create Time'
t.role.menuList = '菜单授权'
t.role.deptList = '数据授权'
t.user = {}
t.user.username = 'User Name'
t.user.deptName = '所属部门'
t.user.email = 'Email'
t.user.mobile = 'Phone'
t.user.status = 'Status'
t.user.status0 = '停用'
t.user.status1 = 'Normal'
t.user.createDate = 'Create Time'
t.user.password = 'Password'
t.user.confirmPassword = 'Confirm Password'
t.user.realName = 'Actual Name'
t.user.gender = 'Gender'
t.user.gender0 = 'male'
t.user.gender1 = 'female'
t.user.gender2 = 'secret'
t.user.roleIdList = 'Role Configurations'
t.user.validate = {}
t.user.validate.confirmPassword = 'The two passwords are different. Please check again.'
t.user.select = 'Select an user'
t.user.selecterror = 'Pick up a record'
export default t

Voir le fichier

@ -21,11 +21,13 @@ export const messages = {
}
export function getLanguage() {
const chooseLanguage = Cookies.get('language')
if (chooseLanguage) return chooseLanguage
if (Cookies.get('language')) {
return Cookies.get('language')
}
// if has not choose language
const language = (navigator.language || navigator.browserLanguage).toLowerCase()
const language = (navigator.language || navigator.browserLanguage)
const locales = Object.keys(messages)
for (const locale of locales) {
if (language.indexOf(locale) > -1) {
@ -33,8 +35,9 @@ export function getLanguage() {
return locale
}
}
Cookies.set('language', 'zh-CN')
return 'zh-CN'
Cookies.set('language', 'en')
return 'en'
}
export default new VueI18n({

Voir le fichier

@ -15,7 +15,7 @@ t.brand.mini = '监控'
// 对比 v2, v3 的结果,补充此文件和 en.js 文件
// 然后替换vue文件的内容
t.save = '保存'
t.add = '新增' // 1
t.delete = '删除' // 1
t.deleteBatch = '批量删除' // 1
@ -95,6 +95,8 @@ t.link = '链接地址'
t.refresh = '刷新'
t.abbr = '缩写'
t.detail = '详情'
t.viewdetail = '查看详情'
t.viewattr = '查看属性'
t.edit = '编辑'
t.source = '来源'
t.auto = '自动'
@ -105,6 +107,9 @@ t.enterTime = '进厂日期'
t.manufacturer = '制造商'
t.success = '修改成功!'
t.all = '全部'
t.reset = '重置'
t.preview = '预览'
t.design = '设计'
t.errors = {}
t.errors.nosection = '该产线没有工段'
@ -112,6 +117,8 @@ t.errors.numsection = '该产线有{num}条工段'
t.errors.nodata = '没有查询到相关数据!'
t.hints = {}
t.hints.input = '请输入'
t.hints.select = '请选择'
t.hints.date = '请选择日期'
t.hints.checktime = '请选择检测时间'
t.hints.number = '请输入正确的数值'
@ -267,6 +274,7 @@ t.validate.required = '必填项不能为空'
t.validate.format = '{attr}格式错误'
t.upload = {}
t.upload.title = '上传资料'
t.upload.text = '将文件拖到此处,或<em>点击上传</em>'
t.upload.tip = '只支持{format}格式文件!'
t.upload.button = '点击上传'
@ -305,7 +313,7 @@ t.login.username = '用户名'
t.login.password = '密码'
t.login.captcha = '验证码'
t.login.demo = '在线演示'
t.login.copyright = '人人开源'
t.login.copyright = '版权所有:中建材智能自动化研究院有限公司 版本: 1.0'
t.schedule = {}
t.schedule.beanName = 'bean名称'

Voir le fichier

@ -126,11 +126,13 @@ export default {
switch (command) {
case 'toCN':
this.$root.$i18n.locale = 'zh-CN'
window.navigator.language = 'zh-cn'
break
case 'toEN':
console.log('root', this.$root.$i18n.locale)
this.$root.$i18n.locale = 'en'
location.reload()
case 'toEN':
console.log('root', this.$root.$i18n.locale)
this.$root.$i18n.locale = 'en'
location.reload()
window.navigator.language = 'en-US'
break
}
},

Voir le fichier

@ -179,7 +179,7 @@ const addOrUpdateConfigs = {
},
{
name: 'files',
label: i18n.t('upload'),
label: i18n.t('upload.title'),
fieldType: 'array',
component: () => import('@/components/base-upload'),
props: {

Voir le fichier

@ -62,7 +62,7 @@ const addOrUpdateConfigs = {
{
name: 'files',
fieldType: 'array',
label: i18n.t('upload'),
label: i18n.t('upload.title'),
component: () => import('@/components/base-upload'),
props: {
// props

Voir le fichier

@ -38,14 +38,14 @@ import { calcMaxHeight } from '@/utils'
import { timeFilter } from '@/utils/filters'
const tableConfigs = [
{ prop: 'createTime', name: i18n.t('createTime'), filter: timeFilter },
{ prop: 'name', name: i18n.t('categoryName.type') },
{ prop: 'name', name: i18n.t('categoryName') },
{ prop: 'operations', name: i18n.t('handle'), width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
]
const addOrUpdateConfigs = {
type: 'dialog',
infoUrl: '/monitoring/reportSheetCategory',
fields: [{ name: 'name', label: i18n.t('categoryName.type'), required: true, span: 24 }],
fields: [{ name: 'name', label: i18n.t('categoryName'), required: true, span: 24 }],
operations: [
{ name: 'cancel', url: true, showAlways: true },
{ name: 'save', url: '/monitoring/reportSheetCategory', permission: 'monitoring:reportsheetcategory:save', showOnEdit: false },

Voir le fichier

@ -65,7 +65,7 @@ import SmallTitle from '@/components/small-title'
import { pick } from 'lodash/object'
import TableOperateComponent from '@/components/base-table/components/operationComponent'
import AttrForm from './workshopSectionDialogAttrForm.vue'
import { calcMaxHeight } from '@/utils'
const tableProps = [
{ name: i18n.t('eq.name'), prop: 'equipmentName' },
{ name: i18n.t('dept.sort'), prop: 'sort' },
@ -84,6 +84,7 @@ export default {
components: { BaseTable, SmallTitle, AttrForm },
data() {
return {
calcMaxHeight,
visible: false,
isDetail: false,
tableProps,

Voir le fichier

@ -42,12 +42,13 @@
</el-form>
</div>
<div class="login-footer">
<p>
<a href="http://demo.open.renren.io/renren-security" target="_blank">{{ $t('login.demo') }}</a>
<p style="background: #ececec99; border-radius: 8px;">
<el-button style="background: none; color: #fff; border: unset; outline: unset; cursor: pointer;" @click="chLang('zh')">中文</el-button> |
<el-button style="background: none; color: #fff; border: unset; outline: unset; cursor: pointer;" @click="chLang('en')">English</el-button>
</p>
<p>
<a href="https://www.renren.io/" target="_blank">{{ $t('login.copyright') }}</a>
2022 © renren.io
{{ $t('login.copyright') }}
</p>
</div>
</main>
@ -86,6 +87,18 @@ export default {
// this.getCaptcha()
},
methods: {
chLang(lang) {
switch (lang) {
case 'zh':
this.$root.$i18n.locale = 'zh-CN'
// location.reload()
break
case 'en':
this.$root.$i18n.locale = 'en'
location.reload()
break
}
},
//
getCaptcha() {
this.dataForm.uuid = getUUID()