export function formInit1(data = {}) {
  return {
    deviceStatus: '',
    baseInfo: {
      createdBy: "",
      id: null,
      name: "",
      startPointName: "",
      endPointName: "",
      totalLong: null,
    },
    status: [],
    type2: 0,
    type3: 0,
    type4: 0,
    type5: 0,
    type6: 0,
    controlLimit: [
      { sum: 0, type: "" },
      { sum: 0, type: "" },
      { sum: 0, type: "" },
      { sum: 0, type: "" },
    ],
    operateSystem: '',
    ...data
  }
}
export function formInit2(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
      createdBy: "",
      lastModifiedBy: null,
      creationTime: "",
      lastModifiedTime: null,
      id: null,
      siteCode: "",
      siteName: "",
      siteAddress: "",
      siteArea: "",
      siteSectionCode: "",
      siteKmSign: "",
      siteLongitude: "",
      siteLatitude: "",
      siteOtherMessage: "",
      wayId: null,
    },
    type3: 0,
    type4: 0,
    type5: 0,
    status: [],
    controlLimit: "",
    count: "",
    ...data
  }
}
export function formInit3(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
      fsuCode: "",
      fsuPort: null,
      equipName: "",
      ip: "",
      railWayName: '',
      siteName: '',
      equipFactory: "",
      backupModeName: null,
      connectModeName: "",
      equipTypeName: null,
      equipSubTypeName: "",
      softVersion: "",
      equipSerialNumber: "",
      kmSign: "",
    },
    type4: 0,
    type5: 0,
    controlLimit: "",
    count: {
      LEAKY: 0
    },
    ...data
  }
}
export function formInit4(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
      equipCode: "",
      equipName: '',
      equipFactory: "",
      equipTypeName: null,
      equipModeName: null,
      equipSerialNumber: "",
      kmSign: "",
      installDate: "",
      repairDate: '',
    },
    type5: 0,
    controlLimit: [
      { sum: 0, type: "" },
    ],
    ...data
  }
}
export function formInit5(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
      antennaFeederLength: null,
      equipId: null,
      fsuId: null,
      hundredMetersLoss: null,
      inserterLength: null,
      jumperLength: null,
      leakyCableCode: "",
      leakyCableDescribe: "",
      leakyCableLength: null,
      leakyCableMode: "",
      reductRatio: null,
      sendPower: null,
      siteId: null,
      wayId: null,
    },
    log: 0,
    loss: 0,
    status: [
      { name: '', value: ''}
    ],
    ...data
  }
}
export function formInit6(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
      antennaFeederLength: null,
      equipId: null,
      fsuId: null,
      feederLossMeters: null,
      inserterLength: null,
      jumperLength: null,
      feederCode: "",
      feederDescribe: "",
      feederLength: null,
      feederModel: "",
      reductRatio: null,
      sendPower: null,
      siteId: null,
      wayId: null,
    },
    log: 0,
    loss: 0,
    status: [
      { name: '', value: ''}
    ],
    ...data
  }
}

let formFuncData = {
  1: formInit1,
  2: formInit2,
  3: formInit3,
  4: formInit4,
  5: formInit5,
  6: formInit6,
};

export function formInit(type) {
  return formFuncData[type];
}