课程资源移动、用户登修改

dev_2022-04-07
yujialong 3 years ago
parent 78812bf013
commit a635295041
  1. 5
      package-lock.json
  2. 1
      package.json
  3. 16
      src/utils/api.js
  4. 115
      src/views/course/contentSettings.vue
  5. 50
      src/views/setting/info.vue
  6. 23
      src/views/user/AddUser.vue
  7. 16
      src/views/user/Info.vue
  8. 22
      src/views/user/User.vue

5
package-lock.json generated

@ -2164,6 +2164,11 @@
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true "dev": true
}, },
"blueimp-md5": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
},
"bn.js": { "bn.js": {
"version": "4.11.8", "version": "4.11.8",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",

@ -10,6 +10,7 @@
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"blueimp-md5": "^2.19.0",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",

@ -1,12 +1,12 @@
import Setting from "@/setting"; import Setting from "@/setting";
const host = Setting.apiBaseURL
const uploadURL = Setting.uploadURL const uploadURL = Setting.uploadURL
const host = 'http://39.108.250.202:9000/'
export default { export default {
logins: `users/users/user/login`, //登录 logins: `users/users/user/login`, //登录
verification: `${Setting.host}users/users/user/captcha`,// 验证码图片 verification: `${host}users/users/user/captcha`,// 验证码图片
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
@ -50,19 +50,21 @@ export default {
// 用户管理 // 用户管理
delUserAccounts: `users/users/userAccount/delUserAccounts`, delUserAccounts: `users/users/userAccount/delUserAccounts`,
queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`, queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`,
personalFile: `users/users/userAccount/personalFile`,
queryUserInfoList: `users/users/userAccount/queryUserInfoList`, queryUserInfoList: `users/users/userAccount/queryUserInfoList`,
resetPwd: `users/users/userAccount/resetPwd`, resetPwd: `users/users/userAccount/resetPwd`,
selectAccountDetail: `users/users/userAccount/selectAccountDetail`, selectAccountDetail: `users/users/userAccount/selectAccountDetail`,
selectUserSysBind: `users/users/userAccount/selectUserSysBind`, selectUserSysBind: `users/users/userAccount/selectUserSysBind`,
updatePersonCenter: `users/users/userAccount/updatePersonCenter`, updatePersonCenter: `users/users/userAccount/updatePersonCenter`,
updateUserAvatars: `${Setting.host}users/users/userAccount/updateUserAvatars`, updateUserAvatars: `${host}users/users/userAccount/updateUserAvatars`,
userInfo: `users/users/userAccount/userInfo`, userInfo: `users/users/userAccount/userInfo`,
// bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`, unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
// sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,
updateAccountEnable: `users/users/userAccount/updateAccountEnable`, updateAccountEnable: `users/users/userAccount/updateAccountEnable`,
updateAccountAllEnable: `users/users/userAccount/updateAccountAllEnable`, updateAccountAllEnable: `users/users/userAccount/updateAccountAllEnable`,
examinePassword: `users/users/userAccount/examinePassword`, examinePassword: `users/users/userAccount/examinePassword`,
viewUserDetailsforNakadai: `users/users/userAccount/viewUserDetailsforNakadai`,
oneClickEnableVerification: `users/users/userAccount/oneClickEnableVerification`,
queryOrder: `liuwanr/order/queryOrder`, //查询订单 queryOrder: `liuwanr/order/queryOrder`, //查询订单
queryOrderDetails: `liuwanr/order/queryOrderDetails`, //查询订单详情 queryOrderDetails: `liuwanr/order/queryOrderDetails`, //查询订单详情
@ -227,8 +229,8 @@ export default {
saveStaff: `nakadai/backstageStaff/saveStaff`, saveStaff: `nakadai/backstageStaff/saveStaff`,
staffDetail: `nakadai/backstageStaff/staffDetail`, staffDetail: `nakadai/backstageStaff/staffDetail`,
staffList: `nakadai/backstageStaff/staffList`, staffList: `nakadai/backstageStaff/staffList`,
importStaff: `${Setting.host}nakadai/backstageStaff/importStaff`, importStaff: `${host}nakadai/backstageStaff/importStaff`,
exportFailure: `${Setting.host}nakadai/backstageStaff/exportFailure`, exportFailure: `${host}nakadai/backstageStaff/exportFailure`,
// 角色管理 // 角色管理
batchRemove: `users/role/batchRemove`, //批量删除角色 batchRemove: `users/role/batchRemove`, //批量删除角色

@ -16,6 +16,7 @@
<el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button> <el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button type="primary" round @click="move">批量移动</el-button>
<el-button type="primary" round @click="cancelSort">取消</el-button> <el-button type="primary" round @click="cancelSort">取消</el-button>
<el-button type="primary" round @click="saveSort">保存</el-button> <el-button type="primary" round @click="saveSort">保存</el-button>
</template> </template>
@ -39,7 +40,8 @@
</div> </div>
</div> </div>
<el-table :data="chapter.subsectionList" class="table" stripe header-align="center"> <el-table :data="chapter.subsectionList" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column v-if="sorting" type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="资源名称"> <el-table-column prop="name" label="资源名称">
</el-table-column> </el-table-column>
@ -182,6 +184,25 @@
</div> </div>
</el-card> </el-card>
<div class="player-download" id="playerDownload"></div> <div class="player-download" id="playerDownload"></div>
<el-dialog title="资源移动" :visible.sync="moveVisible" :close-on-click-modal="false" width="330px">
<el-form>
<el-form-item label="目标章节">
<el-select v-model="moveForm.id" placeholder="请选择目标章节" @change="chapterChange">
<el-option v-for="(item, i) in chapters" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目标排序">
<el-select v-model="moveForm.sort" placeholder="请选择目标排序">
<el-option v-for="(item, i) in sortList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="moveVisible = false">取消</el-button>
<el-button type="primary" @click="moveSubmit">确定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -198,6 +219,7 @@ export default {
}, },
id: this.$route.query.cid, id: this.$route.query.cid,
chapters: [], chapters: [],
multipleSelection: [],
sorting: false, sorting: false,
uploading: false, uploading: false,
uploadList: [], uploadList: [],
@ -231,7 +253,13 @@ export default {
pdfSrc: "", pdfSrc: "",
previewing: false, previewing: false,
showProgress: false, showProgress: false,
progressPercent: 0 progressPercent: 0,
moveVisible: false,
sortList: [],
moveForm: {
id: '',
sort: ''
}
}; };
}, },
components: { pdf }, components: { pdf },
@ -257,6 +285,10 @@ export default {
}); });
}, },
//
handleSelectionChange(val) {
this.multipleSelection = val
},
goBack() { goBack() {
if (this.previewing) { if (this.previewing) {
this.closeIframe(); this.closeIframe();
@ -376,6 +408,85 @@ export default {
sort() { sort() {
this.sorting = true; this.sorting = true;
}, },
//
move() {
if (this.multipleSelection.length) {
this.moveForm = {
id: '',
sort: ''
}
this.sortList = []
this.moveVisible = true
} else {
this.$message.warning('请选择小节!')
}
},
//
chapterChange(id) {
const list = []
//
this.chapters.find(e => e.id === id).subsectionList.map((e, i) => {
list.push({
id: i,
name: i+1
})
})
//
this.sortList = [
{
id: 'bottom',
name: '置末'
},
...list,
{
id: 'top',
name: '置顶'
}
]
},
//
moveSubmit() {
const { moveForm } = this
let { id, sort } = moveForm
if (!id) return this.$message.warning('请选择目标章节')
if (sort === '') return this.$message.warning('请选择目标排序')
if (typeof sort === 'string') sort = sort === 'top' ? 0 : this.sortList.length - 2 //
const list = this.multipleSelection
const promises = []
//
list.map(e => {
promises.push(new Promise((resolve, reject) => {
this.$put(this.api.editSubsection, {
id: e.id,
cid: this.id,
chapterId: id,
sort
}).then(res => {
resolve()
}).catch(err => {
reject()
})
}))
})
// sort
Promise.all(promises).then(() => {
this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`).then(({ chapterList }) => {
chapterList.forEach((n, k) => {
n.sort = k + 1
n.subsectionList.forEach((j, i) => {
j.sort = i + 1
})
})
this.$post(this.api.reorder, {
chapterVOList: chapterList
}).then(res => {
this.$message.success('移动成功!')
this.moveVisible = false
this.getData()
}).catch(res => {})
}).catch(err => {})
})
},
cancelSort() { cancelSort() {
this.sorting = false; this.sorting = false;
}, },

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div class="scroll"> <div class="scroll" v-loading="loading">
<div class="page"> <div class="page">
<h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 基本信息</h6> <h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 基本信息</h6>
<div class="page-content"> <div class="page-content">
@ -130,15 +130,15 @@
<div class="page-content"> <div class="page-content">
<ul class="list"> <ul class="list">
<div class="line info imp"> <div class="line info imp">
<li> <li style="width: 334px;margin-right: 90px">
<label>用户账号</label> <label>学号</label>
<el-input class="m-r-10" size="small" v-model="form.account" clearable disabled></el-input> <el-input class="m-r-10" size="small" v-model="form.workNumber" clearable disabled></el-input>
<el-button type="text" size="small" @click="openAccount">编辑</el-button>
</li> </li>
<li> <li>
<label>手机号</label> <label>手机号</label>
<el-input class="m-r-10" type="text" size="small" v-model="form.phone" disabled></el-input> <el-input class="m-r-10" type="text" size="small" v-model="form.phone" disabled></el-input>
<el-button type="text" size="small" @click="bindPhone">更换</el-button> <el-button type="text" size="small" @click="bindPhone">{{ form.phone ? '更换' : '绑定' }}</el-button>
<el-button v-if="form.phone" type="text" size="small" @click="unbind">解绑</el-button>
</li> </li>
</div> </div>
<div class="line info imp"> <div class="line info imp">
@ -184,7 +184,7 @@
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" @close="closePhone" width="30%"> <el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" @close="closePhone" width="30%">
<el-form ref="form" :model="form" label-width="60px"> <el-form ref="form" :model="form" label-width="60px">
<el-form-item label="手机号"> <el-form-item label="手机号">
<el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> <el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <el-form-item label="验证码">
<div class="flex"> <div class="flex">
@ -237,6 +237,7 @@ import util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
loading: false,
form: { form: {
name:'', name:'',
workNumber:'', workNumber:'',
@ -352,7 +353,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getdata() this.getData()
this.getProvince() this.getProvince()
this.getSchoolData() this.getSchoolData()
this.getSubject() this.getSubject()
@ -362,15 +363,18 @@ export default {
...mapActions('user', [ ...mapActions('user', [
'setAvatar','setUserName' 'setAvatar','setUserName'
]), ]),
getdata() { getData() {
this.$get(this.api.queryUserInfoDetails).then(res => { this.loading = true
let userInfo = res.result.hrUserInfo this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
let schoolId = userInfo.schoolId const userInfo = result.hrUserInfo
this.form = Object.assign(userInfo, res.result.userAccountList[0]) const { userAccount } = result
this.form.schoolId = schoolId userInfo.account = userAccount.account
this.form.accountId = userInfo.id userInfo.phone = userAccount.phone
userInfo.workNumber = userAccount.workNumber
this.form = userInfo
this.originAccount = this.form.account this.originAccount = this.form.account
this.archivesList = res.result.personalFileList this.archivesList = result.personalFileList
this.loading = false
this.$nextTick(() => { this.$nextTick(() => {
if(this.form.provinceId){ if(this.form.provinceId){
this.getCityData(1) this.getCityData(1)
@ -538,6 +542,17 @@ export default {
bindPhone() { bindPhone() {
this.phoneVisible = true this.phoneVisible = true
}, },
//
unbind() {
this.$confirm('确定要解绑该手机号吗?', '提示', {
type: 'warning'
}).then(() => {
this.$get(this.api.unbindMobilePhone).then(res => {
this.$message.success('解绑成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
bindPassword() { bindPassword() {
this.passwordVisible = true this.passwordVisible = true
}, },
@ -816,6 +831,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.flex {
display: flex;
}
.m-r-10 { .m-r-10 {
margin-right: 10px; margin-right: 10px;
} }

@ -145,7 +145,8 @@
<el-table-column prop="lastLoginTime" label="上一次的登录时间" align="center"></el-table-column> <el-table-column prop="lastLoginTime" label="上一次的登录时间" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row,true)">查看</el-button> <el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="del(scope.row)">删除</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> <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> </template>
</el-table-column> </el-table-column>
@ -157,6 +158,7 @@
</template> </template>
<script> <script>
import * as md5 from 'blueimp-md5'
export default { export default {
name: 'baseform', name: 'baseform',
data() { data() {
@ -184,7 +186,11 @@ export default {
methods: { methods: {
getdata() { getdata() {
this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => { this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => {
this.form = result.hrUserInfo const info = result.hrUserInfo
info.phone = result.userAccount.phone
// MD51313
if (info.phone) info.uniqueIdentification = md5(info.phone).slice(0, 13)
this.form = info
this.platformList = result.bindingPlatformAndUserList this.platformList = result.bindingPlatformAndUserList
}).catch((res) => {}) }).catch((res) => {})
}, },
@ -204,7 +210,18 @@ export default {
}, },
show(row) { show(row) {
this.$router.push(`/info?userId=${row.userId}&platformName=${row.platformName}`) this.$router.push(`/info?userId=${row.userId}&platformName=${row.platformName}`)
} },
//
del(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, [row.userId]).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
} }
}; };
</script> </script>

@ -135,8 +135,6 @@
</template> </template>
<script> <script>
import { mapState,mapActions } from 'vuex'
import util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
@ -212,28 +210,14 @@ export default {
loading: false loading: false
}; };
}, },
watch: {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)
},
deep:true
}
},
mounted() { mounted() {
this.getdata() this.getdata()
}, },
methods: { methods: {
...mapActions('user', [
'setAvatar','setUserName'
]),
getdata() { getdata() {
this.loading = true this.loading = true
this.$get(this.api.personalFile, { userId: this.userId }).then(({ result }) => { this.$get(this.api.personalFile, { userId: this.userId }).then(({ result }) => {
this.form = result this.form = result
const form = this.form
const list = result.nakadaiPersonalFileList const list = result.nakadaiPersonalFileList
this.archivesList = list.length ? list : [this.archivesForm] this.archivesList = list.length ? list : [this.archivesForm]
this.loading = false this.loading = false

@ -83,7 +83,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="支持账号,手机号,姓名,学校查询" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input> <el-input placeholder="支持手机号,姓名" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -112,7 +112,7 @@
<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="createTime" label="创建时间" width="150" 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 prop="logInNumber" label="最近登录时间" align="center"></el-table-column> <el-table-column prop="lastLoginTime" label="最近登录时间" align="center"></el-table-column>
<el-table-column label="操作" width="300" align="center"> <el-table-column label="操作" width="300" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button> <el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button>
@ -206,7 +206,7 @@ export default {
}, },
{ {
value: 2, value: 2,
label: '数据平台' label: '数据前瞻'
}, },
], ],
page: 1, page: 1,
@ -259,22 +259,22 @@ export default {
endTime: this.form.endTime, endTime: this.form.endTime,
roleId: this.form.accountRole, roleId: this.form.accountRole,
searchContent: this.form.keyword, searchContent: this.form.keyword,
page: this.page, pageNum: this.page,
size: this.pageSize pageSize: this.pageSize
} }
this.loading = true this.loading = true
this.$get(this.api.queryUserInfoList,data).then(({ message }) => { this.$post(this.api.queryUserInfoList, data).then(({ page, total }) => {
const { list } = message page.map(e => {
list.map(e => {
// //
this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => { this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => {
const platList = result.bindingPlatformAndUserList const platList = result.bindingPlatformAndUserList
// 1->0-> // 1->0->
e.isEnable = platList.find(e => e.isEnable) ? 1 : 0 e.isEnable = platList.find(e => e.isEnable) ? 1 : 0
e.userIds = platList.map(e => e.userId) // userId
}).catch((res) => {}) }).catch((res) => {})
}) })
this.userData = list this.userData = page
this.totals = message.totalCount this.totals = total
this.loading = false this.loading = false
}).catch(res => { }).catch(res => {
this.loading = false this.loading = false
@ -335,7 +335,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(this.api.delUserAccounts,[row.userId]).then(res => { this.$post(this.api.delUserAccounts, row.userIds).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})

Loading…
Cancel
Save