|
@@ -24,8 +24,8 @@
|
|
|
<el-tree
|
|
|
:data="orgList"
|
|
|
:props="orgListTreeProps"
|
|
|
- node-key="menuId"
|
|
|
- ref="menuListTree"
|
|
|
+ node-key="orgId"
|
|
|
+ ref="orgListTree"
|
|
|
@current-change="menuListTreeCurrentChangeHandle"
|
|
|
:default-expand-all="true"
|
|
|
:highlight-current="true"
|
|
@@ -44,6 +44,17 @@
|
|
|
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>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="visible = false">取消</el-button>
|
|
@@ -112,6 +123,7 @@
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs['dataForm'].resetFields()
|
|
|
this.$refs.menuListTree.setCheckedKeys([])
|
|
|
+ this.$refs.orgListDatta.setCheckedKeys([])
|
|
|
})
|
|
|
}).then(() => {
|
|
|
if (this.dataForm.id) {
|
|
@@ -125,11 +137,13 @@
|
|
|
this.dataForm.remark = data.data.remark
|
|
|
// this.dataForm.isCommon = data.data.isCommon
|
|
|
this.dataForm.orgId = data.data.orgId
|
|
|
+ this.menuListTreeSetCurrentNode()
|
|
|
var idx = data.data.menuIdList.indexOf(this.tempKey)
|
|
|
if (idx !== -1) {
|
|
|
data.data.menuIdList.splice(idx, data.data.menuIdList.length - idx)
|
|
|
}
|
|
|
this.$refs.menuListTree.setCheckedKeys(data.data.menuIdList)
|
|
|
+ this.$refs.orgListDatta.setCheckedKeys(data.data.orgIdList)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -139,6 +153,14 @@
|
|
|
this.dataForm.orgId = data.orgId
|
|
|
this.dataForm.orgName = data.name
|
|
|
},
|
|
|
+ menuListTreeSetCurrentNode () {
|
|
|
+ this.$refs.orgListTree.setCurrentKey(this.dataForm.orgId)
|
|
|
+ if (this.dataForm.orgId === '0') {
|
|
|
+ this.dataForm.orgName = ''
|
|
|
+ } else {
|
|
|
+ this.dataForm.orgName = (this.$refs.orgListTree.getCurrentNode() || {})['name']
|
|
|
+ }
|
|
|
+ },
|
|
|
// 表单提交
|
|
|
dataFormSubmit () {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
@@ -152,7 +174,8 @@
|
|
|
'remark': this.dataForm.remark,
|
|
|
'isCommon': this.dataForm.isCommon,
|
|
|
'orgId': this.dataForm.orgId,
|
|
|
- 'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), [this.tempKey], this.$refs.menuListTree.getHalfCheckedKeys())
|
|
|
+ 'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys()),
|
|
|
+ 'orgIdList': [].concat(this.$refs.orgListDatta.getCheckedKeys())
|
|
|
})
|
|
|
}).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|