import { defineComponent, reactive } from 'vue'; import styles from './index.module.less'; import { NButton, NDataTable, NForm, NFormItem, NImage, NSelect, NSpace } from 'naive-ui'; import SearchInput from '@/components/searchInput'; import CSelect from '@/components/CSelect'; import Pagination from '@/components/pagination'; import add from './images/add.png'; export default defineComponent({ name: 'student-studentList', setup(props, { emit }) { const state = reactive({ searchWord: '', orchestraType: null, courseTypeCode: null, loading: false, pagination: { page: 1, rows: 10, pageTotal: 4 }, tableList: [ { studentName: '胡小小', phone: '17625367893', sex: '0', className: '一年级3班', classType: 'normal', studentType: 'member' }, { studentName: '丁曼蓉', phone: '14677789334', sex: '1', className: '一年级3班', classType: 'normal', studentType: '' }, { studentName: '李书意', phone: '13467857893', sex: '1', className: '一年级3班', classType: 'graduate', studentType: 'member' }, { studentName: '夏小满', phone: '13925367893', sex: '0', className: '一年级3班', classType: 'none', studentType: '' } ] as any }); const search = () => { console.log('search', state); }; const onReset = () => { console.log('search'); }; const getList = () => { console.log('getList'); }; const columns = () => { return [ { title: '姓名', key: 'studentName' }, { title: '手机号', key: 'phone' }, { title: '性别', key: 'sex', render(row: any) { return <>{row.sex == '0' ? '女' : '男'}; } }, { title: '班级', key: 'className', render(row: any) { return ( <>
{row.classType == 'none' ? (

{'未在班级'}

) : null} {row.classType == 'graduate' ? (

{'毕业'}

) : null} {row.classType == 'normal' ?

{row.className}

: null}
); } }, { title: '学生类型', key: 'studentType', render(row: any) { return <>{row.studentType == 'member' ? '会员' : '普通'}; } }, { title: '操作', key: 'id', render(row: any) { return ( 详情 ); } } ]; }; return () => (
(state.searchWord = val) }> 搜索 重置
( <> ) }}> 新增学生
); } });