2025-08-09 13:24:01 +08:00

267 lines
6.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '课程名',
align:"center",
dataIndex: 'name'
},
{
title: '封面图',
align:"center",
dataIndex: 'cover',
customRender:render.renderImage,
},
{
title: '介绍视频',
align:"center",
dataIndex: 'video',
},
{
title: '学校',
align:"center",
dataIndex: 'school'
},
{
title: '课程概述',
align:"center",
dataIndex: 'description',
},
{
title: '课程类型',
align:"center",
dataIndex: 'type_dictText'
},
{
title: '授课目标',
align:"center",
dataIndex: 'target'
},
{
title: '课程难度',
align:"center",
dataIndex: 'difficulty_dictText'
},
{
title: '所属专题',
align:"center",
dataIndex: 'subject_dictText'
},
{
title: '课程大纲',
align:"center",
dataIndex: 'outline',
},
{
title: '预备知识',
align:"center",
dataIndex: 'prerequisite'
},
{
title: '参考资料',
align:"center",
dataIndex: 'reference'
},
{
title: '学时安排',
align:"center",
dataIndex: 'arrangement'
},
{
title: '开课时间',
align:"center",
dataIndex: 'startTime'
},
{
title: '结课时间',
align:"center",
dataIndex: 'endTime'
},
{
title: '已报名人数',
align:"center",
dataIndex: 'enrollCount'
},
{
title: '最大报名人数',
align:"center",
dataIndex: 'maxEnroll'
},
{
title: '状态',
align:"center",
dataIndex: 'status'
},
{
title: '常见问题',
align:"center",
dataIndex: 'question',
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '课程名',
field: 'name',
component: 'Input',
},
{
label: '封面图',
field: 'cover',
component: 'JImageUpload',
componentProps:{
fileMax: 0
},
},
{
label: '介绍视频',
field: 'video',
component: 'JUpload',
componentProps:{
},
},
{
label: '学校',
field: 'school',
component: 'Input',
},
{
label: '课程概述',
field: 'description',
component: 'JEditor',
},
{
label: '课程类型',
field: 'type',
component: 'JDictSelectTag',
componentProps:{
dictCode:"course_type",
type: "radio"
},
},
{
label: '授课目标',
field: 'target',
component: 'Input',
},
{
label: '课程难度',
field: 'difficulty',
component: 'JDictSelectTag',
componentProps:{
dictCode:"course_difficulty"
},
},
{
label: '所属专题',
field: 'subject',
component: 'JSelectMultiple',
componentProps:{
dictCode:"course_subject"
},
},
{
label: '课程大纲',
field: 'outline',
component: 'JEditor',
},
{
label: '预备知识',
field: 'prerequisite',
component: 'Input',
},
{
label: '参考资料',
field: 'reference',
component: 'Input',
},
{
label: '学时安排',
field: 'arrangement',
component: 'Input',
},
{
label: '开课时间',
field: 'startTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '结课时间',
field: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '已报名人数',
field: 'enrollCount',
component: 'InputNumber',
},
{
label: '最大报名人数',
field: 'maxEnroll',
component: 'InputNumber',
},
{
label: '状态',
field: 'status',
component: 'InputNumber',
},
{
label: '常见问题',
field: 'question',
component: 'JEditor',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
name: {title: '课程名',order: 0,view: 'text', type: 'string',},
cover: {title: '封面图',order: 1,view: 'image', type: 'string',},
video: {title: '介绍视频',order: 2,view: 'file', type: 'string',},
school: {title: '学校',order: 3,view: 'text', type: 'string',},
description: {title: '课程概述',order: 4,view: 'umeditor', type: 'string',},
type: {title: '课程类型',order: 5,view: 'number', type: 'number',dictCode: 'course_type',},
target: {title: '授课目标',order: 6,view: 'text', type: 'string',},
difficulty: {title: '课程难度',order: 7,view: 'number', type: 'number',dictCode: 'course_difficulty',},
subject: {title: '所属专题',order: 8,view: 'list_multi', type: 'string',dictCode: 'course_subject',},
outline: {title: '课程大纲',order: 9,view: 'umeditor', type: 'string',},
prerequisite: {title: '预备知识',order: 10,view: 'text', type: 'string',},
reference: {title: '参考资料',order: 11,view: 'text', type: 'string',},
arrangement: {title: '学时安排',order: 12,view: 'text', type: 'string',},
startTime: {title: '开课时间',order: 13,view: 'datetime', type: 'string',},
endTime: {title: '结课时间',order: 14,view: 'datetime', type: 'string',},
enrollCount: {title: '已报名人数',order: 15,view: 'number', type: 'number',},
maxEnroll: {title: '最大报名人数',order: 16,view: 'number', type: 'number',},
status: {title: '状态',order: 17,view: 'number', type: 'number',},
question: {title: '常见问题',order: 18,view: 'umeditor', type: 'string',},
};
/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据这里需要单独处理formSchema
return formSchema;
}