| | |
| | | }); |
| | | }, |
| | | nodeClick(data) { |
| | | console.log(data) |
| | | this.treeDeptId = data.id; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | |
| | | }); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | const prop = this.findObject(this.option.group, 'tenantId'); |
| | | console.log('2',prop) |
| | | row.deptId = row.deptId.join(","); |
| | | row.roleId = row.roleId.join(","); |
| | | row.postId = row.postId.join(","); |
| | | console.log('3',row) |
| | | add(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | row.deptId = row.deptId.join(","); |
| | | row.roleId = row.roleId.join(","); |
| | | row.postId = row.postId.join(","); |
| | | console.log('3',row) |
| | | add(row).then(() => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row.deptId = row.deptId.join(","); |
| | |
| | | }, |
| | | beforeOpen(done, type) { |
| | | console.log(type) |
| | | if (["edit", "view"].includes(type)) { |
| | | getUser(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | if (this.form.hasOwnProperty("deptId")) { |
| | | this.form.deptId = this.form.deptId.split(","); |
| | | } |
| | | if (this.form.hasOwnProperty("roleId")) { |
| | | this.form.roleId = this.form.roleId.split(","); |
| | | } |
| | | if (this.form.hasOwnProperty("postId")) { |
| | | this.form.postId = this.form.postId.split(","); |
| | | } |
| | | }); |
| | | if(this.treeDeptId){ |
| | | if (["edit", "view"].includes(type)) { |
| | | getUser(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | if (this.form.hasOwnProperty("deptId")) { |
| | | this.form.deptId = this.form.deptId.split(","); |
| | | } |
| | | if (this.form.hasOwnProperty("roleId")) { |
| | | this.form.roleId = this.form.roleId.split(","); |
| | | } |
| | | if (this.form.hasOwnProperty("postId")) { |
| | | this.form.postId = this.form.postId.split(","); |
| | | } |
| | | }); |
| | | } |
| | | const prop = this.findObject(this.option.group, 'tenantId'); |
| | | console.log('1',prop) |
| | | this.initFlag = true; |
| | | done(); |
| | | }else { |
| | | this.$message.warning('请选择一条所属租户') |
| | | } |
| | | const prop = this.findObject(this.option.group, 'tenantId'); |
| | | console.log('1',prop) |
| | | this.initFlag = true; |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |