1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  | <template> 
 |    <zt-dialog ref="dialog" @confirm="formSubmit"  append-to-body> 
 |      <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> 
 |          <zt-form-item label="选择用户" prop="menuIdList" rules="required"> 
 |              <zt-user-selector v-model="dataForm.menuIdList" multiple/> 
 |          </zt-form-item> 
 |      </el-form> 
 |    </zt-dialog> 
 |  </template> 
 |    
 |  <script> 
 |    export default { 
 |      data() { 
 |        return { 
 |          dataForm: { 
 |            roleId: '' 
 |          } 
 |        } 
 |      }, 
 |      computed: { 
 |      }, 
 |      methods: { 
 |        init(roleId) { 
 |          this.dataForm.roleId = roleId 
 |        }, 
 |        // 表单提交 
 |        async formSubmit() { 
 |          let res = await this.$http['post']('/sys/role/addroleuser', this.dataForm) 
 |          if (res.success) { 
 |            await this.$tip.success() 
 |            this.$refs.dialog.close() 
 |            this.$emit('refreshDataList') 
 |          } 
 |        } 
 |      } 
 |    } 
 |  </script> 
 |  
  |