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