|
|
@@ -5,6 +5,7 @@
|
|
|
import { Toast } from 'antd-mobile'
|
|
|
import { isObjEmpty } from './common.util'
|
|
|
import BillGroupModel from '../../model/common/BillGroupModel'
|
|
|
+import BillModel from '../../model/common/BillModel'
|
|
|
|
|
|
const testForm = [
|
|
|
{
|
|
|
@@ -14,10 +15,11 @@ const testForm = [
|
|
|
'groupCaller': 'test',
|
|
|
'fieldList': [
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'value': '饶猛',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -27,10 +29,11 @@ const testForm = [
|
|
|
'localDatas': [],
|
|
|
},
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
- 'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'caption': '性别',
|
|
|
+ 'value': '男',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -40,10 +43,11 @@ const testForm = [
|
|
|
'localDatas': [],
|
|
|
},
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
- 'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'caption': '年龄',
|
|
|
+ 'value': '25',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -53,10 +57,11 @@ const testForm = [
|
|
|
'localDatas': [],
|
|
|
},
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
- 'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'caption': '籍贯',
|
|
|
+ 'value': '江西',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -66,10 +71,11 @@ const testForm = [
|
|
|
'localDatas': [],
|
|
|
},
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
- 'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'caption': '公司',
|
|
|
+ 'value': '深圳市优软科技有限公司',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -79,10 +85,11 @@ const testForm = [
|
|
|
'localDatas': [],
|
|
|
},
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
- 'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'caption': '学校',
|
|
|
+ 'value': '南昌大学',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -92,10 +99,11 @@ const testForm = [
|
|
|
'localDatas': [],
|
|
|
},
|
|
|
{
|
|
|
- 'appwidth': '字符宽度',
|
|
|
+ 'appwidth': 100,
|
|
|
+ 'length': 100,
|
|
|
'isdefault': true,
|
|
|
- 'caption': '姓名',
|
|
|
- 'value': 'raomeng',
|
|
|
+ 'caption': '高中',
|
|
|
+ 'value': '金溪一中',
|
|
|
'display': '饶猛',
|
|
|
'type': 'S',
|
|
|
'readOnly': true,
|
|
|
@@ -109,19 +117,48 @@ const testForm = [
|
|
|
]
|
|
|
|
|
|
export function analysisFormData () {
|
|
|
+ let billGroupList = []
|
|
|
if (!isObjEmpty(testForm)) {
|
|
|
- let billGroupList = []
|
|
|
testForm.forEach((groupItem, groupIndex) => {
|
|
|
let billGroup = new BillGroupModel()
|
|
|
billGroup.group = groupItem.groupTitle
|
|
|
- billGroup.isForm = groupIndex.isForm
|
|
|
- billGroup.keyField = groupIndex.keyField
|
|
|
- billGroup.billCaller = groupIndex.groupCaller
|
|
|
+ billGroup.isForm = groupItem.isForm
|
|
|
+ billGroup.keyField = groupItem.keyField
|
|
|
+ billGroup.billCaller = groupItem.groupCaller
|
|
|
billGroup.groupIndex = groupIndex
|
|
|
|
|
|
+ let showBillFields = [], hideBillFields = []
|
|
|
if (!isObjEmpty(groupItem.fieldList)) {
|
|
|
- groupItem.fieldList.forEach(() => {})
|
|
|
+ groupItem.fieldList.forEach((fieldItem, filedIndex) => {
|
|
|
+ let billModel = new BillModel()
|
|
|
+
|
|
|
+ billModel.groupIndex = groupIndex
|
|
|
+ billModel.appwidth = fieldItem.appwidth
|
|
|
+ billModel.length = fieldItem.length
|
|
|
+ billModel.isdefault = fieldItem.isdefault
|
|
|
+ billModel.caption = fieldItem.caption
|
|
|
+ billModel.type = fieldItem.type
|
|
|
+ billModel.readOnly = fieldItem.readOnly ? 'T' : 'F'
|
|
|
+ billModel.field = fieldItem.field
|
|
|
+ billModel.value = fieldItem.value
|
|
|
+ billModel.display = fieldItem.display
|
|
|
+ billModel.defValue = fieldItem.defValue
|
|
|
+ billModel.allowBlank = fieldItem.allowBlank
|
|
|
+
|
|
|
+ if (billModel.isdefault) {
|
|
|
+ showBillFields.push(billModel)
|
|
|
+ } else {
|
|
|
+ hideBillFields.push(billModel)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
+ billGroup.showBillFields = showBillFields
|
|
|
+ billGroup.hideBillFields = hideBillFields
|
|
|
+
|
|
|
+ billGroupList.push(billGroup)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ return billGroupList
|
|
|
}
|