用户修改(静态)

dev_2022-04-07
yujialong 3 years ago
parent 9161141d9a
commit 9910bf9ed2
  1. 2
      src/utils/api.js
  2. 4
      src/utils/http.js
  3. 49
      src/views/course/contentSettings.vue
  4. 9
      src/views/setting/index.vue
  5. 4
      src/views/setting/info.vue
  6. 335
      src/views/user/AddUser.vue
  7. 26
      src/views/user/User.vue

@ -56,7 +56,7 @@ export default {
selectAccountDetail: `users/users/userAccount/selectAccountDetail`,
selectUserSysBind: `users/users/userAccount/selectUserSysBind`,
updatePersonCenter: `users/users/userAccount/updatePersonCenter`,
updateUserAvatars: `users/users/userAccount/updateUserAvatars`,
updateUserAvatars: `${Setting.host}users/users/userAccount/updateUserAvatars`,
userInfo: `users/users/userAccount/userInfo`,
// bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,
// sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,

@ -132,9 +132,9 @@ export function get(url, params){
/**
* post方法对应post请求
*/
export function post(url, params) {
export function post(url, params, config) {
return new Promise((resolve, reject) => {
axios.post(url,params)
axios.post(url,params, config)
.then(res => {
return resolve(res.data);
})

@ -85,17 +85,18 @@
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
:http-request="handleRequest"
name="file"
>
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
</el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</el-form-item>
<el-form-item label="小节名称">
<el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input>
@ -113,17 +114,18 @@
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
:http-request="handleRequest"
name="file"
>
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
</el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="switchVisible = false">取消</el-button>
@ -186,7 +188,7 @@
<script>
import { Loading } from "element-ui";
import pdf from "@/components/pdf";
import axios from 'axios'
export default {
name: "contentSettings",
data() {
@ -227,7 +229,9 @@ export default {
loadIns: null,
pdfVisible: false,
pdfSrc: "",
previewing: false
previewing: false,
showProgress: false,
progressPercent: 0
};
},
components: { pdf },
@ -302,19 +306,40 @@ export default {
this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
this.showProgress = true
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(res, file, fileList) {
let { fileId, fileType, fileUrl, ossFileName } = res.data.filesResult;
this.uploading = false;
this.fileId = fileId;
this.fileType = fileType;
this.fileUrl = fileUrl;
this.fileName = ossFileName;
//
handleRequest(data) {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data'
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false
this.fileId = fileId
this.fileType = fileType
this.fileUrl = fileUrl
this.fileName = ossFileName
})
},
uploadError(err, file, fileList) {
this.$message({
@ -391,6 +416,7 @@ export default {
},
closeSection() {
this.isAddSection = false;
this.progressPercent = 0
},
addSection(id) {
this.chapterId = id;
@ -455,6 +481,7 @@ export default {
this.fileType = "";
this.fileUrl = "";
this.sectionId = "";
this.progressPercent = 0
},
//
download(row) {

@ -24,7 +24,7 @@
<script>
import Setting from '@/setting'
import { mapState,mapActions } from 'vuex'
import { mapState,mapMutations } from 'vuex'
import info from './info'
import util from '@/libs/util'
export default {
@ -66,11 +66,10 @@ export default {
},
methods: {
...mapActions('user', [
'setAvatar'
]),
changeAvatar(res) {
this.setAvatar(res.message)
this.$store.commit('userAvatar', {
avatar: res.message
})
},
updateStatus(status){
this.edited = status

@ -159,8 +159,8 @@
</div>
</div>
<div class="btns">
<el-button size="small" v-throttle @click="$router.back()">取消</el-button>
<el-button type="primary" size="small" v-throttle @click="save">更新</el-button>
<el-button size="small" @click="$router.back()">取消</el-button>
<el-button type="primary" size="small" @click="save">更新</el-button>
</div>
<el-dialog :title="form.email ? '更换邮箱' : '绑定邮箱'" :visible.sync="emailVisible" :close-on-click-modal="false" @close="closeEmail" width="30%">

@ -7,167 +7,7 @@
<div class="per_title" @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看用户信息</span>
</div>
</div>
</el-card>
<!-- 个人信息 -->
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>个人信息</span>
</div>
</div>
<div>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
:disabled="isDetail"
>
<el-col :span="6" :offset="5">
<el-form-item prop="userName" label="用户姓名">
<el-input v-model="form.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="证件类型" prop="documentType">
<el-input v-model="form.documentType" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="form.documentType"-->
<!-- clearable-->
<!-- placeholder="请选择证件类型"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item,index) in documentTypeList"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="国家">
<el-input v-model="form.countries" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="form.countries"-->
<!-- clearable-->
<!-- placeholder="请选择国家"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item,index) in countryList"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="城市">
<el-input v-model="form.cityName" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="form.cityId"-->
<!-- clearable-->
<!-- placeholder="请选择城市"-->
<!-- :disabled="form.cityId ? false : true"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item,index) in cityList"-->
<!-- :key="index"-->
<!-- :label="item.cityName"-->
<!-- :value="item.cityId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="教育程度">
<!-- <el-input v-model="form.educationDegree" placeholder="请输入"></el-input>-->
<el-select
v-model="form.educationDegree"
clearable
placeholder="请选择教育程度"
>
<el-option
v-for="(item,index) in educationDegreeList"
:key="index"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="当前院校">
<el-input v-model="form.schoolName" placeholder="请输入"></el-input>
<!-- <el-select v-model="form.schoolId" filterable clearable placeholder="请选择学校">-->
<!-- <el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="唯一识别码">
<el-input
v-model="form.uniqueIdentification"
placeholder="请输入"
:disabled="true"
></el-input>
</el-form-item>
<el-form-item prop="idNumber" label="证件号码">
<el-input
v-model="form.idNumber"
placeholder="请输入证件号码"
maxlength="18"
></el-input>
</el-form-item>
<el-form-item label="省份">
<el-input v-model="form.provinceName" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="form.provinceId"-->
<!-- clearable-->
<!-- placeholder="请选择省份"-->
<!-- @change="getCity"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item,index) in provinceList"-->
<!-- :key="index"-->
<!-- :label="item.provinceName"-->
<!-- :value="item.provinceId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="出生日期">
<el-date-picker
type="date"
placeholder="选择出生日期"
v-model="form.dateBirth"
style="width: 100%;"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item label="性别">
<el-select clearable
v-model="form.sex"
:disabled="IDdisabled"
placeholder="请选择性别"
>
<el-option
v-for="(item,index) in sexList"
:key="index"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
<span class="per_school">{{ isDetail ? '查看' : '编辑' }}用户信息</span>
</div>
</div>
</el-card>
@ -209,8 +49,8 @@
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="微信号">
<el-input v-model="form.WeChatID" placeholder="请输入微信号"></el-input>
<el-form-item label="唯一识别码">
<el-input v-model="form.uniqueIdentification" disabled></el-input>
</el-form-item>
</el-col>
</el-col>
@ -219,117 +59,66 @@
</div>
</el-card>
<!-- 个人档案 -->
<!-- 个人信息 -->
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>个人档案</span>
<span>实名认证信息未实名认证</span>
</div>
</div>
<div>
<div class="flex-center" v-for="(item,index) in archivesList" :key="index" v-show="index == 0 || index == 1 || index == 2 || showArch">
<el-col :span="16" :offset="4">
<el-card shadow="hover" class="from_card">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="isDetail">
<div>
<el-col :span="10">
<el-form-item label="职业">
<el-input v-model="item.professionalName" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="item.personalCareerId"-->
<!-- placeholder="请选择职业"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item1 in occupationList"-->
<!-- :key="item1.value"-->
<!-- :label="item1.label"-->
<!-- :value="item1.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="院校">
<el-input v-model="item.schoolName" placeholder="请输入"></el-input>
<!-- <el-select v-model="item.schoolId" filterable clearable placeholder="请选择院校" @change="id => getSchoolName(id,index)">-->
<!-- <el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>-->
<!-- </el-select>-->
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="120px"
:disabled="isDetail"
>
<el-col :span="6" :offset="5">
<el-form-item prop="userName" label="用户姓名">
<el-input v-model="form.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="专业类">
<el-input v-model="item.professionalClassName" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="item.professionalClassId"-->
<!-- :disabled="item.disciplineId ? false : true"-->
<!-- clearable-->
<!-- placeholder="请选择专业类"-->
<!-- @change="id => getItemProfessional(id,index)"-->
<!-- @clear="() => clearItemProfess(index)"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item2,index) in item.ProfessionalClassList"-->
<!-- :key="index"-->
<!-- :label="item2.professionalClassName"-->
<!-- :value="item2.professionalClassId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-form-item label="证件类型" prop="documentType">
<!-- <el-input v-model="form.documentType" placeholder="请输入"></el-input> -->
<el-select
v-model="form.documentType"
clearable
placeholder="请选择证件类型"
>
<el-option
v-for="(item,index) in documentTypeList"
:key="index"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</div>
<div>
<el-col :span="10" :offset="3">
<el-form-item>
<br />
</el-form-item>
<el-form-item label="专业学科">
<el-input v-model="item.disciplineName" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="item.disciplineId"-->
<!-- clearable-->
<!-- placeholder="请选择专业学科"-->
<!-- @change="id => getItemProfessionalClass(id,index)"-->
<!-- @clear="() => clearItemClass(index)"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item3,index) in item.subjectList"-->
<!-- :key="index"-->
<!-- :label="item3.disciplineName"-->
<!-- :value="item3.disciplineId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-col :span="6" :offset="2">
<el-form-item prop="phone" label="手机号">
<el-input
v-model="form.phone"
placeholder="请输入手机号"
maxlength="11"
></el-input>
</el-form-item>
<el-form-item label="专业">
<el-input v-model="item.professionalName" placeholder="请输入"></el-input>
<!-- <el-select-->
<!-- v-model="item.professionalId"-->
<!-- :disabled="item.professionalClassId ? false : true"-->
<!-- clearable-->
<!-- placeholder="请选择专业"-->
<!-- @change="getItemStuGrade"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="(item4,index) in item.ProfessionalList"-->
<!-- :key="index"-->
<!-- :label="item4.professionalName"-->
<!-- :value="item4.professionalId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<el-form-item prop="idNumber" label="证件号码">
<el-input
v-model="form.idNumber"
placeholder="请输入证件号码"
maxlength="18"
></el-input>
</el-form-item>
</el-col>
</div>
</el-form>
</el-card>
</el-col>
</div>
</div>
<div class="fold" v-if="archivesList.length > 3">
<img :class="{ 'arrowTransform': showArch, 'arrowTransformReturn': !showArch}" style="width: 21px;height: 17px;" src="../../assets/img/person/open.png" alt="" @click="foldArch">
</div>
<div v-if="!archivesList.length" style="line-height: 60px; color: #909399; text-align: center;">暂无数据</div>
</div>
</el-card>
<!-- 已绑定系统 -->
@ -337,7 +126,7 @@
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>已绑定系统</span>
<span>已绑定的平台和用户信息</span>
</div>
<div>
<el-dialog :title="isShow ? '查看系统' : '编辑系统'" :visible.sync="dialogFormVisible" :center="!isIE()" :close-on-click-modal="false">
@ -415,13 +204,18 @@
row-key="platformId"
>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="platformName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="domainName" label="域名" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="platformName" label="平台名称" align="center"></el-table-column>
<el-table-column prop="platformName" label="绑定组织名称" align="center"></el-table-column>
<el-table-column prop="platformName" label="姓名" align="center"></el-table-column>
<el-table-column prop="platformName" label="工号/学号" align="center"></el-table-column>
<el-table-column prop="platformName" label="角色" align="center"></el-table-column>
<el-table-column prop="platformName" label="绑定时间" align="center"></el-table-column>
<el-table-column prop="domainName" label="登录次数" align="center"></el-table-column>
<el-table-column prop="createTime" label="上一次的登录时间" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row,true)">查看</el-button>
<el-button type="text" @click="show(scope.row,false)">编辑</el-button>
<el-switch v-if="scope.row.userId!==1" v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'" @change="switchUser($event,scope.row,scope.$index)" v-auth="'/user:启用'"></el-switch>
</template>
</el-table-column>
</el-table>
@ -436,8 +230,8 @@ export default {
name: 'baseform',
data() {
return {
isDetail: true,
userId: this.$route.query.userId,
isDetail: this.$route.query.show, //
typeList: [
{
id: 0,
@ -465,7 +259,7 @@ export default {
dialogFormVisible: false,
form: {
//
userId: this.$store.state.userId,
userId: '',
userName: '', //
uniqueIdentification: '', //
documentType: '居民身份证', //
@ -503,7 +297,7 @@ export default {
disciplineName: '', //
professionalId: '', //
professionalName: '', //
userId: this.$store.state.userId
userId: this.$route.query.userId
},
archivesList: [],
rules: {
@ -585,7 +379,6 @@ export default {
schoolList: [],
cityList: [], //
provinceList: this.$store.state.provinceList, //
userId: this.$store.state.userId,
IDdisabled: false,
regionOption: [{
regionName: '职站',
@ -864,6 +657,18 @@ export default {
})
}
},
switchUser(val,row,index) {
this.$get(this.api.updateAccountAllEnable,{
id: row.userId,
isEnable: val
}).then(res => {
if(res.code == '200') {
this.$message.success(val ? '启用成功' : '禁用成功')
}else{
this.$message.success(res.message)
}
}).catch(res => {})
},
show(row,isShow){
let obj = {}
Object.assign(obj,{

@ -106,19 +106,17 @@
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="userId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="account" label="用户账号" align="center"></el-table-column>
<el-table-column prop="provinceName" label="省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="城市" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"></el-table-column>
<el-table-column prop="platformName" label="来源" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" width="150" align="center"></el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column>
<el-table-column prop="logInNumber" label="最近登录时间" align="center"></el-table-column>
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button>
<el-button type="text" @click="toDetail(scope.row)" v-auth>编辑</el-button>
<el-button v-if="scope.row.userId!==1" type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-switch v-if="scope.row.userId!==1" v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'" @change="switchOff($event,scope.row,scope.$index)" v-auth="'/user:启用'"></el-switch>
@ -317,20 +315,8 @@ export default {
this.page = val
this.getData()
},
permission(){
this.$router.push('/permission')
},
adduser(){
this.$store.commit("userData", { user_id : ''})
this.$router.push('/adduser')
},
edit(row){
this.$store.commit("userData", { user_id : row.userId})
this.$router.push('/adduser')
},
show(row){
this.$store.commit("userData", { user_id : row.userId})
this.$router.push('/adduser')
toDetail(row, detail){
this.$router.push(`/adduser?userId=${row.userId}${detail ? '&show=1' : ''}`)
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {

Loading…
Cancel
Save