import { listDictModel } from '/@/api/common';
import { DescItem } from '/@/components/Description';
import { BasicColumn, FormSchema } from '/@/components/Table';
import { radioBoolean } from '/@/utils/filters';
export const columns: BasicColumn[] = [
  {
    title: '通知标题',
    dataIndex: 'noticeTitle',
  },
  {
    title: '通知类型',
    dataIndex: 'noticeType',
  },
  {
    title: '通知内容',
    dataIndex: 'noticeContent',
  },
  {
    title: '状态',
    dataIndex: 'disable',
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
  },
  {
    title: '修改时间',
    dataIndex: 'updateTime',
  },
];
export const searchFormSchema: FormSchema[] = [
  {
    field: 'noticeTitle',
    label: '通知标题',
    component: 'Input',
    componentProps: {
      placeholder: '请输入通知标题',
    },
  },
  {
    field: 'noticeType',
    label: '通知类型',
    component: 'Input',
    componentProps: {
      placeholder: '请输入通知类型',
    },
  },
];
//增加
export const dataFormSchema: FormSchema[] = [
  {
    field: 'noticeTitle',
    label: '通知标题',
    component: 'Input',
    required: true,
    componentProps: {
      placeholder: '请输入通知标题',
    },
  },
  {
    field: 'noticeType',
    label: '通知类型',
    component: 'ApiRadioGroup',
    componentProps: {
      api: listDictModel,
      params: {
        dictCode: 'sys_notice_type',
      },
      labelField: 'dictItemName',
      valueField: 'dictItemCode',
    },
    defaultValue: '1',
  },
  {
    field: 'noticeContent',
    label: '通知内容',
    component: 'InputTextArea',
    required: true,
    componentProps: {
      placeholder: '请输入通知内容',
    },
  },
  {
    field: 'disable',
    label: '状态',
    component: 'RadioGroup',
    required: true,
    componentProps: {
      options: radioBoolean,
    },
    defaultValue: 1,
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入备注',
    },
  },
];
// 表单渲染字段
export const descFormSchema: DescItem[] = [
  {
    field: 'noticeTitle',
    label: '通知标题',
    labelMinWidth: 80,
  },
  {
    field: 'noticeType',
    label: '通知类型',
  },
  {
    field: 'noticeContent',
    label: '通知内容',
  },
  {
    field: 'disable',
    label: '状态',
  },
  {
    field: 'remark',
    label: '备注',
  },
  {
    field: 'createTime',
    label: '创建时间',
  },
  {
    field: 'updateTime',
    label: '修改时间',
  },
];
