|
|
|
@ -97,6 +97,22 @@
|
|
|
|
|
<a-radio value="1">普通用户</a-radio> |
|
|
|
|
<a-radio value="2">上级</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<a-upload |
|
|
|
|
listType="picture-card" |
|
|
|
|
class="avatar-uploader" |
|
|
|
|
:showUploadList="false" |
|
|
|
|
:action="uploadAction" |
|
|
|
|
:data="{'isup':1}" |
|
|
|
|
:headers="headers" |
|
|
|
|
:beforeUpload="beforeUpload" |
|
|
|
|
@change="handleChange" |
|
|
|
|
> |
|
|
|
|
<img v-if="picUrl" :src="getAvatarView()" alt="头像" style="height:140px;max-width:180px;border-radius:50%"/> |
|
|
|
|
<div v-else style="height:140px;width:140px;padding-top:35%"> |
|
|
|
|
<a-icon :type="uploadLoading ? 'loading' : 'plus'" /> |
|
|
|
|
<div class="ant-upload-text" style="color: dimgray">上传头像</div> |
|
|
|
|
</div> |
|
|
|
|
</a-upload> |
|
|
|
|
</a-form-item> |
|
|
|
|
<a-form-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow==true"> |
|
|
|
|
<a-select |
|
|
|
@ -114,25 +130,27 @@
|
|
|
|
|
</a-select> |
|
|
|
|
</a-form-item> |
|
|
|
|
<!-- update--end--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ --> |
|
|
|
|
<a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<template v-if="BASE_FileType=='mongodb'"> |
|
|
|
|
<a-radio-group name="radioGroup" v-model="userHead" v-if="userHead"> |
|
|
|
|
<a-radio v-for="item in userHeads" :value="item.id"> |
|
|
|
|
<a-avatar :title="item.fileName" :alt="item.fileName" :src="getHeadsHttpUrl(item.id)" shape="square" :size="64" icon="user" /> |
|
|
|
|
</a-radio> |
|
|
|
|
</a-radio-group> |
|
|
|
|
<a-alert message="可上传多个图片并选择一个候选头像,需要提交保存生效!" banner /> |
|
|
|
|
<file-mangement style="margin-top: 10px" |
|
|
|
|
:uuId="username" |
|
|
|
|
:fileType="'img'" |
|
|
|
|
:moduleCode="'头像'" |
|
|
|
|
:isMultiple="true" |
|
|
|
|
@afterIntFiles="afterIntFiles" |
|
|
|
|
@changeFile="afterIntFiles" |
|
|
|
|
></file-mangement> |
|
|
|
|
</template> |
|
|
|
|
<j-image-upload v-if="BASE_FileType!='mongodb'" class="avatar-uploader" text="上传" v-model="fileList" ></j-image-upload> |
|
|
|
|
</a-form-item> |
|
|
|
|
<!-- <a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <template v-if="BASE_FileType=='mongodb'">--> |
|
|
|
|
<!-- <a-radio-group name="radioGroup" v-model="userHead" v-if="userHead">--> |
|
|
|
|
<!-- <a-radio v-for="item in userHeads" :value="item.id">--> |
|
|
|
|
<!-- <a-avatar :title="item.fileName" :alt="item.fileName" :src="getHeadsHttpUrl(item.id)" shape="square" :size="64" icon="user" />--> |
|
|
|
|
<!-- </a-radio>--> |
|
|
|
|
<!-- </a-radio-group>--> |
|
|
|
|
<!-- <a-alert message="可上传多个图片并选择一个候选头像,需要提交保存生效!" banner />--> |
|
|
|
|
<!-- <file-mangement style="margin-top: 10px"--> |
|
|
|
|
<!-- :uuId="username"--> |
|
|
|
|
<!-- :fileType="'img'"--> |
|
|
|
|
<!-- :moduleCode="'头像'"--> |
|
|
|
|
<!-- :isMultiple="true"--> |
|
|
|
|
<!-- @afterIntFiles="afterIntFiles"--> |
|
|
|
|
<!-- @changeFile="afterIntFiles"--> |
|
|
|
|
<!-- ></file-mangement>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- <j-image-upload v-if="BASE_FileType!='mongodb'" class="avatar-uploader" text="上传" v-model="fileList" ></j-image-upload>--> |
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-date-picker |
|
|
|
@ -193,6 +211,7 @@
|
|
|
|
|
import JImageUpload from '../../../components/jeecg/JImageUpload' |
|
|
|
|
import FileMangement from "@/extends/FileMangement/fileMangement"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "UserModal", |
|
|
|
|
components: { |
|
|
|
@ -217,6 +236,7 @@
|
|
|
|
|
userId:"", //保存用户id |
|
|
|
|
username:"", |
|
|
|
|
userHeads:[], |
|
|
|
|
imgList:[], |
|
|
|
|
userHead:'', |
|
|
|
|
disableSubmit:false, |
|
|
|
|
userDepartModel:{userId:'',departIdList:[]}, // 保存SysUserDepart的用户部门中间表数据需要的对象 |
|
|
|
@ -287,11 +307,12 @@
|
|
|
|
|
form:this.$form.createForm(this), |
|
|
|
|
picUrl: "", |
|
|
|
|
url: { |
|
|
|
|
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload", |
|
|
|
|
fileUpload: window._CONFIG['domianURL']+"/sys/upload/uploadMinio", |
|
|
|
|
userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url |
|
|
|
|
userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url |
|
|
|
|
syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//同步用户到工作流 |
|
|
|
|
queryTenantList: '/sys/tenant/queryList' |
|
|
|
|
queryTenantList: '/sys/tenant/queryList', |
|
|
|
|
imgerver: window._CONFIG['domianURL']+"/sys/common/static/", |
|
|
|
|
}, |
|
|
|
|
identity:"1", |
|
|
|
|
fileList:[], |
|
|
|
@ -312,6 +333,38 @@
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
beforeUpload: function(file){ |
|
|
|
|
var fileType = file.type; |
|
|
|
|
if(fileType.indexOf('image')<0){ |
|
|
|
|
this.$message.warning('请上传图片'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
//TODO 验证文件大小 |
|
|
|
|
}, |
|
|
|
|
handleChange (info) { |
|
|
|
|
this.picUrl = ""; |
|
|
|
|
if (info.file.status === 'uploading') { |
|
|
|
|
this.uploadLoading = true; |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.model.img=null |
|
|
|
|
if (info.file.status === 'done') { |
|
|
|
|
var response = info.file.response; |
|
|
|
|
this.uploadLoading = false; |
|
|
|
|
console.log(response); |
|
|
|
|
if(response.success){ |
|
|
|
|
this.model.img= response.message; |
|
|
|
|
this.picUrl = "Has no pic url yet"; |
|
|
|
|
}else{ |
|
|
|
|
this.$message.warning(response.message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getAvatarView(){ |
|
|
|
|
this.fileList = this.model.img; |
|
|
|
|
return this.model.img; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isDisabledAuth(code){ |
|
|
|
|
return disabledAuthFilter(code); |
|
|
|
|
}, |
|
|
|
@ -366,6 +419,7 @@
|
|
|
|
|
this.edit({activitiSync:'1'}); |
|
|
|
|
}, |
|
|
|
|
edit (record) { |
|
|
|
|
this.imgList=[]; |
|
|
|
|
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度 |
|
|
|
|
let that = this; |
|
|
|
|
that.initialRoleList(); |
|
|
|
@ -384,6 +438,12 @@
|
|
|
|
|
that.$nextTick(() => { |
|
|
|
|
that.form.setFieldsValue(pick(this.model,'username','sex','realname','email','phone','activitiSync','workNo','telephone','post')) |
|
|
|
|
}); |
|
|
|
|
this.picUrl = record.avatar;//以这句为主,设置model中的图片字段 |
|
|
|
|
this.model.img = record.avatar; |
|
|
|
|
console.log("图片路径>>>>>>>>>",record.avatar) |
|
|
|
|
console.log("图片路径>>>>>>>>>",this.picUrl) |
|
|
|
|
let obj ={} |
|
|
|
|
obj.url= record.avatar; |
|
|
|
|
//身份为上级显示负责部门,否则不显示 |
|
|
|
|
if(this.model.userIdentity=="2"){ |
|
|
|
|
this.identity="2"; |
|
|
|
@ -627,32 +687,32 @@
|
|
|
|
|
} |
|
|
|
|
return e && e.fileList |
|
|
|
|
}, |
|
|
|
|
beforeUpload: function(file){ |
|
|
|
|
var fileType = file.type; |
|
|
|
|
if(fileType.indexOf('image')<0){ |
|
|
|
|
this.$message.warning('请上传图片'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
//TODO 验证文件大小 |
|
|
|
|
}, |
|
|
|
|
handleChange (info) { |
|
|
|
|
this.picUrl = ""; |
|
|
|
|
if (info.file.status === 'uploading') { |
|
|
|
|
this.uploadLoading = true; |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (info.file.status === 'done') { |
|
|
|
|
var response = info.file.response; |
|
|
|
|
this.uploadLoading = false; |
|
|
|
|
console.log(response); |
|
|
|
|
if(response.success){ |
|
|
|
|
this.model.avatar = response.message; |
|
|
|
|
this.picUrl = "Has no pic url yet"; |
|
|
|
|
}else{ |
|
|
|
|
this.$message.warning(response.message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// beforeUpload: function(file){ |
|
|
|
|
// var fileType = file.type; |
|
|
|
|
// if(fileType.indexOf('image')<0){ |
|
|
|
|
// this.$message.warning('请上传图片'); |
|
|
|
|
// return false; |
|
|
|
|
// } |
|
|
|
|
// //TODO 验证文件大小 |
|
|
|
|
// }, |
|
|
|
|
// handleChange (info) { |
|
|
|
|
// this.picUrl = ""; |
|
|
|
|
// if (info.file.status === 'uploading') { |
|
|
|
|
// this.uploadLoading = true; |
|
|
|
|
// return |
|
|
|
|
// } |
|
|
|
|
// if (info.file.status === 'done') { |
|
|
|
|
// var response = info.file.response; |
|
|
|
|
// this.uploadLoading = false; |
|
|
|
|
// console.log(response); |
|
|
|
|
// if(response.success){ |
|
|
|
|
// this.model.avatar = response.message; |
|
|
|
|
// this.picUrl = "Has no pic url yet"; |
|
|
|
|
// }else{ |
|
|
|
|
// this.$message.warning(response.message); |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
// 搜索用户对应的部门API |
|
|
|
|
onSearch(){ |
|
|
|
|
this.$refs.departWindow.add(this.checkedDepartKeys,this.userId); |
|
|
|
|