@ -1,11 +1,9 @@
< template >
< template >
< div class = "flex" >
< div class = "flex" >
< div class = "page"
< div class = "page" style = "width: 320px" >
style = "width: 320px" >
< 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 "
< el -radio -group v-model ="studentType" @change="changeStudentType" >
@ change = "changeStudentType" >
< div class = "m-b-20" >
< div class = "m-b-20" >
< el -radio :label ="1" > 所有学生 < / e l - r a d i o >
< el -radio :label ="1" > 所有学生 < / e l - r a d i o >
< / div >
< / div >
@ -17,40 +15,23 @@
< el -divider > < / e l - d i v i d e r >
< el -divider > < / e l - d i v i d e r >
< div >
< div >
< div class = "flex-between m-b-20" >
< div class = "flex-between m-b-20" >
< h6 class = "p-title"
< h6 class = "p-title" style = "margin-bottom: 0" > 学生组织架构 < / h6 >
style = "margin-bottom: 0" > 学生组织架构 < / h6 >
< el -button v-auth ="'学生组织架构添加'" type="text" @click="handleAdd" > 添加 < / el -button >
< el -button v -auth = " ' 学生组织架构添加 ' "
type = "text"
@ click = "handleAdd" > 添加 < / e l - b u t t o n >
< / div >
< / div >
< div style = "height: 504px; max-height: 504px; overflow: auto" >
< div style = "height: 504px; max-height: 504px; overflow: auto" >
< org -tree v -if = " treeVisible "
< org -tree v -if = " treeVisible " default -expand -all ref = "orgTree" node -key = " id " highlight -current lazy
default - expand - all
: load = "loadNodeTree" : expand - on - click - node = "false" @ node - click = "handleNodeClick"
ref = "orgTree"
: current - node - key = "architectureId"
node - key = "id"
: props = "{ children: 'children', label: 'organizationName', isLeaf: 'leaf' }" >
highlight - current
< span class = "custom-tree-node" slot -scope = " { node , data } " >
lazy
< span class = "name" :title ="node.label" > { { node . label } } < / span >
: load = "loadNodeTree"
: expand - on - click - node = "false"
@ node - click = "handleNodeClick"
: current - node - key = "architectureId"
: props = "{children: 'children', label: 'organizationName', isLeaf: 'leaf'}" >
< span class = "custom-tree-node"
slot - scope = "{ node, data }" >
< span class = "name"
: title = "node.label" > { { node . label } } < / span >
< span >
< span >
< el -button v -auth = " ' 学生组织架构编辑 ' "
< el -button v -auth = " ' 学生组织架构编辑 ' " type = "text" icon = "el-icon-edit-outline"
type = "text"
@ click = "() => handleEdit(node, data)" >
icon = "el-icon-edit-outline"
@ click = "() => handleEdit(node, data)" >
< / e l - b u t t o n >
< / e l - b u t t o n >
< el -button v -auth = " ' 学生组织架构添加 ' "
< el -button v -auth = " ' 学生组织架构添加 ' " v -if = " node.level < 3 " type = "text" icon = "el-icon-circle-plus-outline"
v - if = "node.level < 3"
@ click = "() => handleAdd(node, data)" >
type = "text"
icon = "el-icon-circle-plus-outline"
@ click = "() => handleAdd(node, data)" >
< / e l - b u t t o n >
< / e l - b u t t o n >
< / span >
< / span >
< / span >
< / span >
@ -58,225 +39,113 @@
< / div >
< / div >
< / div >
< / div >
< el -dialog :title ="orgTitle"
< el -dialog :title ="orgTitle" :visible.sync ="orgVisible" :close-on-click-modal ="false" width = "50%"
: visible . sync = "orgVisible"
@ close = "handleClose" >
: close - on - click - modal = "false"
< el -form v-if ="orgVisible" ref="orgForm" :model="orgForm" :rules="rules" label-width="100px" >
width = "50%"
< el -form -item :label ="labelName" prop = "organizationName" >
@ close = "handleClose" >
< el -input v -model .trim = " orgForm.organizationName " placeholder = "请输入" > < / e l - i n p u t >
< el -form v -if = " orgVisible "
ref = "orgForm"
: model = "orgForm"
: rules = "rules"
label - width = "100px" >
< el -form -item :label ="labelName"
prop = "organizationName" >
< el -input v -model .trim = " orgForm.organizationName "
placeholder = "请输入" > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "上级部门" >
< el -form -item label = "上级部门" >
< el -cascader v -if = " showCascader "
< el -cascader v -if = " showCascader " v -model = " cascaderValue " :props ="cascaderProps"
v - model = "cascaderValue"
@ change = "handleChangeCascader" clearable style = "width: 100%" >
: props = "cascaderProps"
@ change = "handleChangeCascader"
clearable
style = "width: 100%" >
< / e l - c a s c a d e r >
< / e l - c a s c a d e r >
< span v-else > {{ orgForm.parentName }} < / span >
< span v-else > {{ orgForm.parentName }} < / span >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< / e l - f o r m >
< span slot = "footer"
< span slot = "footer" class = "dialog-footer" >
class = "dialog-footer" >
< el -button v-if ="isAddOrg" @click="handleClose" > 取 消 < / el -button >
< el -button v -if = " isAddOrg "
< el -button v-if ="!isAddOrg" type="danger" plain @click="handleDel" > 删除 < / el -button >
@ click = "handleClose" > 取 消 < / e l - b u t t o n >
< el -button type = "primary" @click ="orgSubmit" > 确 定 < / el -button >
< el -button v -if = " ! isAddOrg "
type = "danger"
plain
@ click = "handleDel" > 删除 < / e l - b u t t o n >
< el -button type = "primary"
@ click = "orgSubmit" > 确 定 < / e l - b u t t o n >
< / span >
< / span >
< / e l - d i a l o g >
< / e l - d i a l o g >
< / div >
< / div >
< div class = "page flex-1 m-l-20"
< div class = "page flex-1 m-l-20" style = "max-width: calc(100% - 320px)" >
style = "max-width: calc(100% - 320px)" >
< h6 class = "p-title" > 筛选 < / h6 >
< h6 class = "p-title" > 筛选 < / h6 >
< div class = "tool" >
< div class = "tool" >
< ul class = "filter" >
< ul class = "filter" >
< li >
< li >
< el -input style = "width: 250px;"
< el -input style = "width: 250px;" placeholder = "请输入学生姓名/学号" prefix -icon = " el -icon -search " v -model = " keyWord "
placeholder = "请输入学生姓名/学号"
clearable > < / e l - i n p u t >
prefix - icon = "el-icon-search"
v - model = "keyWord"
clearable > < / e l - i n p u t >
< / li >
< / li >
< / ul >
< / ul >
< div >
< div >
< el -button type = "info"
< el -button type = "info" v -auth @click ="addStudent" > 新增学生 < / el -button >
v - auth
< el -button type = "primary" v -auth @click ="batchImport" > 批量导入 < / el -button >
@ click = "addStudent" > 新增学生 < / e l - b u t t o n >
< el -button type = "primary" v -auth @click ="delAllSelection" > 批量删除 < / el -button >
< el -button type = "primary"
v - auth
@ click = "batchImport" > 批量导入 < / e l - b u t t o n >
< el -button type = "primary"
v - auth
@ click = "delAllSelection" > 批量删除 < / e l - b u t t o n >
< / div >
< / div >
< / div >
< / div >
< el -table :data ="listData"
< el -table :data ="listData" class = "table" ref = "table" stripe header -align = " center "
class = "table"
@ selection - change = "handleSelectionChange" : row - key = "getRowKeys" >
ref = "table"
< el -table -column type = "selection" width = "55" align = "center" :reserve-selection ="true" > < / e l - t a b l e - c o l u m n >
stripe
< el -table -column type = "index" width = "60" label = "序号" align = "center" > < / e l - t a b l e - c o l u m n >
header - align = "center"
< el -table -column prop = "userName" label = "学生姓名" align = "center" min -width = " 100 " > < / e l - t a b l e - c o l u m n >
@ selection - change = "handleSelectionChange"
< el -table -column prop = "workNumber" label = "学生学号" align = "center" min -width = " 100 " > < / e l - t a b l e - c o l u m n >
: row - key = "getRowKeys" >
< el -table -column prop = "className" label = "班级" align = "center" min -width = " 200 "
< el -table -column type = "selection"
show - overflow - tooltip > < / e l - t a b l e - c o l u m n >
width = "55"
< el -table -column prop = "countries" label = "账号角色" align = "center" width = "100" >
align = "center"
: reserve - selection = "true" > < / e l - t a b l e - c o l u m n >
< el -table -column type = "index"
width = "60"
label = "序号"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "userName"
label = "学生姓名"
align = "center"
min - width = "100" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "workNumber"
label = "学生学号"
align = "center"
min - width = "100" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "className"
label = "班级"
align = "center"
min - width = "200"
show - overflow - tooltip > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "countries"
label = "账号角色"
align = "center"
width = "100" >
< template slot -scope = " scope " > 学生 < / template >
< template slot -scope = " scope " > 学生 < / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "loginNumber"
< el -table -column prop = "loginNumber" label = "登录次数" align = "center" width = "100" > < / e l - t a b l e - c o l u m n >
label = "登录次数"
< el -table -column prop = "lastLoginTime" label = "上次登录时间" align = "center" width = "180" > < / e l - t a b l e - c o l u m n >
align = "center"
< el -table -column label = "操作" align = "center" width = "300" >
width = "100" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "lastLoginTime"
label = "上次登录时间"
align = "center"
width = "180" > < / e l - t a b l e - c o l u m n >
< el -table -column label = "操作"
align = "center"
width = "300" >
< template slot -scope = " scope " >
< template slot -scope = " scope " >
< el -button v -auth
< el -button v -auth v-if ="isRemove" type="text" @click="removeStudent(scope.row)" > 移除 < / el -button >
v - if = "isRemove"
< el -button v -auth type = "text" @ click = "editStudent(scope.row, true)" > 查看 < / e l - b u t t o n >
type = "text"
< el -button v -auth type = "text" @ click = "editStudent(scope.row, false)" > 编辑 < / e l - b u t t o n >
@ click = "removeStudent(scope.row)" > 移除 < / e l - b u t t o n >
< el -button v -auth type = "text" @click ="resetPassword(scope.row)" > 重置密码 < / el -button >
< el -button v -auth
< el -button v -auth type = "text" @click ="handleDelete(scope.row)" > 删除 < / el -button >
type = "text"
< el -switch v -auth = " ' 禁用 ' " v -model = " scope.row.isEnable " :active-value ="1" :inactive-value ="0"
@ click = "editStudent(scope.row,true)" > 查看 < / e l - b u t t o n >
style = "margin: 0 5px" @ change = "switchOff(scope.row)" > < / e l - s w i t c h >
< el -button v -auth
type = "text"
@ click = "editStudent(scope.row,false)" > 编辑 < / e l - b u t t o n >
< el -button v -auth
type = "text"
@ click = "resetPassword(scope.row)" > 重置密码 < / e l - b u t t o n >
< el -button v -auth
type = "text"
@ click = "handleDelete(scope.row)" > 删除 < / e l - b u t t o n >
< el -switch v -auth = " ' 禁用 ' "
v - model = "scope.row.isEnable"
: active - value = "1"
: inactive - value = "0"
style = "margin: 0 5px"
@ change = "switchOff(scope.row)" > < / e l - s w i t c h >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< / e l - t a b l e >
< div class = "pagination" >
< div class = "pagination" >
< el -pagination background
< el -pagination background @current-change ="currentChange" :current-page ="page" layout = "total, prev, pager, next"
@ current - change = "currentChange"
: total = "total" > < / e l - p a g i n a t i o n >
: current - page = "page"
layout = "total, prev, pager, next"
: total = "total" > < / e l - p a g i n a t i o n >
< / div >
< / div >
< el -dialog class = "dialog"
< el -dialog class = "dialog" width = "60%" : title = "isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')"
width = "60%"
: visible . sync = "studentVisible" : close - on - click - modal = "false" @ close = "closeStudent" >
: title = "isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')"
< el -form ref = "form" :model ="form" :rules ="rules" :disabled ="isDetail" label -width = " 100px " >
: visible . sync = "studentVisible"
: close - on - click - modal = "false"
@ close = "closeStudent" >
< el -form ref = "form"
: model = "form"
: rules = "rules"
: disabled = "isDetail"
label - width = "100px" >
< el -row :gutter ="20" >
< el -row :gutter ="20" >
< el -col :span ="12" >
< el -col :span ="12" >
< el -form -item prop = "workNumber"
< el -form -item prop = "workNumber" label = "学生学号" >
label = "学生学号" >
< el -input v -model .trim = " form.workNumber " placeholder = "学生学号" @blur ="workNumberChange" > < / el -input >
< el -input v -model .trim = " form.workNumber "
placeholder = "学生学号"
@ blur = "workNumberChange" > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item prop = "userName"
< el -form -item prop = "userName" label = "学生姓名" >
label = "学生姓名" >
< el -input v -model .trim = " form.userName " placeholder = "请输入学生姓名" > < / e l - i n p u t >
< el -input v -model .trim = " form.userName "
placeholder = "请输入学生姓名" > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item prop = "roleId"
< el -form -item prop = "roleId" label = "账号角色" >
label = "账号角色" >
学生
学生
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item prop = "phone"
< el -form -item prop = "phone" label = "手机号" >
label = "手机号" >
< el -input v -model .trim = " form.phone " placeholder = "可用于登录平台,以及找回密码" maxlength = "11" > < / e l - i n p u t >
< el -input v -model .trim = " form.phone "
placeholder = "可用于登录平台,以及找回密码"
maxlength = "11" > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item prop = "email"
< el -form -item prop = "email" label = "邮箱" >
label = "邮箱" >
< el -input v -model .trim = " form.email " placeholder = "可用于登录平台,以及找回密码" > < / e l - i n p u t >
< el -input v -model .trim = " form.email "
placeholder = "可用于登录平台,以及找回密码" > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item prop = "uniqueIdentification"
< el -form -item prop = "uniqueIdentification" label = "唯一标识" >
label = "唯一标识" >
< el -input disabled v-model ="form.uniqueIdentification" > < / el -input >
< el -input disabled
v - model = "form.uniqueIdentification" > < / e l - i n p u t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< / e l - c o l >
< / e l - c o l >
< el -col :span ="10" >
< el -col :span ="10" >
< el -form -item prop = "classId"
< el -form -item prop = "classId" label = "所在班级" >
label = "所在班级" >
< el -input placeholder = "输入关键字进行过滤" v-model ="filterText" style="margin-bottom: 10px" >
< el -input placeholder = "输入关键字进行过滤"
v - model = "filterText"
style = "margin-bottom: 10px" >
< / e l - i n p u t >
< / e l - i n p u t >
< div style = "max-height: 245px; border: 1px solid #DCDFE6; border-radius: 4px; padding: 10px 10px 10px 0px; overflow: auto" >
< div
< org -tree v -if = " showTree & & treeVisible "
style = "max-height: 245px; border: 1px solid #DCDFE6; border-radius: 4px; padding: 10px 10px 10px 0px; overflow: auto" >
ref = "classTree"
< org -tree v -if = " showTree & & treeVisible " ref = "classTree" show -checkbox node -key = " id " highlight -current
show - checkbox
default - expand - all lazy : load = "loadClassTree" : default - checked - keys = "defaultCheckedKeys"
node - key = "id"
: filter - node - method = "filterNode"
highlight - current
: props = "{ children: 'children', label: 'organizationName', isLeaf: 'leaf' }" >
default - expand - all
< span class = "custom-tree-node" slot -scope = " { node , data } " >
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 style = "display: inline-block; margin-right: 20px" > { { node . label } } < / span >
< span >
< span >
< el -button v -auth = " ' 学生组织架构添加 ' "
< el -button v -auth = " ' 学生组织架构添加 ' " v -if = " node.level < 3 " type = "text"
v - if = "node.level < 3"
icon = "el-icon-circle-plus-outline" @ click = "() => handleAdd(node, data)" >
type = "text"
icon = "el-icon-circle-plus-outline"
@ click = "() => handleAdd(node, data)" >
< / e l - b u t t o n >
< / e l - b u t t o n >
< / span >
< / span >
< / span >
< / span >
@ -287,55 +156,28 @@
< / e l - c o l >
< / e l - c o l >
< / e l - r o w >
< / e l - r o w >
< / e l - f o r m >
< / e l - f o r m >
< span slot = "footer"
< span slot = "footer" class = "dialog-footer" v-if ="!isDetail" >
class = "dialog-footer"
< el -button type = "primary" :disabled ="disableds" @click ="saveData(0)" > 保存 < / el -button >
v - if = "!isDetail" >
< el -button v-if ="isAdd" type="primary" :disabled="disableds" @click="saveData(1)" > 保存并继续添加 < / el -button >
< el -button type = "primary"
< el -button size = "small" @click ="closeStudent" > 取消 < / el -button >
: disabled = "disableds"
@ click = "saveData(0)" > 保存 < / e l - b u t t o n >
< el -button v -if = " isAdd "
type = "primary"
: disabled = "disableds"
@ click = "saveData(1)" > 保存并继续添加 < / e l - b u t t o n >
< el -button size = "small"
@ click = "closeStudent" > 取消 < / e l - b u t t o n >
< / span >
< / span >
< / e l - d i a l o g >
< / e l - d i a l o g >
< el -dialog title = "批量导入"
< el -dialog title = "批量导入" :visible.sync ="importVisible" width = "24%" :close-on-click-modal ="false" >
: visible . sync = "importVisible"
width = "24%"
: close - on - click - modal = "false" >
< div style = "text-align: center" >
< div style = "text-align: center" >
< div style = "margin-bottom: 10px;" >
< div style = "margin-bottom: 10px;" >
< el -button type = "primary"
< el -button type = "primary" @click ="downLoad" > 模板下载 < i class = "el-icon-download el-icon--right" > < / i > < / e l - b u t t o n >
@ click = "downLoad" > 模板下载 < i class = "el-icon-download el-icon--right" > < / i > < / e l - b u t t o n >
< / div >
< / div >
< el -upload name = "file"
< el -upload name = "file" accept = ".xls,.xlsx" :on-remove ="handleRemove" :on-error ="uploadError"
accept = ".xls,.xlsx"
: on - success = "uploadSuccess" : before - remove = "beforeRemove" : limit = "1" : on - exceed = "handleExceed"
: on - remove = "handleRemove"
: action = "this.api.importStudent" : file - list = "uploadList" : headers = "headers" >
: on - error = "uploadError"
< el -button type = "primary" class = "ml20" > 上传文件 < i class = "el-icon-upload2 el-icon--right" > < / i > < / e l - b u t t o n >
: on - success = "uploadSuccess"
: before - remove = "beforeRemove"
: limit = "1"
: on - exceed = "handleExceed"
: action = "this.api.importStudent"
: file - list = "uploadList"
: headers = "headers" >
< el -button type = "primary"
class = "ml20" > 上传文件 < i class = "el-icon-upload2 el-icon--right" > < / i > < / e l - b u t t o n >
< / e l - u p l o a d >
< / e l - u p l o a d >
< el -link v -if = " uploadFaild "
< el -link v-if ="uploadFaild" type="primary" @click="showFaild" > 部分数据导入失败 , 查看失败原因 < / el -link >
type = "primary"
@ click = "showFaild" > 部分数据导入失败 , 查看失败原因 < / e l - l i n k >
< / div >
< / div >
< span slot = "footer"
< span slot = "footer" class = "dialog-footer" >
class = "dialog-footer" >
< el -button size = "small" @ click = "importVisible = false" > 取 消 < / e l - b u t t o n >
< el -button size = "small"
< el -button size = "small" type = "primary" @click ="uploadSure" > 确 定 < / el -button >
@ click = "importVisible = false" > 取 消 < / e l - b u t t o n >
< el -button size = "small"
type = "primary"
@ click = "uploadSure" > 确 定 < / e l - b u t t o n >
< / span >
< / span >
< / e l - d i a l o g >
< / e l - d i a l o g >
< / div >
< / div >
@ -1116,14 +958,15 @@ export default {
< style lang = "scss" scoped >
< style lang = "scss" scoped >
. custom - tree - node {
. custom - tree - node {
display : inline - flex ;
display : inline - flex ;
align - items : center ;
align - items : center ;
}
}
. name {
. name {
display : inline - block ;
display : inline - block ;
max - width : 160 px ;
max - width : 160 px ;
margin - right : 20 px ;
margin - right : 20 px ;
overflow : hidden ;
overflow : hidden ;
text - overflow : ellipsis ;
text - overflow : ellipsis ;
}
}
< / style >
< / style >