|
@@ -0,0 +1,219 @@
|
|
|
+import { BasicColumn, FormSchema } from '/@/components/Table';
|
|
|
+import { getDataOption } from '/@/api/system/dic';
|
|
|
+
|
|
|
+import { requestMagicApi } from '/@/api/magicApi';
|
|
|
+import { BasicOptionModel } from '/@/api/model/baseModel';
|
|
|
+import { Tinymce } from '/@/components/Tinymce';
|
|
|
+import { h } from 'vue';
|
|
|
+
|
|
|
+export const contestStatusOptions: BasicOptionModel[] = [
|
|
|
+ { label: '未发布', value: 1 },
|
|
|
+ { label: '报名中', value: 2 },
|
|
|
+ { label: '报名结束', value: 3 },
|
|
|
+ { label: '活动结束', value: 4 },
|
|
|
+];
|
|
|
+
|
|
|
+export const tableColumns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '活动名称',
|
|
|
+ dataIndex: 'name',
|
|
|
+ align: 'left',
|
|
|
+ width: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '开始时间',
|
|
|
+ dataIndex: 'stateDate',
|
|
|
+ align: 'left',
|
|
|
+ width: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '结束时间',
|
|
|
+ dataIndex: 'endDate',
|
|
|
+ align: 'left',
|
|
|
+ width: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '活动地点',
|
|
|
+ dataIndex: 'address',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '活动类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '组织部门',
|
|
|
+ dataIndex: 'deptCn',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ align: 'left',
|
|
|
+ width: 80,
|
|
|
+ customRender: ({ text }) => {
|
|
|
+ return contestStatusOptions.filter((row) => row.value === text)[0]?.label;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '报名人数',
|
|
|
+ dataIndex: 'count',
|
|
|
+ align: 'left',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+export const searchFormSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ field: 'name',
|
|
|
+ label: '活动名称',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'enrollType',
|
|
|
+ label: '活动类型',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: getDataOption,
|
|
|
+ params: { code: 'enroll_type' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'deptId',
|
|
|
+ label: '组织部门',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: requestMagicApi,
|
|
|
+ params: { url: 'educational/abutment/org-info' },
|
|
|
+ labelField: 'name',
|
|
|
+ valueField: 'id',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'status',
|
|
|
+ label: '状态',
|
|
|
+ component: 'Select',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ options: contestStatusOptions,
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+export const formSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ field: 'name',
|
|
|
+ label: '活动名称',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'date',
|
|
|
+ label: '活动时间',
|
|
|
+ component: 'RangePicker',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ showTime: { format: 'HH:mm:ss' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'address',
|
|
|
+ label: '活动地点',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'enrollType',
|
|
|
+ label: '活动类型',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ colProps: { span: 12 },
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: getDataOption,
|
|
|
+ params: { code: 'enroll_type' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'endDate',
|
|
|
+ label: '截止时间',
|
|
|
+ component: 'DatePicker',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: {
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'deptId',
|
|
|
+ label: '组织部门',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ colProps: { span: 12 },
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: requestMagicApi,
|
|
|
+ params: { url: 'educational/abutment/org-info' },
|
|
|
+ labelField: 'name',
|
|
|
+ valueField: 'id',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'name',
|
|
|
+ label: '负责人',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'tel',
|
|
|
+ label: '联系电话',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '活动封面',
|
|
|
+ field: 'img',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: { span: 24 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '报名范围',
|
|
|
+ field: 'pople',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'newsContent',
|
|
|
+ component: 'Input',
|
|
|
+ label: '活动详情',
|
|
|
+ rules: [{ required: true }],
|
|
|
+ colProps: { span: 24 },
|
|
|
+ render: ({ model, field }) => {
|
|
|
+ return h(Tinymce, {
|
|
|
+ value: model[field],
|
|
|
+ onChange: (value: string) => {
|
|
|
+ model[field] = value;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|