From bfcacf54ad793bc33560f8bb15833508cf73aa5b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 31 三月 2023 01:18:44 +0800 Subject: [PATCH] 2023-03-31 --- src/menu/components/share/actioncomponent/index.jsx | 65 ++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index 82fe3f2..4d26f43 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -263,6 +263,71 @@ this.actionFormRef.handleConfirm().then(btn => { _actionlist = _actionlist.filter(item => !item.origin || item.uuid === btn.uuid) + if ((btn.OpenType === 'excelIn' || btn.OpenType === 'excelOut') && (!btn.verify || !btn.verify.columns) && config.subtype === 'basetable') { + let columns = [] + + if (btn.OpenType === 'excelOut') { + config.cols.forEach(item => { + if (!item.field || item.Hide === 'true') return + + let cell = { + Column: item.field, + Text: item.label, + Width: 20, + abs: 'false', + output: 'true', + required: 'false', + type: 'text', + uuid: Utils.getuuid() + } + + if (item.type === 'number') { + cell.type = 'number' + cell.decimal = item.decimal + } + + columns.push(cell) + }) + + btn.verify = btn.verify || {enable: 'false', dataType: 'default', scripts: []} + btn.verify.columns = columns + } else { + config.cols.forEach(item => { + if (!item.field || item.Hide === 'true') return + + let _type = 'Nvarchar(50)' + let _limit = '50' + if (item.type === 'number' && !item.decimal) { + _type = 'Int' + _limit = '' + } else if (item.type === 'number') { + _type = 'Decimal(18,' + item.decimal + ')' + _limit = item.decimal + } + + let _cell = { + uuid: Utils.getuuid(), + Column: item.field, + Text: item.label, + type: _type, + limit: _limit, + import: 'true', + required: 'true' + } + + if (_type !== 'Nvarchar(50)') { + _cell.min = 0 + _cell.max = 999999 + } + + columns.push(_cell) + }) + + btn.verify = btn.verify || {sheet: 'Sheet1', default: 'true', range: 1, scripts: [], uniques: []} + btn.verify.columns = columns + } + } + let labelrepet = false _actionlist = _actionlist.map(item => { if (item.uuid !== btn.uuid && item.label === btn.label) { -- Gitblit v1.8.0