|
|
@@ -10,7 +10,9 @@
|
|
|
<el-breadcrumb-item :to="{ path: '/system/userrole' }">角色管理</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
<span style="float: right;">
|
|
|
- <el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;" @click="opendialog(null)">添加</el-button>
|
|
|
+ <el-button size="mini" type="primary" v-if="adminpermission == 1" style="margin-left:10px; margin-top: -4px;"
|
|
|
+ @click="opendialog(null)">添加
|
|
|
+ </el-button>
|
|
|
</span>
|
|
|
<el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
|
|
|
<el-form-item label="角色名">
|
|
|
@@ -27,23 +29,30 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-table :data="list" tooltip-effect="dark" border>
|
|
|
- <el-table-column label="操作" width="140px" align="center">
|
|
|
+ <el-table :data="list" size="mini" tooltip-effect="dark" border>
|
|
|
+ <el-table-column label="操作" min-width="150px" align="center" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="small" @click="opendialog(scope.row)" type="text" icon="el-icon-edit" title="编辑"></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除" @click="deleteroledata(scope.row)"></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="用户列表" @click="showUserList(scope.row)"><i
|
|
|
+ <el-button size="small" @click="opendialog(scope.row)" v-if="adminpermission == 1" type="text"
|
|
|
+ icon="el-icon-edit" title="编辑">
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" type="text" v-if="adminpermission == 1" style="margin-left:6px"
|
|
|
+ icon="el-icon-delete" title="删除" @click="deleteroledata(scope.row)"></el-button>
|
|
|
+ <el-button size="small" type="text" style="margin-left:6px" title="用户列表" @click="showUserList(scope.row)"><i
|
|
|
class="icon icon-user"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="菜单权限" @click="setpower(scope.row)"><i
|
|
|
- class="icon icon-file-text"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="操作权限" @click="getItemPower(scope.row)"><i
|
|
|
- class="icon icon-lock"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="容器权限" @click="setequipmentpower(scope.row)"
|
|
|
- v-if="appclient != 'lims'"><i class="icon icon-cog"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="资源权限-部门" @click="departmentMessageViewSet(scope.row)"
|
|
|
- v-if="appclient == 'lims'"><i class="icon icon-cog"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" title="资源权限-区域" @click="districtMessageViewSet(scope.row)"
|
|
|
- v-if="appclient == 'lims'"><i class="icon icon-file-text"></i></el-button>
|
|
|
+ <el-button size="small" type="text" v-if="adminpermission == 1" style="margin-left:6px" title="菜单权限"
|
|
|
+ @click="setpower(scope.row)"><i class="icon icon-file-text"></i></el-button>
|
|
|
+ <el-button size="small" type="text" v-if="adminpermission == 1" style="margin-left:6px" title="操作权限"
|
|
|
+ @click="getItemPower(scope.row)"><i class="icon icon-lock"></i></el-button>
|
|
|
+ <el-button size="small" type="text" style="margin-left:6px" title="角色" @click="setRoleManage(scope.row.Id)"
|
|
|
+ v-if="appclient == 'gfgl'&&adminpermission == 1"><i class="icon icon-cog"></i></el-button>
|
|
|
+ <!-- <el-button size="small" type="text" style="margin-left:3px" title="容器权限" @click="setequipmentpower(scope.row)"
|
|
|
+ v-if="appclient != 'lims'"><i class="icon icon-cog"></i></el-button> -->
|
|
|
+ <el-button size="small" type="text" style="margin-left:6px" title="资源权限-部门"
|
|
|
+ @click="departmentMessageViewSet(scope.row)" v-if="appclient == 'lims'"><i class="icon icon-cog"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" type="text" style="margin-left:6px" title="资源权限-区域"
|
|
|
+ @click="districtMessageViewSet(scope.row)" v-if="appclient == 'lims'"><i class="icon icon-file-text"></i>
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="Realname" align="center" label="角色名" show-overflow-tooltip></el-table-column>
|
|
|
@@ -55,7 +64,8 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="currentItemCount">
|
|
|
</el-pagination>
|
|
|
</el-card>
|
|
|
<!-- 添加角色 -->
|
|
|
@@ -75,17 +85,22 @@
|
|
|
</el-dialog>
|
|
|
<!-- 用户列表 -->
|
|
|
<el-dialog title="包含用户列表" :visible.sync="userDialogVisible">
|
|
|
- <el-button type="primary" size="mini" style="float: right; margin-top: -10px;margin-left :5px" @click="deleteuserdataall()">删除所有关联用户</el-button>
|
|
|
- <el-button type="primary" size="mini" style="float: right; margin-top: -10px" @click="roleadduser()">添加</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="float: right; margin-top: -10px;margin-left :5px"
|
|
|
+ @click="deleteuserdata()">删除</el-button>
|
|
|
+ <el-button type="primary" size="mini" style="float: right; margin-top: -10px" @click="roleadduseradmin()">添加
|
|
|
+ </el-button>
|
|
|
<br />
|
|
|
- <el-table :data="userList" border>
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
+ <el-table :data="userList" @selection-change="handleUserSelecChange" border>
|
|
|
+ <!-- <el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除" @click="deleteuserdata(scope.row)"></el-button>
|
|
|
+ <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除"
|
|
|
+ @click="deleteuserdata(scope.row)"></el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column prop="Username" align="center" label="账号" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="Realname" align="center" label="用户名"></el-table-column>
|
|
|
+ <el-table-column prop="Unit" align="center" label="单位名称"></el-table-column>
|
|
|
<el-table-column prop="Departmentname" align="center" label="所属组织"></el-table-column>
|
|
|
<el-table-column prop="Telephone" align="center" label="手机" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column label="座机" align="center" prop="Mobile" show-overflow-tooltip></el-table-column>
|
|
|
@@ -93,22 +108,64 @@
|
|
|
show-overflow-tooltip></el-table-column> -->
|
|
|
</el-table>
|
|
|
|
|
|
- <el-pagination @size-change="handleUserSizeChange" @current-change="handleUserCurrentChange" :current-page="currentUserPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentUserItemCount">
|
|
|
+ <el-pagination @size-change="handleUserSizeChange" @current-change="handleUserCurrentChange"
|
|
|
+ :current-page="currentUserPage" :page-sizes="[10, 15, 20, 25]" :page-size="size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="currentUserItemCount">
|
|
|
</el-pagination>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="userDialogVisible = false">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 超级添加用户 -->
|
|
|
+ <el-dialog title="添加用户" :visible.sync="adminadduser" top="5vh" width="900px">
|
|
|
+ <el-form label-width="110px" style="text-align:right">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-card style="width: 100%;height: calc(100vh - 283px);margin-top:0px">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>请选择部门</span>
|
|
|
+ </div>
|
|
|
+ <el-tree :data="orgtreelist" :props="orgtreeprops" @node-click="handleNodeClick"></el-tree>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-card style="width: 100%;height: calc(100vh - 283px);margin-top:0px">
|
|
|
+ <el-table :data="userOptions" style="width: 100%;" height="calc(100vh - 353px)" ref="multipleTable"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
+ <el-table-column prop="Realname" label="可选用户">
|
|
|
+ <!-- <template slot="header">
|
|
|
+ <el-button type="primary" style="float: right;" size="small" @click="toggleSelection">
|
|
|
+ 选择用户 <el-icon class="el-icon-d-arrow-right"></el-icon>
|
|
|
+ </el-button>
|
|
|
+ </template> -->
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination small @size-change="handleSetRoleChange" @current-change="handleSetRoleCurrentChange"
|
|
|
+ :current-page="currentSetRolePage" :page-sizes="[10, 15, 20, 25]" :page-size="setrolesize"
|
|
|
+ layout="total, sizes, prev, pager, next" :total="currentSetRoleItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <span style="margin-top:10px;">
|
|
|
+ <el-button size="small" @click="adminadduser = false">取 消</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="toggleSelection()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
<!-- 添加用户 -->
|
|
|
<el-dialog title="添加用户" :visible.sync="addUserShow" width="360px">
|
|
|
<el-form label-width="90px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="用户">
|
|
|
- <el-select ref="selectOfficer" multiple filterable default-first-option v-model="OfficerList" placeholder="请选择"
|
|
|
- style="width: 100%">
|
|
|
+ <el-select ref="selectOfficer" multiple filterable default-first-option v-model="OfficerList"
|
|
|
+ placeholder="请选择" style="width: 100%">
|
|
|
<el-option v-for="item in selectuserlist" :key="item.Id" :label="item.Realname" :value="item.Id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
@@ -124,7 +181,8 @@
|
|
|
</el-dialog>
|
|
|
<!-- 菜单权限 -->
|
|
|
<el-dialog :title="powerdialogtitle" :visible.sync="powerdialogVisible">
|
|
|
- <el-tree style="border: 0" show-checkbox node-key="id" :data="modulepowerdata" :props="modulepowerProps" ref="modulepowertree">
|
|
|
+ <el-tree style="border: 0" show-checkbox node-key="id" :data="modulepowerdata" :props="modulepowerProps"
|
|
|
+ ref="modulepowertree">
|
|
|
</el-tree>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="powerdialogVisible = false">取 消</el-button>
|
|
|
@@ -132,8 +190,9 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 容器权限 -->
|
|
|
- <el-dialog title="容器权限" :visible.sync="powerequipmentdialogVisible">
|
|
|
- <el-checkbox :indeterminate="isequpicheckall" v-model="equipCheckAll" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
+ <!-- <el-dialog title="容器权限" :visible.sync="powerequipmentdialogVisible">
|
|
|
+ <el-checkbox :indeterminate="isequpicheckall" v-model="equipCheckAll" @change="handleCheckAllChange">全选
|
|
|
+ </el-checkbox>
|
|
|
<div style="margin-top:10px;" class="rowequippower">
|
|
|
<el-checkbox-group v-model="selectedequip">
|
|
|
<el-checkbox v-for="item in equipalllist" :key="item.Id" @change="handlecheckedequpichange" :label="item.Id"
|
|
|
@@ -144,10 +203,11 @@
|
|
|
<el-button @click="powerequipmentdialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="saveequiptmentpower()">确 定</el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog> -->
|
|
|
<!-- 操作权限 -->
|
|
|
<el-dialog title="操作权限" :visible.sync="operationPowerDialogVisible">
|
|
|
- <el-tree style="border: 0" show-checkbox node-key="id" :data="operationPowerData" :props="modulepowerProps" ref="operationPowerTree">
|
|
|
+ <el-tree style="border: 0" show-checkbox node-key="id" :data="operationPowerData" :props="modulepowerProps"
|
|
|
+ ref="operationPowerTree">
|
|
|
</el-tree>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="operationPowerDialogVisible = false">取 消</el-button>
|
|
|
@@ -156,7 +216,8 @@
|
|
|
</el-dialog>
|
|
|
<!-- 资源权限 -->
|
|
|
<el-dialog title="资源权限(部门信息)" :visible.sync="messageviewVisible">
|
|
|
- <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
|
|
|
+ <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps"
|
|
|
+ ref="operationOriganizeTree">
|
|
|
</el-tree>
|
|
|
<div slot="footer">
|
|
|
<el-button @click="messageviewVisible = false">取消</el-button>
|
|
|
@@ -165,13 +226,29 @@
|
|
|
</el-dialog>
|
|
|
<!-- 资源权限 -->
|
|
|
<el-dialog title="资源权限(区域信息)" :visible.sync="districtVisible">
|
|
|
- <el-tree style="border: 0" show-checkbox node-key="id" :data="operationdistrictData" :props="districtProps" ref="operationdistrictTree">
|
|
|
+ <el-tree style="border: 0" show-checkbox node-key="id" :data="operationdistrictData" :props="districtProps"
|
|
|
+ ref="operationdistrictTree">
|
|
|
</el-tree>
|
|
|
<div slot="footer">
|
|
|
<el-button @click="districtVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click="savedistrictPower()">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 设置角色管理角色 -->
|
|
|
+ <el-dialog title="管理角色" :visible.sync="rolesetVisible">
|
|
|
+ <el-checkbox :indeterminate="isrolecheckall" v-model="roleCheckAll" @change="handleCheckAllRole">全选
|
|
|
+ </el-checkbox>
|
|
|
+ <div style="margin-top:20px;">
|
|
|
+ <el-checkbox-group v-model="selectedrole">
|
|
|
+ <el-checkbox v-for="role in setrolelist" @change="handlecheckedrolechange" :label="role.Id" :value="role.Id"
|
|
|
+ :key="role.Id">{{role.Realname}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="rolesetVisible = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="managerolesave()">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 给操作权限添加角色 -->
|
|
|
<!-- <el-dialog title="给操作权限选择角色" :visible.sync="addRoleOpsDialogVisible">
|
|
|
@@ -199,7 +276,31 @@
|
|
|
}),
|
|
|
data() {
|
|
|
return {
|
|
|
+ //超级管理员添加用户
|
|
|
+ adminadduser: false,
|
|
|
+ orgtreelist: [],
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'Fullname',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ userOptions: [],
|
|
|
+ userselectOptions: [],
|
|
|
+ selectedOptions: {},
|
|
|
+ AuditorForm: {
|
|
|
+ UserId: ''
|
|
|
+ },
|
|
|
+ //是否有超级管理员权限
|
|
|
+ adminpermission: 0,
|
|
|
+ //角色管理角色
|
|
|
+ rolesetVisible: false,
|
|
|
+ roleCheckAll: false,
|
|
|
+ isrolecheckall: false,
|
|
|
+ selectedrole: [],
|
|
|
+ rolelistcheckall: [],
|
|
|
+ mustrolelist: [],
|
|
|
//添加用户
|
|
|
+ selectuser: [],
|
|
|
addUserShow: false,
|
|
|
partuserlist: [],
|
|
|
OfficerList: [],
|
|
|
@@ -212,13 +313,17 @@
|
|
|
currentPage: 1,
|
|
|
size: 10,
|
|
|
list: [],
|
|
|
-
|
|
|
+ setrolelist:[],
|
|
|
+ rolelist: [],
|
|
|
+ currentSetRoleItemCount: 0,
|
|
|
+ currentSetRolePage: 1,
|
|
|
+ setrolesize: 10,
|
|
|
+ setroledepid:'',
|
|
|
currentUserItemCount: 0,
|
|
|
currentUserPage: 1,
|
|
|
userSize: 10,
|
|
|
userList: [],
|
|
|
selectRoleId: '',
|
|
|
-
|
|
|
formLabelWidth: '120px',
|
|
|
dialogtitle: '', // 添加编辑对话框
|
|
|
dialogVisible: false,
|
|
|
@@ -269,7 +374,10 @@
|
|
|
this.appclient = process.env.appclient
|
|
|
// initial data
|
|
|
this.initData()
|
|
|
- this.getallequipmentlist()
|
|
|
+ //this.getallequipmentlist()
|
|
|
+ this.getallrolelist()
|
|
|
+ this.getadminpermission()
|
|
|
+ this.getroleData()
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
|
|
@@ -296,13 +404,53 @@
|
|
|
_this.exportloading = false
|
|
|
})
|
|
|
},
|
|
|
+ getroleData() {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ this.$axios.get('role/list', {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ _this.setrolelist = res.data.items
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getadminpermission() {
|
|
|
+ this.$axios.get('role/getAdminPermi', {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ this.adminpermission = res.data.code
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getallrolelist() {
|
|
|
+ this.$axios.get('role/alllist', {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ this.rolelist = res.data.items
|
|
|
+ let roleItemCount = res.data.currentItemCount
|
|
|
+ for (var i = 0; i < roleItemCount; i++) {
|
|
|
+ this.rolelistcheckall.push(this.rolelist[i].Id)
|
|
|
+ }
|
|
|
+ this.exportloading = false
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ this.exportloading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
getpartuserlist() {
|
|
|
let _this = this
|
|
|
- this.$axios.get('users/list', {})
|
|
|
+ this.$axios.get('users/parlist', {})
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.partuserlist = res.data.items
|
|
|
- console.log(this.partuserlist, '====')
|
|
|
this.userlistfilter()
|
|
|
})
|
|
|
.catch(err => {
|
|
|
@@ -310,6 +458,106 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ managerolesave() {
|
|
|
+ let _this = this
|
|
|
+ // for (let mdx in this.mustrolelist) {
|
|
|
+ // console.log(this.mustrolelist)
|
|
|
+ // if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
|
|
|
+ // this.selectedrole.push(parseInt(this.mustrolelist[mdx]))
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ let rolestring = this.selectedrole.join(',')
|
|
|
+ let roleidsstring = rolestring.toString()
|
|
|
+
|
|
|
+ // request
|
|
|
+ this.$axios.put('role/setmanrole/' + this.selectedroleid + '_' + roleidsstring, {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ // 更新界面
|
|
|
+ this.getRoleManage(this.selectedroleid)
|
|
|
+ this.rolesetVisible = false
|
|
|
+
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getorgtreelist() {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ IsInnerOrganize: 1,
|
|
|
+ }
|
|
|
+ _this.$axios.get('role/orgalllist', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleNodeClick(data) {
|
|
|
+ this.setroledepid = data.id
|
|
|
+ this.currentSetRolePage = 1
|
|
|
+ this.getauditerbydept(data.id)
|
|
|
+ },
|
|
|
+ getauditerbydept (deptid) {
|
|
|
+ this.userOptions = []
|
|
|
+ const params = {
|
|
|
+ _currentPage: this.currentSetRolePage,
|
|
|
+ _size: this.setrolesize
|
|
|
+ }
|
|
|
+ this.$axios.get('role/getauditerbydept/' + deptid, {params}).then(res => {
|
|
|
+ console.log(res, 'res')
|
|
|
+ this.userOptions = res.data.items
|
|
|
+ this.currentSetRoleItemCount = res.data.currentItemCount
|
|
|
+ //this.adminuserlistfilter()
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ adminuserlistfilter() {
|
|
|
+ try {
|
|
|
+ let entityArray = this.userOptions
|
|
|
+ let arr = this.partuserlist
|
|
|
+ let seluserOptions = []
|
|
|
+ if (entityArray == null) {
|
|
|
+ seluserOptions = arr
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for (var i = 0; i < entityArray.length; i++) {
|
|
|
+ for (var j = 0; j < arr.length; j++) {
|
|
|
+ if (entityArray[i].Id === arr[j].Id) {
|
|
|
+ seluserOptions.push(arr[j])
|
|
|
+ arr.splice(j, 1)
|
|
|
+ j--
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.seluserOptions = arr
|
|
|
+ this.userOptions = this.seluserOptions
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ roleadduseradmin() {
|
|
|
+ this.getorgtreelist()
|
|
|
+ this.selectedOptions = []
|
|
|
+ this.adminadduser = true
|
|
|
+ },
|
|
|
roleadduser() {
|
|
|
this.addUserShow = true
|
|
|
this.getpartuserlist()
|
|
|
@@ -338,6 +586,46 @@
|
|
|
console.log(e)
|
|
|
}
|
|
|
},
|
|
|
+ handleUserSelecChange(val) {
|
|
|
+ this.selectuser = val
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.selectedOptions = val
|
|
|
+ },
|
|
|
+ toggleSelection() {
|
|
|
+ let _this = this
|
|
|
+ _this.userselectOptions = []
|
|
|
+
|
|
|
+ for (let i = 0; i < this.selectedOptions.length; i++) {
|
|
|
+ this.userselectOptions.push(this.selectedOptions[i].Id)
|
|
|
+ }
|
|
|
+ let useridlist = this.userselectOptions.join(',');
|
|
|
+ let useridliststring = useridlist.toString()
|
|
|
+
|
|
|
+ // request
|
|
|
+ this.$axios.put('role/setuserrole/' + useridliststring + '_' + this.selectRoleId, {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ // 更新界面
|
|
|
+ this.initUserList(this.selectRoleId)
|
|
|
+ this.adminadduser = false
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
adduerinrole() {
|
|
|
let _this = this
|
|
|
//用户姓名
|
|
|
@@ -458,7 +746,6 @@
|
|
|
},
|
|
|
|
|
|
getItemPower(val) {
|
|
|
- console.log(val)
|
|
|
let _this = this
|
|
|
_this.operationid = val.Id
|
|
|
_this.$axios.get('role/getItemPower?id=' + _this.operationid, null)
|
|
|
@@ -502,13 +789,28 @@
|
|
|
|
|
|
deleteuserdata(val) {
|
|
|
let _this = this
|
|
|
- console.log("---this.selectRoleId----", this.selectRoleId)
|
|
|
+ let userselect = []
|
|
|
+
|
|
|
+ if (_this.selectuser) {
|
|
|
+ for (let i = 0; i < _this.selectuser.length; i++) {
|
|
|
+ userselect.push(_this.selectuser[i].Id)
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: "请先选择用户!再点击删除"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let useridlist = userselect.join(',');
|
|
|
+ let useridliststring = useridlist.toString()
|
|
|
_this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- _this.$axios.delete('role/deleteuser/' + val.Id + '_' + this.selectRoleId, null)
|
|
|
+ _this.$axios.delete('role/deleteuser/' + useridliststring + '_' + this.selectRoleId, null)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -531,7 +833,7 @@
|
|
|
|
|
|
deleteuserdataall() {
|
|
|
let _this = this
|
|
|
- _this.$confirm('此操作将永久删除所有数据, 是否继续?', '提示', {
|
|
|
+ _this.$confirm('此操作将永久删除数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
@@ -735,7 +1037,7 @@
|
|
|
// response
|
|
|
_this.operationdistrictData = window.toolfun_gettreejson(res.data.District, 'id', 'pId',
|
|
|
'id,name,scope')
|
|
|
- let selectmodels = []
|
|
|
+ let selectmodels = []
|
|
|
if (res.data.SelectedDistrict) {
|
|
|
for (var i = 0; i < res.data.SelectedDistrict.length; i++) {
|
|
|
let isParent = false
|
|
|
@@ -837,6 +1139,54 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ setRoleManage(val) {
|
|
|
+ this.getRoleManage(val)
|
|
|
+ this.rolesetVisible = true
|
|
|
+ },
|
|
|
+ getRoleManage(val) {
|
|
|
+ this.selectedroleid = val
|
|
|
+ this.selectedrole = []
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ this.$axios.get('role/getmanagerole/' + this.selectedroleid, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.mustrolelist = []
|
|
|
+ // response
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ if (_this.roleisexist(parseInt(res.data[i]))) {
|
|
|
+ _this.selectedrole.push(parseInt(res.data[i]))
|
|
|
+ }
|
|
|
+ let flag = false
|
|
|
+ let rdx = 0
|
|
|
+ for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
|
|
|
+ if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!flag) {
|
|
|
+ _this.mustrolelist.push(parseInt(res.data[i]))
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ let checkedCount = this.selectedrole.length
|
|
|
+ this.roleCheckAll = checkedCount === this.rolelist.length
|
|
|
+ this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ roleisexist(val) {
|
|
|
+ for (let i = 0; i < this.rolelist.length; i++) {
|
|
|
+ if (this.rolelist[i].Id === val) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
setequipmentpower(val) {
|
|
|
let _this = this
|
|
|
_this.operationid = val.Id
|
|
|
@@ -963,6 +1313,15 @@
|
|
|
// this.addRoleOpsDialogVisible = true
|
|
|
// },
|
|
|
|
|
|
+ handlecheckedrolechange() {
|
|
|
+ let checkedCount = this.selectedrole.length
|
|
|
+ this.roleCheckAll = checkedCount === this.rolelist.length
|
|
|
+ this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
|
|
|
+ },
|
|
|
+ handleCheckAllRole(val) {
|
|
|
+ this.selectedrole = val ? this.rolelistcheckall : []
|
|
|
+ this.isrolecheckall = false
|
|
|
+ },
|
|
|
|
|
|
// 全选框控制
|
|
|
handleCheckAllChange(val) {
|
|
|
@@ -988,6 +1347,15 @@
|
|
|
this.currentPage = value
|
|
|
this.initData()
|
|
|
},
|
|
|
+ handleSetRoleChange(value) {
|
|
|
+ this.setrolesize = value
|
|
|
+ this.currentSetRolePage = 1
|
|
|
+ this.getauditerbydept(this.setroledepid)
|
|
|
+ },
|
|
|
+ handleSetRoleCurrentChange(value) {
|
|
|
+ this.currentSetRolePage = value
|
|
|
+ this.getauditerbydept(this.setroledepid)
|
|
|
+ },
|
|
|
|
|
|
handleUserSizeChange(value) {
|
|
|
this.userSize = value
|