|
@@ -90,6 +90,7 @@
|
|
|
this.dataForm.id = id || 0
|
|
|
this.menuList = []
|
|
|
this.orgList = []
|
|
|
+ this.visible = true
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl('/user-service/menu/tree'),
|
|
|
method: 'get',
|
|
@@ -107,6 +108,41 @@
|
|
|
if (data.code === '200') {
|
|
|
this.orgList = data.data
|
|
|
}
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['dataForm'].resetFields()
|
|
|
+ this.$refs.menuListTree.setCheckedKeys([])
|
|
|
+ this.$refs.orgListData.setCheckedKeys([])
|
|
|
+ })
|
|
|
+ }).then(() => {
|
|
|
+ if (this.dataForm.id) {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/user-service/role/info/${this.dataForm.id}`),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams()
|
|
|
+ }).then(({data}) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataForm.roleName = data.data.roleName
|
|
|
+ this.dataForm.remark = data.data.remark
|
|
|
+ this.dataForm.orgId = data.data.orgId
|
|
|
+ if (data.data.menuIdList) {
|
|
|
+ data.data.menuIdList.forEach(i => {
|
|
|
+ const node = this.$refs.menuListTree.getNode(i)
|
|
|
+ if (node && node.isLeaf) {
|
|
|
+ this.$refs.menuListTree.setChecked(node, true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (data.data.orgIdList) {
|
|
|
+ data.data.orgIdList.forEach(i => {
|
|
|
+ const node = this.$refs.orgListData.getNode(i)
|
|
|
+ if (node && node.isLeaf) {
|
|
|
+ this.$refs.orgListData.setChecked(node, true, false)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}).then(() => {
|
|
|
this.visible = true
|
|
@@ -115,36 +151,6 @@
|
|
|
this.$refs.menuListTree.setCheckedKeys([])
|
|
|
this.$refs.orgListData.setCheckedKeys([])
|
|
|
})
|
|
|
- }).then(() => {
|
|
|
- if (this.dataForm.id) {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl(`/user-service/role/info/${this.dataForm.id}`),
|
|
|
- method: 'get',
|
|
|
- params: this.$http.adornParams()
|
|
|
- }).then(({data}) => {
|
|
|
- if (data && data.code === '200') {
|
|
|
- this.dataForm.roleName = data.data.roleName
|
|
|
- this.dataForm.remark = data.data.remark
|
|
|
- this.dataForm.orgId = data.data.orgId
|
|
|
- if (data.data.menuIdList) {
|
|
|
- data.data.menuIdList.forEach(i => {
|
|
|
- const node = this.$refs.menuListTree.getNode(i)
|
|
|
- if (node && node.isLeaf) {
|
|
|
- this.$refs.menuListTree.setChecked(node, true)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (data.data.orgIdList) {
|
|
|
- data.data.orgIdList.forEach(i => {
|
|
|
- const node = this.$refs.orgListData.getNode(i)
|
|
|
- if (node && node.isLeaf) {
|
|
|
- this.$refs.orgListData.setChecked(node, true, false)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
})
|
|
|
},
|
|
|
onChose () {
|