const.js 2.16 KB
Newer Older
yanzhongrong's avatar
yanzhongrong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
export function formInit1(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
      id: null,
      name: "",
      startPointName: "",
      endPointName: "",
      totalLong: null,
    },
    type2: 0,
    type3: 0,
    type4: 0,
    type5: 0,
    operateSystem: null,
    ...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: "",
yanzhongrong's avatar
yanzhongrong committed
37
      wayId: null,
yanzhongrong's avatar
yanzhongrong committed
38
    },
yanzhongrong's avatar
yanzhongrong committed
39 40 41
    type3: 0,
    type4: 0,
    type5: 0,
yanzhongrong's avatar
yanzhongrong committed
42 43 44 45 46 47 48
    ...data
  }
}
export function formInit3(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
yanzhongrong's avatar
yanzhongrong committed
49 50 51 52 53
      fsuCode: "",
      fsuPort: null,
      equipName: "",
      ip: "",
      equipFactory: "",
yanzhongrong's avatar
yanzhongrong committed
54
      backupModeName: null,
yanzhongrong's avatar
yanzhongrong committed
55
      connectModeName: "",
yanzhongrong's avatar
yanzhongrong committed
56
      equipTypeName: null,
yanzhongrong's avatar
yanzhongrong committed
57 58 59 60
      equipSubTypeName: "",
      softVersion: "",
      equipSerialNumber: "",
      kmSign: "",
yanzhongrong's avatar
yanzhongrong committed
61
    },
yanzhongrong's avatar
yanzhongrong committed
62 63
    type4: 0,
    type5: 0,
yanzhongrong's avatar
yanzhongrong committed
64 65 66 67 68 69 70
    ...data
  }
}
export function formInit4(data = {}) {
  return {
    deviceStatus: null,
    baseInfo: {
yanzhongrong's avatar
yanzhongrong committed
71 72 73
      equipCode: "",
      equipName: '',
      equipFactory: "",
yanzhongrong's avatar
yanzhongrong committed
74 75
      equipTypeName: null,
      equipModeName: null,
yanzhongrong's avatar
yanzhongrong committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
      equipSerialNumber: "",
      kmSign: "",
      installDate: "",
      repairDate: '',
    },
    type5: 0,
    ...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,
yanzhongrong's avatar
yanzhongrong committed
103 104 105 106
    },
    ...data
  }
}
yanzhongrong's avatar
yanzhongrong committed
107

yanzhongrong's avatar
yanzhongrong committed
108 109 110 111 112
let formFuncData = {
  1: formInit1,
  2: formInit2,
  3: formInit3,
  4: formInit4,
yanzhongrong's avatar
yanzhongrong committed
113
  5: formInit5,
yanzhongrong's avatar
yanzhongrong committed
114
};
yanzhongrong's avatar
yanzhongrong committed
115

yanzhongrong's avatar
yanzhongrong committed
116 117 118
export function formInit(type) {
  return formFuncData[type];
}