From afb39f8ab004b2607bb718edab02e99c7a010114 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 三月 2023 14:36:44 +0800 Subject: [PATCH] 2023-03-22 --- src/menu/components/table/base-table/index.jsx | 74 ++++++++++++++++++++++++------------- 1 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx index f4a90c1..86ba414 100644 --- a/src/menu/components/table/base-table/index.jsx +++ b/src/menu/components/table/base-table/index.jsx @@ -56,7 +56,7 @@ setting: { interType: 'system' }, wrap: { bordered: 'true', tableType: 'checkbox', show: 'true' }, style: {}, - headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' }, + headerStyle: {}, columns: [], cols: [ { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 }, @@ -65,6 +65,10 @@ ], scripts: [], isNew: true + } + + if (card.name === '涓昏〃') { + _card.setting.supModule = ['empty'] } this.updateComponent(_card) @@ -78,7 +82,6 @@ } componentDidMount () { - MKEmitter.addListener('submitModal', this.handleSave) MKEmitter.addListener('completeSave', this.completeSave) } @@ -93,9 +96,41 @@ this.setState = () => { return } - MKEmitter.removeListener('submitModal', this.handleSave) MKEmitter.removeListener('completeSave', this.completeSave) } + + // updateFix = (card) => { + // let fixs = {} + + // card.cols.forEach(col => { + // if (!col.field) return + // if (col.postfix || col.prefix) { + // fixs[col.field] = col + // } + // }) + + // card.cols.forEach(col => { + // if (col.type === 'custom') { + // col.elements.forEach(cell => { + // if (cell.datatype === 'dynamic') { + // cell.height = '' + // cell.innerHeight = 'auto' + + // if (fixs[cell.field]) { + // if (!cell.prefix && fixs[cell.field].prefix) { + // cell.prefix = fixs[cell.field].prefix + // } + // if (!cell.postfix && fixs[cell.field].postfix) { + // cell.postfix = fixs[cell.field].postfix + // } + // } + // } + // }) + // } + // }) + + // return card + // } completeSave = () => { const { card } = this.state @@ -262,26 +297,6 @@ } } - handleSave = (_cards, btn, modal) => { - let card = fromJS(this.state.card).toJS() - - if (card.uuid !== _cards.uuid) return - - let _index = card.action.findIndex(cell => cell.uuid === btn.uuid) - - if (_index === -1) return - - card.action = card.action.map(cell => { - if (cell.uuid === btn.uuid) { - cell.modal = modal - } - - return cell - }) - - this.updateComponent(card) - } - getWrapForms = () => { const { wrap, action, columns, cols } = this.state.card @@ -317,7 +332,7 @@ config.absFields = [] config.cols.forEach(col => { if (!col.field) return - if (['text', 'picture', 'textarea'].includes(col.type)) { + if (['text', 'picture', 'video', 'textarea'].includes(col.type)) { config.columns.push({ datatype: `Nvarchar(${col.fieldlength || 50})`, field: col.field, @@ -370,6 +385,13 @@ this.updateComponent(config) } + parseComponent = (config, type) => { + if (type === 'cols') { + this.updatecolumn(config) + } + this.updateComponent(config) + } + render() { const { card } = this.state let options = ['action', 'search', 'form', 'cols'] @@ -381,8 +403,8 @@ <NormalForm title="琛ㄦ牸璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> - <CopyComponent type="normaltable" card={card}/> - <PasteComponent config={card} options={options} updateConfig={this.updateComponent} /> + <CopyComponent type="basetable" card={card}/> + <PasteComponent config={card} options={options} updateConfig={this.parseComponent} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <SettingComponent config={card} updateConfig={this.updateComponent} /> </div> -- Gitblit v1.8.0