|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
- <div class="pageBody">
|
|
|
- <div class="topPart">
|
|
|
+ <div class="account-edit">
|
|
|
+ <div class="account-edit-header">
|
|
|
<div class="title">
|
|
|
<div class="tltleLeft">编辑账号</div>
|
|
|
<!-- <div class="isUsed">
|
|
@@ -18,44 +18,63 @@
|
|
|
</div> -->
|
|
|
<div>
|
|
|
<!-- <button type="submmit" class="delBtn" @click="delate">删除</button> -->
|
|
|
- <button type="submmit" class="saveBtn" @click="editAcc">保存</button>
|
|
|
+ <button
|
|
|
+ type="submmit"
|
|
|
+ class="saveBtn"
|
|
|
+ @click="editAcc"
|
|
|
+ >保存</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="titleContent">
|
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
|
|
+ <el-form
|
|
|
+ ref="form"
|
|
|
+ :model="form"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
<el-row :gutter="40">
|
|
|
<el-col :span="5">
|
|
|
- <el-form-item label="账号名称" prop="name">
|
|
|
+ <el-form-item
|
|
|
+ label="账号名称"
|
|
|
+ prop="name"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="form.name"
|
|
|
maxlength="32"
|
|
|
placeholder="请输入名称"
|
|
|
size="small"
|
|
|
- ></el-input>
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="5">
|
|
|
- <el-form-item label="登录密码" prop="passward">
|
|
|
+ <el-form-item
|
|
|
+ label="登录密码"
|
|
|
+ prop="passward"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="form.passward"
|
|
|
placeholder="*******"
|
|
|
size="small"
|
|
|
- ></el-input>
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
- <el-button class="resetPass" size="small" @click="rest"
|
|
|
- >重置密码</el-button
|
|
|
- >
|
|
|
+ <el-button
|
|
|
+ class="resetPass"
|
|
|
+ size="small"
|
|
|
+ @click="rest"
|
|
|
+ >重置密码</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="描述" prop="diesc">
|
|
|
+ <el-form-item
|
|
|
+ label="描述"
|
|
|
+ prop="diesc"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="form.diesc"
|
|
|
maxlength="128"
|
|
|
placeholder="描述内容描述内容描述内容描述内容描述内容描述内容"
|
|
|
size="small"
|
|
|
- ></el-input>
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -66,155 +85,164 @@
|
|
|
<div class="content">
|
|
|
<!-- 用户组和角色未开启 -->
|
|
|
<el-row
|
|
|
- :gutter="24"
|
|
|
v-if="
|
|
|
- this.systemSetuser.OpenRole === 0 &&
|
|
|
- this.systemSetuser.OpenGroup === 0
|
|
|
+ systemSetuser.OpenRole === 0
|
|
|
+ && systemSetuser.OpenGroup === 0
|
|
|
"
|
|
|
+ :gutter="24"
|
|
|
>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <Permissiontree
|
|
|
- @getTreeData="getTreeDatas"
|
|
|
- :checkedKeys="powerT"
|
|
|
- :queryType="group"
|
|
|
- :queryId="objID"
|
|
|
+ <PermissionTree
|
|
|
title="权限树"
|
|
|
+ :checked-keys="powerT"
|
|
|
+ :query-type="group"
|
|
|
+ :query-id="objID"
|
|
|
+ @get-tree-data="getTreeDatas"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <Rulesofcompetency @getData="getData" title="权限规则" />
|
|
|
+ <RulesOfCompetency
|
|
|
+ title="权限规则"
|
|
|
+ @get-data="getData"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <loginpolicy
|
|
|
- @getCheckedList="getCheckedList"
|
|
|
- :checkedList="loginList"
|
|
|
- ></loginpolicy>
|
|
|
+ <LoginPolicy
|
|
|
+ :checked-list="loginList"
|
|
|
+ @get-checked-list="getCheckedList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- 角色和用户组都开启 -->
|
|
|
<el-row
|
|
|
- :gutter="24"
|
|
|
v-if="
|
|
|
- this.systemSetuser.OpenRole != 0 && this.systemSetuser.OpenGroup != 0
|
|
|
+ systemSetuser.OpenRole !== 0
|
|
|
+ && systemSetuser.OpenGroup !== 0
|
|
|
"
|
|
|
+ :gutter="24"
|
|
|
>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
<Organization
|
|
|
title="所属账号组"
|
|
|
:data="data"
|
|
|
- :defaultProps="defaultProps"
|
|
|
+ :default-props="defaultProps"
|
|
|
:nodekey="'GroupId'"
|
|
|
- @getCheckedData="getTreeData"
|
|
|
- :checkedIdList="checkedIdList"
|
|
|
+ :checked-id-list="checkedIdList"
|
|
|
+ @get-checked-data="getTreeData"
|
|
|
@click="getId(arrs)"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <rolelists
|
|
|
+ <RoleLists
|
|
|
title="角色列表"
|
|
|
- @checkClick="roleClick"
|
|
|
- @checkChange="checkChange"
|
|
|
- :dataList="roleList"
|
|
|
- :checkBoxList="checkRole"
|
|
|
+ :data-list="roleList"
|
|
|
+ :check-box-list="checkRole"
|
|
|
:number="8"
|
|
|
+ @check-click="roleClick"
|
|
|
+ @check-change="checkChange"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part2">
|
|
|
- <permissionlist
|
|
|
+ <PermissioLlist
|
|
|
title="权限列表"
|
|
|
- :RoleList="powerList"
|
|
|
- :check="true"
|
|
|
class="hucPower"
|
|
|
+ :role-list="powerList"
|
|
|
+ :check="true"
|
|
|
@Competen="Competen"
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="part3">
|
|
|
- <loginpolicy
|
|
|
- @getCheckedList="getCheckedList"
|
|
|
- :checkedList="loginList"
|
|
|
- ></loginpolicy>
|
|
|
+ <LoginPolicy
|
|
|
+ :checked-list="loginList"
|
|
|
+ @get-checked-list="getCheckedList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- 只开启用户组 -->
|
|
|
<el-row
|
|
|
- :gutter="24"
|
|
|
v-if="
|
|
|
- this.systemSetuser.OpenGroup != 0 && this.systemSetuser.OpenRole === 0
|
|
|
+ systemSetuser.OpenGroup !== 0
|
|
|
+ && systemSetuser.OpenRole === 0
|
|
|
"
|
|
|
+ :gutter="24"
|
|
|
>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
<Organization
|
|
|
title="所属账号组"
|
|
|
:data="data"
|
|
|
- :defaultProps="defaultProps"
|
|
|
+ :default-props="defaultProps"
|
|
|
:nodekey="'GroupId'"
|
|
|
- @getCheckedData="getTreeData"
|
|
|
- :checkedIdList="checkedIdList"
|
|
|
+ :checked-id-list="checkedIdList"
|
|
|
+ @get-checked-data="getTreeData"
|
|
|
@click="getId(arrs)"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <Permissiontree
|
|
|
- @getTreeData="getTreeDatas"
|
|
|
- :checkedKeys="powerT"
|
|
|
- :queryType="group"
|
|
|
- :queryId="objID"
|
|
|
+ <PermissionTree
|
|
|
+ :checked-keys="powerT"
|
|
|
+ :query-type="group"
|
|
|
+ :query-id="objID"
|
|
|
title="权限树"
|
|
|
+ @get-tree-data="getTreeDatas"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part2">
|
|
|
- <Rulesofcompetency @getData="getData" title="权限规则" />
|
|
|
+ <RulesOfCompetency
|
|
|
+ title="权限规则"
|
|
|
+ @get-data="getData"
|
|
|
+ />
|
|
|
</div>
|
|
|
|
|
|
<div class="part3">
|
|
|
- <loginpolicy
|
|
|
- @getCheckedList="getCheckedList"
|
|
|
- :checkedList="loginList"
|
|
|
- ></loginpolicy>
|
|
|
+ <LoginPolicy
|
|
|
+ :checked-list="loginList"
|
|
|
+ @get-checked-list="getCheckedList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- 只开启角色 -->
|
|
|
<el-row
|
|
|
- :gutter="24"
|
|
|
v-if="
|
|
|
- this.systemSetuser.OpenGroup === 0 && this.systemSetuser.OpenRole != 0
|
|
|
+ systemSetuser.OpenGroup === 0
|
|
|
+ && systemSetuser.OpenRole != 0
|
|
|
"
|
|
|
+ :gutter="24"
|
|
|
>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <rolelists
|
|
|
+ <RoleLists
|
|
|
title="角色列表"
|
|
|
- @checkChange="checkChange"
|
|
|
- @checkClick="roleClick"
|
|
|
- :dataList="roleList"
|
|
|
- :checkBoxList="checkRole"
|
|
|
+ :data-list="roleList"
|
|
|
+ :check-box-list="checkRole"
|
|
|
:number="8"
|
|
|
+ @check-change="checkChange"
|
|
|
+ @check-click="roleClick"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <permissionlist
|
|
|
+ <PermissioLlist
|
|
|
title="权限列表"
|
|
|
- :RoleList="powerList"
|
|
|
+ :role-list="powerList"
|
|
|
:check="true"
|
|
|
class="hucPower"
|
|
|
@Competen="Competen"
|
|
@@ -223,10 +251,10 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <loginpolicy
|
|
|
- @getCheckedList="getCheckedList"
|
|
|
- :checkedList="loginList"
|
|
|
- ></loginpolicy>
|
|
|
+ <LoginPolicy
|
|
|
+ :checked-list="loginList"
|
|
|
+ @get-checked-list="getCheckedList"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -236,7 +264,11 @@
|
|
|
<div class="title">删除账号</div>
|
|
|
<div class="content">是否确定要删除该账号?</div>
|
|
|
<div class="foot right t30">
|
|
|
- <el-button size="medium" type="danger" class="r24">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="medium"
|
|
|
+ type="danger"
|
|
|
+ class="r24"
|
|
|
+ >删除</el-button>
|
|
|
<el-button size="medium">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -245,282 +277,271 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Organization from "@/components/usergrouptree/index.vue";
|
|
|
-import Permissiontree from "@/components/permissiontree/index.vue";
|
|
|
-import Rulesofcompetency from "@/components/rulesofcompetency/index.vue";
|
|
|
-import loginpolicy from "@/components/loginpolicy/index.vue";
|
|
|
-import rolelists from "@/components/rolelist/index.vue";
|
|
|
-import permissionlist from "@/components/permissionlist/index.vue";
|
|
|
-import Dialog from "@/layout/components/Dialog";
|
|
|
-import { QueryRole, RoleAuths } from "@/api/apiAuthority";
|
|
|
-import { getUserOne } from "@/api/AccountGroup.js";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
+import Organization from '@/components/usergrouptree/index.vue'
|
|
|
+import PermissionTree from '@/components/permissiontree/index.vue'
|
|
|
+import RulesOfCompetency from '@/components/rulesofcompetency/index.vue'
|
|
|
+import LoginPolicy from '@/components/loginpolicy/index.vue'
|
|
|
+import RoleLists from '@/components/rolelist/index.vue'
|
|
|
+import PermissioLlist from '@/components/permissionlist/index.vue'
|
|
|
+import Dialog from '@/layout/components/Dialog'
|
|
|
+import {
|
|
|
+ // QueryRole,
|
|
|
+ RoleAuths
|
|
|
+} from '@/api/apiAuthority'
|
|
|
+// import { getUserOne } from '@/api/AccountGroup.js'
|
|
|
+// import { mapGetters } from 'vuex'
|
|
|
// import Cookies from "js-cookie";
|
|
|
-import { accDeaitls, deitAcc, GetRoleByGroup } from "@/api/Account.js";
|
|
|
+import { accDeaitls, deitAcc, GetRoleByGroup } from '@/api/Account.js'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ Organization,
|
|
|
+ PermissionTree,
|
|
|
+ RulesOfCompetency,
|
|
|
+ LoginPolicy,
|
|
|
+ RoleLists,
|
|
|
+ PermissioLlist,
|
|
|
+ Dialog
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- group: "group",
|
|
|
+ group: 'group',
|
|
|
userId: this.$route.query.userid,
|
|
|
GroupId: this.$route.query.GroupId,
|
|
|
dialogVisible: false,
|
|
|
OpenRole: this.OpenRole,
|
|
|
OpenGroup: this.OpenGroup,
|
|
|
- marginB: "20px",
|
|
|
+ marginB: '20px',
|
|
|
PageIndex: 1,
|
|
|
PageSize: 12,
|
|
|
PwdLengthBegin: null,
|
|
|
PwdLengthEnd: null,
|
|
|
PwdStruc: null,
|
|
|
pwd: null,
|
|
|
- data: [], //账号组
|
|
|
- orgId: "",
|
|
|
+ data: [], // 账号组
|
|
|
+ orgId: '',
|
|
|
arrs: [],
|
|
|
- TacList: [], //登录策略
|
|
|
- AuthList: [], //授权信息
|
|
|
- roleList: [], //角色
|
|
|
- checkRoles: [], //选中的角色
|
|
|
- treeData: [], //权限树数据
|
|
|
- powerList: [], //权限列表
|
|
|
+ TacList: [], // 登录策略
|
|
|
+ AuthList: [], // 授权信息
|
|
|
+ roleList: [], // 角色
|
|
|
+ checkRoles: [], // 选中的角色
|
|
|
+ treeData: [], // 权限树数据
|
|
|
+ powerList: [], // 权限列表
|
|
|
checkedIdList: [],
|
|
|
- loginList: [], //选中展示登录策略
|
|
|
+ loginList: [], // 选中展示登录策略
|
|
|
checkRole: [],
|
|
|
CheckedList: [],
|
|
|
rulesObj: [],
|
|
|
powerT: [],
|
|
|
- objID: "1",
|
|
|
+ objID: '1',
|
|
|
rules: {
|
|
|
UserName: [
|
|
|
- { required: true, message: "请输入账号名称", trigger: "blur" },
|
|
|
- { min: 1, max: 32, message: "长度在 1到 32 个字符", trigger: "blur" },
|
|
|
+ { required: true, message: '请输入账号名称', trigger: 'blur' },
|
|
|
+ { min: 1, max: 32, message: '长度在 1到 32 个字符', trigger: 'blur' }
|
|
|
],
|
|
|
UserPwd: [
|
|
|
- { required: true, message: "请输入账号密码", trigger: "blur" },
|
|
|
- { min: 8, message: "长度最少8个字符", trigger: "blur" },
|
|
|
- ],
|
|
|
- UserDesc: [
|
|
|
- { min: 1, max: 128, message: "长度最多12个字符", trigger: "blur" },
|
|
|
+ { required: true, message: '请输入账号密码', trigger: 'blur' },
|
|
|
+ { min: 8, message: '长度最少8个字符', trigger: 'blur' }
|
|
|
],
|
|
|
+ UserDesc: [{ min: 1, max: 128, message: '长度最多12个字符', trigger: 'blur' }]
|
|
|
},
|
|
|
form: {
|
|
|
name: null,
|
|
|
passward: null,
|
|
|
- diesc: null,
|
|
|
+ diesc: null
|
|
|
// isUsed: true,
|
|
|
},
|
|
|
defaultProps: {
|
|
|
- children: "children",
|
|
|
- label: "GroupName",
|
|
|
+ children: 'children',
|
|
|
+ label: 'GroupName'
|
|
|
},
|
|
|
systemSetuser: null,
|
|
|
treeData1: [],
|
|
|
- checkedAuthList: [],
|
|
|
- };
|
|
|
- },
|
|
|
- components: {
|
|
|
- Organization,
|
|
|
- Permissiontree,
|
|
|
- Rulesofcompetency,
|
|
|
- loginpolicy,
|
|
|
- rolelists,
|
|
|
- permissionlist,
|
|
|
- Dialog,
|
|
|
+ checkedAuthList: []
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
created() {
|
|
|
- let obj;
|
|
|
- if (typeof this.$store.state.app.systemSet == "string") {
|
|
|
- obj = JSON.parse(this.$store.state.app.systemSet);
|
|
|
+ let obj
|
|
|
+ if (typeof this.$store.state.app.systemSet === 'string') {
|
|
|
+ obj = JSON.parse(this.$store.state.app.systemSet)
|
|
|
} else {
|
|
|
- obj = this.$store.state.app.systemSet;
|
|
|
+ obj = this.$store.state.app.systemSet
|
|
|
}
|
|
|
- const { OpenRole, OpenGroup, PwdStruc, PwdLengthBegin, PwdLengthEnd } = obj;
|
|
|
- this.openRole = OpenRole;
|
|
|
- this.OpenGroup = OpenGroup;
|
|
|
- this.PwdStruc = PwdStruc;
|
|
|
- this.PwdLengthBegin = PwdLengthBegin;
|
|
|
- this.PwdLengthEnd = PwdLengthEnd;
|
|
|
- this.editAccInfo();
|
|
|
- const { GroupId } = this.$route.query;
|
|
|
- this.AppId = GroupId;
|
|
|
- this.systemSetuser = obj;
|
|
|
+ const { OpenRole, OpenGroup, PwdStruc, PwdLengthBegin, PwdLengthEnd } = obj
|
|
|
+ this.openRole = OpenRole
|
|
|
+ this.OpenGroup = OpenGroup
|
|
|
+ this.PwdStruc = PwdStruc
|
|
|
+ this.PwdLengthBegin = PwdLengthBegin
|
|
|
+ this.PwdLengthEnd = PwdLengthEnd
|
|
|
+ this.editAccInfo()
|
|
|
+ const { GroupId } = this.$route.query
|
|
|
+ this.AppId = GroupId
|
|
|
+ this.systemSetuser = obj
|
|
|
if (OpenRole) {
|
|
|
- this.title = "角色";
|
|
|
+ this.title = '角色'
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.form.UserPwd = this.generatePassword(
|
|
|
- this.PwdStruc,
|
|
|
- this.PwdLengthBegin,
|
|
|
- this.PwdLengthEnd
|
|
|
- );
|
|
|
+ this.form.UserPwd = this.generatePassword(this.PwdStruc, this.PwdLengthBegin, this.PwdLengthEnd)
|
|
|
},
|
|
|
methods: {
|
|
|
// delate: function (index) {
|
|
|
// this.dialogVisible = true;
|
|
|
// },
|
|
|
getCheckedList(data) {
|
|
|
- this.CheckedList = data;
|
|
|
+ this.CheckedList = data
|
|
|
},
|
|
|
|
|
|
- //获取权限树回调
|
|
|
+ // 获取权限树回调
|
|
|
getTreeDatas(arr) {
|
|
|
- this.checkedAuthList = arr;
|
|
|
+ this.checkedAuthList = arr
|
|
|
},
|
|
|
rest() {
|
|
|
- this.form.passward = this.generatePassword(
|
|
|
- this.PwdStruc,
|
|
|
- this.PwdLengthBegin,
|
|
|
- this.PwdLengthEnd
|
|
|
- );
|
|
|
+ this.form.passward = this.generatePassword(this.PwdStruc, this.PwdLengthBegin, this.PwdLengthEnd)
|
|
|
},
|
|
|
- //获取权限规则
|
|
|
+ // 获取权限规则
|
|
|
getData(obj) {
|
|
|
- this.rulesObj = obj;
|
|
|
+ this.rulesObj = obj
|
|
|
},
|
|
|
generatePassword(rules, minNum, maxNum) {
|
|
|
- var rulesArr = rules.split("");
|
|
|
- var rulesArrLnArr = [];
|
|
|
- var pwd = "";
|
|
|
- var numbers = "0123456789";
|
|
|
- var lower = "abcdefghijklmnopqrstuvwxyz";
|
|
|
- var upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
- var others = "~!@#$%^&*()_";
|
|
|
+ var rulesArr = rules.split('')
|
|
|
+ var rulesArrLnArr = []
|
|
|
+ var pwd = ''
|
|
|
+ var numbers = '0123456789'
|
|
|
+ var lower = 'abcdefghijklmnopqrstuvwxyz'
|
|
|
+ var upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
|
+ var others = '~!@#$%^&*()_'
|
|
|
|
|
|
function rand(min, max) {
|
|
|
- return Math.random() * (max - min) + min;
|
|
|
+ return Math.random() * (max - min) + min
|
|
|
}
|
|
|
- var pwdLen = parseInt(rand(minNum, maxNum)); //随机生成密码长度10-12位。 // alert("密码长度:" + pwdLen);
|
|
|
- var item = new Array(pwdLen); //存放密码的类型 数字(1),小写(2),大写(3),特殊字符(4)
|
|
|
+ var pwdLen = parseInt(rand(minNum, maxNum)) // 随机生成密码长度10-12位。 // alert("密码长度:" + pwdLen);
|
|
|
+ var item = new Array(pwdLen) // 存放密码的类型 数字(1),小写(2),大写(3),特殊字符(4)
|
|
|
for (let i = 0; i < rulesArr.length; i++) {
|
|
|
- if (rulesArr[i] == "1") {
|
|
|
- rulesArrLnArr.push(i + 1 + "");
|
|
|
+ if (rulesArr[i] === '1') {
|
|
|
+ rulesArrLnArr.push(i + 1 + '')
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i < rulesArrLnArr.length; i++) {
|
|
|
- item[rulesArrLnArr[i]] = rulesArrLnArr[i] + "";
|
|
|
+ item[rulesArrLnArr[i]] = rulesArrLnArr[i] + ''
|
|
|
}
|
|
|
for (let i = 0; i < pwdLen; i++) {
|
|
|
- if (rulesArrLnArr.indexOf(i + "") == -1) {
|
|
|
- item[i] = "";
|
|
|
- item[i] +=
|
|
|
- rulesArrLnArr[
|
|
|
- parseInt(Math.random() * (rulesArrLnArr.length - 0) + 0)
|
|
|
- ]; //其余部分随机生成1-4的数字。
|
|
|
+ if (rulesArrLnArr.indexOf(i + '') === -1) {
|
|
|
+ item[i] = ''
|
|
|
+ item[i] += rulesArrLnArr[parseInt(Math.random() * (rulesArrLnArr.length - 0) + 0)] // 其余部分随机生成1-4的数字。
|
|
|
}
|
|
|
- } //打乱次序,重新排序,否则密码第四位永远是特殊符号。
|
|
|
- item.sort(function () {
|
|
|
- return 0.5 - Math.random();
|
|
|
- }); //返回0 两个数位置不变;小于0 就交换位置;大于0就不交换位置
|
|
|
+ } // 打乱次序,重新排序,否则密码第四位永远是特殊符号。
|
|
|
+ item.sort(function() {
|
|
|
+ return 0.5 - Math.random()
|
|
|
+ }) // 返回0 两个数位置不变;小于0 就交换位置;大于0就不交换位置
|
|
|
|
|
|
for (let j = 0; j < pwdLen; j++) {
|
|
|
- if (item[j] == "4") {
|
|
|
- pwd += numbers.charAt(Math.random() * (numbers.length - 1) + 1);
|
|
|
- } else if (item[j] == "2") {
|
|
|
- pwd += lower.charAt(Math.random() * (lower.length - 1) + 1);
|
|
|
- } else if (item[j] == "1") {
|
|
|
- pwd += upper.charAt(Math.random() * (upper.length - 1) + 1);
|
|
|
- } else if (item[j] == "3") {
|
|
|
- pwd += others.charAt(Math.random() * (others.length - 1) + 1);
|
|
|
+ if (item[j] === '4') {
|
|
|
+ pwd += numbers.charAt(Math.random() * (numbers.length - 1) + 1)
|
|
|
+ } else if (item[j] === '2') {
|
|
|
+ pwd += lower.charAt(Math.random() * (lower.length - 1) + 1)
|
|
|
+ } else if (item[j] === '1') {
|
|
|
+ pwd += upper.charAt(Math.random() * (upper.length - 1) + 1)
|
|
|
+ } else if (item[j] === '3') {
|
|
|
+ pwd += others.charAt(Math.random() * (others.length - 1) + 1)
|
|
|
}
|
|
|
}
|
|
|
- return pwd;
|
|
|
+ return pwd
|
|
|
},
|
|
|
|
|
|
- //账号组树
|
|
|
+ // 账号组树
|
|
|
getTreeData(arr) {
|
|
|
- this.checkTrees = arr;
|
|
|
- this.checkTrees.forEach((item) => {
|
|
|
- this.orgId = item.GroupId;
|
|
|
+ this.checkTrees = arr
|
|
|
+ this.checkTrees.forEach(item => {
|
|
|
+ this.orgId = item.GroupId
|
|
|
if (item[0]) {
|
|
|
- item.disabled = true;
|
|
|
+ item.disabled = true
|
|
|
}
|
|
|
- });
|
|
|
- this.checkedIdList = arr;
|
|
|
+ })
|
|
|
+ this.checkedIdList = arr
|
|
|
// let objArr = arr[arr.length - 1];
|
|
|
// if (objArr) {
|
|
|
// this.objID = objArr.GroupId + "";
|
|
|
// this.queryRole();
|
|
|
// }
|
|
|
- if (this.checkTrees != "") {
|
|
|
- this.queryRole();
|
|
|
+ if (this.checkTrees !== '') {
|
|
|
+ this.queryRole()
|
|
|
} else {
|
|
|
- this.roleList = [];
|
|
|
+ this.roleList = []
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- //点击角色后
|
|
|
+ // 点击角色后
|
|
|
roleClick(data) {
|
|
|
try {
|
|
|
- let params = {
|
|
|
- RoleId: data.RoleId,
|
|
|
- };
|
|
|
- RoleAuths(params).then((result) => {
|
|
|
- this.powerList = result.returnData;
|
|
|
- });
|
|
|
+ const params = {
|
|
|
+ RoleId: data.RoleId
|
|
|
+ }
|
|
|
+ RoleAuths(params).then(result => {
|
|
|
+ this.powerList = result.returnData
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
- console.log("RoleAuths");
|
|
|
- console.log(error);
|
|
|
+ console.log('RoleAuths')
|
|
|
+ console.log(error)
|
|
|
}
|
|
|
},
|
|
|
Competen(data) {
|
|
|
- this.$emit("Competen", data);
|
|
|
+ this.$emit('Competen', data)
|
|
|
},
|
|
|
|
|
|
- //详情查询
|
|
|
+ // 详情查询
|
|
|
async editAccInfo() {
|
|
|
try {
|
|
|
const res = await accDeaitls({
|
|
|
- UserId: this.userId,
|
|
|
- });
|
|
|
+ UserId: this.userId
|
|
|
+ })
|
|
|
if (res.code === 0) {
|
|
|
- const { UserDesc, UserName, UserPwd } = res.returnData;
|
|
|
- this.form.name = UserName;
|
|
|
- this.form.diesc = UserDesc;
|
|
|
- this.checkedIdList = res.returnData.GroupList;
|
|
|
- this.loginList = res.returnData.TacList;
|
|
|
-
|
|
|
- console.log(this.checkedIdList);
|
|
|
- this.loginList.forEach((item) => {
|
|
|
- if (item.IsSelected == 1) {
|
|
|
- this.CheckedList.push(item);
|
|
|
+ const { UserDesc, UserName, GroupList, UserPwd, TacList, AuthList, RoleList } = res.returnData
|
|
|
+ this.form.name = UserName
|
|
|
+ this.form.diesc = UserDesc
|
|
|
+ this.checkedIdList = GroupList
|
|
|
+ this.loginList = TacList
|
|
|
+ console.log(UserPwd)
|
|
|
+ // console.log(this.checkedIdList)
|
|
|
+ this.loginList.forEach(item => {
|
|
|
+ if (item.IsSelected === 1) {
|
|
|
+ this.CheckedList.push(item)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
|
|
|
- this.$store.state.auth.authList = res.returnData.AuthList;
|
|
|
+ this.$store.state.auth.authList = AuthList
|
|
|
|
|
|
- res.returnData.AuthList.forEach((item) => {
|
|
|
- this.powerT.push(item.AuthId);
|
|
|
- });
|
|
|
- this.roleList = res.returnData.RoleList;
|
|
|
+ AuthList.forEach(item => {
|
|
|
+ this.powerT.push(item.AuthId)
|
|
|
+ })
|
|
|
+ this.roleList = RoleList
|
|
|
this.roleList.forEach((item, index) => {
|
|
|
- if (item.IsSelected == 1) {
|
|
|
- this.checkRole.push(index);
|
|
|
- this.checkRoles.push(item);
|
|
|
+ if (item.IsSelected === 1) {
|
|
|
+ this.checkRole.push(index)
|
|
|
+ this.checkRoles.push(item)
|
|
|
}
|
|
|
- });
|
|
|
- this.queryRole();
|
|
|
+ })
|
|
|
+ this.queryRole()
|
|
|
} else {
|
|
|
- this.$message.error(res.message);
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log("出错了", error);
|
|
|
+ console.log('出错了', error)
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- //账号编辑修改
|
|
|
+ // 账号编辑修改
|
|
|
async editAcc() {
|
|
|
- this.treeData1 = [];
|
|
|
- this.checkedAuthList.forEach((item) => {
|
|
|
- this.treeData1.push(item.AuthList);
|
|
|
- });
|
|
|
+ this.treeData1 = []
|
|
|
+ this.checkedAuthList.forEach(item => {
|
|
|
+ this.treeData1.push(item.AuthList)
|
|
|
+ })
|
|
|
this.treeData1.forEach((item, index) => {
|
|
|
- this.$store.getters.authArrs.forEach((item2) => {
|
|
|
- if (item.AuthId == item2.AuthId) {
|
|
|
- this.treeData1[index] = item2.AuthList;
|
|
|
+ this.$store.getters.authArrs.forEach(item2 => {
|
|
|
+ if (item.AuthId === item2.AuthId) {
|
|
|
+ this.treeData1[index] = item2.AuthList
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
try {
|
|
|
const res = await deitAcc({
|
|
@@ -533,75 +554,76 @@ export default {
|
|
|
UserId: this.userId,
|
|
|
AuthTo: this.treeData1,
|
|
|
GroupList: this.checkedIdList,
|
|
|
- TacList: this.CheckedList ? this.CheckedList : [],
|
|
|
- });
|
|
|
+ TacList: this.CheckedList ? this.CheckedList : []
|
|
|
+ })
|
|
|
if (res.code === 0) {
|
|
|
- this.$message.success(res.message);
|
|
|
+ this.$message.success(res.message)
|
|
|
setTimeout(() => {
|
|
|
- this.$router.push("/account");
|
|
|
- });
|
|
|
+ this.$router.push('/account')
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$message.error(res.message);
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log("出错了", error);
|
|
|
+ console.log('出错了', error)
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- //角色选取
|
|
|
+ // 角色选取
|
|
|
checkChange(arr) {
|
|
|
- const datas = [];
|
|
|
- const arrs = [];
|
|
|
+ const datas = []
|
|
|
+ const arrs = []
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
- datas.push(this.roleList[arr[i]]);
|
|
|
+ datas.push(this.roleList[arr[i]])
|
|
|
}
|
|
|
- datas.forEach((item) => {
|
|
|
+ datas.forEach(item => {
|
|
|
const RoleC = {
|
|
|
IsSelected: 1,
|
|
|
RoleId: item.RoleId,
|
|
|
- RoleName: item.RoleName,
|
|
|
- };
|
|
|
- arrs.push(RoleC);
|
|
|
- });
|
|
|
- this.checkRoles = arrs;
|
|
|
+ RoleName: item.RoleName
|
|
|
+ }
|
|
|
+ arrs.push(RoleC)
|
|
|
+ })
|
|
|
+ this.checkRoles = arrs
|
|
|
},
|
|
|
- //角色列表
|
|
|
+ // 角色列表
|
|
|
async queryRole() {
|
|
|
try {
|
|
|
const res = await GetRoleByGroup({
|
|
|
- GroupId: this.orgId,
|
|
|
- });
|
|
|
+ GroupId: this.orgId
|
|
|
+ })
|
|
|
if (res.code === 0) {
|
|
|
- const arr = res.returnData;
|
|
|
- const userArr = [];
|
|
|
- arr.forEach((item) => {
|
|
|
- item.name = item.RoleName;
|
|
|
+ const arr = res.returnData
|
|
|
+ const userArr = []
|
|
|
+ arr.forEach(item => {
|
|
|
+ item.name = item.RoleName
|
|
|
if (item.IsSelected) {
|
|
|
- userArr.push(item);
|
|
|
+ userArr.push(item)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
|
|
|
- this.roleList = userArr;
|
|
|
+ this.roleList = userArr
|
|
|
} else {
|
|
|
- this.$message.error(res.message);
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log("出错了", error);
|
|
|
+ console.log('出错了', error)
|
|
|
}
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.pageBody {
|
|
|
+.account-edit {
|
|
|
width: 100%;
|
|
|
height: calc(100vh - 178px);
|
|
|
padding: 0 146px;
|
|
|
- .topPart {
|
|
|
+ .account-edit-header {
|
|
|
box-sizing: border-box;
|
|
|
width: 100%;
|
|
|
height: 184px;
|
|
|
+ margin: 32px 0 24px;
|
|
|
padding: 32px;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
|
|
@@ -653,8 +675,7 @@ export default {
|
|
|
}
|
|
|
.content {
|
|
|
width: 100%;
|
|
|
- height: calc(100% - 184px);
|
|
|
- padding-top: 24px;
|
|
|
+ height: calc(100% - 274px);
|
|
|
box-sizing: border-box;
|
|
|
// .el-row {
|
|
|
// height: 100%;
|
|
@@ -662,9 +683,12 @@ export default {
|
|
|
// height: 100%;
|
|
|
// }
|
|
|
// }
|
|
|
+ ::v-deep .el-empty {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
.part {
|
|
|
width: 100%;
|
|
|
- height: 856px;
|
|
|
+ height: 720px;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
|
|
|
border-radius: 16px;
|
|
@@ -679,7 +703,7 @@ export default {
|
|
|
}
|
|
|
.part2 {
|
|
|
width: 100%;
|
|
|
- height: 512px;
|
|
|
+ height: 376px;
|
|
|
background: #ffffff;
|
|
|
box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
|
|
|
border-radius: 16px;
|