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: 'TB4001',
    type: "VxeTable",
    showFooter:false,
    columns: [
      { type: 'seq', visible: true, width: '50', showOverflow: false },
      { field: 'COL1', title: '项目名称', editRender: { name: 'VxeInput' } },
      { field: 'COL2', title: '项目实现功能', editRender: { name: 'VxeInput' } },

      { field: 'COL3', title: '实施情况', 
        editRender: { name: 'VxeSelect', options: ["新增", "执行中", "完成", "已取消"]},
        slots:{ edit: 'select',default: 'default_select'},
      },

      { field: 'COL4', title: '项目类别', 
        editRender: { name: 'VxeSelect', options: ["软件类(银行业)", "基础设施类", "其他"]},
        slots:{ edit: 'select',default: 'default_select'}
      },

      { field: 'COL5', title: '软件类细分',visible:true, showHeaderOverflow: true,
        editRender: { name: 'VxeSelect',    options: [
          "综合业务", "渠道管理", "客户管理", "产品管理", 
          "财务管理", "决策支持", "共享支持", "其他"
        ],},
        slots:{ edit: 'select',default: 'default_select'},
        show: (row) => row.COL4 === "软件类(银行业)"
      },
      { field: 'COL7', title: '合同金额(万元)', showHeaderOverflow: true, editRender: { name: 'VxeNumberInput' }},

      { field: 'COL8', title: '计划完成',editRender: { name: 'VxeDatePicker' }},
      { field: 'COL9', title: '开始日期',editRender: { name: 'VxeDatePicker' }},
      { field: 'COL10', title: '实际完成',editRender: { name: 'VxeDatePicker' }},
      { field: 'C20A001', title: '项目取消',editRender: { name: 'VxeDatePicker'},
        visible: (row) => row.COL3 == "已取消"
      },
   
      { field: 'COL11', title: '实施模式', 
        editRender: { name: 'VxeSelect', options: ["自主研发(建设)", "整体外包", "部分外包"] },
        slots:{ edit: 'select',default: 'default_select'}
      },

      { field: 'COL12', title: '创新点和意义', showHeaderOverflow: true,editRender: { name: 'VxeInput' }},
      { field: 'COL13', title: '新技术应用情况', showHeaderOverflow: true,editRender: { name: 'VxeInput' }},
      { field: 'COL14', title: '备注', editRender: { name: 'VxeInput' }},
      { title: '操作', slots: { default: 'action' },width:100 }
    ],

    data: [
      { COL1: '', COL2: '', COL3: '', COL4:'', COL5: '' ,COL6:'',COL7:''},
    ],
  }
