dbsd_kczx/src/views/kc/ktgl/KcKechengbiao.data.ts

434 lines
8.8 KiB
TypeScript
Raw Normal View History

2023-03-30 23:29:42 +08:00
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
2023-04-16 22:22:15 +08:00
// import { render } from '/@/utils/common/renderUtils';
import { JVxeColumn, JVxeTypes } from '/@/components/jeecg/JVxeTable/types';
2023-03-30 23:29:42 +08:00
//列表数据
2023-04-16 22:22:15 +08:00
export const columns = <JVxeColumn[]>([
2023-04-01 22:06:31 +08:00
{
2023-04-16 22:22:15 +08:00
title: '课程编号',
align: "left",
2023-04-01 22:06:31 +08:00
width: '300px',
2023-04-16 22:22:15 +08:00
key: 'kcbh',
2023-04-01 22:06:31 +08:00
},
2023-03-30 23:29:42 +08:00
{
title: '课程名称',
2023-04-16 22:22:15 +08:00
align: "left",
key: 'kcmc'
2023-03-30 23:29:42 +08:00
},
{
title: '授课教师',
2023-04-16 22:22:15 +08:00
align: "left",
2023-06-07 08:45:34 +08:00
width: '100px',
2023-04-16 22:22:15 +08:00
key: 'skjs'
2023-03-30 23:29:42 +08:00
},
{
2023-11-07 20:48:52 +08:00
title: '选课人数',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '80px',
2023-04-16 22:22:15 +08:00
key: 'xkrs'
2023-03-30 23:29:42 +08:00
},
{
2023-04-01 22:06:31 +08:00
title: '开课单位',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '100px',
2023-04-16 22:22:15 +08:00
key: 'kkdw_dictText'
2023-03-30 23:29:42 +08:00
},
{
2023-04-01 22:06:31 +08:00
title: '课程性质',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '105px',
2023-04-16 22:22:15 +08:00
key: 'kcxz_dictText'
2023-04-01 22:06:31 +08:00
},
{
title: '上课地点',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '100px',
2023-04-16 22:22:15 +08:00
key: 'skdd'
2023-04-01 22:06:31 +08:00
},
{
title: '上课周次',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '100px',
2023-04-16 22:22:15 +08:00
key: 'jkzc_dictText'
2023-04-01 22:06:31 +08:00
},
{
title: '节次',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '70px',
2023-04-16 22:22:15 +08:00
key: 'hh_dictText'
2023-03-30 23:29:42 +08:00
},
{
2023-04-15 19:02:30 +08:00
title: '星期',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '70px',
2023-04-16 22:22:15 +08:00
key: 'week_dictText'
2023-03-30 23:29:42 +08:00
},
{
2023-04-01 22:06:31 +08:00
title: '学分',
2023-04-16 22:22:15 +08:00
align: "left",
2023-04-01 22:06:31 +08:00
width: '50px',
2023-04-16 22:22:15 +08:00
key: 'xf'
2023-03-30 23:29:42 +08:00
},
2023-04-16 22:22:15 +08:00
2023-03-30 23:29:42 +08:00
{
2023-04-01 22:06:31 +08:00
title: '是否出镜',
2023-04-16 22:22:15 +08:00
key: 'sfcj',
type: JVxeTypes.selectSearch,
width: 100,
options: [
{ label: '是', value: 0, },
{ label: '否', value: 1, },
],
2023-03-30 23:29:42 +08:00
},
{
2023-04-01 22:06:31 +08:00
title: '上课形式',
2023-04-16 22:22:15 +08:00
key: 'skxs',
type: JVxeTypes.selectSearch,
width: 100,
options: [
{ label: '线上', value: 0, },
{ label: '线下', value: 1, },
{ label: '线上线下混合', value: 2, },
],
2023-03-30 23:29:42 +08:00
},
2023-04-16 22:22:15 +08:00
]);
// export const columns: BasicColumn[] = [
// {
// title: 'id',
// align: "center",
// width: '0',
// dataIndex: 'id',
// // ifShow: false,
// },
// {
// title: '课程号',
// align: "center",
// width: '300px',
// dataIndex: 'kcbh'
// },
// {
// title: '课程名称',
// align: "center",
// dataIndex: 'kcmc'
// },
// {
// title: '授课教师',
// align: "center",
// dataIndex: 'skjs'
// },
// {
2023-11-07 20:48:52 +08:00
// title: '选课人数',
2023-04-16 22:22:15 +08:00
// align: "center",
// width: '80px',
// dataIndex: 'xkrs'
// },
// {
// title: '开课单位',
// align: "center",
// width: '100px',
// dataIndex: 'kkdw_dictText'
// },
// {
// title: '课程性质',
// align: "center",
// width: '105px',
// dataIndex: 'kcxz_dictText'
// },
// {
// title: '上课地点',
// align: "center",
// width: '100px',
// dataIndex: 'skdd'
// },
// {
// title: '上课周次',
// align: "center",
// width: '100px',
// dataIndex: 'jkzc_dictText'
// },
// {
// title: '节次',
// align: "center",
// width: '70px',
// dataIndex: 'hh_dictText'
// },
// {
// title: '星期',
// align: "center",
// width: '70px',
// dataIndex: 'week_dictText'
// },
// {
// title: '学分',
// align: "center",
// width: '50px',
// dataIndex: 'xf'
// },
// {
// title: '是否出镜',
// align: "center",
// dataIndex: 'sfcj',
// edit: true,
// editComponent: 'Select',
// // editComponentProps: {
// // // //选中
// // checkedChildren: "是-",
// // // checkedValue: 0,
// // // //未选中
// // unCheckedChildren:'否-',
// // // unCheckedValue: 1,
// // // onClick: (checked: boolean | string | number, event: Event) => {
// // // event.stopPropagation();
// // // console.log('选择后回调',checked,event);
// // // }
// // },
// // editValueMap: (value) => value == '0'?'是':'否',
// // editValueMap: (value) => value?'0':'1',
// // format: (text) => ,C
// editComponentProps: {
// options: [
// { label: '是', value: 0, },
// { label: '否', value: 1, },
// ],
// },
// // customRender: (r) => r.text == 0?'是':'否'
// },
// {
// title: '上课形式',
// align: "center",
// dataIndex: 'skxs',
// edit: true,
// editComponent: 'Select',
// editComponentProps: {
// options: [
// { label: '线上', value: 0, },
// { label: '线下', value: 1, },
// { label: '线上线下混合', value: 2, },
// ],
// },
// // customRender: (r) => r.text == 0?'线上':r.text == 1?'线下':'线上线下混合'
// },
// ];
2023-03-30 23:29:42 +08:00
//查询数据
export const searchFormSchema: FormSchema[] = [
2023-04-01 22:06:31 +08:00
{
label: "课程名称",
field: 'kcmc',
component: 'Input',
colProps: {span: 6},
},
{
label: "授课教师",
field: 'skjs',
component: 'JDictSelectTag',
componentProps:{
},
colProps: {span: 6},
},
{
label: "开课单位",
field: 'kkdw',
component: 'JDictSelectTag',
componentProps:{
},
colProps: {span: 6},
},
{
label: "课程性质",
field: 'kcxz',
component: 'Input',
colProps: {span: 6},
},
{
label: "节次",
field: 'hh',
component: 'JDictSelectTag',
componentProps:{
dictCode: "skjc"
},
colProps: {span: 6},
},
{
label: "星期几",
field: 'week',
component: 'JDictSelectTag',
componentProps:{
dictCode: "week"
},
colProps: {span: 6},
},
2023-03-30 23:29:42 +08:00
];
//表单数据
export const formSchema: FormSchema[] = [
2023-04-01 22:06:31 +08:00
{
label: '课程编号',
field: 'kcbh',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入课程编号!'},
{...rules.duplicateCheckRule('kc_kechengbiao', 'kcbh',model,schema)[0]},
];
},
},
2023-03-30 23:29:42 +08:00
{
label: '课程名称',
field: 'kcmc',
component: 'Input',
2023-04-01 22:06:31 +08:00
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入课程名称!'},
];
},
2023-03-30 23:29:42 +08:00
},
{
label: '授课教师',
field: 'skjs',
2023-04-01 22:06:31 +08:00
component: 'JDictSelectTag',
componentProps:{
dictCode: ""
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入授课教师!'},
];
},
},
{
2023-11-07 20:48:52 +08:00
label: '选课人数',
2023-04-01 22:06:31 +08:00
field: 'xkrs',
2023-03-30 23:29:42 +08:00
component: 'Input',
2023-04-01 22:06:31 +08:00
dynamicRules: ({model,schema}) => {
return [
2023-11-07 20:48:52 +08:00
{ required: true, message: '请输入选课人数!'},
2023-04-01 22:06:31 +08:00
];
},
2023-03-30 23:29:42 +08:00
},
{
2023-04-01 22:06:31 +08:00
label: '开课单位',
field: 'kkdw',
component: 'JDictSelectTag',
componentProps:{
dictCode: ""
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入开课单位!'},
];
},
},
{
label: '课程性质',
field: 'kcxz',
2023-03-30 23:29:42 +08:00
component: 'Input',
2023-04-01 22:06:31 +08:00
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入课程性质!'},
];
},
},
{
label: '上课地点',
field: 'skdd',
component: 'Input',
},
{
label: '上课周次',
field: 'jkzc',
component: 'JSelectMultiple',
componentProps:{
dictCode: "skzc"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入上课周次!'},
];
},
2023-03-30 23:29:42 +08:00
},
{
label: '节次',
field: 'hh',
2023-04-01 22:06:31 +08:00
component: 'JDictSelectTag',
componentProps:{
dictCode: "skjc"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入节次!'},
];
},
2023-03-30 23:29:42 +08:00
},
{
label: '星期几',
field: 'week',
2023-04-01 22:06:31 +08:00
component: 'JDictSelectTag',
componentProps:{
dictCode: "week"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入星期几!'},
];
},
2023-03-30 23:29:42 +08:00
},
{
label: '直播方式',
field: 'zbfs',
2023-04-01 22:06:31 +08:00
component: 'JDictSelectTag',
componentProps:{
dictCode: "skpt"
},
2023-03-30 23:29:42 +08:00
},
{
label: '会议号',
field: 'hyh',
component: 'Input',
},
{
label: '会议密码',
field: 'hymm',
component: 'Input',
},
{
label: '课程链接',
field: 'kclj',
component: 'Input',
},
{
2023-04-01 22:06:31 +08:00
label: '学分',
field: 'xf',
2023-03-30 23:29:42 +08:00
component: 'Input',
2023-04-01 22:06:31 +08:00
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入学分!'},
];
},
},
{
label: '是否出镜0-出镜1-不出镜',
field: 'sfcj',
component: 'InputNumber',
},
{
label: '上课形式0-线上1-线下2-线上线下混合',
field: 'skxs',
component: 'InputNumber',
2023-03-30 23:29:42 +08:00
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];