|
|
|
@ -1,13 +1,12 @@
|
|
|
|
|
<template> |
|
|
|
|
<a-drawer |
|
|
|
|
<a-modal |
|
|
|
|
:title="title" |
|
|
|
|
:maskClosable="true" |
|
|
|
|
:width="drawerWidth" |
|
|
|
|
placement="right" |
|
|
|
|
:closable="true" |
|
|
|
|
@close="handleCancel" |
|
|
|
|
:width="modalWidth" |
|
|
|
|
:visible="visible" |
|
|
|
|
style="height: 100%;overflow: auto;padding-bottom: 53px;"> |
|
|
|
|
:confirmLoading="confirmLoading" |
|
|
|
|
@ok="handleSubmit" |
|
|
|
|
@cancel="close" |
|
|
|
|
cancelText="关闭"> |
|
|
|
|
|
|
|
|
|
<template slot="title"> |
|
|
|
|
<div style="width: 100%;"> |
|
|
|
@ -21,33 +20,41 @@
|
|
|
|
|
|
|
|
|
|
<a-spin :spinning="confirmLoading"> |
|
|
|
|
<a-form :form="form"> |
|
|
|
|
|
|
|
|
|
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-row :gutter="24"> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input placeholder="请输入用户账号" v-decorator.trim="[ 'username', validatorRules.username]" :readOnly="!!model.id"/> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
|
|
<template v-if="!model.id"> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" > |
|
|
|
|
<a-input type="password" placeholder="请输入登录密码" v-decorator="[ 'password',validatorRules.password]" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col > |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" > |
|
|
|
|
<a-input type="password" @blur="handleConfirmBlur" placeholder="请重新输入登录密码" v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col > |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" > |
|
|
|
|
<a-input placeholder="请输入用户姓名" v-decorator.trim="[ 'realname', validatorRules.realname]" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input placeholder="请输入工号" v-decorator.trim="[ 'workNo', validatorRules.workNo]" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]"/> |
|
|
|
|
<j-select-position placeholder="请选择职务" :multiple="true" v-decorator.trim="['post']"/> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" > |
|
|
|
|
<a-select |
|
|
|
|
mode="multiple" |
|
|
|
@ -62,7 +69,8 @@
|
|
|
|
|
</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<!--部门分配--> |
|
|
|
|
<a-form-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled"> |
|
|
|
|
<a-input-search |
|
|
|
@ -73,23 +81,25 @@
|
|
|
|
|
<a-button slot="enterButton" icon="search">选择</a-button> |
|
|
|
|
</a-input-search> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
|
|
<!--租户分配--> |
|
|
|
|
<a-form-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled"> |
|
|
|
|
|
|
|
|
|
<a-select |
|
|
|
|
mode="multiple" |
|
|
|
|
style="width: 100%" |
|
|
|
|
placeholder="请选择租户分配" |
|
|
|
|
:disabled="disableSubmit" |
|
|
|
|
v-model="currentTenant"> |
|
|
|
|
<a-select-option v-for="(item, index) in tenantList" :key="index" :value="item.id"> |
|
|
|
|
{{ item.name }} |
|
|
|
|
</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
</a-form-item> |
|
|
|
|
<!-- <a-form-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">--> |
|
|
|
|
|
|
|
|
|
<!-- <a-select--> |
|
|
|
|
<!-- mode="multiple"--> |
|
|
|
|
<!-- style="width: 100%"--> |
|
|
|
|
<!-- placeholder="请选择租户分配"--> |
|
|
|
|
<!-- :disabled="disableSubmit"--> |
|
|
|
|
<!-- v-model="currentTenant">--> |
|
|
|
|
<!-- <a-select-option v-for="(item, index) in tenantList" :key="index" :value="item.id">--> |
|
|
|
|
<!-- {{ item.name }}--> |
|
|
|
|
<!-- </a-select-option>--> |
|
|
|
|
<!-- </a-select>--> |
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
|
|
<!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ --> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-radio-group |
|
|
|
|
v-model="identity" |
|
|
|
@ -114,6 +124,8 @@
|
|
|
|
|
</div> |
|
|
|
|
</a-upload> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow==true"> |
|
|
|
|
<a-select |
|
|
|
|
mode="multiple" |
|
|
|
@ -124,11 +136,13 @@
|
|
|
|
|
:getPopupContainer = "(target) => target.parentNode" |
|
|
|
|
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" |
|
|
|
|
> |
|
|
|
|
<!-- v-model="departIds"--> |
|
|
|
|
<a-select-option v-for="item in resultDepartOptions" :key="item.key" :value="item.key" |
|
|
|
|
>{{item.title}}</a-select-option |
|
|
|
|
> |
|
|
|
|
</a-select> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<!-- update--end--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ --> |
|
|
|
|
<!-- <a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <template v-if="BASE_FileType=='mongodb'">--> |
|
|
|
@ -152,28 +166,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-date-picker |
|
|
|
|
style="width: 100%" |
|
|
|
|
placeholder="请选择生日" |
|
|
|
|
v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]" |
|
|
|
|
:getCalendarContainer="node => node.parentNode"/> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
<!-- <a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <a-date-picker--> |
|
|
|
|
<!-- style="width: 100%"--> |
|
|
|
|
<!-- placeholder="请选择生日"--> |
|
|
|
|
<!-- v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"--> |
|
|
|
|
<!-- :getCalendarContainer="node => node.parentNode"/>--> |
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-select v-decorator="[ 'sex', {}]" placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode"> |
|
|
|
|
<a-select-option :value="1">男</a-select-option> |
|
|
|
|
<a-select-option :value="2">女</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input placeholder="请输入邮箱" v-decorator="[ 'email', validatorRules.email]" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="12" > |
|
|
|
|
<a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input placeholder="请输入手机号码" :disabled="isDisabledAuth('user:form:phone')" v-decorator="[ 'phone', validatorRules.phone]" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
|
|
<!-- <a-form-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <a-input placeholder="请输入座机" v-decorator="[ 'telephone', validatorRules.telephone]"/>--> |
|
|
|
@ -182,18 +199,19 @@
|
|
|
|
|
<!-- <a-form-item label="工作流引擎" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <j-dict-select-tag v-decorator="['activitiSync', {}]" placeholder="请选择是否同步工作流引擎" :type="'radio'" :triggerChange="true" dictCode="activiti_sync"/>--> |
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
|
|
</a-row> |
|
|
|
|
</a-form> |
|
|
|
|
|
|
|
|
|
</a-spin> |
|
|
|
|
<depart-window ref="departWindow" @ok="modalFormOk"></depart-window> |
|
|
|
|
|
|
|
|
|
<div class="drawer-bootom-button" v-show="!disableSubmit"> |
|
|
|
|
<!-- <div class="drawer-bootom-button" v-show="!disableSubmit"> |
|
|
|
|
<a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消"> |
|
|
|
|
<a-button style="margin-right: .8rem">取消</a-button> |
|
|
|
|
</a-popconfirm> |
|
|
|
|
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button> |
|
|
|
|
</div> |
|
|
|
|
</a-drawer> |
|
|
|
|
</div>--> |
|
|
|
|
</a-modal> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
@ -210,7 +228,7 @@
|
|
|
|
|
import {duplicateCheck } from '@/api/api' |
|
|
|
|
import JImageUpload from '../../../components/jeecg/JImageUpload' |
|
|
|
|
import FileMangement from "@/extends/FileMangement/fileMangement"; |
|
|
|
|
|
|
|
|
|
import signMd5Utils from '@/utils/encryption/signMd5Utils' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "UserModal", |
|
|
|
@ -224,8 +242,8 @@
|
|
|
|
|
return { |
|
|
|
|
departDisabled: false, //是否是我的部门调用该页面 |
|
|
|
|
roleDisabled: false, //是否是角色维护调用该页面 |
|
|
|
|
modalWidth:800, |
|
|
|
|
drawerWidth:700, |
|
|
|
|
modalWidth:1000, |
|
|
|
|
drawerWidth:1100, |
|
|
|
|
modaltoggleFlag:true, |
|
|
|
|
confirmDirty: false, |
|
|
|
|
selectedDepartKeys:[], //保存用户选择部门id |
|
|
|
@ -250,11 +268,13 @@
|
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
password:{ |
|
|
|
|
rules: [{ |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
|
|
|
|
message: '密码由8位数字、大小写字母和特殊符号组成!' |
|
|
|
|
}, { |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
validator: this.validateToNextPassword, |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
@ -272,6 +292,7 @@
|
|
|
|
|
validator: this.validateEmail |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
departIds:{rules: [{ required: true, message: '请选择部门!' }]}, |
|
|
|
|
roles:{}, |
|
|
|
|
// sex:{initialValue:((!this.model.sex)?"": (this.model.sex+""))} |
|
|
|
|
workNo: { |
|
|
|
@ -520,12 +541,12 @@
|
|
|
|
|
// 触发表单验证 |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
if (this.checkedDepartNameString ===''||this.checkedDepartNameString===null||this.checkedDepartNameString === undefined){ |
|
|
|
|
this.$message.error("部门分配不能为空") |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
that.confirmLoading = true; |
|
|
|
|
if(!values.birthday){ |
|
|
|
|
values.birthday = ''; |
|
|
|
|
}else{ |
|
|
|
|
values.birthday = values.birthday.format(this.dateFormat); |
|
|
|
|
} |
|
|
|
|
values.password = signMd5Utils.md5password(values.password); |
|
|
|
|
let formData = Object.assign(this.model, values); |
|
|
|
|
if(that.fileList != ''){ |
|
|
|
|
formData.avatar = that.fileList; |
|
|
|
|