From 16f80ddfc338bc65a893c1b7eb93d1d9861158b2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 02 七月 2023 23:05:17 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/modalform/index.jsx | 2 src/views/login/loginform.jsx | 25 + src/components/resetPassword/resetpwd/index.jsx | 25 + src/menu/components/chart/antv-G6/index.jsx | 1 src/tabviews/zshare/mutilform/mkSwitch/index.jsx | 17 src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx | 13 src/menu/components/chart/antv-X6/chartcompile/index.jsx | 2 src/tabviews/custom/components/chart/antv-G6/index.jsx | 6 src/tabviews/custom/components/card/cardItem/index.jsx | 14 src/menu/components/chart/antv-X6/index.jsx | 83 ---- src/menu/transfer/index.jsx | 115 +++-- src/tabviews/zshare/actionList/excelInbutton/index.jsx | 16 src/templates/sharecomponent/searchcomponent/index.jsx | 1 src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 24 src/menu/components/form/simple-form/index.jsx | 1 src/views/basedesign/index.jsx | 15 src/menu/components/table/normal-table/columns/editColumn/index.jsx | 1 src/api/index.js | 73 +- src/tabviews/zshare/mutilform/mkVercode/index.jsx | 50 ++ src/mob/modalconfig/index.jsx | 1 src/assets/css/design.scss | 24 + src/tabviews/zshare/actionList/normalbutton/index.jsx | 58 ++ src/menu/components/table/edit-table/columns/editColumn/index.jsx | 1 src/views/interface/history/index.jsx | 2 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx | 30 + src/tabviews/custom/components/card/cardcellList/index.jsx | 2 src/menu/components/table/base-table/columns/editColumn/index.jsx | 1 src/views/interface/workspace/request/index.jsx | 4 src/menu/components/form/step-form/index.jsx | 1 src/menu/components/card/cardcellcomponent/index.jsx | 2 src/templates/zshare/formconfig.jsx | 4 src/menu/components/form/tab-form/index.jsx | 1 src/templates/zshare/verifycard/uniqueform/index.jsx | 2 README.md | 2 src/menu/components/share/actioncomponent/index.jsx | 1 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 8 src/tabviews/zshare/actionList/printbutton/index.jsx | 6 src/menu/components/search/main-search/index.jsx | 1 src/tabviews/custom/components/chart/antv-X6/index.scss | 16 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss | 4 src/tabviews/zshare/mutilform/index.jsx | 27 + src/tabviews/custom/components/chart/antv-X6/index.jsx | 334 +++++++++++----- src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx | 4 src/menu/modalconfig/index.jsx | 1 src/views/appmanage/index.jsx | 15 package.json | 2 src/views/login/index.jsx | 48 +- 47 files changed, 709 insertions(+), 377 deletions(-) diff --git a/README.md b/README.md index 68eb8cd..a1068e0 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +node --max-old-space-size=9000 scripts/build.js + ### `npm run eject` **Note: this is a one-way operation. Once you `eject`, you can鈥檛 go back!** diff --git a/package.json b/package.json index 719c61b..07d00b5 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ }, "scripts": { "dev": "set PORT=3001 && node scripts/start.js", - "build": "node --max-old-space-size=9000 scripts/build.js", + "build": "node --max-old-space-size=2048 scripts/build.js", "test": "node scripts/test.js" }, "eslintConfig": { diff --git a/src/api/index.js b/src/api/index.js index 7cd5074..1d2ed22 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,6 @@ import axios from 'axios' import qs from 'qs' -import { notification } from 'antd' +import { notification, Modal } from 'antd' import md5 from 'md5' import CryptoJS from 'crypto-js' import jsSHA from 'jssha' @@ -11,6 +11,7 @@ window.GLOB.IndexDB = null window.GLOB.OuterToken = {} +window.GLOB.$error = false let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : '' let db = `mkdb${service}` @@ -23,53 +24,53 @@ axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' axios.defaults.withCredentials = false -// axios.interceptors.request.use((config) => { -// return config -// }, (error) => { -// return Promise.reject(error) -// }) - -const setCurrentUrl = (res) => { - if (!!(window.history && window.history.pushState)) { - sessionStorage.clear() - sessionStorage.setItem('loginError', JSON.stringify({url: res.config ? res.config.url : '', request: res.config ? res.config.data : '', response: JSON.stringify(res.data)})) - window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') - window.location.reload() - } -} - axios.interceptors.response.use((response) => { if (response.data.ErrCode === 'LoginError') { - if (window.debugger === true) { - response.data.ErrCode = 'E' - return Promise.resolve(response.data) - } else if (window.GLOB.developing) { + if (window.GLOB.developing) { sessionStorage.setItem('devError', 'true') response.data.ErrCode = 'E' return Promise.resolve(response.data) - } else if (!sessionStorage.getItem('loginError')) { - setCurrentUrl(response) + } else if (response.config.url.indexOf('https://sso.mk9h.cn/webapi/dostars') > -1) { + return Promise.reject(response.data) + } else if (response.config.url.indexOf('https://epc.mk9h.cn/webapi/dostars') > -1) { + return Promise.reject(response.data) } + + if (!window.GLOB.$error) { + window.GLOB.$error = true + + Modal.destroyAll() + Modal.error({ + title: response.data.message, + onOk: () => { + window.GLOB.$error = false + sessionStorage.clear() + if (!!(window.history && window.history.pushState)) { + window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') + window.location.reload() + } + } + }) + } + + return Promise.reject(response.data) } else { return Promise.resolve(response.data) } }, (error) => { - let response = error.response + let response = error.response || '' - if (response) { - if (!response.data || !response.data.errors) { // 杩囨护鏃疯鎶ラ敊淇℃伅 - notification.error({ - className: 'notification-custom-error', - bottom: 0, - message: '鐘舵�佺爜-' + response.status + '锛岃鑱旂郴绠$悊鍛�', - placement: 'bottomRight', - duration: 15 - }) - } - return Promise.reject(response) - } else { - return Promise.reject() + if (response && (!response.data || !response.data.errors)) { // 杩囨护鏃疯鎶ラ敊淇℃伅 + notification.error({ + className: 'notification-custom-error', + bottom: 0, + message: '鐘舵�佺爜-' + response.status + '锛岃鑱旂郴绠$悊鍛�', + placement: 'bottomRight', + duration: 15 + }) } + + return Promise.reject(response) }) class Api { diff --git a/src/assets/css/design.scss b/src/assets/css/design.scss index 5d11010..e7a8ac6 100644 --- a/src/assets/css/design.scss +++ b/src/assets/css/design.scss @@ -52,6 +52,30 @@ } } } +.ant-modal-wrap.mk-scroll-modal { + .ant-modal { + top: 50px; + } + .ant-modal-body { + min-height: 150px; + max-height: calc(100vh - 170px); + overflow-y: auto; + } + .ant-modal-body::-webkit-scrollbar { + width: 7px; + } + .ant-modal-body::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); + background: rgba(0, 0, 0, 0.13); + } + .ant-modal-body::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border-radius: 3px; + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + } +} .ant-modal { .ant-radio-group { diff --git a/src/components/resetPassword/resetpwd/index.jsx b/src/components/resetPassword/resetpwd/index.jsx index ee7a60a..514bab5 100644 --- a/src/components/resetPassword/resetpwd/index.jsx +++ b/src/components/resetPassword/resetpwd/index.jsx @@ -142,7 +142,30 @@ }) message.warning(res.message) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: 'https://sso.mk9h.cn/webapi/dologon', + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } + clearTimeout(this.LoginTimer) this.setState({ verdisabled: false, diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index e5a5029..f052c14 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -762,6 +762,7 @@ {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal title="缂栬緫鍏冪礌" + wrapClassName="mk-scroll-modal" visible={visible} width={850} maskClosable={false} @@ -781,6 +782,7 @@ {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal title="鎸夐挳路缂栬緫" + wrapClassName="mk-scroll-modal" visible={actvisible} width={920} maskClosable={false} diff --git a/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx index 4c4f683..19807bf 100644 --- a/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx @@ -102,11 +102,11 @@ type: 'radio', field: 'click', label: '鐐瑰嚮浜嬩欢', - initval: card.click || '', + initval: card.click || 'switch', tooltip: '鐐瑰嚮鑺傜偣鏃惰Е鍙戠殑浜嬩欢銆�', required: false, options: [ - {value: '', label: '鏁版嵁鍒囨崲'}, + {value: 'switch', label: '鏁版嵁鍒囨崲'}, {value: 'menu', label: '鑿滃崟'}, {value: 'menus', label: '鑿滃崟缁�'} ], diff --git a/src/menu/components/chart/antv-G6/index.jsx b/src/menu/components/chart/antv-G6/index.jsx index 652fbe6..2e9dbf7 100644 --- a/src/menu/components/chart/antv-G6/index.jsx +++ b/src/menu/components/chart/antv-G6/index.jsx @@ -961,6 +961,7 @@ width: card.width || 24, height: 400, subtype: card.subtype, + click: 'switch', name: card.name } diff --git a/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx index 2be6ca1..f3ef986 100644 --- a/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx @@ -110,6 +110,7 @@ required: false, options: [ {value: '', label: '鏃�'}, + {value: 'switch', label: '鏁版嵁鍒囨崲'}, {value: 'menu', label: '鑿滃崟'}, {value: 'menus', label: '鑿滃崟缁�'} ], @@ -118,7 +119,6 @@ {field: 'menus', values: ['menus']}, {field: 'menuType', values: ['menus']}, {field: 'open', values: ['menu', 'menus']}, - {field: 'joint', values: ['menu', 'menus']}, ] }, { @@ -149,17 +149,6 @@ {value: 'self', label: '褰撳墠绐楀彛'}, ], forbid: appType !== 'pc' - }, - { - type: 'radio', - field: 'joint', - label: '鍙傛暟鎷兼帴', - initval: card.joint || 'true', - required: false, - options: [ - {value: 'true', label: '鏄�'}, - {value: 'false', label: '鍚�'}, - ], }, { type: 'table', diff --git a/src/menu/components/chart/antv-X6/chartcompile/index.jsx b/src/menu/components/chart/antv-X6/chartcompile/index.jsx index 8d72d4c..6942006 100644 --- a/src/menu/components/chart/antv-X6/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-X6/chartcompile/index.jsx @@ -144,7 +144,7 @@ <Modal wrapClassName="mk-pop-modal" visible={visible} - width={850} + width={900} maskClosable={false} onOk={this.onSubmit} onCancel={() => { this.setState({ visible: false }) }} diff --git a/src/menu/components/chart/antv-X6/index.jsx b/src/menu/components/chart/antv-X6/index.jsx index c161470..4c5cc7c 100644 --- a/src/menu/components/chart/antv-X6/index.jsx +++ b/src/menu/components/chart/antv-X6/index.jsx @@ -3,7 +3,7 @@ import { is, fromJS } from 'immutable' import { Popover } from 'antd' import { ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' -import { Graph, Shape } from '@antv/x6' +import { Graph } from '@antv/x6' import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' @@ -314,6 +314,7 @@ max: 2 }, autoResize: true, + interacting: false, background: { color: card.plot.backgroundColor || 'transparent' }, @@ -335,36 +336,6 @@ allowBlank: false, snap: { radius: 20 - }, - createEdge() { - return new Shape.Edge({ - attrs: { - line: { - stroke: '#000000', - strokeWidth: 1, - targetMarker: { - name: 'block', - width: 12, - height: 8 - } - } - }, - zIndex: 0 - }) - }, - validateConnection({ targetMagnet }) { - return !!targetMagnet - } - }, - highlighting: { - magnetAdsorbed: { - name: 'stroke', - args: { - attrs: { - fill: '#5F95FF', - stroke: '#5F95FF' - } - } } } }) @@ -391,6 +362,7 @@ max: 2 }, autoResize: true, + interacting: false, background: { color: '#ffffff' }, mousewheel: { enabled: true, @@ -410,55 +382,6 @@ allowBlank: false, snap: { radius: 20 - }, - createEdge() { - return new Shape.Edge({ - attrs: { - line: { - stroke: '#000000', - strokeWidth: 1, - targetMarker: { - name: 'block', - width: 12, - height: 8 - } - } - }, - zIndex: 2 - }) - }, - validateConnection({ targetMagnet }) { - return !!targetMagnet - } - }, - highlighting: { - magnetAdsorbed: { - name: 'stroke', - args: { - attrs: { - fill: '#5F95FF', - stroke: '#5F95FF' - } - } - } - }, - translating: { - restrict(cellView) { - const cell = cellView.cell - const parentId = cell.prop('parent') - - if (parentId) { - const parentNode = graph.getCellById(parentId) - if (parentNode) { - return parentNode.getBBox().moveAndExpand({ - x: 0, - y: 36, - width: 0, - height: -36, - }) - } - } - return cell.getBBox() } } }) diff --git a/src/menu/components/form/simple-form/index.jsx b/src/menu/components/form/simple-form/index.jsx index 3f75c5d..5c012de 100644 --- a/src/menu/components/form/simple-form/index.jsx +++ b/src/menu/components/form/simple-form/index.jsx @@ -683,6 +683,7 @@ </div> <Modal title="缂栬緫" + wrapClassName="mk-scroll-modal" visible={this.state.visible} width={950} maskClosable={false} diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx index c5624f9..5e43617 100644 --- a/src/menu/components/form/step-form/index.jsx +++ b/src/menu/components/form/step-form/index.jsx @@ -807,6 +807,7 @@ </div> <Modal title="缂栬緫" + wrapClassName="mk-scroll-modal" visible={this.state.visible} width={950} maskClosable={false} diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index ae873e0..45e890a 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -809,6 +809,7 @@ </div> <Modal title="缂栬緫" + wrapClassName="mk-scroll-modal" visible={this.state.visible} width={950} maskClosable={false} diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index 2708d3d..f526199 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -427,6 +427,7 @@ {/* 缂栬緫鎼滅储鏉′欢 */} <Modal title="鎼滅储鏉′欢-缂栬緫" + wrapClassName="mk-scroll-modal" visible={visible} width={850} maskClosable={false} diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index 5746ac8..fbe9e9e 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -705,6 +705,7 @@ {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal title="鎸夐挳路缂栬緫" + wrapClassName="mk-scroll-modal" visible={visible} width={920} maskClosable={false} diff --git a/src/menu/components/table/base-table/columns/editColumn/index.jsx b/src/menu/components/table/base-table/columns/editColumn/index.jsx index 16ae1ca..95e9bf5 100644 --- a/src/menu/components/table/base-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/index.jsx @@ -459,6 +459,7 @@ <div style={{display: 'inline-block'}}> <Modal title="鏄剧ず鍒楃紪杈�" + wrapClassName="mk-scroll-modal" visible={visible} width={850} maskClosable={false} diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index 06b4348..36565c3 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -512,6 +512,7 @@ <div style={{display: 'inline-block'}}> <Modal title="鏄剧ず鍒楃紪杈�" + wrapClassName="mk-scroll-modal" visible={visible} width={900} maskClosable={false} diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx index df3913f..a5f9a50 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx @@ -465,6 +465,7 @@ <div style={{display: 'inline-block'}}> <Modal title="鏄剧ず鍒楃紪杈�" + wrapClassName="mk-scroll-modal" visible={visible} width={850} maskClosable={false} diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index a6741f2..4765551 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -588,6 +588,7 @@ </DndProvider> <Modal title={card && card.$copy ? '澶嶅埗' : '缂栬緫'} + wrapClassName="mk-scroll-modal" visible={this.state.visible} width={950} maskClosable={false} diff --git a/src/menu/transfer/index.jsx b/src/menu/transfer/index.jsx index 6eeecbf..f0a90d6 100644 --- a/src/menu/transfer/index.jsx +++ b/src/menu/transfer/index.jsx @@ -29,6 +29,22 @@ const _this = this if (!config.enabled) { + let tb = config.components[0] + if (config.components.length === 1 && tb.setting.interType === 'system' && !tb.setting.dataresource) { + confirm({ + title: '褰撳墠椤甸潰灏嗘竻绌猴紝纭畾鍒囨崲涓鸿嚜瀹氫箟椤甸潰鍚楋紵', + content: '', + onOk() { + return new Promise(resolve => { + _this.execUpdate(resolve, true) + }) + }, + onCancel() {} + }) + + return + } + notification.warning({ top: 92, message: '鏈惎鐢ㄨ彍鍗曚笉鍙崌绾э紒', @@ -49,7 +65,7 @@ }) } - execUpdate = (_resolve) => { + execUpdate = (_resolve, clear) => { let _config = fromJS(this.props.config).toJS() _config.permission = 'true' _config.Template = 'CustomPage' @@ -59,23 +75,53 @@ delete _config.autoMatic let useMSearch = false - _config.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 - if (tab.components[0].setting.useMSearch === 'true') { - useMSearch = true - } - - tab.components[0].action.forEach(btn => { + if (clear) { + _config.components = [] + } else { + _config.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 + if (tab.components[0].setting.useMSearch === 'true') { + useMSearch = true + } + + 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]) { @@ -83,8 +129,8 @@ } } }) - tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true')) - tab.components[0].cols.forEach(col => { + 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) { @@ -95,34 +141,9 @@ } }) }) - }) - } 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 (useMSearch) { let cell = { diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index 285307a..604e362 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -525,6 +525,7 @@ </DndProvider> <Modal title={card && card.$copy ? '澶嶅埗' : '缂栬緫'} + wrapClassName="mk-scroll-modal" visible={this.state.visible} width={950} maskClosable={false} diff --git a/src/tabviews/custom/components/card/cardItem/index.jsx b/src/tabviews/custom/components/card/cardItem/index.jsx index c378930..d7d8a72 100644 --- a/src/tabviews/custom/components/card/cardItem/index.jsx +++ b/src/tabviews/custom/components/card/cardItem/index.jsx @@ -16,19 +16,10 @@ data: PropTypes.object, } - state = { - card: null, // 鍗$墖淇℃伅锛屽寘鎷鍙嶉潰 - } - - /** - * @description 鎼滅储鏉′欢鍒濆鍖� - */ - UNSAFE_componentWillMount () { - - } + state = {} shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps)) + return !is(fromJS(this.props.data), fromJS(nextProps.data)) } /** @@ -164,7 +155,6 @@ render() { const { card, data, cards, children } = this.props let style = {...card.style} - let bg = null if (card.setting.bgField) { diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 33e1622..85b86b8 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -77,7 +77,7 @@ } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) + return !is(fromJS(this.props.data), fromJS(nextProps.data)) } /** diff --git a/src/tabviews/custom/components/chart/antv-G6/index.jsx b/src/tabviews/custom/components/chart/antv-G6/index.jsx index d66d9c9..8d7f359 100644 --- a/src/tabviews/custom/components/chart/antv-G6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-G6/index.jsx @@ -1571,9 +1571,9 @@ handleClick = (data = null) => { const { plot, config } = this.state - if (plot.click && !data) return - if (plot.click === 'menus') { + if (!data) return + let menu = null if (plot.menus && plot.menus.length > 0) { @@ -1604,6 +1604,8 @@ MKEmitter.emit('modifyTabs', newtab, true) } else if (plot.click === 'menu') { + if (!data) return + let menuId = plot.menu.slice(-1)[0] let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx index 66b6b4c..3090207 100644 --- a/src/tabviews/custom/components/chart/antv-X6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx @@ -330,23 +330,49 @@ } } }, - // { - // inherit: 'rect', - // width: 66, - // height: 36, - // attrs: { - // body: { - // strokeWidth: 0, - // fill: 'transparent' - // }, - // text: { - // fontSize: 12, - // fill: '#262626' - // } - // } - // }, true ) + +const styles = { + blue: '#1890ff', + red: '#f5222d', + orange_red: '#fa541c', + orange: '#fa8c16', + orange_yellow: '#faad14', + yellow: '#fadb14', + yellow_green: '#a0d911', + green: '#52c41a', + cyan: '#13c2c2', + blue_purple: '#2f54eb', + purple: '#722ed1', + magenta: '#eb2f96', + grass_green: '#aeb303', + deep_red: '#c32539', + deep_blue: '#1d3661', + blue1: '#e6f7ff', + red1: '#fff1f0', + orange_red1: '#fff2e8', + orange1: '#fff7e6', + orange_yellow1: '#fffbe6', + yellow1: '#feffe6', + yellow_green1: '#fcffe6', + green1: '#f6ffed', + cyan1: '#e6fffb', + blue_purple1: '#f0f5ff', + purple1: '#f9f0ff', + magenta1: '#fff0f6', + grass_green1: '#f2efda', + deep_red1: '#fff0f0', + deep_blue1: '#eff1f4' +} + +let sysColor = '#1890ff' +let lightColor = '#e6f7ff' +if (window.GLOB.style) { + let type = window.GLOB.style.replace(/bg_black_style_|bg_white_style_/, '') + sysColor = styles[type] || '#1890ff' + lightColor = styles[type + '1'] || '#e6f7ff' +} class antvX6Chart extends Component { static propTpyes = { @@ -386,7 +412,7 @@ if (BData) { BID = BData.$BID || '' } - + this.setState({ config: _config, BID: BID || '', @@ -578,6 +604,7 @@ max: 2 }, autoResize: true, + interacting: false, panning: true, background: { color: config.plot.backgroundColor || 'transparent' @@ -600,36 +627,6 @@ allowBlank: false, snap: { radius: 20 - }, - createEdge() { - return new Shape.Edge({ - attrs: { - line: { - stroke: '#000000', - strokeWidth: 1, - targetMarker: { - name: 'block', - width: 12, - height: 8 - } - } - }, - zIndex: 0 - }) - }, - validateConnection({ targetMagnet }) { - return !!targetMagnet - } - }, - highlighting: { - magnetAdsorbed: { - name: 'stroke', - args: { - attrs: { - fill: '#5F95FF', - stroke: '#5F95FF' - } - } } } }) @@ -646,6 +643,16 @@ graph.resetCells(cells) graph.positionContent('center') } + + if (config.plot.click) { + graph.on('cell:click', ({ node }) => { + this.checkNode(graph, node) + }) + + graph.on('blank:click', () => { + this.checkNode(graph) + }) + } } laneSrender = () => { @@ -657,6 +664,7 @@ min: 0.5, max: 2 }, + interacting: false, autoResize: true, panning: true, background: { color: '#ffffff' }, @@ -678,55 +686,6 @@ allowBlank: false, snap: { radius: 20 - }, - createEdge() { - return new Shape.Edge({ - attrs: { - line: { - stroke: '#000000', - strokeWidth: 1, - targetMarker: { - name: 'block', - width: 12, - height: 8 - } - } - }, - zIndex: 2 - }) - }, - validateConnection({ targetMagnet }) { - return !!targetMagnet - } - }, - highlighting: { - magnetAdsorbed: { - name: 'stroke', - args: { - attrs: { - fill: '#5F95FF', - stroke: '#5F95FF' - } - } - } - }, - translating: { - restrict(cellView) { - const cell = cellView.cell - const parentId = cell.prop('parent') - - if (parentId) { - const parentNode = graph.getCellById(parentId) - if (parentNode) { - return parentNode.getBBox().moveAndExpand({ - x: 0, - y: 36, - width: 0, - height: -36, - }) - } - } - return cell.getBBox() } } }) @@ -742,6 +701,16 @@ }) graph.resetCells(cells) graph.positionContent('top') + } + + if (config.plot.click) { + graph.on('cell:click', ({ node }) => { + this.checkNode(graph, node) + }) + + graph.on('blank:click', () => { + this.checkNode(graph) + }) } } @@ -912,19 +881,19 @@ showPorts(ports, false) }) - graph.on('node:click', ({ e, x, y, node, view }) => { + graph.on('node:click', ({ node }) => { this.selectNode = node this.setState({node: node.store.data}) }) - graph.on('edge:click', ({ e, x, y, edge, view }) => { + graph.on('edge:click', ({ edge }) => { this.selectNode = edge this.setState({node: edge.store.data}) graph.clearTransformWidgets() }) - graph.on('blank:click', ({ e, x, y }) => { + graph.on('blank:click', () => { this.selectNode = null this.setState({node: null}) @@ -989,8 +958,7 @@ }) const p3 = graph.createNode({ - shape: 'mk-text', - label: '鏂囨湰' + shape: 'mk-text' }) stencil.load([p1, p2, p3], 'group2') @@ -1095,8 +1063,15 @@ }) graph + .use(new Transform({ + resizing: true, + rotating: true + })) .use(new Selection()) - .use(new Snapline()) + .use(new Snapline({ + enabled: true, + filter: (Graph) => Graph.prop('shape') !== 'lane' + })) .use(new Keyboard()) .use(new Clipboard()) .use(new History()) @@ -1141,14 +1116,18 @@ graph.bindKey(['meta+c', 'ctrl+c'], () => { const cells = graph.getSelectedCells() if (cells.length) { - graph.copy(cells) + if (cells[0].prop('shape') !== 'lane' && cells[0].prop('shape') !== 'edge') { + graph.copy(cells) + } } return false }) graph.bindKey(['meta+x', 'ctrl+x'], () => { const cells = graph.getSelectedCells() if (cells.length) { - graph.cut(cells) + if (cells[0].prop('shape') !== 'lane' && cells[0].prop('shape') !== 'edge') { + graph.cut(cells) + } } return false }) @@ -1175,9 +1154,19 @@ graph.bindKey(['backspace', 'delete'], () => { const cells = graph.getSelectedCells() if (cells.length) { - graph.removeCells(cells) this.selectNode = null this.setState({node: null}) + + if (cells[0].prop('shape') === 'lane') { + graph.startBatch('delete-lane') + + graph.removeCells(cells) + this.deleteLane(cells[0], graph) + + graph.stopBatch('delete-lane') + } else { + graph.removeCells(cells) + } } }) @@ -1199,8 +1188,10 @@ showPorts(ports, false) }) - graph.on('node:added', ({ cell, index, options }) => { + graph.on('node:added', ({ cell }) => { if (cell.prop('shape') === 'lane') { + if (cell.prop('zIndex') === 0) return + graph.startBatch('add-lane') this.addLane(cell, graph) @@ -1212,22 +1203,26 @@ if (num <= 1) { message.warning('璇锋坊鍔犳吵閬擄紒') graph.removeCells([cell]) - } else { + } else if (!cell.prop('parent')) { this.addNode(cell, graph) } } }) - graph.on('node:click', ({ e, x, y, node, view }) => { + graph.on('node:click', ({ node }) => { this.selectNode = node this.setState({node: node.store.data}) + + if (node.prop('shape') === 'lane') { + graph.clearTransformWidgets() + } }) - graph.on('edge:click', ({ e, x, y, edge, view }) => { + graph.on('edge:click', ({ edge }) => { this.selectNode = edge this.setState({node: edge.store.data}) graph.clearTransformWidgets() }) - graph.on('blank:click', ({ e, x, y }) => { + graph.on('blank:click', () => { this.selectNode = null this.setState({node: null}) @@ -1292,8 +1287,7 @@ }) const p3 = graph.createNode({ - shape: 'mk-text', - label: '鏂囨湰' + shape: 'mk-text' }) stencil.load([p1, p2, p3], 'group2') @@ -1372,6 +1366,25 @@ // }, {padding: 20}) } + deleteLane = (cell, graph) => { + let id = cell.id + + let nodes = graph.getNodes() + let cells = [] + + nodes.forEach(item => { + if (item.prop('shape') === 'lane') return + + if (item.prop('parent') === id) { + cells.push(item) + } + }) + + graph.removeCells(cells) + + this.resetlane(cell.id, cell.prop('position/x'), -cell.prop('size/width')) + } + addLane = (cell, graph) => { const { config } = this.state @@ -1406,6 +1419,7 @@ } let height = 400 + if (typeof(config.plot.height) === 'number' || /px/.test(config.plot.height)) { height = parseInt(config.plot.height) } @@ -1498,12 +1512,29 @@ const { node } = this.state if (node.shape === 'edge') { + let labels = this.selectNode.prop('labels') + if (!labels || labels.length === 0) { + labels = [{ + attrs: {label: { text: '' }} + }] + } + if (key === 'title') { - this.selectNode.setLabels(value) + labels = JSON.parse(JSON.stringify(labels)) + labels[0].attrs.label.text = value + this.selectNode.setLabels(labels) } else if (key === 'stroke') { this.selectNode.attr('line/stroke', value) } else if (key === 'strokeWidth') { this.selectNode.attr('line/strokeWidth', value) + } else if (key === 'fontSize') { + labels = JSON.parse(JSON.stringify(labels)) + labels[0].attrs.label.fontSize = value + this.selectNode.setLabels(labels) + } else if (key === 'fontFill') { + labels = JSON.parse(JSON.stringify(labels)) + labels[0].attrs.label.fill = value + this.selectNode.setLabels(labels) } else if (key === 'lineType') { if (value === 'dash') { this.selectNode.attr('line/strokeDasharray', 5) @@ -1564,6 +1595,83 @@ } } + checkNode = (graph, node) => { + const { plot, config } = this.state + + let nodes = graph.getNodes() + + nodes.forEach(item => { + if (item.prop('shape') === 'lane') return + + if (item.prop('oristyle')) { + let style = item.prop('oristyle') + + item.prop('attrs/body/fill', style.fill) + item.prop('attrs/body/stroke', style.stroke) + item.prop('attrs/text/fill', style.text) + } + }) + + if (!node || ['lane', 'mk-text', 'edge'].includes(node.prop('shape'))) { + MKEmitter.emit('resetSelectLine', config.uuid, '', '') + return + } + + if (!node.prop('oristyle')) { + node.prop('oristyle', { + fill: node.prop('attrs/body/fill'), + stroke: node.prop('attrs/body/stroke'), + text: node.prop('attrs/text/fill') + }) + } + + node.prop('attrs/body/fill', lightColor) + node.prop('attrs/body/stroke', sysColor) + node.prop('attrs/text/fill', sysColor) + + let sign = node.prop('mksign') || '' + + if (plot.click === 'menus') { + let menu = null + + if (plot.menus && plot.menus.length > 0) { + plot.menus.forEach(m => { + if (sign !== m.sign) return + menu = m + }) + } + if (!menu || !menu.MenuID) return + + let newtab = { + MenuID: menu.MenuID, + MenuName: menu.MenuName, + MenuNo: menu.MenuNo || '', + type: menu.tabType, + param: {$BID: sign} + } + + MKEmitter.emit('modifyTabs', newtab, true) + } else if (plot.click === 'menu') { + let menuId = plot.menu.slice(-1)[0] + let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0] + + if (!newtab && plot.MenuID) { + newtab = { + MenuID: plot.MenuID, + MenuName: plot.MenuName, + MenuNo: plot.MenuNo, + type: plot.tabType + } + } else if (!newtab) { + return + } + + MKEmitter.emit('modifyTabs', {...newtab, param: {$BID: sign}}, true) + } else { + MKEmitter.emit('resetSelectLine', config.uuid, sign, {}) + } + } + resetlane = (id, x, offset) => { let nodes = this.mkGraph.getNodes() @@ -1597,7 +1705,7 @@ </div> : null } <NormalHeader config={config} /> - <div className="canvas" style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> + <div className={'canvas only-show' + (config.plot.click ? ' switchable' : '')} style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> <div id={config.uuid + 'container'} className="mk-container"></div> </div> </div> diff --git a/src/tabviews/custom/components/chart/antv-X6/index.scss b/src/tabviews/custom/components/chart/antv-X6/index.scss index 7bf3861..58cd11f 100644 --- a/src/tabviews/custom/components/chart/antv-X6/index.scss +++ b/src/tabviews/custom/components/chart/antv-X6/index.scss @@ -165,6 +165,22 @@ opacity: 0; } } + .only-show { + .x6-port { + display: none; + } + .x6-cell.x6-edge { + cursor: default; + path { + cursor: default; + } + } + } + .only-show.switchable { + .x6-cell.x6-node:not([data-shape="lane"]):not([data-shape="mk-text"]) { + cursor: pointer; + } + } .chart-header { position: relative; diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx index e423161..d279a75 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx @@ -7,6 +7,8 @@ import './index.scss' +const { TextArea } = Input + class NodeUpdate extends Component { static propTpyes = { node: PropTypes.object, @@ -71,6 +73,8 @@ lineType = 'dash' } + let font = node.labels && node.labels[0] ? node.labels[0].attrs.label : {} + return [ { type: 'title', @@ -80,7 +84,7 @@ type: 'text', field: 'title', label: '鏍囩', - initval: title + initval: font.text || '' }, { type: 'title', @@ -107,6 +111,22 @@ {value: 'solid', text: '瀹炵嚎'}, {value: 'dash', text: '铏氱嚎'} ] + }, + { + type: 'title', + label: '鏍囩鏍峰紡' + }, + { + type: 'number', + field: 'fontSize', + label: '瀛楀彿', + initval: font.fontSize || 14 + }, + { + type: 'color', + field: 'fontFill', + label: '棰滆壊', + initval: font.fill || '#000000' } ] } else if (node.shape === 'lane') { @@ -228,7 +248,7 @@ label: '鍐呭' }, { - type: 'text', + type: 'textarea', field: 'title', label: '鏍囩', initval: title @@ -387,6 +407,12 @@ </Form.Item> </Col> ) + } else if (item.type === 'textarea') { + fields.push( + <Col span={24} key={index} style={{padding: '0 12px'}}> + <TextArea defaultValue={item.initval} rows={3} onChange={(e) => this.change(e.target.value, item.field)} /> + </Col> + ) } else if (item.type === 'number') { fields.push( <Col span={24} key={index}> diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss index 096d405..68f75dc 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss @@ -8,6 +8,10 @@ padding-bottom: 2px; font-size: 13px; } + textarea.ant-input { + padding: 0px 4px; + border-radius: 0px; + } .ant-form-item { display: flex; margin-bottom: 10px; diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index a38bb09..2260a2d 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -1671,7 +1671,9 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return + this.execError({}) }) } else if (submit.intertype === 'inner' && submit.innerFunc) { // 鑷畾涔夊瓨鍌ㄨ繃绋� @@ -1683,7 +1685,9 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return + this.execError({}) }) } diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index 2abe56f..c25df22 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -408,7 +408,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else { @@ -418,7 +419,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } @@ -431,7 +433,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else if (btn.intertype === 'outer') { // 澶栭儴鎺ュ彛 @@ -460,7 +463,8 @@ this.execError(res) resolve(false) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else { @@ -521,7 +525,7 @@ return Api.genericInterface(res) }).then(response => { - if (!response) return + if (!response || response.ErrCode === 'LoginError') return // 鍥炶皟璇锋眰 if (ver_token && response.ErrMesg === 'token_error') { this.execError(response) @@ -542,7 +546,7 @@ } } }).then(res => { - if (!res) return + if (!res || res.ErrCode === 'LoginError') return if (res.status) { this.execSuccess(res) diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index 78fc739..a31ae6b 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -220,7 +220,8 @@ } else { this.execError(result) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else if (btn.intertype === 'inner') { // 浣跨敤鍐呴儴鍑芥暟 @@ -233,7 +234,8 @@ } else { this.execError(result) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 浣跨敤澶栭儴鍑芥暟 @@ -285,7 +287,8 @@ } else { this.execError(result) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else if (btn.intertype === 'outer' && btn.innerFunc) { @@ -349,7 +352,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else { @@ -437,13 +441,15 @@ } else { this.execError(result) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } @@ -525,7 +531,8 @@ } else { this.execError(result) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } @@ -842,7 +849,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus('over') }) } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index f49846b..cf67e2e 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -4,6 +4,7 @@ import qs from 'qs' import { is, fromJS } from 'immutable' import { Button, Modal, notification, message, Drawer, Switch, Checkbox, Progress } from 'antd' +import md5 from 'md5' import Api from '@/api' import Utils, { getSysDefaultSql } from '@/utils/utils.js' @@ -1103,7 +1104,8 @@ this.execError(res) } _resolve() - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1116,7 +1118,8 @@ this.triggerNote(res) // 娑堟伅 } resolve(res) - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1143,7 +1146,7 @@ _resolve() }) } else { // 瓒呭嚭20涓姹傛椂寰幆鎵ц - if (btn.progress === 'progressbar' && btn.$toolbtn && params.length > 1) { + if (btn.progress === 'progressbar' && params.length > 1) { this.setState({ loadingTotal: params.length }) @@ -1164,7 +1167,7 @@ _params = this.getInnerParam(data, formdata, btn.callbackType === 'script') } - if (_params.length > 1 && btn.progress === 'progressbar' && btn.$toolbtn) { + if (_params.length > 1 && btn.progress === 'progressbar') { this.setState({ loadingTotal: _params.length }) @@ -1185,7 +1188,7 @@ params = this.getInnerParam(data, formdata, btn.callbackType === 'script') } - if (params.length > 1 && btn.progress === 'progressbar' && btn.$toolbtn) { + if (params.length > 1 && btn.progress === 'progressbar') { this.setState({ loadingTotal: params.length }) @@ -1232,7 +1235,8 @@ this.execError(res) _resolve() } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1424,7 +1428,8 @@ this.execError(res) _resolve() } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1639,7 +1644,8 @@ this.execError(res) _resolve() } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1702,7 +1708,8 @@ this.execError(res) _resolve() } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1764,7 +1771,8 @@ this.execError(res) _resolve() } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.updateStatus() _resolve() }) @@ -1834,7 +1842,8 @@ return } this.outerCallbackRequest(params, res, record, outParam, _resolve) - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.outerCallbackRequest(params, {status: false, message: 500, ErrCode: 'E', ErrMesg: 500}, record, outParam, _resolve) }) } @@ -2426,6 +2435,29 @@ duration: 5 }) } + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: 'https://sso.mk9h.cn/webapi/dologon', + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } }) }) } @@ -2996,8 +3028,8 @@ className = 'mk-btn mk-' + (btn.class || 'unset') } - if (loadingNumber && !loadingTotal && btn.$toolbtn && (!btn.show || btn.show === 'button')) { - label = (loadingNumber && !loadingTotal ? `(${loadingNumber})` : '') + btn.label + if (loadingNumber && btn.progress !== 'progressbar' && btn.$toolbtn && (!btn.show || btn.show === 'button')) { + label = (loadingNumber ? `(${loadingNumber})` : '') + btn.label } return <> diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 2bbfe85..4c1f0bc 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -533,7 +533,7 @@ return Api.getSystemCacheConfig(param) }).then(result => { - if (!result) { + if (!result || result.ErrCode === 'LoginError') { this.setState({ loading: false }) return } @@ -1262,7 +1262,7 @@ return Api.genericInterface(res) }).then(response => { - if (!response) return + if (!response || response.ErrCode === 'LoginError') return if (ver_token && response.ErrMesg === 'token_error') { this.execError(response) @@ -1291,7 +1291,7 @@ _resolve({next: false, list: []}) } }).then(response => { - if (!response) return + if (!response || response.ErrCode === 'LoginError') return if (response.status) { _list.push(response) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 067bfd2..7623755 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -467,6 +467,31 @@ item.options = fromJS(item.oriOptions).toJS() } item.linkSubField = null + } else if (item.type === 'switch' && item.linkSubField) { + item.options = [] + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } + }) + + if (item.subFields.length === 0) { + item.subFields = null + } else { + reFieldsVal = reFieldsVal || {} + + let val = item.initval === item.openVal ? item.openText : item.closeText + + item.subFields.forEach(n => { + reFieldsVal[n.field] = val || '' + }) + } + item.linkSubField = null } // if (item.type === 'link') { @@ -1011,7 +1036,7 @@ className = 'checkcard' content = (<MKCheckCard config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) } else if (item.type === 'switch') { - content = (<MKSwitch config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) + content = (<MKSwitch config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) } else if (item.type === 'check') { content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) } else if (item.type === 'checkbox') { diff --git a/src/tabviews/zshare/mutilform/mkSwitch/index.jsx b/src/tabviews/zshare/mutilform/mkSwitch/index.jsx index 0601054..62f8822 100644 --- a/src/tabviews/zshare/mutilform/mkSwitch/index.jsx +++ b/src/tabviews/zshare/mutilform/mkSwitch/index.jsx @@ -2,6 +2,8 @@ import PropTypes from 'prop-types' import { Switch } from 'antd' +import MKEmitter from '@/utils/events.js' + class MKSwitch extends Component { static propTpyes = { config: PropTypes.object, @@ -15,10 +17,21 @@ onChange = (val) => { const { config } = this.props + let other = {} + if (config.subFields) { + let _val = val ? config.openText : config.closeText + config.subFields.forEach((n, i) => { + other[n.field] = _val || '' + setTimeout(() => { + MKEmitter.emit('mkFC', 'input', n.uuid, _val || '') + }, i * 5) + }) + } + if (val) { - this.props.onChange(config.openVal) + this.props.onChange(config.openVal, other) } else { - this.props.onChange(config.closeVal) + this.props.onChange(config.closeVal, other) } } diff --git a/src/tabviews/zshare/mutilform/mkVercode/index.jsx b/src/tabviews/zshare/mutilform/mkVercode/index.jsx index dfa614b..c0569d0 100644 --- a/src/tabviews/zshare/mutilform/mkVercode/index.jsx +++ b/src/tabviews/zshare/mutilform/mkVercode/index.jsx @@ -146,7 +146,30 @@ } else { this.props.onSend(send_type, timestamp, n_id) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: 'https://sso.mk9h.cn/webapi/dologon', + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } + clearTimeout(this.timer) this.setState({ verdisabled: false, @@ -182,7 +205,30 @@ } else { this.props.onSend(send_type, timestamp, n_id) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: 'https://sso.mk9h.cn/webapi/dologon', + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } + clearTimeout(this.timer) this.setState({ verdisabled: false, diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 6d282da..6eb1a3b 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -354,6 +354,7 @@ {/* 缂栬緫鎼滅储鏉′欢 */} <Modal title={card && card.copyType === 'search' ? '鎼滅储鏉′欢-澶嶅埗' : '鎼滅储鏉′欢-缂栬緫'} + wrapClassName="mk-scroll-modal" visible={visible} width={850} maskClosable={false} diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 2dea436..d9ef0e8 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3145,7 +3145,7 @@ type: 'text', key: 'separator', label: '杩炴帴绗�', - initVal: card.separator === undefined ? '/' : card.separator, + initVal: card.separator === undefined ? ',' : card.separator, tooltip: '琛ㄥ崟鎻愪氦鏃朵俊鎭箣闂寸殑杩炴帴绗︺�傛敞锛氳繛鎺ョ涓虹┖鏃讹紝鍒濆鍖栨椂濉厖鍏朵粬琛ㄥ崟鏃犳晥銆�', required: false, readonly: false @@ -4056,7 +4056,7 @@ type: 'multiselect', key: 'linkSubField', label: '濉厖琛ㄥ崟', - tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆�', + tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑锛屽紑鍏充細灏嗘彁绀烘枃鏈~鍏ユ琛ㄥ崟銆�', initVal: card.linkSubField || [], options: inputfields }, diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index ac5c8a7..364f8a2 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -28,7 +28,7 @@ multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'], link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'], fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], - switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], + switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'], date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'], datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'place', 'marginTop', 'marginBottom'], diff --git a/src/templates/zshare/verifycard/uniqueform/index.jsx b/src/templates/zshare/verifycard/uniqueform/index.jsx index 2c1e3d2..5249e9c 100644 --- a/src/templates/zshare/verifycard/uniqueform/index.jsx +++ b/src/templates/zshare/verifycard/uniqueform/index.jsx @@ -97,7 +97,7 @@ {btn.Ot !== 'requiredOnce' ? <Col span={7}> <Form.Item label="楠岃瘉绫诲瀷"> {getFieldDecorator('verifyType', { - initialValue: 'physical', + initialValue: 'logic', rules: [ { required: true, diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index ff500da..2433125 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -112,6 +112,21 @@ forbid = false UNSAFE_componentWillMount() { + if (sessionStorage.getItem('devError') === 'true') { + sessionStorage.clear() + window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') + window.location.reload() + return + } + + if (!sessionStorage.getItem('UserID')) { + sessionStorage.removeItem('isEditState') + this.props.history.replace('/login') + return + } + + window.GLOB.developing = true + document.body.className = '' this.getAppList() this.getSmStemp() diff --git a/src/views/basedesign/index.jsx b/src/views/basedesign/index.jsx index b89d9cc..bc036a1 100644 --- a/src/views/basedesign/index.jsx +++ b/src/views/basedesign/index.jsx @@ -40,6 +40,21 @@ } UNSAFE_componentWillMount() { + if (sessionStorage.getItem('devError') === 'true') { + sessionStorage.clear() + window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') + window.location.reload() + return + } + + if (!sessionStorage.getItem('UserID')) { + sessionStorage.removeItem('isEditState') + this.props.history.replace('/login') + return + } + + window.GLOB.developing = true + try { let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) diff --git a/src/views/interface/history/index.jsx b/src/views/interface/history/index.jsx index c9c9143..8b92672 100644 --- a/src/views/interface/history/index.jsx +++ b/src/views/interface/history/index.jsx @@ -211,7 +211,7 @@ interface: window.GLOB.baseurl + 'webapi/dostars', method: 'POST', params: [], - raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"" + (sessionStorage.getItem('LoginUID') || "******") + "\",\n \"UserID\":\"" + (sessionStorage.getItem('UserID') || "******") + "\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}", + raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"@loginuid@\",\n \"UserID\":\"@userid@\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}", id: 'dologon' } MKEmitter.emit('useInterface', m) diff --git a/src/views/interface/workspace/request/index.jsx b/src/views/interface/workspace/request/index.jsx index ae73278..33f2c1e 100644 --- a/src/views/interface/workspace/request/index.jsx +++ b/src/views/interface/workspace/request/index.jsx @@ -95,7 +95,8 @@ } else if (config.active === 'raw') { if (config.raw) { try { - raws = JSON.parse(config.raw) + raws = config.raw.replace(/@userid@/ig, sessionStorage.getItem('UserID') || '').replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID') || '') + raws = JSON.parse(raws) } catch (e) { Modal.error({ title: '鍙傛暟鏍煎紡閿欒锛屽繀椤讳负JSON鏍煎紡锛�' @@ -281,6 +282,7 @@ <Radio value={'formData'}>formData</Radio> <Radio value={'raw'}>raw</Radio> </Radio.Group> + {active === 'raw' ? <span style={{float: 'right', color: '#a5a5a5', fontSize: '13px'}}>娉細浣跨敤@userid@銆丂loginuid@鏃跺皢鑷姩鏇挎崲銆�</span> : null} </div> <div className={'body-content ' + (active === 'none' ? 'show' : '')}> <div className="no-body">This request does not have a body</div> diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 9cce0f9..c160a08 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { message, Modal, notification } from 'antd' +import { message, Modal } from 'antd' import md5 from 'md5' import moment from 'moment' @@ -311,27 +311,6 @@ } } - if (sessionStorage.getItem('loginError')) { - try { - let res = JSON.parse(sessionStorage.getItem('loginError')) - console.info(res.url) - console.info(res.request) - console.info(res.response) - - let result = JSON.parse(res.response) - - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } catch (e) {} - - setTimeout(() => { - sessionStorage.removeItem('loginError') - }, 2000) - } - const _addressUrl = _href + 'queryAddress' if (localStorage.getItem(_addressUrl) === 'true') { @@ -509,7 +488,30 @@ authError: res.message }) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: _id, + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa(_id + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: _rduri.replace('dostars', 'dologon'), + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } + if (index === -1 || index > 10) { this.setState({ auth: false, diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index eda2530..fe22bd9 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -329,7 +329,30 @@ }) message.warning(res.message) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') { + let param = { + func: 's_visitor_login', + timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), + SessionUid: 'bh0bapabtd45epsgra79segbch6c1ibk', + TypeCharOne: 'pc', + appkey: '202004041613277377A6A2456D34A4948AE84' + } + + param.LText = md5(window.btoa('bh0bapabtd45epsgra79segbch6c1ibk' + param.timestamp)) + param.secretkey = md5(param.LText + 'mingke' + param.timestamp) + + let params = { + url: 'https://sso.mk9h.cn/webapi/dologon', + method: 'post', + data: JSON.stringify(param) + } + + Api.directRequest(params) + + return + } + if (LoginVerCodeTimer) { clearTimeout(LoginVerCodeTimer) } -- Gitblit v1.8.0