|
@@ -1,105 +1,118 @@
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
-@import './Index.less';
|
|
|
|
|
|
+@import "./Index.less";
|
|
</style>
|
|
</style>
|
|
<style lang="less">
|
|
<style lang="less">
|
|
-@import './IndexIview.less';
|
|
|
|
|
|
+@import "./IndexIview.less";
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="sc-container">
|
|
<div class="sc-container">
|
|
<Loading v-if="isloading == true"></Loading>
|
|
<Loading v-if="isloading == true"></Loading>
|
|
- <!--菜单栏-->
|
|
|
|
- <div class="sc-menu">
|
|
|
|
- <div class="sc-menu-left dark-iview-select">
|
|
|
|
- <!-- 學制Select -->
|
|
|
|
- <Select v-model="searchPeriod" style="width: 120px" :placeholder="$t('stuAccount.periodHolder')" @on-change="filterData">
|
|
|
|
- <Option v-for="(item, index) in periods" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- <!-- 學級Select -->
|
|
|
|
- <Select v-model="searchGrade" style="width: 120px; margin-left: 5px" :placeholder="$t('stuAccount.gradeHolder')" :not-found-text="$t('stuAccount.sltPdFirst')" clearable @on-change="filterData">
|
|
|
|
- <Option v-for="(item, index) in filterGrades" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- <!-- 教室Select -->
|
|
|
|
- <Select v-model="searchClassroom" ref="classroom" style="width: 150px; margin-left: 5px" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterData" :not-found-text="searchGrade ? $t('stuAccount.noClass') : $t('stuAccount.sltGdFirst')">
|
|
|
|
- <Option v-for="(item, index) in filterClasses" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
|
- <Option value="noclass">{{$t('stuAccount.noRelClass')}}</Option>
|
|
|
|
- </Select>
|
|
|
|
- <!-- 字串模糊搜尋 -->
|
|
|
|
- <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px; margin-left: 20px" search @on-search="filterData" @on-clear="filterData" />
|
|
|
|
- </div>
|
|
|
|
- <div class="sc-menu-right sc-text-no-select" v-if="authorizationStatus == false">
|
|
|
|
- <ul v-if="$access.can('admin.*|student-upd')">
|
|
|
|
- <!--授權管理開關-->
|
|
|
|
- <li @click="showAuthorization()">
|
|
|
|
- <Icon custom="iconfont icon-auth-key" color="white" size="18" />
|
|
|
|
- <span>{{ $t('stuAccount.menuAuth') }}</span>
|
|
|
|
- </li>
|
|
|
|
- <!--授權管理開關-->
|
|
|
|
- <li @click="importStudent()">
|
|
|
|
- <Icon type="md-arrow-round-up" color="white" size="18" />
|
|
|
|
- <span>{{ $t('stuAccount.importStu') }}</span>
|
|
|
|
- </li>
|
|
|
|
- <li @click="addStudent()">
|
|
|
|
- <Icon type="md-add" color="white" size="18" />
|
|
|
|
- <span>{{ $t('stuAccount.addStu') }}</span>
|
|
|
|
- </li>
|
|
|
|
- <li @click="delStudent(-1)" :class="selections.length > 0 ? '' : 'sc-disable-cursor'">
|
|
|
|
- <Icon type="md-trash" :color="selections.length > 0 ? 'white' : '#606060'" size="18" />
|
|
|
|
- <span>{{ $t('stuAccount.delStu') }}</span>
|
|
|
|
- </li>
|
|
|
|
- <li @click="editStudent()" :class="selections.length > 0 ? '' : 'sc-disable-cursor'">
|
|
|
|
- <Icon type="md-create" :color="selections.length > 0 ? 'white' : '#606060'" size="18" />
|
|
|
|
- <span>{{ $t('stuAccount.editInfo') }}</span>
|
|
|
|
- </li>
|
|
|
|
- <li @click="resetPW(-1)" :class="selections.length > 0 ? '' : 'sc-disable-cursor'">
|
|
|
|
- <Icon custom="iconfont icon-reset" :color="selections.length > 0 ? 'white' : '#606060'" size="18" />
|
|
|
|
- <span>{{$t('stuAccount.resetPw')}}</span>
|
|
|
|
- </li>
|
|
|
|
- </ul>
|
|
|
|
|
|
+ <!-- tab切换 -->
|
|
|
|
+ <div class="stu-mgt-header">
|
|
|
|
+ <div class="tab-box">
|
|
|
|
+ <span class="pane" @click="tab = 'list'" :class="{ active: tab === 'list' }">
|
|
|
|
+ 学生管理
|
|
|
|
+ </span>
|
|
|
|
+ <span class="pane" @click="tab = 'class'" :class="{ active: tab === 'class' }">
|
|
|
|
+ 班级管理
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <!--学生账号table-->
|
|
|
|
- <div class="sc-content dark-iview-table"
|
|
|
|
- style="position: relative; padding-left: 20px"
|
|
|
|
- :style="{width: authorizationStatus == true ? '70%' : '100%',transition: 'all 0.7s'}">
|
|
|
|
- <Scroll :on-reach-bottom="scrollLoad" height="750" :distance-to-edge="[15, 15]">
|
|
|
|
- <Table ref="selection" :columns="tableColumns" :data="tableShowData" :loading="tableLoading" @on-selection-change="getSelectInfo">
|
|
|
|
- <template slot-scope="{ row }" slot="status">
|
|
|
|
- <Icon custom="iconfont icon-auth-key"
|
|
|
|
- size="25"
|
|
|
|
- :style="{
|
|
|
|
|
|
+ <!-- 账号管理 -->
|
|
|
|
+ <div v-show="tab == 'list'">
|
|
|
|
+ <!--菜单栏-->
|
|
|
|
+ <div class="sc-menu">
|
|
|
|
+ <div class="sc-menu-left dark-iview-select">
|
|
|
|
+ <!-- 學制Select -->
|
|
|
|
+ <Select v-model="searchPeriod" style="width: 120px" :placeholder="$t('stuAccount.periodHolder')" @on-change="filterData">
|
|
|
|
+ <Option v-for="(item, index) in periods" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
|
+ </Select>
|
|
|
|
+ <!-- 學級Select -->
|
|
|
|
+ <Select v-model="searchGrade" style="width: 150px; margin-left: 5px" :placeholder="$t('stuAccount.gradeHolder')" :not-found-text="$t('stuAccount.sltPdFirst')" clearable @on-change="filterData">
|
|
|
|
+ <Option v-for="(item, index) in years" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
|
+ </Select>
|
|
|
|
+ <!-- 教室Select -->
|
|
|
|
+ <Select v-model="searchClassroom" ref="classroom" style="width: 150px; margin-left: 5px" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterData" :not-found-text="searchGrade ? $t('stuAccount.noClass') : $t('stuAccount.sltGdFirst')">
|
|
|
|
+ <Option v-for="(item, index) in filterClasses" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
|
+ <Option value="noclass">{{$t('stuAccount.noRelClass')}}</Option>
|
|
|
|
+ </Select>
|
|
|
|
+ <!-- 字串模糊搜尋 -->
|
|
|
|
+ <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px; margin-left: 20px" search @on-search="filterData" @on-clear="filterData" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="sc-menu-right sc-text-no-select" v-if="authorizationStatus == false">
|
|
|
|
+ <ul v-if="$access.can('admin.*|student-upd')">
|
|
|
|
+ <!--授權管理開關-->
|
|
|
|
+ <li @click="showAuthorization()">
|
|
|
|
+ <Icon custom="iconfont icon-auth-key" color="white" size="18" />
|
|
|
|
+ <span>{{ $t('stuAccount.menuAuth') }}</span>
|
|
|
|
+ </li>
|
|
|
|
+ <!--授權管理開關-->
|
|
|
|
+ <li @click="importStudent()">
|
|
|
|
+ <Icon type="md-arrow-round-up" color="white" size="18" />
|
|
|
|
+ <span>{{ $t('stuAccount.importStu') }}</span>
|
|
|
|
+ </li>
|
|
|
|
+ <li @click="addStudent()">
|
|
|
|
+ <Icon type="md-add" color="white" size="18" />
|
|
|
|
+ <span>{{ $t('stuAccount.addStu') }}</span>
|
|
|
|
+ </li>
|
|
|
|
+ <li @click="delStudent(-1)" :class="selections.length > 0 ? '' : 'sc-disable-cursor'">
|
|
|
|
+ <Icon type="md-trash" :color="selections.length > 0 ? 'white' : '#606060'" size="18" />
|
|
|
|
+ <span>{{ $t('stuAccount.delStu') }}</span>
|
|
|
|
+ </li>
|
|
|
|
+ <li @click="editStudent()" :class="selections.length > 0 ? '' : 'sc-disable-cursor'">
|
|
|
|
+ <Icon type="md-create" :color="selections.length > 0 ? 'white' : '#606060'" size="18" />
|
|
|
|
+ <span>{{ $t('stuAccount.editInfo') }}</span>
|
|
|
|
+ </li>
|
|
|
|
+ <li @click="resetPW(-1)" :class="selections.length > 0 ? '' : 'sc-disable-cursor'">
|
|
|
|
+ <Icon custom="iconfont icon-reset" :color="selections.length > 0 ? 'white' : '#606060'" size="18" />
|
|
|
|
+ <span>{{$t('stuAccount.resetPw')}}</span>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!--学生账号table-->
|
|
|
|
+ <div class="sc-content dark-iview-table" style="position: relative; padding-left: 20px" :style="{width: authorizationStatus == true ? '70%' : '100%',transition: 'all 0.7s'}">
|
|
|
|
+ <Scroll :on-reach-bottom="scrollLoad" height="750" :distance-to-edge="[15, 15]">
|
|
|
|
+ <Table ref="selection" :columns="tableColumns" :data="tableShowData" :loading="tableLoading" @on-selection-change="getSelectInfo">
|
|
|
|
+ <template slot-scope="{ row }" slot="status">
|
|
|
|
+ <Icon custom="iconfont icon-auth-key" size="25" :style="{
|
|
color: aclassOneInfoNum != undefined && (aclassOneInfoNum.staIds.includes(row.id) == true || aclassOneInfoNum.dyncIds.includes(row.id)) == true ? '#00f492' : '#565656'
|
|
color: aclassOneInfoNum != undefined && (aclassOneInfoNum.staIds.includes(row.id) == true || aclassOneInfoNum.dyncIds.includes(row.id)) == true ? '#00f492' : '#565656'
|
|
}" />
|
|
}" />
|
|
- </template>
|
|
|
|
- <template slot-scope="{ row, index }" slot="header">
|
|
|
|
- <!--<span class="name-header" :style="{background:bgColor[index % 12]}">{{getFirstChart(row.name)}}</span>-->
|
|
|
|
- <PersonalPhoto :name="row.name" :picture="row.picture" :color="bgColor[index % 12]" />
|
|
|
|
- </template>
|
|
|
|
- <template slot-scope="{ row }" slot="gradeId" v-if="authorizationStatus == false">
|
|
|
|
- <span>{{ getGradeName(row.gradeId) }}</span>
|
|
|
|
- </template>
|
|
|
|
- <template slot-scope="{ row }" slot="classId">
|
|
|
|
- <span>{{ row.className }}</span>
|
|
|
|
- </template>
|
|
|
|
- <template slot-scope="{ row }" slot="no">
|
|
|
|
- <span>{{ row.no }}</span>
|
|
|
|
- </template>
|
|
|
|
- <template slot-scope="{ row }" slot="gradeName">
|
|
|
|
- <span>{{ row.gradeName }}</span>
|
|
|
|
- </template>
|
|
|
|
- <template slot-scope="{ row }" slot="action" v-if="authorizationStatus == false">
|
|
|
|
- <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
|
- <Icon type="md-create" size="18" color="white" @click="editStudent(row)" title="修改" />
|
|
|
|
- <Icon custom="iconfont icon-reset" size="18" color="white" @click="resetPW(row)" :title=" $t('stuAccount.resetPw')" />
|
|
|
|
- <Icon type="md-trash" size="18" color="white" @click="delStudent(row)" :title="$t('stuAccount.delStu')" />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </Table>
|
|
|
|
- </Scroll>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="{ row, index }" slot="header">
|
|
|
|
+ <!--<span class="name-header" :style="{background:bgColor[index % 12]}">{{getFirstChart(row.name)}}</span>-->
|
|
|
|
+ <PersonalPhoto :name="row.name" :picture="row.picture" :color="bgColor[index % 12]" />
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="{ row }" slot="gradeId" v-if="authorizationStatus == false">
|
|
|
|
+ <span>{{ getGradeName(row.gradeId) }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="{ row }" slot="classId">
|
|
|
|
+ <span>{{ row.className }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="{ row }" slot="no">
|
|
|
|
+ <span>{{ row.no }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="{ row }" slot="gradeName">
|
|
|
|
+ <span>{{ row.gradeName }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot-scope="{ row }" slot="action" v-if="authorizationStatus == false">
|
|
|
|
+ <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
|
+ <Icon type="md-create" size="18" color="white" @click="editStudent(row)" title="修改" />
|
|
|
|
+ <Icon custom="iconfont icon-reset" size="18" color="white" @click="resetPW(row)" :title=" $t('stuAccount.resetPw')" />
|
|
|
|
+ <Icon type="md-trash" size="18" color="white" @click="delStudent(row)" :title="$t('stuAccount.delStu')" />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </Table>
|
|
|
|
+ </Scroll>
|
|
|
|
|
|
- <AclassOneAuth :students="students" :selected="selections" @closeAuth="closeAuth" :closefromBtn="closefromBtn" />
|
|
|
|
|
|
+ <AclassOneAuth :students="students" :selected="selections" @closeAuth="closeAuth" :closefromBtn="closefromBtn" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 班级管理 -->
|
|
|
|
+ <div v-show="tab == 'class'" class="class-mgt-wrap" id="class-mgt-list">
|
|
|
|
+ <ClassMgt></ClassMgt>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
<Modal v-model="addStudentStatus" width="520" class-name="add-student dark-iview-modal" :mask-closable="false">
|
|
<Modal v-model="addStudentStatus" width="520" class-name="add-student dark-iview-modal" :mask-closable="false">
|
|
<add-student v-if="addStudentStatus" :schoolCode="$store.state.user.schoolCode" :isShow="addStudentStatus" :editStudentInfo="editStudentInfo" @saveStudentInfo="closeAddStudent" :bizType="bizType"></add-student>
|
|
<add-student v-if="addStudentStatus" :schoolCode="$store.state.user.schoolCode" :isShow="addStudentStatus" :editStudentInfo="editStudentInfo" @saveStudentInfo="closeAddStudent" :bizType="bizType"></add-student>
|
|
<div slot="footer"></div>
|
|
<div slot="footer"></div>
|
|
@@ -127,11 +140,11 @@
|
|
<script>
|
|
<script>
|
|
import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
import AddStudent from './AddStudent'
|
|
import AddStudent from './AddStudent'
|
|
|
|
+import ClassMgt from './ClassMgt'
|
|
import ImportStudent from './ImportStudent'
|
|
import ImportStudent from './ImportStudent'
|
|
import Authorization from './Authorization'
|
|
import Authorization from './Authorization'
|
|
import AclassOneAuth from './AclassOneAuth'
|
|
import AclassOneAuth from './AclassOneAuth'
|
|
import { mapGetters, mapMutations } from 'vuex'
|
|
import { mapGetters, mapMutations } from 'vuex'
|
|
-import Loading from '@/common/Loading.vue'
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
AddStudent,
|
|
AddStudent,
|
|
@@ -139,10 +152,11 @@ export default {
|
|
Authorization,
|
|
Authorization,
|
|
PersonalPhoto,
|
|
PersonalPhoto,
|
|
AclassOneAuth,
|
|
AclassOneAuth,
|
|
- Loading
|
|
|
|
|
|
+ ClassMgt
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ tab: 'list',
|
|
totalNum: 0,
|
|
totalNum: 0,
|
|
bgColor: ['#4ECDC4', '#F99406', '#075CD0', '#F7CA17', '#F2774B', '#67809F', '#BF55ED', '#00B169', '#F72459', '#F15A22', '#03C9A8', '#9A1294'],
|
|
bgColor: ['#4ECDC4', '#F99406', '#075CD0', '#F7CA17', '#F2774B', '#67809F', '#BF55ED', '#00B169', '#F72459', '#F15A22', '#03C9A8', '#9A1294'],
|
|
classroomList: [],
|
|
classroomList: [],
|
|
@@ -151,7 +165,9 @@ export default {
|
|
searchPeriod: '',
|
|
searchPeriod: '',
|
|
searchGrade: '',
|
|
searchGrade: '',
|
|
searchClassroom: '',
|
|
searchClassroom: '',
|
|
- schoolData: {},
|
|
|
|
|
|
+ schoolBase: {
|
|
|
|
+ period: []
|
|
|
|
+ },
|
|
tableLoading: true,
|
|
tableLoading: true,
|
|
searchText: '',
|
|
searchText: '',
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
@@ -184,11 +200,11 @@ export default {
|
|
if (row != -1) {
|
|
if (row != -1) {
|
|
this.$Modal.confirm({
|
|
this.$Modal.confirm({
|
|
title: this.$t('cusMgt.resetPw'),
|
|
title: this.$t('cusMgt.resetPw'),
|
|
- content: '<p>' + this.$t('cusMgt.resetPwContent1') + " <strong style='color:red;'>" + row.name + '</strong>'+ this.$t('cusMgt.resetPwContent1') +'?</p>',
|
|
|
|
|
|
+ content: '<p>' + this.$t('cusMgt.resetPwContent1') + " <strong style='color:red;'>" + row.name + '</strong>' + this.$t('cusMgt.resetPwContent1') + '?</p>',
|
|
onOk: () => {
|
|
onOk: () => {
|
|
let ids = []
|
|
let ids = []
|
|
row.pw = row.id
|
|
row.pw = row.id
|
|
- row.year = row.year ? row.year.toString() :''
|
|
|
|
|
|
+ row.year = row.year ? row.year.toString() : ''
|
|
delete row.no
|
|
delete row.no
|
|
ids.push(row)
|
|
ids.push(row)
|
|
this.tableLoading = true
|
|
this.tableLoading = true
|
|
@@ -209,10 +225,10 @@ export default {
|
|
if (this.selections.length > 0) {
|
|
if (this.selections.length > 0) {
|
|
this.$Modal.confirm({
|
|
this.$Modal.confirm({
|
|
title: this.$t('cusMgt.resetPw'),
|
|
title: this.$t('cusMgt.resetPw'),
|
|
- content: '<p>' + this.$t('cusMgt.resetPwContent3') + " <strong style='color:red;'>" + this.selections.length + '</strong>'+ this.$t('cusMgt.resetPwContent4') +'</p>',
|
|
|
|
|
|
+ content: '<p>' + this.$t('cusMgt.resetPwContent3') + " <strong style='color:red;'>" + this.selections.length + '</strong>' + this.$t('cusMgt.resetPwContent4') + '</p>',
|
|
onOk: () => {
|
|
onOk: () => {
|
|
this.tableLoading = true
|
|
this.tableLoading = true
|
|
- let apiData = this.selections.map( (item) =>{
|
|
|
|
|
|
+ let apiData = this.selections.map((item) => {
|
|
let d = item
|
|
let d = item
|
|
d.pw = d.id
|
|
d.pw = d.id
|
|
delete d.no
|
|
delete d.no
|
|
@@ -290,7 +306,7 @@ export default {
|
|
data.studentInfos.year = parseInt(data.studentInfos.year)
|
|
data.studentInfos.year = parseInt(data.studentInfos.year)
|
|
newStudents.push(data.studentInfos)
|
|
newStudents.push(data.studentInfos)
|
|
} else if (data.action == 2) { // 修改
|
|
} else if (data.action == 2) { // 修改
|
|
- newStudents = data.studentInfos.map(function(item) {
|
|
|
|
|
|
+ newStudents = data.studentInfos.map(function (item) {
|
|
let temp = item
|
|
let temp = item
|
|
temp.pw = '******'
|
|
temp.pw = '******'
|
|
temp.year = parseInt(temp.year)
|
|
temp.year = parseInt(temp.year)
|
|
@@ -304,7 +320,7 @@ export default {
|
|
},
|
|
},
|
|
closeImportStudent(data) {
|
|
closeImportStudent(data) {
|
|
// 給一個 PW 讓AddStudent.vue 的Watch 可以動作
|
|
// 給一個 PW 讓AddStudent.vue 的Watch 可以動作
|
|
- let newStudents = data.map(function(item) {
|
|
|
|
|
|
+ let newStudents = data.map(function (item) {
|
|
let temp = item
|
|
let temp = item
|
|
temp.pw = '******'
|
|
temp.pw = '******'
|
|
temp.year = parseInt(temp.year)
|
|
temp.year = parseInt(temp.year)
|
|
@@ -324,7 +340,7 @@ export default {
|
|
this.isloading = false
|
|
this.isloading = false
|
|
}, 1000)
|
|
}, 1000)
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+
|
|
addStudent() {
|
|
addStudent() {
|
|
this.bizType = 1
|
|
this.bizType = 1
|
|
this.$refs.selection.clearCurrentRow()
|
|
this.$refs.selection.clearCurrentRow()
|
|
@@ -340,63 +356,63 @@ export default {
|
|
this.isloading = true
|
|
this.isloading = true
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.tableColumns = [
|
|
this.tableColumns = [
|
|
- {
|
|
|
|
- type: 'selection',
|
|
|
|
- width: 80,
|
|
|
|
- align: 'center'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- slot: 'header',
|
|
|
|
- title: ' ',
|
|
|
|
- align: 'center',
|
|
|
|
- width: 120
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- key: 'id',
|
|
|
|
- title: this.$t('stuAccount.account'),
|
|
|
|
- align: 'center',
|
|
|
|
- sortable: true,
|
|
|
|
- sortMethod: (a, b, type) => {
|
|
|
|
- if (type == 'asc') {
|
|
|
|
- return a.localeCompare(b)
|
|
|
|
- } else {
|
|
|
|
- return b.localeCompare(a)
|
|
|
|
|
|
+ {
|
|
|
|
+ type: 'selection',
|
|
|
|
+ width: 80,
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ slot: 'header',
|
|
|
|
+ title: ' ',
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 120
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ key: 'id',
|
|
|
|
+ title: this.$t('stuAccount.account'),
|
|
|
|
+ align: 'center',
|
|
|
|
+ sortable: true,
|
|
|
|
+ sortMethod: (a, b, type) => {
|
|
|
|
+ if (type == 'asc') {
|
|
|
|
+ return a.localeCompare(b)
|
|
|
|
+ } else {
|
|
|
|
+ return b.localeCompare(a)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- key: 'name',
|
|
|
|
- title: this.$t('stuAccount.stuName'),
|
|
|
|
- align: 'center',
|
|
|
|
- sortable: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- slot: 'classId',
|
|
|
|
- title: this.$t('stuAccount.classroomName'),
|
|
|
|
- align: 'center',
|
|
|
|
- sortable: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- key: 'no',
|
|
|
|
- title: this.$t('stuAccount.seatNo'),
|
|
|
|
- align: 'center',
|
|
|
|
- width: 120,
|
|
|
|
- sortable: true,
|
|
|
|
- sortMethod: (a, b, type) => {
|
|
|
|
- if (type == 'desc') {
|
|
|
|
- return parseInt(a) > parseInt(b) ? -1 : 1
|
|
|
|
- } else {
|
|
|
|
- return parseInt(a) < parseInt(b) ? -1 : 1
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ key: 'name',
|
|
|
|
+ title: this.$t('stuAccount.stuName'),
|
|
|
|
+ align: 'center',
|
|
|
|
+ sortable: true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ slot: 'classId',
|
|
|
|
+ title: this.$t('stuAccount.classroomName'),
|
|
|
|
+ align: 'center',
|
|
|
|
+ sortable: true
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ key: 'no',
|
|
|
|
+ title: this.$t('stuAccount.seatNo'),
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 120,
|
|
|
|
+ sortable: true,
|
|
|
|
+ sortMethod: (a, b, type) => {
|
|
|
|
+ if (type == 'desc') {
|
|
|
|
+ return parseInt(a) > parseInt(b) ? -1 : 1
|
|
|
|
+ } else {
|
|
|
|
+ return parseInt(a) < parseInt(b) ? -1 : 1
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ slot: 'status',
|
|
|
|
+ title: this.$t('stuAccount.authStatus'),
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 150,
|
|
|
|
+ sortable: true
|
|
}
|
|
}
|
|
- },
|
|
|
|
- {
|
|
|
|
- slot: 'status',
|
|
|
|
- title: this.$t('stuAccount.authStatus'),
|
|
|
|
- align: 'center',
|
|
|
|
- width: 150,
|
|
|
|
- sortable: true
|
|
|
|
- }
|
|
|
|
]
|
|
]
|
|
this.isloading = false
|
|
this.isloading = false
|
|
}, 1000)
|
|
}, 1000)
|
|
@@ -459,7 +475,7 @@ export default {
|
|
if (this.selections.length > 0) {
|
|
if (this.selections.length > 0) {
|
|
this.$Modal.confirm({
|
|
this.$Modal.confirm({
|
|
title: this.$t('stuAccount.tips2Title'),
|
|
title: this.$t('stuAccount.tips2Title'),
|
|
- content: '<p>' + this.$t('stuAccount.tips2Content3') + " <strong style='color:red;'>" + this.selections.length + '</strong>'+ this.$t('stuAccount.tips2Content4') +'</p>',
|
|
|
|
|
|
+ content: '<p>' + this.$t('stuAccount.tips2Content3') + " <strong style='color:red;'>" + this.selections.length + '</strong>' + this.$t('stuAccount.tips2Content4') + '</p>',
|
|
onOk: () => {
|
|
onOk: () => {
|
|
this.tableLoading = true
|
|
this.tableLoading = true
|
|
let delIds = this.selections.map(item => {
|
|
let delIds = this.selections.map(item => {
|
|
@@ -517,15 +533,34 @@ export default {
|
|
sortable: true
|
|
sortable: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- slot: 'gradeId',
|
|
|
|
- title: this.$t('stuAccount.grade'),
|
|
|
|
|
|
+ key: 'stuId',
|
|
|
|
+ title: '学号',
|
|
|
|
+ align: 'center',
|
|
|
|
+ sortable: true
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // slot: 'gradeId',
|
|
|
|
+ // title: this.$t('stuAccount.grade'),
|
|
|
|
+ // align: 'center',
|
|
|
|
+ // width: 140,
|
|
|
|
+ // sortable: true
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
|
|
+ key: 'year',
|
|
|
|
+ title: '学级',
|
|
align: 'center',
|
|
align: 'center',
|
|
width: 140,
|
|
width: 140,
|
|
sortable: true
|
|
sortable: true
|
|
},
|
|
},
|
|
|
|
+ // {
|
|
|
|
+ // slot: 'classId',
|
|
|
|
+ // title: this.$t('stuAccount.classroomName'),
|
|
|
|
+ // align: 'center',
|
|
|
|
+ // sortable: true
|
|
|
|
+ // },
|
|
{
|
|
{
|
|
slot: 'classId',
|
|
slot: 'classId',
|
|
- title: this.$t('stuAccount.classroomName'),
|
|
|
|
|
|
+ title: '班级',
|
|
align: 'center',
|
|
align: 'center',
|
|
sortable: true
|
|
sortable: true
|
|
},
|
|
},
|
|
@@ -547,7 +582,7 @@ export default {
|
|
slot: 'status',
|
|
slot: 'status',
|
|
title: this.$t('stuAccount.authStatus'),
|
|
title: this.$t('stuAccount.authStatus'),
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: 100,
|
|
|
|
|
|
+ width: 120,
|
|
sortable: true
|
|
sortable: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -564,7 +599,7 @@ export default {
|
|
res => {
|
|
res => {
|
|
this.tableLoading = false
|
|
this.tableLoading = false
|
|
// 給一個 PW 讓AddStudent.vue 的Watch 可以動作
|
|
// 給一個 PW 讓AddStudent.vue 的Watch 可以動作
|
|
- let newStudents = res.students.map(function(item) {
|
|
|
|
|
|
+ let newStudents = res.students.map(function (item) {
|
|
let temp = item
|
|
let temp = item
|
|
temp.pw = '******'
|
|
temp.pw = '******'
|
|
return temp
|
|
return temp
|
|
@@ -587,9 +622,9 @@ export default {
|
|
)
|
|
)
|
|
},
|
|
},
|
|
/** 取得年級Name */
|
|
/** 取得年級Name */
|
|
- getGradeName: function(gradeId) {
|
|
|
|
|
|
+ getGradeName: function (gradeId) {
|
|
if (gradeId != null) {
|
|
if (gradeId != null) {
|
|
- let gradeData = this.grades.filter(function(item) {
|
|
|
|
|
|
+ let gradeData = this.grades.filter(function (item) {
|
|
return item.id == gradeId
|
|
return item.id == gradeId
|
|
})
|
|
})
|
|
return gradeData[0].name
|
|
return gradeData[0].name
|
|
@@ -610,7 +645,7 @@ export default {
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
|
|
- scrollLoad: function() {
|
|
|
|
|
|
+ scrollLoad: function () {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
let maxLength = this.tableShowData.length
|
|
let maxLength = this.tableShowData.length
|
|
let temp = this.tableFilterData.slice(this.pointNum + 1, this.pointNum + this.basicCount)
|
|
let temp = this.tableFilterData.slice(this.pointNum + 1, this.pointNum + this.basicCount)
|
|
@@ -625,14 +660,14 @@ export default {
|
|
}, 1500)
|
|
}, 1500)
|
|
},
|
|
},
|
|
/**根据学段、年级、班级搜索 */
|
|
/**根据学段、年级、班级搜索 */
|
|
- filterData: function() {
|
|
|
|
|
|
+ filterData: function () {
|
|
let data = this.students
|
|
let data = this.students
|
|
|
|
|
|
// 筛选没有关联班级的学生
|
|
// 筛选没有关联班级的学生
|
|
if (this.searchClassroom == 'noclass') {
|
|
if (this.searchClassroom == 'noclass') {
|
|
if (this.searchClassroom) {
|
|
if (this.searchClassroom) {
|
|
let id = this.searchClassroom
|
|
let id = this.searchClassroom
|
|
- data = data.filter(function(item) {
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
return item.classId == null
|
|
return item.classId == null
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -646,7 +681,7 @@ export default {
|
|
// 帳號資訊搜尋
|
|
// 帳號資訊搜尋
|
|
if (this.searchText) {
|
|
if (this.searchText) {
|
|
let text = this.searchText
|
|
let text = this.searchText
|
|
- data = data.filter(function(item) {
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
return item.name.indexOf(text) >= 0 || item.id.indexOf(text) >= 0
|
|
return item.name.indexOf(text) >= 0 || item.id.indexOf(text) >= 0
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -654,23 +689,23 @@ export default {
|
|
// 學制篩選
|
|
// 學制篩選
|
|
if (this.searchPeriod) {
|
|
if (this.searchPeriod) {
|
|
let id = this.searchPeriod
|
|
let id = this.searchPeriod
|
|
- data = data.filter(function(item) {
|
|
|
|
- return item.periodId == id
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
|
|
+ return item.periodId == id
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
// 年級篩選
|
|
// 年級篩選
|
|
if (this.searchGrade) {
|
|
if (this.searchGrade) {
|
|
let id = this.searchGrade
|
|
let id = this.searchGrade
|
|
- data = data.filter(function(item) {
|
|
|
|
- return item.gradeId == id
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
|
|
+ return item.year == id
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
// 教室篩選
|
|
// 教室篩選
|
|
if (this.searchClassroom) {
|
|
if (this.searchClassroom) {
|
|
let id = this.searchClassroom
|
|
let id = this.searchClassroom
|
|
- data = data.filter(function(item) {
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
return item.classId == id
|
|
return item.classId == id
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -684,6 +719,11 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ this.$store.dispatch('user/getSchoolProfile').then(
|
|
|
|
+ res => {
|
|
|
|
+ this.schoolBase = res.school_base
|
|
|
|
+ }
|
|
|
|
+ )
|
|
this.initData()
|
|
this.initData()
|
|
this.baseFindStudent()
|
|
this.baseFindStudent()
|
|
},
|
|
},
|
|
@@ -695,11 +735,11 @@ export default {
|
|
students: 'schoolBaseInfo/getStudent', // 學生List
|
|
students: 'schoolBaseInfo/getStudent', // 學生List
|
|
aclassOneInfoNum: 'studentAclassOneAuth/getSchoolAclassOneInfoNum'
|
|
aclassOneInfoNum: 'studentAclassOneAuth/getSchoolAclassOneInfoNum'
|
|
}),
|
|
}),
|
|
- filterGrades: function() {
|
|
|
|
|
|
+ filterGrades: function () {
|
|
var data = this.grades
|
|
var data = this.grades
|
|
if (this.searchPeriod) {
|
|
if (this.searchPeriod) {
|
|
let periodId = this.searchPeriod
|
|
let periodId = this.searchPeriod
|
|
- data = data.filter(function(item) {
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
return item.periodId == periodId
|
|
return item.periodId == periodId
|
|
})
|
|
})
|
|
return data
|
|
return data
|
|
@@ -707,11 +747,11 @@ export default {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- filterClasses: function() {
|
|
|
|
|
|
+ filterClasses: function () {
|
|
var data = this.classes
|
|
var data = this.classes
|
|
if (this.searchGrade) {
|
|
if (this.searchGrade) {
|
|
let gradeId = this.searchGrade
|
|
let gradeId = this.searchGrade
|
|
- data = data.filter(function(item) {
|
|
|
|
|
|
+ data = data.filter(function (item) {
|
|
return item.gradeId == gradeId
|
|
return item.gradeId == gradeId
|
|
})
|
|
})
|
|
return data
|
|
return data
|
|
@@ -719,20 +759,49 @@ export default {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getPeriodName: function() {
|
|
|
|
|
|
+ getPeriodName: function () {
|
|
let str = ''
|
|
let str = ''
|
|
- if(this.periods){
|
|
|
|
|
|
+ if (this.periods) {
|
|
let id = this.searchPeriod
|
|
let id = this.searchPeriod
|
|
let period = this.periods.filter((item) => {
|
|
let period = this.periods.filter((item) => {
|
|
return item.id == id
|
|
return item.id == id
|
|
})
|
|
})
|
|
- if(period[0]) str = period[0].name
|
|
|
|
|
|
+ if (period[0]) str = period[0].name
|
|
}
|
|
}
|
|
return str
|
|
return str
|
|
|
|
+ },
|
|
|
|
+ years() {
|
|
|
|
+ if (this.schoolBase && this.schoolBase.period.length && this.searchPeriod) {
|
|
|
|
+ let pData = this.schoolBase.period.find(item => {
|
|
|
|
+ return item.id == this.searchPeriod
|
|
|
|
+ })
|
|
|
|
+ if (pData) {
|
|
|
|
+ let date = new Date()
|
|
|
|
+ let year = date.getFullYear()
|
|
|
|
+ let month = date.getMonth() + 1
|
|
|
|
+ let start = pData.semesters.find(item => {
|
|
|
|
+ return item.start == 1
|
|
|
|
+ })
|
|
|
|
+ // 根据入学月份确定当前年级和学级的关系
|
|
|
|
+ if (start && month < start.month) {
|
|
|
|
+ year--
|
|
|
|
+ }
|
|
|
|
+ let res = pData.grades.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ label: `${item.name}(${year}级)`,
|
|
|
|
+ value: year--
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return res
|
|
|
|
+ } else {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- selections: function(value) {
|
|
|
|
|
|
+ selections: function (value) {
|
|
console.log(value)
|
|
console.log(value)
|
|
}
|
|
}
|
|
},
|
|
},
|