| | |
| | | exec = () => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let resetForm = (m) => { |
| | | if (m.field) { |
| | | m.field = m.field.toLowerCase() |
| | | } |
| | | if (m.type === 'split' && m.splitctrl) { |
| | | m.splitctrl = m.splitctrl.toLowerCase() |
| | | } |
| | | if (m.tabField) { |
| | | m.tabField = m.tabField.toLowerCase() |
| | | } |
| | | if (m.linkField) { |
| | | m.linkField = m.linkField.toLowerCase() |
| | | } |
| | | if (m.supField) { |
| | | m.supField = m.supField.toLowerCase() |
| | | } |
| | | if (m.phoneField) { |
| | | m.phoneField = m.phoneField.toLowerCase() |
| | | } |
| | | if (m.linkSubField) { |
| | | m.linkSubField = m.linkSubField.map(n => n.toLowerCase()) |
| | | m.linkSubField = Array.from(new Set(m.linkSubField)) |
| | | } |
| | | } |
| | | let resetMark = (m) => { |
| | | m.marks = m.marks.map(n => { |
| | | if (n.field && Array.isArray(n.field)) { |
| | | if (n.field[1] === 'static') { |
| | | n.field[0] = n.field[0] === '$Index' ? n.field[0] : n.field[0].toLowerCase() |
| | | } else { |
| | | n.field = n.field.map(p => p === '$Index' ? p : p.toLowerCase()) |
| | | } |
| | | } |
| | | |
| | | return n |
| | | }) |
| | | } |
| | | let resetElement = (m) => { |
| | | if (m.datatype === 'dynamic' && m.field) { |
| | | if (m.field && m.field !== '$Index') { |
| | | m.field = m.field.toLowerCase() |
| | | } |
| | | if (m.posterField) { |
| | |
| | | m.linkurl = m.linkurl.toLowerCase() |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | if (m.modal.setting) { |
| | | if (m.modal.setting.focus) { |
| | | m.modal.setting.focus = m.modal.setting.focus.toLowerCase() |
| | | } |
| | | if (m.modal.setting.errFocus) { |
| | | m.modal.setting.errFocus = m.modal.setting.errFocus.toLowerCase() |
| | | } |
| | | } |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | if (col.type === 'split' && col.splitctrl) { |
| | | col.splitctrl = col.splitctrl.toLowerCase() |
| | | } |
| | | resetForm(col) |
| | | return col |
| | | }) |
| | | } |
| | |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify.billcodes) { |
| | | m.verify.billcodes = m.verify.billcodes.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | if (col.linkField && col.linkField !== 'BID') { |
| | | col.linkField = col.linkField.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | if (m.verify.accountfield && m.verify.accountfield !== 'BID') { |
| | | m.verify.accountfield = m.verify.accountfield.toLowerCase() |
| | | } |
| | |
| | | if (m.controlField) { |
| | | m.controlField = m.controlField.toLowerCase() |
| | | } |
| | | |
| | | if (m.marks && m.marks.length) { |
| | | resetMark(m) |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | |
| | | let _replace = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | | if (item.setting) { |
| | | if (item.setting.controlField) { |
| | | item.setting.controlField = item.setting.controlField.toLowerCase() |
| | | } |
| | | if (item.setting.selectField) { |
| | | item.setting.selectField = item.setting.selectField.toLowerCase() |
| | | } |
| | | } |
| | | item.subtabs.forEach(tab => { |
| | | tab.components = _replace(tab.components) |
| | | }) |
| | |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | if (col.dateShift) { |
| | | col.dateShift = col.dateShift.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | |
| | | |
| | | if (item.subcards) { |
| | | item.subcards.forEach(card => { |
| | | if (card.setting && card.setting.controlField) { |
| | | card.setting.controlField = card.setting.controlField.toLowerCase() |
| | | if (card.setting) { |
| | | if (card.setting.controlField && card.setting.controlField !== '$Index') { |
| | | card.setting.controlField = card.setting.controlField.toLowerCase() |
| | | } |
| | | if (card.setting.bgField) { |
| | | card.setting.bgField = card.setting.bgField.toLowerCase() |
| | | } |
| | | if (card.setting.menuType) { |
| | | card.setting.menuType = card.setting.menuType.toLowerCase() |
| | | } |
| | | } |
| | | if (card.elements) { |
| | | card.elements = card.elements.map(m => { |
| | |
| | | |
| | | if (card.fields) { |
| | | card.fields = card.fields.map(m => { |
| | | if (m.field) { |
| | | m.field = m.field.toLowerCase() |
| | | } |
| | | if (m.type === 'split' && m.splitctrl) { |
| | | m.splitctrl = m.splitctrl.toLowerCase() |
| | | } |
| | | resetForm(m) |
| | | return m |
| | | }) |
| | | } |
| | | if (card.subButton) { |
| | | resetElement(card.subButton) |
| | | |
| | | if (card.subButton.resetForms) { |
| | | card.subButton.resetForms = card.subButton.resetForms.map(n => n.toLowerCase()) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (item.plot.gender) { |
| | | item.plot.gender = item.plot.gender.toLowerCase() |
| | | } |
| | | if (item.plot.menuType) { |
| | | item.plot.menuType = item.plot.menuType.toLowerCase() |
| | | } |
| | | if (item.Yaxis) { |
| | | if (Array.isArray(item.Yaxis)) { |
| | | item.Yaxis = item.Yaxis.map(m => { |
| | |
| | | let _update = (cols) => { |
| | | return cols.map(col => { |
| | | if (col.type === 'custom' && col.elements) { |
| | | if (col.sortField) { |
| | | col.sortField = col.sortField.toLowerCase() |
| | | } |
| | | col.elements = col.elements.map(m => { |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols = _update(col.subcols) |
| | | } else if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } else { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | |
| | | if (col.editable === 'true') { |
| | | if (col.linkSubField) { |
| | | col.linkSubField = col.linkSubField.map(n => n.toLowerCase()) |
| | | col.linkSubField = Array.from(new Set(col.linkSubField)) |
| | | } |
| | | if (col.clearField) { |
| | | col.clearField = col.clearField.toLowerCase() |
| | | } |
| | | if (col.ctrlField) { |
| | | col.ctrlField = col.ctrlField.toLowerCase() |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (col.marks && col.marks.length) { |
| | | resetMark(col) |
| | | } |
| | | } |
| | | |
| | | return col |
| | |
| | | } |
| | | |
| | | item.cols = _update(item.cols) |
| | | |
| | | if (item.lineMarks) { |
| | | item.lineMarks = item.lineMarks.map(n => { |
| | | if (n.field && Array.isArray(n.field)) { |
| | | if (n.field[1] === 'static') { |
| | | n.field[0] = n.field[0] === '$Index' ? n.field[0] : n.field[0].toLowerCase() |
| | | } else { |
| | | n.field = n.field.map(p => p === '$Index' ? p : p.toLowerCase()) |
| | | } |
| | | } |
| | | |
| | | return n |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (item.subMenus) { |
| | | item.subMenus = item.subMenus.map(m => { |
| | | if (m.setting && m.setting.tip) { |
| | | m.setting.tip = m.setting.tip.toLowerCase() |
| | | } |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (item.wrap) { |
| | | if (item.wrap.field) { |
| | | item.wrap.field = item.wrap.field.toLowerCase() |
| | | } |
| | | if (item.wrap.tipField) { |
| | | item.wrap.tipField = item.wrap.tipField.toLowerCase() |
| | | } |
| | |
| | | if (item.wrap.link) { |
| | | item.wrap.link = item.wrap.link.toLowerCase() |
| | | } |
| | | if (item.wrap.linkField) { |
| | | item.wrap.linkField = item.wrap.linkField.toLowerCase() |
| | | } |
| | | if (item.wrap.focus) { |
| | | item.wrap.focus = item.wrap.focus.toLowerCase() |
| | | } |
| | | if (item.wrap.refocus) { |
| | | item.wrap.refocus = item.wrap.refocus.toLowerCase() |
| | | } |
| | | if (item.wrap.statusControl) { |
| | | item.wrap.statusControl = item.wrap.statusControl.toLowerCase() |
| | | } |
| | | if (item.wrap.timeField) { |
| | | item.wrap.timeField = item.wrap.timeField.toLowerCase() |
| | | } |
| | | if (item.wrap.endField) { |
| | | item.wrap.endField = item.wrap.endField.toLowerCase() |
| | | } |
| | | if (item.wrap.remarkField) { |
| | | item.wrap.remarkField = item.wrap.remarkField.toLowerCase() |
| | | } |
| | | if (item.wrap.colorField) { |
| | | item.wrap.colorField = item.wrap.colorField.toLowerCase() |
| | | } |
| | | if (item.wrap.menuType) { |
| | | item.wrap.menuType = item.wrap.menuType.toLowerCase() |
| | | } |
| | | |
| | | if (item.type === 'timeline') { |
| | | if (item.wrap.label) { |
| | | item.wrap.label = item.wrap.label.toLowerCase() |
| | | } |
| | | if (item.wrap.node) { |
| | | item.wrap.node = item.wrap.node.toLowerCase() |
| | | } |
| | | } |
| | | } |
| | | |
| | | return item |