| | |
| | | |
| | | changeType = (type) => { |
| | | if (type === 'mk_func' && this.state.textInput) { |
| | | if (this.state.textInput) { |
| | | let val = this.state.textInput.replace(/(\s|\t|\v)*/ig, '') |
| | | if (/^[a-zA-Z_]+$/.test(val)) { |
| | | let params = { |
| | | url: window.location.origin + '/star', |
| | | method: 'post', |
| | | data: JSON.stringify({ |
| | | FUNC: 's_get_userproc', |
| | | LText: this.state.textInput.replace(/(\s|\t|\v)*/ig, ''), |
| | | LText: val, |
| | | UserID: '', |
| | | USERNAME: '' |
| | | }) |
| | |
| | | } |
| | | } |
| | | if (!this.state.type) { |
| | | this.setState({type: type, value: null}) |
| | | } else if (['mk_fields', 'mk_cols'].includes(type) && ['mk_fields', 'mk_cols'].includes(this.state.type)) { |
| | | this.setState({type: type, value: null}) |
| | | } else { |
| | | this.setState({type: type, textInput: '', value: null}) |
| | |
| | | cell.pageTemplate = 'billprint' |
| | | } else if (item.Action === 'View') { |
| | | cell.OpenType = 'popview' |
| | | } else if (item.Action === 'Prompt' || item.Action === 'Delete') { |
| | | } else if (['PromptOnce', 'Prompt', 'Delete'].includes(item.Action)) { |
| | | cell.OpenType = 'prompt' |
| | | } else if (item.Action === 'ExportExcel') { |
| | | cell.OpenType = 'excelOut' |
| | |
| | | } |
| | | |
| | | result = [] |
| | | let cosCol = null |
| | | |
| | | list.forEach(item => { |
| | | if (item.Hide === 'true') return |
| | | if (item.ColSpanID && item.ColSpanTitle) { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | | datatype: 'dynamic', |
| | | width: 24, |
| | | marks: null, |
| | | height: '', |
| | | noValue: 'hide', |
| | | style: { paddingLeft: '4px' }, |
| | | prefix: '', |
| | | postfix: '', |
| | | eleType: 'text', |
| | | field: item.FieldName.toLowerCase(), |
| | | innerHeight: 'auto' |
| | | } |
| | | if (cosCol) { |
| | | if (cosCol.ColSpanID === item.ColSpanID) { |
| | | cosCol.elements.push(_cell) |
| | | } else { |
| | | result.push(JSON.parse(JSON.stringify(cosCol))) |
| | | cosCol = { |
| | | ColSpanID: item.ColSpanID, |
| | | uuid: Utils.getuuid(), |
| | | label: item.ColSpanTitle, |
| | | Hide: 'false', |
| | | Align: item.Align || 'left', |
| | | IsSort: 'false', |
| | | type: 'custom', |
| | | Width: 120, |
| | | elements: [_cell] |
| | | } |
| | | } |
| | | } else { |
| | | cosCol = { |
| | | ColSpanID: item.ColSpanID, |
| | | uuid: Utils.getuuid(), |
| | | label: item.ColSpanTitle, |
| | | Hide: 'false', |
| | | Align: item.Align || 'left', |
| | | IsSort: 'false', |
| | | type: 'custom', |
| | | Width: 120, |
| | | elements: [_cell] |
| | | } |
| | | } |
| | | return |
| | | } else if (cosCol) { |
| | | result.push(JSON.parse(JSON.stringify(cosCol))) |
| | | cosCol = null |
| | | } |
| | | |
| | | let cell = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | result.push(cell) |
| | | }) |
| | | |
| | | if (cosCol) { |
| | | result.push(JSON.parse(JSON.stringify(cosCol))) |
| | | } |
| | | |
| | | result = JSON.stringify(result) |
| | | } else if (type === 'mk_forms') { |
| | | let list = JSON.parse(textInput) |