|
@@ -34,27 +34,31 @@
|
|
</el-popover>
|
|
</el-popover>
|
|
<el-input v-model="dataForm.orgName" v-popover:menuListPopover :readonly="true" placeholder="点击选择所属机构" class="menu-list__input"></el-input>
|
|
<el-input v-model="dataForm.orgName" v-popover:menuListPopover :readonly="true" placeholder="点击选择所属机构" class="menu-list__input"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item size="mini" label="授权">
|
|
|
|
- <el-tree
|
|
|
|
- :data="menuList"
|
|
|
|
- :props="menuListTreeProps"
|
|
|
|
- node-key="menuId"
|
|
|
|
- ref="menuListTree"
|
|
|
|
- :default-expand-all="true"
|
|
|
|
- show-checkbox>
|
|
|
|
- </el-tree>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item size="mini" label="数据权限">
|
|
|
|
- <el-tree
|
|
|
|
- :data="orgList"
|
|
|
|
- :props="orgListTreeProps"
|
|
|
|
- node-key="orgId"
|
|
|
|
- ref="orgListDatta"
|
|
|
|
- :default-expand-all="true"
|
|
|
|
- :highlight-current="true"
|
|
|
|
- show-checkbox>
|
|
|
|
- </el-tree>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <div class="myitem">
|
|
|
|
+ <el-form-item size="mini" label="授权">
|
|
|
|
+ <el-tree
|
|
|
|
+ :data="menuList"
|
|
|
|
+ :props="menuListTreeProps"
|
|
|
|
+ node-key="menuId"
|
|
|
|
+ ref="menuListTree"
|
|
|
|
+ :default-expand-all="true"
|
|
|
|
+ show-checkbox>
|
|
|
|
+ </el-tree>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="myitem">
|
|
|
|
+ <el-form-item size="mini" label="数据权限">
|
|
|
|
+ <el-tree
|
|
|
|
+ :data="orgList"
|
|
|
|
+ :props="orgListTreeProps"
|
|
|
|
+ node-key="orgId"
|
|
|
|
+ ref="orgListDatta"
|
|
|
|
+ :default-expand-all="true"
|
|
|
|
+ :highlight-current="true"
|
|
|
|
+ show-checkbox>
|
|
|
|
+ </el-tree>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="visible = false">取消</el-button>
|
|
<el-button @click="visible = false">取消</el-button>
|
|
@@ -138,12 +142,26 @@
|
|
// this.dataForm.isCommon = data.data.isCommon
|
|
// this.dataForm.isCommon = data.data.isCommon
|
|
this.dataForm.orgId = data.data.orgId
|
|
this.dataForm.orgId = data.data.orgId
|
|
this.menuListTreeSetCurrentNode()
|
|
this.menuListTreeSetCurrentNode()
|
|
- var idx = data.data.menuIdList.indexOf(this.tempKey)
|
|
|
|
- if (idx !== -1) {
|
|
|
|
- data.data.menuIdList.splice(idx, data.data.menuIdList.length - idx)
|
|
|
|
|
|
+ // var idx = data.data.menuIdList.indexOf(this.tempKey)
|
|
|
|
+ // if (idx !== -1) {
|
|
|
|
+ // data.data.menuIdList.splice(idx, data.data.menuIdList.length - idx)
|
|
|
|
+ // }
|
|
|
|
+ if (data.data.menuIdList) {
|
|
|
|
+ data.data.menuIdList.forEach(i => {
|
|
|
|
+ const node = this.$refs.menuListTree.getNode(i)
|
|
|
|
+ if (node.isLeaf) {
|
|
|
|
+ this.$refs.menuListTree.setChecked(node, true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (data.data.orgIdList) {
|
|
|
|
+ data.data.orgIdList.forEach(i => {
|
|
|
|
+ const node = this.$refs.orgListDatta.getNode(i)
|
|
|
|
+ if (node.isLeaf) {
|
|
|
|
+ this.$refs.orgListDatta.setChecked(node, true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- this.$refs.menuListTree.setCheckedKeys(data.data.menuIdList)
|
|
|
|
- this.$refs.orgListDatta.setCheckedKeys(data.data.orgIdList)
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -174,8 +192,8 @@
|
|
'remark': this.dataForm.remark,
|
|
'remark': this.dataForm.remark,
|
|
'isCommon': this.dataForm.isCommon,
|
|
'isCommon': this.dataForm.isCommon,
|
|
'orgId': this.dataForm.orgId,
|
|
'orgId': this.dataForm.orgId,
|
|
- 'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys()),
|
|
|
|
- 'orgIdList': [].concat(this.$refs.orgListDatta.getCheckedKeys())
|
|
|
|
|
|
+ 'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), this.$refs.menuListTree.getHalfCheckedKeys()),
|
|
|
|
+ 'orgIdList': [].concat(this.$refs.orgListDatta.getCheckedKeys(), this.$refs.orgListDatta.getHalfCheckedKeys())
|
|
})
|
|
})
|
|
}).then(({data}) => {
|
|
}).then(({data}) => {
|
|
if (data && data.code === '200') {
|
|
if (data && data.code === '200') {
|
|
@@ -198,3 +216,12 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.myitem{
|
|
|
|
+ width: 49%;
|
|
|
|
+ overflow: auto;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ vertical-align: top;
|
|
|
|
+}
|
|
|
|
+</style>
|