From 78eed586f6a0d15162c89878c53a301e7b142a8a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 10 十月 2022 00:07:06 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/table/normal-table/index.jsx | 81 ++-------------------------------------- 1 files changed, 5 insertions(+), 76 deletions(-) diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index a2448ee..0983391 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -6,7 +6,7 @@ import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' -import { resetStyle } from '@/utils/utils-custom.js' +import { resetStyle, getTables } from '@/utils/utils-custom.js' import MKEmitter from '@/utils/events.js' import getWrapForm from './options' import Utils from '@/utils/utils.js' @@ -22,7 +22,6 @@ const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) -// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) const ColumnComponent = asyncComponent(() => import('./columns')) class TableCardEditComponent extends Component { @@ -75,7 +74,6 @@ { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, ], scripts: [], - btnlog: [], isNew: true } @@ -145,7 +143,6 @@ componentDidMount () { MKEmitter.addListener('submitModal', this.handleSave) - // MKEmitter.addListener('logButton', this.logButton) MKEmitter.addListener('completeSave', this.completeSave) } @@ -161,7 +158,6 @@ return } MKEmitter.removeListener('submitModal', this.handleSave) - // MKEmitter.removeListener('logButton', this.logButton) MKEmitter.removeListener('completeSave', this.completeSave) } @@ -207,14 +203,9 @@ if (!window.GLOB.styling || !card.errors) { // 鏍峰紡淇敼鏃朵笉鍋氱瓫鏌� card.errors = [] - // let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : '' - // if (supModule === 'empty') { - // supModule = '' - // } let doubleClick = card.wrap.doubleClick || '' let columns = card.columns.map(c => c.field) - // let lowcols = card.columns.map(c => c.field.toLowerCase()) if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) @@ -228,18 +219,14 @@ card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) } + if (card.errors.length === 0) { + card.$tables = getTables(card) + } + card.action.forEach(cell => { 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}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) - // } else { - // cell.modal.fields.forEach(m => { - // if (m.type === 'linkMain' && !supModule) { - // card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄}) - // } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) { - // card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻}) - // } - // }) } } if (doubleClick === cell.uuid) { @@ -253,14 +240,6 @@ 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}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`}) - // } else { - // cell.modal.fields.forEach(m => { - // if (m.type === 'linkMain' && !supModule) { - // card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄}) - // } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) { - // card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻}) - // } - // }) } } if (doubleClick === cell.uuid) { @@ -298,17 +277,6 @@ this.props.updateConfig(_card) } - - // logButton = (id, item) => { - // const { card } = this.state - - // if (id !== card.uuid) return - - // let btnlog = card.btnlog || [] - // btnlog.push(item) - - // this.updateComponent({...card, btnlog}) - // } changeStyle = () => { const { card } = this.state @@ -424,44 +392,6 @@ this.updateComponent(card) } - // handleLog = (type, logs, item) => { - // let card = fromJS(this.state.card).toJS() - - // if (type === 'revert') { - // let done = false - // if (item.$parentId) { - // card.cols.forEach(col => { - // if (col.type !== 'action') return - // if (item.$parentId === col.uuid) { - // col.elements = col.elements ? [...col.elements, item] : [item] - // done = true - // } - // }) - // } - - // if (!done) { - // card.action = card.action ? [...card.action, item] : [item] - // } - - // card.btnlog = logs - - // this.updateComponent(card) - // notification.success({ - // top: 92, - // message: '鎭㈠鎴愬姛锛�', - // duration: 2 - // }) - // } else { - // card.btnlog = logs - // this.updateComponent(card) - // notification.success({ - // top: 92, - // message: '娓呴櫎鎴愬姛锛�', - // duration: 2 - // }) - // } - // } - getWrapForms = () => { const { wrap, action, columns, cols } = this.state.card @@ -522,7 +452,6 @@ <CopyComponent type="normaltable" card={card}/> <PasteComponent config={card} options={options} updateConfig={this.updateComponent} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> - {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> */} <ClockComponent config={card} updateConfig={this.updateComponent}/> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> -- Gitblit v1.8.0