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

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==",
"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": {
"version": "4.11.8",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",

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

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

@ -16,6 +16,7 @@
<el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button>
</template>
<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="saveSort">保存</el-button>
</template>
@ -39,7 +40,8 @@
</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 prop="name" label="资源名称">
</el-table-column>
@ -182,6 +184,25 @@
</div>
</el-card>
<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>
</template>
@ -198,6 +219,7 @@ export default {
},
id: this.$route.query.cid,
chapters: [],
multipleSelection: [],
sorting: false,
uploading: false,
uploadList: [],
@ -231,7 +253,13 @@ export default {
pdfSrc: "",
previewing: false,
showProgress: false,
progressPercent: 0
progressPercent: 0,
moveVisible: false,
sortList: [],
moveForm: {
id: '',
sort: ''
}
};
},
components: { pdf },
@ -257,6 +285,10 @@ export default {
});
},
//
handleSelectionChange(val) {
this.multipleSelection = val
},
goBack() {
if (this.previewing) {
this.closeIframe();
@ -376,6 +408,85 @@ export default {
sort() {
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() {
this.sorting = false;
},

@ -1,6 +1,6 @@
<template>
<div>
<div class="scroll">
<div class="scroll" v-loading="loading">
<div class="page">
<h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 基本信息</h6>
<div class="page-content">
@ -130,15 +130,15 @@
<div class="page-content">
<ul class="list">
<div class="line info imp">
<li>
<label>用户账号</label>
<el-input class="m-r-10" size="small" v-model="form.account" clearable disabled></el-input>
<el-button type="text" size="small" @click="openAccount">编辑</el-button>
<li style="width: 334px;margin-right: 90px">
<label>学号</label>
<el-input class="m-r-10" size="small" v-model="form.workNumber" clearable disabled></el-input>
</li>
<li>
<label>手机号</label>
<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>
</div>
<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-form ref="form" :model="form" label-width="60px">
<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 label="验证码">
<div class="flex">
@ -237,6 +237,7 @@ import util from '@/libs/util'
export default {
data() {
return {
loading: false,
form: {
name:'',
workNumber:'',
@ -352,7 +353,7 @@ export default {
}
},
mounted() {
this.getdata()
this.getData()
this.getProvince()
this.getSchoolData()
this.getSubject()
@ -362,15 +363,18 @@ export default {
...mapActions('user', [
'setAvatar','setUserName'
]),
getdata() {
this.$get(this.api.queryUserInfoDetails).then(res => {
let userInfo = res.result.hrUserInfo
let schoolId = userInfo.schoolId
this.form = Object.assign(userInfo, res.result.userAccountList[0])
this.form.schoolId = schoolId
this.form.accountId = userInfo.id
getData() {
this.loading = true
this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
const userInfo = result.hrUserInfo
const { userAccount } = result
userInfo.account = userAccount.account
userInfo.phone = userAccount.phone
userInfo.workNumber = userAccount.workNumber
this.form = userInfo
this.originAccount = this.form.account
this.archivesList = res.result.personalFileList
this.archivesList = result.personalFileList
this.loading = false
this.$nextTick(() => {
if(this.form.provinceId){
this.getCityData(1)
@ -538,6 +542,17 @@ export default {
bindPhone() {
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() {
this.passwordVisible = true
},
@ -816,6 +831,9 @@ export default {
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.m-r-10 {
margin-right: 10px;
}

@ -145,7 +145,8 @@
<el-table-column prop="lastLoginTime" 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)">查看</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>
</template>
</el-table-column>
@ -157,6 +158,7 @@
</template>
<script>
import * as md5 from 'blueimp-md5'
export default {
name: 'baseform',
data() {
@ -184,7 +186,11 @@ export default {
methods: {
getdata() {
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
}).catch((res) => {})
},
@ -204,7 +210,18 @@ export default {
},
show(row) {
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>

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

@ -83,7 +83,7 @@
</el-col>
<el-col :span="6">
<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-col>
</el-row>
@ -112,7 +112,7 @@
<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="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">
<template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button>
@ -206,7 +206,7 @@ export default {
},
{
value: 2,
label: '数据平台'
label: '数据前瞻'
},
],
page: 1,
@ -259,22 +259,22 @@ export default {
endTime: this.form.endTime,
roleId: this.form.accountRole,
searchContent: this.form.keyword,
page: this.page,
size: this.pageSize
pageNum: this.page,
pageSize: this.pageSize
}
this.loading = true
this.$get(this.api.queryUserInfoList,data).then(({ message }) => {
const { list } = message
list.map(e => {
this.$post(this.api.queryUserInfoList, data).then(({ page, total }) => {
page.map(e => {
//
this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => {
const platList = result.bindingPlatformAndUserList
// 1->0->
e.isEnable = platList.find(e => e.isEnable) ? 1 : 0
e.userIds = platList.map(e => e.userId) // userId
}).catch((res) => {})
})
this.userData = list
this.totals = message.totalCount
this.userData = page
this.totals = total
this.loading = false
}).catch(res => {
this.loading = false
@ -335,7 +335,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts,[row.userId]).then(res => {
this.$post(this.api.delUserAccounts, row.userIds).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})

Loading…
Cancel
Save