|
@@ -1,328 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="dark-iview-table student-list">
|
|
|
- <div class="sc-menu-left dark-iview-select dark-iview-input">
|
|
|
- <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 28%;margin-left:20px;" search @on-search="searchData" @on-clear="searchData">
|
|
|
- </Input>
|
|
|
- <Select v-model="searchPeriod" style="width:20%;margin-left:5%;" :placeholder="$t('stuAccount.periodHolder')" clearable @on-change="filterStudentInfo">
|
|
|
- <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index">{{ item.periodName }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="searchGrade" style="width:20%;margin-left:1%;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterStudentInfo">
|
|
|
- <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,searchPeriod).grades" :value="item.gradeCode" :key="index">{{ item.gradeName }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="searchClassroom" ref="classroom" style="width:20%;margin-left:1%;" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterStudentInfo">
|
|
|
- <Option v-for="(item,index) in classroomList" :value="item.classroomCode" :key="index">{{ item.classroomName }}</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- <Table ref="selection" :columns="tableColumns" :data="tableShowData" height="630" :loading="tableLoading" @on-selection-change="getSelectInfo">
|
|
|
- <Loading slot="loading"></Loading>
|
|
|
- <template slot-scope="{ row,index }" slot="status">
|
|
|
- <Icon v-if="index % 3 == 1" type="md-checkmark-circle-outline" size="18" color="#1CD0A1" />
|
|
|
- <span v-else>—</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="classroomName">
|
|
|
- <span>{{row.classroomName}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="classroomCode">
|
|
|
- <span>{{row.classroomCode}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="periodName">
|
|
|
- <span>{{row.periodName}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="gradeName">
|
|
|
- <span>{{row.gradeName}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="action">
|
|
|
- <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
- <Icon type="md-create" size="18" color="white" @click="editStudent(index)" />
|
|
|
- <Icon type="md-trash" size="18" color="white" @click="delStudent(index)" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </Table>
|
|
|
- <div class="page-box dark-iview-page">
|
|
|
- <Page :total="totalNum" show-sizer :page-size="pageSize" show-total :current.sync="currentPage" @on-change="getPageData" @on-page-size-change="setPageSize" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
- import Loading from '@/common/Loading.vue'
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- Loading
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- searchText: '',
|
|
|
- searchPeriod: '',
|
|
|
- searchGrade: '',
|
|
|
- searchClassroom: '',
|
|
|
- selections: [],
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 20,
|
|
|
- tableShowData: [],
|
|
|
- tableColumns: [],
|
|
|
- totalNum: 0,
|
|
|
- tableLoading: false,
|
|
|
- schoolData: {},
|
|
|
- classroomShowList:[]
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /**根据学段、年级、班级搜索 */
|
|
|
- filterStudentInfo() {
|
|
|
- if (this.searchClassroom !== '' && this.searchClassroom !== undefined) {
|
|
|
- let findCountParams = {
|
|
|
- "collectionName": "Student",
|
|
|
- "queryDict": {
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- 'classroomCode': this.searchClassroom,
|
|
|
- }
|
|
|
- }
|
|
|
- this.getResultCount(findCountParams)
|
|
|
- this.currentPage = 1
|
|
|
- let params = {
|
|
|
- '@CURRPAGE': this.currentPage,
|
|
|
- '@PAGESIZE': this.pageSize,
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- 'classroomCode': this.searchClassroom,
|
|
|
- }
|
|
|
- this.baseFindStudent(params)
|
|
|
- } else {
|
|
|
- let classrooms = []
|
|
|
- let classroomCodes = []
|
|
|
- if (this.searchGrade == '' || this.searchGrade == undefined) {
|
|
|
- classrooms = this.classroomList.filter(
|
|
|
- (item, index) => {
|
|
|
- return item.periodCode == this.searchPeriod
|
|
|
- }
|
|
|
- )
|
|
|
- } else {
|
|
|
- classrooms = this.classroomList.filter(
|
|
|
- (item, index) => {
|
|
|
- return item.periodCode == this.searchPeriod && item.gradeCode == this.searchGrade
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- classroomCodes = classrooms.map((item) => {
|
|
|
- return item.classroomCode
|
|
|
- })
|
|
|
- if (classroomCodes.length == 0) {
|
|
|
- if (this.searchPeriod == '' || this.searchPeriod == undefined) {
|
|
|
- let findCountParams = {
|
|
|
- "collectionName": "Student",
|
|
|
- "queryDict": {
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- }
|
|
|
- }
|
|
|
- this.getResultCount(findCountParams)
|
|
|
-
|
|
|
- let params = {
|
|
|
- '@CURRPAGE': this.currentPage,
|
|
|
- '@PAGESIZE': this.pageSize,
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- }
|
|
|
- this.baseFindStudent(params)
|
|
|
- } else {
|
|
|
- this.totalNum = 0
|
|
|
- this.tableShowData.length = 0
|
|
|
- this.tableData.length = 0
|
|
|
- }
|
|
|
- } else {
|
|
|
- let findCountParams = {
|
|
|
- "collectionName": "Student",
|
|
|
- "queryDict": {
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- 'classroomCode': classroomCodes,
|
|
|
- }
|
|
|
- }
|
|
|
- this.getResultCount(findCountParams)
|
|
|
-
|
|
|
- let params = {
|
|
|
- '@CURRPAGE': this.currentPage,
|
|
|
- '@PAGESIZE': this.pageSize,
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- 'classroomCode': classroomCodes,
|
|
|
- }
|
|
|
- this.baseFindStudent(params)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- /**
|
|
|
- * 远程搜索
|
|
|
- * 暂时只支持一个条件模糊查询
|
|
|
- * 需要回车触发
|
|
|
- * */
|
|
|
- searchData() {
|
|
|
- this.tableLoading = true
|
|
|
- this.currentPage = 1
|
|
|
-
|
|
|
- let findCountParams = {
|
|
|
- "collectionName": "Student",
|
|
|
- "queryDict": {
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- //'$.name': this.searchText,
|
|
|
- '$.studentId': this.searchText,
|
|
|
- }
|
|
|
- }
|
|
|
- this.getResultCount(findCountParams)
|
|
|
- let params = {
|
|
|
- '@CURRPAGE': this.currentPage,
|
|
|
- '@PAGESIZE': this.pageSize,
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- //'$.name': this.searchText,
|
|
|
- '$.studentId': this.searchText,
|
|
|
- }
|
|
|
- this.baseFindStudent(params)
|
|
|
- },
|
|
|
- //获取选中的数据
|
|
|
- getSelectInfo(selction, row) {
|
|
|
- this.selections = selction
|
|
|
- this.selectRow = row
|
|
|
- this.$emit('selectedStudent', selction)
|
|
|
- },
|
|
|
- /**设置每页数量 */
|
|
|
- setPageSize(pageSize) {
|
|
|
- this.pageSize = pageSize
|
|
|
- this.findStudentInfo()
|
|
|
- },
|
|
|
- /**查询当前Page学生信息 */
|
|
|
- findStudentInfo() {
|
|
|
- this.tableLoading = true
|
|
|
- let params = {
|
|
|
- '@CURRPAGE': this.currentPage,
|
|
|
- '@PAGESIZE': this.pageSize,
|
|
|
- 'code': this.$store.state.userInfo.schoolCode,
|
|
|
- }
|
|
|
- this.baseFindStudent(params)
|
|
|
- },
|
|
|
- /**基础查询数据 */
|
|
|
- baseFindStudent(params) {
|
|
|
- this.$api.stuAccount.findStudent(params).then(
|
|
|
- (res) => {
|
|
|
- if (res.error == null) {
|
|
|
- this.tableData = res.result.data
|
|
|
- for (let index in this.tableData) {
|
|
|
- let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.user.schoolProfile.school_classes, "$..[?(@.classroomCode=='" + this.tableData[index].classroomCode + "')]")
|
|
|
- if (currentClassroomlInfo.length > 0) {
|
|
|
- let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
|
|
|
- if (currentSchoolInfo.length > 0) {
|
|
|
- this.tableData[index].periodName = currentSchoolInfo[0].periodName
|
|
|
- this.tableData[index].periodCode = currentSchoolInfo[0].periodCode
|
|
|
- this.tableData[index].gradeName = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeName
|
|
|
- this.tableData[index].gradeCode = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeCode
|
|
|
- this.tableData[index].classroomName = currentClassroomlInfo[0].classroomName
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- [...this.tableShowData] = this.tableData
|
|
|
- this.tableLoading = false
|
|
|
- } else {
|
|
|
- this.$Message.error('API error!')
|
|
|
- this.tableLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- this.tableLoading = false
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- /**查询学生总共人数 */
|
|
|
- getResultCount(params) {
|
|
|
- this.$api.newEvaluation.FindCount(params).then(res => {
|
|
|
- this.totalNum = res.result.data[0]
|
|
|
- })
|
|
|
- },
|
|
|
- getPageData() {
|
|
|
- this.findStudentInfo()
|
|
|
- },
|
|
|
- initData() {
|
|
|
- this.tableColumns = [
|
|
|
- {
|
|
|
- type: 'selection',
|
|
|
- width: 80,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'seatNo',
|
|
|
- title: this.$t('stuAccount.seatNo'),
|
|
|
- align: 'center',
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'studentId',
|
|
|
- title: this.$t('stuAccount.account'),
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- key: 'name',
|
|
|
- title: this.$t('stuAccount.stuName'),
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'classroomName',
|
|
|
- title: this.$t('stuAccount.classroomName'),
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'classroomCode',
|
|
|
- title: this.$t('stuAccount.classroomCode'),
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'periodName',
|
|
|
- title: this.$t('stuAccount.period'),
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- slot: 'gradeName',
|
|
|
- title: this.$t('stuAccount.grade'),
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- //{
|
|
|
- // slot: 'status',
|
|
|
- // title: this.$t('stuAccount.authStatus'),
|
|
|
- // align: 'center'
|
|
|
- //},
|
|
|
- //{
|
|
|
- // slot: 'action',
|
|
|
- // title: ' ',
|
|
|
- // width: 100,
|
|
|
- // align: 'center'
|
|
|
- //}
|
|
|
- ]
|
|
|
- },
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.initData()
|
|
|
- let findCountParams = {
|
|
|
- "collectionName": "Student",
|
|
|
- "queryDict": {
|
|
|
- 'code': this.$store.state.userInfo.schoolCode
|
|
|
- }
|
|
|
- }
|
|
|
- this.getResultCount(findCountParams)
|
|
|
- this.getPageData()
|
|
|
- },
|
|
|
- computed: {
|
|
|
- classroomList() {
|
|
|
- if (this.searchGrade == '') {
|
|
|
- return this.$store.state.user.schoolProfile.school_classes
|
|
|
- } else {
|
|
|
- return this.$store.state.user.schoolProfile.school_classes.filter((item) => {
|
|
|
- return item.gradeCode == this.searchGrade
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-</script>
|
|
|
-<style lang="less" scoped>
|
|
|
- @import "./StudentList.less";
|
|
|
-</style>
|
|
|
-<style>
|
|
|
- .student-list #loadingBox {
|
|
|
- margin-top: 0px !important;
|
|
|
- }
|
|
|
-</style>
|