-
+
+
+
+
+
+
+
+
+ {{node.label}}
+
+
+
+
+
+
@@ -79,7 +105,18 @@
roleUpdate: {
visible: false,
roleId: '',
- }
+ },
+ isOlderVersion: true,
+ userLoading: false,
+ treeProps: {
+ label: 'name',
+ isLeaf: 'leaf'
+ },
+ multiple:true,
+ addressType: 'user',
+ highSecurityFilter: 'sysAdmin,auditor' ,// 例如值为sysAdmin,auditor,则开启三员之后该地址簿不显示系统管理员和安全审计员
+ pid: '',
+
}
},
methods: {
@@ -99,6 +136,7 @@
const data = ro.data;
that.form.roleOpts = data.roleOpts;
that.form.userOpts = data.userOpts;
+ that.isOlderVersion = data.isOlderVersion;
} else {
that.$message.error(ro.msg);
}
@@ -115,6 +153,9 @@
that.form.roleId = '';
that.form.roleOpts = [];
that.buttonDisabled = false;
+ if (!that.isOlderVersion){
+ this.$refs.tree.setCheckedNodes([]);
+ }
},
handleClose(done) {
this.closeDlalog('cancel');
@@ -129,6 +170,12 @@
closeDlalog(type) {// 取消/确定之后的关闭
const that = this;
if (type == 'save') {
+ if (!that.isOlderVersion){
+ let nodes = this.$refs.tree.getCheckedNodes();
+ nodes.forEach((item)=>{
+ that.form.userArr.push(item.id);
+ })
+ }
if (that.form.userArr.length == 0) {
that.$message.error('请选择[成员]');
return;
@@ -168,8 +215,11 @@
message: ro.msg,
type: 'warning'
});
+ that.$emit('cancel');
+ that.dialogVisible = false;
+ // 清空所有数据
+ that.clearAllData();
}
-
}).catch(error=>{
console.log(error);
that.loading = false;
@@ -191,7 +241,78 @@
if (result == 'ok') {
this.initData();
}
- }
+ },
+ openNode(obj, node, tree) {// 打开一只模型文件
+
+ },
+ expandNode(obj, node, tree) {// 展开节点
+
+ },
+ closeNode(obj, node, tree) {// 关闭时清空,下次展开重新请求动态加载
+ node.childNodes = [];
+ node.loaded = false;
+ },
+ loadNode(node, resolve) {// `动态`加载
+ const that = this;
+ that.userLoading = true;
+ const data = {
+ url:'jd',
+ data:{
+ cmd: 'com.actionsoft.apps.coe.pal_bpm_org_address_component_subjson',
+ addressType: that.addressType,
+ pid: '',
+ highSecurityFilter: that.highSecurityFilter
+ }
+ };
+ if (node.level === 0) {
+ // 获取根目录
+ data.data.pid = that.pid;
+ data.data.parentType = '';
+ } else {
+ // 获取其他目录
+ data.data.pid = node.data.id;
+ data.data.parentType = node.data.type;
+ }
+ // 查询数据
+ awsuiAxios.post(data).then(function (ro) {
+ // 设置是否可选中
+ if (that.multiple) {// 多选
+ const isDept = that.addressType.indexOf('department') > -1;
+ const isUser = that.addressType.indexOf('user') > -1;
+ const isRole = that.addressType.indexOf('role') > -1;
+ const isPosition = that.addressType.indexOf('position') > -1;
+ for (let i = 0; i < ro.data.length; i++) {
+ const curr = ro.data[i];
+ if (curr.type == 'company' || curr.type == 'roleRoot' || curr.type == 'roleGroup' || curr.type == 'positionRoot' || curr.type == 'positionGroup') {
+ curr.disabled = true;
+ } else {
+ if (isDept && curr.type == 'department') curr.disabled = false;
+ if (!isDept && curr.type == 'department') curr.disabled = true;
+ if (isUser && curr.type == 'user') curr.disabled = false;
+ if (!isUser && curr.type == 'user') curr.disabled = true;
+ if (isRole && curr.type == 'role') curr.disabled = false;
+ if (!isRole && curr.type == 'role') curr.disabled = true;
+ if (isPosition && curr.type == 'position') curr.disabled = false;
+ if (!isPosition && curr.type == 'position') curr.disabled = true;
+ }
+ }
+ }
+ resolve(ro.data);
+ that.userLoading = false;
+ if (node.level == 0 && ro.data.length > 0) {
+ const tree = that.$refs.tree;
+ tree.getNode(ro.data[0].id).expand();
+ setTimeout(function(){
+ const childNode = tree.getNode(ro.data[0].id).childNodes[0];
+ if (childNode != null) {
+ childNode.expand();
+ }
+ }, 500);
+ }
+ }).catch(error=>{
+ console.log(error);
+ })
+ },
},
watch: {
visible(val) {