From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 02 八月 2022 11:42:43 +0800 Subject: [PATCH] Merge branch 'develop' --- src/views/pcdesign/index.jsx | 98 ++++++++++++++++++------------------------------- 1 files changed, 36 insertions(+), 62 deletions(-) diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index c574d3e..b26500d 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -1,5 +1,4 @@ import React, { Component } from 'react' -import { connect } from 'react-redux' import { DndProvider } from 'react-dnd' import { withRouter } from 'react-router' import { is, fromJS } from 'immutable' @@ -56,6 +55,8 @@ window.GLOB.urlFields = [] // url鍙橀噺 window.GLOB.customMenu = null // 淇濆瓨鑿滃崟淇℃伅 +const memberLevel = Utils.getMemberLevel() + class MenuDesign extends Component { state = { localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, @@ -77,11 +78,12 @@ settingshow: sessionStorage.getItem('settingshow') !== 'false', controlshow: sessionStorage.getItem('controlshow') !== 'false', comloading: false, - eyeopen: false + eyeopen: false, + modalStatus: false // 寮圭獥鏄惁寮�鍚紝鍒ゆ柇ctrl+s鏄惁鍙敤 } UNSAFE_componentWillMount() { - if (this.props.memberLevel < 30) return + if (memberLevel < 30) return try { let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) @@ -125,11 +127,12 @@ } componentDidMount () { - if (this.props.memberLevel < 30) { + if (memberLevel < 30) { document.getElementById('mk-pc-design-view').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh; height: 100vh; background: #fff;">鏈簲鐢ㄦ病鏈塒C绔〉闈㈢殑缂栬緫鏉冮檺锛岃鑱旂郴绠$悊鍛橈紒</div>' return } MKEmitter.addListener('delButtons', this.delButtons) + MKEmitter.addListener('modalStatus', this.modalStatus) MKEmitter.addListener('thawButtons', this.thawButtons) MKEmitter.addListener('copyButtons', this.copyButtons) MKEmitter.addListener('changePopview', this.initPopview) @@ -163,6 +166,15 @@ let _shortcut = `${preKey}+${keyCode}` if (_shortcut === 'ctrl+83') { + if (this.state.modalStatus) { + notification.warning({ + top: 92, + message: '璇蜂繚瀛�' + this.state.modalStatus, + duration: 5 + }) + return false + } + let node = document.getElementById('save-modal-config') if (!node) { node = document.getElementById('save-pop-config') @@ -187,6 +199,7 @@ return } MKEmitter.removeListener('delButtons', this.delButtons) + MKEmitter.removeListener('modalStatus', this.modalStatus) MKEmitter.removeListener('thawButtons', this.thawButtons) MKEmitter.removeListener('copyButtons', this.copyButtons) MKEmitter.removeListener('changePopview', this.initPopview) @@ -194,6 +207,10 @@ MKEmitter.removeListener('triggerMenuSave', this.triggerMenuSave) MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) + } + + modalStatus = (val) => { + this.setState({modalStatus: val}) } triggerMenuSave = () => { @@ -995,12 +1012,14 @@ } }) } else if (item.type === 'form') { - m.children = item.subcards.map(m => { - return { - key: m.uuid, - title: m.setting.title - } - }) + if (item.subtype !== 'simpleform') { + m.children = item.subcards.map(m => { + return { + key: m.uuid, + title: m.setting.title + } + }) + } } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) { item.action && item.action.forEach(btn => { if (btn.hidden === 'true') return @@ -1600,7 +1619,7 @@ } MKEmitter.emit('completeSave') }) - }, 300) + }, 300 + (+sessionStorage.getItem('mkDelay'))) } getRoleFields = () => { @@ -1662,49 +1681,14 @@ } else if (item.type === 'group') { check(item.components) return - } else if (item.subtype === 'propcard' && item.subcards.length === 0) { - error = `缁勪欢銆�${item.name}銆嬩腑鍗$墖涓嶅彲涓虹┖锛乣 - return - } else if (item.type === 'login' && !item.wrap.linkmenu && item.wrap.link !== 'menu') { - error = '鐧诲綍缁勪欢鏈缃叧鑱旇彍鍗曪紒' + } else if (!item.errors || item.errors.length === 0) { return } - if (['voucher'].includes(item.subtype)) return - if (['propcard', 'brafteditor', 'sandbox', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return - if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return - - if (item.setting) { - if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆鏁版嵁婧愶紒` - } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.length === 0) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆鏁版嵁婧愶紒` - } else if (!item.setting.primaryKey) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婚敭锛乣 - } else if (!item.setting.supModule && item.type !== 'balcony' && (!item.wrap || item.wrap.supType !== 'multi')) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婄骇缁勪欢锛乣 - } - } - if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') { - if (!item.plot.Xaxis) { - error = `缁勪欢銆�${item.name}銆嬪浘琛ㄥ瓧娈靛皻鏈缃紒` - } - } else if (item.type === 'dashboard' && !item.plot.valueField) { - error = `缁勪欢銆�${item.name}銆嬫樉绀哄�煎皻鏈缃紒` - } else if (item.type === 'scatter' && (!item.plot.Xaxis || !item.plot.Yaxis || !item.plot.gender)) { - error = `缁勪欢銆�${item.name}銆嬪潗鏍囪酱灏氭湭璁剧疆锛乣 - } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { - error = `缁勪欢銆�${item.name}銆嬪熀鏈俊鎭皻鏈缃紒` - } else if (item.type === 'table' && item.wrap.doubleClick) { - let _actions = [...item.action] - item.cols.forEach(col => { - if (col.type !== 'action') return - _actions.push(...col.elements) - }) - if (_actions.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { - error = `缁勪欢銆�${item.name}銆嬬粦瀹氱殑鍙屽嚮鎸夐挳宸插垹闄わ紒` - } - } + item.errors.forEach(err => { + if (err.level !== 0 || error) return + error = `缁勪欢銆�${item.name}銆�${err.detail}` + }) }) } @@ -1980,14 +1964,4 @@ } } -const mapStateToProps = (state) => { - return { - memberLevel: state.memberLevel - } -} - -const mapDispatchToProps = () => { - return {} -} - -export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MenuDesign)) \ No newline at end of file +export default withRouter(MenuDesign) \ No newline at end of file -- Gitblit v1.8.0