import {BasicColumn} from '/@/components/Table'; import {FormSchema} from '/@/components/Table'; import { rules} from '/@/utils/helper/validator'; // import { render } from '/@/utils/common/renderUtils'; import { JVxeColumn, JVxeTypes } from '/@/components/jeecg/JVxeTable/types'; //列表数据 export const columns = ([ { title: '课程编号', align: "left", width: '300px', key: 'kcbh', }, { title: '课程名称', align: "left", key: 'kcmc' }, { title: '授课教师', align: "left", width: '100px', key: 'skjs' }, { title: '选课人数', align: "left", width: '80px', key: 'xkrs' }, { title: '开课单位', align: "left", width: '100px', key: 'kkdw_dictText' }, { title: '课程性质', align: "left", width: '105px', key: 'kcxz_dictText' }, { title: '上课地点', align: "left", width: '100px', key: 'skdd' }, { title: '上课周次', align: "left", width: '100px', key: 'jkzc_dictText' }, { title: '节次', align: "left", width: '70px', key: 'hh_dictText' }, { title: '星期', align: "left", width: '70px', key: 'week_dictText' }, { title: '学分', align: "left", width: '50px', key: 'xf' }, { title: '是否出镜', key: 'sfcj', type: JVxeTypes.selectSearch, width: 100, options: [ { label: '是', value: 0, }, { label: '否', value: 1, }, ], }, { title: '上课形式', key: 'skxs', type: JVxeTypes.selectSearch, width: 100, options: [ { label: '线上', value: 0, }, { label: '线下', value: 1, }, { label: '线上线下混合', value: 2, }, ], }, ]); // 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' // }, // { // title: '选课人数', // 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?'线下':'线上线下混合' // }, // ]; //查询数据 export const searchFormSchema: FormSchema[] = [ { 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}, }, ]; //表单数据 export const formSchema: FormSchema[] = [ { label: '课程编号', field: 'kcbh', component: 'Input', dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入课程编号!'}, {...rules.duplicateCheckRule('kc_kechengbiao', 'kcbh',model,schema)[0]}, ]; }, }, { label: '课程名称', field: 'kcmc', component: 'Input', dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入课程名称!'}, ]; }, }, { label: '授课教师', field: 'skjs', component: 'JDictSelectTag', componentProps:{ dictCode: "" }, dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入授课教师!'}, ]; }, }, { label: '选课人数', field: 'xkrs', component: 'Input', dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入选课人数!'}, ]; }, }, { label: '开课单位', field: 'kkdw', component: 'JDictSelectTag', componentProps:{ dictCode: "" }, dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入开课单位!'}, ]; }, }, { label: '课程性质', field: 'kcxz', component: 'Input', 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: '请输入上课周次!'}, ]; }, }, { label: '节次', field: 'hh', component: 'JDictSelectTag', componentProps:{ dictCode: "skjc" }, dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入节次!'}, ]; }, }, { label: '星期几', field: 'week', component: 'JDictSelectTag', componentProps:{ dictCode: "week" }, dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入星期几!'}, ]; }, }, { label: '直播方式', field: 'zbfs', component: 'JDictSelectTag', componentProps:{ dictCode: "skpt" }, }, { label: '会议号', field: 'hyh', component: 'Input', }, { label: '会议密码', field: 'hymm', component: 'Input', }, { label: '课程链接', field: 'kclj', component: 'Input', }, { label: '学分', field: 'xf', component: 'Input', dynamicRules: ({model,schema}) => { return [ { required: true, message: '请输入学分!'}, ]; }, }, { label: '是否出镜,0-出镜,1-不出镜', field: 'sfcj', component: 'InputNumber', }, { label: '上课形式,0-线上,1-线下,2-线上线下混合', field: 'skxs', component: 'InputNumber', }, // TODO 主键隐藏字段,目前写死为ID { label: '', field: 'id', component: 'Input', show: false, }, ];