From d712ae0a0d338bdc96c463c9ffe42f8c844f3c37 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 02 三月 2023 12:46:57 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/templates/zshare/modalform/index.jsx | 2 src/utils/utils-datamanage.js | 8 src/tabviews/zshare/actionList/popupbutton/index.jsx | 2 src/utils/utils-custom.js | 148 +++-- src/templates/zshare/verifycard/customscript/index.jsx | 8 src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx | 2 src/tabviews/custom/popview/index.jsx | 20 src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx | 4 src/menu/components/table/edit-table/options.jsx | 15 src/menu/stylecontroller/index.scss | 8 src/tabviews/basetable/index.jsx | 6 src/tabviews/custom/components/form/step-form/index.scss | 2 src/menu/components/form/step-form/index.scss | 2 src/tabviews/zshare/mutilform/mkInput/index.jsx | 4 src/views/billprint/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 6 src/menu/components/table/edit-table/columns/editColumn/index.jsx | 24 src/views/mobdesign/index.jsx | 26 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 9 src/views/menudesign/index.jsx | 21 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 28 src/api/cacheutils.js | 4 src/tabviews/custom/components/module/voucher/index.jsx | 2 src/menu/components/form/dragtitle/index.scss | 4 src/menu/components/form/tab-form/index.jsx | 8 src/menu/components/share/actioncomponent/formconfig.jsx | 39 + src/tabviews/custom/components/table/normal-table/index.jsx | 13 src/menu/components/card/double-data-card/index.jsx | 13 src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 1 src/menu/pastecontroller/index.jsx | 17 src/menu/components/card/data-card/index.jsx | 1 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 146 +++-- src/tabviews/zshare/mutilform/index.jsx | 23 src/menu/components/share/actioncomponent/actionform/index.jsx | 5 src/menu/components/table/edit-table/columns/index.scss | 1 src/tabviews/custom/index.jsx | 20 src/menu/components/table/normal-table/columns/index.jsx | 1 src/views/design/sidemenu/thdmenuplus/index.jsx | 8 src/menu/components/tabs/paste/index.jsx | 19 src/menu/components/table/edit-table/columns/index.jsx | 193 ++++-- src/tabviews/zshare/actionList/index.scss | 1 src/tabviews/zshare/mutilform/mkInput/index.scss | 2 src/menu/datasource/verifycard/utils.jsx | 44 + src/tabviews/custom/components/table/base-table/index.jsx | 6 src/assets/css/viewstyle.scss | 5 src/tabviews/custom/components/card/double-data-card/index.scss | 29 src/tabviews/custom/components/form/tab-form/index.scss | 2 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx | 2 src/tabviews/custom/components/module/account/index.jsx | 81 ++ src/components/header/index.jsx | 2 src/menu/components/form/tab-form/index.scss | 1 src/tabviews/custom/components/card/double-data-card/index.jsx | 1 src/templates/zshare/verifycard/callbackcustomscript/index.jsx | 4 src/menu/datasource/verifycard/customscript/index.jsx | 2 src/menu/components/form/simple-form/options.jsx | 14 src/mob/components/topbar/normal-navbar/options.jsx | 9 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 79 ++ src/menu/components/form/dragtitle/index.jsx | 3 src/templates/sharecomponent/fieldscomponent/index.jsx | 1 src/menu/components/card/balcony/index.scss | 7 src/tabviews/custom/components/table/edit-table/index.jsx | 4 src/views/tabledesign/index.jsx | 17 src/templates/modalconfig/dragelement/index.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx | 4 src/menu/components/form/step-form/options.jsx | 30 + src/tabviews/custom/components/form/simple-form/index.jsx | 2 src/menu/components/table/edit-table/index.jsx | 8 src/utils/utils.js | 44 + src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 25 src/tabviews/custom/components/form/tab-form/index.jsx | 10 src/menu/components/card/balcony/index.jsx | 3 src/menu/components/form/step-form/index.jsx | 8 src/menu/stylecontroller/index.jsx | 32 src/views/pcdesign/index.jsx | 26 src/templates/modalconfig/settingform/index.jsx | 12 src/templates/zshare/formconfig.jsx | 14 src/mob/components/formdragelement/index.jsx | 4 src/pc/createview/index.jsx | 8 src/tabviews/zshare/actionList/printbutton/index.jsx | 2 src/tabviews/custom/components/module/account/index.scss | 9 src/tabviews/custom/components/table/edit-table/normalTable/index.scss | 5 src/tabviews/custom/components/module/voucher/voucherTable/index.jsx | 15 src/tabviews/custom/components/form/step-form/index.jsx | 16 src/menu/components/module/account/options.jsx | 16 src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx | 42 + src/menu/components/form/dragtitle/card.jsx | 10 86 files changed, 1,099 insertions(+), 429 deletions(-) diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js index 012223d..1c174d9 100644 --- a/src/api/cacheutils.js +++ b/src/api/cacheutils.js @@ -45,6 +45,10 @@ } catch (e) { console.warn('WebSql 鍒濆鍖栧け璐ワ紒') window.GLOB.WebSql = null + + if (window.indexedDB) { + this.openIndexDB(db) + } } } diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index b79b5a2..0bd4ba1 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -293,6 +293,11 @@ .ant-pagination-next:hover .ant-pagination-item-link { color: $color6; } + .ant-pagination-options { + > div:not(:first-child) { + z-index: 1; + } + } } // 琛ㄦ牸鎺掑簭鍥炬爣 .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-up.on, .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-down.on { diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 0f878e0..cfbbe05 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -66,6 +66,8 @@ confirm({ title: '鎮ㄧ‘瀹氳閫�鍑哄悧?', content: '', + okText: '纭畾', + cancelText: '鍙栨秷', onOk() { sessionStorage.clear() _this.props.logout() diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index c0986a3..d495918 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Popover, Checkbox, message } from 'antd' -import { PlusOutlined, PlusSquareOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined, SettingOutlined, ToolOutlined, ClockCircleOutlined } from '@ant-design/icons' +import { PlusOutlined, PlusSquareOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined, SettingOutlined, ToolOutlined, ClockCircleOutlined, ColumnHeightOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' @@ -285,6 +285,7 @@ return ( <div className="menu-balcony-edit-box" style={_style} id={card.uuid}> + {card.style.height ? <ColumnHeightOutlined className="fixed-height" title="瀹氶珮" /> : null} <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> <PlusOutlined className="plus" title="娣诲姞鍏冪礌" onClick={this.addElement} /> diff --git a/src/menu/components/card/balcony/index.scss b/src/menu/components/card/balcony/index.scss index 6d5f095..3aaefbb 100644 --- a/src/menu/components/card/balcony/index.scss +++ b/src/menu/components/card/balcony/index.scss @@ -47,6 +47,13 @@ right: -30px; font-size: 16px; } + .fixed-height { + position: absolute; + bottom: 3px; + right: 3px; + font-size: 10px; + color: orange; + } } .menu-balcony-edit-box::after { display: block; diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index d7f18a7..92c55a7 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -448,7 +448,6 @@ delete _card.supNodes } - if (res.layout === 'flex') { _card.wrap.pagestyle = 'page' } diff --git a/src/menu/components/card/double-data-card/index.jsx b/src/menu/components/card/double-data-card/index.jsx index 32dd303..5e709c6 100644 --- a/src/menu/components/card/double-data-card/index.jsx +++ b/src/menu/components/card/double-data-card/index.jsx @@ -428,19 +428,6 @@ const { card } = this.state let _card = {...card, wrap: res} - - if (res.supNodes) { - _card.supNodes = res.supNodes - _card.supNodes = _card.supNodes.map(item => { - item.componentId = item.nodes[item.nodes.length - 1] - return item - }) - - delete res.supNodes - } else { - delete _card.supNodes - } - if (res.layout === 'flex') { _card.wrap.pagestyle = 'page' diff --git a/src/menu/components/form/dragtitle/card.jsx b/src/menu/components/form/dragtitle/card.jsx index 090ccd1..bfcbe4a 100644 --- a/src/menu/components/form/dragtitle/card.jsx +++ b/src/menu/components/form/dragtitle/card.jsx @@ -11,7 +11,7 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const Card = ({ id, card, sort, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { +const Card = ({ id, card, sort, labelSize, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { const originalIndex = findCard(id).index const [{ isDragging }, drag] = useDrag({ item: { type: 'form', id, originalIndex }, @@ -68,6 +68,10 @@ updateGroup(_card) } + let style = {fontSize: labelSize} + let s = labelSize * 1.5 + 'px' + let sortStyle = {width: s, height: s, lineHeight: s, borderRadius: s} + return ( <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> @@ -79,8 +83,8 @@ </div> } trigger="hover"> <div className={'page-card ' + (active ? 'active' : '')} onClick={select} style={{ opacity: opacity}}> - <div ref={node => drag(drop(node))}> - <span className="form-sort">{sort}</span> + <div ref={node => drag(drop(node))} style={style}> + <span className="form-sort" style={sortStyle}>{sort}</span> {card.setting.title} </div> </div> diff --git a/src/menu/components/form/dragtitle/index.jsx b/src/menu/components/form/dragtitle/index.jsx index 96a6e7f..008d237 100644 --- a/src/menu/components/form/dragtitle/index.jsx +++ b/src/menu/components/form/dragtitle/index.jsx @@ -4,7 +4,7 @@ import Card from './card' import './index.scss' -const Container = ({list, selectId, tabtype, handleList, handleGroup, closeGroup, selectGroup}) => { +const Container = ({list, labelSize, selectId, tabtype, handleList, handleGroup, closeGroup, selectGroup}) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -45,6 +45,7 @@ id={card.uuid} key={card.uuid} sort={i + 1} + labelSize={labelSize} active={card.uuid === selectId} card={card} moveCard={moveCard} diff --git a/src/menu/components/form/dragtitle/index.scss b/src/menu/components/form/dragtitle/index.scss index 9921c52..f1c1799 100644 --- a/src/menu/components/form/dragtitle/index.scss +++ b/src/menu/components/form/dragtitle/index.scss @@ -2,6 +2,10 @@ display: flex; line-height: 30px; min-height: 50px; + font-weight: inherit; + div { + font-weight: inherit; + } .page-card { position: relative; flex: 1; diff --git a/src/menu/components/form/simple-form/options.jsx b/src/menu/components/form/simple-form/options.jsx index 760d969..2ddaa70 100644 --- a/src/menu/components/form/simple-form/options.jsx +++ b/src/menu/components/form/simple-form/options.jsx @@ -84,6 +84,7 @@ {value: 'static', label: '闈欐��'}, ], controlFields: [ + {field: 'empty', values: ['dynamic']}, {field: 'supModule', values: ['static']}, ] }, @@ -171,6 +172,19 @@ }, { type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + skip: true, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { + type: 'radio', field: 'permission', label: '鏉冮檺楠岃瘉', initval: wrap.permission || 'false', diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx index b16532c..32bc1f9 100644 --- a/src/menu/components/form/step-form/index.jsx +++ b/src/menu/components/form/step-form/index.jsx @@ -201,7 +201,7 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) + MKEmitter.emit('changeStyle', ['height', 'font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) } getStyle = (style) => { @@ -704,6 +704,11 @@ render() { const { card, group, appType } = this.state + let labelSize = 14 + if (card.style.fontSize) { + labelSize = parseInt(card.style.fontSize) + } + return ( <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ @@ -725,6 +730,7 @@ </Popover> <FormTitle list={card.subcards} + labelSize={labelSize} selectId={group ? group.uuid : ''} handleList={this.changecards} handleGroup={this.changeGroup} diff --git a/src/menu/components/form/step-form/index.scss b/src/menu/components/form/step-form/index.scss index 8ca4c7c..40539f2 100644 --- a/src/menu/components/form/step-form/index.scss +++ b/src/menu/components/form/step-form/index.scss @@ -15,6 +15,7 @@ top: 1px; cursor: pointer; padding: 5px; + color: rgba(0, 0, 0, 0.65); background: rgba(255, 255, 255, 0.55); } @@ -25,6 +26,7 @@ } .form-area { position: relative; + font-size: 14px; .page-card { background: transparent; } diff --git a/src/menu/components/form/step-form/options.jsx b/src/menu/components/form/step-form/options.jsx index 48f3daf..3d87ab2 100644 --- a/src/menu/components/form/step-form/options.jsx +++ b/src/menu/components/form/step-form/options.jsx @@ -61,6 +61,7 @@ {value: 'static', label: '闈欐��'}, ], controlFields: [ + {field: 'empty', values: ['dynamic']}, {field: 'supModule', values: ['static']}, ] }, @@ -84,8 +85,22 @@ options: [ {value: 'show', label: '鏄剧ず'}, {value: 'hidden', label: '闅愯棌'}, - ] + ], + // controlFields: [ + // {field: 'labelSize', values: ['show']}, + // ] }, + // { + // type: 'number', + // field: 'labelSize', + // label: '鍚嶇О澶у皬', + // initval: wrap.labelSize || '', + // tooltip: '鍒嗙粍鍚嶇О瀛椾綋澶у皬銆�', + // min: 12, + // max: 50, + // precision: 0, + // required: false + // }, { type: 'radio', field: 'tabtype', @@ -122,6 +137,19 @@ }, { type: 'radio', + field: 'empty', + label: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + skip: true, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { + type: 'radio', field: 'permission', label: '鏉冮檺楠岃瘉', initval: wrap.permission || 'false', diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index cc18525..1de74ec 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -213,7 +213,7 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) + MKEmitter.emit('changeStyle', ['height', 'font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear', 'minHeight'], card.style, this.getStyle) } getStyle = (style) => { @@ -729,6 +729,11 @@ render() { const { card, group, appType } = this.state + let labelSize = 14 + if (card.style.fontSize) { + labelSize = parseInt(card.style.fontSize) + } + return ( <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ @@ -750,6 +755,7 @@ </Popover> <FormTitle list={card.subcards} + labelSize={labelSize} tabtype={card.wrap.tabtype || ''} selectId={group ? group.uuid : ''} handleList={this.changecards} diff --git a/src/menu/components/form/tab-form/index.scss b/src/menu/components/form/tab-form/index.scss index 8ca4c7c..ffb7696 100644 --- a/src/menu/components/form/tab-form/index.scss +++ b/src/menu/components/form/tab-form/index.scss @@ -25,6 +25,7 @@ } .form-area { position: relative; + font-size: 14px; .page-card { background: transparent; } diff --git a/src/menu/components/module/account/options.jsx b/src/menu/components/module/account/options.jsx index 9d027e8..8faa66c 100644 --- a/src/menu/components/module/account/options.jsx +++ b/src/menu/components/module/account/options.jsx @@ -35,13 +35,27 @@ }, { type: 'radio', + field: 'readonly', + label: '鍙', + initval: wrap.readonly || 'false', + required: true, + options: [ + {value: 'false', label: '鍚�'}, + {value: 'true', label: '鏄�'}, + ], + controlFields: [ + {field: 'addable', values: ['false']}, + ] + }, + { + type: 'radio', field: 'addable', label: '鍙柊澧�', initval: wrap.addable || 'false', required: true, options: [ - {value: 'true', label: '鏄�'}, {value: 'false', label: '鍚�'}, + {value: 'true', label: '鏄�'}, ], controlFields: [ {field: 'linkmenu', values: ['true']}, diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index b78ff7f..740b4a2 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -214,6 +214,9 @@ if (Ot === 'required') { shows.push('progress') } + if (Ot === 'required' && (intertype === 'inner' || intertype === 'system')) { + shows.push('execType') + } if (this.record.openmenu && this.record.openmenu !== 'goback') { shows.push('open') } @@ -434,7 +437,7 @@ } else if (_funcType === 'closetab') { shows.push('refreshTab') } else if (_funcType === 'scan') { - shows.push('linkmenu') + shows.push('linkmenu', 'prefix') reRequired.linkmenu = false reTooltip.linkmenu = '浣跨敤鎵爜鐧诲綍鍔熻兘鎴栬彍鍗曡烦杞姛鑳芥椂锛岄渶閫夋嫨璺宠浆鐨勮彍鍗曘��' diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 2a0179a..c1f4bd9 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -137,6 +137,7 @@ { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' }, { value: 'mkUnsubscribe', text: '娉ㄩ攢璐︽埛' }, { value: 'reAuth', text: '鍒囨崲绯荤粺锛堟竻绌虹紦瀛�-灏忕▼搴忥級' }, + { value: 'clearCache', text: '娓呯┖鏈湴閰嶇疆' }, { value: 'copyurl', text: '澶嶅埗閾炬帴鍦板潃' }, { value: 'logout', text: '閫�鍑�' }, { value: 'goBack', text: '杩斿洖' }, @@ -382,6 +383,14 @@ required: true, extendName: 'MenuNo', options: isApp ? appMenus : menulist + }, + { + type: 'text', + key: 'prefix', + label: '鍓嶇紑', + initVal: card.prefix || '', + tooltip: '鎵爜淇℃伅灏嗕笌鍓嶇紑鎷兼帴鍚庢墽琛屻�傛敞锛氳烦杞彍鍗曢渶浠kbid寮�澶淬��', + required: false }, { type: 'textarea', @@ -1072,6 +1081,21 @@ label: '鍏抽棴鎻愮ず', initVal: card.closeText || '', required: false, + }, + { + type: 'radio', + key: 'execType', + label: '璇锋眰鏂瑰紡', + initVal: card.execType || 'multi', + tooltip: '閫変腑澶氭潯鏁版嵁鏃剁殑璇锋眰鏂瑰紡锛屾敞锛氬綋閫変腑鏁版嵁瓒呰繃20鏉℃椂灏嗛�愭潯璇锋眰銆�', + required: false, + options: [{ + value: 'multi', + text: '鎵归噺璇锋眰' + }, { + value: 'single', + text: '閫愭潯璇锋眰' + }] }, { type: 'radio', @@ -1804,6 +1828,21 @@ }, { type: 'radio', + key: 'execType', + label: '璇锋眰鏂瑰紡', + initVal: card.execType || 'multi', + tooltip: '閫変腑澶氭潯鏁版嵁鏃剁殑璇锋眰鏂瑰紡锛屾敞锛氬綋閫変腑鏁版嵁瓒呰繃20鏉℃椂灏嗛�愭潯璇锋眰銆�', + required: false, + options: [{ + value: 'multi', + text: '鎵归噺璇锋眰' + }, { + value: 'single', + text: '閫愭潯璇锋眰' + }] + }, + { + type: 'radio', key: 'progress', label: '杩涘害鎻愮ず', initVal: card.progress || 'number', diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index bd69d85..6120716 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -14,7 +14,8 @@ roleList = [] } - if (['picture', 'link', 'colspan'].includes(card.type)) { + // if (['picture', 'link', 'colspan'].includes(card.type)) { + if (['picture', 'link'].includes(card.type)) { card.type = 'text' } @@ -31,8 +32,11 @@ value: 'custom', text: '鑷畾涔夊垪' }, { - value: 'action', - text: '鎿嶄綔' + value: 'colspan', + text: '鍚堝苟鍒�' + // }, { + // value: 'action', + // text: '鎿嶄綔' }, { value: 'formula', text: '鍏紡' @@ -40,6 +44,13 @@ value: 'index', text: '搴忓彿' }] + + if (!card.isSub) { + options.push({ + value: 'action', + text: '鎿嶄綔' + }) + } let editCols = [ { @@ -60,6 +71,15 @@ editCols.push({ field: col.uuid, label: col.label + }) + } else if (col.type === 'colspan') { + col.subcols.forEach(subcol => { + if (subcol.editable === 'true' && subcol.uuid !== card.uuid) { + editCols.push({ + field: subcol.uuid, + label: col.label + '-' + subcol.label + }) + } }) } }) @@ -116,7 +136,7 @@ type: 'radio', key: 'IsSort', label: '鎺掑簭', - initVal: card.IsSort || 'false', + initVal: card.IsSort || (card.isSub ? 'false' : 'true'), required: true, options: [{ value: 'true', diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index 88c227d..e445b43 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -17,6 +17,7 @@ number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'editable', 'initval', 'sum', 'blacklist'], textarea: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'prefix', 'initval', 'postfix', 'blacklist'], custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], + colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], action: ['label', 'type', 'Align', 'Width'], formula: ['label', 'type', 'Align', 'Hide', 'Width', 'prefix', 'postfix', 'eval', 'formula', 'blacklist'], index: ['label', 'type', 'Align', 'Width'] @@ -131,7 +132,7 @@ return item }) }, () => { - if (value === 'action') { + if (value === 'action' || value === 'colspan') { this.props.form.setFieldsValue({Align: 'center'}) } }) @@ -349,21 +350,18 @@ } handleSubmit = () => { - const { columns, column } = this.props + // const { columns } = this.props // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - values.uuid = column.uuid - values.marks = column.marks || [] - - if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { - notification.warning({ - top: 92, - message: '瀛楁宸叉坊鍔狅紒', - duration: 5 - }) - return - } + // if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { + // notification.warning({ + // top: 92, + // message: '瀛楁宸叉坊鍔狅紒', + // duration: 5 + // }) + // return + // } this.setState({visible: false, formlist: null}) this.props.submitCol(values) diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 319b9af..afa1eba 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -59,31 +59,57 @@ </th> ) - let style = {cursor: 'move', textAlign: align} - if (column.Width) { - style.width = column.Width - style.minWidth = column.Width - } + if (index !== undefined) { + let style = {cursor: 'move', textAlign: align} + if (column.Width) { + style.width = column.Width + style.minWidth = column.Width + } - return connectDragSource( - connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> - <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ - <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> - {['custom', 'action'].includes(column.type) ? - <PlusOutlined className="plus" title="娣诲姞" onClick={() => this.props.addElement(column)} /> : null - } - <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> - {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} - {column.type === 'action' ? <PasteComponent options={['action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} - {column.type === 'custom' || column.type === 'action' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} - <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> - {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } - </div> - } trigger="hover"> - {children} - </Popover> - </th>), - ) + return connectDragSource( + connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> + {['custom', 'colspan', 'action'].includes(column.type) ? + <PlusOutlined className="plus" title="娣诲姞" onClick={() => this.props.addElement(column)} /> : null + } + <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> + {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} + {column.type === 'action' ? <PasteComponent options={['action']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} + {column.type === 'custom' || column.type === 'action' ? <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={() => this.props.changeStyle(column)}/> : null} + <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> + {['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + </div> + } trigger="hover"> + {children} + </Popover> + </th>), + ) + } else if (column) { + let style = {textAlign: align} + if (column.Width) { + style.width = column.Width + style.minWidth = column.Width + } + + return ( + <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> + {['custom', 'colspan'].includes(column.type) ? + <PlusOutlined className="plus" title="娣诲姞" onClick={() => this.props.addElement(column)} /> : null + } + <EditOutlined className="edit" title="缂栬緫" onClick={() => this.props.editColumn(column)} /> + {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} + <DeleteOutlined className="close" title="鍒犻櫎" onClick={this.deleteCol} /> + {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } + </div> + } trigger="hover"> + {children} + </Popover> + </th> + ) + } } } @@ -267,12 +293,14 @@ let _columns = fromJS(this.state.columns).toJS() let type = item.subType - if (!['text', 'number', 'textarea', 'custom', 'action', 'formula', 'index'].includes(item.subType)) { + if (!['text', 'number', 'textarea', 'custom', 'action', 'formula', 'index', 'colspan'].includes(item.subType)) { type = 'text' } let col = { focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: type, elements: [] } - if (col.type === 'action') { + if (col.type === 'colspan') { + col.subcols = [] + } else if (col.type === 'action') { col.label = '鎿嶄綔' } else if (col.type === 'index') { col.label = '搴忓彿' @@ -287,14 +315,21 @@ }) } - updateCol = (col, btn) => { - let _columns = fromJS(this.state.columns).toJS() - _columns = _columns.map(column => { + loopCol = (columns, col) => { + return columns.map(column => { + if (column.type === 'colspan') { + column.subcols = this.loopCol(column.subcols || [], col) + } if (column.uuid === col.uuid) { return col } return column }) + } + + updateCol = (col, btn) => { + let _columns = fromJS(this.state.columns).toJS() + _columns = this.loopCol(_columns, col) this.setState({ columns: _columns, @@ -331,7 +366,16 @@ addElement = (col) => { let column = fromJS(col).toJS() - if (column.type === 'custom') { + if (column.type === 'colspan') { + column.subcols = column.subcols || [] + let subcol = { isSub: true, focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' } + column.subcols.push(subcol) + + this.setState({ + card: subcol + }) + this.updateCol(column) + } else if (column.type === 'custom') { let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 @@ -358,7 +402,13 @@ submitCol = (col) => { const { card } = this.state - if (col.type === 'custom') { + col.uuid = card.uuid + col.isSub = card.isSub === true + col.marks = card.marks || [] + + if (col.type === 'colspan') { + col.subcols = card.subcols || [] + } else if (col.type === 'custom') { col.style = card.style || {} col.elements = card.type === 'custom' ? (card.elements || []) : [] } else if (col.type === 'action') { @@ -410,10 +460,19 @@ this.setState({card: null}) } + loopDelCol = (columns, col) => { + return columns.filter(column => { + if (column.type === 'colspan') { + column.subcols = this.loopDelCol(column.subcols, col) + } + return column.uuid !== col.uuid + }) + } + deleteCol = (col) => { let _columns = fromJS(this.state.columns).toJS() - _columns = _columns.filter(column => column.uuid !== col.uuid) + _columns = this.loopDelCol(_columns, col) this.setState({ columns: _columns @@ -541,6 +600,43 @@ MKEmitter.removeListener('submitStyle', this.getStyle) } + handlecolumns = (columns, fields, config, isSub) => { + return columns.map((col, index) => { + let title = col.label + if (col.editable === 'true') { + title = <span>{col.label}<EditOutlined style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff', opacity: '0.7'}}/></span> + } + + return { + title: title, + dataIndex: col.uuid, + align: col.Align, + sorter: col.IsSort === 'true', + onCell: () => ({ + column: col, + width: col.Width, + config: config, + upComponent: this.updateCol + }), + onHeaderCell: () => ({ + index: isSub ? undefined : index, + column: col, + fields: fields, + align: col.Align, + moveCol: this.moveCol, + dropCol: this.dropCol, + updateCol: this.updateCol, + addElement: this.addElement, + editColumn: this.editColumn, + pasteCell: this.pasteCell, + changeStyle: this.changeStyle, + deleteCol: this.deleteCol, + }), + children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, true) : null, + } + }) + } + render() { const { config } = this.props const { fields, card, lineMarks, tableId, visible } = this.state @@ -560,38 +656,7 @@ } } - const columns = this.state.columns.map((col, index) => { - let title = col.label - if (col.editable === 'true') { - title = <span>{col.label}<EditOutlined style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff', opacity: '0.7'}}/></span> - } - return { - title: title, - dataIndex: col.uuid, - align: col.Align, - sorter: col.IsSort === 'true', - onCell: () => ({ - column: col, - width: col.Width, - config: config, - upComponent: this.updateCol - }), - onHeaderCell: () => ({ - index, - column: col, - fields: fields, - align: col.Align, - moveCol: this.moveCol, - dropCol: this.dropCol, - updateCol: this.updateCol, - addElement: this.addElement, - editColumn: this.editColumn, - pasteCell: this.pasteCell, - changeStyle: this.changeStyle, - deleteCol: this.deleteCol, - }), - } - }) + const columns = this.handlecolumns(this.state.columns, fields, config) return ( <div className={`edit-table-columns ${config.setting.laypage} ${config.wrap.mode || ''} table-vertical-${config.wrap.vertical || ''}`} id={tableId}> diff --git a/src/menu/components/table/edit-table/columns/index.scss b/src/menu/components/table/edit-table/columns/index.scss index b7e3f7b..0accff1 100644 --- a/src/menu/components/table/edit-table/columns/index.scss +++ b/src/menu/components/table/edit-table/columns/index.scss @@ -113,6 +113,7 @@ } >.anticon-copy { color: #26C281; + margin-left: 5px; } >.anticon-delete { color: #ff4d4f; diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index ec5c659..ac0caff 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -350,6 +350,14 @@ if (col.format === 'abs') { config.absFields.push(col.field) } + } else if (col.type === 'colspan' && col.subcols) { + col.subcols.forEach(scol => { + if (scol.type === 'number') { + if (scol.format === 'abs') { + config.absFields.push(scol.field) + } + } + }) } }) diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx index d04ef9a..9e47b44 100644 --- a/src/menu/components/table/edit-table/options.jsx +++ b/src/menu/components/table/edit-table/options.jsx @@ -62,6 +62,9 @@ options: [ {value: 'true', label: '鍙紪杈�'}, {value: 'false', label: '涓嶅彲缂栬緫'}, + ], + controlFields: [ + {field: 'switchable', values: ['true']}, ] }, { @@ -280,6 +283,18 @@ forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { + type: 'radio', + field: 'switchable', + label: '鐘舵�佸垏鎹�', + initval: wrap.switchable || 'true', + tooltip: '鏄惁鍙互鍦ㄧ紪杈戝拰榛樿table鐘舵�侀棿鍒囨崲銆�', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ] + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index 6477d10..917976c 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -501,7 +501,6 @@ title: col.label, dataIndex: col.uuid, align: col.Align, - // sorter: !isSub && col.IsSort === 'true', sorter: col.IsSort === 'true', onCell: () => ({ column: col, diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx index 53b2285..418222c 100644 --- a/src/menu/components/tabs/paste/index.jsx +++ b/src/menu/components/tabs/paste/index.jsx @@ -23,35 +23,32 @@ this.setState({visible: true}) } - resetconfig = (item, uuids = {}) => { + resetconfig = (item) => { if (item.type === 'tabs') { - uuids[item.uuid] = MenuUtils.getuuid() - item.uuid = uuids[item.uuid] + item.uuid = MenuUtils.getuuid() item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.subtabs.forEach(tab => { - uuids[tab.uuid] = MenuUtils.getuuid() - tab.uuid = uuids[tab.uuid] + tab.uuid = MenuUtils.getuuid() tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell, uuids) + cell = this.resetconfig(cell) return cell }) }) } else if (item.type === 'group') { - uuids[item.uuid] = MenuUtils.getuuid() - item.uuid = uuids[item.uuid] + item.uuid = MenuUtils.getuuid() item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.components = item.components.map(cell => { - cell = MenuUtils.resetComponentConfig(cell, uuids) + cell = MenuUtils.resetComponentConfig(cell) return cell }) } else { - item = MenuUtils.resetComponentConfig(item, uuids) + item = MenuUtils.resetComponentConfig(item) } return item @@ -90,7 +87,7 @@ return } - res = this.resetconfig(res, {}) + res = this.resetconfig(res) delete res.copyType diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx index 2631584..85de3e6 100644 --- a/src/menu/datasource/verifycard/customscript/index.jsx +++ b/src/menu/datasource/verifycard/customscript/index.jsx @@ -234,7 +234,7 @@ </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>, + <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鎺掑簭銆佸垎椤典互鍙婃悳绱㈡潯浠跺彉閲忥紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}</Tooltip> <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url鍙橀噺锛岃鎸夌収@xxx@鏍煎紡浣跨敤銆�'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip> diff --git a/src/menu/datasource/verifycard/utils.jsx b/src/menu/datasource/verifycard/utils.jsx index 8b3fd5a..93f129b 100644 --- a/src/menu/datasource/verifycard/utils.jsx +++ b/src/menu/datasource/verifycard/utils.jsx @@ -14,13 +14,11 @@ let _customScript = '' let arr_field = columns.map(item => item.field).join(',') - if (scripts.length > 0) { - scripts.forEach(item => { - _customScript += ` - ${item.sql} - ` - }) - } + scripts.forEach(item => { + _customScript += ` + ${item.sql} + ` + }) if (!arr_field) { arr_field = '*' @@ -44,8 +42,8 @@ // error = '绯荤粺鍑芥暟' + _customScript.match(/\$ex@.{1,50}@ex\$/g)[0].replace(/\$ex@|@ex\$/g, '') + '鏈畾涔�' // } - _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) - _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) + _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`) + _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`) _dataresource = _dataresource.replace(/@\$|\$@/ig, '') _customScript = _customScript.replace(/@\$|\$@/ig, '') @@ -218,12 +216,38 @@ if (/@[0-9a-zA-Z_]+@/ig.test(sql)) { let arr = sql.match(/@[0-9a-zA-Z_]+@/ig) + let getTrueSql = (sl) => { + if (!/\/\*/.test(sl)) return sl + let index = 0 + + sl = sl.replace(/\s/ig, ' ') + sl = sl.replace(/\*\//ig, 'm_k@') + sl = sl.replace(/\/\*/ig, () => { + index++ + return '@m_k' + index + }) + + for (let i = index; i > 0; i--) { + let reg = new RegExp(`@m_k${i}.+m_k@`, 'ig') + sl = sl.replace(reg, '') + } + + return sl + } + + let _scripts = [] + _dataresource = _dataresource.replace('/*system_query*/', '') + _dataresource = getTrueSql(_dataresource) + scripts.forEach(item => { + _scripts.push({...item, sql: getTrueSql(item.sql)}) + }) + arr.forEach(item => { let reg = new RegExp(item, 'ig') if (reg.test(_dataresource)) { errors.push(`鏁版嵁婧愪腑瀛樺湪鏈浛鎹㈠��${item}`) } - scripts && scripts.forEach(script => { + _scripts.forEach(script => { if (reg.test(script.sql)) { errors.push(`鑷畾涔夎剼鏈�(${script.$index || ''})瀛樺湪鏈浛鎹㈠��${item}`) } diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index 7a49bf2..d816e9d 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -18,40 +18,37 @@ visible: false } - resetconfig = (item, uuids = {}) => { + resetconfig = (item) => { let appType = sessionStorage.getItem('appType') if (item.type === 'tabs') { - uuids[item.uuid] = MenuUtils.getuuid() - item.uuid = uuids[item.uuid] + item.uuid = MenuUtils.getuuid() item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.subtabs.forEach(tab => { - uuids[tab.uuid] = MenuUtils.getuuid() - tab.uuid = uuids[tab.uuid] + tab.uuid = MenuUtils.getuuid() if (appType !== 'mob') { tab.components = tab.components.filter(cell => cell.type !== 'menubar') } tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell, uuids) + cell = this.resetconfig(cell) return cell }) }) } else if (item.type === 'group') { - uuids[item.uuid] = MenuUtils.getuuid() - item.uuid = uuids[item.uuid] + item.uuid = MenuUtils.getuuid() item.setting.name = item.setting.name + MenuUtils.getSignName() item.name = item.setting.name item.components = item.components.map(cell => { - cell = MenuUtils.resetComponentConfig(cell, uuids) + cell = MenuUtils.resetComponentConfig(cell) return cell }) } else { - item = MenuUtils.resetComponentConfig(item, uuids) + item = MenuUtils.resetComponentConfig(item) } return item diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index b795e25..e06a198 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -167,12 +167,16 @@ this.callback = null } - updateStyle = (style) => { + updateStyle = (style, prop) => { const { card } = this.state let _style = { ...card, ...style + } + + if (prop && !_style[prop]) { + delete _style[prop] } this.setState({ @@ -278,7 +282,7 @@ * @description 淇敼鑳屾櫙棰滆壊 锛岄鑹叉帶浠� */ changeBackgroundColor = (val) => { - this.updateStyle({backgroundColor: val}) + this.updateStyle({backgroundColor: val}, 'backgroundColor') } changeBackground = (val) => { @@ -438,29 +442,11 @@ } changeWidth = (val) => { - const { card } = this.state - let _style = {...card} - - if (val === '0px') { - delete _style.width - } else { - _style.width = val - } - - this.setState({ - card: _style - }) - - this.callback && this.callback(_style) + this.updateStyle({width: val === '0px' ? '' : val}, 'width') } changeHeight = (val) => { - let _val = val - if (_val === '0px') { - _val = 'auto' - } - - this.updateStyle({height: _val}) + this.updateStyle({height: val === '0px' ? '' : val}, 'height') } changeNormalStyle = (val, type) => { @@ -633,7 +619,7 @@ label={<BgColorsOutlined title="鑳屾櫙棰滆壊"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <ColorSketch value={card.backgroundColor || '#ffffff'} onChange={this.changeBackgroundColor} /> + <ColorSketch allowClear={true} value={card.backgroundColor || ''} onChange={this.changeBackgroundColor} /> </Form.Item> <Form.Item colon={false} diff --git a/src/menu/stylecontroller/index.scss b/src/menu/stylecontroller/index.scss index 02bccdb..8940758 100644 --- a/src/menu/stylecontroller/index.scss +++ b/src/menu/stylecontroller/index.scss @@ -82,6 +82,14 @@ .color-sketch-block { position: relative; top: 10px; + .color-sketch-value { + .anticon-close-circle { + background: transparent; + } + .anticon-close-circle:hover { + color: #ffffff; + } + } } .color-sketch-block + .ant-input { float: right; diff --git a/src/mob/components/formdragelement/index.jsx b/src/mob/components/formdragelement/index.jsx index 4ab72c5..bfeaf84 100644 --- a/src/mob/components/formdragelement/index.jsx +++ b/src/mob/components/formdragelement/index.jsx @@ -102,6 +102,10 @@ newcard.span = 24 newcard.focus = true + if (item.subType === 'textarea') { + newcard.required = 'false' + } + let targetId = '' if (item.dropTargetId) { diff --git a/src/mob/components/topbar/normal-navbar/options.jsx b/src/mob/components/topbar/normal-navbar/options.jsx index 2a395e0..5fbab72 100644 --- a/src/mob/components/topbar/normal-navbar/options.jsx +++ b/src/mob/components/topbar/normal-navbar/options.jsx @@ -87,6 +87,7 @@ controlFields: [ {field: 'reload', values: ['back']}, {field: 'linkmenu', values: ['scan']}, + {field: 'prefix', values: ['scan']}, ], span: 24 }, @@ -179,6 +180,14 @@ options: menulist }, { + type: 'text', + field: 'prefix', + label: '鍓嶇紑', + initval: wrap.prefix || '', + tooltip: '鎵爜淇℃伅灏嗕笌鍓嶇紑鎷兼帴鍚庢墽琛屻�傛敞锛氳烦杞彍鍗曢渶浠kbid寮�澶淬��', + required: false + }, + { type: 'radio', field: 'minishow', label: '灏忕▼搴忎腑', diff --git a/src/pc/createview/index.jsx b/src/pc/createview/index.jsx index 580b8cc..be5bdec 100644 --- a/src/pc/createview/index.jsx +++ b/src/pc/createview/index.jsx @@ -3,6 +3,7 @@ import { is, fromJS } from 'immutable' import { Button, Modal, notification } from 'antd' import moment from 'moment' +import md5 from 'md5' import Utils from '@/utils/utils.js' import MenuUtils, { getTables } from '@/utils/utils-custom.js' @@ -158,15 +159,14 @@ } if (_config.components) { - let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + let commonId = Utils.getuuid() if (_config.interfaces && _config.interfaces.length > 0) { config.interfaces = _config.interfaces.map(inter => { - uuids[inter.uuid] = this.getuuid() - inter.uuid = uuids[inter.uuid] + inter.uuid = md5(commonId + inter.uuid) return inter }) } - config.components = MenuUtils.resetConfig(_config.components, uuids, res.clearMenu === 'true') + config.components = MenuUtils.resetConfig(_config.components, commonId, res.clearMenu === 'true') config.tables = _config.tables || [] config.style = _config.style || {} config.statusBarbgColor = _config.statusBarbgColor || '' diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 7965a78..0e5c7d9 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -379,6 +379,9 @@ if (cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� @@ -404,6 +407,9 @@ if (cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� 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 9431a8d..c450a84 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -120,6 +120,7 @@ let subconfig = fromJS(_config).toJS() subconfig.columns = subconfig.subColumns || [] + subconfig.setting.primaryKey = subconfig.setting.subKey subcard.style = subcard.backStyle subcard.elements = subcard.backElements diff --git a/src/tabviews/custom/components/card/double-data-card/index.scss b/src/tabviews/custom/components/card/double-data-card/index.scss index 4969ee5..f483742 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.scss +++ b/src/tabviews/custom/components/card/double-data-card/index.scss @@ -236,6 +236,20 @@ .circle-select:hover { border-color: var(--mk-sys-color); } + >.card-row-list { + >.ant-col:not(.extend-card) { + .card-item-box:hover { + background-color: var(--mk-sys-color2); + } + } + } + .sub-card-wrap.mk-parity-bg { + .ant-col:nth-child(even){ + .card-item-box:not(:hover) { + background-color: var(--mk-sys-color1); + } + } + } } .card-item-wrap { .card-item-box { @@ -284,11 +298,6 @@ overflow: hidden; transition: height 0.3s; } - .sub-card-wrap { - .card-item-box:hover { - background-color: var(--mk-sys-color2); - } - } } .card-item-wrap.flex-card { >.card-item-box:first-child { @@ -302,10 +311,12 @@ margin-right: 35px; } - .sub-card-wrap.mk-parity-bg { - .ant-col:nth-child(even){ - .card-item-box:not(:hover) { - background-color: var(--mk-sys-color1); + .data-zoom:not(.check) { + .sub-card-wrap.mk-parity-bg { + .ant-col:nth-child(even){ + .card-item-box { + background-color: var(--mk-sys-color1); + } } } } diff --git a/src/tabviews/custom/components/form/simple-form/index.jsx b/src/tabviews/custom/components/form/simple-form/index.jsx index b29ce9c..336de9c 100644 --- a/src/tabviews/custom/components/form/simple-form/index.jsx +++ b/src/tabviews/custom/components/form/simple-form/index.jsx @@ -288,6 +288,8 @@ render() { const { config, loading, BID, BData, data, group, dict } = this.state + if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null + return ( <div className="custom-simple-form-box" id={'anchor' + config.uuid} style={{...config.style}}> {loading ? diff --git a/src/tabviews/custom/components/form/step-form/index.jsx b/src/tabviews/custom/components/form/step-form/index.jsx index c5c8315..f3711b3 100644 --- a/src/tabviews/custom/components/form/step-form/index.jsx +++ b/src/tabviews/custom/components/form/step-form/index.jsx @@ -104,6 +104,16 @@ _group = _groups || _group } + config.titleStyle = {} + config.sortStyle = {} + + if (config.style.fontSize) { + let size = parseInt(config.style.fontSize) + config.titleStyle = {fontSize: size} + let s = size * 1.5 + 'px' + config.sortStyle = {width: s, height: s, lineHeight: s, borderRadius: s} + } + this.setState({ sync: _sync, data: _data, @@ -380,6 +390,8 @@ render() { const { config, loading, BID, BData, data, group, dict, step } = this.state + if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null + return ( <div className="custom-normal-form-box" id={'anchor' + config.uuid} style={{...config.style}}> {loading ? @@ -390,8 +402,8 @@ } {config.wrap.groupLabel !== 'hidden' ? <div className="mk-normal-form-title"> {config.subcards.map(card => ( - <div key={card.uuid} className={'form-title' + (card.sort <= step ? ' active' : '')}> - <span className="form-sort" style={{background: config.wrap.color}}>{card.sort}</span> + <div key={card.uuid} style={config.titleStyle} className={'form-title' + (card.sort <= step ? ' active' : '')}> + <span className="form-sort" style={{background: config.wrap.color, ...config.sortStyle}}>{card.sort}</span> <span className="before-line" style={{background: config.wrap.color}}></span> <span className="after-line" style={{background: config.wrap.color}}></span> {card.setting.title} diff --git a/src/tabviews/custom/components/form/step-form/index.scss b/src/tabviews/custom/components/form/step-form/index.scss index 06b56f4..12ca54d 100644 --- a/src/tabviews/custom/components/form/step-form/index.scss +++ b/src/tabviews/custom/components/form/step-form/index.scss @@ -11,10 +11,12 @@ line-height: 30px; min-height: 50px; margin-bottom: 20px; + font-weight: inherit; .form-title { position: relative; flex: 1; text-align: center; + font-weight: inherit; .form-sort { background: #d8d8d8; display: block; diff --git a/src/tabviews/custom/components/form/tab-form/index.jsx b/src/tabviews/custom/components/form/tab-form/index.jsx index 66e5dd2..695bbec 100644 --- a/src/tabviews/custom/components/form/tab-form/index.jsx +++ b/src/tabviews/custom/components/form/tab-form/index.jsx @@ -83,6 +83,12 @@ return group }) + config.titleStyle = {} + + if (config.style.fontSize) { + config.titleStyle = {fontSize: parseInt(config.style.fontSize)} + } + this.setState({ sync: _sync, data: _data, @@ -300,6 +306,8 @@ render() { const { config, loading, BID, BData, data, group, dict } = this.state + if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null + return ( <div className="custom-tab-form-box" id={'anchor' + config.uuid} style={{...config.style}}> {loading ? @@ -310,7 +318,7 @@ } {config.wrap.groupLabel !== 'hidden' ? <div className={'mk-normal-form-title ' + config.wrap.tabtype}> {config.subcards.map(card => ( - <div key={card.uuid} onClick={() => this.changeGroup(card)} className={'form-title' + (group && group.uuid === card.uuid ? ' active' : '')}> + <div key={card.uuid} onClick={() => this.changeGroup(card)} style={config.titleStyle} className={'form-title' + (group && group.uuid === card.uuid ? ' active' : '')}> {card.setting.title} </div>)) } diff --git a/src/tabviews/custom/components/form/tab-form/index.scss b/src/tabviews/custom/components/form/tab-form/index.scss index 370f64a..a079e22 100644 --- a/src/tabviews/custom/components/form/tab-form/index.scss +++ b/src/tabviews/custom/components/form/tab-form/index.scss @@ -12,11 +12,13 @@ min-height: 36px; margin-bottom: 20px; font-size: 16px; + font-weight: inherit; .form-title { position: relative; flex: 1; text-align: center; cursor: pointer; + font-weight: inherit; } } .mk-normal-form-title.mkbtn { diff --git a/src/tabviews/custom/components/module/account/index.jsx b/src/tabviews/custom/components/module/account/index.jsx index 943e10d..4996d2c 100644 --- a/src/tabviews/custom/components/module/account/index.jsx +++ b/src/tabviews/custom/components/module/account/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Select, Divider } from 'antd' +import { notification, Select, Divider, Modal } from 'antd' import { PlusOutlined } from '@ant-design/icons' import moment from 'moment' @@ -11,6 +11,7 @@ import './index.scss' const { Option } = Select +const { confirm } = Modal class AccountModule extends Component { static propTpyes = { @@ -82,31 +83,63 @@ } changeBook = (value) => { - const { books } = this.state + const { books, activeItem } = this.state - let activeItem = books.filter(item => item.id === value)[0] + let Item = books.filter(item => item.id === value)[0] - this.setState({activeItem}) - - if (activeItem) { - MKEmitter.emit('resetSelectLine', this.props.config.uuid, activeItem.id, activeItem) - - let userid = sessionStorage.getItem('UserID') || '' - let sid = localStorage.getItem('SessionUid') || '' - let param = { - func: 'sPC_TableData_InUpDe', - LText: `delete tmp_session_show_key where createuserid='${userid}' and createuser='${sid}' and key_type='fcc_years' - insert into tmp_session_show_key ( key_id,key_type,createuserid,CreateUser,CreateStaff) - select '${activeItem.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`, - exec_type: 'y' - } - - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - - Api.genericInterface(param) + if (!activeItem && Item) { + this.setBook(Item) + } else if (Item) { + const that = this + confirm({ + title: '纭畾鍒囨崲璐﹀鍚楋紵', + content: '鍒囨崲璐﹀鏃剁郴缁熼渶瑕佸埛鏂般��', + onOk() { + return new Promise(resolve => { + that.setBook(Item, resolve) + }) + }, + onCancel() {} + }) } + } + + setBook = (item, resolve) => { + if (!resolve) { + this.setState({activeItem: item}) + + MKEmitter.emit('resetSelectLine', this.props.config.uuid, item.id, item) + } + + let userid = sessionStorage.getItem('UserID') || '' + let sid = localStorage.getItem('SessionUid') || '' + let param = { + func: 'sPC_TableData_InUpDe', + LText: `delete tmp_session_show_key where createuserid='${userid}' and key_type='fcc_years' + insert into tmp_session_show_key ( key_id,key_type,createuserid,CreateUser,CreateStaff) + select '${item.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`, + exec_type: 'y' + } + + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + param.secretkey = Utils.encrypt('', param.timestamp) + param.LText = Utils.formatOptions(param.LText) + + Api.genericInterface(param).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + resolve && resolve() + return + } + + if (resolve) { + window.location.reload() + } + }) } addBook = () => { @@ -150,7 +183,7 @@ {books.map(item => ( <Option disabled={!item.months} key={item.id}>{item.account_name}</Option> ))} - </Select> : <Select value={activeItem ? activeItem.id : ''} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook}> + </Select> : <Select value={activeItem ? activeItem.id : ''} disabled={config.wrap.readonly === 'true'} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook}> {books.map(item => ( <Option disabled={!item.months} key={item.id}>{item.account_name}</Option> ))} diff --git a/src/tabviews/custom/components/module/account/index.scss b/src/tabviews/custom/components/module/account/index.scss index 4b04107..1821b31 100644 --- a/src/tabviews/custom/components/module/account/index.scss +++ b/src/tabviews/custom/components/module/account/index.scss @@ -16,6 +16,15 @@ .date { margin-left: 15px; } + .ant-select.ant-select-disabled { + .ant-select-selection:hover { + border-color: #d9d9d9; + } + .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active { + border-color: #d9d9d9; + box-shadow: none; + } + } } .mk-add-book { diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index aae840b..c230975 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -83,7 +83,7 @@ } // config.wrap.type = 'checkVoucher' - // BID = '20230214130744811P0K95RQ155KG0QIQOFV' + // BID = '20230228173542370E2F4FC1773704C29A6A4' // config.wrap.type = 'checkTemp' // BID = '20230214174458780MFR8IA576ON4VKNOLVH' diff --git a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx index 327a6c9..2acf108 100644 --- a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx +++ b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx @@ -191,6 +191,16 @@ let line = {...record} line[col.field] = value + if (col.field === 'subject_voucher_text') { + MKEmitter.emit('changeRecord', col.tableId, line) + + setTimeout(() => { + let cl = {subject_voucher_text: 'subject_code', subject_code: 'debit', debit: 'credit'} + MKEmitter.emit('tdFocus', cl[col.uuid] + record.uuid) + }, 50) + return + } + if (col.field === 'debit') { line.credit = '' if (isNaN(line.debit)) { @@ -260,6 +270,11 @@ if (value !== record[col.field]) { let line = {...record, [col.field]: value} + if (col.field === 'subject_voucher_text') { + MKEmitter.emit('changeRecord', col.tableId, line) + return + } + if (col.field === 'debit') { line.credit = '' if (isNaN(line.debit)) { diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 08bd627..80579fb 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -75,12 +75,6 @@ setting.orisel = true } - _config.cols.forEach(column => { - if (column.type === 'action') { - column.operations = column.elements - } - }) - _config.style = _config.style || {} this.setState({ diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index c8c762b..3496def 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -111,10 +111,6 @@ }) } - if (column.type === 'action') { - column.operations = column.elements - } - _columns.push(column) }) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index bcf4ee3..8c85c47 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -916,7 +916,7 @@ pageIndex: 1, // 鍒濆椤甸潰绱㈠紩 pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 columns: null, // 鏄剧ず鍒� - fields: [], + forms: [], pickup: false, // 鏀惰捣鏈�夋嫨椤� orderfields: {}, // 鎺掑簭id涓巉ield杞崲 loading: false, @@ -932,51 +932,81 @@ let _columns = [] let deForms = [] - columns.forEach(item => { - if (!initEditLine && item.editable === 'true') { - initEditLine = item - } + let _forms = {} - if (item.type === 'text' && item.editable === 'true' && item.editType === 'select' && item.resourceType === '1') { - let _option = Utils.getSelectQueryOptions(item) + let getColumns = (cols) => { + return cols.map(item => { + let cell = null + + if (item.type === 'colspan') { + cell = { title: item.label, align: item.Align } + cell.children = getColumns(item.subcols) + } else { + if (item.editable === 'true') { + _forms[item.field] = item + if (!initEditLine) { + initEditLine = item + } + } + + if (item.type === 'text' && item.editable === 'true' && item.editType === 'select' && item.resourceType === '1') { + let _option = Utils.getSelectQueryOptions(item) + + if (window.GLOB.debugger === true || window.debugger === true) { + console.info(_option.sql) + } + + item.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) + item.arr_field = _option.field + + deForms.push(item) + } + + if (item.field) { + orderfields[item.uuid] = item.field + } - if (window.GLOB.debugger === true || window.debugger === true) { - console.info(_option.sql) + cell = { + align: item.Align, + dataIndex: item.uuid, + title: item.label, + sorter: !!(item.field && item.IsSort === 'true'), + width: item.Width || 120, + $type: item.type, + onCell: record => ({ + record, + col: item, + config: item.type === 'custom' || item.type === 'action' ? {setting, columns: fields} : null, + }) + } } + + return cell + }) + } + _columns = getColumns(columns) - item.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) - item.arr_field = _option.field + let forms = [] + fields.forEach(item => { + if (item.field === setting.primaryKey) return - deForms.push(item) + if (_forms[item.field]) { + forms.push({..._forms[item.field], datatype: item.datatype}) + } else { + forms.push(item) } + }) - if (item.field) { - orderfields[item.uuid] = item.field + _columns.forEach(item => { + if (item.$type === 'action') return + + let _copy = fromJS(item).toJS() + _copy.sorter = false + + if (item.editable === 'true') { + _copy.title = <span>{item.label}<EditOutlined className="system-color mk-edit-sign"/></span> } - - let _item = { - align: item.Align, - dataIndex: item.uuid, - title: item.label, - sorter: item.field && item.IsSort === 'true', - width: item.Width || 120, - onCell: record => ({ - record, - col: item, - config: item.type === 'custom' || item.type === 'action' ? {setting, columns: fields} : null, - }) - } - - if (item.type !== 'action') { - let _copy = fromJS(_item).toJS() - _copy.sorter = false - - if (item.editable === 'true') { - _copy.title = <span>{item.label}<EditOutlined className="system-color mk-edit-sign"/></span> - } - edColumns.push(_copy) - } - _columns.push(_item) + edColumns.push(_copy) }) if (setting.delable !== 'false' && setting.operType !== 'buoyMode') { @@ -993,13 +1023,6 @@ }) } - // if (setting.borderColor) { // 杈规棰滆壊 - // let style = `#${setting.tableId} table, #${setting.tableId} tr, #${setting.tableId} th, #${setting.tableId} td {border-color: ${setting.borderColor}}` - // let ele = document.createElement('style') - // ele.innerHTML = style - // document.getElementsByTagName('head')[0].appendChild(ele) - // } - let size = (setting.pageSize || 10) + '' let pageOptions = ['10', '25', '50', '100', '500', '1000'] @@ -1009,6 +1032,7 @@ } this.setState({ + forms, pageSize: setting.pageSize || 10, pageOptions, columns: _columns, @@ -1035,12 +1059,6 @@ } componentDidMount () { - const { fields, setting } = this.props - - this.setState({ - fields: fields.filter(item => item.field !== setting.primaryKey), - }) - MKEmitter.addListener('subLine', this.subLine) MKEmitter.addListener('nextLine', this.nextLine) MKEmitter.addListener('addRecord', this.addLine) @@ -1286,7 +1304,7 @@ } subLine = (col, record) => { - const { tableId, fields, edData } = this.state + const { tableId, forms, edData } = this.state if (col && col.tableId !== tableId) return @@ -1300,7 +1318,7 @@ setTimeout(() => { let item = fromJS(record).toJS() let line = [] - fields.forEach(col => { + forms.forEach(col => { if (col.editable !== 'true' || item.$deleted) { if (col.type === 'number') { item[col.field] = +item[col.field] @@ -1357,7 +1375,7 @@ } plusLine = () => { - const { edData, fields, initEditLine } = this.state + const { edData, forms, initEditLine } = this.state let item = {...edData[edData.length - 1]} @@ -1365,7 +1383,7 @@ item.$type = 'add' item.$Index = '' - fields.forEach(col => { + forms.forEach(col => { if (col.initval !== '$copy') { item[col.field] = col.initval } @@ -1434,7 +1452,7 @@ addLine = (id, record) => { const { BID } = this.props - const { edData, fields, tableId } = this.state + const { edData, forms, tableId } = this.state if (id) { if (id !== tableId) return @@ -1448,7 +1466,7 @@ item.$Index = '' item.$$BID = BID || '' - fields.forEach(col => { + forms.forEach(col => { if (col.initval !== '$copy') { item[col.field] = col.initval } @@ -1481,7 +1499,7 @@ item.$$BID = BID || '' } - fields.forEach(col => { + forms.forEach(col => { if (col.initval !== '$copy') { item[col.field] = col.initval } @@ -1502,7 +1520,7 @@ } checkData = () => { - const { edData, fields } = this.state + const { edData, forms } = this.state if (edData.length === 0) { notification.warning({ @@ -1516,7 +1534,7 @@ let Index = 1 let data = fromJS(edData).toJS().map(item => { let line = [] - fields.forEach(col => { + forms.forEach(col => { if (col.editable !== 'true' || item.$deleted) { if (col.type === 'number') { item[col.field] = +item[col.field] @@ -1581,7 +1599,7 @@ submit = (data, type) => { const { submit, BID, setting } = this.props - const { fields } = this.state + const { forms } = this.state if (type !== 'simple' && (setting.commit === 'change' || setting.commit === 'simple')) { data = data.filter(item => !item.$origin) @@ -1596,7 +1614,7 @@ return } - let result = getEditTableSql(submit, data, fields) + let result = getEditTableSql(submit, data, forms) let param = { excel_in: result.lines, @@ -1996,9 +2014,9 @@ </div> : null} <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}> {!submit.hasAction && pickup ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">鎻愪氦</Button> : null} - <Switch title="缂栬緫" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> + {setting.switchable !== 'false' ? <Switch title="缂栬緫" className="main-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> : null} </div> - <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''}`} id={tableId}> + <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} id={tableId}> <Table rowKey="$$uuid" components={components} diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss index 25f0089..6d3798c 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss @@ -318,6 +318,11 @@ } } } +.edit-custom-table.mk-edit-multi { + th .ant-table-column-title .anticon-edit { + display: none; + } +} .edit-custom-table.editable { td { background-color: #ffffff!important; diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index efacce5..7f66256 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -130,19 +130,6 @@ } } - _config.cols.forEach(column => { - if (column.type === 'action') { - column.operations = column.elements - } - }) - - // if (setting.color) { - // setting.style.color = setting.color - // } - // if (setting.fontSize) { - // setting.style.fontSize = setting.fontSize - // } - if (_config.wrap.collapse === 'true') { _config.wrap.title = _config.wrap.title || ' ' } diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index 2d9f4c7..e97abb9 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -257,6 +257,7 @@ return } + // 鍐呴儴鍑芥暟涓簔_mk_express锛岃〃绀烘煡璇㈠揩閫掍俊鎭� if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { this.getExpress() return diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 093e914..2957081 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -540,6 +540,9 @@ if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� @@ -578,6 +581,9 @@ if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� @@ -618,6 +624,9 @@ if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� @@ -663,6 +672,9 @@ if (cell.syncComponentId === item.wrap.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� @@ -698,6 +710,9 @@ if (cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� @@ -736,6 +751,9 @@ if (group.subButton.syncComponentId === item.setting.supModule) { group.subButton.syncComponentId = '' + if (group.subButton.execSuccess === 'grid') { + group.subButton.execSuccess = 'mainline' + } } group.fields = group.fields.map(cell => { @@ -900,7 +918,7 @@ // dataName 绯荤粺鐢熸垚鐨勬暟鎹簮鍚嶇О if (component.setting.sync === 'true') { - component.dataName = Utils.getdataName() + component.dataName = 'mk' + component.uuid.slice(-18) } // floor 缁勪欢鐨勫眰绾� diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index a3eb065..a3970b8 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -385,6 +385,9 @@ if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.btnstyle) { // 鍏煎 @@ -417,6 +420,9 @@ if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (card.btnstyle) { // 鍏煎 card.style = card.style || {} @@ -451,6 +457,9 @@ if (!mutil && cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (card.btnstyle) { // 鍏煎 @@ -491,6 +500,9 @@ if (cell.syncComponentId === item.wrap.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } } else if (['text', 'number', 'formula'].includes(cell.eleType)) { if (!cell.height) { @@ -520,6 +532,9 @@ if (cell.syncComponentId === item.setting.supModule) { cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } } if (cell.btnstyle) { // 鍏煎 @@ -553,6 +568,9 @@ if (group.subButton.syncComponentId === item.setting.supModule) { group.subButton.syncComponentId = '' + if (group.subButton.execSuccess === 'grid') { + group.subButton.execSuccess = 'mainline' + } } group.fields = group.fields.map(cell => { @@ -713,7 +731,7 @@ // dataName 绯荤粺鐢熸垚鐨勬暟鎹簮鍚嶇О if (component.setting.sync === 'true') { - component.dataName = Utils.getdataName() + component.dataName = 'mk' + component.uuid.slice(-18) } // floor 缁勪欢鐨勫眰绾� diff --git a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx index 86891ed..7610cae 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx @@ -45,7 +45,7 @@ let sheetName = btn.verify.sheet let errDetail = '' - if (Object.keys(workbook.Sheets).length === 1) { + if (sheetName === 'Sheet1' && Object.keys(workbook.Sheets).length === 1) { sheetName = Object.keys(workbook.Sheets)[0] } diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 41f9ddb..5615c35 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -594,29 +594,68 @@ this.table2excel(column, table, this.state.excelName.replace(/\.xlsx/ig, '.xls')) - if (btn.verify && btn.verify.enable === 'true' && btn.verify.script) { + if (btn.verify.enable === 'true' && btn.verify.script) { this.execCustomScript() } else { this.execSuccess({ErrCode: 'S', ErrMesg: '瀵煎嚭鎴愬姛锛�'}) } } else { + let letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + let cols = [] + + for (let index = 0; index < columns.length; index++) { + let i = Math.floor(index / 26) + let s = letters[i - 1] || '' + + cols.push(s + letters[index % 26]) + } + + let table = [] let _header = [] let _topRow = {} let colwidth = [] let requires = [] + let merges = [] columns.forEach((col, i) => { _header.push(col.Column) _topRow[col.Column] = col.Text - colwidth.push({width: col.Width || 20}) + colwidth.push({wch: col.Width || 20}) if (col.required === 'true') { requires.push(i) } }) - - let table = [] - - table.push(_topRow) + + if (btn.verify.merge === 'true') { + let fLine = {} + let sLine = {} + let sign = '' + columns.forEach((col, i) => { + if (/.+-.+/.test(col.Text)) { + let _sign = col.Text.split('-')[0] + let _name = col.Text.split('-')[1] + fLine[col.Column] = _sign + sLine[col.Column] = _name + + if (sign === _sign) { + merges[merges.length - 1] = merges[merges.length - 1].split(':')[0] + `:${cols[i]}1` + } else { + merges.push(`${cols[i]}1:${cols[i]}2`) + sign = _sign + } + } else { + fLine[col.Column] = col.Text + sLine[col.Column] = col.Text + sign = '' + merges.push(`${cols[i]}1:${cols[i]}2`) + } + }) + + table.push(fLine) + table.push(sLine) + } else { + table.push(_topRow) + } data && data.forEach((item, index) => { let _row = {} @@ -646,22 +685,42 @@ ws['!cols'] = colwidth + if (btn.verify.rowHeight) { + ws['!rows'] = Array(table.length).fill({hpx: btn.verify.rowHeight}) + } + if (requires.length) { - let cols = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' requires.forEach(col => { if (cols[col]) { ws[cols[col] + '1'].s = {font: { color: { rgb: 'F5222D' } }} } }) } + + if (merges.length) { + ws['!merges'] = [] + merges.forEach(item => { + ws['!merges'].push(XLSX.utils.decode_range(item)) + }) + + cols.forEach(col => { + if (ws[col + '1'].s) { + ws[col + '1'].s = {font: { color: { rgb: 'F5222D' } }, alignment: { horizontal: 'center', vertical: 'center' }} + } else { + ws[col + '1'].s = {alignment: { horizontal: 'center', vertical: 'center' }} + } + ws[col + '2'].s = {alignment: { horizontal: 'center', vertical: 'center' }} + }) + } + // ws["A1"].s = {fill: { bgColor: { rgb: "FFFFAA" }}, font: { color: { rgb: "1890FF" } }} - + const wb = XLSX.utils.book_new() - XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') + XLSX.utils.book_append_sheet(wb, ws, btn.verify.sheet || 'Sheet1') XLSX.writeFile(wb, this.state.excelName) - if (btn.verify && btn.verify.enable === 'true' && btn.verify.script) { + if (btn.verify.enable === 'true' && btn.verify.script) { this.execCustomScript() } else { this.execSuccess({ErrCode: 'S', ErrMesg: '瀵煎嚭鎴愬姛锛�'}) diff --git a/src/tabviews/zshare/actionList/index.scss b/src/tabviews/zshare/actionList/index.scss index 8efb160..99ac35f 100644 --- a/src/tabviews/zshare/actionList/index.scss +++ b/src/tabviews/zshare/actionList/index.scss @@ -49,6 +49,7 @@ height: 34px; border-radius: 0px; padding-left: 15px!important; + border-bottom-width: 1px!important; .anticon { display: none; } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 2271803..1735f7a 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -973,6 +973,7 @@ _sql = _sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) _sql = _sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + _sql = _sql.replace(/@typename@/ig, `'admin'`) return _sql } @@ -1022,7 +1023,7 @@ if (params[0].$unCheckParam) { this.checkLoopRequest(params, _resolve) - } else if (params.length <= 20) { + } else if (params.length <= 20 && btn.execType !== 'single') { let deffers = params.map((param, i) => { return new Promise(resolve => { setTimeout(() => { @@ -1068,6 +1069,7 @@ let iserror = false let errorMsg = '' result.forEach(res => { + if (iserror) return if (res.status) { errorMsg = res } else { @@ -1083,7 +1085,7 @@ _resolve() }) } else { // 瓒呭嚭20涓姹傛椂寰幆鎵ц - if (btn.progress === 'progressbar' && btn.$toolbtn) { + if (btn.progress === 'progressbar' && btn.$toolbtn && params.length > 1) { this.setState({ loadingTotal: params.length }) diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx index bf6178c..43b9afa 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.jsx +++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx @@ -348,7 +348,7 @@ className={className} onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} >{label}</Button> - <span onClick={(e) => {e.stopPropagation()}}>{this.getPop()}</span> + <span onClick={(e) => {e.stopPropagation()}} onDoubleClick={(e) => {e.stopPropagation()}}>{this.getPop()}</span> </> ) } diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index d868d58..fbe6651 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1131,6 +1131,8 @@ _customScript = _customScript.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) _dataresource = _dataresource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) _customScript = _customScript.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + _dataresource = _dataresource.replace(/@typename@/ig, `'admin'`) + _customScript = _customScript.replace(/@typename@/ig, `'admin'`) let LText = '' diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 325f5ab..445b601 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -545,6 +545,10 @@ if (item.database === 'sso') { let sql = _sso + item.base_sql _sso = '' + + sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`) + sql = sql.replace(/@BID@/ig, `'${BID}'`) + if (debug) { console.info(sql) } @@ -552,6 +556,10 @@ } else { let sql = _sql + item.base_sql _sql = '' + + sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`) + sql = sql.replace(/@BID@/ig, `'${BID}'`) + if (debug) { console.info(sql) } @@ -565,9 +573,7 @@ LText: localItems.join(' union all '), obj_name: '', arr_field: '', - table_type: 'Y', - BID: BID || '', - ID: this.state.ID || '' + table_type: 'Y' } if (param.LText) { @@ -601,9 +607,7 @@ LText: mainItems.join(' union all '), obj_name: '', arr_field: '', - table_type: 'Y', - BID: BID || '', - ID: this.state.ID || '' + table_type: 'Y' } if (mainparam.LText) { @@ -663,11 +667,12 @@ func: 'sPC_Get_SelectedList', LText: _sql + form.base_sql, obj_name: form.field, - arr_field: form.arr_field, - BID: this.props.BID || '', - ID: this.state.ID || '' + arr_field: form.arr_field } + param.LText = param.LText.replace(/@ID@/ig, `'${this.state.ID || ''}'`) + param.LText = param.LText.replace(/@BID@/ig, `'${this.props.BID || ''}'`) + if (debug) { console.info(param.LText) } diff --git a/src/tabviews/zshare/mutilform/mkInput/index.jsx b/src/tabviews/zshare/mutilform/mkInput/index.jsx index 7bd5605..2092679 100644 --- a/src/tabviews/zshare/mutilform/mkInput/index.jsx +++ b/src/tabviews/zshare/mutilform/mkInput/index.jsx @@ -131,6 +131,10 @@ const { config } = this.props const { value } = this.state + if (config.inputType === 'password') { + return <Input.Password ref={this.inputRef} className="mk-form-input" placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit}/> + } + return <Input ref={this.inputRef} className="mk-form-input" allowClear placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit} /> } } diff --git a/src/tabviews/zshare/mutilform/mkInput/index.scss b/src/tabviews/zshare/mutilform/mkInput/index.scss index 21a1344..7161e2d 100644 --- a/src/tabviews/zshare/mutilform/mkInput/index.scss +++ b/src/tabviews/zshare/mutilform/mkInput/index.scss @@ -1,4 +1,4 @@ -.mk-form-input { +.mk-form-input:not(.ant-input-password) { .ant-input-suffix { opacity: 0; transition: opacity 0.3s; diff --git a/src/templates/modalconfig/dragelement/index.jsx b/src/templates/modalconfig/dragelement/index.jsx index fcfb770..3cd1b5a 100644 --- a/src/templates/modalconfig/dragelement/index.jsx +++ b/src/templates/modalconfig/dragelement/index.jsx @@ -103,6 +103,8 @@ if (item.subType === 'linkMain') { newcard.hidden = 'true' + } else if (item.subType === 'textarea') { + newcard.required = 'false' } let targetId = '' diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx index ab2adf7..b459117 100644 --- a/src/templates/modalconfig/settingform/index.jsx +++ b/src/templates/modalconfig/settingform/index.jsx @@ -142,6 +142,18 @@ })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)} </Form.Item> </Col> : null} + {display === 'dialog' && appType === 'mob' ? <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="灏忎簬100鏃朵负鐧惧垎鐜囷紝澶т簬100鏃朵负缁濆鍊笺�傜┖鍊兼椂瀹藉害鑷�傚簲銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 瀹藉害 + </Tooltip> + }> + {getFieldDecorator('width', { + initialValue: config.setting.width || '' + })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)} + </Form.Item> + </Col> : null} {['dialog', 'drawer', 'modal'].includes(display) ? <Col span={12}> <Form.Item label="鍒濆鐒︾偣"> {getFieldDecorator('focus', { diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 6224ab7..249c732 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -762,13 +762,18 @@ <Form {...formItemLayout}> <Row gutter={24}> <Col span={8}> - <Form.Item label="琛ㄥ悕"> + <Form.Item label={ + <Tooltip placement="bottomLeft" title="瀵煎叆鏃跺伐浣滆〃鍚嶄笌excel涓繀椤讳竴鑷达紝娉細宸ヤ綔琛ㄥ悕涓篠heet1涓攅xcel涓粎鏈変竴涓伐浣滆〃鏃朵笉杩涜琛ㄥ悕楠岃瘉銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 宸ヤ綔琛� + </Tooltip> + }> {getFieldDecorator('sheet', { initialValue: verify.sheet || '', rules: [ { required: true, - message: '璇疯緭鍏ヨ〃鍚�!' + message: '璇疯緭鍏ュ伐浣滆〃鍚�!' } ] })(<Input placeholder="" autoComplete="off" />)} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx index 7e27b64..09adfd9 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx @@ -272,7 +272,7 @@ </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>, + <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip> {usefulfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鎼滅储鏉′欢锛岃鎸夌収@xxx@鏍煎紡浣跨敤銆�'}>, {usefulfields}</Tooltip> : null} {linefields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'琛ㄥ崟鍙婅鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}>, {linefields}</Tooltip> : null} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx index c4df36d..0159b4e 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Radio, Tooltip, notification } from 'antd' +import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' @@ -234,6 +234,46 @@ </Radio.Group>)} </Form.Item> </Col> : null} + {btnType !== 'print' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="瀵煎嚭excel涓伐浣滆〃鍚嶇О锛岄粯璁や负Sheet1銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 宸ヤ綔琛� + </Tooltip> + }> + {getFieldDecorator('sheet', { + initialValue: setting.sheet || '' + })(<Input placeholder="" autoComplete="off" />)} + </Form.Item> + </Col> : null} + {btnType !== 'print' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="瀵煎嚭excel涓殑琛岄珮銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 琛岄珮 + </Tooltip> + }> + {getFieldDecorator('rowHeight', { + initialValue: setting.rowHeight || '' + })(<InputNumber min={10} max={200} precision={0} />)} + </Form.Item> + </Col> : null} + {btnType !== 'print' ? <Col span={8}> + <Form.Item label={ + <Tooltip placement="topLeft" title="璇峰皢闇�瑕佸悎骞剁殑琛ㄥご浣跨敤涓í绾垮垎闅旓紙濡傦細鍟嗗搧-鏁伴噺銆佸晢鍝�-鍗曚环锛夛紝鍓嶉儴鍒嗗皢浣滀负涓昏〃澶达紝鍚庨儴鍒嗗皢浣滀负瀛愯〃澶淬��"> + <QuestionCircleOutlined className="mk-form-tip" /> + 琛ㄥご鍚堝苟 + </Tooltip> + }> + {getFieldDecorator('merge', { + initialValue: setting.merge || 'false' + })( + <Radio.Group> + <Radio value="false">鍚�</Radio> + <Radio value="true">鏄�</Radio> + </Radio.Group>)} + </Form.Item> + </Col> : null} </Row> </Form> </div> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index ee401ec..76e6878 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -785,6 +785,31 @@ columns.push(cell) }) + if (config.subtype === 'dualdatacard') { + config.subColumns.forEach(item => { + if (fields.includes(item.field) || !item.field) return + fields.push(item.field) + + let cell = { + Column: item.field, + Text: item.label, + Width: 20, + abs: 'false', + output: 'true', + required: 'false', + type: 'text', + uuid: Utils.getuuid() + } + + if (item.type === 'number') { + cell.type = 'number' + cell.decimal = item.decimal + } + + columns.push(cell) + }) + } + this.setState({ verify: {...verify, columns: columns} }) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx index 306c80d..6e71f40 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx @@ -45,8 +45,8 @@ _dataresource = '' } - _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) - _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) + _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`) + _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`) _dataresource = _dataresource.replace(/@\$|\$@/ig, '') _customScript = _customScript.replace(/@\$|\$@/ig, '') diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx index 0e8275c..19c1db3 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx @@ -23,8 +23,8 @@ _dataresource = '' } - _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) - _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) + _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`) + _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`) _dataresource = _dataresource.replace(/@\$|\$@/ig, '') _customScript = _customScript.replace(/@\$|\$@/ig, '') diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index 38fbab2..0aa6042 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -196,6 +196,7 @@ if (item.type === 'text' && item.length >= 256) { newcard.type = 'textarea' + newcard.required = 'false' newcard.fieldlength = item.length if (firstItem) { if (firstItem.type === newcard.type) { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index d11afb9..d211ba0 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3386,6 +3386,20 @@ }, { type: 'radio', + key: 'inputType', + label: '鍔犲瘑鏄剧ず', + initVal: card.inputType || 'text', + required: false, + options: [{ + value: 'text', + text: '鍚�' + }, { + value: 'password', + text: '鏄�' + }] + }, + { + type: 'radio', key: 'interception', label: '鎴彇绌烘牸', initVal: card.interception || 'true', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 6bd3be2..9843550 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -19,7 +19,7 @@ const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) const modalTypeOptions = { - text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl'], + text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType'], number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom'], select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'empty'], checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'arrange', 'marginTop', 'marginBottom', 'empty'], diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx index d2b8119..4fe7e4e 100644 --- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx +++ b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx @@ -146,7 +146,7 @@ } param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`) + param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${param.timestamp}'`) console.info(`/* sql 楠岃瘉 */\n${param.LText.replace(/\n\s{6,20}/ig, '\n')}`) @@ -239,7 +239,7 @@ </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>, + <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞跺湪鍗曞彿鐢熸垚鎴栧垱寤哄嚟璇佹椂浣跨敤銆�'}><span style={{color: '#13c2c2'}}>BillCode, BVoucher, FIBVoucherDate, FiYear, ModularDetailCode</span></Tooltip> {usefulfields ? <span>, {usefulfields}</span> : ''} diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index 1f172d4..4c4a094 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -68,6 +68,10 @@ values.uuid = editItem ? editItem.uuid : '' values.position = values.position || (editItem ? editItem.position : 'front') + if (type === 'fullscreen' && editItem) { + values.status = editItem.status || 'true' + } + let _quot = values.sql.match(/'{1}/g) let _lparen = values.sql.match(/\({1}/g) let _rparen = values.sql.match(/\){1}/g) @@ -119,10 +123,10 @@ let _backCustomScript = '' // 榛樿sql鍚庢墽琛岃剼鏈� this.props.customScripts.forEach(item => { - if (item.status === 'false' && values.uuid !== item.uuid) return - let _item = values.uuid === item.uuid ? values : item + if (_item.status === 'false') return + if (_item.position === 'init') { _initCustomScript += ` /* 鍒濆鍖栬剼鏈� */ diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 1eaf2e9..eb12ca9 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -1,3 +1,5 @@ +import md5 from 'md5' + export default class MenuUtils { /** * @description 鑾峰彇涓嬬骇妯″潡 @@ -394,7 +396,7 @@ * @description 閲嶇疆鑿滃崟閰嶇疆锛岄〉闈㈡暣浣撳鍒� * @return {String} components 閰嶇疆淇℃伅 */ - static resetConfig = (components, uuids = {}, clear = false) => { + static resetConfig = (components, commonId, clear = false) => { return components.map(item => { if (item.type === 'navbar') { return item @@ -404,18 +406,16 @@ item.type = 'card' } - uuids[item.uuid] = this.getuuid() - item.uuid = uuids[item.uuid] + item.uuid = md5(commonId + item.uuid) if (item.type === 'tabs') { item.subtabs.forEach(tab => { - uuids[tab.uuid] = this.getuuid() - tab.uuid = uuids[tab.uuid] + tab.uuid = md5(commonId + tab.uuid) - tab.components = this.resetConfig(tab.components, uuids, clear) + tab.components = this.resetConfig(tab.components, commonId, clear) }) } else if (item.type === 'group') { - item.components = this.resetConfig(item.components, uuids, clear) + item.components = this.resetConfig(item.components, commonId, clear) } else if (item.type === 'menubar') { item.subMenus = item.subMenus.map(cell => { cell.uuid = this.getuuid() @@ -426,8 +426,17 @@ return cell }) } else if (['card', 'carousel', 'timeline'].includes(item.type)) { - if (item.wrap.datatype === 'public' && uuids[item.wrap.publicId]) { - item.wrap.publicId = uuids[item.wrap.publicId] + if (item.wrap.datatype === 'public' && item.wrap.publicId) { + item.wrap.publicId = md5(commonId + item.wrap.publicId) + } + + if (item.supNodes && item.supNodes.length > 0) { + item.supNodes = item.supNodes.map(cell => { + cell.nodes = cell.nodes.map(n => md5(commonId + n)) + cell.componentId = cell.nodes[cell.nodes.length - 1] + + return cell + }) } item.subcards.forEach(card => { @@ -448,9 +457,12 @@ card.elements = card.elements.map(cell => { cell.uuid = this.getuuid() - if (clear && cell.eleType === 'button' && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' + if (cell.eleType === 'button') { + if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { + cell.pageTemplate = '' + cell.linkmenu = '' + } + this.resetBtn(cell, commonId) } return cell @@ -460,9 +472,12 @@ card.backElements = card.backElements.map(cell => { cell.uuid = this.getuuid() - if (clear && cell.eleType === 'button' && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' + if (cell.eleType === 'button') { + if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { + cell.pageTemplate = '' + cell.linkmenu = '' + } + this.resetBtn(cell, commonId) } return cell @@ -470,16 +485,19 @@ } }) } else if (item.type === 'balcony') { - if (item.wrap.datatype === 'public' && uuids[item.wrap.publicId]) { - item.wrap.publicId = uuids[item.wrap.publicId] + if (item.wrap.datatype === 'public' && item.wrap.publicId) { + item.wrap.publicId = md5(commonId + item.wrap.publicId) } if (item.elements) { item.elements = item.elements.map(cell => { cell.uuid = this.getuuid() - if (clear && cell.eleType === 'button' && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' + if (cell.eleType === 'button') { + if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { + cell.pageTemplate = '' + cell.linkmenu = '' + } + this.resetBtn(cell, commonId) } return cell @@ -488,7 +506,7 @@ } else if (item.type === 'table' && item.cols) { let loopCol = (col) => { col.subcols = col.subcols.map(c => { - c.uuid = this.getuuid() + c.uuid = md5(commonId + c.uuid) if (c.type === 'colspan' && c.subcols) { c = loopCol(c) @@ -507,6 +525,8 @@ cell.linkmenu = '' } + this.resetBtn(cell, commonId) + return cell }) } @@ -515,12 +535,9 @@ return col } - let _uuids = {} - item.cols = item.cols.map(col => { - let uuid = this.getuuid() - _uuids[col.uuid] = uuid - col.uuid = uuid + item.cols = item.cols.map(col => { + col.uuid = md5(commonId + col.uuid) if (col.type === 'colspan' && col.subcols) { col = loopCol(col) @@ -532,6 +549,7 @@ } else if (col.type === 'action' && col.elements) { col.elements = col.elements.map(cell => { cell.uuid = this.getuuid() + this.resetBtn(cell, commonId) return cell }) } @@ -540,8 +558,15 @@ if (item.subtype === 'editable') { item.cols = item.cols.map(col => { - if (col.editable === 'true' && col.enter && _uuids[col.enter]) { - col.enter = _uuids[col.enter] + if (col.editable === 'true' && col.enter) { + col.enter = md5(commonId + col.enter) + } else if (col.type === 'colspan' && col.subcols) { + col.subcols = col.subcols.map(c => { + if (c.editable === 'true' && c.enter) { + c.enter = md5(commonId + c.enter) + } + return c + }) } return col }) @@ -555,6 +580,11 @@ return m }) + + if (cell.subButton) { + this.resetBtn(cell.subButton, commonId) + } + return cell }) } @@ -563,18 +593,16 @@ item.btnlog = null } - let oriUids = {} if (item.action) { item.action = item.action.map(cell => { - let _uuid = this.getuuid() - - oriUids[cell.uuid] = _uuid - cell.uuid = _uuid + cell.uuid = md5(commonId + cell.uuid) if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { cell.pageTemplate = '' cell.linkmenu = '' } + + this.resetBtn(cell, commonId) return cell }) @@ -613,27 +641,35 @@ } if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { - let em = false item.setting.supModule = item.setting.supModule.map(c => { - if (!uuids[c]) { - em = true - } - return uuids[c] || '' + return md5(commonId + c) }) - if (em) { - item.setting.supModule = '' - } if (item.wrap && item.wrap.supModule) { item.wrap.supModule = item.setting.supModule } } if (item.wrap && item.wrap.doubleClick) { - item.wrap.doubleClick = oriUids[item.wrap.doubleClick] || '' + item.wrap.doubleClick = md5(commonId + item.wrap.doubleClick) } return item }) + } + + /** + * @description 鎸夐挳閲嶇疆 + */ + static resetBtn (btn, commonId) { + if (btn.switchTab && btn.switchTab.length > 0) { + btn.switchTab = btn.switchTab.map(m => md5(commonId + m)) + } + if (btn.anchors && btn.anchors.length > 0) { + btn.anchors = btn.anchors.map(m => md5(commonId + m)) + } + if (btn.syncComponent && btn.syncComponent.length > 0) { + btn.syncComponent = btn.syncComponent.map(m => md5(commonId + m)) + } } /** @@ -652,7 +688,7 @@ * @description 閲嶇疆缁勪欢閰嶇疆 * @return {String} item 缁勪欢淇℃伅 */ - static resetComponentConfig = (item, uuids = {}) => { + static resetComponentConfig = (item) => { if (item.type === 'navbar') { return item } @@ -661,11 +697,8 @@ item.type = 'card' } - let _uuid = this.getuuid() - - uuids[item.uuid] = _uuid - - item.uuid = _uuid + item.uuid = this.getuuid() + let commonId = this.getuuid() // 閲嶇疆缁勪欢鍚嶇О let sign = this.getSignName() @@ -736,12 +769,8 @@ return col } - let _uuids = {} item.cols = item.cols.map(col => { - let uuid = this.getuuid() - - _uuids[col.uuid] = uuid - col.uuid = uuid + col.uuid = md5(commonId + col.uuid) if (col.type === 'colspan' && col.subcols) { col = loopCol(col) @@ -764,8 +793,8 @@ if (item.subtype === 'editable') { item.cols = item.cols.map(col => { - if (col.editable === 'true' && col.enter && _uuids[col.enter]) { - col.enter = _uuids[col.enter] + if (col.editable === 'true' && col.enter) { + col.enter = md5(commonId + col.enter) } return col }) @@ -785,17 +814,12 @@ delete item.btnlog - let oriUids = {} if (item.action) { if (sessionStorage.getItem('editMenuType') === 'popview') { item.action = item.action.filter(c => c.OpenType !== 'popview' && c.OpenType !== 'funcbutton') } item.action = item.action.map(cell => { - let _uuid = this.getuuid() - - oriUids[cell.uuid] = _uuid - - cell.uuid = _uuid + cell.uuid = md5(commonId + cell.uuid) return cell }) @@ -840,7 +864,7 @@ } if (item.wrap && item.wrap.doubleClick) { - item.wrap.doubleClick = oriUids[item.wrap.doubleClick] || '' + item.wrap.doubleClick = md5(commonId + item.wrap.doubleClick) } return item diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 80b560e..c081694 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -157,6 +157,8 @@ _customScript = _customScript.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) _dataresource = _dataresource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) _customScript = _customScript.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + _dataresource = _dataresource.replace(/@typename@/ig, `'admin'`) + _customScript = _customScript.replace(/@typename@/ig, `'admin'`) let regoptions = null if (setting.queryType === 'statistics' || _customScript) { @@ -375,6 +377,8 @@ _customScript = _customScript.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) _dataresource = _dataresource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) _customScript = _customScript.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + _dataresource = _dataresource.replace(/@typename@/ig, `'admin'`) + _customScript = _customScript.replace(/@typename@/ig, `'admin'`) let regoptions = null if (setting.queryType === 'statistics' || _customScript) { @@ -556,6 +560,7 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + sql = sql.replace(/@typename@/ig, `'admin'`) // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { @@ -646,6 +651,7 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + sql = sql.replace(/@typename@/ig, `'admin'`) if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { console.info(sql.replace(/\n\s{8}/ig, '\n')) @@ -863,6 +869,8 @@ _script = _script.replace(/@UserID@/ig, userId) _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) _script = _script.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + _sql = _sql.replace(/@typename@/ig, `'admin'`) + _script = _script.replace(/@typename@/ig, `'admin'`) // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞 if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { diff --git a/src/utils/utils.js b/src/utils/utils.js index e7c224d..09aede5 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -78,20 +78,6 @@ } /** - * @description 鏁版嵁婧愬悕绉帮紝鐢ㄤ簬缁熶竴鏌ヨ - * @return {String} name - */ - static getdataName () { - let name = [] - let _options = 'abcdefghigklmnopqrstuvwxyz' - for (let i = 0; i < 6; i++) { - name.push(_options.substr(Math.floor(Math.random() * 26), 1)) - } - name.splice(3, 0, new Date().getTime()) - return name.join('') - } - - /** * @description 鐢熸垚32浣島uid string + 鏃堕棿 * @return {String} uuid */ @@ -219,6 +205,35 @@ return value } + + // /** + // * @description sql瑙e瘑 + // * @return {String} value + // */ + // static unFormatOptions (value) { + // if (!value) return '' + + // value = window.atob(value) + // value = value.replace('minKe', '') + // value = window.decodeURIComponent(window.atob(value)) + + // // 澶栬仈鏁版嵁搴撴浛鎹� + // if (window.GLOB.externalDatabase !== null && window.GLOB.externalDatabase) { + // value = value.replace(window.GLOB.externalDatabase, '@db@') + // } + + // value = value.replace(/ mpercent /ig, '%') + + // // 鏇挎崲鍏抽敭瀛� + // formatKeys.forEach(item => { + // let reg = new RegExp('(\\s)?' + item.value.replace(/\s/g, '') + '(\\s)?', 'ig') + // value = value.replace(reg, ' ' + item.key + ' ') + // }) + + // // value = value.replace(/\n/ig, ' \n ') + + // return value + // } /** * @description sPC_TableData_InUpDe sql鍔犲瘑 @@ -2141,6 +2156,7 @@ _callbacksql = _callbacksql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) _callbacksql = _callbacksql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) _callbacksql = _callbacksql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + _callbacksql = _callbacksql.replace(/@typename@/ig, `'admin'`) return { sql: _sql, diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index f69b43a..b616463 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -399,7 +399,7 @@ // floor 缁勪欢鐨勫眰绾� // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ if (component.setting.sync === 'true') { - component.dataName = Utils.getdataName() + component.dataName = 'mk' + component.uuid.slice(-18) let param = this.getDefaultParam(component) _pars.push(param) } else { diff --git a/src/views/design/sidemenu/thdmenuplus/index.jsx b/src/views/design/sidemenu/thdmenuplus/index.jsx index c10da0d..ad47ac4 100644 --- a/src/views/design/sidemenu/thdmenuplus/index.jsx +++ b/src/views/design/sidemenu/thdmenuplus/index.jsx @@ -3,6 +3,7 @@ import { Modal, notification, Col, Card, Tabs, Row, Input, Button } from 'antd' import { PlusOutlined } from '@ant-design/icons' import moment from 'moment' +import md5 from 'md5' import Api from '@/api' import { sysTemps } from '@/utils/option.js' @@ -235,16 +236,15 @@ config.MenuNo = param.MenuNo config.easyCode = '' - let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + let commonId = Utils.getuuid() if (config.interfaces && config.interfaces.length > 0) { config.interfaces = config.interfaces.map(inter => { - uuids[inter.uuid] = this.getuuid() - inter.uuid = uuids[inter.uuid] + inter.uuid = md5(commonId + inter.uuid) return inter }) } - config.components = MenuUtils.resetConfig(config.components, uuids) + config.components = MenuUtils.resetConfig(config.components, commonId) config.enabled = false param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 93dd0b6..ce3e6e5 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -876,7 +876,7 @@ } else { resolve(result) } - }) + }, this.netError) }) } else { resolve({status: true}) @@ -909,7 +909,7 @@ } return Api.getSystemConfig(_param) } - }).then(res => { // 椤甸潰鎸夐挳鍏崇郴淇濆瓨 + }, this.netError).then(res => { // 椤甸潰鎸夐挳鍏崇郴淇濆瓨 if (!res || !res.status) return res this.setState({ @@ -923,7 +923,7 @@ status: true } } - }).then(res => { + }, this.netError).then(res => { this.setState({ menuloading: false }) @@ -944,10 +944,23 @@ duration: 5 }) } - }) + }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } + netError = (error) => { + this.setState({ + menuloading: false + }) + if (!error) { + notification.warning({ + top: 92, + message: '淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滄槸鍚︽甯搞��', + duration: 5 + }) + } + } + getRoleFields = () => { if (sessionStorage.getItem('sysRoles')) return diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index f54144d..96074f4 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -842,16 +842,15 @@ } } } else { - let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + let commonId = Utils.getuuid() if (config.interfaces && config.interfaces.length > 0) { config.interfaces = config.interfaces.map(inter => { - uuids[inter.uuid] = this.getuuid() - inter.uuid = uuids[inter.uuid] + inter.uuid = md5(commonId + inter.uuid) return inter }) } - config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu) + config.components = MenuUtils.resetConfig(config.components, commonId, urlParam.clearMenu) if (config.version !== 2.0) { config.components = this.collectTB(config.components) @@ -1607,14 +1606,14 @@ } resolve(result) - }) + }, this.netError) } else { resolve(res) } } else { resolve(res) } - }) + }, this.netError) } } }).then(res => { // 椤甸潰淇濆瓨 @@ -1652,10 +1651,23 @@ duration: 5 }) } - }) + }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } + netError = (error) => { + this.setState({ + menuloading: false + }) + if (!error) { + notification.warning({ + top: 92, + message: '淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滄槸鍚︽甯搞��', + duration: 5 + }) + } + } + getRoleFields = () => { if (sessionStorage.getItem('sysRoles')) return diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index 36018b0..9a294ce 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -776,15 +776,14 @@ } } } else { - let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧� + let commonId = Utils.getuuid() if (config.interfaces && config.interfaces.length > 0) { config.interfaces = config.interfaces.map(inter => { - uuids[inter.uuid] = this.getuuid() - inter.uuid = uuids[inter.uuid] + inter.uuid = md5(commonId + inter.uuid) return inter }) } - config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu) + config.components = MenuUtils.resetConfig(config.components, commonId, urlParam.clearMenu) if (config.version !== 2.0) { config.components = this.collectTB(config.components) @@ -1374,14 +1373,14 @@ } resolve(result) - }) + }, this.netError) } else { resolve(res) } } else { resolve(res) } - }) + }, this.netError) } } }).then(res => { // 椤甸潰淇濆瓨 @@ -1419,10 +1418,23 @@ duration: 5 }) } - }) + }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } + netError = (error) => { + this.setState({ + menuloading: false + }) + if (!error) { + notification.warning({ + top: 92, + message: '淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滄槸鍚︽甯搞��', + duration: 5 + }) + } + } + getRoleFields = () => { if (sessionStorage.getItem('sysRoles') || sessionStorage.getItem('permFuncField')) return Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index 5a0b0c8..0689387 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -595,7 +595,7 @@ new Promise(resolve => { Api.getSystemConfig(param).then(res => { resolve(res) - }) + }, this.netError) }).then(res => { if (!res || !res.status) return res @@ -629,10 +629,23 @@ duration: 5 }) } - }) + }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } + netError = (error) => { + this.setState({ + menuloading: false + }) + if (!error) { + notification.warning({ + top: 92, + message: '淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滄槸鍚︽甯搞��', + duration: 5 + }) + } + } + getRoleFields = () => { if (sessionStorage.getItem('sysRoles')) return Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { -- Gitblit v1.8.0