提交 e2e2b09f authored 作者: taojinlong's avatar taojinlong

feat: 国际化

上级 da8e4473
......@@ -3,42 +3,42 @@
<div class="toolbar">
<div class="canvas-config">
<span>画布大小</span>
<span> {{ $t(panel.canvas_size)}} </span>
<input v-model="canvasStyleData.width">
<span>*</span>
<input v-model="canvasStyleData.height">
</div>
<div class="canvas-config" style="margin-right: 10px">
<span>画布比例</span>
<span> {{ $t(panel.canvas_scale)}} </span>
<input v-model="scale" @input="handleScaleChange"> %
</div>
<el-tooltip content="样式">
<el-tooltip :content="$t('panel.style')">
<el-button class="el-icon-magic-stick" size="mini" circle @click="showPanel" />
</el-tooltip>
<el-tooltip content="撤消">
<el-tooltip :content="$t('panel.undo') ">
<el-button class="el-icon-refresh-right" size="mini" circle @click="undo" />
</el-tooltip>
<el-tooltip content="重做">
<el-tooltip :content="$t('panel.redo') ">
<el-button class="el-icon-refresh-left" size="mini" circle @click="redo" />
</el-tooltip>
<el-tooltip content="插入图片">
<el-tooltip :content="$t('panel.insert_picture') ">
<el-button class="el-icon-upload" size="mini" circle @click="goFile" />
</el-tooltip>
<el-tooltip content="清空画布" style="margin-right: 10px">
<el-tooltip :content="$t('panel.clean_canvas')" style="margin-right: 10px">
<el-button class="el-icon-document-delete" size="mini" circle @click="clearCanvas" />
</el-tooltip>
<input id="input" ref="files" type="file" hidden @change="handleFileChange">
<el-tooltip content="保存">
<el-tooltip :content="$t('commons.save') ">
<el-button class="el-icon-circle-check" size="mini" circle @click="save" />
</el-tooltip>
<el-tooltip content="预览">
<el-tooltip :content="$t('panel.preview')">
<el-button class="el-icon-view" size="mini" circle @click="clickPreview" />
</el-tooltip>
<span style="float: right;margin-left: 10px">
<el-button size="mini" @click="closePanelEdit">
关闭
{{ $t(commons.close) }}
</el-button>
</span>
</div>
......
......@@ -2,7 +2,7 @@
<div v-loading="requestStatus==='waiting'" class="rect-shape">
<div v-if="requestStatus==='error'" style=";width: 100%;height: 100%;background-color: #ece7e7; text-align: center">
<div style="font-size: 12px; color: #9ea6b2;">
获取数据出错 请联系管理员<br>
{{ $t(panel.error_data) }}<br>
{{ message }}
</div>
</div>
......
......@@ -85,6 +85,7 @@ export default {
tokenError: 'Token error, please login again'
},
commons: {
all: 'All',
enable: 'Enable',
disable: 'Disable',
yes: 'Yes',
......@@ -812,7 +813,34 @@ export default {
export_to_panel: 'Export to template',
preview: 'Preview',
select_panel_from_left: 'Please select panel from left',
template_nale: 'Template name'
template_nale: 'Template name',
template: 'Template',
category: 'Category',
all_org: 'All Organization',
custom: 'Custom',
import_template: 'Import Template',
copy_template: 'Copy Template',
upload_template: 'Upload Template',
belong_to_category: 'Category',
pls_select_belong_to_category: 'Please select category',
template_name_cannot_be_empty: 'Template name cannot be empty',
select_by_table: 'Select by table',
data_list: 'Data list',
component_list: 'Component list',
custom_scope: 'Custom control range',
multiple_choice: 'Multiple choice',
single_choice: 'Single choice',
field: 'Field',
unshared_people: 'Unshared people',
shared_people: 'Shared people',
error_data: 'Error getting data, please contact administrator',
canvas_size: 'Canvas Size',
canvas_scale: 'Canvas Scale',
style: 'Style',
clean_canvas: 'Clean Canvas',
insert_picture: 'Insert Picture',
redo: 'Redo',
undo: 'UToolbar.vuendo'
},
plugin: {
local_install: 'Local installation',
......
差异被折叠。
......@@ -85,6 +85,7 @@ export default {
tokenError: 'token错误,请重新登录'
},
commons: {
all: '全部',
enable: '启用',
disable: '停用',
yes: '是',
......@@ -812,7 +813,34 @@ export default {
export_to_panel: '导出为模板',
preview: '预览',
select_panel_from_left: '请从左侧选择仪表盘',
template_nale: '模板名称'
template_nale: '模板名称',
template: '模板',
category: '分类',
all_org: '所有组织',
custom: '自定义',
import_template: '导入模板',
copy_template: '复用模板',
upload_template: '上传模板',
belong_to_category: '所属类别',
pls_select_belong_to_category: '请选择所属类别',
template_name_cannot_be_empty: '模板名称不能为空',
select_by_table: '按表选择',
data_list: '数据列表',
component_list: '组件列表',
custom_scope: '自定义控制范围',
multiple_choice: '多选',
single_choice: '单选',
field: '字段',
unshared_people: '未分享人员',
shared_people: '已分享人员',
error_data: '获取数据出错 请联系管理员 Error getting data, please contact administrator',
canvas_size: '画布大小',
canvas_scale: '画布比例',
style: '样式',
clean_canvas: '清空画布',
insert_picture: '插入图片',
redo: '重做',
undo: '撤销'
},
plugin: {
local_install: '本地安装',
......
......@@ -11,7 +11,7 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId"
>
<el-table-column label="所有组织" prop="name" />
<el-table-column :label="$t('panel.all_org')" prop="name" />
<el-table-column type="selection" fixd />
<!-- <el-table-column label="分享给" prop="deptId" width="80" fixed="right">
<template slot-scope="scope">
......
......@@ -79,7 +79,7 @@ export default {
const rows = this.$refs.table.store.states.selection
const request = this.buildRequest(rows)
saveShare(request).then(res => {
this.$success('保存成功')
this.$success(this.$t('commons.save_success'))
return true
}).catch(err => {
this.$error(err.message)
......@@ -88,7 +88,6 @@ export default {
},
cancel() {
console.log('role cancel')
},
buildRequest(rows) {
const targetIds = rows.map(row => row.roleId)
......
......@@ -34,9 +34,9 @@ export default {
data() {
return {
data: [],
defaultHeadName: '全部',
defaultHeadName: this.$t('commons.all'),
columnLabel: null,
filter_options: [{ text: '未分享人员', value: 0 }, { text: '已分享人员', value: 1 }],
filter_options: [{ text: this.$t('panel.unshared_people'), value: 0 }, { text: this.$t('panel.shared_people'), value: 1 }],
fieldName: 'nickName',
type: 0, // 类型0代表用户
shares: []
......@@ -80,7 +80,7 @@ export default {
const rows = this.$refs.table.store.states.selection
const request = this.buildRequest(rows)
saveShare(request).then(res => {
this.$success('保存成功')
this.$success(this.$t('commons.save_success'))
return true
}).catch(err => {
this.$error(err.message)
......
......@@ -3,7 +3,7 @@
<de-container class="de-dialog-container">
<de-aside-container :show-drag-bar="false" class="ms-aside-container">
<el-tabs v-model="activeName" class="filter-dialog-tabs">
<el-tab-pane :lazy="true" class="de-tab" label="按表选择" name="dataset">
<el-tab-pane :lazy="true" class="de-tab" :label="$t('panel.select_by_table')" name="dataset">
<div class="component-header filter-common">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item v-for="bread in dataSetBreads" :key="bread.label">
......@@ -120,7 +120,7 @@
<div class="filter-field">
<div class="field-content">
<div class="field-content-left">
<div class="field-content-text">字段</div>
<div class="field-content-text">{{ $t(panel.field) }} </div>
</div>
<div class="field-content-right">
......@@ -149,14 +149,14 @@
<el-switch
v-if="widget.showSwitch"
v-model="componentInfo.options.attrs.multiple"
active-text="多选"
inactive-text="单选"
:active-text="$t('panel.multiple_choice')"
:inactive-text="$t('panel.single_choice')"
@change="multipleChange"
/>
</div>
</el-col>
<el-col :span="16"><div class="filter-options-right">
<el-checkbox v-model="customRange"><span> 自定义控制范围 </span> </el-checkbox>
<el-checkbox v-model="customRange"><span> {{ $t(panel.custom_scope) }} </span> </el-checkbox>
<el-popover
v-model="popovervisible"
......@@ -175,10 +175,6 @@
</el-checkbox-group>
</div>
<!-- <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="popovervisible=false">取消</el-button>
<el-button type="primary" size="mini" @click="popovervisible=false">确定</el-button>
</div> -->
<i slot="reference" :class="{'i-filter-active': customRange, 'i-filter-inactive': !customRange}" class="el-icon-setting i-filter" />
</el-popover>
<!-- <el-checkbox disabled>备选项</el-checkbox> -->
......@@ -243,10 +239,10 @@ export default {
showDomType: 'tree',
comShowDomType: 'view',
dataSetBreads: [
{ label: '数据列表', link: false, type: 'root' }
{ label: this.$t('panel.data_list') , link: false, type: 'root' }
],
componentSetBreads: [
{ label: '组件列表', link: false, type: 'root' }
{ label: this.$t('panel.component_list'), link: false, type: 'root' }
],
data: [],
sceneDatas: [],
......@@ -321,12 +317,6 @@ export default {
.map(item => item.propValue.viewId)
viewsWithIds(viewIds).then(res => {
const datas = res.data
// for (let index = 0; index < 4; index++) {
// datas = datas.concat(datas)
// }
// datas.forEach(item => item.name += 'aaaaaaaaabbbbb')
this.viewInfos = datas
})
},
......
......@@ -4,7 +4,7 @@
<el-row>
<el-input
v-model="templateFilterText"
placeholder="输入关键字进行过滤"
:placeholder="$t('panel.filter_keywords')"
size="mini"
clearable
prefix-icon="el-icon-search"
......
......@@ -2,17 +2,17 @@
<el-row>
<el-row v-if="editPanel.optType==='new' && editPanel.panelInfo.nodeType==='panel'">
<el-col :span="18" style="height: 40px">
<el-radio v-model="inputType" label="self">自定义</el-radio>
<el-radio v-model="inputType" label="import">导入模板</el-radio>
<el-radio v-model="inputType" label="copy">复用模板</el-radio>
<el-radio v-model="inputType" label="self"> {{ $t(panel.custom) }}</el-radio>
<el-radio v-model="inputType" label="import">{{ $t(panel.import_template) }} </el-radio>
<el-radio v-model="inputType" label="copy">{{ $t(panel.copy_template) }} </el-radio>
</el-col>
<el-col v-if="inputType==='import'" :span="6">
<el-button class="el-icon-upload" size="small" type="primary" @click="goFile">上传模板</el-button>
<el-button class="el-icon-upload" size="small" type="primary" @click="goFile">{{ $t(panel.upload_template) }}</el-button>
<input id="input" ref="files" type="file" accept=".DE" hidden @change="handleFileChange">
</el-col>
</el-row>
<el-row style="margin-top: 5px">
<el-col :span="4">{{ editPanel.titleSuf }}名称</el-col>
<el-col :span="4">{{ editPanel.titleSuf }} {{ $t(commons.name) }}</el-col>
<el-col :span="20">
<el-input v-model="editPanel.panelInfo.name" clearable size="mini" />
</el-col>
......@@ -25,8 +25,8 @@
</el-row>
<el-row v-if="inputType==='import'" class="preview" :style="classBackground" />
<el-row class="root-class">
<el-button @click="cancel()">取 消</el-button>
<el-button type="primary" @click="save()">确 定</el-button>
<el-button @click="cancel()">{{ $t(commons.cancel) }}</el-button>
<el-button type="primary" @click="save()">{{ $t(commons.confirm) }}</el-button>
</el-row>
</el-row>
</template>
......@@ -49,7 +49,7 @@ export default {
fieldName: 'name',
tableRadio: null,
keyWordSearch: '',
columnLabel: '所属类别',
columnLabel: this.$t('panel.belong_to_category'),
templateList: [],
importTemplateInfo: {
snapshot: ''
......@@ -101,12 +101,12 @@ export default {
},
save() {
if (!this.editPanel.panelInfo.name) {
this.$warning('名称不能为空')
this.$warning( this.$t('commons.name_can_not_empty'))
return false
}
panelSave(this.editPanel.panelInfo).then(response => {
this.$message({
message: '保存成功',
message: this.$t('commons.save_success'),
type: 'success',
showClose: true
})
......
......@@ -314,24 +314,24 @@ export default {
this.editPanel.visible = true
switch (param.optType) {
case 'new':
this.editPanel.titlePre = '新建'
this.editPanel.panelInfo.name = '新建仪表盘'
this.editPanel.titlePre = this.$t('commons.create')
this.editPanel.panelInfo.name = this.$t('panel.panelAdd')
this.editPanel.panelInfo.pid = param.data.id
this.editPanel.panelInfo.level = param.data.level + 1
break
case 'edit':
case 'rename':
this.editPanel.titlePre = '编辑'
this.editPanel.titlePre = this.$t('commons.edit')
this.editPanel.panelInfo.id = param.data.id
this.editPanel.panelInfo.name = param.data.name
break
}
switch (param.type) {
case 'folder':
this.editPanel.titleSuf = '目录'
this.editPanel.titleSuf = this.$t('panel.group')
break
case 'panel':
this.editPanel.titleSuf = '仪表盘'
this.editPanel.titleSuf = this.$t('panel.panel')
break
}
},
......
......@@ -49,7 +49,7 @@ export default {
fieldName: 'name',
tableRadio: null,
keyWordSearch: '',
columnLabel: '所属类别'
columnLabel: this.$t('panel.belong_to_category')
}
},
created() {
......@@ -74,16 +74,16 @@ export default {
},
save() {
if (!this.templateInfo.pid) {
this.$warning('请选择所属类别')
this.$warning(this.$t(panel.pls_select_belong_to_category))
return false
}
if (!this.templateInfo.name) {
this.$warning('模板名称不能为空')
this.$warning(this.$t('panel.template_name_cannot_be_empty'))
return false
}
post('/template/save', this.templateInfo).then(response => {
this.$message({
message: '保存成功',
message: this.$t('commons.save_success'),
type: 'success',
showClose: true
})
......
......@@ -34,8 +34,8 @@ export default {
},
methods: {
templateDelete() {
this.$alert('是否删除模板:' + this.template.name + '?', '', {
confirmButtonText: '确认',
this.$alert(this.$t('panel.confirm_delete') + this.$t('panel.template') + ': ' + this.template.name + '?', '', {
confirmButtonText: this.$t('panel.confirm'),
callback: (action) => {
if (action === 'confirm') {
this.$emit('templateDelete', this.template.id)
......
......@@ -129,8 +129,8 @@ export default {
this.$emit('showTemplateEditDialog', 'new')
},
templateDelete(template) {
this.$alert('是否删除分类:' + template.name + '?', '', {
confirmButtonText: '确认',
this.$alert(this.$t('panel.confirm_delete') + this.$t('panel.category') + ': ' + template.name + '?', '', {
confirmButtonText: this.$t('panel.confirm_delete'),
callback: (action) => {
if (action === 'confirm') {
this.$emit('templateDelete', template.id)
......
......@@ -88,7 +88,7 @@ export default {
if (id) {
post('/template/delete/' + id, null).then(response => {
this.$message({
message: '删除成功',
message: this.$t('commons.delete_success'),
type: 'success',
showClose: true
})
......@@ -98,10 +98,10 @@ export default {
},
showTemplateEditDialog(type, templateInfo) {
if (type === 'edit') {
this.dialogTitle = '编辑'
this.dialogTitle = this.$t('commons.edit')
this.templateEditForm = JSON.parse(JSON.stringify(templateInfo))
} else {
this.dialogTitle = '新建'
this.dialogTitle = this.$t('commons.create')
this.templateEditForm = { name: '', nodeType: 'folder', templateType: this.currentTemplateType, level: 0 }
}
this.editTemplate = true
......@@ -112,7 +112,7 @@ export default {
saveTemplateEdit(templateEditForm) {
post('/template/save', templateEditForm).then(response => {
this.$message({
message: '保存成功',
message: this.$t('commons.save_success'),
type: 'success',
showClose: true
})
......
......@@ -132,15 +132,13 @@ export default {
],
searchConfig: {
useQuickSearch: true,
quickPlaceholder: '按名称搜索',
quickPlaceholder: this.$t('commons.search_by_name'),
combine: false,
components: [
// { field: 'name', label: '姓名', component: 'FuComplexInput', defaultOperator: 'eq' },
{ field: 'name', label: '名称', component: 'FuComplexInput' },
{ field: 'name', label: this.$t('commons.name'), component: 'FuComplexInput' },
{
field: 'type',
label: '类型',
label: this.$t('datasource.type'),
component: 'FuComplexSelect',
options: [{ label: 'mysql', value: 'mysql' }, { label: 'sqlServer', value: 'sqlServer' }],
multiple: false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论