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: "重要信息系统运行整体情况",
    project2: "基本信息",
    code: 'TB3001',
    content: [
      { type: "text", value: "（1）重要信息系统总数（不含基础设施类）：" },
      { type: "input", value: "", unit: "个", field: "COL0" },
     
      { type: "text", value: "，其中：" },
      { type: "brspace" },

      { type: "text", value: "综合业务类：" },
      { type: "number", value: "", unit: "个", field: "COL1" },
      { type: "text", value: "，渠道管理类：" },
      { type: "number", value: "", unit: "个", field: "COL2" },
      { type: "text", value: "，客户管理类：" },
      { type: "number", value: "", unit: "个", field: "COL3" },

      { type: "text", value: "产品管理类：" },
      { type: "number", value: "", unit: "个", field: "COL4" },
      { type: "text", value: "，财务管理类：" },
      { type: "number", value: "", unit: "个", field: "COL5" },

      { type: "brspace" },

      { type: "text", value: "决策支持类：" },
      { type: "number", value: "", unit: "个", field: "COL6" },
    
      { type: "text", value: "共享支持类：" },
      { type: "number", value: "", unit: "个", field: "COL7" },
      { type: "text", value: "，其他：" },
      { type: "number", value: "", unit: "个", field: "COL8" },
      { type: "br" },

      { type: "text", value: "（2）安全保护等级：" },
      { type: "text", value: "1级：" },
      { type: "number", value: "", unit: "个", field: "COL9" },
      { type: "text", value: "，2级：" },
      { type: "number", value: "", unit: "个", field: "COL10" },
      { type: "text", value: "，3级：" },
      { type: "number", value: "", unit: "个", field: "COL11" },
      { type: "text", value: "4级：" },
      { type: "number", value: "", unit: "个", field: "COL12" },
      { type: "text", value: "，5级：" },
      { type: "number", value: "", unit: "个", field: "COL13" },
      { type: "text", value: "，未定级：" },
      { type: "number", value: "", unit: "个", field: "COL14" },

    ],
    remarks: {
      rows:5,
      field:"COL15"
    },
  },
  {
    serialNumber: "2",
    project: "重要信息系统运行整体情况",
    project2: "灾备情况",
    code: 'TB3001',
    content: [
      { type: "text", value: "（1）纳入（含双活、多活）灾备的重要信息系统数：" },
      { type: "input", value: "", unit: "个", field: "COL16" },
      { type: "text", value: "，其中：" },
      { type: "brspace" },
      { type: "text", value: "数据级灾备：" },
      { type: "number", value: "", unit: "个", field: "COL17" },
      { type: "text", value: "，系统级灾备：" },
      { type: "number", value: "", unit: "个", field: "COL18" },
      { type: "text", value: "，应用级灾备：" },
      { type: "number", value: "", unit: "个", field: "COL19" },
      { type: "brspace" },
      { type: "text", value: "仅纳入同城灾备：" },
      { type: "number", value: "", unit: "个", field: "COL20" },
      { type: "text", value: "，仅纳入异地灾备：" },
      { type: "number", value: "", unit: "个", field: "COL21" },
      { type: "text", value: "，纳入同城又纳入异地灾备：" },
      { type: "number", value: "", unit: "个", field: "COL22" },
      { type: "brspace" },
      { type: "text", value: "灾难恢复能力等级：" },
      { type: "text", value: "1级：" },
      { type: "number", value: "", unit: "个", field: "COL23" },
      { type: "text", value: "，2级：" },
      { type: "number", value: "", unit: "个", field: "COL24" },
      { type: "text", value: "，3级：" },
      { type: "number", value: "", unit: "个", field: "COL25" },
      { type: "text", value: "4级：" },
      { type: "number", value: "", unit: "个", field: "COL26" },
      { type: "text", value: "，5级：" },
      { type: "number", value: "", unit: "个", field: "COL27" },
      { type: "brspace" },
      { type: "text", value: "采取高可用技术：" },
      { type: "number", value: "", unit: "个", field: "COL29" },
      { type: "br" },
      { type: "text", value: "（2）已开展过灾备切换且真实接管业务演练的重要信息系统数：" },
      { type: "number", value: "", unit: "个", field: "C23A001" },
      { type: "brspace" },
      { type: "text", value: "符合监管要求的重要信息系统灾备覆盖率：" },
      { type: "number", value: "", unit: "%", field: "COL30" },
      { type: "br" },
      { type: "text", value: "（3）已制定应急预案的重要信息系统数：" },
      { type: "number", value: "", unit: "个", field: "COL31" },
      { type: "text", value: "，重要信息系统应急预案覆盖率：" },
      { type: "number", value: "", unit: "%", field: "COL32" },

    ],
    remarks: {
      rows:6,
      field:"COL33"
    },
  },

  {
    serialNumber: "3",
    project: "重要信息系统运行整体情况",
    project2: "系统部署模式",
    code: 'TB3001',
    content: [
      { type: "checkbox-group",field: "C24A001",options:[
        "裸金属","虚拟化","容器化","集群化","私有云","专有云","公有云","混合云"
      ]},
    ],
    remarks: {
      rows:2,
      field:"C24A002"
    },
  },
  
  {
    serialNumber: "3",
    project: "重要信息系统运行整体情况",
    project2: "数据量",
    code: 'TB3001',
    content: [
      { type: "number",field: "C24A003",unit:'TB'}
    ],   
    remarks: {
      rows:2,
      field:"C24A004"
    },
  },

  {
    serialNumber: "3",
    project: "重要信息系统运行整体情况",
    project2: "开发模式",
    code: 'TB3001',
    content: [

      { type: "text", value: "自主研发：" },
      { type: "number", value: "", unit: "个", field: "COL34" },
      { type: "text", value: "，整体外包：" },
      { type: "number", value: "", unit: "个", field: "COL35" },
      { type: "text", value: "，部分外包：" },
      { type: "number", value: "", unit: "个", field: "COL36" },
      { type: "br" },


    ],
    remarks: {
      rows:2,
      field:"COL37"
    },
  },
  {
    serialNumber: "4",
    project: "重要信息系统运行整体情况",
    project2: "运维模式",
    code: 'TB3001',
    content: [
      { type: "text", value: "自主运维：" },
      { type: "number", value: "", unit: "个", field: "COL38" },
      { type: "text", value: "，整体外包：" },
      { type: "number", value: "", unit: "个", field: "COL39" },
      { type: "text", value: "，部分外包：" },
      { type: "number", value: "", unit: "个", field: "COL40" },
    ],
    remarks: {
      rows:2,
      field:"COL41"
    },
  },
  {
    serialNumber: "5",
    project: "重要信息系统运行整体情况",
    project2: "知识产权",
    code: 'TB3001',
    content: [
      { type: "text", value: "自有：" },
      { type: "number", value: "", unit: "个", field: "COL42" },
      { type: "text", value: "，共有：" },
      { type: "number", value: "", unit: "个", field: "COL43" },
      { type: "text", value: "，他有：" },
      { type: "number", value: "", unit: "个", field: "COL44" },
    ],
    remarks: {
      rows:2,
      field:"COL45"
    },
  },
  {
    serialNumber: "6",
    project: "重要信息系统运行整体情况",
    project2: "重要信息系统托管情况",
    code: 'TB3001',
    content: [
      { type: "text", value: "本机构托管在外部机构重要信息系统数量：" },
      { type: "number", value: "", unit: "个", field: "COL46" },
      { type: "br" },
      { type: "text", value: "外部机构托管在本机构的重要信息系统数量：" },
      { type: "number", value: "", unit: "个", field: "COL47" },
      { type: "text", value: "，托管机构数量：" },
      { type: "number", value: "", unit: "个", field: "COL48" },
    ],
    remarks: {
      rows:2,
      field:"COL49"
    },
  },
  {
    serialNumber: "7",
    project: "重要信息系统运行整体情况",
    project2: "变更情况",
    code: 'TB3001',
    content: [
      { type: "text", value: "本报告期重要信息系统软件重大版本升级次数：" },
      { type: "input", value: "", unit: "次", field: "COL50" },
      { type: "br" },
      { type: "text", value: "本报告期重要信息系统变更总数：" },
      { type: "number", value: "", unit: "次", field: "COL51" },
      { type: "text", value: "，重要信息系统紧急变更总数：" },
      { type: "number", value: "", unit: "次", field: "COL52" },
      { type: "br" },
      { type: "text", value: "本报告期生产环境变更成功率：" },
      { type: "number", value: "", unit: "%", field: "COL53" },
      { type: "br" },
      { type: "text", value: "本报告期因生产环境变更引发的异常事件数：" },
      { type: "number", value: "", unit: "次", field: "COL54" },
    ],
    remarks: {
      rows:2,
      field:"COL55"
    },
  },
  {
    serialNumber: "8",
    project: "重要信息系统详细情况",
    project2: "",
    code: 'TB3002',
    type: "MultiColumnTable",
    content: [
      { name: "系统名称", formType: "input", field: "COL106" },
      { 
        name: "系统类别", 
        formType: "radio-group", 
        field: "COL56",
        options: [
            "综合业务类", "渠道管理类", "客户管理类", "产品管理类","财务管理类", "决策支持类", "共享支持类", "其他"
        ],
        otherOption:true,
        otherField:"COL57"
      },
      

      { name: "系统功能简介", formType: "textarea", field: "COL59" },
      { name: "投产日期", formType: "date", field: "COL60" },
      { name: "系统所在数据中心名称", formType: "input", field: "COL61" },
      { 
        name: "开发模式", 
        formType: "radio-group-extraFields", 
        field: "COL62",
        options: [
          { label: "自主研发",},
          { label: "整体外包",},
          { label: "部分外包",}
        ],
        extraFields:{
          "整体外包": [
            { label: "外包商名称", field: "COL63",formType:"input",width:"100px"},
          ],
          "部分外包": [
            { label: "外包商名称", field: "COL64",formType:"input",width:"100px"},
          ],
        }
      },
      { 
        name: "运维模式", 
        formType: "radio-group-extraFields", 
        field: "COL65",
        options: [
          { label: "自主运维",},
          { label: "整体外包" },
          { label: "部分外包" }
        ],
        extraFields:{
          "整体外包": [
            { label: "外包商名称", field: "COL66",width:"100px"},
          ],
          "部分外包": [
            { label: "外包商名称", field: "COL67",width:"100px"},
          ],
        }
      },
      { 
        name: "知识产权", 
        formType: "radio-group-extraFields", 
        field: "COL68",
        options: [
          { label: "自有",},
          { label: "共有"},
          { label: "他有"}
        ],
        extraFields:{
          "共有": [
            { label: "共有方名称", field: "COL69",width:"100px"},
          ],
          "他有": [
            { label: "他有方名称", field: "COL70",width:"100px"},
          ],
        }
      },
      { 
        name: "安全保护等级", 
        formType: "radio-group", 
        field: "COL71",
        options: ["1级", "2级", "3级", "4级", "5级", "未定级"]
      },
      { 
        name: "服务时段", 
        formType: "radio-group", 
        field: "COL72",
        options: [
          "7×24小时", "7×8小时", "5×8小时", "其他"
        ],
        otherOption:true,
        otherField:"COL73"
      },
      { 
        name: "托管于外部机构", 
        formType: "yesno", 
        field: "COL74",
        otherOption:true,
        otherField:"COL75",
        otherLabel:"托管机构名称"

      },
      { 
        name: "灾难恢复要求", 
        formType: "radio-group-extraFields", 
        field: "COL76",
        options: [
          { label: "明确系统恢复要求"},
          { label: "未明确"},

        ],
        extraFields:{
          "明确系统恢复要求": [
            { label: "RTO", field: "COL77", unit: "分钟",width:"100px"},
            { label: "RPO", field: "COL78", unit: "分钟",width:"100px" }
          ]
        }
      },

      { 
        name: "灾备情况-恢复能力等级", 
        formType: "radio-group", 
        field: "COL79",
        options: [
          "无","1级","2级","3级","4级","5级","6级"
        ]
      },
      { 
        name: "灾备情况-区域", 
        formType: "checkbox-group", 
        field: "COL80",
        options: [
          "同城灾备","异地灾备"
        ],
        extraFields:{
          "同城灾备": [
            { label: "同城灾备级别", field: "COL81",formType:"radio",options:[
                { label: "数据级",value:"数据级"},
                { label: "系统级",value:"系统级"},
                { label: "应用级",value:"应用级"},
              ],width:"500px"
            },
          ],
          "异地灾备": [
              { label: "异地灾备级别", field: "COL82",formType:"radio",options:[
                { label: "数据级",value:"数据级"},
                { label: "系统级",value:"系统级"},
                { label: "应用级",value:"应用级"},
              ],width:"500px"
            },
          ],
        }
      },
      { 
        name: "建立应急预案", 
        formType: "radio-group", 
        field: "COL83",
        options: ["是", "否"]
      },
      { 
        name: "备份数据异地保存", 
        formType: "yesno", 
        field: "COL84",
        otherOption:true,
        otherField:"COL85",
        otherLabel:"备份数据异地保存地点"

      },
      { 
        name: "已开展过灾备切换且真实接管业务演练", 
        formType: "radio-group", 
        field: "C23A001",
        options: ["是", "否"]
      },
      { 
        name: "接管最长时间", 
        formType: "input", 
        field: "C23A002",
        unit: "小时",
        showWhen: { field: "C23A001", value: "是" }
      },
      { 
        name: "本地高可用技术", 
        formType: "checkbox-group", 
        field: "COL86",
        options: [
          "虚拟化", "集群", "负载均衡", "服务器及主机备份", "存储设备冗余","无","其他"
        ],
        otherOption:true,
        otherField:"COL87",
        otherLabel:""

      },
      { 
        name: "系统部署方式", 
        formType: "checkbox-group", 
        field: "C24A005",
        options: [
          "裸金属", "虚拟化", "容器化", "集群化", "私有化","专有云","公有云","混合云"
        ],
      },
      { 
        name: "系统数据量", 
        formType: "number", 
        field: "C24A006",
        unit:'TB'
      },
      { 
        name: "系统架构", 
        formType: "checkbox-group", 
        field: "C24A007",
        options: [
          "单体架构", "分布式架构", "SOA架构", "微服务架构", "无服务架构","云原生架构"
        ],
        otherOption:true,
        otherField:"C24A008",
        otherLabel:"其他"
      },
      { 
        name: "关键软硬件产品",
        formType:'table',
        field: "TB30021",
        gridOptions:
        {
          border: true,
          showOverflow: true,
          editConfig: {
            trigger: 'click',
            mode: 'row'
          },
          checkboxConfig: {
            labelField: 'name',
            highlight: true
          },
    
          toolbarConfig: {
            zoom: true,
            buttons: [
              { name: '新增', code: 'add', mode:'text',status: 'primary',size:"mini",field:"TB30021"},
              { name: '删除', code: 'delete', mode:'text',status: 'primary',size:"mini",field:"TB30021"},
            ]
          },
          columns: [
            { type: 'checkbox', width: 70 },
            { field: 'COL88', title: '产品用途',editRender:{
              name: 'input',
              attrs: {
                type: 'input', 
              }

            }},
            { field: 'COL89', title: '产品类型',editRender:{
              name: 'input',
              attrs: {
                type: 'input', 
              }
            }},
            { field: 'COL90', title: '产品品牌',editRender:{
              name: 'input',
              attrs: {
                type: 'input', 
                min: 0, 
                step: 10,
              }
            }},

            { field: 'COL91', title: '产品型号',editRender:{
              name: 'input',
              attrs: {
                type: 'input', 
              }
            }},
            { field: 'COL92', title: '数量（台/套）',editRender:{
              name: 'input',
              attrs: {
                type: 'number', 
                min: 0, 
                step: 10,
                unit: '请输入整数'
              }
            }},
          ],
          data: [
            {},
          ]
        }

      },
    ],
    datas: [],
    remarks: {
      rows:6,
      field:""
    },
  },
  {
    serialNumber: "9",
    project: "官方网站情况",
    project2: "",
    code: 'TB3003',
    type: "MultiColumnTable",
    content: [
      { name: "系统名称", formType: "input", field: "COL107" },
      { name: "中文名称", formType: "input", field: "COL93" },
      { name: "域名", formType: "input", field: "COL95" },
      { name: "互联网IP地址", formType: "input", field: "COL97" },
      { 
        name: "IPv6支持", 
        formType: "radio-group", 
        field: "C20A001",
        options: ["是", "否"]
      },
      { 
        name: "是否云部署", 
        formType: "yesno", 
        field: "C23A001",
      },
      { 
        name: "云部署模式", 
        formType: "checkbox-group", 
        field: "C23A002",
        options: [
          "私有云", "专有云", "公有云", "混合云"
        ]
      },
      { 
        name: "备案情况", 
        formType: "checkbox-group", 
        field: "COL99",
        options: [
          "工信部ICP备案","国际联网备案"
        ]
      },
      { 
        name: "工信部ICP备案-备案号", 
        formType: "input", 
        field: "COL100",
      },
      { 
        name: "国际联网备案-备案号", 
        formType: "input", 
        field: "COL101",
      },

      { 
        name: "等保定级情况", 
        formType: "select", 
        field: "C20A010",
        options: [
          {label:"一级"}, 
          {label:"二级"}, 
          {label:"三级"}, 
          {label:"四级"}, 
          {label:"未定级"}
        ]
      },
      { 
        name: "等级保护情况-备案情况", 
        formType: "radio-group", 
        field: "C20A011",
        options: ["已向公安部门备案", "未备案"]
      },
      { 
        name: "等级测评情况", 
        formType: "radio-group", 
        field: "COL104",
        options: ["已开展", "未开展"]
      }
    ],
    datas: [],
    remarks: {
      rows:6,
      field:""
    },
  },
  {
    serialNumber: "10",
    project: "移动互联网",
    project2: "移动互联网应用程序",
    code: 'TB30041',
    type: "MultiColumnTable",
    content: [
      { name: "应用名称", formType: "input", field: "C24A009" },
      { name: "应用类型", formType: "radio-group", field: "C24A010",
        options:["手机应用程序","微信小程序","其他"],
        otherField:"C24A011" 
      },
      { name: "承载主要业务名称", formType: "input", field: "C24A011" },
      { name: "个人客户数", formType: "input", field: "C24A012" },
      { name: "公司客户数", formType: "input", field: "C24A013" },
      { name: "月活用户数", formType: "input", field: "C24A014" },
      { name: "是否搜集客户敏感信息", formType: "yesno", field: "C24A015" },
      { name: "备案情况", formType: "yesno", field: "C24A016" },
      { name: "已采用加密技术传输客户敏感数据", formType: "yesno", field: "C24A017" },
      { name: "已定期开展漏洞扫描并修复漏洞", formType: "yesno", field: "C24A018" },
      { name: "已实施安全加固", formType: "yesno", field: "C24A019" },

      { name: "客户身份鉴证方式", formType: "checkbox-group", field: "C24A023",
        options:["单因素验证","双因素验证","多因素验证","其他"],
        otherField:"C24A024"
      },
     
      { name: "是否存在过度收集个人信息、隐私政策不合理、功能不健全等问题", formType: "yesno", field: "C24A025" },

      { name: "应用备注", formType: "input", field: "C24A026" },
      
    ],
    datas: [],
    remarks: {
      rows:6,
      field:""
    },
  },
  {
    serialNumber: "11",
    project: "移动互联网",
    project2: "通报",
    code: 'TB3004',
    content: [
      { type: "text", value: "（1）本年度收到工信部门通报次数：" },
      { type: "number", value: "", unit: "次", field: "C24A027" },
      { type: "br" },
      { type: "text", value: "（2）本年度收到中央网信办、地方网信部门通报：" },
      { type: "number", value: "", unit: "次", field: "C24A028" },
      { type: "br" },

    ]
    ,
    remarks: {
      rows:2,
      field:"C24A029"
    },
  }
];
