From 5733fc7e386a51217ba6d07e272ca8bd95045abc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 一月 2025 10:14:35 +0800 Subject: [PATCH] Merge branch 'develop' --- src/mob/components/navbar/normal-navbar/index.jsx | 2 src/menu/picturecontroller/index.jsx | 3 src/templates/zshare/editTable/index.jsx | 5 src/menu/datasource/verifycard/excelout/index.jsx | 17 src/menu/components/editor/braft-editor/options.jsx | 1 src/tabviews/zshare/normalTable/index.jsx | 2 src/utils/utils-custom.js | 75 +- src/menu/components/card/cardcellcomponent/dragaction/action.jsx | 4 src/menu/picturecontroller/index.scss | 6 src/menu/components/share/actioncomponent/dragaction/index.jsx | 7 src/tabviews/custom/popview/index.jsx | 1 src/menu/components/share/sourcecomponent/inputform/index.scss | 21 src/tabviews/basetable/index.jsx | 6 src/tabviews/home/index.jsx | 2 src/views/billprint/index.jsx | 6 src/menu/components/share/sourcecomponent/index.scss | 20 src/tabviews/commontable/index.jsx | 2 src/assets/css/design.scss | 19 src/tabviews/zshare/actionList/normalbutton/index.jsx | 47 src/views/mobdesign/index.jsx | 79 ++ src/views/menudesign/index.jsx | 58 + src/templates/zshare/verifycard/voucherform/index.jsx | 50 + src/tabviews/custom/components/card/cardcellList/index.jsx | 3 src/menu/components/share/searchcomponent/dragsearch/index.jsx | 7 src/mob/colorsketch/index.jsx | 2 src/menu/components/card/cardcellcomponent/index.jsx | 11 src/menu/components/share/actioncomponent/formconfig.jsx | 13 src/templates/zshare/pasteform/index.jsx | 15 src/templates/zshare/verifycard/uniqueform/index.jsx | 6 src/menu/components/card/cardcomponent/index.jsx | 2 src/menu/pastecontroller/index.jsx | 65 ++ src/tabviews/custom/components/editor/braft-editor/index.scss | 9 src/tabviews/custom/components/chart/antv-X6/index.jsx | 2 src/menu/components/share/actioncomponent/actionform/index.jsx | 16 src/tabviews/custom/index.jsx | 6 src/menu/components/table/base-table/columns/index.jsx | 7 src/views/appmanage/index.jsx | 2 src/menu/debug/index.jsx | 11 src/menu/components/table/normal-table/columns/index.jsx | 12 src/views/appmanage/submutilform/index.jsx | 2 src/menu/components/table/edit-table/columns/index.jsx | 12 src/mob/searchconfig/searchdragelement/index.jsx | 7 package-lock.json | 6 src/assets/css/viewstyle.scss | 23 src/views/login/loginform.jsx | 6 src/menu/components/chart/antv-G6/index.jsx | 2 src/menu/components/share/sourcecomponent/inputform/index.jsx | 133 ++- src/views/appcheck/index.jsx | 2 src/tabviews/custom/components/chart/antv-G6/index.jsx | 2 src/menu/components/card/cardcellcomponent/dragaction/index.jsx | 7 src/assets/css/table.scss | 40 src/mob/components/topbar/normal-navbar/options.jsx | 2 src/views/rolemanage/index.jsx | 2 src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 3 src/views/tabledesign/index.jsx | 135 ++++ src/tabviews/zshare/mutilform/mkColor/index.jsx | 2 src/templates/sharecomponent/columncomponent/index.jsx | 5 src/api/index.js | 3 src/tabviews/custom/components/share/normalTable/index.jsx | 2 src/templates/modalconfig/dragelement/index.jsx | 7 src/menu/sysinterface/index.jsx | 5 src/utils/utils.js | 12 src/index.js | 4 src/views/sso/index.jsx | 12 src/menu/components/card/balcony/index.jsx | 2 src/menu/components/search/main-search/dragsearch/index.jsx | 7 src/mob/components/menubar/normal-menubar/menucomponent/index.jsx | 2 src/views/rolemanage/filtermenu/index.jsx | 1 src/menu/stylecontroller/index.jsx | 5 src/views/pcdesign/index.jsx | 67 ++ src/templates/zshare/verifycard/index.jsx | 18 src/views/syscheck/index.jsx | 532 ++++++++++++++++ src/menu/components/share/sourcecomponent/index.jsx | 21 src/mob/components/formdragelement/index.jsx | 7 src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx | 7 src/menu/components/share/actioncomponent/index.jsx | 5 src/menu/components/card/cardsimplecomponent/index.jsx | 2 /dev/null | 13 src/templates/sharecomponent/actioncomponent/dragaction/index.jsx | 6 src/menu/components/share/copycomponent/index.jsx | 7 src/components/pasteboard/index.jsx | 15 src/utils/option.js | 20 src/views/login/index.jsx | 14 83 files changed, 1,366 insertions(+), 443 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e3b8fd..832b343 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5508,9 +5508,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001643", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", - "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==" + "version": "1.0.30001690", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz", + "integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==" }, "canvg": { "version": "3.0.10", diff --git a/src/api/index.js b/src/api/index.js index b76ef61..426e70a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -15,7 +15,8 @@ window.GLOB.$error = false let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' -let lang = sessionStorage.getItem('lang') !== 'zh-CN' ? sessionStorage.getItem('lang') : '' +let lang = sessionStorage.getItem('lang') || 'zh-CN' +lang = lang !== 'zh-CN' ? lang : '' let db = `mkdb${service + lang}` if (window.indexedDB) { diff --git a/src/assets/css/design.scss b/src/assets/css/design.scss index c252031..ceaad14 100644 --- a/src/assets/css/design.scss +++ b/src/assets/css/design.scss @@ -77,6 +77,25 @@ } } +// 鑷畾涔夋粴鍔ㄦ牱寮� +.mk-scrollbar { + overflow-y: auto; +} +.mk-scrollbar::-webkit-scrollbar { + width: 7px; +} +.mk-scrollbar::-webkit-scrollbar-thumb { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); + background: rgba(0, 0, 0, 0.13); + border-radius: 5px; +} +.mk-scrollbar::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + border-radius: 3px; +} + .ant-modal { .ant-radio-group { white-space: nowrap; diff --git a/src/assets/css/table.scss b/src/assets/css/table.scss index 4ba1965..ff79fc5 100644 --- a/src/assets/css/table.scss +++ b/src/assets/css/table.scss @@ -316,34 +316,34 @@ // geekblue .background.geekblue-1 { - @include tableBackground(#f0f5ff); + @include tableBackground(#f0f6ff); } .background.geekblue-2 { - @include tableBackground(#d6e4ff); + @include tableBackground(#dee9ff); } .background.geekblue-3 { - @include tableBackground(#adc6ff); + @include tableBackground(#b5ccff); } .background.geekblue-4 { - @include tableBackground(#85a5ff); + @include tableBackground(#8cadff); } .background.geekblue-5 { - @include tableBackground(#597ef7); + @include tableBackground(#638aff); } .background.geekblue-6 { - @include tableBackground(#2f54eb, #ffffff); + @include tableBackground(#3860f4, #ffffff); } .background.geekblue-7 { - @include tableBackground(#1d39c4, #ffffff); + @include tableBackground(#2544cf, #ffffff); } .background.geekblue-8 { - @include tableBackground(#10239e, #ffffff); + @include tableBackground(#162ca8, #ffffff); } .background.geekblue-9 { - @include tableBackground(#061178, #ffffff); + @include tableBackground(#0a1882, #ffffff); } .background.geekblue-10 { - @include tableBackground(#030852, #ffffff); + @include tableBackground(#060e5c, #ffffff); } // purple @@ -740,34 +740,34 @@ // geekblue .font.geekblue-1 { - color: #f0f5ff; + color: #f0f6ff; } .font.geekblue-2 { - color: #d6e4ff; + color: #dee9ff; } .font.geekblue-3 { - color: #adc6ff; + color: #b5ccff; } .font.geekblue-4 { - color: #85a5ff; + color: #8cadff; } .font.geekblue-5 { - color: #597ef7; + color: #638aff; } .font.geekblue-6 { - color: #2f54eb; + color: #3860f4; } .font.geekblue-7 { - color: #1d39c4; + color: #2544cf; } .font.geekblue-8 { - color: #10239e; + color: #162ca8; } .font.geekblue-9 { - color: #061178; + color: #0a1882; } .font.geekblue-10 { - color: #030852; + color: #060e5c; } // purple diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index ceedbf9..2c30c62 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -406,14 +406,23 @@ @include viewstyle(#e6fffb, #b5f5ec, #87e8de, #5cdbd3, #36cfc9, #13c2c2); } +// body[class*='mk-blue-purple-'] { +// --mk-sys-color: #2f54eb; +// --mk-sys-color1: #f0f5ff; +// --mk-sys-color2: #d6e4ff; +// --mk-sys-color3: #adc6ff; +// --mk-sys-color4: #85a5ff; +// --mk-sys-color5: #597ef7; +// @include viewstyle(#f0f5ff, #d6e4ff, #adc6ff, #85a5ff, #597ef7, #2f54eb); +// } body[class*='mk-blue-purple-'] { - --mk-sys-color: #2f54eb; - --mk-sys-color1: #f0f5ff; - --mk-sys-color2: #d6e4ff; - --mk-sys-color3: #adc6ff; - --mk-sys-color4: #85a5ff; - --mk-sys-color5: #597ef7; - @include viewstyle(#f0f5ff, #d6e4ff, #adc6ff, #85a5ff, #597ef7, #2f54eb); + --mk-sys-color: #3860f4; + --mk-sys-color1: #f0f6ff; + --mk-sys-color2: #dee9ff; + --mk-sys-color3: #b5ccff; + --mk-sys-color4: #8cadff; + --mk-sys-color5: #638aff; + @include viewstyle(#f0f6ff, #dee9ff, #b5ccff, #8cadff, #638aff, #3860f4); } body[class*='mk-purple-'] { diff --git a/src/components/Image/index.jsx b/src/components/Image/index.jsx deleted file mode 100644 index 508c7be..0000000 --- a/src/components/Image/index.jsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, {Component} from 'react' -import './index.scss' - -class ImageWrap extends Component { - componentDidMount () { - let Img = new Image() - Img.src = this.props.url - - if (!this.ImageWrapDom) return - - if (Img.complete) { - this.setSize(Img.width, Img.height) - } else { - Img.onload = () => { - this.setSize(Img.width, Img.height) - } - } - } - - shouldComponentUpdate () { - return false - } - - setSize = (width, height) => { - if (!this.ImageWrapDom) return - const { clientWidth, clientHeight } = this.ImageWrapDom - - if (!clientWidth || !clientHeight || !width || !height) return - - let ratio = (width / height) / (clientWidth / clientHeight) - - if (ratio > 1.5) { - let _height = Math.floor(height * (clientWidth / width)) - this.ImageDom.style.height = 'auto' - this.ImageDom.style.top = ((clientHeight - _height) / 2) + 'px' - } else if (ratio > 1 && ratio < 1.5) { - let _width = Math.floor(width / (height / clientHeight)) - this.ImageDom.style.width = _width + 'px' - this.ImageDom.style.left = '-' + ((_width - clientWidth) / 2) + 'px' - } else if (ratio < 1) { - let _height = Math.floor(height / (width / clientWidth)) - this.ImageDom.style.height = _height + 'px' - this.ImageDom.style.top = '-' + ((_height - clientHeight) / 2) + 'px' - } - } - - render() { - return ( - <div className="mk_image-wrap" ref={dom => { this.ImageWrapDom = dom }}> - <img src={this.props.url} ref={dom => { this.ImageDom = dom }} alt=""/> - </div> - ) - } -} - -export default ImageWrap \ No newline at end of file diff --git a/src/components/Image/index.scss b/src/components/Image/index.scss deleted file mode 100644 index 3e5b646..0000000 --- a/src/components/Image/index.scss +++ /dev/null @@ -1,13 +0,0 @@ -.mk_image-wrap { - display: inline-block; - position: relative; - overflow: hidden; - width: 100%; - height: 100%; - - img { - position: absolute; - width: 100%; - height: 100%; - } -} diff --git a/src/components/pasteboard/index.jsx b/src/components/pasteboard/index.jsx index 66c00c4..d71d82a 100644 --- a/src/components/pasteboard/index.jsx +++ b/src/components/pasteboard/index.jsx @@ -44,21 +44,6 @@ try { _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) - - if (typeof(_config) === 'object' && _config.$srcId) { - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid && _config.$srcId !== srcid) { - notification.warning({ - top: 92, - message: '褰撳墠绯荤粺鏃犳潈闄愪娇鐢ㄦ椤归厤缃紒', - duration: 5 - }) - - _config = '' - } else { - delete _config.$srcId - } - } } catch (e) { // 閫氳繃sql璇彞娣诲姞瀛楁闆� if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int|datetime|date)/ig.test(config)) { diff --git a/src/index.js b/src/index.js index 969f8b0..f91f8c0 100644 --- a/src/index.js +++ b/src/index.js @@ -122,6 +122,10 @@ GLOB.systemType = '' GLOB.upStatus = config.updateStatus + '' !== 'false' + if (config.style_appkey) { + GLOB.style_appkey = config.style_appkey + } + // GLOB.mainSystemApi = 'https://cloud.positecgroup.com/webapi/dostars' GLOB.mainSystemApi = 'https://sso.mk9h.cn/cloud/webapi/dostars' diff --git a/src/menu/components/card/balcony/index.jsx b/src/menu/components/card/balcony/index.jsx index 1410c94..c1bef15 100644 --- a/src/menu/components/card/balcony/index.jsx +++ b/src/menu/components/card/balcony/index.jsx @@ -213,7 +213,7 @@ MKEmitter.emit('cardAddElement', card.uuid, res) } else { res.eleType = 'button' - res.width = typeof(res.width) === 'number' ? res.width : 12 + res.width = res.width || res.width === 0 ? res.width : 12 MKEmitter.emit('cardAddElement', card.uuid, res) } resolve({status: true}) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx index 729095c..c22c252 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx @@ -55,6 +55,10 @@ let btnElement = null let _style = resetStyle(card.style) + if (_style.display === 'none') { + _style.display = 'block' + } + if (card.OpenType === 'form') { if (card.formType === 'switch') { btnElement = (<Switch style={_style} className={card.size === 'large' ? 'ant-switch-large' : ''} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index 1c1b983..6b85d33 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -63,6 +63,9 @@ _style = {...card.style, opacity: isDragging ? 0.3 : 1} _style = resetStyle(_style) } + if (_style.display === 'none') { + _style.display = 'block' + } if (card.eleType === 'picture' && card.maxWidth) { _style.maxWidth = card.maxWidth let left = _style.marginLeft || 'auto' diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx index e55c040..e3c1ff9 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx @@ -56,13 +56,6 @@ copycard.uuid = Utils.getuuid() try { - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } - _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { console.warn('Stringify Failure') diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 89008dd..193be32 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -151,6 +151,9 @@ options = ['margin', 'float'] } else { options.push('width', 'minHeight', 'float') + if (element.OpenType !== 'form') { + options.push('display') + } _style.minHeight = _style.minHeight || '28px' _style.textAlign = _style.textAlign || 'center' } @@ -255,6 +258,10 @@ _card.innerHeight = _card.barHeight + (_card.displayValue === 'true' ? fontSize + 2 : 0) } else if (_card.eleType === 'button') { // 鎷嗗垎style _card.style = fromJS(style).toJS() + + if (_card.OpenType === 'form') { + delete _card.style.display + } if (style.float) { _card.wrapStyle = {textAlign: style.float} @@ -511,6 +518,10 @@ if (cell.OpenType !== 'form') { res.style = {} } + + if (res.style) { + delete res.style.display + } // } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { } else if (res.class !== cell.class || !res.style) { if (res.class) { diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index 54f4ea0..ea2add7 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -400,7 +400,7 @@ if (element.copyType === 'action') { element.eleType = 'button' - element.width = typeof(element.width) === 'number' ? element.width : 12 + element.width = element.width || element.width === 0 ? element.width : 12 } element.uuid = _uuid diff --git a/src/menu/components/card/cardsimplecomponent/index.jsx b/src/menu/components/card/cardsimplecomponent/index.jsx index dce5198..c30754d 100644 --- a/src/menu/components/card/cardsimplecomponent/index.jsx +++ b/src/menu/components/card/cardsimplecomponent/index.jsx @@ -289,7 +289,7 @@ if (element.copyType === 'action') { element.eleType = 'button' - element.width = typeof(element.width) === 'number' ? element.width : 12 + element.width = element.width || element.width === 0 ? element.width : 12 } element.uuid = _uuid diff --git a/src/menu/components/chart/antv-G6/index.jsx b/src/menu/components/chart/antv-G6/index.jsx index 658e69c..1578066 100644 --- a/src/menu/components/chart/antv-G6/index.jsx +++ b/src/menu/components/chart/antv-G6/index.jsx @@ -55,7 +55,7 @@ yellow_green: '#a0d911', green: '#52c41a', cyan: '#13c2c2', - blue_purple: '#2f54eb', + blue_purple: '#3860f4', purple: '#722ed1', magenta: '#eb2f96', grass_green: '#aeb303', diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx index 70910be..72d9018 100644 --- a/src/menu/components/editor/braft-editor/options.jsx +++ b/src/menu/components/editor/braft-editor/options.jsx @@ -150,6 +150,7 @@ {value: 'no-border', label: '鏃犺竟妗�'}, {value: 'bold-border', label: '杈规鍔犵矖'}, {value: 'deep-border', label: '杈规棰滆壊鍔犳繁'}, + {value: 'word-break', label: '寮哄埗鎹㈣'}, ], span: 24 }, diff --git a/src/menu/components/search/main-search/dragsearch/index.jsx b/src/menu/components/search/main-search/dragsearch/index.jsx index 04d5372..f9ca883 100644 --- a/src/menu/components/search/main-search/dragsearch/index.jsx +++ b/src/menu/components/search/main-search/dragsearch/index.jsx @@ -50,13 +50,6 @@ let _val = fromJS(copycard).toJS() try { - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } - _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 6fcaa2f..6b1a7e1 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -495,6 +495,9 @@ shows.push('execSuccess', 'execError', 'tipTitle') } else if (_funcType === 'mkUnsubscribe' || _funcType === 'reAuth') { shows.push('tipTitle') + } else if (_funcType === 'reSystem') { + shows.push('tipTitle', 'Ot') + reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl') } else if (_funcType === 'closetab') { shows.push('refreshTab') } else if (_funcType === 'scan') { @@ -1280,6 +1283,19 @@ delete values.extraParam } + if (values.refreshTab && values.refreshTab.length && ['pop', 'prompt', 'exec'].includes(values.OpenType) && window.GLOB.customMenu) { + let id = values.refreshTab[values.refreshTab.length - 1] + if (id === window.GLOB.customMenu.uuid) { + if (values.execSuccess !== 'never' || (values.syncComponent && values.syncComponent.length)) { + notification.warning({ + top: 92, + message: '鎸夐挳鍒锋柊鑿滃崟涓哄綋鍓嶈彍鍗曟椂锛屾垚鍔熷悗鐨勭粍浠跺埛鏂帮紙鎴栧叧闂爣绛撅級灏嗗け鏁�!', + duration: 5 + }) + } + } + } + resolve(values) } else { reject(err) diff --git a/src/menu/components/share/actioncomponent/dragaction/index.jsx b/src/menu/components/share/actioncomponent/dragaction/index.jsx index a90eb21..f0ba685 100644 --- a/src/menu/components/share/actioncomponent/dragaction/index.jsx +++ b/src/menu/components/share/actioncomponent/dragaction/index.jsx @@ -72,13 +72,6 @@ copycard.uuid = Utils.getuuid() try { - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } - _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { console.warn('Stringify Failure') diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 3b1815b..53fe5e4 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -214,7 +214,8 @@ { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' }, { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' }, { value: 'mkUnsubscribe', text: '娉ㄩ攢璐︽埛' }, - { value: 'reAuth', text: '鍒囨崲绯荤粺锛堟竻绌虹紦瀛�-灏忕▼搴忥級' }, + { value: 'reAuth', text: '鍒囨崲鎺堟潈鐮� / 灏忕▼搴忔竻绌虹紦瀛�' }, + { value: 'reSystem', text: '鍒囨崲绯荤粺' }, { value: 'clearCache', text: '娓呯┖鏈湴閰嶇疆' }, { value: 'copyurl', text: '澶嶅埗閾炬帴鍦板潃' }, { value: 'expPdf', text: '瀵煎嚭PDF' }, @@ -363,6 +364,16 @@ } } + if (card.syncComponents && card.syncComponents[0] && Array.isArray(card.syncComponents[0])) { + card.syncComponents = card.syncComponents.map((item, i) => { + return { + syncComId: item, + label: '', + uuid: 'fixed' + i + } + }) + } + let forms = [ { type: 'select', diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index e71e10d..a754d81 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -461,6 +461,11 @@ } btn.updateTime = moment().format('YYYY-MM-DD HH:mm') + + if (btn.style) { + delete btn.style.display + } + return btn } else { return item diff --git a/src/menu/components/share/copycomponent/index.jsx b/src/menu/components/share/copycomponent/index.jsx index 3cebc71..529ca0c 100644 --- a/src/menu/components/share/copycomponent/index.jsx +++ b/src/menu/components/share/copycomponent/index.jsx @@ -55,13 +55,6 @@ this.transConfig(_val, type) try { - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } - _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { console.warn(e) diff --git a/src/menu/components/share/searchcomponent/dragsearch/index.jsx b/src/menu/components/share/searchcomponent/dragsearch/index.jsx index 3ead8c1..accf640 100644 --- a/src/menu/components/share/searchcomponent/dragsearch/index.jsx +++ b/src/menu/components/share/searchcomponent/dragsearch/index.jsx @@ -44,13 +44,6 @@ let _val = fromJS(copycard).toJS() try { - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } - _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { diff --git a/src/menu/components/share/sourcecomponent/index.jsx b/src/menu/components/share/sourcecomponent/index.jsx index c8f515b..68b42cb 100644 --- a/src/menu/components/share/sourcecomponent/index.jsx +++ b/src/menu/components/share/sourcecomponent/index.jsx @@ -1,8 +1,8 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Radio, Modal } from 'antd' -import { PaperClipOutlined, DeleteOutlined } from '@ant-design/icons' +import { Radio, Modal, message } from 'antd' +import { PaperClipOutlined, DeleteOutlined, CopyOutlined } from '@ant-design/icons' import InputForm from './inputform' import './index.scss' @@ -45,6 +45,18 @@ this.props.onChange('') } + copyUrl = () => { + const { url } = this.state + + let oInput = document.createElement('input') + oInput.value = url + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + } + handleChange = (key) => { this.setState({visible: key}) } @@ -75,11 +87,13 @@ {url && type === 'video' ? <div className="mk-source-item-info"> <PaperClipOutlined /> <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> + <CopyOutlined title="澶嶅埗閾炬帴" onClick={this.copyUrl}/> <DeleteOutlined title="鍒犻櫎鏂囦欢" onClick={this.deleteUrl}/> </div> : null} {url && type !== 'video' && url !== '@icon@' ? <div className="mk-source-item-info picture"> <img src={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt="" /> <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> + <CopyOutlined title="澶嶅埗閾炬帴" onClick={this.copyUrl}/> <DeleteOutlined title="鍒犻櫎鏂囦欢" onClick={this.deleteUrl}/> </div> : null} {url && type !== 'video' && url === '@icon@' ? <div className="mk-source-item-info avatar"> @@ -88,9 +102,10 @@ </div> : null} <Modal visible={!!visible} - width={visible !== 'system' ? 650 : 1000} + width={visible !== 'system' ? 650 : 1200} closable={false} maskClosable={false} + centered={visible === 'system'} okText="纭畾" cancelText="鍙栨秷" onOk={this.popSubmit} diff --git a/src/menu/components/share/sourcecomponent/index.scss b/src/menu/components/share/sourcecomponent/index.scss index 156af96..e1707cf 100644 --- a/src/menu/components/share/sourcecomponent/index.scss +++ b/src/menu/components/share/sourcecomponent/index.scss @@ -18,11 +18,21 @@ cursor: pointer; display: none; } + .anticon-copy { + position: absolute; + top: 3px; + right: 30px; + padding-right: 0px; + color: #26C281; + cursor: pointer; + display: none; + } a { display: inline-block; - width: 100%; + min-width: 60%; + max-width: calc(100% - 80px); padding-left: 22px; - padding-right: 14px; + padding-right: 0px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -50,20 +60,20 @@ height: 32px; line-height: 32px; } - .anticon-delete { + .anticon-delete, .anticon-copy { top: 8px; } } .mk-source-item-info.avatar { display: flex; top: 0px; - .anticon-delete { + .anticon-delete, .anticon-copy { top: 8px; } } .mk-source-item-info:hover { background-color: #e6f7ff; - .anticon-delete { + .anticon-delete, .anticon-copy { display: inline-block; } } diff --git a/src/menu/components/share/sourcecomponent/inputform/index.jsx b/src/menu/components/share/sourcecomponent/inputform/index.jsx index 0a06300..4d4a477 100644 --- a/src/menu/components/share/sourcecomponent/inputform/index.jsx +++ b/src/menu/components/share/sourcecomponent/inputform/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Input, Form, Row, Col, Pagination, Empty, Button, Modal, notification } from 'antd' +import { Input, Form, Row, Col, Empty, Button, Modal, notification } from 'antd' import { PlusOutlined } from '@ant-design/icons' import Api from '@/api' @@ -13,7 +13,6 @@ const { Search } = Input const FileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) const Video = asyncComponent(() => import('@/menu/picturecontroller/video')) -const Image = asyncComponent(() => import('@/components/Image')) const EditForm = asyncComponent(() => import('@/menu/picturecontroller/editform')) class PopSource extends Component { @@ -23,12 +22,9 @@ state = { url: '', - originlist: [], list: [], - pagelist: [], + icons: [], searchKey: '', - pageSize: 12, - pageIndex: 1, selectId: '', editvisible: false, card: null @@ -88,28 +84,40 @@ } init = (originlist) => { - let list = originlist - let pagelist = list.filter((item, index) => index < this.state.pageSize) + const { type } = this.props + this.setState({list: originlist, icons: window.GLOB.sIcons || [], url: '', searchKey: ''}) - this.setState({originlist, list, url: '', searchKey: '', pageIndex: 1, pagelist}) - } + if (type !== 'video' && !window.GLOB.sIcons && sessionStorage.getItem('getIcons') !== 'fail') { + fetch(window.GLOB.baseurl + 'Content/static/data.json') + .then(response => response.json()) + .catch(() => { + sessionStorage.setItem('getIcons', 'fail') + }) + .then(res => { + if (res && res.list) { + let icons = [] + res.list.forEach(item => { + if (!item.url) return - changeSearch = () => { - const { originlist, pageSize, searchKey } = this.state - let list = originlist.filter(item => item.remark.indexOf(searchKey) > -1) - let pagelist = list.filter((item, index) => index < pageSize) + icons.push({ + linkurl: window.GLOB.baseurl + 'Content/static/' + item.url, + remark: item.remark || '', + id: Utils.getuuid() + }) + }) - this.setState({list, pagelist, pageIndex: 1}) + window.GLOB.sIcons = icons + + this.setState({icons}) + } else { + sessionStorage.setItem('getIcons', 'fail') + } + }) + } } changeValue = (e) => { this.setState({url: e.target.value}) - } - - changeSize = (page) => { - const { list, pageSize } = this.state - let pagelist = list.filter((item, index) => index < pageSize * page && index >= pageSize * (page - 1)) - this.setState({pageIndex: page, pagelist}) } changeFile = (val) => { @@ -117,8 +125,15 @@ } selectItem = (item) => { + const { type } = this.props + const { icons } = this.state + if (item.linkurl) { - this.setState({url: item.linkurl, selectId: item.id}) + if (type !== 'video' && icons.findIndex(n => n.id === item.id) > -1) { + this.setState({url: item.linkurl.replace(window.GLOB.baseurl, '@mywebsite@/'), selectId: item.id}) + } else { + this.setState({url: item.linkurl, selectId: item.id}) + } } } @@ -170,43 +185,65 @@ render () { const { type, keyword } = this.props - const { list, url, pagelist, searchKey, pageIndex, pageSize, selectId, editvisible, card } = this.state + const { list, icons, url, searchKey, selectId, editvisible, card } = this.state - return ( - <div className="mk-source-pop-wrap"> - {keyword === 'input' ? <Form.Item label="鍦板潃" help="鍙娇鐢ˊmywebsite@浠f浛鍩熷悕锛堝惈铏氭嫙鐩綍锛夛紝濡傦細@mywebsite@/Content/images/xxx.jpg" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> + if (keyword === 'input') { + return <div className="mk-source-pop-wrap"> + <Form.Item label="鍦板潃" help="鍙娇鐢ˊmywebsite@浠f浛鍩熷悕锛堝惈铏氭嫙鐩綍锛夛紝濡傦細@mywebsite@/Content/images/xxx.jpg" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> <TextArea id="source-input" value={url} rows={4} onChange={this.changeValue}/> - </Form.Item> : null} - {keyword === 'upload' ? <Form.Item label="涓婁紶" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> + </Form.Item> + </div> + } else if (keyword === 'upload') { + return <div className="mk-source-pop-wrap"> + <Form.Item label="涓婁紶" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={{xs: { span: 24 }, sm: { span: 20 }}}> <FileUpload config={{ initval: '', suffix: type === 'video' ? '.mp4,.webm,.ogg' : '.jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp,.ico', maxfile: 1, fileType: type === 'video' ? 'text' : 'picture' }} onChange={this.changeFile} /> - </Form.Item> : null} - {keyword === 'system' ? - <Search value={searchKey} placeholder="" onChange={(e) => this.setState({searchKey: e.target.value})} onSearch={this.changeSearch} enterButton/> : null} - {keyword === 'system' ? <Button className="picture-plus mk-green" onClick={() => this.handleSource({typecharone: type})}> + </Form.Item> + </div> + } + + let pagelist = list + let iconlist = icons + + if (searchKey) { + pagelist = list.filter(item => item.remark && item.remark.indexOf(searchKey) > -1) + iconlist = icons.filter(item => item.remark && item.remark.indexOf(searchKey) > -1) + } + + return ( + <div className="mk-source-pop-wrap"> + <Search value={searchKey} placeholder="" onChange={(e) => this.setState({searchKey: e.target.value})}/> + <Button className="picture-plus mk-green" onClick={() => this.handleSource({typecharone: type})}> <PlusOutlined /> 娣诲姞 - </Button> : null} - {keyword === 'system' && list.length ? - <Row gutter={16} style={{minHeight: '250px'}}> - {pagelist.map(item => ( - <Col span={4} key={item.id}> - <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> - <div className="image-video-box-body"> - {type !== 'video' ? <Image url={item.linkurl} /> : null} - {type === 'video' ? <Video value={item.linkurl} /> : null} - </div> + </Button> + <Row gutter={16} className="mk-scrollbar"> + {pagelist.map(item => ( + <Col span={3} key={item.id}> + <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> + <div className="image-video-box-body"> + {type !== 'video' ? <img src={item.linkurl} alt=""/> : <Video value={item.linkurl} />} </div> - </Col> - ))} - </Row> : null} - {keyword === 'system' && list.length === 0 ? <Empty description={null}/> : null} - {keyword === 'system' && list.length > pageSize ? <Pagination size="small" current={pageIndex} pageSize={pageSize} onChange={this.changeSize} total={list.length} /> : null} + </div> + </Col> + ))} + {iconlist.length ? <div className="static-source">闈欐�佽祫婧�</div> : null} + {iconlist.map(item => ( + <Col span={3} key={item.id}> + <div className={'image-video-box' + (selectId === item.id ? ' active' : '')} onClick={() => this.selectItem(item)}> + <div className="image-video-box-body"> + <img src={item.linkurl} alt=""/> + </div> + </div> + </Col> + ))} + {!pagelist.length && !iconlist.length ? <Empty description={null}/> : null} + </Row> <Modal - title={'鏂板缓'} + title="鏂板缓" wrapClassName="picture-edit-model" visible={editvisible} width={600} diff --git a/src/menu/components/share/sourcecomponent/inputform/index.scss b/src/menu/components/share/sourcecomponent/inputform/index.scss index fc5b77f..cf04bb0 100644 --- a/src/menu/components/share/sourcecomponent/inputform/index.scss +++ b/src/menu/components/share/sourcecomponent/inputform/index.scss @@ -20,6 +20,12 @@ .video-react-control-bar { display: none; } + img { + width: 100%; + height: 100%; + object-fit: contain; + object-position: center; + } } .image-video-box-body::after { content: ''; @@ -54,6 +60,21 @@ margin-top: 5px; word-break: break-all; } + + .mk-scrollbar { + padding: 5px 0px; + min-height: 300px; + max-height: calc(100vh - 250px); + clear: both; + + .static-source { + clear: both; + padding-left: 10px; + color: rgba(0, 0, 0, 0.85); + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + margin-bottom: 10px; + } + } } .picture-edit-model { .ant-modal { diff --git a/src/menu/components/table/base-table/columns/index.jsx b/src/menu/components/table/base-table/columns/index.jsx index b824871..508f594 100644 --- a/src/menu/components/table/base-table/columns/index.jsx +++ b/src/menu/components/table/base-table/columns/index.jsx @@ -391,7 +391,7 @@ if (!cell.eleType) { if (cell.copyType === 'action') { cell.eleType = 'button' - cell.width = typeof(cell.width) === 'number' ? cell.width : 12 + cell.width = cell.width || cell.width === 0 ? cell.width : 12 } else { cell.eleType = 'text' } @@ -547,11 +547,6 @@ let val = { copyType: 'cols', cols: columns.filter(col => !col.origin) - } - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index e0e95cc..16de3eb 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -47,11 +47,6 @@ cols: [column] } - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid - } - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() @@ -386,7 +381,7 @@ if (!cell.eleType) { if (cell.copyType === 'action') { cell.eleType = 'button' - cell.width = typeof(cell.width) === 'number' ? cell.width : 12 + cell.width = cell.width || cell.width === 0 ? cell.width : 12 } else { cell.eleType = 'text' } @@ -551,11 +546,6 @@ let val = { copyType: 'editcols', cols: columns.filter(col => !col.origin) - } - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index bed9a9d..f30dc30 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -47,11 +47,6 @@ cols: [column] } - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid - } - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() @@ -381,7 +376,7 @@ if (!cell.eleType) { if (cell.copyType === 'action') { cell.eleType = 'button' - cell.width = typeof(cell.width) === 'number' ? cell.width : 12 + cell.width = cell.width || cell.width === 0 ? cell.width : 12 } else { cell.eleType = 'text' } @@ -516,11 +511,6 @@ let val = { copyType: 'cols', cols: columns.filter(col => !col.origin) - } - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid } oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) diff --git a/src/menu/datasource/verifycard/excelout/index.jsx b/src/menu/datasource/verifycard/excelout/index.jsx index a1fe536..7c90483 100644 --- a/src/menu/datasource/verifycard/excelout/index.jsx +++ b/src/menu/datasource/verifycard/excelout/index.jsx @@ -23,6 +23,9 @@ } let columns = [{ + Column: 'tb', + Text: '琛ㄥ悕' + }, { Column: 'label', Text: '鍚嶇О' }, { @@ -37,6 +40,11 @@ let _header = [] let _topRow = {} let colwidth = [] + let tbName = setting.tableName || '' + + if (window.GLOB.externalDatabase !== null) { + tbName = tbName.replace(/@db@/ig, window.GLOB.externalDatabase) + } columns.forEach(col => { _header.push(col.Column) @@ -50,8 +58,11 @@ let _row = {} columns.forEach((col) => { - let val = item[col.Column] - _row[col.Column] = val + if (col.Column === 'tb') { + _row[col.Column] = tbName + } else { + _row[col.Column] = item[col.Column] + } }) table.push(_row) @@ -65,7 +76,7 @@ const wb = XLSX.utils.book_new() XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') - XLSX.writeFile(wb, `${setting.tableName || ''}${moment().format('YYYYMMDDHHmmss')}.xlsx`) + XLSX.writeFile(wb, `${tbName}${moment().format('YYYYMMDDHHmmss')}.xlsx`) } render() { diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index aa75c46..2df2119 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -1170,13 +1170,13 @@ arr.push(_key) if (_key === 'bid') { - _val = BID + _val = `'${BID}'` } else { _val = `@${_field}` } if (_key === 'bid') { - _val2 = `' + ${BID} + '` + _val2 = BID } else { _val2 = `' + @${_field} + '` } @@ -1244,7 +1244,7 @@ _sql += ` /* 鍒涘缓鍑瘉 */ exec s_BVoucher_Create - @Bill ='0', + @Bill = @${_voucher.linkField}, @BVoucherType ='${_voucher.BVoucherType}', @VoucherTypeOne ='${_voucher.VoucherTypeOne}', @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', @@ -2069,6 +2069,11 @@ { reg: /@datam@/ig, value: `''` }, ] + let process = this.props.config.process === 'true' + if (process) { + regs.push({ reg: /@works_flow_code@/ig, value: `'1949-10-01 15:00:00'` }) + } + let sql = this.formatDataSource(item, regs) return sql diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index b9b8937..51b273d 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -5,6 +5,7 @@ import { SnippetsOutlined } from '@ant-design/icons' import md5 from 'md5' +import Utils from '@/utils/utils.js' import MenuUtils from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' // import './index.scss' @@ -177,11 +178,23 @@ btn.anchors = this.modules[id] || this.modules[_id] || null } if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { + if (btn.syncComponents[0] && Array.isArray(btn.syncComponents[0])) { // 鍏煎闂鏁版嵁 + btn.syncComponents = btn.syncComponents.map((item, i) => { + return { + syncComId: item, + label: '', + uuid: 'fixed' + i + } + }) + } + btn.syncComponents = btn.syncComponents.map(m => { let id = m.syncComId[m.syncComId.length - 1] let _id = md5(commonId + id) - return this.modules[id] || this.modules[_id] || null + m.syncComId = this.modules[id] || this.modules[_id] || null + + return m.syncComId ? m : null }) btn.syncComponents = btn.syncComponents.filter(Boolean) @@ -279,7 +292,7 @@ } this.pasteFormRef.handleConfirm().then(res => { - if (!res.copyType) { + if (!res.copyType || (res.copyType === 'components' && this.props.vType !== res.type)) { notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', @@ -295,6 +308,54 @@ let menu = fromJS(window.GLOB.customMenu).toJS() + if (res.copyType === 'components') { + let commonId = Utils.getuuid() + + res.interfaces = res.interfaces.map(inter => { + inter.uuid = md5(commonId + inter.uuid) + return inter + }) + + res.components = MenuUtils.resetConfig(res.components, commonId, true) + + if (menu.components.length) { + if ( + menu.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 && + res.components.findIndex(m => m.type === 'search' || (m.type === 'topbar' && m.wrap.type !== 'navbar')) > -1 + ) { + notification.warning({ + top: 92, + message: '鎼滅储鏉′欢涓嶅彲閲嶅娣诲姞锛�', + duration: 5 + }) + return + } + if ( + menu.components.findIndex(m => m.type === 'topbar') > -1 && + res.components.findIndex(m => m.type === 'topbar') > -1 + ) { + notification.warning({ + top: 92, + message: '瀵艰埅鏍忎笉鍙噸澶嶆坊鍔狅紒', + duration: 5 + }) + return + } + } + + this.setState({visible: false}) + + this.props.insert(res) + + notification.success({ + top: 92, + message: '绮樿创鎴愬姛锛�', + duration: 2 + }) + + return + } + if (!options.includes(res.copyType)) { if (type && types[res.copyType]) { notification.warning({ diff --git a/src/menu/picturecontroller/index.jsx b/src/menu/picturecontroller/index.jsx index a8633f1..cee337b 100644 --- a/src/menu/picturecontroller/index.jsx +++ b/src/menu/picturecontroller/index.jsx @@ -16,7 +16,6 @@ const EditForm = asyncComponent(() => import('./editform')) const Video = asyncComponent(() => import('./video')) -const Image = asyncComponent(() => import('@/components/Image')) class SourceController extends Component { state = { @@ -295,7 +294,7 @@ <Col span={4} key={item.id}> <div className="image-video-box"> <div className="image-video-box-body"> - <Image url={item.linkurl.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} /> + <img src={item.linkurl.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt=""/> </div> <div className="image-video-control"> <CopyOutlined onClick={() => this.copySource(item)}/> diff --git a/src/menu/picturecontroller/index.scss b/src/menu/picturecontroller/index.scss index d143734..a8d3572 100644 --- a/src/menu/picturecontroller/index.scss +++ b/src/menu/picturecontroller/index.scss @@ -23,6 +23,12 @@ .video-react-control-bar { display: none; } + img { + width: 100%; + height: 100%; + object-fit: contain; + object-position: center; + } } .image-video-control { position: absolute; diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index 59dabec..71a5517 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -1103,8 +1103,9 @@ labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.display || 'block'} onChange={(e) => this.changeNormalStyle(e.target.value, 'display')}> - <Radio value="block">鍧楃骇鍏冪礌</Radio> - <Radio value="inline-block">琛屽唴鍧楀厓绱�</Radio> + <Radio value="block">鏁磋</Radio> + <Radio value="inline-block">鑷�傚簲</Radio> + <Radio value="none">涓嶆樉绀�</Radio> </Radio.Group> </Form.Item> </Col> diff --git a/src/menu/sysinterface/index.jsx b/src/menu/sysinterface/index.jsx index 3c61833..5952f9c 100644 --- a/src/menu/sysinterface/index.jsx +++ b/src/menu/sysinterface/index.jsx @@ -74,11 +74,6 @@ copy = (item) => { let msg = { key: 'interface', type: 'line', data: item } - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - msg.$srcId = srcid - } - try { msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) } catch (e) { diff --git a/src/mob/colorsketch/index.jsx b/src/mob/colorsketch/index.jsx index 2260cdd..9b8dcb1 100644 --- a/src/mob/colorsketch/index.jsx +++ b/src/mob/colorsketch/index.jsx @@ -8,7 +8,7 @@ import './index.scss' const presetColors = [ - '#1890ff', '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#2f54eb', '#722ed1', + '#1890ff', '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#3860f4', '#722ed1', '#eb2f96', '#aeb303', '#c32539', '#1d3661', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', '#adc6ff', '#EBE9E9', '#d9d9d9', 'rgba(0, 0, 0, 0.65)', 'rgba(0, 0, 0, 0.85)', '#000000', '#ffffff', 'transparent' ] diff --git a/src/mob/components/formdragelement/index.jsx b/src/mob/components/formdragelement/index.jsx index d357279..e28f1f9 100644 --- a/src/mob/components/formdragelement/index.jsx +++ b/src/mob/components/formdragelement/index.jsx @@ -64,13 +64,6 @@ _card.$copy = true - delete val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid - } - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() diff --git a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx index 2382fb8..28acf2c 100644 --- a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx +++ b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx @@ -146,7 +146,7 @@ }} type={card.setting.icon || 'cloud'}/> {card.setting.tip ? <sup className="am-badge-text"></sup> : null} </div> : <div className="menu-sign"> - <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth, borderRadius: card.setting.borderRadius || '15%'}} src={card.setting.url} alt=""/> + <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth, borderRadius: card.setting.borderRadius || '15%'}} src={card.setting.url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt=""/> {card.setting.tip ? <sup className="am-badge-text"></sup> : null} </div>} <div className="menu-name" style={{opacity: !card.setting.name ? 0 : 1}}>{card.setting.name || '鏄庣'}</div> diff --git a/src/mob/components/navbar/normal-navbar/index.jsx b/src/mob/components/navbar/normal-navbar/index.jsx index 48a06f5..beb30d4 100644 --- a/src/mob/components/navbar/normal-navbar/index.jsx +++ b/src/mob/components/navbar/normal-navbar/index.jsx @@ -120,6 +120,8 @@ render() { const { card } = this.state + if (!card.wrap) return null + let _style = {...card.style} _style.height = card.wrap.height diff --git a/src/mob/components/topbar/normal-navbar/options.jsx b/src/mob/components/topbar/normal-navbar/options.jsx index 43cc169..a66aa8b 100644 --- a/src/mob/components/topbar/normal-navbar/options.jsx +++ b/src/mob/components/topbar/normal-navbar/options.jsx @@ -67,7 +67,7 @@ label: '鏍囬', initval: wrap.title || '', // tooltip: '浣跨敤鎼滅储妗嗘椂锛屾爣棰樼敤浜庢悳绱㈡潯浠堕殣钘忔椂锛堝綋鍚敤榛戝悕鍗曪紝鐧诲綍鐢ㄦ埛鏃犳潈闄愭椂锛夋樉绀恒�傛敞锛欯username浠h〃鐢ㄦ埛鍚嶏紝@fullname浠h〃濮撳悕銆�', - tooltip: '娉細@username浠h〃鐢ㄦ埛鍚嶏紝@fullname浠h〃濮撳悕銆�', + tooltip: '娉細@username浠h〃鐢ㄦ埛鍚嶏紝@fullname浠h〃濮撳悕锛孈appname浠h〃搴旂敤鍚嶃��', required: false }, { diff --git a/src/mob/searchconfig/searchdragelement/index.jsx b/src/mob/searchconfig/searchdragelement/index.jsx index cf7e96a..10a535e 100644 --- a/src/mob/searchconfig/searchdragelement/index.jsx +++ b/src/mob/searchconfig/searchdragelement/index.jsx @@ -53,13 +53,6 @@ let val = JSON.parse(JSON.stringify(_card)) val.copyType = 'search' - delete val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid - } - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index c1a63d8..a53fbef 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -179,7 +179,7 @@ let keys = Object.keys(urlparam) config.allSqls.forEach(item => { item.id = md5(window.GLOB.appkey + item.v_id) - if (item.type === 'datasource' || item.type === 'excelOut') { + if (['datasource', 'interface', 'excelOut'].includes(item.type)) { item.urlkeys = keys item.urlparam = urlparam if (config.flow_code) { @@ -372,8 +372,9 @@ Utils.initSearchVal(item) if (urlparam.$searchkey) { + let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig') item.search.forEach(cell => { - if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { + if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { cell.initval = urlparam.$searchval } }) @@ -580,6 +581,7 @@ } } else if (cell.syncComponentId === 'multiComponent') { let ids = cell.syncComponents.map(m => { + if (Array.isArray(m)) return m.pop() || '' return m.syncComId.pop() || '' }) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 463dc0b..b3ccb8d 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -209,7 +209,7 @@ // 瀛楁閫忚鍙婂繀濉爣蹇� config.search = config.search.map(item => { - if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field.toLowerCase()) { + if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field) { item.initval = param.$searchval } return item diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index c550596..6f543bb 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -110,7 +110,7 @@ } if (card.field) { - __param.$searchkey = card.field.toLowerCase() + __param.$searchkey = card.field __param.$searchval = data[card.field] || '' } @@ -736,6 +736,7 @@ } } else { url = data[card.field] || '' + url = url.replace(/@mywebsite@\//ig, window.GLOB.baseurl) } if (url === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� diff --git a/src/tabviews/custom/components/chart/antv-G6/index.jsx b/src/tabviews/custom/components/chart/antv-G6/index.jsx index 5fc57b9..8c166e7 100644 --- a/src/tabviews/custom/components/chart/antv-G6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-G6/index.jsx @@ -23,7 +23,7 @@ yellow_green: '#a0d911', green: '#52c41a', cyan: '#13c2c2', - blue_purple: '#2f54eb', + blue_purple: '#3860f4', purple: '#722ed1', magenta: '#eb2f96', grass_green: '#aeb303', diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx index 96770b5..a1df8cf 100644 --- a/src/tabviews/custom/components/chart/antv-X6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx @@ -344,7 +344,7 @@ yellow_green: '#a0d911', green: '#52c41a', cyan: '#13c2c2', - blue_purple: '#2f54eb', + blue_purple: '#3860f4', purple: '#722ed1', magenta: '#eb2f96', grass_green: '#aeb303', diff --git a/src/tabviews/custom/components/editor/braft-editor/index.scss b/src/tabviews/custom/components/editor/braft-editor/index.scss index ea58f85..e81c223 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.scss +++ b/src/tabviews/custom/components/editor/braft-editor/index.scss @@ -67,6 +67,15 @@ } } } +.custom-braft-editor-box.word-break { + .braft-content { + table { + td, th { + word-break: break-all!important; + } + } + } +} .custom-braft-editor-box.tb-flex { .braft-content { table { diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 25310ed..4bfb15a 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -32,7 +32,7 @@ } if (item.field) { - __param.$searchkey = item.field.toLowerCase() + __param.$searchkey = item.field __param.$searchval = record[item.field] || '' } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 639042b..7e1cae0 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -224,7 +224,7 @@ let keys = Object.keys(urlparam) config.allSqls.forEach(item => { item.id = md5(window.GLOB.appkey + item.v_id) - if (item.type === 'datasource' || item.type === 'excelOut') { + if (['datasource', 'interface', 'excelOut'].includes(item.type)) { item.urlkeys = keys item.urlparam = urlparam if (config.flow_code) { @@ -583,8 +583,9 @@ Utils.initSearchVal(item) if (urlparam.$searchkey) { + let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig') item.search.forEach(cell => { - if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { + if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { cell.initval = urlparam.$searchval } }) @@ -1063,6 +1064,7 @@ } } else if (cell.syncComponentId === 'multiComponent') { let ids = cell.syncComponents.map(m => { + if (Array.isArray(m)) return m.pop() || '' return m.syncComId.pop() || '' }) diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 778c090..261269a 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -755,6 +755,7 @@ } } else if (cell.syncComponentId === 'multiComponent') { let ids = cell.syncComponents.map(m => { + if (Array.isArray(m)) return m.pop() || '' return m.syncComId.pop() || '' }) diff --git a/src/tabviews/home/index.jsx b/src/tabviews/home/index.jsx index 5dafb3f..b26fe42 100644 --- a/src/tabviews/home/index.jsx +++ b/src/tabviews/home/index.jsx @@ -16,7 +16,7 @@ state = { loading: true, - background: sessionStorage.getItem('home_background'), + background: sessionStorage.getItem('home_background') || 'unset', waiting: true, view: '' } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index ed3d7a8..9ddcf4e 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1120,7 +1120,7 @@ } else { let works_flow_countersign = '' let works_flow_sign_values = '' - let works_flow_sign_field = '' + let works_flow_sign_field = 'statuscharone' let works_flow_sign_label = '' let works_begin_branch = '' if (line.approvalMethod === 'countersign' && node.checkIds.length > 1) { @@ -1302,7 +1302,6 @@ getSysDeclareSql = (btn, formdata, data, columns, BID = '') => { const { submitType } = this.state - let datavars = {} // 澹版槑鐨勫彉閲忥紝琛ㄥ崟鍙婃樉绀哄垪 // 闇�瑕佸0鏄庣殑鍙橀噺闆� let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid', 'mk_submit_type'] @@ -1317,7 +1316,6 @@ // 鑾峰彇瀛楁閿�煎 formdata && formdata.forEach(form => { let _key = form.key.toLowerCase() - datavars[_key] = form.value if (!_initvars.includes(_key)) { _initvars.push(_key) @@ -1372,14 +1370,12 @@ // 娣诲姞鏁版嵁涓瓧娈碉紝琛ㄥ崟鍊间紭鍏�(鎸夐挳涓嶉�夎鎴栧琛屾嫾鎺ユ椂璺宠繃) if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { - datavars = {..._data, ...datavars} - const setField = (col) => { if (!col.field) return let _key = col.field.toLowerCase() if (!_initvars.includes(_key)) { - let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : '' + let _val = _data.hasOwnProperty(_key) ? _data[_key] : '' if (col.datatype && /^date/ig.test(col.datatype) && !_val) { _val = '1949-10-01' @@ -2961,6 +2957,7 @@ } let tabId = '' + let menu = null if (btn.refreshTab && btn.refreshTab.length > 0) { tabId = btn.refreshTab[btn.refreshTab.length - 1] } @@ -2969,8 +2966,26 @@ this.clearBackSqlCache() } + if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0 && sign !== '@no_target_menu@') { + let menuId = btn.openmenu.slice(-1)[0] + if (window.GLOB.mkThdMenus.has(menuId)) { + menu = {...window.GLOB.mkThdMenus.get(menuId), param: { $BID: id }} + } else if (btn.MenuID) { + menu = { + MenuID: btn.MenuID, + MenuName: btn.MenuName, + type: btn.tabType, + param: { $BID: id } + } + } + } + if (tabId && btn.$MenuID === tabId) { // 鍒锋柊褰撳墠鑿滃崟鏃讹紝鍋滄鍏朵粬鎿嶄綔 MKEmitter.emit('reloadMenuView', tabId) + + if (menu) { + MKEmitter.emit('modifyTabs', menu, true) + } return } @@ -3026,24 +3041,8 @@ node && node.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'nearest'}) } - if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0 && sign !== '@no_target_menu@') { - let menuId = btn.openmenu.slice(-1)[0] - let menu = null - - if (window.GLOB.mkThdMenus.has(menuId)) { - menu = {...window.GLOB.mkThdMenus.get(menuId), param: { $BID: id }} - } else if (btn.MenuID) { - menu = { - MenuID: btn.MenuID, - MenuName: btn.MenuName, - type: btn.tabType, - param: { $BID: id } - } - } - - if (menu) { - MKEmitter.emit('modifyTabs', menu, true) - } + if (menu) { + MKEmitter.emit('modifyTabs', menu, true) } if (btn.execSuccess === 'popclose' && btn.$tabId) { // 鏍囩鍏抽棴鍒锋柊 diff --git a/src/tabviews/zshare/mutilform/mkColor/index.jsx b/src/tabviews/zshare/mutilform/mkColor/index.jsx index e101e12..30f3cba 100644 --- a/src/tabviews/zshare/mutilform/mkColor/index.jsx +++ b/src/tabviews/zshare/mutilform/mkColor/index.jsx @@ -6,7 +6,7 @@ import './index.scss' const presetColors = [ - '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#2f54eb', '#722ed1', + '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#3860f4', '#722ed1', '#eb2f96', '#595959', '#ffa39e', '#ffbb96', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', '#adc6ff', '#d3adf7', '#ffadd2', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' ] diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 691422b..df592f1 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -349,7 +349,7 @@ } if (item.field) { - __param.$searchkey = item.field.toLowerCase() + __param.$searchkey = item.field __param.$searchval = record[item.field] || '' } diff --git a/src/templates/modalconfig/dragelement/index.jsx b/src/templates/modalconfig/dragelement/index.jsx index 6d6c0c5..830681c 100644 --- a/src/templates/modalconfig/dragelement/index.jsx +++ b/src/templates/modalconfig/dragelement/index.jsx @@ -64,13 +64,6 @@ _card.$copy = true - delete val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid - } - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() diff --git a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx index c0076ff..f32ecfc 100644 --- a/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/dragaction/index.jsx @@ -68,12 +68,6 @@ delete _val.controlField delete _val.controlVal } - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx index e488a3d..b425dba 100644 --- a/src/templates/sharecomponent/columncomponent/index.jsx +++ b/src/templates/sharecomponent/columncomponent/index.jsx @@ -373,11 +373,6 @@ columns: columnlist } - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - val.$srcId = srcid - } - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) document.body.appendChild(oInput) oInput.select() diff --git a/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx b/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx index 3edd6e1..b604984 100644 --- a/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx @@ -52,13 +52,6 @@ let _val = fromJS(copycard).toJS() try { - delete _val.$srcId - - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - _val.$srcId = srcid - } - _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) } catch (e) { diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index c8a9cda..6a19cdb 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -419,11 +419,6 @@ } try { - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid) { - msg.$srcId = srcid - } - msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) } catch (e) { console.warn('Stringify Failure') diff --git a/src/templates/zshare/pasteform/index.jsx b/src/templates/zshare/pasteform/index.jsx index 2a9a5b4..72b17fe 100644 --- a/src/templates/zshare/pasteform/index.jsx +++ b/src/templates/zshare/pasteform/index.jsx @@ -39,21 +39,6 @@ } try { _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) - - if (typeof(_config) === 'object' && _config.$srcId) { - let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') - if (srcid && _config.$srcId !== srcid) { - notification.warning({ - top: 92, - message: '褰撳墠绯荤粺鏃犳潈闄愪娇鐢ㄦ椤归厤缃紒', - duration: 5 - }) - - _config = '' - } else { - delete _config.$srcId - } - } } catch (e) { // 閫氳繃sql璇彞娣诲姞瀛楁闆� if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int|datetime|date)/ig.test(values.config)) { diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 1027840..6846474 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -1357,13 +1357,13 @@ arr.push(_key) if (_key === 'bid') { - _val = BID + _val = `'${BID}'` } else { _val = `@${_field}` } if (_key === 'bid') { - _val2 = `' + ${BID} + '` + _val2 = BID } else { _val2 = `' + @${_field} + '` } @@ -1431,7 +1431,7 @@ _sql += ` /* 鍒涘缓鍑瘉 */ exec s_BVoucher_Create - @Bill ='0', + @Bill = @${_voucher.linkField}, @BVoucherType ='${_voucher.BVoucherType}', @VoucherTypeOne ='${_voucher.VoucherTypeOne}', @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', @@ -2447,12 +2447,12 @@ changeUniques = (uniques) => { const { card } = this.props - const { verify, fields, columnsFields } = this.state + const { verify, unionFields, columnsFields } = this.state let _fields = [] let change = {} if (card.Ot !== 'requiredOnce') { - _fields = fields + _fields = unionFields } else { _fields = columnsFields } @@ -2650,7 +2650,7 @@ /> <EditTable actions={['move']} data={verify.customverifys} columns={customColumns} onChange={(customverifys) => {this.setState({verify: {...verify, customverifys}})}}/> </TabPane> : null} - {verifyInter === 'system' ? <TabPane tab={ + {verifyInter === 'system' && (['form', 'pop'].includes(card.OpenType) || !card.OpenType) ? <TabPane tab={ <span> 鍗曞彿鐢熸垚 {verify.billcodes.length ? <span className="count-tip">{verify.billcodes.length}</span> : null} @@ -2668,7 +2668,7 @@ /> <EditTable actions={['move']} data={verify.billcodes} columns={orderColumns} onChange={(billcodes) => {this.setState({verify: {...verify, billcodes}})}}/> </TabPane> : null} - {verifyInter === 'system' ? <TabPane tab={ + {verifyInter === 'system' && (card.Ot === 'requiredOnce' || (['form', 'pop'].includes(card.OpenType) || !card.OpenType)) ? <TabPane tab={ <span> {card.Ot !== 'requiredOnce' ? '鍞竴鎬ч獙璇�' : '鍚岀被鏁版嵁楠岃瘉'} {verify.uniques.length ? <span className="count-tip">{verify.uniques.length}</span> : null} @@ -2682,11 +2682,11 @@ <EditTable actions={['edit', 'move', 'del', 'status', 'sql']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/> </TabPane> : null} {verifyInter === 'system' ? <TabPane tab={ - <span> + <span title={card.Ot === 'requiredOnce' ? '澶氳鎷兼帴鏃朵笉鍙敤' : ''}> 鍒涘缓鍑瘉 {verify.voucher && verify.voucher.enabled ? <span className="count-tip">1</span> : null} </span> - } key="voucher"> + } key="voucher" disabled={card.Ot === 'requiredOnce'}> <VoucherForm voucher={voucher} columns={columns} diff --git a/src/templates/zshare/verifycard/uniqueform/index.jsx b/src/templates/zshare/verifycard/uniqueform/index.jsx index cb5dced..36bb946 100644 --- a/src/templates/zshare/verifycard/uniqueform/index.jsx +++ b/src/templates/zshare/verifycard/uniqueform/index.jsx @@ -64,11 +64,9 @@ } ] })( - <Select - mode="multiple" - > + <Select mode="multiple"> {fields.map(item => ( - <Select.Option key={item.uuid} value={item.field}>{item.label}</Select.Option> + <Select.Option key={item.uuid} value={item.field}>{`${item.label}锛�${item.field}锛塦}</Select.Option> ))} </Select> )} diff --git a/src/templates/zshare/verifycard/voucherform/index.jsx b/src/templates/zshare/verifycard/voucherform/index.jsx index c3c4b5a..f66fd0b 100644 --- a/src/templates/zshare/verifycard/voucherform/index.jsx +++ b/src/templates/zshare/verifycard/voucherform/index.jsx @@ -1,7 +1,8 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Form, Row, Col, Select, Switch, notification } from 'antd' +import { Form, Row, Col, Select, Switch, notification, Modal } from 'antd' +import { ConsoleSqlOutlined } from '@ant-design/icons' // import './index.scss' class UniqueForm extends Component { @@ -141,6 +142,50 @@ }) } + voucherSql = () => { + let BVoucherType = this.props.form.getFieldValue('BVoucherType') + let VoucherTypeOne = this.props.form.getFieldValue('VoucherTypeOne') + let linkField = this.props.form.getFieldValue('linkField') + + let _detail = this.state.voucherDetail.filter(item => item.ModularDetailCode === VoucherTypeOne)[0] + + if (!_detail) { + notification.warning({ + top: 92, + message: '鍑瘉绫诲瀷鎴栧嚟璇佹爣璇嗕笉瀛樺湪锛�', + duration: 5 + }) + return + } + + let _sql = `/* 鍒涘缓鍑瘉 */ + exec s_BVoucher_Create + @Bill = @${linkField || ''}, + @BVoucherType ='${BVoucherType}', + @VoucherTypeOne ='${VoucherTypeOne}', + @VoucherTypeTwo ='${_detail.VoucherTypeTwo}', + @Type =${_detail.IDefine1}, + @UserID=@UserID@, + @Username=@Username, + @FullName=@FullName, + @BVoucher =@BVoucher OUTPUT , + @FIBVoucherDate =@FIBVoucherDate OUTPUT , + @FiYear =@FiYear OUTPUT , + @ErrorCode =@ErrorCode OUTPUT, + @retmsg=@retmsg OUTPUT + if @ErrorCode!='' + GOTO aaa + ` + + Modal.info({ + title: '', + width: 500, + className: 'sql-example', + icon: null, + content: _sql.split(/\n\s{6}/ig).map((n, index) => <div key={index} dangerouslySetInnerHTML={{ __html: n.replace(/\s/ig, ' ') }} style={{whiteSpace: 'nowrap'}}></div>) + }) + } + render() { const { getFieldDecorator } = this.props.form const { voucherobj } = this.props @@ -255,8 +300,9 @@ </Form.Item> </Col> <Col span={11}> - <Form.Item label={'鏄惁鍚敤'}> + <Form.Item label="鏄惁鍚敤"> <Switch checkedChildren="鍚�" unCheckedChildren="鍋�" checked={voucherobj.enabled} onChange={this.onEnabledChange} /> + {voucherobj.enabled ? <ConsoleSqlOutlined style={{marginLeft: '20px', fontSize: '18px', color: '#1890ff', verticalAlign: 'middle'}} onClick={this.voucherSql}/> : null} </Form.Item> </Col> </Row> diff --git a/src/utils/option.js b/src/utils/option.js index 858aa90..e025897 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -502,16 +502,16 @@ 'blue-8': '#0050b3', 'blue-9': '#003a8c', 'blue-10': '#002766', - 'geekblue-1': '#f0f5ff', - 'geekblue-2': '#d6e4ff', - 'geekblue-3': '#adc6ff', - 'geekblue-4': '#85a5ff', - 'geekblue-5': '#597ef7', - 'geekblue-6': '#2f54eb', - 'geekblue-7': '#1d39c4', - 'geekblue-8': '#10239e', - 'geekblue-9': '#061178', - 'geekblue-10': '#030852', + 'geekblue-1': '#f0f6ff', + 'geekblue-2': '#dee9ff', + 'geekblue-3': '#b5ccff', + 'geekblue-4': '#8cadff', + 'geekblue-5': '#638aff', + 'geekblue-6': '#3860f4', + 'geekblue-7': '#2544cf', + 'geekblue-8': '#162ca8', + 'geekblue-9': '#0a1882', + 'geekblue-10': '#060e5c', 'purple-1': '#f9f0ff', 'purple-2': '#efdbff', 'purple-3': '#d3adf7', diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index db18898..021894d 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -451,11 +451,7 @@ card.elements = card.elements.map(cell => { if (cell.eleType === 'button') { cell.uuid = md5(commonId + cell.uuid) - if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' - } - this.resetBtn(cell, commonId) + this.resetBtn(cell, commonId, clear) } else { cell.uuid = this.getuuid() } @@ -467,11 +463,7 @@ card.backElements = card.backElements.map(cell => { if (cell.eleType === 'button') { cell.uuid = md5(commonId + cell.uuid) - if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' - } - this.resetBtn(cell, commonId) + this.resetBtn(cell, commonId, clear) } else { cell.uuid = this.getuuid() } @@ -491,11 +483,7 @@ item.elements = item.elements.map(cell => { if (cell.eleType === 'button') { cell.uuid = md5(commonId + cell.uuid) - if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' - } - this.resetBtn(cell, commonId) + this.resetBtn(cell, commonId, clear) } else { cell.uuid = this.getuuid() } @@ -528,12 +516,7 @@ cell.uuid = md5(commonId + cell.uuid) if (cell.eleType === 'button') { - if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' - } - - this.resetBtn(cell, commonId) + this.resetBtn(cell, commonId, clear) } return cell @@ -572,11 +555,15 @@ }) if (cell.subButton) { - this.resetBtn(cell.subButton, commonId) + this.resetBtn(cell.subButton, commonId, clear) } return cell }) + } else if (item.type === 'login') { + if (clear) { + item.wrap.linkmenu = '' + } } if (item.btnlog) { @@ -587,12 +574,7 @@ item.action = item.action.map(cell => { cell.uuid = md5(commonId + cell.uuid) - if (clear && cell.pageTemplate === 'linkpage' && cell.linkmenu) { - cell.pageTemplate = '' - cell.linkmenu = '' - } - - this.resetBtn(cell, commonId) + this.resetBtn(cell, commonId, clear) return cell }) @@ -650,7 +632,7 @@ /** * @description 鎸夐挳閲嶇疆 */ - static resetBtn (btn, commonId) { + static resetBtn (btn, commonId, clear = false) { if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) { if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) { btn.modal.fields = btn.modal.fields.map(m => { @@ -659,6 +641,16 @@ }) } } + + if (clear) { + if (btn.pageTemplate === 'linkpage') { + btn.pageTemplate = '' + } + delete btn.linkmenu + delete btn.openmenu + delete btn.refreshTab + } + if (btn.switchTab && btn.switchTab.length > 0) { btn.switchTab = btn.switchTab.map(m => md5(commonId + m)) } @@ -666,6 +658,15 @@ btn.anchors = btn.anchors.map(m => md5(commonId + m)) } if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { + if (btn.syncComponents[0] && Array.isArray(btn.syncComponents[0])) { + btn.syncComponents = btn.syncComponents.map((item, i) => { + return { + syncComId: item, + label: '', + uuid: 'fixed' + i + } + }) + } btn.syncComponents = btn.syncComponents.map(m => { m.syncComId = m.syncComId.map(n => { if (/\$focus/.test(n)) { @@ -3882,7 +3883,7 @@ _sql += ` /* 鍒涘缓鍑瘉 */ exec s_BVoucher_Create - @Bill ='0', + @Bill = @${_voucher.linkField}, @BVoucherType ='${_voucher.BVoucherType}', @VoucherTypeOne ='${_voucher.VoucherTypeOne}', @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', @@ -4077,7 +4078,9 @@ _sql += ` /* 宸ヤ綔娴佸紓甯竤ql */ if @works_flow_error@ != '' - select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa + begin + select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa + end /* 宸ヤ綔娴侀粯璁ql */ insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) @@ -4096,7 +4099,9 @@ _sql += ` /* 宸ヤ綔娴佸紓甯竤ql */ if @works_flow_error@ != '' - select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa + begin + select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa + end if @works_flow_countersign@ = 'Y' begin @@ -5228,7 +5233,9 @@ sql += ` /* 宸ヤ綔娴佸紓甯竤ql */ if @works_flow_error@ != '' - select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa + begin + select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa + end /* 宸ヤ綔娴侀粯璁ql */ insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) @@ -6434,7 +6441,7 @@ filterComponent(config.components, _mainSearch) let keys = sqls.map(item => item.uuid) - if (keys.length > Array.from(new Set(keys)).length && !window.GLOB.syscheck) { + if (keys.length > Array.from(new Set(keys)).length) { if (window.backend) { let m = new Map() let n = new Map() diff --git a/src/utils/utils.js b/src/utils/utils.js index 94e75c9..dde2cfb 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1775,7 +1775,6 @@ let primaryId = param.ID let BID = param.BID || '' let verify = btn.verify || {} - let datavars = {} // 澹版槑鐨勫彉閲忥紝琛ㄥ崟鍙婃樉绀哄垪 let _actionType = null let _callbacksql = '' @@ -1825,7 +1824,6 @@ // 鑾峰彇瀛楁閿�煎 formdata && formdata.forEach(form => { let _key = form.key.toLowerCase() - datavars[_key] = form.value if (!_initvars.includes(_key)) { _initvars.push(_key) @@ -1880,14 +1878,12 @@ // 娣诲姞鏁版嵁涓瓧娈碉紝琛ㄥ崟鍊间紭鍏�(鎸夐挳涓嶉�夎鎴栧琛屾嫾鎺ユ椂璺宠繃) if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { - datavars = {..._data, ...datavars} - const setField = (col) => { if (!col.field) return let _key = col.field.toLowerCase() if (!_initvars.includes(_key)) { - let _val = datavars.hasOwnProperty(_key) ? datavars[_key] : '' + let _val = _data.hasOwnProperty(_key) ? _data[_key] : '' if (col.datatype && /^date/ig.test(col.datatype) && !_val) { _val = '1949-10-01' @@ -2181,13 +2177,13 @@ arr.push(_key) if (_key === 'bid') { - _val = BID + _val = `'${BID}'` } else { _val = `@${_field}` } if (_key === 'bid') { - _val2 = `' + ${BID} + '` + _val2 = BID } else { _val2 = `' + @${_field} + '` } @@ -2255,7 +2251,7 @@ _sql += ` /* 鍒涘缓鍑瘉 */ exec s_BVoucher_Create - @Bill ='${_data[_voucher.linkField.toLowerCase()] || ''}', + @Bill = @${_voucher.linkField}, @BVoucherType ='${_voucher.BVoucherType}', @VoucherTypeOne ='${_voucher.VoucherTypeOne}', @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', diff --git a/src/views/appcheck/index.jsx b/src/views/appcheck/index.jsx index 5e669d2..2e999fe 100644 --- a/src/views/appcheck/index.jsx +++ b/src/views/appcheck/index.jsx @@ -22,7 +22,7 @@ bg_black_style_yellow_green: {name: '榛勭豢鑹�', color: '#a0d911'}, bg_black_style_green: {name: '缁胯壊', color: '#52c41a'}, bg_black_style_cyan: {name: '闈掕壊', color: '#13c2c2'}, - bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#2f54eb'}, + bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#3860f4'}, bg_black_style_purple: {name: '绱壊', color: '#722ed1'}, bg_black_style_magenta: {name: '娲嬬孩鑹�', color: '#eb2f96'}, bg_black_style_grass_green: {name: '鑽夌豢鑹�', color: '#aeb303'}, diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 76ce934..ea9e714 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -32,7 +32,7 @@ bg_black_style_yellow_green: {name: '榛勭豢鑹�', color: '#a0d911'}, bg_black_style_green: {name: '缁胯壊', color: '#52c41a'}, bg_black_style_cyan: {name: '闈掕壊', color: '#13c2c2'}, - bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#2f54eb'}, + bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#3860f4'}, bg_black_style_purple: {name: '绱壊', color: '#722ed1'}, bg_black_style_magenta: {name: '娲嬬孩鑹�', color: '#eb2f96'}, bg_black_style_grass_green: {name: '鑽夌豢鑹�', color: '#aeb303'}, diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index 369b47f..14976ea 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -194,7 +194,7 @@ <Select.Option value="bg_black_style_yellow_green"><span className="color-block" style={{background: '#a0d911'}}></span>榛勭豢鑹诧紙#a0d911锛�</Select.Option> <Select.Option value="bg_black_style_green"><span className="color-block" style={{background: '#52c41a'}}></span>缁胯壊锛�#52c41a锛�</Select.Option> <Select.Option value="bg_black_style_cyan"><span className="color-block" style={{background: '#13c2c2'}}></span>闈掕壊锛�#13c2c2锛�</Select.Option> - <Select.Option value="bg_black_style_blue_purple"><span className="color-block" style={{background: '#2f54eb'}}></span>钃濈传鑹诧紙#2f54eb锛�</Select.Option> + <Select.Option value="bg_black_style_blue_purple"><span className="color-block" style={{background: '#3860f4'}}></span>钃濈传鑹诧紙#3860f4锛�</Select.Option> <Select.Option value="bg_black_style_purple"><span className="color-block" style={{background: '#722ed1'}}></span>绱壊锛�#722ed1锛�</Select.Option> <Select.Option value="bg_black_style_magenta"><span className="color-block" style={{background: '#eb2f96'}}></span>娲嬬孩鑹诧紙#eb2f96锛�</Select.Option> <Select.Option value="bg_black_style_grass_green"><span className="color-block" style={{background: '#aeb303'}}></span>鑽夌豢鑹诧紙#aeb303锛�</Select.Option> diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index f89e307..47cdcbf 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -190,6 +190,10 @@ LText: `select '${window.GLOB.appkey}'`, } + if (window.GLOB.style_appkey) { + _param.style_appkey = window.GLOB.style_appkey + } + _param.userid = result.UserID _param.LoginUID = result.LoginUID _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') @@ -322,7 +326,7 @@ let keys = Object.keys(urlparam) config.allSqls.forEach(item => { item.id = md5(window.GLOB.appkey + item.v_id) - if (item.type === 'datasource' || item.type === 'excelOut') { + if (['datasource', 'interface', 'excelOut'].includes(item.type)) { item.urlkeys = keys item.urlparam = urlparam if (config.flow_code) { diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 362d15f..dce9c22 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -485,7 +485,7 @@ } if (res.query_address !== 'true') { - localStorage.setItem(_addressUrl, 'false') + localStorage.removeItem(_addressUrl) } else { localStorage.setItem(_addressUrl, 'true') this.queryAddress() @@ -558,6 +558,10 @@ appkey: appkey } + if (window.GLOB.style_appkey) { + _param.style_appkey = window.GLOB.style_appkey + } + _param.userid = result.UserID _param.LoginUID = result.LoginUID _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') @@ -628,13 +632,7 @@ localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) - if (res.srcid) { - localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) - } else { - localStorage.removeItem(window.GLOB.sysSign + 'srcId') - } - - sessionStorage.setItem('home_background', res.index_background_color || '') + res.index_background_color && sessionStorage.setItem('home_background', res.index_background_color) let seconds = 0 if (res.sys_datetime) { diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index 0a245cf..55df6ad 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -52,12 +52,6 @@ UNSAFE_componentWillMount () { const { loginWays } = this.props let remember = true - - if (localStorage.getItem(window.location.href.split('#')[0] + 'users')) { // 杩囨浮 - localStorage.setItem(window.GLOB.sysSign + 'users', localStorage.getItem(window.location.href.split('#')[0] + 'users')) - localStorage.setItem(window.GLOB.sysSign + 'remember', localStorage.getItem(window.location.href.split('#')[0] + 'remember')) - localStorage.removeItem(window.location.href.split('#')[0] + 'users') - } if (localStorage.getItem(window.GLOB.sysSign + 'remember') === 'false') { remember = false diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 41ba0b2..29eb9eb 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -4,8 +4,8 @@ import { is, fromJS } from 'immutable' import moment from 'moment' import HTML5Backend from 'react-dnd-html5-backend' -import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' -import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' +import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin, message } from 'antd' +import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' import html2canvas from 'html2canvas' import md5 from 'md5' @@ -1230,7 +1230,16 @@ insert = (item) => { let config = fromJS(this.state.config).toJS() - config.components.push(item) + if (item.copyType === 'components') { + config.components.push(...item.components) + if (!config.interfaces) { + config.interfaces = item.interfaces + } else { + config.interfaces.push(...item.interfaces) + } + } else { + config.components.push(item) + } this.setState({config}) window.GLOB.customMenu = config @@ -1249,6 +1258,44 @@ const { oriConfig, config } = this.state return is(fromJS(oriConfig), fromJS(config)) + } + + copyMenu = () => { + const { config } = this.state + + if (!config.enabled) { + notification.warning({ + top: 92, + message: '鑿滃崟鏈惎鐢紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + } else if (config.components.length === 0) { + notification.warning({ + top: 92, + message: '鏈坊鍔犵粍浠讹紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + } else { + let msg = { copyType: 'components', type: 'admin' } + + msg.components = config.components || [] + msg.interfaces = config.interfaces || [] + + try { + msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) + } catch (e) { + console.warn('Stringify Failure') + msg = '' + } + + let oInput = document.createElement('input') + oInput.value = msg + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + } } updateLogConfig = (config) => { @@ -1306,7 +1353,8 @@ /> {/* 琛ㄥ悕娣诲姞 */} <TableComponent config={config} updatetable={this.updateConfig}/> - <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> + <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> + <Paragraph style={{padding: '0px 0px 0px 18px'}}>鑿滃崟缁勪欢锛�<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> <NormalCss config={config} updateConfig={this.updateConfig}/> </> : null} </Panel> @@ -1333,7 +1381,7 @@ <SysInterface config={config} updateConfig={this.updateConfig}/> <PictureController/> <StyleCombControlButton menu={config} /> - <PasteController insert={this.insert} /> + <PasteController vType="admin" insert={this.insert} /> {config ? <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config.enabled} onChange={this.onEnabledChange} /> : null} <Button type="primary" id="save-config" disabled={!config} className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>淇濆瓨</Button> <Button type="default" disabled={menuloading} onClick={this.closeView}>鍏抽棴</Button> diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index b15aa97..1dbe670 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -4,7 +4,7 @@ import { is, fromJS } from 'immutable' import HTML5Backend from 'react-dnd-html5-backend' import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' -import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' +import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' import moment from 'moment' import md5 from 'md5' @@ -1669,7 +1669,7 @@ let _config = fromJS(config).toJS() let NavBar = null _config.components = _config.components.map(item => { - if (item.type === 'navbar') { + if (item.type === 'navbar' && item.wrap) { NavBar = fromJS(item).toJS() return { type: 'navbar', @@ -1914,7 +1914,7 @@ } else if (item.type === 'group') { check(item.components, level, sign) return - } else if (item.type === 'navbar' && !item.wrap.MenuNo) { + } else if (item.type === 'navbar' && item.wrap && !item.wrap.MenuNo) { error = `瀵艰埅鏍忋��${item.name}銆嬫湭璁剧疆鑿滃崟鍙傛暟锛乣 } else if (item.type === 'topbar') { if (item.wrap.type === 'search' || item.wrap.type === 'searchIcon' || (item.wrap.type === 'navbar' && item.wrap.search === 'true')) { @@ -1988,11 +1988,22 @@ insert = (item) => { let config = fromJS(this.state.config).toJS() - if (item.type === 'topbar' && !config.style.paddingTop) { - config.style.paddingTop = '50px' + if (item.copyType === 'components') { + if (item.components.findIndex(m => m.type === 'topbar') > -1 && !config.style.paddingTop) { + config.style.paddingTop = '50px' + } + config.components.push(...item.components) + if (!config.interfaces) { + config.interfaces = item.interfaces + } else { + config.interfaces.push(...item.interfaces) + } + } else { + if (item.type === 'topbar' && !config.style.paddingTop) { + config.style.paddingTop = '50px' + } + config.components.push(item) } - - config.components.push(item) this.setState({config}) window.GLOB.customMenu = config @@ -2170,6 +2181,53 @@ return is(fromJS(oriConfig), fromJS(config)) } + copyMenu = () => { + const { config } = this.state + + if (!config.enabled) { + notification.warning({ + top: 92, + message: '鑿滃崟鏈惎鐢紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + } else { + let msg = { copyType: 'components', type: 'mob' } + + msg.components = [] + msg.interfaces = config.interfaces || [] + + config.components.forEach(item => { + if (item.type === 'navbar') return + + msg.components.push(item) + }) + + if (msg.components.length === 0) { + notification.warning({ + top: 92, + message: '鏈坊鍔犵粍浠讹紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + return + } + + try { + msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) + } catch (e) { + console.warn('Stringify Failure') + msg = '' + } + + let oInput = document.createElement('input') + oInput.value = msg + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + } + } + updateLogConfig = (config) => { config.open_edition = this.state.config.open_edition || '' @@ -2217,8 +2275,9 @@ <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> {/* 琛ㄥ悕娣诲姞 */} <TableComponent config={config} updatetable={this.updateConfig}/> - <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> - <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>鑿滃崟閾炬帴</Paragraph> + <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> + <Paragraph style={{padding: '0px 0px 0px 23px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>鑿滃崟閾炬帴</Paragraph> + <Paragraph style={{padding: '0px 0px 0px 18px'}}>鑿滃崟缁勪欢锛�<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> <NormalCss config={config} updateConfig={this.updateConfig}/> </> : null} </Panel> @@ -2247,7 +2306,7 @@ {config ? <Debug config={config}/> : null} <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 缁勪欢鍚�</Button> <CreateView resetmenu={this.getAppMenus} /> - <PasteController insert={this.insert} /> + <PasteController vType="mob" insert={this.insert} /> <TableNodes config={config} /> <ViewNodes config={config} MenuId={MenuId}/> <SysInterface config={config} updateConfig={this.updateConfig}/> diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index f4dd5f0..c5fc857 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -4,7 +4,7 @@ import { is, fromJS } from 'immutable' import HTML5Backend from 'react-dnd-html5-backend' import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' -import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' +import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' import moment from 'moment' import md5 from 'md5' @@ -1354,7 +1354,7 @@ let _config = fromJS(config).toJS() let NavBar = null _config.components = _config.components.map(item => { - if (item.type === 'navbar') { + if (item.type === 'navbar' && item.wrap) { NavBar = fromJS(item).toJS() return { type: 'navbar', @@ -1662,7 +1662,16 @@ insert = (item) => { let config = fromJS(this.state.config).toJS() - config.components.push(item) + if (item.copyType === 'components') { + config.components.push(...item.components) + if (!config.interfaces) { + config.interfaces = item.interfaces + } else { + config.interfaces.push(...item.interfaces) + } + } else { + config.components.push(item) + } this.setState({config}) window.GLOB.customMenu = config @@ -1805,6 +1814,53 @@ return is(fromJS(oriConfig), fromJS(config)) } + copyMenu = () => { + const { config } = this.state + + if (!config.enabled) { + notification.warning({ + top: 92, + message: '鑿滃崟鏈惎鐢紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + } else { + let msg = { copyType: 'components', type: 'pc' } + + msg.components = [] + msg.interfaces = config.interfaces || [] + + config.components.forEach(item => { + if (item.type === 'navbar') return + + msg.components.push(item) + }) + + if (msg.components.length === 0) { + notification.warning({ + top: 92, + message: '鏈坊鍔犵粍浠讹紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + return + } + + try { + msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) + } catch (e) { + console.warn('Stringify Failure') + msg = '' + } + + let oInput = document.createElement('input') + oInput.value = msg + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + } + } + updateLogConfig = (config) => { config.open_edition = this.state.config.open_edition || '' @@ -1845,7 +1901,8 @@ <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> {/* 琛ㄥ悕娣诲姞 */} <TableComponent config={config} updatetable={this.updateConfig}/> - <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> + <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> + <Paragraph style={{padding: '0px 0px 0px 18px'}}>鑿滃崟缁勪欢锛�<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> <NormalCss config={config} updateConfig={this.updateConfig}/> </> : null} </Panel> @@ -1874,7 +1931,7 @@ {config ? <Debug config={config}/> : null} <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 缁勪欢鍚�</Button> <CreateView resetmenu={this.getAppMenus} /> - <PasteController insert={this.insert} /> + <PasteController vType="pc" insert={this.insert} /> <TableNodes config={config} /> <ViewNodes config={config} MenuId={MenuId}/> <SysInterface config={config} updateConfig={this.updateConfig}/> diff --git a/src/views/rolemanage/filtermenu/index.jsx b/src/views/rolemanage/filtermenu/index.jsx index 788a7d7..ad6c49f 100644 --- a/src/views/rolemanage/filtermenu/index.jsx +++ b/src/views/rolemanage/filtermenu/index.jsx @@ -495,6 +495,7 @@ <Button className="mk-orange" onClick={this.trigger}>杩囨护鑿滃崟</Button> <Modal title="杩囨护鑿滃崟" + wrapClassName="mk-scroll-modal" visible={visible} width={800} onOk={this.deletemenu} diff --git a/src/views/rolemanage/index.jsx b/src/views/rolemanage/index.jsx index 7484a51..a63b474 100644 --- a/src/views/rolemanage/index.jsx +++ b/src/views/rolemanage/index.jsx @@ -8,6 +8,8 @@ import Api from '@/api' import Utils from '@/utils/utils.js' import asyncComponent from '@/utils/asyncComponent' + +import '@/assets/css/design.scss' import './index.scss' const { confirm } = Modal diff --git a/src/views/sso/index.jsx b/src/views/sso/index.jsx index 4db7c48..bcd4613 100644 --- a/src/views/sso/index.jsx +++ b/src/views/sso/index.jsx @@ -57,6 +57,10 @@ LText: `select '${window.GLOB.appkey}'`, } + if (window.GLOB.style_appkey) { + _param.style_appkey = window.GLOB.style_appkey + } + _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) @@ -103,13 +107,7 @@ localStorage.setItem(window.GLOB.sysSign + 'pwdlevel', level) - if (res.srcid) { - localStorage.setItem(window.GLOB.sysSign + 'srcId', res.srcid) - } else { - localStorage.removeItem(window.GLOB.sysSign + 'srcId') - } - - sessionStorage.setItem('home_background', res.index_background_color || '') + res.index_background_color && sessionStorage.setItem('home_background', res.index_background_color) let seconds = 0 if (res.sys_datetime) { diff --git a/src/views/syscheck/index.jsx b/src/views/syscheck/index.jsx index d1fa395..6095b3a 100644 --- a/src/views/syscheck/index.jsx +++ b/src/views/syscheck/index.jsx @@ -1,13 +1,13 @@ import React, {Component} from 'react' import { fromJS } from 'immutable' import { Spin, notification, Button, Modal } from 'antd' -import moment from 'moment' import { SwapOutlined } from '@ant-design/icons' +import moment from 'moment' +import md5 from 'md5' import Api from '@/api' import Utils from '@/utils/utils.js' import asyncComponent from '@/utils/asyncComponent' -import { getAllSqls } from '@/utils/utils-custom.js' import './index.scss' const Header = asyncComponent(() => import('./header')) @@ -21,19 +21,24 @@ activeMenu: null, remain: 0, lackmenus: [], + lacklinks: [], outmenus: [], backmenus: [], appbackmenus: [], + btnmenus: [], + appbtnmenus: [], unablemenus: [], } sqlmap = null + btnmap = null + allMenus = [] + appMenus = {} // delete _val.controlField 鍒犻櫎鎸夐挳鎺у埗瀛楁 UNSAFE_componentWillMount() { document.body.className = '' - window.GLOB.syscheck = true } componentDidMount() { @@ -59,12 +64,17 @@ remain: 0, menulist: [], lackmenus: [], + lacklinks: [], outmenus: [], backmenus: [], appbackmenus: [], + btnmenus: [], + appbtnmenus: [], unablemenus: [], loading: true }) + + this.allMenus = [] Api.getCloudConfig({func: 's_get_pc_menus', systemType: window.GLOB.sysType, debug: 'Y'}).then(result => { if (result.status) { let menulist = [] @@ -73,6 +83,8 @@ fst.snd_menu.forEach(snd => { if (snd.trd_menu) { snd.trd_menu.forEach(trd => { + this.allMenus.push(trd.MenuID) + if (trd.PageParam) { let pass = false try { @@ -109,6 +121,7 @@ }) } else { this.sqlmap = new Map() + this.btnmap = new Map() let errlist = sessionStorage.getItem('syscheck_main') errlist = errlist ? JSON.parse(errlist) : null @@ -166,13 +179,18 @@ remain: 0, menulist: [], lackmenus: [], + lacklinks: [], outmenus: [], backmenus: [], appbackmenus: [], + btnmenus: [], + appbtnmenus: [], unablemenus: [], loading: true }) + this.allMenus = [] + this.appMenus = {} Api.getCloudConfig(param).then(result => { if (result.status) { let applist = [] @@ -219,7 +237,11 @@ app.status = true app.menus = [] + this.appMenus[app.ID] = [] + result.menus.forEach(m => { + this.appMenus[app.ID].push(m.MenuID) + if (m.menus_rolelist) { try { let pageParam = JSON.parse(window.decodeURIComponent(window.atob(m.menus_rolelist))) @@ -232,6 +254,7 @@ if (m.type === 'navbar') return } delete m.menus_rolelist + m.$pid = app.ID app.menus.push(m) }) @@ -280,6 +303,7 @@ }) } else { this.sqlmap = new Map() + this.btnmap = new Map() let errlist = sessionStorage.getItem('syscheck_app') errlist = errlist ? JSON.parse(errlist) : null @@ -330,7 +354,7 @@ } getMenuParam = (menus) => { - const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus, stop } = this.state + const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus, stop } = this.state let menu = menus.shift() @@ -339,10 +363,18 @@ MenuID: menu.MenuID } + let appType = 'admin' if (menu.kei_no) { param.TypeCharOne = menu.kei_no param.typename = menu.typename param.lang = menu.lang + + appType = 'pc' + if (['pad', 'mob'].includes(menu.typename)) { + appType = 'mob' + } + + this.allMenus = this.appMenus[menu.$pid] || [] } this.setState({ @@ -371,26 +403,63 @@ } else if (!config.enabled) { this.setState({unablemenus: [...unablemenus, menu]}) } else { - let sqls = getAllSqls(config) - let keys = sqls.map(item => item.uuid) + let sqls = [] + let btns = [] + let links = [] - if (keys.length > Array.from(new Set(keys)).length) { - this.setState({backmenus: [...backmenus, menu]}) - } else { - let repeat = false - let premenu = null - sqls.forEach(item => { - if (this.sqlmap.has(item.uuid)) { - window.mkInfo(item) - if (repeat) return - repeat = true - premenu = this.sqlmap.get(item.uuid) - } else { - this.sqlmap.set(item.uuid, menu) - } + this.getAllSqls(config, appType, sqls, btns, links) + + if (links.length) { + links.forEach(item => { + window.mkInfo(menu.pName + '锛�' + item) }) - if (premenu) { - this.setState({appbackmenus: [...appbackmenus, [premenu, menu]]}) + this.setState({lacklinks: [...lacklinks, menu]}) + } + + if (sqls.length) { + let keys = sqls.map(item => item.uuid) + + if (keys.length > Array.from(new Set(keys)).length) { + this.setState({backmenus: [...backmenus, menu]}) + } else { + let repeat = false + let premenu = null + sqls.forEach(item => { + if (this.sqlmap.has(item.uuid)) { + window.mkInfo(item) + if (repeat) return + repeat = true + premenu = this.sqlmap.get(item.uuid) + } else { + this.sqlmap.set(item.uuid, menu) + } + }) + if (premenu) { + this.setState({appbackmenus: [...appbackmenus, [premenu, menu]]}) + } + } + } + + if (btns.length) { + let keys = btns.map(item => item.uuid) + if (keys.length > Array.from(new Set(keys)).length) { + this.setState({btnmenus: [...btnmenus, menu]}) + } else { + let repeat = false + let premenu = null + btns.forEach(item => { + if (this.btnmap.has(item.uuid)) { + window.mkInfo(item) + if (repeat) return + repeat = true + premenu = this.btnmap.get(item.uuid) + } else { + this.btnmap.set(item.uuid, menu) + } + }) + if (premenu) { + this.setState({appbtnmenus: [...appbtnmenus, [premenu, menu]]}) + } } } } @@ -419,12 +488,402 @@ }) } + getAllSqls = (config, appType, sqls, btns, links) => { + let filterComponent = (components, label = '') => { + components.forEach(item => { + item.$menuname = (config.MenuName || '') + label + '-' + (item.name || '') + + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + filterComponent(tab.components, label) + }) + } else if (item.type === 'group') { + filterComponent(item.components, label) + } else { + if (item.wrap && item.setting) { + if (item.wrap.datatype === 'public' || item.wrap.datatype === 'static') { + item.setting.interType = 'other' + } + } + + if (appType === 'mob' && item.type !== 'search' && item.type !== 'topbar' && item.search && item.search.length > 0) { + item.search = [] + } + if (appType !== 'mob' && item.search && item.search.length > 0) { + item.search.forEach(cell => { + if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { + sqls.push({uuid: md5(item.uuid + cell.uuid), type: 'sForm', LText: `${item.$menuname}-${cell.label}锛堟悳绱級`}) + } + }) + } + + if (item.subtype === 'tablecard') { // 鍏煎 + item.type = 'card' + } + + if (item.setting && item.setting.interType === 'system') { + item.setting.$name = item.$menuname || '' + + sqls.push({uuid: item.uuid, type: 'datasource', LText: item.setting.$name}) + } + + item.action && item.action.forEach(cell => { + cell.logLabel = item.$menuname + '-' + cell.label + + btns.push({uuid: cell.uuid, label: cell.logLabel}) + + if (cell.hidden === 'true') return false + + resetButton(item, cell) + }) + + if (item.type === 'table') { + let getCols = (cols) => { + cols.forEach(col => { + if (col.type === 'action') { + col.type = 'custom' + } + if (col.type === 'colspan') { + getCols(col.subcols || []) + } else if (col.type === 'custom') { + col.elements.forEach(cell => { + if (cell.eleType !== 'button') { + resetElement(item, cell) + return + } + + cell.logLabel = item.$menuname + '-' + cell.label + + btns.push({uuid: cell.uuid, label: cell.logLabel}) + + if (cell.hidden === 'true') return + + resetButton(item, cell) + }) + } else if (item.subtype === 'editable' && col.editable === 'true') { + if (col.editType === 'select' && col.resourceType === '1') { + sqls.push({uuid: col.uuid, type: 'tbForm', LText: `${item.$menuname}-${col.label}锛堝垪琛ㄥ崟锛塦}) + } else if (col.editType === 'popSelect') { + if (col.pops) { + col.pops.forEach(n => { + sqls.push({uuid: n.uuid, type: 'popSource', LText: `${item.$menuname}-${col.label}锛堝垪琛ㄥ崟锛塦}) + }) + } else { + sqls.push({uuid: col.uuid, type: 'popSource', LText: `${item.$menuname}-${col.label}锛堝垪琛ㄥ崟锛塦}) + } + } + } + }) + } + + getCols(item.cols) + + if (item.subtype === 'editable' && item.submit.intertype === 'system') { + item.submit.logLabel = item.$menuname + '-鎻愪氦' + + sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', LText: item.submit.logLabel}) + } + } else if (['card', 'carousel', 'timeline'].includes(item.type)) { + item.subcards && item.subcards.forEach(card => { + if (card.setting.click === 'menu' && card.setting.menu) { + if (appType === 'admin') { + if (!Array.isArray(card.setting.menu)) { + links.push(item.$menuname) + } else { + let menuId = card.setting.menu.slice(-1)[0] + if (!this.allMenus.includes(menuId)) { + links.push(item.$menuname) + } + } + } else { + if (typeof(card.setting.menu) !== 'string') { + links.push(item.$menuname) + } else if (!this.allMenus.includes(card.setting.menu)) { + links.push(item.$menuname) + } + } + } else if (card.setting.click === 'menus' && card.menus && card.menus.length > 0) { + if (appType === 'admin') { + card.menus.forEach(m => { + if (!m.MenuID || !this.allMenus.includes(m.MenuID)) { + links.push(item.$menuname) + } + }) + } else { + card.menus.forEach(m => { + if (typeof(m.menu) !== 'string' || !this.allMenus.includes(m.menu)) { + links.push(item.$menuname) + } + }) + } + } + + card.elements && card.elements.forEach(cell => { + if (cell.eleType !== 'button') { + resetElement(item, cell) + return + } + + cell.logLabel = item.$menuname + '-' + cell.label + + btns.push({uuid: cell.uuid, label: cell.logLabel}) + + if (cell.hidden === 'true') return + + resetButton(item, cell) + }) + + if (!card.backElements || card.backElements.length === 0) return + + card.backElements.forEach(cell => { + if (cell.eleType !== 'button') { + resetElement(item, cell) + return + } + + cell.logLabel = item.$menuname + '-' + cell.label + + btns.push({uuid: cell.uuid, label: cell.logLabel}) + + if (cell.hidden === 'true') return + + resetButton(item, cell) + }) + }) + } else if (item.type === 'balcony') { + item.elements.forEach(cell => { + if (cell.eleType !== 'button') { + resetElement(item, cell) + return + } + + cell.logLabel = item.$menuname + '-' + cell.label + + btns.push({uuid: cell.uuid, label: cell.logLabel}) + + if (cell.hidden === 'true') return + + resetButton(item, cell) + }) + } else if (item.type === 'form') { + item.subcards.forEach(group => { + group.subButton.OpenType = 'formSubmit' + group.subButton.uuid = group.uuid + group.subButton.modal = { + fields: group.fields + } + + group.subButton.logLabel = item.$menuname + '-' + group.subButton.label + + btns.push({uuid: group.uuid, label: group.subButton.logLabel}) + + resetButton(item, group.subButton) + }) + } else if (item.type === 'module' && item.subtype === 'invoice') { + if (item.buyer.setting && item.buyer.setting.interType === 'system') { + sqls.push({uuid: item.uuid + 'buyer', type: 'datasource', LText: item.$menuname + '-buyer'}) + } + + if (item.detail.setting && item.detail.setting.interType === 'system') { + sqls.push({uuid: item.uuid + 'detail', type: 'datasource', LText: item.$menuname + '-detail'}) + } + + sqls.push({uuid: item.uuid + item.billSaveBtn.type, type: 'button', LText: item.$menuname + '-' + item.billSaveBtn.label}) + + sqls.push({uuid: item.uuid + item.billOutBtn.type, type: 'button', LText: item.$menuname + '-' + item.billOutBtn.label}) + + sqls.push({uuid: item.uuid + 'billback', type: 'btnCallBack', LText: item.$menuname + '-' + item.billOutBtn.label + '(鍥炶皟)'}) + } else if (item.type === 'menubar') { + item.subMenus.forEach(cell => { + if (cell.setting.type === 'menu') { + if (!this.allMenus.includes(cell.uuid)) { + links.push(item.$menuname + '-' + cell.setting.name) + } + } else if (cell.setting.type === 'linkmenu') { + if (!this.allMenus.includes(cell.setting.linkMenuId)) { + links.push(item.$menuname + '-' + cell.setting.name) + } + } + }) + } else if (item.type === 'login') { + if (!item.wrap.linkmenu || !this.allMenus.includes(item.wrap.linkmenu)) { + links.push(item.$menuname) + } + } else if (item.type === 'topbar') { + if (item.wrap.menus) { + item.wrap.menus.forEach(m => { + if (!this.allMenus.includes(m.menu)) { + links.push(item.$menuname) + } + }) + } + } + } + }) + } + + let resetElement = (item, cell) => { + if (cell.linkmenu && cell.linkmenu.length) { + if (appType === 'admin') { + if (!Array.isArray(cell.linkmenu)) { + links.push(item.$menuname) + } else { + let menuId = cell.linkmenu.slice(-1)[0] + if (!this.allMenus.includes(menuId)) { + links.push(item.$menuname) + } + } + } else { + if (cell.linkmenu !== 'goback' && (typeof(cell.linkmenu) !== 'string' || !this.allMenus.includes(cell.linkmenu))) { + links.push(item.$menuname) + } + } + } + } + + let resetButton = (item, cell) => { + if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { + if (cell.intertype === 'system' || cell.procMode === 'system') { // 绯荤粺鎺ュ彛 + sqls.push({uuid: cell.uuid, type: 'button', LText: cell.logLabel}) + } + if (cell.callbackType === 'script' && cell.verify && cell.verify.cbScripts) { + sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', LText: cell.logLabel}) + } + if (['pop', 'formSubmit'].includes(cell.OpenType) && cell.modal && cell.modal.fields) { + cell.modal.fields.forEach(form => { + // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� + if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { + sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'form', LText: `${cell.logLabel}-${form.label}锛堣〃鍗曪級`}) + } else if (form.type === 'popSelect') { + sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', LText: `${cell.logLabel}-${form.label}锛堣〃鍗曪級`}) + } + }) + } + } else if (cell.OpenType === 'excelIn') { + if (cell.intertype === 'system') { + sqls.push({uuid: cell.uuid, type: 'excelIn', LText: cell.logLabel}) + } + } else if (cell.OpenType === 'excelOut') { + if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { + sqls.push({uuid: cell.uuid, type: 'excelOut', LText: cell.logLabel || ''}) + } else if (cell.intertype === 'system' && cell.verify && item.setting && item.setting.interType === 'system') { + if (appType === 'mob') { + cell.pagination = 'false' + } + if (item.subtype === 'dualdatacard' || item.setting.laypage !== cell.pagination) { + sqls.push({uuid: cell.uuid, type: 'excelOut', LText: cell.logLabel || ''}) + } + } + } else if (cell.OpenType === 'funcbutton') { + if (cell.funcType === 'print') { + if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { + sqls.push({uuid: cell.uuid, type: 'print', LText: cell.logLabel || ''}) + } + if (cell.execMode === 'pop' && cell.modal && cell.modal.fields) { + cell.modal.fields.forEach(form => { + // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� + if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { + sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'form', LText: `${cell.logLabel}-${form.label}锛堣〃鍗曪級`}) + } else if (form.type === 'popSelect') { + sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', LText: `${cell.logLabel}-${form.label}锛堣〃鍗曪級`}) + } + }) + } + } else if ((cell.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system') { + sqls.push({uuid: cell.uuid, type: 'pay', LText: cell.logLabel}) + } + } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') { + if (cell.pageTemplate === 'pay' && cell.payMode === 'system') { + sqls.push({uuid: cell.uuid, type: 'pay', LText: cell.logLabel}) + } + } else if (cell.OpenType === 'popview') { + if (cell.config && cell.config.components && cell.config.enabled) { + let label = (item.name ? '-' + item.name : '') + '-' + cell.label + + filterComponent(cell.config.components, label, true) + } + } + + if (appType === 'admin') { + if (cell.refreshTab && cell.refreshTab.length) { + let tabId = cell.refreshTab[cell.refreshTab.length - 1] + if (!this.allMenus.includes(tabId)) { + links.push(cell.logLabel) + } + } + if (cell.openmenu && cell.openmenu.length) { + if (!Array.isArray(cell.openmenu)) { + links.push(cell.logLabel) + } else { + let menuId = cell.openmenu.slice(-1)[0] + if (!this.allMenus.includes(menuId)) { + links.push(cell.logLabel) + } + } + } + if (cell.linkmenu && cell.linkmenu.length) { + if (!Array.isArray(cell.linkmenu)) { + links.push(cell.logLabel) + } else { + let menuId = cell.linkmenu.slice(-1)[0] + if (!this.allMenus.includes(menuId)) { + links.push(cell.logLabel) + } + } + } + } else { + if (cell.openmenu && cell.openmenu.length && cell.openmenu !== 'goback' && (typeof(cell.openmenu) !== 'string' || !this.allMenus.includes(cell.openmenu))) { + links.push(cell.logLabel) + } + if (cell.linkmenu && cell.linkmenu.length && cell.linkmenu !== 'goback' && (typeof(cell.linkmenu) !== 'string' || !this.allMenus.includes(cell.linkmenu))) { + links.push(cell.logLabel) + } + } + } + + if (appType === 'mob') { + config.components.forEach(item => { + if (item.type === 'topbar' && item.wrap.type !== 'navbar' && item.search) { + let search = [] + search.push(...item.search.fields) + + item.search.groups.forEach(group => { + search.push(...group.fields) + }) + + if (search.length > 0) { + search.forEach(cell => { + if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { + sqls.push({uuid: cell.uuid, type: 'sForm', LText: `鎼滅储鏍�-${cell.label}锛堣〃鍗曪級`}) + } + }) + } + } + }) + } + + if (config.interfaces && config.interfaces.length > 0) { + config.interfaces.forEach(m => { + if (m.status !== 'true' || m.setting.interType !== 'system') return false + + m.setting.$name = (config.MenuName || '') + '-' + (m.name || '') + + sqls.push({uuid: m.uuid, type: 'interface', LText: m.setting.$name}) + }) + } + + filterComponent(config.components) + } + record = (type) => { - const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = this.state + const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state let menus = [] lackmenus.forEach(item => { + menus.push(item.MenuID) + }) + lacklinks.forEach(item => { menus.push(item.MenuID) }) outmenus.forEach(item => { @@ -437,6 +896,13 @@ menus.push(item.MenuID) }) appbackmenus.forEach(item => { + menus.push(item[0].MenuID) + menus.push(item[1].MenuID) + }) + btnmenus.forEach(item => { + menus.push(item.MenuID) + }) + appbtnmenus.forEach(item => { menus.push(item[0].MenuID) menus.push(item[1].MenuID) }) @@ -459,7 +925,7 @@ } render () { - const { loading, activeMenu, menulist, remain, lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = this.state + const { loading, activeMenu, menulist, remain, lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state if (!sessionStorage.getItem('UserID')) return null @@ -492,6 +958,12 @@ return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> })} </div> : null} + {lacklinks.length ? <div className="item-wrap"> + <div className="title">鍏宠仈鑿滃崟涓嶅瓨鍦�</div> + {lacklinks.map((item, i) => { + return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> + })} + </div> : null} {backmenus.length ? <div className="item-wrap"> <div className="title">鑿滃崟鍚庣鑴氭湰ID閲嶅</div> {backmenus.map((item, i) => { @@ -504,6 +976,18 @@ return <div key={i}>{item[0].MenuName} <span></span> {item[0].pName} <SwapOutlined /> {item[1].MenuName} <span></span> {item[1].pName}</div> })} </div> : null} + {btnmenus.length ? <div className="item-wrap"> + <div className="title">鑿滃崟鎸夐挳ID閲嶅</div> + {btnmenus.map((item, i) => { + return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> + })} + </div> : null} + {appbtnmenus.length ? <div className="item-wrap"> + <div className="title">鑿滃崟鎸夐挳ID閲嶅锛堣彍鍗曢棿锛�</div> + {appbtnmenus.map((item, i) => { + return <div key={i}>{item[0].MenuName} <span></span> {item[0].pName} <SwapOutlined /> {item[1].MenuName} <span></span> {item[1].pName}</div> + })} + </div> : null} </div> </div> ) diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index ad2c7a6..be78503 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -4,8 +4,8 @@ import { is, fromJS } from 'immutable' import moment from 'moment' import HTML5Backend from 'react-dnd-html5-backend' -import { notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' -import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' +import { notification, Modal, Collapse, Card, Switch, Button, Typography, message } from 'antd' +import { DoubleLeftOutlined, DoubleRightOutlined, CopyOutlined } from '@ant-design/icons' import md5 from 'md5' import Api from '@/api' @@ -896,6 +896,129 @@ return is(fromJS(oriConfig), fromJS(config)) } + copyMenu = () => { + const { config } = this.state + + if (!config.enabled) { + notification.warning({ + top: 92, + message: '鑿滃崟鏈惎鐢紝涓嶅彲澶嶅埗銆�', + duration: 5 + }) + } else { + let msg = { copyType: 'components', type: 'admin', interfaces: [] } + + msg.components = fromJS(config.components).toJS() + msg.components.forEach((item, i) => { + if (item.type === 'tabs') { + item.name = '鏍囩缁�' + i + item.width = 24 + item.subtype = 'tabs' + item.setting = {autoSwitch: 'false', blacklist: [], name: item.name, position: 'top', supModule: [], tabStyle: 'line', width: 24} + + item.subtabs.forEach(tab => { + tab.components[0].subtype = 'normaltable' + tab.components[0].width = 24 + tab.components[0].wrap.width = 24 + tab.components[0].wrap.name = tab.components[0].name + + tab.components[0].action.forEach(btn => { + if (btn.OpenType === 'popview' && btn.config) { + btn.config.Template = 'CustomPage' + if (btn.config.components[0]) { + btn.config.components[0].subtype = 'normaltable' + } + } + }) + tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true')) + tab.components[0].cols.forEach(col => { + if (col.type !== 'custom') return + col.elements.forEach(btn => { + if (btn.OpenType === 'popview' && btn.config) { + btn.config.Template = 'CustomPage' + if (btn.config.components[0]) { + btn.config.components[0].subtype = 'normaltable' + } + } + }) + }) + }) + } else { + item.subtype = 'normaltable' + item.width = 24 + item.wrap.width = 24 + item.wrap.name = item.name + item.action.forEach(btn => { + if (btn.OpenType === 'popview' && btn.config) { + btn.config.Template = 'CustomPage' + if (btn.config.components[0]) { + btn.config.components[0].subtype = 'normaltable' + } + } + }) + item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true')) + item.cols.forEach(col => { + if (col.type !== 'custom') return + col.elements.forEach(btn => { + if (btn.OpenType === 'popview' && btn.config) { + btn.config.Template = 'CustomPage' + if (btn.config.components[0]) { + btn.config.components[0].subtype = 'normaltable' + } + } + }) + }) + } + }) + + if (msg.components[0].search && msg.components[0].search.length > 0) { + let cell = { + uuid: Utils.getuuid(), + type: 'search', + width: 24, + subtype: 'mainsearch', + name: '鎼滅储', + search: msg.components[0].search, + style: {borderBottomColor: '#f0f0f0', borderBottomWidth: '1px'}, + wrap: {float: 'left', blacklist: [], name: '鎼滅储', width: 24} + } + + cell.wrap.advanceType = msg.components[0].wrap.advanceType || 'modal' + cell.wrap.advanceWidth = msg.components[0].wrap.advanceWidth || 1000 + cell.wrap.searchLwidth = msg.components[0].wrap.searchLwidth || 33.3 + cell.wrap.searchRatio = msg.components[0].wrap.searchRatio || 6 + cell.wrap.resetContrl = msg.components[0].wrap.resetContrl || 'init' + cell.wrap.show = msg.components[0].wrap.show || 'true' + + if (cell.wrap.advanceType === 'drawer') { + cell.wrap.drawerPlacement = msg.components[0].wrap.drawerPlacement || 'left' + } + + msg.components[0].search = [] + msg.components[0].setting.useMSearch = 'true' + + msg.components.unshift(cell) + msg.components[0].$tables = getTables(msg.components[0]) + msg.components[1].$tables = getTables(msg.components[1]) + } + + try { + msg = window.btoa(window.encodeURIComponent(JSON.stringify(msg))) + } catch (e) { + console.warn('Stringify Failure') + msg = '' + } + + let oInput = document.createElement('input') + oInput.value = msg + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + message.success('澶嶅埗鎴愬姛銆�') + } + } + updateLogConfig = (config) => { config.fstMenuId = this.state.config.fstMenuId || config.fstMenuId || '' config.parentId = this.state.config.parentId || config.parentId || '' @@ -944,6 +1067,7 @@ {/* 琛ㄥ悕娣诲姞 */} <TableComponent config={config} updatetable={this.updateConfig}/> <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> + <Paragraph style={{padding: '0px 0px 0px 5px'}}>鑿滃崟缁勪欢 <CopyOutlined onClick={this.copyMenu} style={{marginLeft: '3px', cursor: 'pointer', color: '#1890ff'}} /></Paragraph> </> : null} </Panel> <Panel header="鎼滅储" key="search"> @@ -966,13 +1090,6 @@ <div className={'menu-view' + (menuloading ? ' saving' : '')}> <Card bordered={false} extra={ <div className="mk-opeartion-list"> - {/* <Dropdown overlay={ - <div className="mk-button-dropdown-wrap"> - <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> - </div> - } trigger={['click']} placement="bottomCenter"> - <Button className="mk-button-more">鏇村<DownOutlined/></Button> - </Dropdown> */} {config ? <Debug config={config}/> : null} {config ? <Transfer config={config}/> : null} {config ? <Unattended config={config} updateConfig={this.updateConfig}/> : null} -- Gitblit v1.8.0