学生等修复

dev_2022-05-11
yujialong 3 years ago
parent 91033ece9d
commit 5637e7930a
  1. 2
      src/pages/setting/list/info.vue
  2. 468
      src/pages/student/list/index.vue
  3. 2
      src/store/modules/user.js
  4. 14
      vue.config.js

@ -211,7 +211,7 @@
width="30%"> 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 placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> <el-input style="width: 404px;" 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-between"> <div class="flex-between">

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

@ -92,7 +92,7 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
util.local.remove(Setting.storeKey); util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey); util.local.remove(Setting.tokenKey);
if (state.fromClient) { if (util.cookies.get('serverLogin')) {
util.cookies.remove('serverLogin') util.cookies.remove('serverLogin')
location.href = Setting.isDev location.href = Setting.isDev
? `http://192.168.31.125:8082/#/` ? `http://192.168.31.125:8082/#/`

@ -1,12 +1,3 @@
// 引入等比适配插件
const px2rem = require("postcss-px2rem");
// 配置基本大小
const postcss = px2rem({
// 基准大小 baseSize,需要和rem.js中相同
remUnit: 16
});
const Setting = require('./src/setting.env') const Setting = require('./src/setting.env')
// 使用等比适配插件 // 使用等比适配插件
@ -14,11 +5,6 @@ module.exports = {
lintOnSave: true, lintOnSave: true,
css: { css: {
loaderOptions: { loaderOptions: {
postcss: {
plugins: [
postcss
]
},
sass: { sass: {
prependData: `@import "@/styles/var.scss";` prependData: `@import "@/styles/var.scss";`
}, },

Loading…
Cancel
Save