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
|
}
|