From a29d9d644a2a30e9ef4afcc6d728c20c218dc359 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 15 六月 2023 14:25:28 +0800 Subject: [PATCH] 2023-06-15 --- src/menu/components/table/edit-table/index.jsx | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index fd53e91..6c0dc8d 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -96,11 +96,6 @@ cell.uuid = Utils.getuuid() return cell }) - } else if (col.type === 'action' && col.elements) { - col.elements = col.elements.map(cell => { - cell.uuid = Utils.getuuid() - return cell - }) } return col }) @@ -141,7 +136,9 @@ delete item.isNew - this.setState({card: item}) + this.setState({card: null}, () => { + this.setState({card: item}) + }) } } @@ -158,6 +155,10 @@ card.$c_cl = true card.errors = checkComponent(card) + + if (!card.submit.sheet) { + card.errors.push({ level: 0, detail: '鎻愪氦鎸夐挳鏈缃紒'}) + } if (card.errors.length === 0) { card.$tables = getTables(card) @@ -214,7 +215,7 @@ addColumns = () => { let card = fromJS(this.state.card).toJS() - card.cols.push({ focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' }) + card.cols.push({ focus: true, Width: 120, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' }) this.setState({card}) } @@ -273,9 +274,9 @@ } getWrapForms = () => { - const { wrap, action } = this.state.card + const { wrap, columns } = this.state.card - return getWrapForm(wrap, action) + return getWrapForm(wrap, columns) } updateWrap = (res) => { @@ -343,8 +344,11 @@ render() { const { card, appType } = this.state + + if (!card) return null + let _style = resetStyle(card.style) - + return ( <div className="menu-editable-table-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/> -- Gitblit v1.8.0