3535 <el-input size =" medium" clearable type =" password" v-model =" form.confirm_password" autocomplete =" off" ></el-input >
3636 </el-form-item >
3737 <el-form-item v-if =" pageType !== 'password'" label =" 选择分组" >
38- <el-select
38+ <!-- < el-select
3939 size="medium"
4040 multiple
4141 v-model="form.group_ids"
4242 :disabled="groups.length === 0"
4343 placeholder="请选择分组"
4444 >
4545 <el-option v-for="item in groups" :key="item.id" :label="item.name" :value="item.id"> </el-option>
46- </el-select >
47- <!-- < el-radio -group v-model="form.group_id" label-position="top" class="user-info ">
48- <el-radio :label="item.id" v-for="( item, index) in groups" :key="index" >{{item.name}}</el-radio >
49- </el-radio -group> -- >
46+ </el-select> -->
47+ <el-checkbox -group v-model =" form.group_ids " >
48+ <el-checkbox v-for =" item in groups" :key =" item.id " :label = " item.id " >{{ item.name }}</el-checkbox >
49+ </el-checkbox -group >
5050 </el-form-item >
5151 <el-form-item v-show =" submit" class =" submit" >
5252 <el-button type =" primary" @click =" submitForm('form')" >保 存</el-button >
@@ -165,7 +165,7 @@ export default {
165165 try {
166166 this .loading = true
167167 res = await User .register (this .form )
168- if (res .error_code === 0 ) {
168+ if (res .error_code < window . SUCCESS_CODE ) {
169169 this .loading = false
170170 this .$message .success (` ${ res .msg } ` )
171171 this .eventBus .$emit (' addUser' , true )
@@ -192,7 +192,7 @@ export default {
192192 this .loading = false
193193 console .log (e)
194194 }
195- if (res .error_code === 0 ) {
195+ if (res .error_code < window . SUCCESS_CODE ) {
196196 this .loading = false
197197 this .$message .success (` ${ res .msg } ` )
198198 this .$emit (' handleInfoResult' , true )
@@ -226,17 +226,17 @@ export default {
226226 this .form .group_ids = temp
227227 },
228228 },
229- watch: {
230- groups: {
231- // 默认选中管理员组
232- handler () {
233- if (this .groups && this .groups [0 ] && this .groups [0 ].id ) {
234- this .form .group_ids = [this .groups [0 ].id ]
235- }
236- },
237- immediate: true ,
238- },
239- },
229+ // watch: {
230+ // groups: {
231+ // // 默认选中管理员组
232+ // handler() {
233+ // if (this.groups && this.groups[0] && this.groups[0].id) {
234+ // this.form.group_ids = [this.groups[0].id]
235+ // }
236+ // },
237+ // immediate: true,
238+ // },
239+ // },
240240 created () {
241241 // 通过是否接收到数据来判断当前页面是添加数据还是编辑数据
242242 if (this .pageType === ' edit' ) {
0 commit comments