From 1b60547cb25f5c0a4371e5be0517adf092f2dc62 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 28 一月 2023 16:08:21 +0800 Subject: [PATCH] 2023-01-28 --- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 45 ++++++++++++++++++++++++++++++--------------- 1 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 8f566d2..ee401ec 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -811,22 +811,37 @@ changeColumns = (columns) => { const { verify } = this.state - if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) { - columns = columns.map(col => { - let _cell = { - uuid: Utils.getuuid(), - Column: col.Column, - Text: col.Text, - Width: 20, - abs: 'false', - output: col.output || 'true', - required: col.required || 'false', - type: 'text', - } + columns = columns.map(col => { + col.type = col.type || 'text' + col.output = col.output || 'true' + col.required = col.required || 'false' - return _cell - }) - } + if (!['text', 'image', 'number'].includes(col.type)) { + if (/^Decimal/ig.test(col.type)) { + col.type = 'number' + } else { + col.type = 'text' + } + } + + return col + }) + // if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) { + // columns = columns.map(col => { + // let _cell = { + // uuid: Utils.getuuid(), + // Column: col.Column, + // Text: col.Text, + // Width: 20, + // abs: 'false', + // output: col.output || 'true', + // required: col.required || 'false', + // type: 'text', + // } + + // return _cell + // }) + // } this.setState({verify: {...verify, columns}}) } -- Gitblit v1.8.0