|
@@ -223,8 +223,36 @@ export default {
|
|
|
|
|
|
this.codes.nums = JSON.stringify(obj)
|
|
|
},
|
|
|
+ getSendUserGroupName() {
|
|
|
+ if (!this.showConcertlabGroup) return
|
|
|
+ const tree = this.$refs.concertlabTree
|
|
|
+ let idArr = []
|
|
|
+ let nameArr = []
|
|
|
+ if (tree) {
|
|
|
+ const r = tree.getCheckedNodes()
|
|
|
+ // 遍历取最后一级(没children的那一级)
|
|
|
+ const lastLevel = r.filter(item => !item.children)
|
|
|
+ idArr = lastLevel.map(item => item.id)
|
|
|
+ nameArr = lastLevel.map(item => item.name)
|
|
|
+ }
|
|
|
+ this.codes.userGroupId = idArr
|
|
|
+ this.codes.userGroupName = nameArr
|
|
|
+ this.userFunc()
|
|
|
+ },
|
|
|
+ userFunc() {
|
|
|
+ if (this.codes.userGroupId.length == 0) {
|
|
|
+ this.showUser = true
|
|
|
+ } else {
|
|
|
+ this.showUser = false
|
|
|
+ }
|
|
|
+ },
|
|
|
// 提交
|
|
|
submit(name) {
|
|
|
+ try {
|
|
|
+ this.getSendUserGroupName()
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
this.$refs[name].validate((valid) => {
|
|
|
if (valid && !this.goodShow) {
|
|
|
this.isDisable = true
|