From e659867fb59ad88f121d446e56df53389d88960d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 03 四月 2023 12:09:35 +0800 Subject: [PATCH] 2023-04-03 --- src/menu/components/table/base-table/index.jsx | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 56 insertions(+), 4 deletions(-) diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx index 64db94a..bd16cd3 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 }, @@ -98,6 +98,39 @@ } 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 @@ -158,11 +191,17 @@ } card.action.forEach(cell => { + if (cell.hidden === 'true' || cell.origin) return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } + if (doubleClick === cell.uuid) { doubleClick = '' } @@ -171,11 +210,17 @@ card.cols.forEach(col => { if (col.type === 'action') { col.elements.forEach(cell => { + if (cell.hidden === 'true') return if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { if (!cell.modal || cell.modal.fields.length === 0) { - card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) } + } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎叆鍒楁湭璁剧疆锛乣}) + } else if (cell.OpenType === 'excelOut' && (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0)) { + card.errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濅腑瀵煎嚭鍒楁湭璁剧疆锛乣}) } + if (doubleClick === cell.uuid) { doubleClick = '' } @@ -352,6 +397,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'] @@ -364,7 +416,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="basetable" card={card}/> - <PasteComponent config={card} options={options} updateConfig={this.updateComponent} /> + <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