import { getGradeYears, getDeatil } from '@/utils/student.js' export default { data() { return { gradeyear: 0, options: [], studentXh: '', items: ['思想', '职业', '身心', '文化', '劳动'], current: 0, score: '', tableData: [], currentableData: [], vModelValue: 3, value: '', } }, mounted() { uni.getStorage({ key: 'studentxh', success: function(res) { this.studentXh = res.data } }) this.getYears() this.onClickItem({ currentIndex: 0 }) }, methods: { change(e) { this.gradeyear = e }, getYears() { getGradeYears({ xh: this.studentXh }).then(res => { if (res.msg == '成功') { const All = res.data let myrange = [] All.forEach((val, index) => { myrange.push({ value: val.gradeYear, // 选项id text: val.gradeYear // 选项名称 }) }) this.options = myrange if (this.options.length > 0) { this.gradeyear = this.options[0].value this.queryscires() } } }) }, queryscires() { getDeatil({ studentId: this.studentXh, gradeYear: this.gradeyear }).then(res => { if (res.msg == '成功') { this.score = res.data.score this.tableData = res.data.list // console.log(this.tableData) // this.onClickItem() this.selectdata() } }) }, selectdata() { let index = Number.parseInt(this.current) + 1 console.log(index) let start, end; start = this.tableData.findIndex(item => item.itemName.startsWith(index)) end = this.tableData.findIndex(item => item.itemName.startsWith(index + 1)) if (end == -1) { console.log(start) this.currentableData = this.tableData.slice(start) } else { console.log(start, end) this.currentableData = this.tableData.slice(start, end) if (this.currentableData.length > 0) { console.log(this.currentableData) } } }, onClickItem(e) { if (this.current != e.currentIndex) { this.current = e.currentIndex; this.queryscires() } } } }

学生成绩管理系统 - 查看学生成绩

原文地址: https://www.cveoy.top/t/topic/o2rs 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录