|
@@ -3,37 +3,37 @@
|
|
<!-- 表头 -->
|
|
<!-- 表头 -->
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
<el-form :inline="true" style="width: 87%">
|
|
<el-form :inline="true" style="width: 87%">
|
|
- <el-form-item label="角色权限">
|
|
|
|
|
|
+ <el-form-item :label="$t('roleauthorization')">
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item >
|
|
<el-form-item >
|
|
<div>
|
|
<div>
|
|
- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入关键字查询" clearable="true">
|
|
|
|
|
|
+ <el-input style="float:left;" v-model="keyword" class="input-with-select" :placeholder="$t('pleaseenterakeyworforquery')" clearable="true">
|
|
<el-button slot="append" @click="mohu" @clear="mohus" icon="el-icon-search"></el-button>
|
|
<el-button slot="append" @click="mohu" @clear="mohus" icon="el-icon-search"></el-button>
|
|
</el-input>
|
|
</el-input>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="float: right">
|
|
<el-form-item style="float: right">
|
|
- <el-link type="primary" :underline="false" @click="handleAdd('添加角色', '立即添加')">添加角色</el-link>
|
|
|
|
- <el-link type="primary" :underline="false" @click="modify()" style="margin-left: 20px;">修改默认角色</el-link>
|
|
|
|
|
|
+ <el-link type="primary" :underline="false" @click="handleAdd($t('addingroles'), $t('Immediatelyadd'))">{{ $t('addingroles') }}</el-link>
|
|
|
|
+ <el-link type="primary" :underline="false" @click="modify()" style="margin-left: 20px;">{{ $t('modifyingDefaultRole') }}</el-link>
|
|
<!-- <el-link type="primary" :underline="false" @click="exportAuthority()" style="margin-left:20px">导出所有权限</el-link> -->
|
|
<!-- <el-link type="primary" :underline="false" @click="exportAuthority()" style="margin-left:20px">导出所有权限</el-link> -->
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-col>
|
|
</el-col>
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
<el-table :data="tableData" style="width: 100%" height="615">
|
|
<el-table :data="tableData" style="width: 100%" height="615">
|
|
- <el-table-column prop="rolename" label="角色" align="center">
|
|
|
|
|
|
+ <el-table-column prop="rolename" :label="$t('jiao-se')" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- {{scope.row.rolename}} <span v-if="scope.row.isDefault == 1" style="color: #909399;"> - (默认角色)</span>
|
|
|
|
|
|
+ {{scope.row.rolename}} <span v-if="scope.row.isDefault == 1" style="color: #909399;"> {{ $t('mo-ren-jiao-se') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="roleDescribe" label="描述"></el-table-column>
|
|
|
|
- <el-table-column prop="date" label="操作">
|
|
|
|
|
|
+ <el-table-column prop="roleDescribe" :label="$t('other.describe')"></el-table-column>
|
|
|
|
+ <el-table-column prop="date" :label="$t('operation')">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div>
|
|
<div>
|
|
- <el-button size="small" @click="handleAdd('编辑角色', '立即修改', scope.row)" :style="scope.row.rolename != '超级管理员' ? '' : 'visibility:hidden;'">编辑角色</el-button>
|
|
|
|
- <el-button type="primary" size="small" @click="shisha(scope.row.id), roleName = scope.row.rolename" v-if="scope.row.rolename !='超级管理员' || (scope.row.rolename =='超级管理员' && user.roleName == '超级管理员')">分配权限</el-button>
|
|
|
|
- <el-button size="small" @click="exportAuthority(scope.row)" >导出权限</el-button>
|
|
|
|
- <el-button type="danger" size="small" @click="deteHand(scope.row)" v-if="scope.row.rolename != '超级管理员'">删除</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="handleAdd($t('editingtherole'), $t('Immediatelychange'), scope.row)" :style="scope.row.rolename != $t('role.superAdministrator') ? '' : 'visibility:hidden;'">{{ $t('editingtherole') }}</el-button>
|
|
|
|
+ <el-button type="primary" size="small" @click="shisha(scope.row.id), roleName = scope.row.rolename" v-if="scope.row.rolename !=$t('role.superAdministrator') || (scope.row.rolename ==$t('role.superAdministrator') && user.roleName == $t('role.superAdministrator'))">{{ $t('assignpermissions') }}</el-button>
|
|
|
|
+ <el-button size="small" @click="exportAuthority(scope.row)" >{{ $t('exportpermission') }}</el-button>
|
|
|
|
+ <el-button type="danger" size="small" @click="deteHand(scope.row)" v-if="scope.row.rolename != $t('role.superAdministrator')">{{ $t('btn.delete') }}</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -51,7 +51,7 @@
|
|
></el-pagination>
|
|
></el-pagination>
|
|
</el-col> -->
|
|
</el-col> -->
|
|
<!-- 分配权限弹窗 -->
|
|
<!-- 分配权限弹窗 -->
|
|
- <el-dialog :title="'分配权限 - '+roleName" :visible.sync="dialogVisible" width="764px" :before-close="handleClose">
|
|
|
|
|
|
+ <el-dialog :title="$t('assignpermissions') +' - '+roleName" :visible.sync="dialogVisible" width="764px" :before-close="handleClose">
|
|
<div class="quanxians">
|
|
<div class="quanxians">
|
|
<!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText"></el-input> -->
|
|
<!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText"></el-input> -->
|
|
<!-- <el-tree :data="data" show-checkbox node-key="id" :filter-node-method="filterNode" ref="tree" :default-expanded-keys="[2, 3]" :default-checked-keys="[5]" :props="defaultProps"> </el-tree> -->
|
|
<!-- <el-tree :data="data" show-checkbox node-key="id" :filter-node-method="filterNode" ref="tree" :default-expanded-keys="[2, 3]" :default-checked-keys="[5]" :props="defaultProps"> </el-tree> -->
|
|
@@ -75,7 +75,7 @@
|
|
<ul v-if="mainMenu.children && mainMenu.useState">
|
|
<ul v-if="mainMenu.children && mainMenu.useState">
|
|
<li v-for="subMenu in mainMenu.children" :key="subMenu.id">
|
|
<li v-for="subMenu in mainMenu.children" :key="subMenu.id">
|
|
<el-checkbox :label="subMenu.name" name="type" v-model="subMenu.checked" style="font-weight:bold;" @change="subChange(subMenu)"></el-checkbox>
|
|
<el-checkbox :label="subMenu.name" name="type" v-model="subMenu.checked" style="font-weight:bold;" @change="subChange(subMenu)"></el-checkbox>
|
|
- <span v-if="subMenu.functionList && subMenu.functionList.length > 0" style="margin-right:10px;margin-left:10px;">(功能:
|
|
|
|
|
|
+ <span v-if="subMenu.functionList && subMenu.functionList.length > 0" style="margin-right:10px;margin-left:10px;">({{ $t('gong-neng') }} :
|
|
<el-checkbox v-for="fun in subMenu.functionList" :key="fun.id" :label="fun.name" name="type" v-model="fun.checked" @change="funChange(fun)"></el-checkbox>)</span>
|
|
<el-checkbox v-for="fun in subMenu.functionList" :key="fun.id" :label="fun.name" name="type" v-model="fun.checked" @change="funChange(fun)"></el-checkbox>)</span>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
@@ -85,39 +85,39 @@
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" @click="saveList()">保存</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="saveList()">{{ $t('save') }}</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 添加角色弹窗 -->
|
|
<!-- 添加角色弹窗 -->
|
|
<el-dialog :title="titles" :visible.sync="addDialogVisible" width="600px" :before-close="handleClose">
|
|
<el-dialog :title="titles" :visible.sync="addDialogVisible" width="600px" :before-close="handleClose">
|
|
<div>
|
|
<div>
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
|
- <el-form-item label="角色名称" prop="rolename">
|
|
|
|
|
|
+ <el-form-item :label="$t('charactername')" prop="rolename">
|
|
<el-input v-model="form.rolename" clearable></el-input>
|
|
<el-input v-model="form.rolename" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="描述">
|
|
|
|
|
|
+ <el-form-item :label="$t('other.describe')">
|
|
<el-input type="textarea" v-model="form.roleDescribe" maxlength="25" show-word-limit clearable></el-input>
|
|
<el-input type="textarea" v-model="form.roleDescribe" maxlength="25" show-word-limit clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button style="float: right" type="primary" @click="onSubmit('form')">确定</el-button>
|
|
|
|
|
|
+ <el-button style="float: right" type="primary" @click="onSubmit('form')">{{ $t('btn.determine') }}</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 修改默认角色弹窗 -->
|
|
<!-- 修改默认角色弹窗 -->
|
|
- <el-dialog title="默认角色" :visible.sync="defaultRole" width="400px" :before-close="handleClose">
|
|
|
|
|
|
+ <el-dialog :title="$t('defaultrole')" :visible.sync="defaultRole" width="400px" :before-close="handleClose">
|
|
<div>
|
|
<div>
|
|
<el-form label-width="80px">
|
|
<el-form label-width="80px">
|
|
- <el-form-item label="默认角色">
|
|
|
|
- <el-select v-model="roleId" placeholder="请选择默认角色">
|
|
|
|
|
|
+ <el-form-item :label="$t('defaultrole')">
|
|
|
|
+ <el-select v-model="roleId" :placeholder="$t('defaultText.pleaseChoose')">
|
|
<el-option v-for="item in auseList" :key="item.id" :label="item.rolename" :value="item.id"></el-option>
|
|
<el-option v-for="item in auseList" :key="item.id" :label="item.rolename" :value="item.id"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <div class="daoru"><span type="info" style="color:#999">*设置导入人员时的默认角色</span></div>
|
|
|
|
|
|
+ <div class="daoru"><span type="info" style="color:#999">{{ $t('defaultroleforimportingpeople') }}</span></div>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button type="primary" @click="determine()">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="determine()">{{ $t('btn.determine') }}</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -148,7 +148,7 @@ export default {
|
|
moduleList: [],
|
|
moduleList: [],
|
|
roles: '',
|
|
roles: '',
|
|
titles: '',
|
|
titles: '',
|
|
- addTil: '立即添加',
|
|
|
|
|
|
+ addTil: this.$t('Immediatelyadd'),
|
|
keyword: '',
|
|
keyword: '',
|
|
auseList: [],
|
|
auseList: [],
|
|
defaultRole: false,
|
|
defaultRole: false,
|
|
@@ -156,7 +156,7 @@ export default {
|
|
roleName: '',
|
|
roleName: '',
|
|
rules: {
|
|
rules: {
|
|
rolename: [{
|
|
rolename: [{
|
|
- required: true, message: '请输入角色名称', trigger: 'blur'
|
|
|
|
|
|
+ required: true, message: this.$t('peaseenterthe'), trigger: 'blur'
|
|
}]
|
|
}]
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -187,7 +187,7 @@ export default {
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '操作成功',
|
|
|
|
|
|
+ message: this.$t('operationissuccessful'),
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
this.defaultRole = false
|
|
this.defaultRole = false
|
|
@@ -288,8 +288,8 @@ export default {
|
|
return data.label.indexOf(value) !== -1;
|
|
return data.label.indexOf(value) !== -1;
|
|
},
|
|
},
|
|
handleAdd(tex, tel, id) {
|
|
handleAdd(tex, tel, id) {
|
|
- if(id && id.rolename == '超级管理员'){
|
|
|
|
- this.$message('超级管理员为固定的默认角色无法编辑');
|
|
|
|
|
|
+ if(id && id.rolename == this.$t('role.superAdministrator')){
|
|
|
|
+ this.$message(this.$t('administratorcannotbeedited'));
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.titles = tex
|
|
this.titles = tex
|
|
@@ -339,9 +339,9 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
deteHand(item) {
|
|
deteHand(item) {
|
|
- this.$confirm('此操作将删除('+item.rolename+')角色, 是否继续?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
|
+ this.$confirm(this.$t('operationwilldelete')+'('+item.rolename+')'+this.$t('shifujuxu'), this.$t('other.prompts'), {
|
|
|
|
+ confirmButtonText: this.$t('btn.determine'),
|
|
|
|
+ cancelButtonText: this.$t('btn.cancel'),
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.http.post('/permission/deleteRole', {
|
|
this.http.post('/permission/deleteRole', {
|
|
@@ -350,7 +350,7 @@ export default {
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '删除成功',
|
|
|
|
|
|
+ message: this.$t('message.successfullyDeleted'),
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
this.getRole()
|
|
this.getRole()
|
|
@@ -442,7 +442,7 @@ export default {
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '操作成功',
|
|
|
|
|
|
+ message: this.$t('operationissuccessful'),
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
this.getRole()
|
|
this.getRole()
|
|
@@ -467,7 +467,7 @@ export default {
|
|
},res => {
|
|
},res => {
|
|
if(res.code == 'ok'){
|
|
if(res.code == 'ok'){
|
|
var a = document.createElement('a');
|
|
var a = document.createElement('a');
|
|
- a.download = "权限数据表.xls";
|
|
|
|
|
|
+ a.download = this.$t('quanxianshuju')+ ".xls";
|
|
a.href = res.data;
|
|
a.href = res.data;
|
|
a.click();
|
|
a.click();
|
|
}else{
|
|
}else{
|