From d0ba373226e86b651e6306d35afc2d0b405938cd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 13 四月 2025 18:59:42 +0800 Subject: [PATCH] 2025-04-13 --- src/views/transystem/index.jsx | 64 ++++++++++++++++++++++++++++++- 1 files changed, 61 insertions(+), 3 deletions(-) diff --git a/src/views/transystem/index.jsx b/src/views/transystem/index.jsx index 1776ba9..7cffafa 100644 --- a/src/views/transystem/index.jsx +++ b/src/views/transystem/index.jsx @@ -22,13 +22,14 @@ 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: '' }) @@ -40,6 +41,8 @@ } } 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}) @@ -169,7 +172,7 @@ 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' @@ -343,9 +346,60 @@ } 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(), @@ -377,6 +431,10 @@ 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) -- Gitblit v1.8.0