From 34441bae44398270864de3ec7d8c9ca7e35f3d13 Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Tue, 23 Jun 2020 23:44:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/apolloTable/component/Cell.tsx | 6 +++--- .../component/filter-condition/index.tsx | 6 +++++- components/apolloTable/component/filter/index.tsx | 15 +++++++++------ components/apolloTable/editFormV3/index.tsx | 10 +++++++++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/components/apolloTable/component/Cell.tsx b/components/apolloTable/component/Cell.tsx index e94bae4..d1a8fb4 100644 --- a/components/apolloTable/component/Cell.tsx +++ b/components/apolloTable/component/Cell.tsx @@ -174,9 +174,9 @@ const Cell = (props: CellProps) => { } onClick={() => { // 不可编辑状态 - if (!cellEditable || readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag)) { - return false; - } + // if (!cellEditable || readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag)) { + // return false; + // } if (selectedCell === `${position}_${cellKey}`) { setStatus('edit'); } else { diff --git a/components/apolloTable/component/filter-condition/index.tsx b/components/apolloTable/component/filter-condition/index.tsx index c75b2e1..987f483 100644 --- a/components/apolloTable/component/filter-condition/index.tsx +++ b/components/apolloTable/component/filter-condition/index.tsx @@ -18,7 +18,11 @@ const formatTags = (columns: ColumnProps[], tags: any[]) => { return item.columnName === tag.colName; }); if (!colConfig) return; - const { operator = [], columnType } = colConfig; + const { operator = [] } = colConfig; + let { columnType } = colConfig; + if (!config[columnType]) { + columnType = '1'; + } const { componentAttr, getFormatter } = config[columnType]; const newProps = { ...(componentAttr || {}), diff --git a/components/apolloTable/component/filter/index.tsx b/components/apolloTable/component/filter/index.tsx index d45a4bd..6e7c1dc 100644 --- a/components/apolloTable/component/filter/index.tsx +++ b/components/apolloTable/component/filter/index.tsx @@ -166,12 +166,12 @@ export default class Filter extends Component { for (let i = 0; i < filterConfig.length; i++) { // 筛选条件值为undefined或[]或[{text:'',value:''}]都算空,不能提交 if ( - !filterConfig[i].colName - || !filterConfig[i].operationCode - || !filterConfig[i].colValues - || filterConfig[i].colValues.length === 0 - || (!filterConfig[i].colValues && filterConfig[i].colValues !== 0) - || (!filterConfig[i].colValues[0].text && filterConfig[i].colValues[0].text !== 0) + !filterConfig[i].colName || + !filterConfig[i].operationCode || + !filterConfig[i].colValues || + filterConfig[i].colValues.length === 0 || + (!filterConfig[i].colValues && filterConfig[i].colValues !== 0) || + (!filterConfig[i].colValues[0].text && filterConfig[i].colValues[0].text !== 0) ) { message.error(locale.filterEmpty); return; @@ -210,6 +210,9 @@ export default class Filter extends Component { if (filterItem) { operateOptions = filterItem.operator; type = String(filterItem.columnType); + if (!config[type]) { + type = '1'; + } delete filterItem.columnAttrObj.maxLength; const { columnAttrObj } = filterItem; newProps = { diff --git a/components/apolloTable/editFormV3/index.tsx b/components/apolloTable/editFormV3/index.tsx index 4d00a58..06bfc0c 100644 --- a/components/apolloTable/editFormV3/index.tsx +++ b/components/apolloTable/editFormV3/index.tsx @@ -116,7 +116,15 @@ class FormWrap extends Component { validateTrigger, rules: [{ required: !!item.requiredFlag, message: '必填项不能为空' }, ...rules], initialValue: getFormat(detailConfig, item, value), - })()} + })( + , + )} ); }; -- 2.21.0