|
@@ -15,7 +15,7 @@ import {
|
|
|
import SearchInput from '@/components/searchInput';
|
|
|
import CSelect from '@/components/CSelect';
|
|
|
import Pagination from '@/components/pagination';
|
|
|
-import { classGroupList, deleteClass } from './api';
|
|
|
+import { classGroupList, deleteClass,getSubject } from './api';
|
|
|
|
|
|
import CreateClass from './modals/createClass';
|
|
|
import RestStudentBox from './modals/restStudentBox';
|
|
@@ -30,6 +30,7 @@ import TheTooltip from '/src/components/TheTooltip';
|
|
|
import PreviewWindow from '../preview-window';
|
|
|
import { state as globalState } from '/src/state';
|
|
|
import {courseSchedulePage} from '../home/api'
|
|
|
+import ResetSubject from './modals/resetSubject'
|
|
|
export default defineComponent({
|
|
|
name: 'class-classList',
|
|
|
setup(props, { emit }) {
|
|
@@ -37,7 +38,8 @@ export default defineComponent({
|
|
|
searchForm: {
|
|
|
keyword: null as any,
|
|
|
currentClass: null,
|
|
|
- currentGradeNum: null
|
|
|
+ currentGradeNum: null,
|
|
|
+ subjectId:null
|
|
|
},
|
|
|
orchestraType: null,
|
|
|
courseTypeCode: null,
|
|
@@ -57,7 +59,9 @@ export default defineComponent({
|
|
|
removeRow: {} as any,
|
|
|
previewModal: false,
|
|
|
previewParams: {} as any,
|
|
|
- lastCourse:null as any
|
|
|
+ lastCourse:null as any,
|
|
|
+ subjectList:[] as any,
|
|
|
+ showResetClass:false
|
|
|
});
|
|
|
const formRef = ref();
|
|
|
const dialog = useDialog();
|
|
@@ -74,7 +78,8 @@ export default defineComponent({
|
|
|
state.searchForm = {
|
|
|
keyword: null as any,
|
|
|
currentClass: null,
|
|
|
- currentGradeNum: null
|
|
|
+ currentGradeNum: null,
|
|
|
+ subjectId:null
|
|
|
};
|
|
|
getList();
|
|
|
};
|
|
@@ -112,23 +117,37 @@ export default defineComponent({
|
|
|
}
|
|
|
console.log('getList');
|
|
|
};
|
|
|
-
|
|
|
+ const getSubjectList = async()=>{
|
|
|
+ const res = await getSubject({page:1,rows:9999})
|
|
|
+ state.subjectList = res.data.rows.map((item:any)=>{
|
|
|
+ return {
|
|
|
+ value:item.id,
|
|
|
+ label:item.name
|
|
|
+ }
|
|
|
+ })
|
|
|
+ state.subjectList.unshift( { value: null, label: '选择声部' },)
|
|
|
+ }
|
|
|
const columns = () => {
|
|
|
return [
|
|
|
{
|
|
|
title: '班级名称',
|
|
|
key: 'name',
|
|
|
- width: '25%'
|
|
|
+ width: '20%'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '班级声部',
|
|
|
+ key: 'subjectName',
|
|
|
+ width: '20%'
|
|
|
},
|
|
|
{
|
|
|
title: '学生人数',
|
|
|
key: 'preStudentNum',
|
|
|
- width: '25%'
|
|
|
+ width: '20%'
|
|
|
},
|
|
|
{
|
|
|
title: '上次学习',
|
|
|
key: 'lastStudy',
|
|
|
- width: '25%',
|
|
|
+ width: '20%',
|
|
|
render(row: any) {
|
|
|
return row.lastStudy ? (
|
|
|
<TheTooltip
|
|
@@ -176,7 +195,12 @@ export default defineComponent({
|
|
|
详情
|
|
|
</NButton>
|
|
|
)}
|
|
|
-
|
|
|
+ <NButton
|
|
|
+ type="primary"
|
|
|
+ text
|
|
|
+ onClick={() => resetClassSubject(row)}>
|
|
|
+ 修改声部
|
|
|
+ </NButton>
|
|
|
{index == 0 ? (
|
|
|
<NButton
|
|
|
type="primary"
|
|
@@ -256,8 +280,14 @@ export default defineComponent({
|
|
|
state.activeRow = row;
|
|
|
state.goCourseVisiable = true;
|
|
|
};
|
|
|
+
|
|
|
+ const resetClassSubject = (row:any)=>{
|
|
|
+ state.activeRow = row;
|
|
|
+ state.showResetClass = true
|
|
|
+ }
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
+ getSubjectList()
|
|
|
});
|
|
|
return () => (
|
|
|
<div class={styles.listWrap}>
|
|
@@ -293,7 +323,16 @@ export default defineComponent({
|
|
|
} as any)}
|
|
|
v-model:value={state.searchForm.currentClass}></CSelect>
|
|
|
</NFormItem>
|
|
|
-
|
|
|
+ <NFormItem>
|
|
|
+ <CSelect
|
|
|
+ {...({
|
|
|
+ options: state.subjectList,
|
|
|
+ placeholder: '选择声部',
|
|
|
+ clearable: true,
|
|
|
+ inline: true
|
|
|
+ } as any)}
|
|
|
+ v-model:value={state.searchForm.subjectId}></CSelect>
|
|
|
+ </NFormItem>
|
|
|
<NFormItem>
|
|
|
<NSpace justify="end">
|
|
|
<NButton type="primary" class="searchBtn" onClick={search}>
|
|
@@ -359,12 +398,28 @@ export default defineComponent({
|
|
|
preset="card"
|
|
|
class={['modalTitle background']}
|
|
|
title={'创建班级'}>
|
|
|
- <CreateClass
|
|
|
+ {state.showaddClass? <CreateClass
|
|
|
gradeNumList={state.gradeNumList}
|
|
|
classArray={classArray}
|
|
|
+ subjectList = {state.subjectList}
|
|
|
onGetList={() => getList()}
|
|
|
onClose={() => (state.showaddClass = false)}
|
|
|
- />
|
|
|
+ />:null}
|
|
|
+
|
|
|
+ </NModal>
|
|
|
+ <NModal
|
|
|
+ v-model:show={state.showResetClass}
|
|
|
+ style={{ width: '500px' }}
|
|
|
+ preset="card"
|
|
|
+ class={['modalTitle background']}
|
|
|
+ title={'修改声部'}>
|
|
|
+ {state.showResetClass? <ResetSubject
|
|
|
+ activeRow={state.activeRow}
|
|
|
+ subjectList = {state.subjectList}
|
|
|
+ onGetList={() => getList()}
|
|
|
+ onClose={() => (state.showResetClass = false)}
|
|
|
+ />:null}
|
|
|
+
|
|
|
</NModal>
|
|
|
|
|
|
<NModal
|