对接班级管理列表
This commit is contained in:
+33
-1
@@ -626,8 +626,40 @@ export default {
|
||||
"isAffix": true,
|
||||
"isIframe": false,
|
||||
"roles": ["admin", "common"],
|
||||
"icon": "el-icon-s-opportunity"
|
||||
"icon": "el-icon-connection"
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
"path": "/classList/classList",
|
||||
"name": "classList",
|
||||
"component": "classList/classList",
|
||||
"meta": {
|
||||
"title": "message.router.classList",
|
||||
"isLink": "",
|
||||
"isHide": false,
|
||||
"isKeepAlive": true,
|
||||
"isAffix": true,
|
||||
"isIframe": false,
|
||||
"roles": ["admin", "common"],
|
||||
"icon": "el-icon-coordinate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "/department",
|
||||
"name": "department",
|
||||
"component": "department",
|
||||
"meta": {
|
||||
"title": "message.router.department",
|
||||
"isLink": "",
|
||||
"isHide": false,
|
||||
"isKeepAlive": true,
|
||||
"isAffix": true,
|
||||
"isIframe": false,
|
||||
"roles": ["admin", "common"],
|
||||
"icon": "el-icon-collection"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ export default {
|
||||
attendanceMachineEquipmentManagement:'attendanceMachineEquipmentManagement',
|
||||
recipe: 'recipe',
|
||||
evaluate: 'evaluate',
|
||||
classList: 'classList',
|
||||
department: 'department',
|
||||
},
|
||||
staticRoutes: {
|
||||
signIn: 'signIn',
|
||||
|
||||
@@ -56,6 +56,8 @@ export default {
|
||||
attendanceMachineEquipmentManagement:'考勤机设备管理',
|
||||
recipe: '每周食谱',
|
||||
evaluate: '幼儿评价表',
|
||||
classList: '班级管理',
|
||||
department: '部门管理'
|
||||
|
||||
},
|
||||
staticRoutes: {
|
||||
|
||||
@@ -56,6 +56,8 @@ export default {
|
||||
attendanceMachineEquipmentManagement:'考勤機設備管理',
|
||||
recipe: '每周食谱',
|
||||
evaluate: '幼儿评价表',
|
||||
classList: '班级管理',
|
||||
department: '部门管理',
|
||||
},
|
||||
staticRoutes: {
|
||||
signIn: '登入',
|
||||
|
||||
+1
-7
@@ -258,30 +258,24 @@ router.beforeEach((to, from, next) => {
|
||||
keepAliveSplice(to);
|
||||
NProgress.configure({ showSpinner: false });
|
||||
if (to.meta.title && to.path !== '/login') NProgress.start();
|
||||
let token = localStorage.getItem('token');
|
||||
let token = Session.get('token');
|
||||
if (to.path === '/login' && !token) {
|
||||
console.log(111111111)
|
||||
NProgress.start();
|
||||
next();
|
||||
delayNProgressDone();
|
||||
} else {
|
||||
if (!token) {
|
||||
console.log(2222222222)
|
||||
NProgress.start();
|
||||
next('/login');
|
||||
Session.clear();
|
||||
delayNProgressDone();
|
||||
} else if (token && to.path === '/login') {
|
||||
console.log(33333333333)
|
||||
next('/home');
|
||||
delayNProgressDone();
|
||||
} else {
|
||||
console.log(4444444444)
|
||||
if (Object.keys(store.state.routesList.routesList).length <= 0) {
|
||||
console.log(55555)
|
||||
getRouterList(router, to, next);
|
||||
} else {
|
||||
console.log(6666666666)
|
||||
next();
|
||||
delayNProgressDone(0);
|
||||
}
|
||||
|
||||
+15
-1
@@ -26,7 +26,9 @@ const state = {
|
||||
token: localStorage.getItem('token') || '',
|
||||
refreshToken: localStorage.getItem('refreshToken') || '', // 刷新token
|
||||
user: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {}, // 用户信息
|
||||
|
||||
school: localStorage.getItem('school') ? JSON.parse(localStorage.getItem('school')) : {}, // 学校 默认获取的第一个
|
||||
roles: localStorage.getItem('roles') ? JSON.parse(localStorage.getItem('roles')) : [], // 权限 是家长或教师
|
||||
classify: localStorage.getItem('classify') ? JSON.parse(localStorage.getItem('classify')) : {} // 用户为班主任的班级 默认查找的第一个
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +45,18 @@ const mutations = {
|
||||
state.user = newUser
|
||||
localStorage.setItem('user', JSON.stringify(newUser) )
|
||||
},
|
||||
setSchool( state, newSchool){
|
||||
localStorage.setItem('school', JSON.stringify(newSchool) )
|
||||
state.school = newSchool
|
||||
},
|
||||
setRoles( state, newRoles){
|
||||
localStorage.setItem('roles', JSON.stringify(newRoles) )
|
||||
state.roles = newRoles
|
||||
},
|
||||
setClassify( state, newClassify){
|
||||
localStorage.setItem('classify', JSON.stringify(newClassify) )
|
||||
state.classify = newClassify
|
||||
},
|
||||
|
||||
}
|
||||
const actions = {
|
||||
|
||||
@@ -3,7 +3,7 @@ import router, { resetRouter } from '@/router/index';
|
||||
import axios from 'axios';
|
||||
import { Message, MessageBox } from 'element-ui';
|
||||
import { Session } from '@/utils/storage';
|
||||
const getToken = localStorage.getItem('token');
|
||||
|
||||
const errorCode = {
|
||||
'401': '登录状态已过期,即将返回首页重新登录。',
|
||||
'403': '当前操作没有权限',
|
||||
@@ -20,10 +20,12 @@ const service = axios.create({
|
||||
// 添加请求拦截器
|
||||
service.interceptors.request.use(
|
||||
(config) => {
|
||||
console.log('---------------------')
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
let getToken = Session.get('token');
|
||||
if (getToken && !isToken) {
|
||||
config.headers['Authorization'] = localStorage.getItem('token') // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
config.headers['Authorization'] = getToken // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取组织结构
|
||||
export function getClass () {
|
||||
return request({
|
||||
url: '/manager/class/list',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 获取班级用户列表
|
||||
export function getClassStudent (classId, params) {
|
||||
return request({
|
||||
url: `/manager/class/student/list/${classId}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
export default [
|
||||
{
|
||||
label: "设备id",
|
||||
prop: "deviceId",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "账号名称",
|
||||
prop: "username",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
{
|
||||
label: "设备名称",
|
||||
prop: "deviceName",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
prop: "username",
|
||||
type: "image",
|
||||
},
|
||||
{
|
||||
label: "密码",
|
||||
prop: "password",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
label: "设备标签",
|
||||
prop: "deviceLabel",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "设备地址",
|
||||
prop: "deviceUrl",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "设备状态",
|
||||
prop: "deviceStatus",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
{
|
||||
label: "设备物理地址",
|
||||
prop: "macAddress",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
]
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button @click="newlyClick" type="primary" size="mini" icon="el-icon-plus"
|
||||
>新增食谱</el-button
|
||||
>
|
||||
<!-- <el-button @click="updateClick" icon="el-icon-edit" size="mini" >修改食谱</el-button>
|
||||
<el-button @click="newlyTwoClick" type="success" size="mini" icon="el-icon-plus"
|
||||
>新增周次</el-button
|
||||
>
|
||||
<el-button @click="updateTwoClick" icon="el-icon-edit" size="mini" >修改周次</el-button>
|
||||
<el-button @click="newlyClassClick" type="warning" size="mini" icon="el-icon-plus">新增食谱总类别</el-button>
|
||||
<el-button @click="updateClassClick" icon="el-icon-edit" size="mini" >修改食谱类别</el-button> -->
|
||||
<!-- <el-button @click="resetClick" type="info" size="mini" icon="iconfont icon-biaodan"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button @click="searchClick" type="warning" size="mini" icon="el-icon-search"
|
||||
>搜索</el-button
|
||||
> -->
|
||||
<el-input
|
||||
v-if="false"
|
||||
v-model="searchData"
|
||||
size="mini"
|
||||
style="width: 20%"
|
||||
placeholder="请输入搜索的关键字"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CommonHead",
|
||||
data() {
|
||||
return {
|
||||
searchData: "",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
newlyClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("newly-data");
|
||||
},
|
||||
updateClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("update-data");
|
||||
},
|
||||
newlyTwoClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("newly-two-data");
|
||||
},
|
||||
updateTwoClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("update-two-data");
|
||||
},
|
||||
newlyClassClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("newly-class-data");
|
||||
},
|
||||
updateClassClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("update-class-data");
|
||||
},
|
||||
resetClick() {
|
||||
this.$emit("reset-data");
|
||||
},
|
||||
searchClick() {
|
||||
this.$emit("search-data", this.searchData);
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<el-table
|
||||
border
|
||||
:header-cell-style="{
|
||||
background: '#f5f7fa',
|
||||
}"
|
||||
:data="tableData"
|
||||
style="width: 100%; margin-top: 20px"
|
||||
height="650"
|
||||
size="mini"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="
|
||||
column.label !== 'id' &&
|
||||
column.label !== '审批人Id' &&
|
||||
column.label !== '抄送人Id'
|
||||
"
|
||||
v-for="(column, index) in tableColumns"
|
||||
:key="index"
|
||||
:prop="column.prop"
|
||||
:label="column.label"
|
||||
width="auto"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="column.type === 'text'"> {{ scope.row[column.prop] }}</span>
|
||||
<div v-else-if="column.type === 'image'">
|
||||
<img style="width: 200px; height: 100px" :src="scope.row[column.prop]" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@click="handleEdit(scope.row)"
|
||||
class="el-icon-edit"
|
||||
type="text"
|
||||
size="small"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm @confirm="handleDelete(scope.row)" :title="'确定要删除吗?'">
|
||||
<el-button
|
||||
slot="reference"
|
||||
style="margin-left: 10px; color: red"
|
||||
class="el-icon-delete"
|
||||
type="text"
|
||||
size="small"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "CommonTablesImg",
|
||||
props: {
|
||||
columns: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
deleteFunc: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
editFunc: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
// 删除事件
|
||||
handleDelete(row) {
|
||||
this.deleteFunc(row.id);
|
||||
},
|
||||
// 编辑事件
|
||||
handleEdit(row) {
|
||||
console.log(row);
|
||||
this.editFunc(row);
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
tableColumns() {
|
||||
// 处理传进来的列配置,返回符合 Element UI 表格要求的配置
|
||||
return this.columns.map((column) => {
|
||||
return {
|
||||
label: column.label,
|
||||
prop: column.prop,
|
||||
type: column.type,
|
||||
};
|
||||
});
|
||||
},
|
||||
tableData() {
|
||||
// 处理传进来的数据,返回符合 Element UI 表格要求的数据
|
||||
return this.data.map((rowData) => {
|
||||
let row = {};
|
||||
for (let column of this.columns) {
|
||||
row[column.prop] = rowData[column.prop];
|
||||
}
|
||||
return row;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="side-nav">
|
||||
<h3>班级管理</h3>
|
||||
<div>
|
||||
<el-tree :data="classArr" node-key="classId"
|
||||
ref="areaTrees"
|
||||
:default-expanded-keys="defaultCheckedKeys"
|
||||
:default-checked-keys="defaultCheckedKeys"
|
||||
accordion
|
||||
:highlight-current="true"
|
||||
:props="defaultProps" @node-click="handleNodeClick"
|
||||
></el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-adapt-container">
|
||||
<el-card shadow="hover">
|
||||
<h4>{{ classData.className}}</h4>
|
||||
</el-card>
|
||||
<el-card shadow="hover" style=" margin-top: 20px;" >
|
||||
<el-table
|
||||
:data="studentArr"
|
||||
:row-style="{ height: '50px' }"
|
||||
border
|
||||
>
|
||||
<el-table-column label="学生姓名" prop="name"></el-table-column>
|
||||
<el-table-column label="学生照片" prop="faceImg">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.faceImg" alt="" style="width: 100px; height: 100px;">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号" prop="mobile"></el-table-column>
|
||||
<el-table-column label="家长" prop="relation"></el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
<Pagination
|
||||
:total="total"
|
||||
:pageNum="query.current"
|
||||
:pageSize="query.size"
|
||||
@clickCurrent="onClickCurrent"
|
||||
@clickSize="onClickSize"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import columns from "./columns";
|
||||
import { getClass, getClassStudent } from "./api";
|
||||
import { formatDate } from "@/com/index";
|
||||
import CommonHead from './components/CommonHead.vue'
|
||||
|
||||
export default {
|
||||
name: "deviceManagement",
|
||||
data() {
|
||||
return {
|
||||
columns,
|
||||
total: 0,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'childrenList',
|
||||
label: 'className'
|
||||
},
|
||||
loading: false,
|
||||
equipmentList: [],
|
||||
dialogVisible: false,
|
||||
classArr: [],
|
||||
studentArr: [],// 学生列表
|
||||
classData: {
|
||||
classId: null,
|
||||
className: ''
|
||||
}, // 选中的班级
|
||||
total: 0,
|
||||
defaultCheckedKeys: []
|
||||
};
|
||||
},
|
||||
components: {
|
||||
CommonHead,
|
||||
},
|
||||
async created() {
|
||||
this.classList()
|
||||
const defaultCheckClass= localStorage.getItem('defaultCheckClass')
|
||||
if(defaultCheckClass){
|
||||
this.classData = JSON.parse(defaultCheckClass)
|
||||
this.defaultCheckedKeys = [this.classData.classId]
|
||||
this.studentList(this.classData.classId)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleNodeClick(item) {
|
||||
if(item.childrenList.length == 0) {
|
||||
this.studentList(item.classId)
|
||||
this.classData = item
|
||||
localStorage.setItem('defaultCheckClass', JSON.stringify(this.classData) )
|
||||
|
||||
}
|
||||
},
|
||||
// 班级列表
|
||||
classList(){
|
||||
getClass().then( res =>{
|
||||
this.classArr = res
|
||||
})
|
||||
},
|
||||
// 获取班级学生列表
|
||||
studentList(classId){
|
||||
getClassStudent(classId, this.query).then( res =>{
|
||||
this.studentArr = res.records
|
||||
this.total = res.total
|
||||
})
|
||||
},
|
||||
// 点击切换页数
|
||||
onClickCurrent(val) {
|
||||
this.query.current = val;
|
||||
this.studentList(this.classData.classId);
|
||||
},
|
||||
// 点击了每页页数
|
||||
onClickSize(val) {
|
||||
this.query.size = val;
|
||||
this.studentList(this.classData.classId);
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box{
|
||||
display: flex;
|
||||
.side-nav{
|
||||
width: 250px;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20px 20px 20px 20px;
|
||||
box-sizing: border-box;
|
||||
margin-right: 20px;
|
||||
h3{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.form-adapt-container{
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.material-list{
|
||||
width: 100%;
|
||||
.top-box{
|
||||
display: flex;
|
||||
}
|
||||
.label{
|
||||
display: flex; flex: 1; align-items: center;
|
||||
height: 36px;
|
||||
}
|
||||
.delete-box{
|
||||
width: 30px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.content::-webkit-scrollbar {
|
||||
width: 0; /* 设置滚动条的宽度 */
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,20 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取部门列表
|
||||
export function getClass () {
|
||||
return request({
|
||||
url: '/manager/dept/list',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 获取部门用户列表
|
||||
export function getClassStudent (deptId, params) {
|
||||
return request({
|
||||
url: `/manager/user/list/${deptId}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
export default [
|
||||
{
|
||||
label: "设备id",
|
||||
prop: "deviceId",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "账号名称",
|
||||
prop: "username",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
{
|
||||
label: "设备名称",
|
||||
prop: "deviceName",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
prop: "username",
|
||||
type: "image",
|
||||
},
|
||||
{
|
||||
label: "密码",
|
||||
prop: "password",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
label: "设备标签",
|
||||
prop: "deviceLabel",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "设备地址",
|
||||
prop: "deviceUrl",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
label: "设备状态",
|
||||
prop: "deviceStatus",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
{
|
||||
label: "设备物理地址",
|
||||
prop: "macAddress",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
]
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button @click="newlyClick" type="primary" size="mini" icon="el-icon-plus"
|
||||
>新增食谱</el-button
|
||||
>
|
||||
<!-- <el-button @click="updateClick" icon="el-icon-edit" size="mini" >修改食谱</el-button>
|
||||
<el-button @click="newlyTwoClick" type="success" size="mini" icon="el-icon-plus"
|
||||
>新增周次</el-button
|
||||
>
|
||||
<el-button @click="updateTwoClick" icon="el-icon-edit" size="mini" >修改周次</el-button>
|
||||
<el-button @click="newlyClassClick" type="warning" size="mini" icon="el-icon-plus">新增食谱总类别</el-button>
|
||||
<el-button @click="updateClassClick" icon="el-icon-edit" size="mini" >修改食谱类别</el-button> -->
|
||||
<!-- <el-button @click="resetClick" type="info" size="mini" icon="iconfont icon-biaodan"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button @click="searchClick" type="warning" size="mini" icon="el-icon-search"
|
||||
>搜索</el-button
|
||||
> -->
|
||||
<el-input
|
||||
v-if="false"
|
||||
v-model="searchData"
|
||||
size="mini"
|
||||
style="width: 20%"
|
||||
placeholder="请输入搜索的关键字"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CommonHead",
|
||||
data() {
|
||||
return {
|
||||
searchData: "",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
newlyClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("newly-data");
|
||||
},
|
||||
updateClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("update-data");
|
||||
},
|
||||
newlyTwoClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("newly-two-data");
|
||||
},
|
||||
updateTwoClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("update-two-data");
|
||||
},
|
||||
newlyClassClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("newly-class-data");
|
||||
},
|
||||
updateClassClick() {
|
||||
// 在此处调用父组件传入的方法叫父组件做事情
|
||||
this.$emit("update-class-data");
|
||||
},
|
||||
resetClick() {
|
||||
this.$emit("reset-data");
|
||||
},
|
||||
searchClick() {
|
||||
this.$emit("search-data", this.searchData);
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<el-table
|
||||
border
|
||||
:header-cell-style="{
|
||||
background: '#f5f7fa',
|
||||
}"
|
||||
:data="tableData"
|
||||
style="width: 100%; margin-top: 20px"
|
||||
height="650"
|
||||
size="mini"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="
|
||||
column.label !== 'id' &&
|
||||
column.label !== '审批人Id' &&
|
||||
column.label !== '抄送人Id'
|
||||
"
|
||||
v-for="(column, index) in tableColumns"
|
||||
:key="index"
|
||||
:prop="column.prop"
|
||||
:label="column.label"
|
||||
width="auto"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="column.type === 'text'"> {{ scope.row[column.prop] }}</span>
|
||||
<div v-else-if="column.type === 'image'">
|
||||
<img style="width: 200px; height: 100px" :src="scope.row[column.prop]" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@click="handleEdit(scope.row)"
|
||||
class="el-icon-edit"
|
||||
type="text"
|
||||
size="small"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm @confirm="handleDelete(scope.row)" :title="'确定要删除吗?'">
|
||||
<el-button
|
||||
slot="reference"
|
||||
style="margin-left: 10px; color: red"
|
||||
class="el-icon-delete"
|
||||
type="text"
|
||||
size="small"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "CommonTablesImg",
|
||||
props: {
|
||||
columns: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
deleteFunc: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
editFunc: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
// 删除事件
|
||||
handleDelete(row) {
|
||||
this.deleteFunc(row.id);
|
||||
},
|
||||
// 编辑事件
|
||||
handleEdit(row) {
|
||||
console.log(row);
|
||||
this.editFunc(row);
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
tableColumns() {
|
||||
// 处理传进来的列配置,返回符合 Element UI 表格要求的配置
|
||||
return this.columns.map((column) => {
|
||||
return {
|
||||
label: column.label,
|
||||
prop: column.prop,
|
||||
type: column.type,
|
||||
};
|
||||
});
|
||||
},
|
||||
tableData() {
|
||||
// 处理传进来的数据,返回符合 Element UI 表格要求的数据
|
||||
return this.data.map((rowData) => {
|
||||
let row = {};
|
||||
for (let column of this.columns) {
|
||||
row[column.prop] = rowData[column.prop];
|
||||
}
|
||||
return row;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="side-nav">
|
||||
<h3>班级管理</h3>
|
||||
<div>
|
||||
<el-tree :data="classArr" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-adapt-container">
|
||||
<el-card shadow="hover">
|
||||
<h4>{{ classData.className}}</h4>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="hover" style=" margin-top: 20px;" >
|
||||
<el-table
|
||||
:data="studentArr"
|
||||
:row-style="{ height: '50px' }"
|
||||
border
|
||||
>
|
||||
<el-table-column label="学生姓名" prop="name"></el-table-column>
|
||||
<el-table-column label="学生照片" prop="faceImg">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.faceImg" alt="" style="width: 100px; height: 100px;">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="家长姓名" prop="name"></el-table-column>
|
||||
<el-table-column label="手机号" prop="name"></el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
<Pagination
|
||||
:total="total"
|
||||
:pageNum="query.current"
|
||||
:pageSize="query.size"
|
||||
@clickCurrent="onClickCurrent"
|
||||
@clickSize="onClickSize"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import columns from "./columns";
|
||||
import { getClass, getClassStudent } from "./api";
|
||||
import { formatDate } from "@/com/index";
|
||||
import CommonHead from './components/CommonHead.vue'
|
||||
|
||||
export default {
|
||||
name: "deviceManagement",
|
||||
data() {
|
||||
return {
|
||||
columns,
|
||||
total: 0,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
defaultProps: {
|
||||
children: 'childrenList',
|
||||
label: 'className'
|
||||
},
|
||||
loading: false,
|
||||
equipmentList: [],
|
||||
dialogVisible: false,
|
||||
classArr: [],
|
||||
studentArr: [],// 学生列表
|
||||
classData: {}, // 选中的班级
|
||||
classId: {}, // 选中的班级
|
||||
};
|
||||
},
|
||||
components: {
|
||||
CommonHead,
|
||||
},
|
||||
async created() {
|
||||
// this.query.superId = 851392899;
|
||||
// console.log(config)
|
||||
// this.getAttendanceFormData();
|
||||
// this.semesterList()
|
||||
this.classList()
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleNodeClick(item) {
|
||||
this.classData = item
|
||||
if(item.childrenList.length == 0) {
|
||||
this.studentList(item.classId)
|
||||
this.classId = classId.classId
|
||||
}
|
||||
},
|
||||
// 班级列表
|
||||
classList(){
|
||||
getClass().then( res =>{
|
||||
this.classArr = res
|
||||
})
|
||||
},
|
||||
// 获取班级学生列表
|
||||
studentList(classId){
|
||||
getClassStudent(classId, this.query).then( res =>{
|
||||
this.studentArr = res.student
|
||||
})
|
||||
},
|
||||
// 点击切换页数
|
||||
onClickCurrent(val) {
|
||||
this.query.current = val;
|
||||
this.studentList(this.classId);
|
||||
},
|
||||
// 点击了每页页数
|
||||
onClickSize(val) {
|
||||
this.query.size = val;
|
||||
this.studentList(this.classId);
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box{
|
||||
display: flex;
|
||||
.side-nav{
|
||||
width: 250px;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20px 20px 20px 20px;
|
||||
box-sizing: border-box;
|
||||
margin-right: 20px;
|
||||
h3{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.form-adapt-container{
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.material-list{
|
||||
width: 100%;
|
||||
.top-box{
|
||||
display: flex;
|
||||
}
|
||||
.label{
|
||||
display: flex; flex: 1; align-items: center;
|
||||
height: 36px;
|
||||
}
|
||||
.delete-box{
|
||||
width: 30px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.content::-webkit-scrollbar {
|
||||
width: 0; /* 设置滚动条的宽度 */
|
||||
}
|
||||
</style>
|
||||
@@ -1,4 +1,4 @@
|
||||
import request from '@/utils/request';
|
||||
import request from '@/utils/logoRequest';
|
||||
|
||||
// 登录
|
||||
export function login (data) {
|
||||
|
||||
@@ -174,7 +174,6 @@ export default {
|
||||
this.submit.loading = true;
|
||||
this.$router.push('/evaluate')
|
||||
console.log(this.$router)
|
||||
localStorage.setItem('token', 123)
|
||||
|
||||
if( rulesPhone(this.loginForm.phone) ){ // 判断是否存在手机号验证码
|
||||
if(this.loginForm.code){
|
||||
@@ -186,9 +185,23 @@ export default {
|
||||
}
|
||||
this.$store.dispatch('loginIn', formData).then(res =>{
|
||||
this.$message.success('登录成功!')
|
||||
Session.set('token',res.token_type +' ' + res.access_token)
|
||||
// this.$router.push('/evaluate')
|
||||
// 设置用户信息 学校信息 班级信息
|
||||
let user = this.$store.state.user
|
||||
if(user.campusInfo ){
|
||||
if(user.campusInfo.length >= 1){ // 说明只有一个校区
|
||||
if(user.campusInfo[0].classInfo){
|
||||
this.$store.commit('setSchool', user.campusInfo[0] ); // 设置默认校区
|
||||
}
|
||||
}
|
||||
}else { // 未查到校区信息
|
||||
|
||||
}
|
||||
|
||||
this.oldSet()
|
||||
|
||||
|
||||
}).finally(err =>{
|
||||
this.submit.loading = false;
|
||||
this.sendText = '发送'
|
||||
|
||||
Reference in New Issue
Block a user