|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
-<div>
|
|
|
- <el-card class="box-card" style="height: calc(100vh - 92px);">
|
|
|
+ <div>
|
|
|
+ <el-card class="box-card" style="height: calc(100vh - 92px);">
|
|
|
<div slot="header" style="height: 20px;">
|
|
|
<span style="float: left;">
|
|
|
<i class="icon icon-table2"></i>
|
|
|
@@ -27,35 +27,35 @@
|
|
|
</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" tooltip-effect="dark" border>
|
|
|
+ <el-table-column label="操作" width="140px" align="center">
|
|
|
<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 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" @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
|
|
|
+ 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>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="Realname" align="center" label="角色名" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="Description" align="center" label="角色描述" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="创建日期" align="center" show-overflow-tooltip>
|
|
|
+ <el-table-column prop="Realname" align="center" label="角色名" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Description" align="center" label="角色描述" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="创建日期" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ jstimehandle(scope.row.CreateOn+'') }}
|
|
|
</template>
|
|
|
</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">
|
|
|
+ <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">
|
|
|
</el-pagination>
|
|
|
</el-card>
|
|
|
<!-- 添加角色 -->
|
|
|
@@ -76,8 +76,8 @@
|
|
|
<!-- 用户列表 -->
|
|
|
<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>
|
|
|
- <br />
|
|
|
+ <el-button type="primary" size="mini" style="float: right; margin-top: -10px" @click="roleadduser()">添加</el-button>
|
|
|
+ <br />
|
|
|
<el-table :data="userList" border>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -94,7 +94,7 @@
|
|
|
</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">
|
|
|
+ :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">
|
|
|
@@ -102,7 +102,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 添加用户 -->
|
|
|
- <el-dialog title="添加用户" :visible.sync="addUserShow" width="360px">
|
|
|
+ <el-dialog title="添加用户" :visible.sync="addUserShow" width="360px">
|
|
|
<el-form label-width="90px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
@@ -124,10 +124,7 @@
|
|
|
</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>
|
|
|
@@ -139,7 +136,8 @@
|
|
|
<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" :value="item.Id"> {{item.Name}}</el-checkbox>
|
|
|
+ <el-checkbox v-for="item in equipalllist" :key="item.Id" @change="handlecheckedequpichange" :label="item.Id"
|
|
|
+ :value="item.Id"> {{item.Name}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -149,40 +147,25 @@
|
|
|
</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>
|
|
|
<el-button type="primary" @click="saveOperatinonPower()">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <!-- 资源权限 -->
|
|
|
- <el-dialog title="资源权限(部门信息)" :visible.sync="messageviewVisible">
|
|
|
- <!-- <el-checkbox :indeterminate="isdepartmentcheckall" v-model="departmentCheckAll" @change="handleCheckAlldepartment">全选</el-checkbox>
|
|
|
- <div style="margin-top:20px;">
|
|
|
- <el-checkbox-group v-model="selecteddepartment">
|
|
|
- <el-checkbox v-for="department in departmentlist" @change="handlecheckeddepartmentchange" :label="department.Id" :value="department.Id" :key="department">{{department.name}}</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
- </div> -->
|
|
|
- <el-tree style="border: 0" show-checkbox node-key="id"
|
|
|
- :data="operationOrganizeData"
|
|
|
- :props="organizeProps"
|
|
|
- ref="operationOriganizeTree">
|
|
|
+ <!-- 资源权限 -->
|
|
|
+ <el-dialog title="资源权限(部门信息)" :visible.sync="messageviewVisible">
|
|
|
+ <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>
|
|
|
<el-button type="primary" @click="savemessageviewPower()">确定</el-button>
|
|
|
</div>
|
|
|
</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-dialog title="资源权限(区域信息)" :visible.sync="districtVisible">
|
|
|
+ <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>
|
|
|
@@ -206,7 +189,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { mapGetters } from 'vuex'
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
export default {
|
|
|
name: 'userrole',
|
|
|
computed: mapGetters({
|
|
|
@@ -215,10 +200,10 @@
|
|
|
data() {
|
|
|
return {
|
|
|
//添加用户
|
|
|
- addUserShow:false,
|
|
|
- partuserlist:[],
|
|
|
- OfficerList:[],
|
|
|
- selectuserlist:[],
|
|
|
+ addUserShow: false,
|
|
|
+ partuserlist: [],
|
|
|
+ OfficerList: [],
|
|
|
+ selectuserlist: [],
|
|
|
exportloading: true,
|
|
|
searchform: {
|
|
|
name: ''
|
|
|
@@ -247,12 +232,12 @@
|
|
|
powerdialogVisible: false,
|
|
|
powerequipmentdialogVisible: false, // 容器权限
|
|
|
operationPowerDialogVisible: false, // 操作权限
|
|
|
- messageviewVisible:false, //信息查看权限
|
|
|
- districtVisible:false, //区域信息查看权限
|
|
|
+ messageviewVisible: false, //信息查看权限
|
|
|
+ districtVisible: false, //区域信息查看权限
|
|
|
addRoleOpsDialogVisible: false, // 给操作添加角色
|
|
|
ismessageviewcheckall: false,
|
|
|
operationOrganizeData: [],
|
|
|
- operationdistrictData:[],
|
|
|
+ operationdistrictData: [],
|
|
|
modulepowerdata: [], // 菜单树
|
|
|
operationPowerData: [], // 操作树
|
|
|
modulepowerProps: {
|
|
|
@@ -280,38 +265,44 @@
|
|
|
appclient: ''
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.appclient = process.env.appclient
|
|
|
// initial data
|
|
|
this.initData()
|
|
|
this.getallequipmentlist()
|
|
|
},
|
|
|
methods: {
|
|
|
- initData () {
|
|
|
+ initData() {
|
|
|
let _this = this
|
|
|
// paginate
|
|
|
- const params = { _currentPage: this.currentPage, _size: this.size, keyword: this.searchform.name }
|
|
|
+ const params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ keyword: this.searchform.name
|
|
|
+ }
|
|
|
// request
|
|
|
- this.$axios.get('role/list', { params })
|
|
|
+ this.$axios.get('role/list', {
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.list = res.data.items
|
|
|
_this.currentItemCount = res.data.currentItemCount
|
|
|
- _this.exportloading=false
|
|
|
+ _this.exportloading = false
|
|
|
})
|
|
|
.catch(err => {
|
|
|
// handle error
|
|
|
console.error(err)
|
|
|
- _this.exportloading=false
|
|
|
+ _this.exportloading = false
|
|
|
})
|
|
|
},
|
|
|
- getpartuserlist() {
|
|
|
- let _this =this
|
|
|
+ getpartuserlist() {
|
|
|
+ let _this = this
|
|
|
this.$axios.get('users/list', {})
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.partuserlist = res.data.items
|
|
|
- console.log(this.partuserlist ,'====')
|
|
|
+ console.log(this.partuserlist, '====')
|
|
|
this.userlistfilter()
|
|
|
})
|
|
|
.catch(err => {
|
|
|
@@ -319,12 +310,12 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- roleadduser(){
|
|
|
+ roleadduser() {
|
|
|
this.addUserShow = true
|
|
|
this.getpartuserlist()
|
|
|
- this.OfficerList = ''
|
|
|
+ this.OfficerList = []
|
|
|
},
|
|
|
- userlistfilter(){
|
|
|
+ userlistfilter() {
|
|
|
try {
|
|
|
let entityArray = this.userList
|
|
|
let arr = this.partuserlist
|
|
|
@@ -343,11 +334,11 @@
|
|
|
}
|
|
|
}
|
|
|
this.selectuserlist = arr
|
|
|
- } catch (e) {
|
|
|
+ } catch (e) {
|
|
|
console.log(e)
|
|
|
}
|
|
|
},
|
|
|
- adduerinrole(){
|
|
|
+ adduerinrole() {
|
|
|
let _this = this
|
|
|
//用户姓名
|
|
|
let tempOfficers = [];
|
|
|
@@ -396,9 +387,9 @@
|
|
|
_size: this.userSize
|
|
|
}
|
|
|
// request
|
|
|
- this.$axios.get('role/getusersforrole/'+rid, {
|
|
|
- params
|
|
|
- })
|
|
|
+ this.$axios.get('role/getusersforrole/' + rid, {
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.userList = res.data.items
|
|
|
@@ -409,7 +400,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- jstimehandle (val) {
|
|
|
+ jstimehandle(val) {
|
|
|
val = val.replace('T', ' ')
|
|
|
return val.substring(0, 10)
|
|
|
},
|
|
|
@@ -446,16 +437,16 @@
|
|
|
for (var i = 0; i < res.data.Selectemodule.length; i++) {
|
|
|
let isParent = false
|
|
|
for (let j = 0; j < res.data.Selectemodule.length; j++) {
|
|
|
- if(res.data.Selectemodule[i].id === res.data.Selectemodule[j].pId){
|
|
|
+ if (res.data.Selectemodule[i].id === res.data.Selectemodule[j].pId) {
|
|
|
//是父节点
|
|
|
isParent = true
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(isParent) {//不去勾选父节点
|
|
|
- continue
|
|
|
+ if (isParent) { //不去勾选父节点
|
|
|
+ continue
|
|
|
}
|
|
|
- //选中
|
|
|
+ //选中
|
|
|
selectmodels.push(res.data.Selectemodule[i].id)
|
|
|
}
|
|
|
}
|
|
|
@@ -472,7 +463,6 @@
|
|
|
_this.operationid = val.Id
|
|
|
_this.$axios.get('role/getItemPower?id=' + _this.operationid, null)
|
|
|
.then(res => {
|
|
|
- console.log(res.data)
|
|
|
// response
|
|
|
_this.operationPowerData = window.toolfun_gettreejson(res.data.Operation, 'id', 'pId', 'id,name,scope')
|
|
|
let selectmodels = []
|
|
|
@@ -487,38 +477,38 @@
|
|
|
this.powerdialogtitle = '用户(' + val.Realname + ')-操作权限设置'
|
|
|
this.operationPowerDialogVisible = true
|
|
|
},
|
|
|
- departmentmessageview(val) {
|
|
|
- console.log(val)
|
|
|
- let _this = this
|
|
|
- _this.operationid = val.Id
|
|
|
- _this.$axios.get('role/getItemPower?id=' + _this.operationid, null)
|
|
|
- .then(res => {
|
|
|
- console.log(res.data)
|
|
|
- // response
|
|
|
- _this.operationPowerData = window.toolfun_gettreejson(res.data.Operation, 'id', 'pId', 'id,name,scope')
|
|
|
- let selectmodels = []
|
|
|
- if (res.data.Selecteoperation) {
|
|
|
- for (var i = 0; i < res.data.Selecteoperation.length; i++) {
|
|
|
- selectmodels.push(res.data.Selecteoperation[i].id)
|
|
|
- }
|
|
|
- }
|
|
|
- _this.$refs.operationPowerTree.setCheckedKeys(selectmodels)
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
- this.powerdialogtitle = '用户(' + val.Realname + ')-操作权限设置'
|
|
|
- this.messageviewVisible = true
|
|
|
- },
|
|
|
+ // departmentmessageview(val) {
|
|
|
+ // console.log(val)
|
|
|
+ // let _this = this
|
|
|
+ // _this.operationid = val.Id
|
|
|
+ // _this.$axios.get('role/getItemPower?id=' + _this.operationid, null)
|
|
|
+ // .then(res => {
|
|
|
+ // console.log(res.data)
|
|
|
+ // // response
|
|
|
+ // _this.operationPowerData = window.toolfun_gettreejson(res.data.Operation, 'id', 'pId', 'id,name,scope')
|
|
|
+ // let selectmodels = []
|
|
|
+ // if (res.data.Selecteoperation) {
|
|
|
+ // for (var i = 0; i < res.data.Selecteoperation.length; i++) {
|
|
|
+ // selectmodels.push(res.data.Selecteoperation[i].id)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // _this.$refs.operationPowerTree.setCheckedKeys(selectmodels)
|
|
|
+ // })
|
|
|
+ // .catch(() => {})
|
|
|
+ // this.powerdialogtitle = '用户(' + val.Realname + ')-操作权限设置'
|
|
|
+ // this.messageviewVisible = true
|
|
|
+ // },
|
|
|
|
|
|
|
|
|
- deleteuserdata (val) {
|
|
|
+ deleteuserdata(val) {
|
|
|
let _this = this
|
|
|
- console.log("---this.selectRoleId----",this.selectRoleId)
|
|
|
+ console.log("---this.selectRoleId----", this.selectRoleId)
|
|
|
_this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- _this.$axios.delete('role/deleteuser/'+val.Id+ '_' +this.selectRoleId, null)
|
|
|
+ _this.$axios.delete('role/deleteuser/' + val.Id + '_' + this.selectRoleId, null)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -538,15 +528,15 @@
|
|
|
.catch(() => {})
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
-
|
|
|
- deleteuserdataall () {
|
|
|
+
|
|
|
+ deleteuserdataall() {
|
|
|
let _this = this
|
|
|
_this.$confirm('此操作将永久删除所有数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- _this.$axios.delete('role/deletealluser/'+this.selectRoleId + '', null)
|
|
|
+ _this.$axios.delete('role/deletealluser/' + this.selectRoleId + '', null)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -566,14 +556,14 @@
|
|
|
.catch(() => {})
|
|
|
}).catch(() => {})
|
|
|
},
|
|
|
- deleteroledata (val) {
|
|
|
+ deleteroledata(val) {
|
|
|
let _this = this
|
|
|
_this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- _this.$axios.delete('role/deleterole/'+val.Id + '', null)
|
|
|
+ _this.$axios.delete('role/deleterole/' + val.Id + '', null)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -603,7 +593,7 @@
|
|
|
}
|
|
|
let _this = this
|
|
|
if (this.dialogtitle === '添加角色') {
|
|
|
- _this.$axios.post('role/',_this.roleform)
|
|
|
+ _this.$axios.post('role/', _this.roleform)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -625,7 +615,7 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
} else {
|
|
|
- _this.$axios.put('role/'+_this.roleform.roleid + '', _this.roleform)
|
|
|
+ _this.$axios.put('role/' + _this.roleform.roleid + '', _this.roleform)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -711,20 +701,29 @@
|
|
|
// request
|
|
|
this.$axios.get('role/getdepartment?id=' + this.selectedroleid, {})
|
|
|
.then(res => {
|
|
|
- // response
|
|
|
+ // response
|
|
|
_this.operationOrganizeData = window.toolfun_gettreejson(res.data.Organize, 'id', 'pId', 'id,name,scope')
|
|
|
let selectmodels = []
|
|
|
- if (res.data.SelecteOrganize) {
|
|
|
- for (var i = 0; i < res.data.SelecteOrganize.length; i++) {
|
|
|
- selectmodels.push(res.data.SelecteOrganize[i].id)
|
|
|
+ if (res.data.SelectedOrganize) {
|
|
|
+ for (var i = 0; i < res.data.SelectedOrganize.length; i++) {
|
|
|
+ let isParent = false
|
|
|
+ for (let j = 0; j < res.data.SelectedOrganize.length; j++) {
|
|
|
+ if (res.data.SelectedOrganize[i].id === res.data.SelectedOrganize[j].pId) {
|
|
|
+ //是父节点
|
|
|
+ isParent = true
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isParent) { //不去勾选父节点
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ //选中
|
|
|
+ selectmodels.push(res.data.SelectedOrganize[i].id)
|
|
|
}
|
|
|
}
|
|
|
- _this.$refs.operationOriganizeTree.setCheckedKeys(selectmodels)
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
+ _this.$refs.operationOriganizeTree.setCheckedKeys(selectmodels, true)
|
|
|
})
|
|
|
+ .catch(() => {})
|
|
|
},
|
|
|
districtMessageViewSet(val) {
|
|
|
this.districtVisible = true
|
|
|
@@ -733,15 +732,28 @@
|
|
|
// request
|
|
|
this.$axios.get('role/getdistrict?id=' + this.selectedroleid, {})
|
|
|
.then(res => {
|
|
|
- // response
|
|
|
- _this.operationdistrictData = window.toolfun_gettreejson(res.data.District, 'id', 'pId', 'id,name,scope')
|
|
|
- let selectmodels = []
|
|
|
+ // response
|
|
|
+ _this.operationdistrictData = window.toolfun_gettreejson(res.data.District, 'id', 'pId',
|
|
|
+ 'id,name,scope')
|
|
|
+ let selectmodels = []
|
|
|
if (res.data.SelectedDistrict) {
|
|
|
for (var i = 0; i < res.data.SelectedDistrict.length; i++) {
|
|
|
+ let isParent = false
|
|
|
+ for (let j = 0; j < res.data.SelectedDistrict.length; j++) {
|
|
|
+ if (res.data.SelectedDistrict[i].id === res.data.SelectedDistrict[j].pId) {
|
|
|
+ //是父节点
|
|
|
+ isParent = true
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isParent) { //不去勾选父节点
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ //选中
|
|
|
selectmodels.push(res.data.SelectedDistrict[i].id)
|
|
|
}
|
|
|
}
|
|
|
- _this.$refs.operationdistrictTree.setCheckedKeys(selectmodels)
|
|
|
+ _this.$refs.operationdistrictTree.setCheckedKeys(selectmodels, true)
|
|
|
})
|
|
|
.catch(err => {
|
|
|
// handle error
|
|
|
@@ -967,22 +979,22 @@
|
|
|
this.equipCheckAll = checkedCount === this.equipalllist.length
|
|
|
this.isequpicheckall = checkedCount > 0 && checkedCount < this.equipalllist.length
|
|
|
},
|
|
|
- handleSizeChange (value) {
|
|
|
+ handleSizeChange(value) {
|
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
|
this.initData()
|
|
|
},
|
|
|
- handleCurrentChange (value) {
|
|
|
- this.currentPage = value
|
|
|
- this.initData()
|
|
|
+ handleCurrentChange(value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initData()
|
|
|
},
|
|
|
|
|
|
- handleUserSizeChange (value) {
|
|
|
+ handleUserSizeChange(value) {
|
|
|
this.userSize = value
|
|
|
this.currentUserPage = 1
|
|
|
this.initUserList(this.selectRoleId)
|
|
|
},
|
|
|
- handleUserCurrentChange (value) {
|
|
|
+ handleUserCurrentChange(value) {
|
|
|
this.currentUserPage = value
|
|
|
this.initUserList(this.selectRoleId)
|
|
|
},
|
|
|
@@ -1008,19 +1020,23 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- .el-pagination {
|
|
|
- margin: 1rem 0 2rem;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
- .plab {
|
|
|
- font-size: 13px;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
- .rowequippower .el-checkbox{
|
|
|
+ .el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .plab {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rowequippower .el-checkbox {
|
|
|
margin-left: 1px;
|
|
|
padding: 5px 10px 0 0;
|
|
|
}
|
|
|
+
|
|
|
</style>
|