| | |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | >新增</el-button> |
| | | >新增 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <!--表格及分页--> |
| | |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button> |
| | | <el-button v-if="scope.row.userType == 3" link type="primary" icon="Edit" @click="handleRole(scope.row)">绑定角色</el-button> |
| | | <el-button v-if="scope.row.userType == 3" link type="primary" icon="Edit" |
| | | @click="handleRole(scope.row)">绑定角色 |
| | | </el-button> |
| | | <el-button link type="primary" icon="reset" @click="handeReset(scope.row)">重置密码</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-form-item label="联系方式" prop="contact"> |
| | | <el-input v-model="form.contact" placeholder="请输入联系方式" /> |
| | | </el-form-item> |
| | | <el-form-item v-if="!form.id"> |
| | | <br> |
| | | </el-form-item> |
| | | <el-form-item /> |
| | | <el-form-item label="上传头像" prop=""> |
| | | <upload-icons @uploadData="uploadData" :imageList="form.headImg" :limit="1"></upload-icons> |
| | | </el-form-item> |
| | |
| | | > |
| | | <div class="bandCheck"> |
| | | <el-checkbox-group v-model="roleCheckedList"> |
| | | <el-checkbox v-for="(item,index) in roleSelectList" :key="index" :label="item.name" :value="item.id" size ="large" /> |
| | | <el-checkbox v-for="(item,index) in roleSelectList" :key="index" :label="item.name" :value="item.id" |
| | | size="large"/> |
| | | </el-checkbox-group> |
| | | </div> |
| | | <div class="handleBtn"> |
| | |
| | | import role from "@/api/system/role"; |
| | | import { sysDictData } from "@/api/system/dict"; |
| | | import setPostParams from "@/utils/searchParams.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL //图片前缀 |
| | | |
| | |
| | | email:'邮箱地址', |
| | | createTimeView:'创建时间' |
| | | }) |
| | | |
| | | /** 获取列表 */ |
| | | async function getList(val) { |
| | | loading.value = true; |
| | |
| | | title.value = "修改用户"; |
| | | } |
| | | |
| | | /** 重置密码 */ |
| | | function handeReset(row) { |
| | | proxy.$modal.confirm('是否确认重置"' + row.nickName + '"的密码?').then(function () { |
| | | return user().resetPwd(row.id).then(res => { |
| | | proxy.$modal.confirm(`重置密码成功,新密码为:${res.data}`); |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | proxy.$modal.confirm('是否确认删除名称为"' + row.nickName + '"的数据项?').then(function() { |
| | |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }).catch(() => { |
| | | }); |
| | | } |
| | | |
| | | /** |
| | |
| | | userTypeList.value = res.data |
| | | }) |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | proxy.$refs["userRef"].validate(valid => { |
| | |
| | | } |
| | | //绑定按钮 |
| | | const userId = ref() |
| | | |
| | | async function handleRole(row){ |
| | | open1.value = true |
| | | userId.value = row.id |
| | | await getUserRole() |
| | | await getBandedRoleList(userId.value) |
| | | } |
| | | |
| | | //获取已绑定角色列表 |
| | | async function getBandedRoleList(id){ |
| | | await user().getListRoleAdmin(id).then((res) =>{ |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //绑定请求 |
| | | async function bandListConfirm(){ |
| | | let postParam = { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getUserType() |
| | | getList(); |
| | | </script> |
| | |
| | | max-width: 100px; |
| | | height: 50px; |
| | | } |
| | | |
| | | .el-dialog{ |
| | | width:50vw; |
| | | |
| | | .user-form{ |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | |
| | | align-items: center; |
| | | margin: 20px auto; |
| | | width: 90%; |
| | | |
| | | .el-form-item{ |
| | | width: 45%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .bandCheck{ |
| | | width:100%; |
| | | /* background-color: beige; */ |
| | |
| | | align-items: center; |
| | | margin-bottom:100px; |
| | | } |
| | | |
| | | .handleBtn{ |
| | | width:100%; |
| | | /* background-color: beige; */ |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | .el-button{ |
| | | width:100px; |
| | | } |