Procházet zdrojové kódy

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

ggooalice před 2 roky
rodič
revize
52ebd9a2f9

+ 20 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -880,5 +880,24 @@
   "selectastartdate": "Please select a start date",
   "cannotbesynchronized": "The time period for synchronizing messages from DingTalk cannot exceed seven days",
   "tripStatistics": "Business trip statistics export",
-  "applicationissuccessful": "Successful application"
+  "applicationissuccessful": "Successful application",
+  "Immediatelyadd": "Add it now",
+  "addingroles": "Add role",
+  "pleaseenterakeyworforquery": "Please enter a keyword query",
+  "roleauthorization": "Role Permissions",
+  "jiao-se": "Role",
+  "mo-ren-jiao-se": "- (default role)",
+  "modifyingDefaultRole": "Modify the default role",
+  "Immediatelychange": "Edit now",
+  "assignpermissions": "assign permissions",
+  "editingtherole": "edit role",
+  "exportpermission": "export permission",
+  "administratorcannotbeedited": "The super administrator is a fixed default role and cannot be edited",
+  "charactername": "Role Name",
+  "defaultrole": "default role",
+  "defaultroleforimportingpeople": "* Set default roles when importing people",
+  "gong-neng": "Function",
+  "operationwilldelete": "This action will delete",
+  "quanxianshuju": "Permissions Data Sheet",
+  "shifujuxu": "role, continue?"
 }

+ 20 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -880,5 +880,24 @@
   "projectassociate": "请选择要关联的项目",
   "tripStatistics": "出差统计导出",
   "cannotbesynchronized": "从钉钉同步消息时间段不能超过七天",
-  "applicationissuccessful": "申请成功"
+  "applicationissuccessful": "申请成功",
+  "roleauthorization": "角色权限",
+  "pleaseenterakeyworforquery": "请输入关键字查询",
+  "addingroles": "添加角色",
+  "Immediatelyadd": "立即添加",
+  "modifyingDefaultRole": "修改默认角色",
+  "jiao-se": "角色",
+  "mo-ren-jiao-se": "- (默认角色)",
+  "editingtherole": "编辑角色",
+  "Immediatelychange": "立即修改",
+  "assignpermissions": "分配权限",
+  "exportpermission": "导出权限",
+  "gong-neng": "功能",
+  "charactername": "角色名称",
+  "defaultrole": "默认角色",
+  "defaultroleforimportingpeople": "*设置导入人员时的默认角色",
+  "administratorcannotbeedited": "超级管理员为固定的默认角色无法编辑",
+  "operationwilldelete": "此操作将删除",
+  "shifujuxu": "角色, 是否继续?",
+  "quanxianshuju": "权限数据表"
 }

+ 34 - 34
fhKeeper/formulahousekeeper/timesheet/src/views/quanx/quanx.vue

@@ -3,37 +3,37 @@
       <!-- 表头 -->
       <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
           <el-form :inline="true" style="width: 87%">
-              <el-form-item label="角色权限">
+              <el-form-item :label="$t('roleauthorization')">
               </el-form-item>
               <el-form-item >
                   <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-input>
                   </div>
               </el-form-item>
               <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-form-item>
           </el-form>
       </el-col>
       <!-- 表格 -->
       <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">
-              {{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>
         </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">
                 <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>
             </template>
         </el-table-column>
@@ -51,7 +51,7 @@
             ></el-pagination>
         </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">
                 <!-- <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> -->
@@ -75,7 +75,7 @@
                       <ul v-if="mainMenu.children && mainMenu.useState">
                         <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>
-                            <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>
                         </li>
                       </ul>
@@ -85,39 +85,39 @@
                 </el-form>
             </div>
             <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>
         </el-dialog>
         <!-- 添加角色弹窗 -->
         <el-dialog :title="titles" :visible.sync="addDialogVisible" width="600px" :before-close="handleClose">
             <div>
                 <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-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-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>
             </div>
         </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>
               <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-select>
                 </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>
             </div>
             <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>
         </el-dialog>
   </div>
@@ -148,7 +148,7 @@ export default {
         moduleList: [],
         roles: '',
         titles: '',
-        addTil: '立即添加',
+        addTil: this.$t('Immediatelyadd'),
         keyword: '',
         auseList: [],
         defaultRole: false,
@@ -156,7 +156,7 @@ export default {
         roleName: '',
         rules: {
           rolename: [{
-            required: true, message: '请输入角色名称', trigger: 'blur'
+            required: true, message: this.$t('peaseenterthe'), trigger: 'blur'
           }]
         }
     };
@@ -187,7 +187,7 @@ export default {
         res => {
             if (res.code == "ok") {
                 this.$message({
-                    message: '操作成功',
+                    message: this.$t('operationissuccessful'),
                     type: "success"
                 });
                 this.defaultRole = false
@@ -288,8 +288,8 @@ export default {
         return data.label.indexOf(value) !== -1;
       },
         handleAdd(tex, tel, id) {
-          if(id && id.rolename == '超级管理员'){
-            this.$message('超级管理员为固定的默认角色无法编辑');
+          if(id && id.rolename == this.$t('role.superAdministrator')){
+            this.$message(this.$t('administratorcannotbeedited'));
             return
           }
           this.titles = tex
@@ -339,9 +339,9 @@ export default {
          
       },
       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'
         }).then(() => {
           this.http.post('/permission/deleteRole', {
@@ -350,7 +350,7 @@ export default {
           res => {
               if (res.code == "ok") {
                 this.$message({
-                      message: '删除成功',
+                      message: this.$t('message.successfullyDeleted'),
                       type: "success"
                   });
                 this.getRole()
@@ -442,7 +442,7 @@ export default {
           res => {
               if (res.code == "ok") {
                 this.$message({
-                      message: '操作成功',
+                      message: this.$t('operationissuccessful'),
                       type: "success"
                   });
                 this.getRole()
@@ -467,7 +467,7 @@ export default {
         },res => {
           if(res.code == 'ok'){
             var a = document.createElement('a');
-            a.download = "权限数据表.xls";
+            a.download = this.$t('quanxianshuju')+ ".xls";
             a.href = res.data;
             a.click();
           }else{