|
@@ -1,85 +1,154 @@
|
|
|
import { BasicColumn, FormSchema } from '/@/components/Table';
|
|
|
import { getDataOption } from '/@/api/system/dic';
|
|
|
import { requestMagicApi } from '/@/api/magicApi';
|
|
|
+import { BasicOptionModel } from '/@/api/model/baseModel';
|
|
|
|
|
|
-export const columns: BasicColumn[] = [
|
|
|
+export const levelOptions: BasicOptionModel[] = [
|
|
|
+ { label: '无等级', value: 0 },
|
|
|
+ { label: '2级', value: 2 },
|
|
|
+ { label: '3级', value: 3 },
|
|
|
+ { label: '4级', value: 4 },
|
|
|
+ { label: '5级', value: 5 },
|
|
|
+];
|
|
|
+
|
|
|
+export const tableColumns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
{
|
|
|
- title: '奖学金名称',
|
|
|
+ title: '名称',
|
|
|
dataIndex: 'name',
|
|
|
+ align: 'left',
|
|
|
},
|
|
|
{
|
|
|
- title: '奖学金总金额',
|
|
|
+ title: '总金额',
|
|
|
dataIndex: 'totalAmount',
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
},
|
|
|
{
|
|
|
- title: '奖学金来源',
|
|
|
+ title: '来源',
|
|
|
dataIndex: 'scholarshipSourceCn',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '资助单位/个人',
|
|
|
+ dataIndex: 'scholarship',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: '奖学金等级',
|
|
|
+ title: '等级',
|
|
|
dataIndex: 'scholarshipLevel',
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
+ customRender: ({ text }) => {
|
|
|
+ return levelOptions.find((item) => item.value === text)?.label;
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
|
{
|
|
|
field: 'scholarshipName',
|
|
|
- label: '奖学金名称',
|
|
|
+ label: '名称',
|
|
|
component: 'Input',
|
|
|
colProps: { span: 8 },
|
|
|
},
|
|
|
{
|
|
|
field: 'scholarshipSource',
|
|
|
- label: '奖学金来源',
|
|
|
- component: 'Input',
|
|
|
+ label: '来源',
|
|
|
+ component: 'ApiSelect',
|
|
|
colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: getDataOption,
|
|
|
+ params: { code: 'scholarship_source' },
|
|
|
+ showSearch: true,
|
|
|
+ filterOption: (input: string, option: any) => {
|
|
|
+ return (
|
|
|
+ option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
|
|
|
+ option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
field: 'scholarshipLevel',
|
|
|
- label: '奖学金等级',
|
|
|
- component: 'Input',
|
|
|
+ label: '等级',
|
|
|
+ component: 'Select',
|
|
|
colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ options: levelOptions,
|
|
|
+ },
|
|
|
},
|
|
|
];
|
|
|
-// export导出
|
|
|
-// import 导出
|
|
|
-export const FromSchema: FormSchema[] = [
|
|
|
+
|
|
|
+
|
|
|
+export const formSchema: FormSchema[] = [
|
|
|
{
|
|
|
- field: 'id',
|
|
|
- label: 'id',
|
|
|
+ field: 'baseSemesterId',
|
|
|
+ label: '所属学期',
|
|
|
+ required: true,
|
|
|
+ component: 'ApiSelect',
|
|
|
+ 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
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ colProps: { span: 24 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'type',
|
|
|
+ label: '类型',
|
|
|
component: 'Input',
|
|
|
- show: false,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ required: true,
|
|
|
},
|
|
|
{
|
|
|
field: 'name',
|
|
|
- label: '奖学金名称',
|
|
|
+ label: '名称',
|
|
|
component: 'Input',
|
|
|
colProps: { span: 24 },
|
|
|
required: true,
|
|
|
},
|
|
|
{
|
|
|
field: 'scholarshipSource',
|
|
|
- label: '奖学金来源',
|
|
|
- // APi请求下拉框
|
|
|
+ label: '来源',
|
|
|
component: 'ApiSelect',
|
|
|
required: true,
|
|
|
componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
api: getDataOption,
|
|
|
params: { code: 'scholarship_source' },
|
|
|
+ showSearch: true,
|
|
|
+ filterOption: (input: string, option: any) => {
|
|
|
+ return (
|
|
|
+ option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
|
|
|
+ option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
colProps: { span: 24 },
|
|
|
},
|
|
|
{
|
|
|
- field: 'baseSemesterId',
|
|
|
- label: '所属学期',
|
|
|
- required: true,
|
|
|
- component: 'ApiSelect',
|
|
|
- componentProps: {
|
|
|
- api: requestMagicApi,
|
|
|
- params: { url: 'baseData/semester/option' },
|
|
|
- },
|
|
|
-
|
|
|
+ field: 'name',
|
|
|
+ label: '资助单位/个人',
|
|
|
+ component: 'Input',
|
|
|
colProps: { span: 24 },
|
|
|
+ required: true,
|
|
|
},
|
|
|
{
|
|
|
field: 'totalAmount',
|
|
@@ -90,33 +159,13 @@ export const FromSchema: FormSchema[] = [
|
|
|
},
|
|
|
{
|
|
|
field: 'scholarshipLevel',
|
|
|
- label: '奖学金等级',
|
|
|
+ label: '等级',
|
|
|
component: 'Select',
|
|
|
required: true,
|
|
|
componentProps: ({ formModel }) => {
|
|
|
return {
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: '无等级',
|
|
|
- value: 0,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '2级',
|
|
|
- value: 2,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '3级',
|
|
|
- value: 3,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '4级',
|
|
|
- value: 4,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '5级',
|
|
|
- value: 5,
|
|
|
- },
|
|
|
- ],
|
|
|
+ options: levelOptions,
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
onChange: (e) => {
|
|
|
formModel.baseStudentScholarshipLevelList = [];
|
|
|
if (e === 0) {
|
|
@@ -128,7 +177,6 @@ export const FromSchema: FormSchema[] = [
|
|
|
];
|
|
|
return;
|
|
|
}
|
|
|
- // for of
|
|
|
|
|
|
for (let i = 0; i < e; i++) {
|
|
|
formModel.baseStudentScholarshipLevelList.push({
|
|
@@ -155,21 +203,24 @@ export const moneyColumns: BasicColumn[] = [
|
|
|
{
|
|
|
title: '等级',
|
|
|
dataIndex: 'level',
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
},
|
|
|
{
|
|
|
title: '金额',
|
|
|
dataIndex: 'money',
|
|
|
- align: 'center',
|
|
|
slots: {
|
|
|
customRender: 'money',
|
|
|
},
|
|
|
+ align: 'left',
|
|
|
},
|
|
|
{
|
|
|
title: '单位',
|
|
|
dataIndex: 'unit',
|
|
|
- align: 'center',
|
|
|
customRender: ({}) => {
|
|
|
return '元/每人';
|
|
|
},
|
|
|
+ align: 'left',
|
|
|
+ width: 80,
|
|
|
},
|
|
|
];
|