|
@@ -1,4 +1,4 @@
|
|
|
-import { defineComponent, onMounted, reactive } from 'vue';
|
|
|
+import { defineComponent, onMounted, reactive, watch } from 'vue';
|
|
|
import styles from '../index.module.less';
|
|
|
import {
|
|
|
NButton,
|
|
@@ -13,17 +13,24 @@ import {
|
|
|
import SearchInput from '@/components/searchInput';
|
|
|
import CSelect from '@/components/CSelect';
|
|
|
import Pagination from '@/components/pagination';
|
|
|
-import { getStudentList } from '../api';
|
|
|
+import { classGroupDetail, getStudentList } from '../api';
|
|
|
import add from './images/add.png';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import TheEmpty from '/src/components/TheEmpty';
|
|
|
export default defineComponent({
|
|
|
name: 'student-studentList',
|
|
|
+ props: {
|
|
|
+ upgradeFlag: {
|
|
|
+ type: Number
|
|
|
+ }
|
|
|
+ },
|
|
|
setup(props, { emit }) {
|
|
|
const message = useMessage();
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
+
|
|
|
const state = reactive({
|
|
|
+ upgradeFlag: props.upgradeFlag == 0 ? true : false, // 是否为历史班
|
|
|
searchForm: { keyword: '', gender: null as any },
|
|
|
loading: false,
|
|
|
pagination: {
|
|
@@ -34,6 +41,12 @@ export default defineComponent({
|
|
|
tableList: [] as any
|
|
|
});
|
|
|
|
|
|
+ watch(
|
|
|
+ () => props.upgradeFlag,
|
|
|
+ () => {
|
|
|
+ state.upgradeFlag = props.upgradeFlag == 0 ? true : false;
|
|
|
+ }
|
|
|
+ );
|
|
|
const search = () => {
|
|
|
state.pagination.page = 1;
|
|
|
getList();
|
|
@@ -62,6 +75,7 @@ export default defineComponent({
|
|
|
console.log(e);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
});
|
|
@@ -79,7 +93,12 @@ export default defineComponent({
|
|
|
const gotoDetail = (row: any) => {
|
|
|
router.push({
|
|
|
path: '/classStudentDetail',
|
|
|
- query: { ...route.query, studentId: row.id, studentName: row.nickname }
|
|
|
+ query: {
|
|
|
+ ...route.query,
|
|
|
+ studentId: row.id,
|
|
|
+ studentName: row.nickname,
|
|
|
+ upgradeFlag: state.upgradeFlag ? 0 : 1
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
const columns = () => {
|