zzw
2023-11-20 c1314fc66be416fb4e7f8ef69a4734493fd802ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import buildOneTextJsData from './js/oneText'
import buildDialogJsData from './js/dialog'
import buildSelectJsData from './js/select'
import buildDatePickerJsData from './js/datePicker'
 
export function makeUpJs(formJson) {
  const data = {}
  data[formJson.formModel] = {}
  data[formJson.formRules] = {}
 
  formJson.fields.forEach(field => {
    if (field.FComponentType === 'oneText') {
      buildOneTextJsData(formJson, field, null, data)
    } else if (field.FComponentType === 'dialog') {
      buildDialogJsData(formJson, field, data)
    } else if (field.FComponentType === 'select') {
      buildSelectJsData(formJson, field, null, data)
    } else if (field.FComponentType === 'datePicker') {
      buildDatePickerJsData(formJson, field, null, data)
    }
  })
 
  return data
}