|
|
@ -3,8 +3,10 @@ |
|
|
|
<!--工具栏--> |
|
|
|
<div class="head-container"> |
|
|
|
<el-row type="flex"> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-col :span="20" class="col_flex"> |
|
|
|
<!-- 搜索 --> |
|
|
|
<div class="form_item"> |
|
|
|
<span>角色名称:</span> |
|
|
|
<el-input |
|
|
|
v-model="query.blurry" |
|
|
|
clearable |
|
|
@ -14,6 +16,9 @@ |
|
|
|
class="filter-item" |
|
|
|
@keyup.enter.native="crud.toQuery" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="form_item"> |
|
|
|
<span>管理员名称:</span> |
|
|
|
<el-input |
|
|
|
v-model="query.blurry" |
|
|
|
clearable |
|
|
@ -23,15 +28,23 @@ |
|
|
|
class="filter-item" |
|
|
|
@keyup.enter.native="crud.toQuery" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<rrOperation /> |
|
|
|
</el-col> |
|
|
|
<el-col class="page_add" :span="4"> |
|
|
|
<el-button class="table_add" type="primary" icon="el-icon-plus" @click="addDialogVisible = true">新增</el-button> |
|
|
|
<el-button class="table_add" type="primary" round @click="addDialogVisible = true">新增</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
<!--新增用户--> |
|
|
|
<el-dialog append-to-body :close-on-click-modal="false" :show-close="false" :before-close="crud.cancelCU" :visible.sync="addDialogVisible" title="新增" width="400px"> |
|
|
|
<el-dialog |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
:before-close="crud.cancelCU" |
|
|
|
:visible.sync="addDialogVisible" |
|
|
|
title="新增" |
|
|
|
width="576px" |
|
|
|
> |
|
|
|
<el-form ref="form" :inline="true" :model="form" size="small" label-width="100px"> |
|
|
|
<el-form-item |
|
|
|
label="登录账号" |
|
|
@ -40,7 +53,7 @@ |
|
|
|
{ required: true, message: '请输入登录账号', trigger: 'blur' } |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-input v-model="form.account" style="width: 200px" /> |
|
|
|
<el-input v-model="form.account" style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="管理员名称" |
|
|
@ -50,7 +63,7 @@ |
|
|
|
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' } |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-input v-model="form.nickName" style="width: 200px" /> |
|
|
|
<el-input v-model="form.nickName" style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label="管理员角色" |
|
|
@ -59,7 +72,7 @@ |
|
|
|
{ required: true, message: '请选择管理员角色', trigger: 'change' } |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-select v-model="form.roles" placeholder="请选择管理员角色"> |
|
|
|
<el-select v-model="form.roles" placeholder="请选择管理员角色" style="width: 336px"> |
|
|
|
<el-option label="机构超级管理员" value="1" /> |
|
|
|
<el-option label="普通用户" value="2" /> |
|
|
|
</el-select> |
|
|
@ -71,95 +84,104 @@ |
|
|
|
{ required: true, trigger: 'change', message: '请选择管理员状态' } |
|
|
|
]" |
|
|
|
> |
|
|
|
<el-select v-model="form.enabled" placeholder="请选择管理员状态"> |
|
|
|
<el-select v-model="form.enabled" placeholder="请选择管理员状态" style="width: 336px"> |
|
|
|
<el-option label="启用" value="1" /> |
|
|
|
<el-option label="关闭" value="0" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="crud.cancelCU">关闭</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" round @click="crud.submitCU">保存</el-button> |
|
|
|
<el-button round @click="crud.cancelCU">关闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!-- 编辑用户 --> |
|
|
|
<el-dialog append-to-body :close-on-click-modal="false" :show-close="false" :before-close="crud.cancelCU" :visible.sync="editDialogVisible" title="编辑" width="480px"> |
|
|
|
<el-form ref="form" :inline="true" :model="editForm" :rules="rules" size="small" label-width="100px"> |
|
|
|
<el-dialog |
|
|
|
append-to-body |
|
|
|
:close-on-click-modal="false" |
|
|
|
:before-close="crud.cancelCU" |
|
|
|
:visible.sync="editDialogVisible" |
|
|
|
title="编辑" |
|
|
|
width="576px" |
|
|
|
> |
|
|
|
<el-form |
|
|
|
ref="form" |
|
|
|
:inline="true" |
|
|
|
:model="editForm" |
|
|
|
:rules="rules" |
|
|
|
size="small" |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
<el-form-item label="管理员名称" prop="nickName"> |
|
|
|
<el-input v-model="editForm.nickName" style="width: 200px" /> |
|
|
|
<el-input v-model="editForm.nickName" style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="管理员角色" prop="roles"> |
|
|
|
<el-input v-model="editForm.roles" disabled style="width: 200px" /> |
|
|
|
<el-input v-model="editForm.roles" disabled style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="机构名称" prop="orgName"> |
|
|
|
<el-input v-model="editForm.orgName" disabled style="width: 200px" /> |
|
|
|
<el-input v-model="editForm.orgName" disabled style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="更改手机号" prop="phone"> |
|
|
|
<el-input v-model.number="editForm.phone" style="width: 200px" /> |
|
|
|
<el-input v-model.number="editForm.phone" style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="获取验证码" prop="code"> |
|
|
|
<el-input v-model.number="editForm.code" style="width: 200px" /> |
|
|
|
<el-button class="edit_code" type="primary" :disabled="disabledSendCode" @click="countdown()">{{ verification }}</el-button> |
|
|
|
<el-form-item label="验证码" prop="code" class="auth_code"> |
|
|
|
<el-input v-model.number="editForm.code" style="width: 336px" /> |
|
|
|
<div class="login-code"> |
|
|
|
<span @click="countdown()">{{ verification }}</span> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="登录密码" prop="password"> |
|
|
|
<el-input v-model="editForm.password" style="width: 200px" /> |
|
|
|
<el-input v-model="editForm.password" style="width: 336px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="crud.cancelCU">关闭</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" round @click="crud.submitCU">保存</el-button> |
|
|
|
<el-button round @click="crud.cancelCU">关闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!--表格渲染--> |
|
|
|
<el-row :gutter="15"> |
|
|
|
<el-col> |
|
|
|
<el-card class="box-card" shadow="never"> |
|
|
|
<!-- :data="crud.data" --> |
|
|
|
<el-table ref="table" v-loading="crud.loading" :data="tableData" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|
|
|
<el-table |
|
|
|
ref="table" |
|
|
|
v-loading="crud.loading" |
|
|
|
:data="tableData" |
|
|
|
:header-cell-style="{ background: '#3a8aeb', color: '#fff' }" |
|
|
|
style="width: 100%;" |
|
|
|
@selection-change="crud.selectionChangeHandler" |
|
|
|
> |
|
|
|
<el-table-column :selectable="checkboxT" type="selection" width="55" /> |
|
|
|
<el-table-column prop="account" width="135" align="center" label="登录账号" /> |
|
|
|
<el-table-column prop="nickName" align="center" label="管理员名称" /> |
|
|
|
<el-table-column prop="roles" align="center" label="管理角色" /> |
|
|
|
<el-table-column prop="orgName" align="center" label="机构名称" /> |
|
|
|
<el-table-column prop="phone" align="center" label="手机号码" /> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="状态" align="center" prop="enabled"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch |
|
|
|
v-model="scope.row.enabled" |
|
|
|
:disabled="user.id === scope.row.id" |
|
|
|
active-color="#409EFF" |
|
|
|
inactive-color="#F56C6C" |
|
|
|
@change="changeEnabled(scope.row, scope.row.enabled)" |
|
|
|
/> |
|
|
|
<div>{{ scope.row.enabled == 0 ? '启用' : '关闭' }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createTime" width="135" label="创建日期" /> |
|
|
|
<!-- v-if="checkPer(['admin','user:edit','user:del'])" --> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
width="140" |
|
|
|
align="center" |
|
|
|
fixed="right" |
|
|
|
> |
|
|
|
<el-table-column label="操作" width="180" align="center" fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- <udOperation |
|
|
|
:data="scope.row" |
|
|
|
:permission="permission" |
|
|
|
:disabled-dle="scope.row.id === user.id" |
|
|
|
/> --> |
|
|
|
/>--> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
icon="el-icon-edit" |
|
|
|
class="edit_btn" |
|
|
|
@click="editFormData(scope.$index, scope.row)" |
|
|
|
/> |
|
|
|
<el-button type="danger" icon="el-icon-delete" /> |
|
|
|
>编辑</el-button> |
|
|
|
<el-button type="danger" class="delt_btn">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!--分页组件--> |
|
|
|
<pagination /> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
@ -185,7 +207,7 @@ export default { |
|
|
|
name: 'User', |
|
|
|
components: { rrOperation, pagination }, |
|
|
|
cruds() { |
|
|
|
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }}) |
|
|
|
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser } }) |
|
|
|
}, |
|
|
|
mixins: [presenter(), header(), form(defaultForm), crud()], |
|
|
|
// 数据字典 |
|
|
@ -257,7 +279,7 @@ export default { |
|
|
|
created() { |
|
|
|
this.crud.msg.add = '新增成功,默认密码:123456' |
|
|
|
}, |
|
|
|
mounted: function() { |
|
|
|
mounted: function () { |
|
|
|
const that = this |
|
|
|
window.onresize = function temp() { |
|
|
|
that.height = document.documentElement.clientHeight - 180 + 'px;' |
|
|
@ -341,10 +363,10 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
|
.el-dialog__header{ |
|
|
|
.el-dialog__header { |
|
|
|
background-color: #f1f1f1; |
|
|
|
} |
|
|
|
.edit_code{ |
|
|
|
} |
|
|
|
.edit_code { |
|
|
|
margin-left: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |