Ver código fonte

189-ETA系统admin的账号和角色,不允许删除和修改,允许重置密码

hbchen 6 meses atrás
pai
commit
ddc9144ddd

+ 5 - 3
src/views/system_manage/components/addUserDialog.vue

@@ -9,7 +9,8 @@
         <el-form @submit.native.prevent :model="userForm" :rules="userRule" ref="userForm" label-width="160px"
             class="demo-ruleForm" style="marginTop:15px;">
             <el-form-item :label="$t('SystemManage.DepartManage.user_login_accout')" prop="account">
-                <el-input v-model="userForm.account" :placeholder="$t('SystemManage.DepartManage.user_add_placeholder01')" :disabled="userForm.disabledForm" clearable>
+                <el-input v-model="userForm.account" :placeholder="$t('SystemManage.DepartManage.user_add_placeholder01')" 
+                :disabled="userForm.disabledForm || userForm.isAdminEdit" clearable>
                 </el-input>
             </el-form-item>
             <el-form-item :label="$t('SystemManage.DepartManage.user_login_pwd')" prop="pwd" v-if="userForm.title == $t('SystemManage.DepartManage.user_add_btn')">
@@ -17,7 +18,8 @@
                     :type="userForm.title == $t('SystemManage.DepartManage.user_add_btn') ? 'text' : 'password' " clearable></el-input>
             </el-form-item>
             <el-form-item :label="$t('SystemManage.DepartManage.user_table_name')" prop="name">
-                <el-input v-model="userForm.name" :placeholder="$t('SystemManage.DepartManage.user_add_placeholder03')"  clearable>
+                <el-input v-model="userForm.name" :placeholder="$t('SystemManage.DepartManage.user_add_placeholder03')"  clearable
+                :disabled="userForm.isAdminEdit">
                 </el-input>
             </el-form-item>
             <el-form-item :label="$t('SystemManage.DepartManage.user_table_mobile')" prop="mobile" class="mobile-input-item">
@@ -46,7 +48,7 @@
                 <el-input :disabled="hasEmployeeNo" v-model="userForm.employeeNumber" :placeholder="$t('SystemManage.DepartManage.user_add_placeholder07')"></el-input>
             </el-form-item>
             <el-form-item :label="$t('SystemManage.DepartManage.user_role')" prop="role">
-                <el-select v-model="userForm.role" :placeholder="$t('SystemManage.DepartManage.user_role')" :disabled="userForm.disabledForm" @change="roleChange">
+                <el-select v-model="userForm.role" :placeholder="$t('SystemManage.DepartManage.user_role')" :disabled="userForm.disabledForm || userForm.isAdminEdit" @change="roleChange">
                     <el-option v-for="item in roleArr" :key="item.RoleId" :label="item.RoleName" :value="item.RoleId">
                     </el-option>
                 </el-select>

+ 2 - 1
src/views/system_manage/departManage.vue

@@ -124,7 +124,7 @@
 								<span v-permission="permissionBtn.sysDepartPermission.sysDepart_moveGroup"
 									class="editsty" @click.stop="moveDepart(scope.row)">{{$t('SystemManage.DepartManage.user_table_move_group')}}</span>
 								<span v-permission="permissionBtn.sysDepartPermission.sysDepart_enable"
-									class="editsty" 
+									class="editsty" v-if="scope.row.AdminName != 'admin' && scope.row.Enabled==1"
 									@click.stop="handleChangeStatus(scope.row)"
 								>{{scope.row.Enabled===0?$t('SystemManage.DepartManage.user_table_status_open'):$t('SystemManage.DepartManage.user_table_status_ban')}}</span>
 								<!-- <span v-permission="permissionBtn.sysDepartPermission.sysDepart_del"
@@ -1245,6 +1245,7 @@ export default {
 				title:this.$t('SystemManage.DepartManage.user_edit_btn'),
 				admin_id:item.AdminId,
 				account:item.AdminName,
+				isAdminEdit:item.AdminName=="admin",
 				pwd:item.Password,
 				employeeNumber:item.EmployeeId,
 				// oldPwd:item.Password,

+ 1 - 1
src/views/system_manage/roleManage.vue

@@ -42,7 +42,7 @@
 					<template slot-scope="scope"> <span>{{scope.row.RoleType}}</span> </template>
 				</el-table-column>
 				<el-table-column :label="$t('Table.column_operations')" align="center">
-					<template slot-scope="scope">
+					<template slot-scope="scope" v-if="scope.row.RoleName!='admin'">
 						<div style="color:#4099ef; font-size:24px;">
 							<!-- <span v-permission="permissionBtn.sysDepartPermission.sysRole_settingAuth"
 								class="editsty" @click.stop="getAuthDetail(scope.row)" style="marginRight:20px;">查看权限</span> -->