import type { VxeGridProps, VxeColumnPropTypes } from 'vxe-table';
import XEUtils from 'xe-utils';

interface VxeColumn {
  type?: string;
  field?: string;
  title?: string;
  width?: number | string;
  minWidth?: number | string;
  maxWidth?: number | string;
  sortable?: boolean;
  formatter?: (value: any) => string;
  treeNode?: boolean;
  slots?: {};
  visible?: boolean;
  editRender?: {};
  align?: string;
  showOverflow?: boolean | string;
  fixed?: string;
  filters?: [] | {};
  filterMethod?: any;
  filterMethodTp?: string;
  filterRender?: any;
}

export const tableFormData = [
  {
    serialNumber: '1',
    project: '卫星导航系统应用整体情况',
    code: 'TM2001',
    type: 'VxeTable',
    columns: [
      {
        field: '',
        title: '业务场景',
        headerAlign: 'center',
        children: [
          {
            field: 'COL1',
            title: '场景类型',
            width: 200,
            editRender: {
              name: 'VxeSelect',
              options: ['授时', '定位', '导航', '短报文通信', '国际搜救', '其他'],
            },
            slots: { edit: 'select', default: 'default_select' },
          },
          {
            field: 'COL2',
            title: '其他场景',
            width: 200,
            editRender: { name: 'VxeInput' },
            slots: { edit: 'other_input', default: 'default_other' },
          },
          { field: 'COL3', title: '场景简述', width: 200, editRender: { name: 'VxeInput' } },
        ],
      },
      {
        field: '',
        title: '产品情况',
        headerAlign: 'center',
        children: [
          {
            field: '',
            showHeaderOverflow: true,
            title: '截至本月底拥有BDS载体保有量',
            children: [
              { field: 'COL9', title: '保有量', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL011', title: '单用', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL013', title: '主用', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL015', title: '优先', width: 200, editRender: { name: 'VxeNumberInput' } },
            ],
          },
          {
            field: '',
            showHeaderOverflow: true,
            title: '截至本月底拥有GPS载体保有量',
            children: [
              { field: 'COL017', title: '保有量', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL019', title: '单用', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL021', title: '主用', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL023', title: '优先', width: 200, editRender: { name: 'VxeNumberInput' } },
            ],
          },
          {
            field: 'col2_3',
            showHeaderOverflow: true,
            title: '截至本月底拥有其他载体保有量',
            children: [
              { field: 'COL025', title: '保有量', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL027', title: '单用', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL029', title: '主用', width: 200, editRender: { name: 'VxeNumberInput' } },
              { field: 'COL031', title: '优先', width: 200, editRender: { name: 'VxeNumberInput' } },
            ],
          },
        ],
      },

      { title: '操作', slots: { default: 'action' }, width: 100 },
    ],

    datas: [],
    remarks: '',
  },
  {
    serialNumber: '2',
    project: '卫星导航系统应用清单',
    code: 'TM2002',
    type: 'VxeTable',
    columns: [
      {
        field: '',
        title: '业务场景',
        headerAlign: 'center',
        children: [
          {
            field: 'COL001',
            title: '场景类型',
            width: 200,
            editRender: {
              name: 'VxeSelect',
              options: ['授时', '定位', '导航', '短报文通信', '国际搜救', '其他'],
            },
            slots: { edit: 'select', default: 'default_select' },
          },
          {
            field: 'COL002',
            title: '其他场景',
            width: 200,
            editRender: { name: 'VxeInput' },
            slots: { edit: 'other_input', default: 'default_other' },
          },
          { field: 'COL003', title: '场景简述', width: 200, editRender: { name: 'VxeInput' } },
        ],
      },
      {
        field: '',
        title: '产品情况',
        headerAlign: 'center',
        children: [
          { field: 'COL005', title: '名称', width: 200, editRender: { name: 'VxeInput' } },
          { field: 'COL006', title: '描述', width: 200, editRender: { name: 'VxeInput' } },
          {
            field: 'COL007',
            title: '是否境内生产',
            width: 200,
            editRender: {
              name: 'VxeSelect',
              options: [
                { label: '是', value: '是' },
                { label: '否', value: '否' },
              ],
            },
          },
          { field: 'COL008', title: '生产厂家', width: 200, editRender: { name: 'VxeInput' } },
          { field: 'COL009', title: '生产型号', width: 200, editRender: { name: 'VxeInput' } },
        ],
      },
      {
        field: '',
        title: '产品所用器件情况',
        headerAlign: 'center',
        children: [
          {
            field: 'COL011',
            title: '器件类型',
            width: 200,
            editRender: {
              name: 'VxeSelect',
              options: [
                { label: '芯片', value: '芯片' },
                { label: '模块', value: '模块' },
                { label: '板卡', value: '板卡' },
                { label: '不涉及', value: '不涉及' },
              ],
            },
          },
          {
            field: 'COL012',
            title: '是否境内生产',
            width: 200,
            editRender: {
              name: 'VxeSelect',
              options: [
                { label: '是', value: '是' },
                { label: '否', value: '否' },
              ],
            },
          },
          { field: 'COL013', title: '生产厂家', width: 200, editRender: { name: 'VxeInput' } },
          { field: 'COL014', title: '生产型号', width: 200, editRender: { name: 'VxeInput' } },
        ],
      },
      {
        field: '',
        title: '产品应用现状',
        headerAlign: 'center',
        children: [
          {
            field: 'COL016',
            title: '应用模式',
            width: 200,
            editRender: {
              name: 'VxeSelect',
              options: ['仅BDS ', '仅GPS', '仅其他', '主用BDS', '主用GPS', '主用其他', '优先用BDS', '优先用GPS', '优先用其他', '其他'],
            },
            slots: { edit: 'select', default: 'default_select' },
          },
          {
            field: 'COL017',
            title: '其他应用模式',
            width: 200,
            editRender: { name: 'VxeInput' },
            slots: { edit: 'other_input', default: 'default_other' },
          },
          { field: 'COL018', title: '应用台数', width: 200, editRender: { name: 'VxeNumberInput' } },
        ],
      },
      { title: '操作', slots: { default: 'action' }, width: 100 },
    ],

    datas: [],
    remarks: '',
  },
];
