import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';

export const querySchema: FormSchemaGetter = () => [
  /* {
    component: 'Input',
    fieldName: 'deptId',
    label: '部门ID',
  }, */
  /* {
    component: 'Input',
    fieldName: 'deptName',
    label: '部门名称',
  }, */
  {
    component: 'RangePicker',
    fieldName: 'tjrq',
    label: '统计日期',
  },
  /* {
    component: 'Input',
    fieldName: 'rwzs',
    label: '发起任务总数',
  },
  {
    component: 'Input',
    fieldName: 'jqrws',
    label: '警情任务数',
  },
  {
    component: 'Input',
    fieldName: 'ajrws',
    label: '案件任务数',
  },
  {
    component: 'Input',
    fieldName: 'zxrws',
    label: '专项任务数',
  },
  {
    component: 'Input',
    fieldName: 'qtrws',
    label: '其他任务数',
  },
  {
    component: 'Input',
    fieldName: 'ptrws',
    label: '普通任务数',
  },
  {
    component: 'Input',
    fieldName: 'jjrws',
    label: '指令任务数',
  },
  {
    component: 'Input',
    fieldName: 'zlrws',
    label: '线索核查数',
  }, */
];

// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
  // { type: 'checkbox', width: 60 },
  {
    title: 'ID',
    field: 'id',
    visible: false, // 隐藏列
  },
  {
    title: '部门ID',
    field: 'deptId',
    visible: false, // 隐藏列
  },
  {
    title: '部门名称',
    field: 'deptName',
    minWidth: 100,
  },
  {
    title: '任务类型',
    children: [
      {
        title: '发起任务总数',
        field: 'rwzs',
      },
      {
        title: '警情任务数',
        field: 'jqrws',
      },
      {
        title: '案件任务数',
        field: 'ajrws',
      },
      {
        title: '专项任务数',
        field: 'zxrws',
      },
      {
        title: '其他任务数',
        field: 'qtrws',
      },
    ],
  },
  {
    title: '任务级别',
    children: [
      {
        title: '普通任务数',
        field: 'ptrws',
      },
      {
        title: '指令任务数',
        field: 'jjrws',
      },
      {
        title: '敏感任务数',
        field: 'mgrws',
      },
      {
        title: '情指任务数',
        field: 'qzrws',
      },
      {
        title: '线索核查数',
        field: 'zlrws',
      },
      {
        title: '特殊任务数',
        field: 'tsrws',
      },
    ],
  },
  /* {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 180,
  }, */
];

export const modalSchema: FormSchemaGetter = () => [
  {
    label: 'ID',
    fieldName: 'id',
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: [''],
    },
  },
  {
    label: '部门ID',
    fieldName: 'deptId',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '部门名称',
    fieldName: 'deptName',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '统计日期',
    fieldName: 'tjrq',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      format: 'YYYY-MM-DD',
      valueFormat: 'YYYY-MM-DD',
    },
    rules: 'required',
  },
  {
    label: '发起任务总数',
    fieldName: 'rwzs',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '警情任务数',
    fieldName: 'jqrws',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '案件任务数',
    fieldName: 'ajrws',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '专项任务数',
    fieldName: 'zxrws',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '其他任务数',
    fieldName: 'qtrws',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '普通任务数',
    fieldName: 'ptrws',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '指令任务数',
    fieldName: 'jjrws',
    component: 'Input',
    rules: 'required',
  },
  {
    label: '线索核查数',
    fieldName: 'zlrws',
    component: 'Input',
    rules: 'required',
  },
];
