import moment from 'moment';

export const modalConfig = {
  formItems: [
    {
      field: 'noticeTitle',
      type: 'input',
      label: '公告标题',
      required: true,
      placeholder: '请输入公告标题'
    },
    {
      field: 'noticeType',
      type: 'select',
      label: '公告类型',
      required: true,
      placeholder: '请选择公告类型',
      options:[
        { value: '1', title: '通知' },
        { value: '2', title: '公告' },
      ]
    },
    {
      field: 'startTime',
      type: 'datepicker',
      label: '开始时间',
      required: false,
      placeholder: '请选择开始时间',
      otherOptions: {
        type: 'datetime',
        'value-format': 'yyyy-MM-dd HH:mm:ss',
      },
      resFormat: (time) => {
        return moment(time).format('YYYY-MM-DD HH:mm:ss');
      }
    },
    {
      field: 'endTime',
      type: 'datepicker',
      label: '结束时间',
      required: false,
      placeholder: '请选择结束时间',
      otherOptions: {
        type: 'datetime',
        'value-format': 'yyyy-MM-dd HH:mm:ss',
      },
      resFormat: (time) => {
        return moment(time).format('YYYY-MM-DD HH:mm:ss');
      }
    },
    {
      field: 'status',
      type: 'radio',
      label: '状态',
      required: true,
      options:[
        { label: '正常', value: '0' },
        { label: '关闭', value: '1' }
      ]
    },
    {
      field: 'noticeContent',
      type: 'textarea',
      label: '内容',
      placeholder: '请输入内容'
    }
    
  ],
  colLayout: { span: 24 },
  itemStyle: {}
}
