From 03a22ec6f9ad7303d10b4c65bb5bc6fa5cbd448a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 22 十月 2022 23:21:42 +0800 Subject: [PATCH] 2022-10-22 --- src/menu/components/table/edit-table/index.jsx | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index d95042e..089f718 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -365,6 +365,25 @@ this.updateComponent(_card) } + updatecolumn = (config) => { + config.absFields = [] + config.cols.forEach(col => { + if (col.type === 'number') { + if (col.format === 'abs') { + config.absFields.push(col.field) + } + } + }) + + if (config.absFields.length) { + config.absFields = Array.from(new Set(config.absFields)) + } else { + config.absFields = null + } + + this.updateComponent(config) + } + clickComponent = (e) => { if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { e.stopPropagation() @@ -405,7 +424,7 @@ </Popover> <SearchComponent config={card} updatesearch={this.updateComponent}/> <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> - <ColumnComponent config={card} updatecolumn={this.updateComponent}/> + <ColumnComponent config={card} updatecolumn={this.updatecolumn}/> <div className="component-name"> <div className="center"> <div className="title">{card.name}</div> -- Gitblit v1.8.0