|
@@ -116,19 +116,33 @@ export const formSchema: FormSchema[] = [
|
|
|
field: 'semesterId',
|
|
|
component: 'ApiSelect',
|
|
|
required: true,
|
|
|
- componentProps: {
|
|
|
- getPopupContainer: () => document.body,
|
|
|
- api: requestMagicApi,
|
|
|
- params: {
|
|
|
- url: '/baseData/semester/option',
|
|
|
- },
|
|
|
- showSearch: true,
|
|
|
- filterOption: (input: string, option: any) => {
|
|
|
- return (
|
|
|
- option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
|
|
|
- option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- );
|
|
|
- },
|
|
|
+ componentProps: ({ formActionType }) => {
|
|
|
+ return {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: requestMagicApi,
|
|
|
+ params: {
|
|
|
+ url: '/baseData/semester/option',
|
|
|
+ },
|
|
|
+ showSearch: true,
|
|
|
+ filterOption: (input: string, option: any) => {
|
|
|
+ return (
|
|
|
+ option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
|
|
|
+ option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ );
|
|
|
+ },
|
|
|
+ onChange: async (value: any) => {
|
|
|
+ const { updateSchema } = formActionType;
|
|
|
+ const data = await getExamPlanPlanList({ semesterId: value });
|
|
|
+
|
|
|
+ updateSchema({
|
|
|
+ field: 'examPlanId',
|
|
|
+ component: 'Select',
|
|
|
+ componentProps: {
|
|
|
+ options: data.map((item) => ({ label: item.name, value: item.id })),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ };
|
|
|
},
|
|
|
colProps: { span: 24 },
|
|
|
},
|