提交 be379743 编写于 作者: C Captain.B

Merge remote-tracking branch 'origin/dev' into dev

const en_US = { const en_US = {
commons: { commons: {
'workspace': 'Workspace', 'workspace': 'Workspace',
'organization': 'Organization',
'project': 'Project', 'project': 'Project',
'name': 'Name', 'name': 'Name',
'description': 'Description', 'description': 'Description',
'save': 'Save', 'save': 'Save',
'save_success': 'Saved successfully', 'save_success': 'Saved successfully',
'delete_success': 'Deleted successfully', 'delete_success': 'Deleted successfully',
'modify_success': 'Modify Success',
'delete_cancel': 'Deleted Cancel',
'confirm': 'Confirm', 'confirm': 'Confirm',
'cancel': 'Cancel', 'cancel': 'Cancel',
'prompt': 'Prompt', 'prompt': 'Prompt',
'operating': 'Operating',
}, },
workspace: { workspace: {
'create': 'Create Workspace', 'create': 'Create Workspace',
...@@ -21,6 +25,15 @@ const en_US = { ...@@ -21,6 +25,15 @@ const en_US = {
'organization_name': 'Organization Name', 'organization_name': 'Organization Name',
'please_choose_organization': 'Please Choose Organization', 'please_choose_organization': 'Please Choose Organization',
}, },
organization: {
'create': 'Create',
'modify': 'Modify',
'delete_confirm': 'Are you sure you want to delete this workspace?',
'input_name': 'Please enter a organization name',
'input_name_2_50': '2 to 50 characters in length',
'search_by_name': 'Search by name',
'special_characters_are_not_supported': 'Special characters are not supported',
},
project: { project: {
'recent': 'Recent Projects', 'recent': 'Recent Projects',
'create': 'Create Project', 'create': 'Create Project',
......
const zh_CN = { const zh_CN = {
commons: { commons: {
'workspace': '工作空间', 'workspace': '工作空间',
'organization': '组织',
'project': '项目', 'project': '项目',
'name': '名称', 'name': '名称',
'description': '描述', 'description': '描述',
'save': '保存', 'save': '保存',
'save_success': '保存成功', 'save_success': '保存成功',
'delete_success': '删除成功', 'delete_success': '删除成功',
'modify_success': '修改成功',
'delete_cancel': '已取消删除',
'confirm': '确定', 'confirm': '确定',
'cancel': '取消', 'cancel': '取消',
'prompt': '提示', 'prompt': '提示',
'operating': '操作',
}, },
workspace: { workspace: {
'create': '创建工作空间', 'create': '创建工作空间',
...@@ -21,6 +25,15 @@ const zh_CN = { ...@@ -21,6 +25,15 @@ const zh_CN = {
'organization_name': '所属组织', 'organization_name': '所属组织',
'please_choose_organization': '请选择组织', 'please_choose_organization': '请选择组织',
}, },
organization: {
'create': '创建组织',
'modify': '修改组织',
'delete_confirm': '这个组织确定要删除吗?',
'input_name': '请输入组织名称',
'input_name_2_50': '长度在 2 到 50 个字符',
'search_by_name': '根据名称搜索',
'special_characters_are_not_supported': '不支持特殊字符',
},
project: { project: {
'recent': '最近的项目', 'recent': '最近的项目',
'create': '创建项目', 'create': '创建项目',
......
const zh_TW = { const zh_TW = {
commons: { commons: {
'workspace': '工作空间', 'workspace': '工作空间',
'organization': '组织',
'name': '名称', 'name': '名称',
'description': '描述', 'description': '描述',
'save': '保存', 'save': '保存',
...@@ -9,6 +10,7 @@ const zh_TW = { ...@@ -9,6 +10,7 @@ const zh_TW = {
'confirm': '确定', 'confirm': '确定',
'cancel': '取消', 'cancel': '取消',
'prompt': '提示', 'prompt': '提示',
'operating': '操作',
}, },
workspace: { workspace: {
'create': '创建工作空间', 'create': '创建工作空间',
...@@ -20,6 +22,11 @@ const zh_TW = { ...@@ -20,6 +22,11 @@ const zh_TW = {
'organization_name': '所属组织', 'organization_name': '所属组织',
'please_choose_organization': '请选择组织', 'please_choose_organization': '请选择组织',
}, },
organization: {
'create': '创建组织',
'modify': '修改组织',
'search_by_name': '根据名称搜索',
},
project: { project: {
'recent': '最近的项目' 'recent': '最近的项目'
}, },
......
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
<el-card> <el-card>
<div slot="header"> <div slot="header">
<el-row type="flex" justify="space-between" align="middle"> <el-row type="flex" justify="space-between" align="middle">
<span class="title">组织 <span class="title">{{$t('commons.organization')}}
<ms-create-box :tips="btnTips" :exec="create"/> <ms-create-box :tips="btnTips" :exec="create"/>
</span> </span>
<span class="search"> <span class="search">
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search" <el-input type="text" size="small" :placeholder="$t('organization.search_by_name')" prefix-icon="el-icon-search"
maxlength="60" v-model="condition" clearable/> maxlength="60" v-model="condition" clearable/>
</span> </span>
</el-row> </el-row>
</div> </div>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column type="selection" width="55"/> <el-table-column type="selection" width="55"/>
<el-table-column prop="name" label="名称"/> <el-table-column prop="name" :label="$t('commons.name')"/>
<el-table-column prop="description" label="描述"/> <el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column label="操作"> <el-table-column :label="$t('commons.operating')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/> <el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/> <el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini" circle/>
...@@ -44,31 +44,31 @@ ...@@ -44,31 +44,31 @@
</div> </div>
</el-card> </el-card>
<el-dialog title="创建组织" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true"> <el-dialog :title="$t('organization.create')" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createOrganization"> <el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createOrganization">
<el-form-item label="名称" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/> <el-input v-model="form.name" autocomplete="off"/>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item :label="$t('commons.description')" prop="description">
<el-input v-model="form.description" autocomplete="off"/> <el-input v-model="form.description" autocomplete="off"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="createOrganization('createOrganization')" size="medium">创建</el-button> <el-button type="primary" @click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="修改组织" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc"> <el-dialog :title="$t('organization.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="updateOrganizationForm"> <el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="updateOrganizationForm">
<el-form-item label="用户名" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"/> <el-input v-model="form.name" autocomplete="off"/>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item :label="$t('commons.description')" prop="description">
<el-input v-model="form.description" autocomplete="off"/> <el-input v-model="form.description" autocomplete="off"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateOrganization('updateOrganizationForm')" size="medium">修改</el-button> <el-button type="primary" @click="updateOrganization('updateOrganizationForm')" size="medium">{{$t('organization.modify')}}</el-button>
</span> </span>
</el-dialog> </el-dialog>
...@@ -94,23 +94,23 @@ ...@@ -94,23 +94,23 @@
currentPage: 1, currentPage: 1,
pageSize: 5, pageSize: 5,
total: 0, total: 0,
btnTips: "添加组织", btnTips: this.$t('organization.create'),
condition: "", condition: "",
tableData: [], tableData: [],
form: {}, form: {},
rule: { rule: {
name: [ name: [
{required: true, message: '请输入姓名', trigger: 'blur'}, {required: true, message: this.$t('organization.input_name'), trigger: 'blur'},
{ min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }, { min: 2, max: 10, message: this.$t('organization.input_name_2_50'), trigger: 'blur' },
{ {
required: true, required: true,
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/, pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
message: '姓名不支持特殊字符', message: this.$t('organization.special_characters_are_not_supported'),
trigger: 'blur' trigger: 'blur'
} }
], ],
description: [ description: [
{ max: 60, message: '最大长度 60 个字符', trigger: 'blur'} { max: 50, message: this.$t('organization.input_name_2_50'), trigger: 'blur'}
] ]
} }
} }
...@@ -128,22 +128,22 @@ ...@@ -128,22 +128,22 @@
this.form = row; this.form = row;
}, },
del(row) { del(row) {
this.$confirm('是否删除组织' + row.name +'', '', { this.$confirm(this.$t('organization.delete_confirm'), '', {
confirmButtonText: '确定', confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: '取消', cancelButtonText: this.$t('commons.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.result = this.$get(this.deletePath + row.id,() => { this.result = this.$get(this.deletePath + row.id,() => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: this.$t('commons.delete_success')
}); });
this.initTableData() this.initTableData()
}); });
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: this.$t('commons.delete_cancel')
}); });
}); });
}, },
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
this.result = this.$post(this.createPath, this.form,() => { this.result = this.$post(this.createPath, this.form,() => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加成功!' message: this.$t('commons.save_success')
}); });
this.initTableData(); this.initTableData();
this.createVisible = false; this.createVisible = false;
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
this.result = this.$post(this.updatePath, this.form,() => { this.result = this.$post(this.updatePath, this.form,() => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: this.$t('commons.modify_success')
}); });
this.updateVisible = false; this.updateVisible = false;
this.initTableData(); this.initTableData();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册