From 76c4adc98ef8e7a3ea0f44d608363e3c0ddacf9b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 03 七月 2024 18:01:35 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/custom/components/table/base-table/index.jsx | 2 src/views/pay/index.scss | 8 + src/tabviews/custom/components/card/double-data-card/index.jsx | 10 + src/tabviews/custom/components/tabs/antv-tabs/index.jsx | 2 src/mob/mobshell/index.jsx | 44 ++++++++ src/tabviews/custom/components/table/normal-table/index.jsx | 4 src/tabviews/custom/components/tabs/antv-tabs/index.scss | 4 src/pc/menushell/index.jsx | 44 ++++++++ src/views/pay/index.jsx | 13 -- src/tabviews/custom/components/table/edit-table/index.jsx | 2 src/tabviews/zshare/actionList/index.jsx | 4 src/menu/debug/index.jsx | 103 ++++++++++++++++++++ src/menu/components/tabs/antv-tabs/index.jsx | 6 + src/tabviews/custom/components/card/data-card/index.jsx | 20 ++- 14 files changed, 227 insertions(+), 39 deletions(-) diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx index eaa3206..1aa31f6 100644 --- a/src/menu/components/tabs/antv-tabs/index.jsx +++ b/src/menu/components/tabs/antv-tabs/index.jsx @@ -223,6 +223,12 @@ // editab.selectVal = res.selectVal || '' editab.blacklist = res.blacklist + if (/^\s+$/.test(editab.label) && editab.icon) { + editab.taType = 'only-icon' + } else { + delete editab.taType + } + if (editab.uuid) { tabs.subtabs = tabs.subtabs.map(t => { if (t.uuid === editab.uuid) { diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index be6eaec..91caad6 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -1,4 +1,4 @@ -import React, {Component} from 'react' +import React, { Component } from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' import { Modal, Button, Drawer, Tooltip } from 'antd' @@ -26,6 +26,7 @@ sqlList = [] verSqls = [] + linkMain = null trigger = () => { let config = fromJS(this.props.config).toJS() @@ -66,6 +67,7 @@ } this.sqlList = [] + this.linkMain = [] let regs = [ { reg: /@userName@/ig, value: `'User_Name'` }, @@ -137,8 +139,80 @@ this.verSqls = sqls let that = this + let formErrors = [] + if (this.linkMain.length) { + let map = new Map() + if (config.interfaces) { + config.interfaces.forEach(m => { + if (m.status !== 'true' || !m.columns) return false + + map.set(m.uuid, m.columns) + }) + } + + let forEachComs = (components) => { + components.forEach(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + forEachComs(tab.components) + }) + } else if (item.type === 'group') { + forEachComs(item.components) + } else if (item.columns && item.columns.length) { + map.set(item.uuid, item.columns) + } + }) + } + + forEachComs(config.components) + + this.linkMain.forEach(item => { + if (item.config.wrap && item.config.wrap.datatype === 'public') return + + let supModule = '' + if (item.config.wrap && item.config.wrap.datatype === 'static') { + supModule = item.config.wrap.supModule ? item.config.wrap.supModule[item.config.wrap.supModule.length - 1] : '' + } else if (item.config.setting && item.config.setting.supModule) { + supModule = item.config.setting.supModule[item.config.setting.supModule.length - 1] || '' + if (supModule === 'empty') { + supModule = '' + } + } + + if (!supModule) return + + let cols = map.get(supModule) + + if (!cols) { + formErrors.push(<div key={item.forms[0].uuid}> + 缁勪欢<span style={{color: '#1890ff', margin: '0 2px 0 2px'}}>{item.config.name}{item.label ? '-' + item.label : ''}</span>涓〃鍗�<span style={{color: 'orange', margin: '0 2px 0 2px'}}>{item.forms.map(c => c.label + ' (' + c.field + ')').join('銆�')}</span>鏃犳晥 + </div>) + } else { + let _forms = [] + let _cols = cols.map(col => col.field.toLowerCase()) + + item.forms.forEach(m => { + if (_cols.includes(m.field.toLowerCase())) return + + _forms.push(m.label + ' (' + m.field + ')') + }) + + if (_forms.length) { + formErrors.push(<div key={item.forms[0].uuid}> + 缁勪欢<span style={{color: '#1890ff', margin: '0 2px 0 2px'}}>{item.config.name}{item.label ? '-' + item.label : ''}</span>涓〃鍗�<span style={{color: 'orange', margin: '0 2px 0 2px'}}>{_forms.join('銆�')}</span>鏃犳晥 + </div>) + } + } + }) + } + + formErrors = formErrors.length ? formErrors : '' + Modal.confirm({ - content: `褰撳墠鑿滃崟鍏�${this.sqlList.length}涓粍浠讹紝${sqls.length}椤硅剼鏈渶瑕佹楠�${sqls.length > 20 ? '锛屾椂闂村ぇ姒傞渶瑕�' + parseInt(sqls.length / 2) + '绉�' : ''}銆俙, + content: <div style={{paddingLeft: '38px'}}> + {`褰撳墠鑿滃崟鍏�${this.sqlList.length}涓粍浠讹紝${sqls.length}椤硅剼鏈渶瑕佹楠�${sqls.length > 20 ? '锛屾椂闂村ぇ姒傞渶瑕�' + parseInt(sqls.length / 2) + '绉�' : ''}銆俙} + {formErrors} + </div>, onOk() { that.setState({visible: true, status: 'loading', sqlList: fromJS(sqls).toJS(), successIds: [], errorIds: [], errorMsg: {}, execId: ''}, () => { that.roopSql() @@ -354,6 +428,18 @@ if (!group.subButton.Ot) { group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl' } + + if (group.fields) { + let cells = group.fields.filter(cell => cell.type === 'linkMain') + + if (cells.length) { + this.linkMain.push({ + config: item, + forms: cells + }) + } + } + let res = this.resetButton(item, group.subButton, process, group) if (res) { @@ -380,6 +466,19 @@ resetButton = (item, cell, process, group, isback) => { let sql = '' + if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { + if (cell.modal && cell.modal.fields.length) { + let cells = cell.modal.fields.filter(n => n.type === 'linkMain') + + if (cells.length) { + this.linkMain.push({ + config: item, + forms: cells, + label: cell.label + }) + } + } + } if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { if (cell.intertype === 'system' || cell.procMode === 'system') { // 绯荤粺鎺ュ彛 if (item.subtype === 'dualdatacard' && isback) { diff --git a/src/mob/mobshell/index.jsx b/src/mob/mobshell/index.jsx index 257a3d7..cada1ef 100644 --- a/src/mob/mobshell/index.jsx +++ b/src/mob/mobshell/index.jsx @@ -217,12 +217,48 @@ _cards.push(Navbar) } - if (style) { - handleList({...menu, style, components: _cards}) + if (item.component === 'navbar') { + let appMenus = sessionStorage.getItem('appViewList') + if (appMenus) { + try { + appMenus = JSON.parse(appMenus) + appMenus = appMenus.filter(item => item.keys_type === 'navbar') + } catch (e) { + appMenus = [] + } + } else { + appMenus = [] + } + + if (appMenus.length) { + confirm({ + title: '濡傞渶浣跨敤褰撳墠搴旂敤涓凡鏈夌殑鑿滃崟鏍忥紝璇风偣鍑诲彸渚у叧鑱旇彍鍗曟爮锛屽闇�鏂板璇风偣纭畾銆�', + onOk() { + if (style) { + handleList({...menu, style, components: _cards}) + } else { + handleList({...menu, components: _cards}) + } + setCards(_cards) + }, + onCancel() {} + }) + } else { + if (style) { + handleList({...menu, style, components: _cards}) + } else { + handleList({...menu, components: _cards}) + } + setCards(_cards) + } } else { - handleList({...menu, components: _cards}) + if (style) { + handleList({...menu, style, components: _cards}) + } else { + handleList({...menu, components: _cards}) + } + setCards(_cards) } - setCards(_cards) } }) diff --git a/src/pc/menushell/index.jsx b/src/pc/menushell/index.jsx index 32b17b4..756d8ce 100644 --- a/src/pc/menushell/index.jsx +++ b/src/pc/menushell/index.jsx @@ -169,12 +169,48 @@ const { index: overIndex } = findCard(`${targetId}`) const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) - if (style) { - handleList({...menu, style, components: _cards}) + if (item.component === 'navbar') { + let appMenus = sessionStorage.getItem('appViewList') + if (appMenus) { + try { + appMenus = JSON.parse(appMenus) + appMenus = appMenus.filter(item => item.keys_type === 'navbar') + } catch (e) { + appMenus = [] + } + } else { + appMenus = [] + } + + if (appMenus.length) { + confirm({ + title: '濡傞渶浣跨敤褰撳墠搴旂敤涓凡鏈夌殑鑿滃崟鏍忥紝璇风偣鍑诲彸渚у叧鑱旇彍鍗曟爮锛屽闇�鏂板璇风偣纭畾銆�', + onOk() { + if (style) { + handleList({...menu, style, components: _cards}) + } else { + handleList({...menu, components: _cards}) + } + setCards(_cards) + }, + onCancel() {} + }) + } else { + if (style) { + handleList({...menu, style, components: _cards}) + } else { + handleList({...menu, components: _cards}) + } + setCards(_cards) + } } else { - handleList({...menu, components: _cards}) + if (style) { + handleList({...menu, style, components: _cards}) + } else { + handleList({...menu, components: _cards}) + } + setCards(_cards) } - setCards(_cards) } }) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index b442a83..3550b7d 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -439,13 +439,9 @@ }, i * 10) }) } else { - if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { - this.loadLinedata(lines[0].$$uuid, position) - } else { - this.loadData(id) - } - } else if (!btn || btn.resetPageIndex !== 'false') { + if ((position === 'line' || position === 'line_grid') && lines && lines.length === 1 && !config.forbidLine) { + this.loadLinedata(lines[0].$$uuid, position) + } else if (btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { @@ -459,14 +455,20 @@ let supModule = config.setting.supModule if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$uuid, position) + } else if (btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadData(id) + }) } else { this.loadData(id) } } else if (['mainline', 'maingrid', 'popclose'].includes(position) && supModule) { MKEmitter.emit('reloadData', supModule, position === 'maingrid' ? '' : BID) - } else if (!btn || btn.resetPageIndex !== 'false') { + } else if (btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index a5fd92e..a3c0682 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -374,14 +374,20 @@ let supModule = config.setting.supModule if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid, position) + } else if (btn.resetPageIndex !== 'false') { + this.setState({ + pageIndex: 1 + }, () => { + this.loadData(id) + }) } else { this.loadData(id) } } else if (['mainline', 'maingrid', 'popclose'].includes(position) && supModule) { MKEmitter.emit('reloadData', supModule, position === 'maingrid' ? '' : BID) - } else if (!btn || btn.resetPageIndex !== 'false') { + } else if (btn.resetPageIndex !== 'false') { this.setState({ pageIndex: 1 }, () => { diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 10d0453..27b2f35 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -568,7 +568,7 @@ if (config.uuid !== menuId) return if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$uuid, position) } else { this.reloadtable(btn, id) diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index fcb0aa5..2b3560d 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -749,7 +749,7 @@ if (config.uuid !== menuId) return if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$uuid, position) } else { this.reloadtable(btn) diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index a5e10c5..b689a85 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -960,7 +960,7 @@ }) } else { if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$uuid, position) } else { this.reloadtable(btn, id) @@ -971,7 +971,7 @@ } } else { if (position === 'line' || position === 'line_grid') { - if (lines && lines.length === 1) { + if (lines && lines.length === 1 && !config.forbidLine) { this.loadLinedata(lines[0].$$uuid, position) } else { this.reloadtable(btn, id) diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx index 154f5a6..ea63ca4 100644 --- a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx +++ b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx @@ -149,7 +149,7 @@ <div className={`menu-antv-tabs-wrap ${tabs.setting.tabLabel || ''} ${tabs.setting.cusClass || ''} align-${tabs.setting.tabAlign || ''}`} id={'anchor' + tabs.uuid} style={tabs.style}> <Tabs defaultActiveKey="1" tabBarStyle={{background: tabs.setting.backgroundColor || 'transparent'}} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> {tabs.subtabs.map(tab => ( - <TabPane tab={<span id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} style={{backgroundColor: tab.backgroundColor || 'transparent'}} key={tab.uuid}> + <TabPane tab={<span className={tab.taType || ''} id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} style={{backgroundColor: tab.backgroundColor || 'transparent'}} key={tab.uuid}> <TabTransfer config={tab}/> </TabPane> ))} diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.scss b/src/tabviews/custom/components/tabs/antv-tabs/index.scss index 9093f26..21a134e 100644 --- a/src/tabviews/custom/components/tabs/antv-tabs/index.scss +++ b/src/tabviews/custom/components/tabs/antv-tabs/index.scss @@ -23,6 +23,10 @@ .ant-tabs-bottom-bar { margin-top: 0; } + + .ant-tabs-tab .only-icon .anticon { + margin-right: 0px; + } } .menu-antv-tabs-wrap.hide >.ant-tabs >.ant-tabs-bar{ diff --git a/src/tabviews/zshare/actionList/index.jsx b/src/tabviews/zshare/actionList/index.jsx index 8948d0c..c0945f5 100644 --- a/src/tabviews/zshare/actionList/index.jsx +++ b/src/tabviews/zshare/actionList/index.jsx @@ -206,8 +206,7 @@ btn={item} selectedData={selectedData} /> - ) - } + ) } else { return ( <FuncButton @@ -219,6 +218,7 @@ /> ) } + } return null }) } diff --git a/src/views/pay/index.jsx b/src/views/pay/index.jsx index c3c5575..b01f691 100644 --- a/src/views/pay/index.jsx +++ b/src/views/pay/index.jsx @@ -259,17 +259,8 @@ {!overdone ? <div className="qrcode-box"> {!overdue ? <p>璺濈浜岀淮鐮佽繃鏈熻繕鍓�<span>{second}</span>绉掞紝杩囨湡鍚庤鍒锋柊椤甸潰閲嶆柊鑾峰彇浜岀淮鐮併��</p> : null} {overdue ? <p className="overdue">浜岀淮鐮佸凡杩囨湡锛�<span onClick={this.resetQrcode}>鍒锋柊</span>椤甸潰閲嶆柊鑾峰彇浜岀淮鐮併��</p> : null} - <QRCode - value={qrcode} - size={250} - fgColor="#000000" - // imageSettings={{ - // src: '', - // height: 60, - // width: 60, - // excavate: true - // }} - /> + <QRCode value={qrcode} size={250} fgColor="#000000"/> + {!overdue && !qrcode ? <div className="qr-mask"></div> : null} {overdue ? <div className="overdue-mask"><p onClick={this.resetQrcode}>鑾峰彇澶辫触 鐐瑰嚮閲嶆柊鑾峰彇浜岀淮鐮�</p></div> : null} <div className="qrcode-tip"> <img src={WeiXinScan} alt=""/> diff --git a/src/views/pay/index.scss b/src/views/pay/index.scss index b69ffac..e2fa10d 100644 --- a/src/views/pay/index.scss +++ b/src/views/pay/index.scss @@ -101,6 +101,14 @@ cursor: pointer; } } + .qr-mask { + position: absolute; + width: 240px; + height: 240px; + top: 45px; + background: rgba(255, 255, 255, 0.95); + left: calc(50% - 120px); + } .qrcode-tip { background: #ff7674; width: 250px; -- Gitblit v1.8.0