后台账号联调及bug修复

dev_2022-03-03
yujialong 3 years ago
parent f4850af50f
commit e312e8e4ba
  1. 3
      src/assets/css/main.css
  2. 1
      src/utils/api.js
  3. 2
      src/views/course/contentSettings.vue
  4. 22
      src/views/data/Framework.vue
  5. 1
      src/views/data/Introduce.vue
  6. 11
      src/views/data/Product.vue
  7. 9
      src/views/serve/Configure.vue
  8. 39
      src/views/system/addLog.vue
  9. 22
      src/views/system/manageLog.vue
  10. 2
      src/views/system/role.vue
  11. 664
      src/views/system/staff.vue

@ -315,9 +315,6 @@ li {
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
} }
#app .el-select{
display: unset;
}
/*flex*/ /*flex*/
.flex-center{ .flex-center{

@ -238,4 +238,5 @@ export default {
logManagementList: `nakadai/log/logManagementList`, logManagementList: `nakadai/log/logManagementList`,
platformLogList: `nakadai/log/platformLogList`, platformLogList: `nakadai/log/platformLogList`,
listUpdate: `nakadai/log/update`, listUpdate: `nakadai/log/update`,
checkRepeat: `${host1}/nakadai/log/checkRepeat`,
}; };

@ -13,7 +13,7 @@
<div class="btns"> <div class="btns">
<template v-if="!sorting"> <template v-if="!sorting">
<el-button type="primary" round @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button> <el-button type="primary" round @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button>
<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="cancelSort">取消</el-button> <el-button type="primary" round @click="cancelSort">取消</el-button>

@ -5,7 +5,7 @@
<div class="plus"> <div class="plus">
<i class="el-icon-circle-plus-outline" @click.stop="addType(0)"></i> <i class="el-icon-circle-plus-outline" @click.stop="addType(0)"></i>
</div> </div>
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick"> <el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" v-loading="loadingType" @current-change="typeClick">
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span :title="node.label">{{ node.label }}</span> <span :title="node.label">{{ node.label }}</span>
<span class="actions"> <span class="actions">
@ -65,7 +65,7 @@
<el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false"> <el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;"> <el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<div style="overflow:auto;height: 558px;width:330px;padding:15px;background:#fff" ref="typeTreeWrap" @scroll="loadType"> <div style="overflow:auto;height: 558px;width:330px;padding:15px;background:#fff" ref="typeTreeWrap" @scroll="loadType">
<el-tree <el-tree v-loading="importLoading"
ref="typeTree" ref="typeTree"
:data="importTypeList" :data="importTypeList"
node-key="id" node-key="id"
@ -155,6 +155,7 @@ import { Loading } from 'element-ui'
export default { export default {
data() { data() {
return { return {
loadingType: false,
typeList: [], typeList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -177,7 +178,7 @@ export default {
pageSize: 10, pageSize: 10,
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
importLoading: null, importLoading: false,
tablePromises: [], tablePromises: [],
importTypeList: [], importTypeList: [],
fieldData: [], fieldData: [],
@ -218,6 +219,7 @@ export default {
methods: { methods: {
// //
getType(){ getType(){
this.loadingType = true
this.$post(this.api.getTableByClassification).then(res => { this.$post(this.api.getTableByClassification).then(res => {
// , // ,
function handleId(data,level = 0){ function handleId(data,level = 0){
@ -232,6 +234,7 @@ export default {
} }
handleId(res) handleId(res)
this.typeList = res this.typeList = res
this.loadingType = false
// addEd // addEd
if (!this.addEd) { if (!this.addEd) {
if(res[0].children.length){ // if(res[0].children.length){ //
@ -520,9 +523,8 @@ export default {
}, },
// //
batchImport(){ batchImport(){
this.importLoading = Loading.service({ this.importLoading = true
background: 'rgba(255, 255, 255, .5)' this.importVisible = true
})
// //
this.$post(this.api.originalList).then(res => { this.$post(this.api.originalList).then(res => {
// idlabelnamekeylabelnamekey // idlabelnamekeylabelnamekey
@ -567,14 +569,13 @@ export default {
Promise.all(this.tablePromises).then(_ => { Promise.all(this.tablePromises).then(_ => {
handleDisabled(res) handleDisabled(res)
this.importTypeList = res this.importTypeList = res
this.importLoading.close() this.importLoading = false
this.importVisible = true
}) })
}).catch(res => { }).catch(res => {
this.importLoading.close() this.importLoading = false
}) })
}).catch(res => { }).catch(res => {
this.importLoading.close() this.importLoading = false
}) })
}, },
// //
@ -738,6 +739,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap { .wrap {
display: flex; display: flex;
height: calc(100vh - 223px);
padding: 0 24px; padding: 0 24px;
.side { .side {
width: 300px; width: 300px;

@ -212,6 +212,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap { .wrap {
display: flex; display: flex;
height: calc(100vh - 223px);
padding: 0 24px; padding: 0 24px;
.side { .side {
width: 300px; width: 300px;

@ -52,7 +52,7 @@
</div> </div>
<el-dialog :title="isDetail ? '查看产品' : (id ? '编辑产品' : '新增产品')" :visible.sync="productVisible" width="600px" center @close="closeProduct" class="dialog" :close-on-click-modal="false"> <el-dialog :title="isDetail ? '查看产品' : (id ? '编辑产品' : '新增产品')" :visible.sync="productVisible" width="600px" center @close="closeProduct" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="98px" :disabled="isDetail"> <el-form ref="form" label-width="98px" :disabled="isDetail" v-loading="loading">
<el-form-item label="数据产品名称"> <el-form-item label="数据产品名称">
<el-input v-model="productName" placeholder="请输入数据产品名称"></el-input> <el-input v-model="productName" placeholder="请输入数据产品名称"></el-input>
</el-form-item> </el-form-item>
@ -166,6 +166,7 @@ export default {
productName: '', productName: '',
market: '', market: '',
typeList: [], typeList: [],
loading: false,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
@ -263,6 +264,7 @@ export default {
}, },
// //
getType(queryDetail){ getType(queryDetail){
this.loading = true
this.productVisible = true this.productVisible = true
this.$post(this.api.getTableByClassification).then(res => { this.$post(this.api.getTableByClassification).then(res => {
const that = this const that = this
@ -297,7 +299,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.typeList = res this.typeList = res
queryDetail && this.getDetail() queryDetail ? this.getDetail() : (this.loading = false)
},500) },500)
this.importVisible = true this.importVisible = true
}).catch(res => {}) }).catch(res => {})
@ -371,7 +373,10 @@ export default {
this.market = data.market this.market = data.market
this.checkedIds = data.tableId.split(',') this.checkedIds = data.tableId.split(',')
this.$refs.type.setCheckedKeys(this.checkedIds) // this.$refs.type.setCheckedKeys(this.checkedIds) //
}).catch(res => {}) this.loading = false
}).catch(res => {
this.loading = false
})
}, },
// //
add(){ add(){

@ -66,7 +66,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="系统后台" align="center"> <el-table-column prop="payamount" label="系统后台" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toBackstage(scope.row)" v-auth="'/configure:系统后台进入'">进入</el-button> <el-button type="text" @click="toBackstage(scope.row)" v-if="scope.row.systemId !== '11'" v-auth="'/configure:系统后台进入'">进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="项目系统" align="center"> <el-table-column prop="payamount" label="项目系统" align="center">
@ -79,13 +79,6 @@
<el-button type="text" @click="getIntoJudgement(scope.row)" v-auth="'/configure:判分系统进入'">进入</el-button> <el-button type="text" @click="getIntoJudgement(scope.row)" v-auth="'/configure:判分系统进入'">进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
<!--
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
</template>
</el-table-column>
-->
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="handleCurrentChange" <el-pagination background @current-change="handleCurrentChange"

@ -16,8 +16,8 @@
<el-card class="page" shadow="hover"> <el-card class="page" shadow="hover">
<el-form class="form" ref="form" label-width="120px" center> <el-form class="form" ref="form" label-width="120px" center>
<el-form-item label="版本标题"> <el-form-item class="required" label="版本标题">
<el-input placeholder="请输入版本标题" v-model="form.versionName" maxlength="30" style="width: 400px"></el-input> <el-input placeholder="请输入版本标题" v-model="form.versionName" maxlength="30" style="width: 400px" @change="nameChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="封面图片"> <el-form-item label="封面图片">
<el-upload <el-upload
@ -40,7 +40,7 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="更新内容"> <el-form-item class="required" label="更新内容">
<ul class="contents"> <ul class="contents">
<li v-for="(item, i) in form.logContents" :key="i"> <li v-for="(item, i) in form.logContents" :key="i">
<div class="action"> <div class="action">
@ -72,6 +72,7 @@
</template> </template>
<script> <script>
import Setting from '@/setting'
export default { export default {
data() { data() {
return { return {
@ -95,6 +96,8 @@ export default {
name: '优化' name: '优化'
} }
], ],
nameRepeat: false,
originName: '',
form: { form: {
versionName: '', versionName: '',
coverUrl: '', coverUrl: '',
@ -115,11 +118,26 @@ export default {
getData() { getData() {
this.$get(`${this.api.logGet}?logId=${this.id}`).then(res => { this.$get(`${this.api.logGet}?logId=${this.id}`).then(res => {
const { log } = res const { log } = res
this.form.versionName = log.versionName this.form = {
this.form.coverUrl = log.coverUrl versionName: log.versionName,
this.form.logContents = log.logContents.length ? log.logContents : [JSON.parse(JSON.stringify(this.originContent))] coverUrl: log.coverUrl,
logContents: log.logContents.length ? log.logContents : [JSON.parse(JSON.stringify(this.originContent))]
}
this.originName = log.versionName
}).catch(res => {}) }).catch(res => {})
}, },
//
nameChange(val) {
if (this.originName === val) {
this.nameRepeat = false
} else {
this.$get(`${this.api.checkRepeat}?platformId=${this.platformId}&versionName=${val}`).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}
},
// //
add() { add() {
this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent))) this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
@ -156,6 +174,7 @@ export default {
const { versionName, logContents } = this.form const { versionName, logContents } = this.form
const id = this.id const id = this.id
if (!versionName) return this.$message.error('请输入版本标题') if (!versionName) return this.$message.error('请输入版本标题')
if (this.nameRepeat) return this.$message.error('版本名称已存在!')
if (!logContents.length || !logContents.find(e => e.type !== '' && e.content)) return this.$message.error('请输入更新内容') if (!logContents.length || !logContents.find(e => e.type !== '' && e.content)) return this.$message.error('请输入更新内容')
this.submiting = true this.submiting = true
const data = { const data = {
@ -192,6 +211,14 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
min-height: calc(100vh - 310px); min-height: calc(100vh - 310px);
/deep/.required {
label:before {
content: '*';
margin-right: 5px;
vertical-align: middle;
color: #f00;
}
}
} }
$avatar-width: 104px; $avatar-width: 104px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {

@ -186,6 +186,7 @@ export default {
} }
.tool { .tool {
padding-bottom: 20px; padding-bottom: 20px;
margin-bottom: 0;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
} }
.filters { .filters {
@ -198,13 +199,17 @@ export default {
} }
/deep/.timeline { /deep/.timeline {
margin-left: 20%; margin-left: 20%;
.el-timeline-item__node--normal {
top: 30px;
}
.el-timeline-item__wrapper { .el-timeline-item__wrapper {
padding-left: 40px; top: 15px;
padding-left: 40px;
} }
.sign { .sign {
position: relative; position: relative;
display: inline-block; display: inline-block;
margin: -11px 0 0 -22%; margin-left: -22%;
font-size: 14px; font-size: 14px;
color: #9076FF; color: #9076FF;
} }
@ -217,10 +222,11 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin: -22px 0 20px; padding-bottom: 10px;
margin: -19px 0 20px;
font-size: 18px; font-size: 18px;
color: #9076FF; color: #9076FF;
cursor: pointer; border-bottom: 1px dashed #bfbfbf;
} }
.action { .action {
margin-left: 15px; margin-left: 15px;
@ -242,25 +248,27 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
font-size: 14px; font-size: 15px;
color: #9984f1; font-weight: 600;
img { img {
width: 20px; width: 20px;
margin-right: 5px; margin-right: 5px;
} }
} }
.val { .val {
font-size: 15px; font-size: 14px;
line-height: 1.8; line-height: 1.8;
white-space: pre-wrap; white-space: pre-wrap;
p { p {
position: relative; position: relative;
color: #6a6a6a;
&:before { &:before {
content: ''; content: '';
display: inline-block; display: inline-block;
width: 5px; width: 5px;
height: 5px; height: 5px;
margin: 0 10px 0 5px; margin: 0 10px 0 5px;
vertical-align: middle;
border-radius: 20px; border-radius: 20px;
background-color: #c5b8ff; background-color: #c5b8ff;
} }

@ -246,7 +246,7 @@ export default {
let data = { let data = {
...this.form, ...this.form,
permissionId, permissionId,
platformId:1, platformId: Setting.platformId,
}; };
if (this.form.id) { if (this.form.id) {
this.$post(this.api.saveOrUpdate, data).then(res => { this.$post(this.api.saveOrUpdate, data).then(res => {

@ -4,20 +4,20 @@
<el-col :span="4"> <el-col :span="4">
<div class="page"> <div class="page">
<div class="m-b-20"> <div class="m-b-20">
<h6 class="p-title">学生</h6> <h6 class="p-title">后台员工账号</h6>
<el-radio-group v-model="studentType" @change="changeStudentType"> <el-radio-group v-model="studentType" @change="initData">
<div class="m-b-20"> <div class="m-b-20">
<el-radio :label="1">所有学生</el-radio> <el-radio :label="1">所有员工</el-radio>
</div> </div>
<div> <div>
<el-radio :label="2">未加入班级的学生</el-radio> <el-radio :label="2">未加入部门的员工</el-radio>
</div> </div>
</el-radio-group> </el-radio-group>
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
<div> <div>
<div class="flex-between"> <div class="flex-between">
<h6 class="p-title" style="margin-bottom: 0">学生组织架构</h6> <h6 class="p-title" style="margin-bottom: 0">组织架构</h6>
<el-button type="text" @click="addOrg">添加</el-button> <el-button type="text" @click="addOrg">添加</el-button>
</div> </div>
@ -89,42 +89,31 @@
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
<el-input style="width: 250px;" placeholder="请输入学生姓名/学号/账号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input> <el-input style="width: 250px;" placeholder="请输入员工姓名/手机号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" @click="addStudent">新增学生</el-button> <el-button type="primary" @click="addStaff">新增员工</el-button>
<el-button type="primary" @click="batchImport">批量导入</el-button> <el-button type="primary" @click="batchImport">批量导入</el-button>
<el-button type="primary" @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="accountId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center" min-width="100"></el-table-column> <el-table-column prop="userName" label="员工姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center" min-width="100"></el-table-column>
<el-table-column prop="className" label="班级" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column> <el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="countries" label="账号角色" align="center" width="100"> <el-table-column prop="className" label="手机号" align="center" width="120"></el-table-column>
<template slot-scope="scope">学生</template> <el-table-column prop="loginNumber" label="所在部门" align="center" min-width="100"></el-table-column>
<el-table-column prop="countries" label="授权角色" align="center" width="100">
<template slot-scope="scope">员工</template>
</el-table-column> </el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center" width="100"></el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center" width="120"></el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="isRemove" type="text" @click="removeStudent(scope.row)">移除</el-button> <el-button type="text" @click="editStaff(scope.row,true)">查看</el-button>
<el-button type="text" @click="editStudent(scope.row,true)">查看</el-button> <el-button type="text" @click="editStaff(scope.row,false)">编辑</el-button>
<el-button type="text" @click="editStudent(scope.row,false)">编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button> <el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="delStaff(scope.row)">删除</el-button>
<el-switch
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
style="margin: 0 5px"
@change="switchOff(scope.row)"
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -132,84 +121,48 @@
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div> </div>
<el-dialog <el-dialog :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '员工'" :visible.sync="staffVisible" width="580px" class="dialog" :close-on-click-modal="false">
class="dialog" <el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'>
width="60%" <el-form-item prop="workNumber" label="工号">
:title="isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" <el-input v-model.trim="form.workNumber" placeholder="请输入工号"></el-input>
:visible.sync="studentVisible" </el-form-item>
:close-on-click-modal="false" <el-form-item prop="userName" label="姓名">
@close="closeStudent" <el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
> </el-form-item>
<el-form ref="form" :model="form" :rules="rules" :disabled="isDetail" label-width="100px"> <el-form-item prop="account" label="账号">
<el-row :gutter="20"> <el-input v-model.trim="form.account" placeholder="请输入账号"></el-input>
<el-col :span="12"> </el-form-item>
<el-form-item prop="workNumber" label="学生学号"> <el-form-item prop="phone" label="手机号">
<el-input v-model="form.workNumber" placeholder="学生学号"></el-input> <el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11" @blur="phoneChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="学生姓名"> <el-form-item prop="email" label="邮箱">
<el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input> <el-input v-model.trim="form.email" placeholder="请输入邮箱" @blur="emailChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="roleId" label="账号角色"> <el-form-item prop="roleValue" label="授权角色">
学生 <el-select v-model="form.roleValue" @change="roleChange" @remove-tag="roleRemove" multiple style="width: 100%;">
</el-form-item> <template v-for="item in roleList">
<el-form-item prop="account" label="学生账号"> <!-- 不显示超管 -->
<el-input v-model="form.account" placeholder="请输入学生账号"></el-input> <el-option
</el-form-item> v-if="item.roleName !== '超级管理员'"
:key="item.id"
<el-form-item prop="phone" label="手机号"> :label="item.roleName"
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11" @blur="phoneChange"></el-input> :value="item.id">
</el-form-item> </el-option>
<el-form-item prop="email" label="邮箱"> </template>
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码" @blur="emailChange"></el-input> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="uniqueIdentification" label="唯一标识"> <el-form-item v-for="(item, i) in form.roleAndDeptList" :key="i" :label="`${item.roleName}所在部门`">
<el-input disabled v-model="form.uniqueIdentification"></el-input> <el-cascader
</el-form-item> v-model="item.cascaderValue"
</el-col> :options="orgList"
<el-col :span="10"> :props="casProps"
<el-form-item prop="classId" label="所在班级"> style="width: 100%"
<el-input ></el-cascader>
placeholder="输入关键字进行过滤" </el-form-item>
v-model="filterText"
style="margin-bottom: 10px"
>
</el-input>
<div style="height: 300px; max-height: 300px; border: 1px solid #DCDFE6; border-radius: 4px; padding: 10px 10px 10px 0px; overflow: auto">
<org-tree
v-if="showTree && treeVisible"
ref="classTree"
show-checkbox
node-key="id"
highlight-current
default-expand-all
lazy
:load="loadClassTree"
:default-checked-keys="defaultCheckedKeys"
:filter-node-method="filterNode"
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span>
<el-button
v-if="node.level < 3"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => addOrg(node, data)">
</el-button>
</span>
</span>
</org-tree>
</div>
<p style="color: #C0C4CC;">提示需创建班级后才可以勾选</p>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button type="primary" :disabled="disableds" @click="saveData(0)">保存</el-button> <el-button @click="closeStudent">取消</el-button>
<el-button v-if="isAdd" type="primary" :disabled="disableds" @click="saveData(1)">保存并继续添加</el-button> <el-button type="primary" @click="submitStaff">确定</el-button>
<el-button size="small" @click="closeStudent">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -268,14 +221,14 @@ export default {
}; };
var workNumberPass = (rule, value, callback) => { var workNumberPass = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('请输入学生学号')); callback(new Error('请输入员工学号'));
} else { } else {
var pattern = /^[A-Za-z0-9]*$/; var pattern = /^[A-Za-z0-9]*$/;
if(pattern.test(value)){ if(pattern.test(value)){
this.worknumberChange(); this.worknumberChange();
callback(); callback();
}else{ }else{
callback(new Error('请输入正确学生学号格式')); callback(new Error('请输入正确员工学号格式'));
} }
} }
}; };
@ -283,13 +236,8 @@ export default {
return { return {
orgList: [], orgList: [],
orgListDia: [], orgListDia: [],
isRemove: false, // studentType: 1, //:(1. 2.)
currentClassId: '', // id orgVisible: false, //
studentType: 1, //:(1. 2.)
architectureId: '', // id
orgLevel: '', // (1. 2. 3.)
orgVisible: false, //
labelName: "部门名称", //
orgForm: { orgForm: {
id: '', id: '',
organizationName: '' organizationName: ''
@ -299,20 +247,22 @@ export default {
checkStrictly: true, checkStrictly: true,
label: "organizationName", label: "organizationName",
value: "id" value: "id"
}, // },
treeVisible: true, treeVisible: true,
treeNode: {}, treeNode: {},
treeResolve: [], treeResolve: [],
isDetail: false, isDetail: false,
keyWord: '', keyWord: '',
roleList: [],
form: { form: {
userName: '', accountId: '',
phone: '', userName: '',
uniqueIdentification: '', phone: '',
workNumber: '', roleList: [],
email: '', uniqueIdentification: '',
account: '', workNumber: '',
classId: "" email: '',
account: ''
}, },
rules: { rules: {
organizationName: [ organizationName: [
@ -320,27 +270,14 @@ export default {
], ],
account: [ account: [
{ required: true,validator: accountPass, trigger: 'blur' } { required: true,validator: accountPass, trigger: 'blur' }
// { required: true, message: "", trigger: "blur" },
// {
// pattern: /^[A-Za-z0-9]*$/,
// message: "",
// trigger: "blur"
// }
], ],
userName: [ userName: [
{ required: true, message: "请输入学生姓名", trigger: "blur" } { required: true, message: "请输入姓名", trigger: "blur" }
], ],
workNumber: [ workNumber: [
{ required: true,validator: workNumberPass, trigger: 'blur' } { required: true,validator: workNumberPass, trigger: 'blur' }
// { required: true, message: "", trigger: "blur" },
// {
// pattern: /^[A-Za-z0-9]*$/,
// message: "",
// trigger: "blur"
// }
], ],
phone: [ phone: [
// { required: true, message: '', trigger: 'blur' },
{ {
pattern: /^1[3456789]\d{9}$/, pattern: /^1[3456789]\d{9}$/,
message: "请输入正确的手机号", message: "请输入正确的手机号",
@ -348,7 +285,6 @@ export default {
} }
], ],
email: [ email: [
// { required: true, message: '', trigger: 'blur' },
{ {
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
message: "请输入正确的邮箱", message: "请输入正确的邮箱",
@ -362,15 +298,20 @@ export default {
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
isAdd: true, staffVisible: false,
studentVisible: false,
accountReapeat: false, accountReapeat: false,
originAccount: '',
workNumberReapeat: false, workNumberReapeat: false,
originWorkNumber: '',
phoneRepeat: false, phoneRepeat: false,
emailRepeat: false, emailRepeat: false,
showTree: true, //
defaultCheckedKeys: [], defaultCheckedKeys: [],
filterText: '', // casProps: {
multiple: true,
checkStrictly: true,
label: 'organizationName',
value: 'id'
},
importVisible: false, importVisible: false,
uploadList: [], uploadList: [],
@ -386,21 +327,12 @@ export default {
watch: { watch: {
keyWord: function(val) { keyWord: function(val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(this.getStaff, 500);
if (this.studentType) {
this.initData();
} else {
this.getOrgStudentData();
}
}, 500);
},
filterText(val) {
this.$refs.classTree.filter(val);
} }
}, },
mounted() { mounted() {
this.getOrg() this.getOrg()
this.getRole()
}, },
methods: { methods: {
// //
@ -409,6 +341,7 @@ export default {
const list = res.treeList const list = res.treeList
this.orgList = list this.orgList = list
this.handleOrgId(list) this.handleOrgId(list)
this.getStaff()
}, },
// id // id
handleOrgId(list, ids) { handleOrgId(list, ids) {
@ -482,7 +415,6 @@ export default {
this.orgForm.parentId = cas[len - 1] this.orgForm.parentId = cas[len - 1]
this.orgForm.level = len + 1 this.orgForm.level = len + 1
} }
debugger
if (!form.id) { if (!form.id) {
// //
this.$post(this.api.saveArch, form).then(res => { this.$post(this.api.saveArch, form).then(res => {
@ -490,7 +422,6 @@ export default {
this.closeOrg() this.closeOrg()
}).catch(err => {}) }).catch(err => {})
} else { } else {
if (cas.length === 1 && this.labelName === '班级名称') return util.errorMsg('请选择年级!')
// //
this.$post(this.api.updateArch, form).then(res => { this.$post(this.api.updateArch, form).then(res => {
util.successMsg("编辑成功!") util.successMsg("编辑成功!")
@ -502,18 +433,9 @@ export default {
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
if (data.level === 3) { this.$refs.table.clearSelection()
this.isRemove = true; this.studentType = null
this.currentClassId = data.id; this.getStaff()
} else {
this.isRemove = false;
this.currentClassId = "";
}
this.$refs.table.clearSelection();
this.studentType = null;
this.architectureId = data.id;
this.orgLevel = data.level;
util.debounce(this.getOrgStudentData(), 1000);
}, },
// //
closeOrg() { closeOrg() {
@ -521,136 +443,44 @@ export default {
this.cascaderValue = [] this.cascaderValue = []
this.getOrg() this.getOrg()
}, },
getOrgTreeData(resolve, level, parentId, ids) { // //
this.$post(`${this.api.treeListArch}?level=${level}&parentId=${parentId}`).then(res => { getStaff() {
let { status, treeList } = res;
if (status === 200 && treeList.length) {
let result = [];
treeList.forEach(i => {
if (i.level === 3) {
i.leaf = true;
} else {
i.leaf = false;
}
i.ids = ids ? `${ids},${i.id}` : `${i.id}`; //
result.push(i);
});
return resolve(result);
} else {
return resolve([]);
}
}).catch(err => {
});
},
getOrgStudentData() { //
let params = {
architectureId: this.architectureId,
level: this.orgLevel,
keyWord: this.keyWord,
pageNum: 1,
pageSize: this.pageSize
};
this.$post(this.api.treeListArch, params).then(res => {
this.listData = res.page;
this.total = res.total;
}).catch(err => {
});
},
getData() { //
let data = { let data = {
type: this.studentType, type: this.studentType || '',
staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '',
keyWord: this.keyWord, keyWord: this.keyWord,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize pageSize: this.pageSize
}; };
this.$post(this.api.studentList, data).then(res => { this.$post(this.api.staffList, data).then(res => {
this.listData = res.page; this.listData = res.records
this.total = res.total; this.total = res.total
}).catch(err => { }).catch(err => {})
});
},
currentChange(val) { //
this.page = val;
if (this.studentType) {
this.getData();
} else {
this.getOrgStudentData();
}
}, },
getRowKeys(row) { // key //
return row.accountId; currentChange(val) {
this.page = val
this.getStaff()
}, },
handleSelectionChange(val) { // handleSelectionChange(val) { //
this.multipleSelection = val; this.multipleSelection = val
},
changeStudentType() {
this.isRemove = false;
this.initData();
}, },
initData() { initData() {
this.$refs.table.clearSelection(); this.$refs.table.clearSelection()
this.page = 1; this.page = 1
this.getData(); this.getStaff()
},
delAllSelection() { //
if (this.multipleSelection.length) {
this.$confirm("确定要删除选中用户吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.accountId;
});
this.$post(`${this.api.delStudent}?accountIds=${ids.toString()}`).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
if (this.studentType) {
this.getData();
} else {
this.getOrgStudentData();
}
}).catch(res => {
});
if(this.multipleSelection.length === this.listData.length && this.page>1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
}, },
handleDelete(row) { // //
delStaff(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.delStudent}?accountIds=${row.accountId}`).then(res => { this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功")
if (this.studentType) { this.getStaff()
this.getData();
} else {
this.getOrgStudentData();
}
}).catch(res => { }).catch(res => {
}); });
}).catch(() => { }).catch(() => {})
});
},
removeStudent(row) { //
this.$confirm("确定要移除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.removeStudent}?classId=${this.currentClassId}&stuAccountId=${row.accountId}`).then(res => {
util.successMsg("移除成功");
if (this.studentType) {
this.getData();
} else {
this.getOrgStudentData();
}
}).catch(res => {
});
}).catch(() => {
});
}, },
resetPassword(row) { // resetPassword(row) { //
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => {
@ -661,44 +491,71 @@ export default {
}).catch(() => { }).catch(() => {
}); });
}, },
switchOff(row) { // //
let isEnable = row.isEnable === 0 ? 0 : 1; addStaff() {
this.$get(`${this.api.updateAccountEnable}?id=${row.accountId}&isEnable=${isEnable}`).then(res => { this.staffVisible = true
util.successMsg("更新状态成功"); },
if (this.studentType) { // /
this.getData(); editStaff(row, isDetail) {
} else { this.isDetail = isDetail
this.getOrgStudentData(); this.staffVisible = true
} this.$post(`${this.api.staffDetail}?accountId=${row.accountId}`).then(res => {
}).catch(res => { const { data } = res
}); this.form = data
this.originAccount = data.account
this.originWorkNumber = data.workNumber
}).catch(res => {})
},
//
getRole() {
this.roleList =[]
this.$get(`${this.api.roleList}?page=1&size=1000&name=&platformId=${Setting.platformId}`).then(res => {
this.roleList = res.rolePage.records
}).catch(res => {})
},
//
roleChange(value) {
if (value.length) {
let ids = this.form.roleAndDeptList.map(e => e.roleId);
this.roleList.forEach(i => {
let obj = {
roleId: "",
roleName: "",
cascaderValue: []
};
if (value.includes(i.id) && !ids.includes(i.id)) {
console.log(i)
obj.roleId = i.id;
obj.roleName = i.roleName;
this.form.roleAndDeptList.push(obj);
}
});
} else {
this.form.roleAndDeptList.splice(0);
}
}, },
addStudent() { // roleRemove(value) { //
this.isAdd = true; let list = [];
this.showTree = true; for(var i=0;i<this.form.roleAndDeptList.length;i++){
this.studentVisible = true; if (this.form.roleAndDeptList[i].roleId == value){
},
editStudent(row, isDetail) { // / }else{
this.isAdd = false; list.push(this.form.roleAndDeptList[i])
this.isDetail = isDetail; }
this.showTree = false; }
this.studentVisible = true; this.form.roleAndDeptList = list
this.$post(`${this.api.getStudentInfoByAccountId}?stuAccountId=${row.accountId}`).then(res => {
this.form = res.data;
this.showTree = true;
}).catch(res => {});
}, },
accountChange() { // accountChange() { //
if (this.form.account) { if (this.form.account) {
let url = ""; let url = "";
if (this.isAdd) { if (this.form.accountId) {
url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&account=${this.form.account}&workNumber=`; url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&account=${this.form.account}&workNumber=`;
} else { } else {
url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&accountId=${this.form.accountId}&account=${this.form.account}&workNumber=`; url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&accountId=${this.form.accountId}&account=${this.form.account}&workNumber=`;
} }
this.$post(url).then(res => { this.$post(url).then(res => {
this.disableds = false this.disableds = false
if (this.isAdd && this.form.accountId) { if (this.form.accountId) {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
this.form = { this.form = {
account: this.form.account, account: this.form.account,
@ -716,8 +573,7 @@ export default {
this.accountReapeat = false; this.accountReapeat = false;
}).catch(err => { }).catch(err => {
if (this.isAdd) { if (this.form.accountId) {
this.showTree = false;
} else { } else {
this.accountReapeat = true; this.accountReapeat = true;
} }
@ -727,7 +583,7 @@ export default {
worknumberChange() { worknumberChange() {
if (this.form.workNumber) { if (this.form.workNumber) {
let url = ""; let url = "";
if (this.isAdd && !this.form.accountId) { if (!this.form.accountId) {
url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&workNumber=${this.form.workNumber}&account=`; url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&workNumber=${this.form.workNumber}&account=`;
} else { } else {
url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&accountId=${this.form.accountId}&workNumber=${this.form.workNumber}&account=`; url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&accountId=${this.form.accountId}&workNumber=${this.form.workNumber}&account=`;
@ -738,11 +594,9 @@ export default {
} }
}).catch(err => { }).catch(err => {
this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => { this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => {
this.showTree = true;
let classId = res.data.classList.map(e => e.id); let classId = res.data.classList.map(e => e.id);
this.form.classId = classId.toString(); this.form.classId = classId.toString();
delete this.form.classList; delete this.form.classList;
// this.showTree = true;
this.accountReapeat = false; this.accountReapeat = false;
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
}).catch(res => {}); }).catch(res => {});
@ -754,7 +608,7 @@ export default {
let regex = /^1[3456789]\d{9}$/; let regex = /^1[3456789]\d{9}$/;
if (regex.test(this.form.phone)) { if (regex.test(this.form.phone)) {
let url = ""; let url = "";
if (this.isAdd && !this.form.accountId) { if (!this.form.accountId) {
url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`; url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`;
} else { } else {
url = `${this.api.checkEmailOrPhone}?accountId=${this.form.accountId}&phone=${this.form.phone}&email=`; url = `${this.api.checkEmailOrPhone}?accountId=${this.form.accountId}&phone=${this.form.phone}&email=`;
@ -772,7 +626,7 @@ export default {
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
if (regex.test(this.form.email)) { if (regex.test(this.form.email)) {
let url = ""; let url = "";
if (this.isAdd && !this.form.accountId) { if (!this.form.accountId) {
url = `${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`; url = `${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`;
} else { } else {
url = `${this.api.checkEmailOrPhone}?accountId=${this.form.accountId}&email=${this.form.email}&phone=`; url = `${this.api.checkEmailOrPhone}?accountId=${this.form.accountId}&email=${this.form.email}&phone=`;
@ -786,81 +640,35 @@ export default {
}); });
} }
}, },
filterNode(value, data) { // /
if (!value) return true; submitStaff() {
return data.organizationName.indexOf(value) !== -1;
},
loadClassTree(node, resolve) { //
let level = 1;
let parentId = "";
if (node.level === 0) {
this.treeNode = node;
this.treeResolve = resolve;
this.getClassTreeData(resolve, level, parentId);
} else if (node.level > 2) {
return resolve([]);
} else {
if (node.data && node.data.level && node.data.id) {
this.getClassTreeData(resolve, node.data.level + 1, node.data.id);
}
}
},
getClassTreeData(resolve, level, parentId) { //
this.$post(`${this.api.treeListArch}?level=${level}&parentId=${parentId}`).then(res => {
let { status, treeList } = res;
if (status === 200 && treeList.length) {
let result = [];
treeList.forEach(i => {
i.disabled = i.level < 3;
if (i.level === 3) {
i.leaf = true;
// propschecked
// i.checked = this.form.classId.includes(i.id.toString());
if (this.form.classId) {
this.defaultCheckedKeys = this.form.classId.split(",").map(i => Number(i));
}
i.showCheckbox = true;
} else {
i.leaf = false;
i.showCheckbox = false;
}
result.push(i);
});
return resolve(result);
} else {
return resolve([]);
}
}).catch(err => {
});
},
saveData(type) { // /
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
let nodes = this.$refs.classTree.getCheckedNodes(); if (this.accountReapeat) return util.warningMsg("该账号已存在")
if (nodes.length) { if (this.workNumberReapeat) return util.warningMsg("该员工学号已存在")
let tempArr = []; if (this.phoneRepeat) return util.warningMsg("该手机号已存在")
nodes.forEach(i => { if (this.emailRepeat) return util.warningMsg("该邮箱已存在")
if (i.level === 3) { const form = this.form
tempArr.push(i.id); if (this.teacherForm.roleAndDeptList.length){
} for (let i = 0; i < this.teacherForm.roleAndDeptList.length; i++) {
}); if (this.teacherForm.roleAndDeptList[i].cascaderValue.length < 2) {
this.form.classId = tempArr.toString(); util.warningMsg(`请选择${this.teacherForm.roleAndDeptList[i].roleName}所属部门`)
} return;
if (this.form.accountId) {
this.submiting = true
this.$post(this.api.modifyStudent, this.form).then(res => {
util.successMsg("编辑成功!");
if (type) {
this.resetStudent();
} else { } else {
this.closeStudent(); data.roleAndDeptList.push({
if (this.studentType) { roleId: this.teacherForm.roleAndDeptList[i].roleId,
this.getData(); staffArchitectureId: this.teacherForm.roleAndDeptList[i].cascaderValue[0],
} else { gradeId: this.teacherForm.roleAndDeptList[i].cascaderValue[1]
this.getOrgStudentData(); })
}
} }
}
}
this.submiting = true
if (form.accountId) {
this.$post(this.api.modifyStaff, form).then(res => {
util.successMsg("编辑成功!")
this.closeStudent()
setTimeout(() => { setTimeout(() => {
this.submiting = false this.submiting = false
}, 2000) }, 2000)
@ -870,24 +678,10 @@ export default {
}, 2000) }, 2000)
}) })
} else { } else {
if (this.accountReapeat) return util.warningMsg("该账号已存在"); form.uniqueIdentification = new Date().getTime()
if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在"); this.$post(this.api.saveStaff, form).then(res => {
if (this.phoneRepeat) return util.warningMsg("该手机号已存在"); util.successMsg("新增成功!")
if (this.emailRepeat) return util.warningMsg("该邮箱已存在"); this.closeStudent()
this.submiting = true
this.form.uniqueIdentification = new Date().getTime();
this.$post(this.api.addStudent, this.form).then(res => {
util.successMsg("新增成功!");
if (type) {
this.resetStudent();
} else {
this.closeStudent();
if (this.studentType) {
this.getData();
} else {
this.getOrgStudentData();
}
}
setTimeout(() => { setTimeout(() => {
this.submiting = false this.submiting = false
}, 2000) }, 2000)
@ -897,59 +691,45 @@ export default {
}, 2000) }, 2000)
}) })
} }
} else {
return false;
} }
}); })
}, },
resetStudent() { // //
this.$refs.form.clearValidate(); closeStudent() {
this.form = { this.$refs.form.clearValidate()
userName: '', this.form = {
account: '', accountId: '',
phone: '', userName: '',
uniqueIdentification: '', account: '',
workNumber: '', phone: '',
email: '', uniqueIdentification: '',
classId: "" workNumber: '',
}; email: '',
this.$refs.classTree.setCheckedKeys([]); classId: ''
if (this.studentType) { };
this.getData(); this.defaultCheckedKeys = []
} else { this.isDetail = false
this.getOrgStudentData(); this.staffVisible = false
} this.getStaff()
},
closeStudent() { //
this.$refs.form.clearValidate();
this.form = {
userName: '',
account: '',
phone: '',
uniqueIdentification: '',
workNumber: '',
email: '',
classId: ""
};
this.defaultCheckedKeys = [];
this.isDetail = false;
this.showTree = false;
this.studentVisible = false;
}, },
batchImport() { // //
batchImport() {
this.importVisible = true; this.importVisible = true;
this.uploadList = []; this.uploadList = [];
this.uploadFaild = false; this.uploadFaild = false;
}, },
downLoad() { // //
downLoad() {
location.href = this.api.studentTemplate; location.href = this.api.studentTemplate;
}, },
handleExceed(files, fileList) { // //
handleExceed(files, fileList) {
util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
showFaild() { // //
showFaild() {
location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}`; location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}`;
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
@ -961,8 +741,6 @@ export default {
} }
util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`); util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`);
util.successMsg(`本次上传有${res.data.failureNum}个错误信息录入`); util.successMsg(`本次上传有${res.data.failureNum}个错误信息录入`);
this.getClassTreeData('','1','')
} else { } else {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据");
} }

Loading…
Cancel
Save