From bdfec44c9f3a37dbbe05bf14a252ffec04132a86 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 九月 2022 21:24:28 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/components/card/data-card/index.jsx | 87 ++++++++++++++++++++----------------------- 1 files changed, 41 insertions(+), 46 deletions(-) diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index bcdde15..c3dfe4e 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Popover, Modal, Pagination } from 'antd' -import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' +import { PlusOutlined, PlusCircleOutlined, PlusSquareOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, DownOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' @@ -145,7 +145,6 @@ } componentDidMount () { - MKEmitter.addListener('submitStyle', this.getStyle) MKEmitter.addListener('submitModal', this.handleSave) // MKEmitter.addListener('logButton', this.logButton) } @@ -161,7 +160,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitStyle', this.getStyle) MKEmitter.removeListener('submitModal', this.handleSave) // MKEmitter.removeListener('logButton', this.logButton) } @@ -198,7 +196,7 @@ card.errors = [] let columns = card.columns.map(c => c.field) - let lowcols = card.columns.map(c => c.field.toLowerCase()) + // 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: '鏈缃暟鎹簮锛�'}) @@ -212,30 +210,30 @@ card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) } - let supModule = '' - if (card.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢 - if (card.supNodes && card.supNodes[0]) { - supModule = card.supNodes[0].componentId - } - } else if (card.setting.supModule) { - supModule = card.setting.supModule[card.setting.supModule.length - 1] || '' - if (supModule === 'empty') { - supModule = '' - } - } + // let supModule = '' + // if (card.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢 + // if (card.supNodes && card.supNodes[0]) { + // supModule = card.supNodes[0].componentId + // } + // } else if (card.setting.supModule) { + // supModule = card.setting.supModule[card.setting.supModule.length - 1] || '' + // if (supModule === 'empty') { + // supModule = '' + // } + // } 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}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻}) - } - }) + // } 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}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻}) + // } + // }) } } // $check@鏈夋晥鎬ф娴� @@ -257,14 +255,14 @@ 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}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻}) - } - }) + // } 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 (linkbtn && linkbtn === cell.uuid) { @@ -281,14 +279,14 @@ 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}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻}) - } - }) + // } 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 (linkbtn && linkbtn === cell.uuid) { @@ -375,15 +373,11 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['background', 'height', 'border', 'padding', 'margin', 'shadow'], card.style) + MKEmitter.emit('changeStyle', ['background', 'height', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle) } - getStyle = (comIds, style) => { - const { card } = this.state - - if (comIds.length !== 1 || comIds[0] !== card.uuid) return - - let _card = {...card, style} + getStyle = (style) => { + let _card = {...this.state.card, style} this.updateComponent(_card) } @@ -799,6 +793,7 @@ <div style={{clear: 'both'}}></div> {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `鍏� ${total} 鏉} pageSize={20} defaultCurrent={1}/> : null} {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null} + {card.wrap.pagestyle === 'more' && card.setting.laypage === 'true' ? <div className="mk-more">鏌ョ湅鏇村<DownOutlined/></div> : null} <div className="component-name"> <div className="center"> <div className="title">{card.name}</div> -- Gitblit v1.8.0