From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 14 六月 2023 09:55:50 +0800 Subject: [PATCH] 2023-06-14 --- src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 38 ++++++++++++++++++++++++++++++++++---- 1 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index be05ea6..78fc739 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -713,6 +713,21 @@ }) } + if (btn.verify.wrapText === 'true' && data) { + let lines = data.length + 1 + let start = 2 + if (btn.verify.merge === 'true') { + lines = data.length + 2 + } + for (let n = 0; n < cols.length; n++) { + for (let m = start; m <= lines; m++) { + if (ws[cols[n] + m] && !ws[cols[n] + m].s) { + ws[cols[n] + m].s = {alignment: { wrapText: true }} + } + } + } + } + // ws["A1"].s = {fill: { bgColor: { rgb: "FFFFAA" }}, font: { color: { rgb: "1890FF" } }} const wb = XLSX.utils.book_new() @@ -884,7 +899,7 @@ defaultSql = btn.verify.defaultSql || 'true' _dataresource = btn.verify.dataresource || '' queryType = btn.verify.queryType - primaryKey = btn.verify.primaryKey || 'ID' + // primaryKey = btn.verify.primaryKey || 'ID' if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' @@ -920,6 +935,11 @@ custom_script: customScript, default_sql: defaultSql, menuname: btn.logLabel + } + + if (btn.verify.dataType !== 'custom' && setting.sub_field) { + arr_field = arr_field + ',' + setting.sub_field + param.arr_field = arr_field } // 鏁版嵁绠$悊鏉冮檺 @@ -988,9 +1008,9 @@ if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) { primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',') if (_search && primaryId) { - _search += ` and ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` + _search += ` and ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` } else if (primaryId) { - _search = `where ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` + _search = `where ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` } } @@ -1098,7 +1118,17 @@ MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', []) } - btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) + if (btn.syncComponentId) { + if (btn.syncComponentId === 'multiComponent') { + btn.syncComponentIds.forEach((id, i) => { + setTimeout(() => { + MKEmitter.emit('reloadData', id) + }, 20 * i) + }) + } else { + MKEmitter.emit('reloadData', btn.syncComponentId) + } + } if (btn.switchTab && btn.switchTab.length > 0) { let id = btn.switchTab[btn.switchTab.length - 1] -- Gitblit v1.8.0