From e3d44b5694b87e8b32d468d8b97fdd409da10b52 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 29 六月 2023 09:23:43 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/modalform/index.jsx | 2 src/tabviews/custom/components/editor/braft-editor/index.jsx | 34 src/menu/components/chart/antv-X6/index.scss | 177 - src/tabviews/custom/popview/index.jsx | 41 src/tabviews/zshare/actionList/newpagebutton/index.jsx | 38 src/views/design/sidemenu/index.jsx | 2 src/tabviews/commontable/index.jsx | 2 report.20230625.164948.17280.0.001.json | 605 ++++ src/menu/components/form/formaction/formconfig.jsx | 2 src/tabviews/custom/components/card/cardcellList/index.jsx | 12 src/tabviews/custom/components/card/prop-card/index.jsx | 17 src/tabviews/zshare/mutilform/mkCheckCard/index.scss | 8 src/views/mkiframe/index.scss | 10 src/menu/components/card/cardcellcomponent/index.jsx | 4 src/tabviews/custom/components/table/normal-table/index.jsx | 17 src/tabviews/custom/components/chart/antv-pie/index.jsx | 16 src/tabviews/custom/components/timeline/normal-timeline/index.jsx | 17 src/menu/components/group/groupcomponents/card.jsx | 3 src/components/breadview/index.jsx | 21 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss | 99 src/tabviews/custom/components/chart/antv-X6/index.jsx | 1662 ++++++++++++ src/menu/components/share/actioncomponent/actionform/index.jsx | 11 src/tabviews/custom/index.jsx | 57 src/menu/components/tabs/tabcomponents/card.jsx | 3 src/menu/components/tabs/paste/index.jsx | 2 src/tabviews/custom/components/chart/antv-scatter/index.jsx | 16 src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 17 package-lock.json | 5 src/menu/components/card/cardcellcomponent/dragaction/index.scss | 1 src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 16 src/menu/components/group/groupcomponents/index.jsx | 1 src/menu/components/chart/antv-X6/chartcompile/index.jsx | 141 src/tabviews/custom/components/chart/antv-G6/index.jsx | 16 src/views/design/sidemenu/thdmenuform/index.jsx | 15 src/views/basedesign/index.jsx | 8 src/tabviews/custom/components/table/edit-table/index.jsx | 17 src/tabviews/zshare/actionList/index.jsx | 1 src/api/index.js | 14 src/tabviews/custom/components/form/simple-form/index.jsx | 17 src/tabviews/subtable/index.jsx | 2 src/tabviews/custom/components/iframe/index.jsx | 23 src/tabviews/custom/components/card/table-card/index.jsx | 16 src/tabviews/zshare/mutilform/mkCheckCard/index.jsx | 26 src/menu/components/chart/antv-X6/xflow.json | 986 +++++++ src/menu/datasource/verifycard/customscript/index.scss | 66 src/tabviews/custom/components/form/step-form/index.jsx | 17 src/views/login/index.jsx | 26 src/components/keyInterface/index.jsx | 8 src/tabviews/custom/components/code/sand-box/index.jsx | 34 src/menu/components/group/paste/index.jsx | 2 src/tabviews/custom/components/tree/antd-tree/index.jsx | 17 src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx | 64 src/tabviews/zshare/normalTable/index.jsx | 5 src/views/mkiframe/index.jsx | 187 + src/views/menudesign/menuform/index.jsx | 16 src/menu/components/tabs/tabcomponents/index.jsx | 1 src/tabviews/basetable/index.jsx | 15 src/views/billprint/index.jsx | 7 src/menu/menushell/card.jsx | 8 src/tabviews/subtabtable/index.jsx | 2 src/menu/components/iframe/options.jsx | 3 src/views/design/sidemenu/editthdmenu/index.jsx | 2 src/menu/modulesource/option.jsx | 4 src/tabviews/custom/components/card/data-card/index.jsx | 17 src/menu/components/share/actioncomponent/formconfig.jsx | 51 src/tabviews/custom/components/group/normal-group/index.jsx | 7 src/menu/stylecontroller/styleInput/index.jsx | 3 src/router/index.js | 5 src/menu/pastecontroller/index.jsx | 2 src/tabviews/custom/components/carousel/prop-card/index.jsx | 16 src/components/tabview/index.jsx | 23 src/components/tabview/index.scss | 5 src/tabviews/custom/components/table/base-table/index.jsx | 17 src/components/header/index.jsx | 40 src/tabviews/custom/components/card/double-data-card/index.jsx | 17 src/menu/datasource/verifycard/customscript/index.jsx | 85 src/menu/components/chart/antv-X6/index.jsx | 699 +--- src/tabviews/custom/components/carousel/data-card/index.jsx | 16 src/views/tabledesign/menuform/index.jsx | 11 src/tabviews/iframe/index.jsx | 1 src/components/breadview/index.scss | 5 src/tabviews/custom/components/chart/custom-chart/index.jsx | 33 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx | 455 +++ src/index.js | 2 src/tabviews/custom/components/form/tab-form/index.jsx | 17 src/tabviews/zshare/actionList/tabbutton/index.jsx | 9 src/tabviews/custom/components/share/tabtransfer/index.jsx | 7 src/menu/stylecontroller/index.jsx | 101 src/tabviews/rolemanage/index.jsx | 1 src/menu/components/chart/antv-X6/lane.json | 1162 ++++++++ src/templates/zshare/formconfig.jsx | 30 src/tabviews/custom/components/interfaces/interItem/index.jsx | 17 /dev/null | 67 src/tabviews/custom/components/chart/antv-X6/index.scss | 207 + src/assets/mobimg/xflow.png | 0 src/tabviews/custom/components/card/balcony/index.jsx | 18 package.json | 1 src/utils/option.js | 8 98 files changed, 6,759 insertions(+), 1,080 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f465c9..2989e07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -657,6 +657,11 @@ "resolved": "https://registry.npmjs.org/@antv/x6-plugin-dnd/-/x6-plugin-dnd-2.0.5.tgz", "integrity": "sha512-g8GGJS2XmM8C59juOBiFqaR/f8i8y8tqw9sJNwta7s1Phh3hwDd7o4kk36Kk5eTKkfZfnjEyWHMOqp/h+EDibQ==" }, + "@antv/x6-plugin-export": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@antv/x6-plugin-export/-/x6-plugin-export-2.1.6.tgz", + "integrity": "sha512-m0ukMmZhrFE5n7uCR43DVQBdiUfpjGN+vm1mc+6RTZdHK8pa6Mxr0RZztaxPy34YA4tli+bGY3ePslsNPfh6PQ==" + }, "@antv/x6-plugin-history": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@antv/x6-plugin-history/-/x6-plugin-history-2.2.3.tgz", diff --git a/package.json b/package.json index ab2d13a..a25c806 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@antv/x6": "^2.11.1", "@antv/x6-plugin-clipboard": "^2.1.6", "@antv/x6-plugin-dnd": "^2.0.5", + "@antv/x6-plugin-export": "^2.1.6", "@antv/x6-plugin-history": "^2.2.3", "@antv/x6-plugin-keyboard": "^2.2.1", "@antv/x6-plugin-scroller": "^2.0.9", diff --git a/report.20230625.164948.17280.0.001.json b/report.20230625.164948.17280.0.001.json new file mode 100644 index 0000000..c8baabc --- /dev/null +++ b/report.20230625.164948.17280.0.001.json @@ -0,0 +1,605 @@ + +{ + "header": { + "event": "Allocation failed - JavaScript heap out of memory", + "trigger": "FatalError", + "filename": "report.20230625.164948.17280.0.001.json", + "dumpEventTime": "2023-06-25T16:49:48Z", + "dumpEventTimeStamp": "1687682988567", + "processId": 17280, + "cwd": "E:\\project\\pc-plat", + "commandLine": [ + "node", + "scripts/start.js" + ], + "nodejsVersion": "v12.4.0", + "wordSize": 64, + "arch": "x64", + "platform": "win32", + "componentVersions": { + "node": "12.4.0", + "v8": "7.4.288.27-node.18", + "uv": "1.29.1", + "zlib": "1.2.11", + "brotli": "1.0.7", + "ares": "1.15.0", + "modules": "72", + "nghttp2": "1.38.0", + "napi": "4", + "llhttp": "1.1.3", + "http_parser": "2.8.0", + "openssl": "1.1.1b", + "cldr": "35.1", + "icu": "64.2", + "tz": "2019a", + "unicode": "12.1" + }, + "release": { + "name": "node", + "headersUrl": "https://nodejs.org/download/release/v12.4.0/node-v12.4.0-headers.tar.gz", + "sourceUrl": "https://nodejs.org/download/release/v12.4.0/node-v12.4.0.tar.gz", + "libUrl": "https://nodejs.org/download/release/v12.4.0/win-x64/node.lib" + }, + "osName": "Windows_NT", + "osRelease": "10.0.19045", + "osVersion": "Windows 10 Pro", + "osMachine": "x86_64", + "host": "LAPTOP-67RFI4SB" + }, + "javascriptStack": { + "message": "No stack.", + "stack": [ + "Unavailable." + ] + }, + "nativeStack": [ + { + "pc": "0x00007ff66f1e64a9", + "symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+9161" + }, + { + "pc": "0x00007ff66f1e9d94", + "symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+23732" + }, + { + "pc": "0x00007ff66f1e8db8", + "symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+19672" + }, + { + "pc": "0x00007ff66f2d256b", + "symbol": "uv_loop_fork+48251" + }, + { + "pc": "0x00007ff66f60a56e", + "symbol": "v8::internal::Parser::ReportMessageAt+206" + }, + { + "pc": "0x00007ff66f5de5ea", + "symbol": "v8::internal::wasm::StreamingDecoder::Fail+666" + }, + { + "pc": "0x00007ff66f674a3c", + "symbol": "v8::internal::Heap::CreateFillerObjectAt+2972" + }, + { + "pc": "0x00007ff66f67c7af", + "symbol": "v8::internal::LocalEmbedderHeapTracer::NotifyV8MarkingWorklistWasEmpty+5375" + }, + { + "pc": "0x00007ff66f672e23", + "symbol": "v8::internal::Heap::CollectGarbage+1235" + }, + { + "pc": "0x00007ff66f671524", + "symbol": "v8::internal::GCTracer::AddScopeSample+1316" + }, + { + "pc": "0x00007ff66f6b2153", + "symbol": "v8::internal::Factory::NewFillerObject+67" + }, + { + "pc": "0x00007ff66f9d8cc6", + "symbol": "v8::internal::OptimizingCompileDispatcher::Unblock+116966" + }, + { + "pc": "0x00007ff66fe74196", + "symbol": "v8::internal::NativesCollection<0>::GetScriptsSource+662454" + } + ], + "javascriptHeap": { + "totalMemory": 2171875328, + "totalCommittedMemory": 2171875328, + "usedMemory": 1820032688, + "availableMemory": 58851592, + "memoryLimit": 2197815296, + "heapSpaces": { + "read_only_space": { + "memorySize": 524288, + "committedMemory": 524288, + "capacity": 523976, + "used": 31712, + "available": 492264 + }, + "new_space": { + "memorySize": 33554432, + "committedMemory": 33554432, + "capacity": 16767232, + "used": 5485640, + "available": 11281592 + }, + "old_space": { + "memorySize": 1845616640, + "committedMemory": 1845616640, + "capacity": 1531953792, + "used": 1527583256, + "available": 4370536 + }, + "code_space": { + "memorySize": 3833856, + "committedMemory": 3833856, + "capacity": 3405952, + "used": 3405952, + "available": 0 + }, + "map_space": { + "memorySize": 10489856, + "committedMemory": 10489856, + "capacity": 6226400, + "used": 6226400, + "available": 0 + }, + "large_object_space": { + "memorySize": 277233664, + "committedMemory": 277233664, + "capacity": 276749424, + "used": 276749424, + "available": 0 + }, + "code_large_object_space": { + "memorySize": 622592, + "committedMemory": 622592, + "capacity": 550304, + "used": 550304, + "available": 0 + }, + "new_large_object_space": { + "memorySize": 0, + "committedMemory": 0, + "capacity": 16767232, + "used": 0, + "available": 16767232 + } + } + }, + "resourceUsage": { + "userCpuSeconds": 1725.56, + "kernelCpuSeconds": 105.796, + "cpuConsumptionPercent": 6.63343, + "maxRss": 2244743168, + "pageFaults": { + "IORequired": 8971633, + "IONotRequired": 0 + }, + "fsActivity": { + "reads": 31233, + "writes": 89 + } + }, + "libuv": [ + ], + "environmentVariables": { + "=C:": "C:\\", + "=E:": "E:\\project\\pc-plat", + "ALLUSERSPROFILE": "C:\\ProgramData", + "ANDROID_SDK_HOME": "D:\\Program Files (x86)\\Android\\android-sdk", + "APPDATA": "C:\\Users\\king\\AppData\\Roaming", + "BABEL_ENV": "development", + "CHROME_CRASHPAD_PIPE_NAME": "\\\\.\\pipe\\crashpad_3112_MPXUUELTKOUORVVL", + "CLASSPATH": ".;C:\\Program Files\\Java\\jdk-13.0.1\\lib\\dt.jar;C:\\Program Files\\Java\\jdk-13.0.1\\lib\\tools.jar;", + "COLORTERM": "truecolor", + "CommonProgramFiles": "C:\\Program Files\\Common Files", + "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files", + "CommonProgramW6432": "C:\\Program Files\\Common Files", + "COMPUTERNAME": "LAPTOP-67RFI4SB", + "ComSpec": "C:\\WINDOWS\\system32\\cmd.exe", + "configsetroot": "C:\\WINDOWS\\ConfigSetRoot", + "DriverData": "C:\\Windows\\System32\\Drivers\\DriverData", + "FPS_BROWSER_APP_PROFILE_STRING": "Internet Explorer", + "FPS_BROWSER_USER_PROFILE_STRING": "Default", + "GIT_ASKPASS": "d:\\Program Files\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass.sh", + "HOME": "C:\\Users\\king", + "HOMEDRIVE": "C:", + "HOMEPATH": "\\Users\\king", + "INIT_CWD": "E:\\project\\pc-plat", + "JAVA_HOME": "C:\\Program Files\\Java\\jdk-13.0.1", + "LANG": "zh_CN.UTF-8", + "LOCALAPPDATA": "C:\\Users\\king\\AppData\\Local", + "LOGONSERVER": "\\\\LAPTOP-67RFI4SB", + "NODE": "C:\\Program Files\\nodejs\\node.exe", + "NODE_ENV": "development", + "NODE_EXE": "C:\\Program Files\\nodejs\\\\node.exe", + "NODE_PATH": "", + "NPM_CLI_JS": "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js", + "npm_config_access": "", + "npm_config_allow_same_version": "", + "npm_config_also": "", + "npm_config_always_auth": "", + "npm_config_argv": "{\"remain\":[],\"cooked\":[\"run\",\"dev\"],\"original\":[\"run\",\"dev\"]}", + "npm_config_audit": "true", + "npm_config_audit_level": "low", + "npm_config_auth_type": "legacy", + "npm_config_before": "", + "npm_config_bin_links": "true", + "npm_config_browser": "", + "npm_config_ca": "", + "npm_config_cache": "C:\\Users\\king\\AppData\\Roaming\\npm-cache", + "npm_config_cache_lock_retries": "10", + "npm_config_cache_lock_stale": "60000", + "npm_config_cache_lock_wait": "10000", + "npm_config_cache_max": "Infinity", + "npm_config_cache_min": "10", + "npm_config_cafile": "", + "npm_config_cert": "", + "npm_config_cidr": "", + "npm_config_color": "true", + "npm_config_commit_hooks": "true", + "npm_config_depth": "Infinity", + "npm_config_description": "true", + "npm_config_dev": "", + "npm_config_dry_run": "", + "npm_config_editor": "notepad.exe", + "npm_config_engine_strict": "", + "npm_config_fetch_retries": "2", + "npm_config_fetch_retry_factor": "10", + "npm_config_fetch_retry_maxtimeout": "60000", + "npm_config_fetch_retry_mintimeout": "10000", + "npm_config_force": "", + "npm_config_git": "git", + "npm_config_git_tag_version": "true", + "npm_config_global": "", + "npm_config_globalconfig": "C:\\Program Files\\nodejs\\etc\\npmrc", + "npm_config_globalignorefile": "C:\\Program Files\\nodejs\\etc\\npmignore", + "npm_config_global_style": "", + "npm_config_group": "", + "npm_config_ham_it_up": "", + "npm_config_heading": "npm", + "npm_config_https_proxy": "", + "npm_config_if_present": "", + "npm_config_ignore_prepublish": "", + "npm_config_ignore_scripts": "", + "npm_config_init_author_email": "", + "npm_config_init_author_name": "", + "npm_config_init_author_url": "", + "npm_config_init_license": "ISC", + "npm_config_init_module": "C:\\Users\\king\\.npm-init.js", + "npm_config_init_version": "1.0.0", + "npm_config_json": "", + "npm_config_key": "", + "npm_config_legacy_bundling": "", + "npm_config_link": "", + "npm_config_local_address": "", + "npm_config_loglevel": "notice", + "npm_config_logs_max": "10", + "npm_config_long": "", + "npm_config_maxsockets": "50", + "npm_config_message": "%s", + "npm_config_metrics_registry": "https://registry.npmjs.org/", + "npm_config_node_gyp": "C:\\Users\\king\\AppData\\Roaming\\nvm\\v12.4.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js", + "npm_config_node_options": "", + "npm_config_node_version": "12.4.0", + "npm_config_noproxy": "", + "npm_config_offline": "", + "npm_config_onload_script": "", + "npm_config_only": "", + "npm_config_optional": "true", + "npm_config_otp": "", + "npm_config_package_lock": "true", + "npm_config_package_lock_only": "", + "npm_config_parseable": "", + "npm_config_prefer_offline": "", + "npm_config_prefer_online": "", + "npm_config_prefix": "C:\\Program Files\\nodejs", + "npm_config_preid": "", + "npm_config_production": "", + "npm_config_progress": "true", + "npm_config_proxy": "", + "npm_config_read_only": "", + "npm_config_rebuild_bundle": "true", + "npm_config_registry": "https://registry.npmjs.org/", + "npm_config_rollback": "true", + "npm_config_save": "true", + "npm_config_save_bundle": "", + "npm_config_save_dev": "", + "npm_config_save_exact": "", + "npm_config_save_optional": "", + "npm_config_save_prefix": "^", + "npm_config_save_prod": "", + "npm_config_scope": "", + "npm_config_scripts_prepend_node_path": "warn-only", + "npm_config_script_shell": "", + "npm_config_searchexclude": "", + "npm_config_searchlimit": "20", + "npm_config_searchopts": "", + "npm_config_searchstaleness": "900", + "npm_config_send_metrics": "", + "npm_config_shell": "C:\\WINDOWS\\system32\\cmd.exe", + "npm_config_shrinkwrap": "true", + "npm_config_sign_git_commit": "", + "npm_config_sign_git_tag": "", + "npm_config_sso_poll_frequency": "500", + "npm_config_sso_type": "oauth", + "npm_config_strict_ssl": "true", + "npm_config_tag": "latest", + "npm_config_tag_version_prefix": "v", + "npm_config_timing": "", + "npm_config_tmp": "C:\\Users\\king\\AppData\\Local\\Temp", + "npm_config_umask": "0000", + "npm_config_unicode": "", + "npm_config_unsafe_perm": "true", + "npm_config_update_notifier": "true", + "npm_config_usage": "", + "npm_config_user": "", + "npm_config_userconfig": "C:\\Users\\king\\.npmrc", + "npm_config_user_agent": "npm/6.9.0 node/v12.4.0 win32 x64", + "npm_config_version": "", + "npm_config_versions": "", + "npm_config_viewer": "browser", + "npm_execpath": "C:\\Users\\king\\AppData\\Roaming\\nvm\\v12.4.0\\node_modules\\npm\\bin\\npm-cli.js", + "npm_lifecycle_event": "dev", + "npm_lifecycle_script=set PORT": "3001 && node scripts/start.js", + "npm_node_execpath": "C:\\Program Files\\nodejs\\node.exe", + "npm_package_babel_plugins_0_0": "import", + "npm_package_babel_plugins_0_1_libraryName": "antd", + "npm_package_babel_plugins_0_1_style": "css", + "npm_package_babel_plugins_0_2": "pc", + "npm_package_babel_plugins_1_0": "import", + "npm_package_babel_plugins_1_1_libraryName": "antd-mobile", + "npm_package_babel_plugins_1_1_style": "css", + "npm_package_babel_plugins_1_2": "mobile", + "npm_package_babel_presets_0": "react-app", + "npm_package_browserslist_development_0": "last 1 chrome version", + "npm_package_browserslist_development_1": "last 1 firefox version", + "npm_package_browserslist_development_2": "last 1 safari version", + "npm_package_browserslist_production_0": ">0.2%", + "npm_package_browserslist_production_1": "not dead", + "npm_package_browserslist_production_2": "not op_mini all", + "npm_package_dependencies_antd": "^3.26.20", + "npm_package_dependencies_antd_mobile": "^5.14.2", + "npm_package_dependencies_axios": "^0.19.0", + "npm_package_dependencies_babel_eslint": "10.0.2", + "npm_package_dependencies_babel_jest": "^24.8.0", + "npm_package_dependencies_babel_loader": "8.0.6", + "npm_package_dependencies_babel_plugin_import": "^1.11.0", + "npm_package_dependencies_babel_plugin_named_asset_import": "^0.3.3", + "npm_package_dependencies_babel_preset_react_app": "9.0.0", + "npm_package_dependencies_braft_editor": "^2.3.9", + "npm_package_dependencies_braft_extensions": "^0.1.1", + "npm_package_dependencies_browserslist": "^4.13.0", + "npm_package_dependencies_camelcase": "^5.2.0", + "npm_package_dependencies_case_sensitive_paths_webpack_plugin": "2.2.0", + "npm_package_dependencies_codemirror": "^5.52.2", + "npm_package_dependencies_crypto_js": "^4.1.1", + "npm_package_dependencies_css_loader": "2.1.1", + "npm_package_dependencies_dotenv": "6.2.0", + "npm_package_dependencies_dotenv_expand": "4.2.0", + "npm_package_dependencies_dragact": "^0.2.12", + "npm_package_dependencies_echarts": "^5.2.1", + "npm_package_dependencies_echarts_for_react": "^2.0.15-beta.1", + "npm_package_dependencies_eslint": "^6.1.0", + "npm_package_dependencies_eslint_config_react_app": "^5.0.1", + "npm_package_dependencies_eslint_loader": "2.2.1", + "npm_package_dependencies_eslint_plugin_flowtype": "3.13.0", + "npm_package_dependencies_eslint_plugin_import": "2.18.2", + "npm_package_dependencies_eslint_plugin_jsx_a11y": "6.2.3", + "npm_package_dependencies_eslint_plugin_react": "7.14.3", + "npm_package_dependencies_eslint_plugin_react_hooks": "^1.6.1", + "npm_package_dependencies_exceljs": "^4.2.1", + "npm_package_dependencies_file_loader": "3.0.1", + "npm_package_dependencies_file_saver": "^2.0.5", + "npm_package_dependencies_fs_extra": "7.0.1", + "npm_package_dependencies_html2canvas": "^1.0.0-rc.7", + "npm_package_dependencies_html_webpack_plugin": "4.0.0-beta.5", + "npm_package_dependencies_http_proxy_middleware": "^0.20.0", + "npm_package_dependencies_identity_obj_proxy": "3.0.0", + "npm_package_dependencies_immutability_helper": "^3.0.1", + "npm_package_dependencies_immutable": "^4.0.0-rc.12", + "npm_package_dependencies_insert_css": "^2.0.0", + "npm_package_dependencies_is_wsl": "^1.1.0", + "npm_package_dependencies_jest": "24.8.0", + "npm_package_dependencies_jest_environment_jsdom_fourteen": "0.1.0", + "npm_package_dependencies_jest_resolve": "24.8.0", + "npm_package_dependencies_jest_watch_typeahead": "0.3.1", + "npm_package_dependencies_jsbarcode": "^3.11.3", + "npm_package_dependencies_jspdf": "^2.5.1", + "npm_package_dependencies_jssha": "^3.2.0", + "npm_package_dependencies_jszip": "^3.10.0", + "npm_package_dependencies_js_table2excel": "^1.0.3", + "npm_package_dependencies_md5": "^2.2.1", + "npm_package_dependencies_mini_css_extract_plugin": "0.5.0", + "npm_package_dependencies_moment": "^2.24.0", + "npm_package_dependencies_node_sass": "^4.12.0", + "npm_package_dependencies_optimize_css_assets_webpack_plugin": "5.0.3", + "npm_package_dependencies_pnp_webpack_plugin": "1.5.0", + "npm_package_dependencies_postcss_flexbugs_fixes": "4.1.0", + "npm_package_dependencies_postcss_loader": "3.0.0", + "npm_package_dependencies_postcss_normalize": "7.0.1", + "npm_package_dependencies_postcss_preset_env": "6.7.0", + "npm_package_dependencies_postcss_safe_parser": "4.0.1", + "npm_package_dependencies_prop_types": "^15.7.2", + "npm_package_dependencies_qrcode_react": "^1.0.0", + "npm_package_dependencies_rc_form": "^2.4.11", + "npm_package_dependencies_react": "^16.9.0", + "npm_package_dependencies_react_app_polyfill": "^1.0.2", + "npm_package_dependencies_react_codemirror2": "^7.1.0", + "npm_package_dependencies_react_color": "^2.18.1", + "npm_package_dependencies_react_dev_utils": "^9.0.3", + "npm_package_dependencies_react_dnd": "^9.4.0", + "npm_package_dependencies_react_dnd_html5_backend": "^9.4.0", + "npm_package_dependencies_react_dom": "^16.9.0", + "npm_package_dependencies_react_highlight_words": "^0.16.0", + "npm_package_dependencies_react_native": "^0.63.2", + "npm_package_dependencies_react_redux": "^7.1.1", + "npm_package_dependencies_react_router_dom": "^5.0.1", + "npm_package_dependencies_redux": "^4.0.4", + "npm_package_dependencies_redux_thunk": "^2.3.0", + "npm_package_dependencies_resolve": "1.12.0", + "npm_package_dependencies_resolve_url_loader": "3.1.0", + "npm_package_dependencies_sass_loader": "7.2.0", + "npm_package_dependencies_semver": "6.3.0", + "npm_package_dependencies_sheetjs_style": "^0.15.8", + "npm_package_dependencies_spark_md5": "^3.0.1", + "npm_package_dependencies_sql_formatter": "^11.0.2", + "npm_package_dependencies_style_loader": "1.0.0", + "npm_package_dependencies_terser_webpack_plugin": "1.4.1", + "npm_package_dependencies_ts_pnp": "1.1.2", + "npm_package_dependencies_url_loader": "2.1.0", + "npm_package_dependencies_video_react": "^0.14.1", + "npm_package_dependencies_webpack": "4.39.1", + "npm_package_dependencies_webpack_dev_server": "3.2.1", + "npm_package_dependencies_webpack_manifest_plugin": "2.0.4", + "npm_package_dependencies_workbox_webpack_plugin": "4.3.1", + "npm_package_dependencies_x2js": "^3.4.3", + "npm_package_dependencies_xlsx": "^0.15.5", + "npm_package_dependencies__antv_data_set": "^0.11.4", + "npm_package_dependencies__antv_g2": "^4.1.34", + "npm_package_dependencies__antv_g6": "^4.6.4", + "npm_package_dependencies__antv_util": "^2.0.17", + "npm_package_dependencies__antv_x6": "^2.11.1", + "npm_package_dependencies__antv_x6_plugin_clipboard": "^2.1.6", + "npm_package_dependencies__antv_x6_plugin_dnd": "^2.0.5", + "npm_package_dependencies__antv_x6_plugin_history": "^2.2.3", + "npm_package_dependencies__antv_x6_plugin_keyboard": "^2.2.1", + "npm_package_dependencies__antv_x6_plugin_scroller": "^2.0.9", + "npm_package_dependencies__antv_x6_plugin_selection": "^2.1.7", + "npm_package_dependencies__antv_x6_plugin_snapline": "^2.1.7", + "npm_package_dependencies__antv_x6_plugin_stencil": "^2.0.3", + "npm_package_dependencies__antv_x6_plugin_transform": "^2.1.7", + "npm_package_dependencies__antv_xflow": "^1.0.50", + "npm_package_dependencies__ant_design_icons": "^4.6.2", + "npm_package_dependencies__babel_core": "7.5.5", + "npm_package_dependencies__svgr_webpack": "4.3.2", + "npm_package_dependencies__typescript_eslint_eslint_plugin": "1.13.0", + "npm_package_dependencies__typescript_eslint_parser": "1.13.0", + "npm_package_dependencies__uiw_react_codemirror": "^2.2.1", + "npm_package_description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).", + "npm_package_devDependencies_typescript": "^4.0.2", + "npm_package_eslintConfig_extends": "react-app", + "npm_package_gitHead": "e095ca8ea64467afaff040cf4102b3eb54f37350", + "npm_package_homepage": "http://.", + "npm_package_jest_collectCoverageFrom_0": "src/**/*.{js,jsx,ts,tsx}", + "npm_package_jest_collectCoverageFrom_1": "!src/**/*.d.ts", + "npm_package_jest_moduleFileExtensions_0": "web.js", + "npm_package_jest_moduleFileExtensions_1": "js", + "npm_package_jest_moduleFileExtensions_2": "web.ts", + "npm_package_jest_moduleFileExtensions_3": "ts", + "npm_package_jest_moduleFileExtensions_4": "web.tsx", + "npm_package_jest_moduleFileExtensions_5": "tsx", + "npm_package_jest_moduleFileExtensions_6": "json", + "npm_package_jest_moduleFileExtensions_7": "web.jsx", + "npm_package_jest_moduleFileExtensions_8": "jsx", + "npm_package_jest_moduleFileExtensions_9": "node", + "npm_package_jest_moduleNameMapper__react_native_web_": "react-native-web", + "npm_package_jest_moduleNameMapper______module___css_sass_scss__": "identity-obj-proxy", + "npm_package_jest_roots_0": "<rootDir>/src", + "npm_package_jest_setupFiles_0": "react-app-polyfill/jsdom", + "npm_package_jest_testEnvironment": "jest-environment-jsdom-fourteen", + "npm_package_jest_testMatch_0": "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}", + "npm_package_jest_testMatch_1": "<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}", + "npm_package_jest_transformIgnorePatterns_0": "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$", + "npm_package_jest_transformIgnorePatterns_1": "^.+\\.module\\.(css|sass|scss)$", + "npm_package_jest_transform______css_": "<rootDir>/config/jest/cssTransform.js", + "npm_package_jest_transform_______js_jsx_ts_tsx__": "<rootDir>/node_modules/babel-jest", + "npm_package_jest_transform__________js_jsx_ts_tsx_css_json___": "<rootDir>/config/jest/fileTransform.js", + "npm_package_jest_watchPlugins_0": "jest-watch-typeahead/filename", + "npm_package_jest_watchPlugins_1": "jest-watch-typeahead/testname", + "npm_package_name": "pc-plat", + "npm_package_private": "true", + "npm_package_readmeFilename": "README.md", + "npm_package_scripts_build": "node scripts/build.js", + "npm_package_scripts_dev=set PORT": "3001 && node scripts/start.js", + "npm_package_scripts_test": "node scripts/test.js", + "npm_package_version": "0.1.0", + "NPM_PREFIX_NPM_CLI_JS": "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js", + "NUMBER_OF_PROCESSORS": "8", + "NVM_HOME": "C:\\Users\\king\\AppData\\Roaming\\nvm", + "NVM_SYMLINK": "C:\\Program Files\\nodejs", + "OneDrive": "C:\\Users\\king\\OneDrive", + "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined", + "OS": "Windows_NT", + "Path": "C:\\Users\\king\\AppData\\Roaming\\nvm\\v12.4.0\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin;E:\\project\\pc-plat\\node_modules\\.bin;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;D:\\Program Files\\Git\\cmd;D:\\Program Files\\Microsoft VS Code\\bin;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\VSShell\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\DTS\\Binn\\;C:\\Program Files\\TortoiseGit\\bin;D:\\Program Files\\mysql\\bin;C:\\Program Files\\Java\\jdk-13.0.1\\bin;C:\\Program Files\\Java\\jdk-13.0.1\\jre\\bin;D:\\Program Files\\Redis;D:\\Program Files (x86)\\Yarn\\bin\\;\";% ANDROID_SDK_HOME%\\platform-tools\";\";C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\\";D:\\Program Files (x86)\\Tencent\\寰俊web寮�鍙戣�呭伐鍏穃\dll;C:\\Users\\king\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Python37\\Scripts\\;C:\\Python37\\;C:\\Users\\king\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\king\\AppData\\Local\\Yarn\\bin;C:\\Users\\king\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs", + "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL", + "PORT": "3001 ", + "PROCESSOR_ARCHITECTURE": "AMD64", + "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 142 Stepping 10, GenuineIntel", + "PROCESSOR_LEVEL": "6", + "PROCESSOR_REVISION": "8e0a", + "ProgramData": "C:\\ProgramData", + "ProgramFiles": "C:\\Program Files", + "ProgramFiles(x86)": "C:\\Program Files (x86)", + "ProgramW6432": "C:\\Program Files", + "PROMPT": "$P$G", + "PSModulePath": "C:\\Users\\king\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules", + "PUBLIC": "C:\\Users\\Public", + "SESSIONNAME": "Console", + "SystemDrive": "C:", + "SystemRoot": "C:\\WINDOWS", + "TEMP": "C:\\Users\\king\\AppData\\Local\\Temp", + "TERM_PROGRAM": "vscode", + "TERM_PROGRAM_VERSION": "1.52.1", + "TMP": "C:\\Users\\king\\AppData\\Local\\Temp", + "USERDOMAIN": "LAPTOP-67RFI4SB", + "USERDOMAIN_ROAMINGPROFILE": "LAPTOP-67RFI4SB", + "USERNAME": "king", + "USERPROFILE": "C:\\Users\\king", + "VSCODE_GIT_ASKPASS_MAIN": "d:\\Program Files\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass-main.js", + "VSCODE_GIT_ASKPASS_NODE": "D:\\Program Files\\Microsoft VS Code\\Code.exe", + "VSCODE_GIT_IPC_HANDLE": "\\\\.\\pipe\\vscode-git-98b274b1e6-sock", + "windir": "C:\\WINDOWS", + "__PSLockDownPolicy": "0" + }, + "sharedObjects": [ + "C:\\Program Files\\nodejs\\node.exe", + "C:\\WINDOWS\\SYSTEM32\\ntdll.dll", + "C:\\WINDOWS\\System32\\KERNEL32.DLL", + "C:\\WINDOWS\\System32\\KERNELBASE.dll", + "C:\\WINDOWS\\System32\\WS2_32.dll", + "C:\\WINDOWS\\System32\\RPCRT4.dll", + "C:\\WINDOWS\\System32\\ADVAPI32.dll", + "C:\\WINDOWS\\System32\\msvcrt.dll", + "C:\\WINDOWS\\System32\\sechost.dll", + "C:\\WINDOWS\\System32\\USER32.dll", + "C:\\WINDOWS\\System32\\win32u.dll", + "C:\\WINDOWS\\System32\\GDI32.dll", + "C:\\WINDOWS\\System32\\gdi32full.dll", + "C:\\WINDOWS\\System32\\msvcp_win.dll", + "C:\\WINDOWS\\System32\\ucrtbase.dll", + "C:\\WINDOWS\\SYSTEM32\\dbghelp.dll", + "C:\\WINDOWS\\System32\\PSAPI.DLL", + "C:\\WINDOWS\\System32\\CRYPT32.dll", + "C:\\WINDOWS\\System32\\bcrypt.dll", + "C:\\WINDOWS\\SYSTEM32\\IPHLPAPI.DLL", + "C:\\WINDOWS\\SYSTEM32\\USERENV.dll", + "C:\\WINDOWS\\SYSTEM32\\WINMM.dll", + "C:\\WINDOWS\\System32\\IMM32.DLL", + "C:\\WINDOWS\\SYSTEM32\\powrprof.dll", + "C:\\WINDOWS\\SYSTEM32\\UMPDC.dll", + "C:\\WINDOWS\\system32\\uxtheme.dll", + "C:\\WINDOWS\\System32\\combase.dll", + "C:\\WINDOWS\\system32\\mswsock.dll", + "C:\\WINDOWS\\SYSTEM32\\kernel.appcore.dll", + "C:\\WINDOWS\\System32\\bcryptprimitives.dll", + "C:\\WINDOWS\\SYSTEM32\\CRYPTBASE.DLL", + "C:\\WINDOWS\\System32\\NSI.dll", + "C:\\WINDOWS\\SYSTEM32\\dhcpcsvc6.DLL", + "C:\\WINDOWS\\SYSTEM32\\dhcpcsvc.DLL", + "C:\\WINDOWS\\SYSTEM32\\DNSAPI.dll", + "C:\\WINDOWS\\system32\\napinsp.dll", + "C:\\WINDOWS\\system32\\pnrpnsp.dll", + "C:\\WINDOWS\\system32\\wshbth.dll", + "C:\\WINDOWS\\system32\\NLAapi.dll", + "C:\\WINDOWS\\System32\\winrnr.dll", + "C:\\Windows\\System32\\rasadhlp.dll", + "C:\\WINDOWS\\System32\\fwpuclnt.dll", + "\\\\?\\E:\\project\\pc-plat\\node_modules\\node-sass\\vendor\\win32-x64-72\\binding.node" + ] +} \ No newline at end of file diff --git a/src/api/index.js b/src/api/index.js index 54cf1dc..7cd5074 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -197,16 +197,20 @@ param.thd_party_openid = openid param.thd_party_appid = appid param.id = scanId - } else if (binding_type === 'login_check') { // appid 姝ゆ椂涓虹洰鏍� + } else if (binding_type === 'login_check') { // appid 姝ゆ椂涓虹洰鏍囧湴鍧� param.v_type = 'login_check' param.LoginUID = sessionStorage.getItem('LoginUID') || '' - url = appid.replace(/\/webapi(.*)/, '/webapi/dologon/s_visitor_login') - + if (!param.rduri) { param.rduri = window.GLOB.baseurl + 'webapi/dologon/s_visitor_login' } - - param.linkurl = appid.replace(/\/webapi(.*)/, '/index.html') + + if (appid) { + url = appid.replace(/\/webapi(.*)/, '/webapi/dologon/s_visitor_login') + param.linkurl = appid.replace(/\/webapi(.*)/, '/index.html') + } else { + param.linkurl = window.GLOB.linkurl + } } param.LText = md5(window.btoa(_SessionUid + param.timestamp + (param.linkurl || ''))) diff --git a/src/assets/mobimg/xflow.png b/src/assets/mobimg/xflow.png index 3fa7da2..f15d8dd 100644 --- a/src/assets/mobimg/xflow.png +++ b/src/assets/mobimg/xflow.png Binary files differ diff --git a/src/components/breadview/index.jsx b/src/components/breadview/index.jsx index b1f59ca..bc64507 100644 --- a/src/components/breadview/index.jsx +++ b/src/components/breadview/index.jsx @@ -15,7 +15,6 @@ const CustomPage = asyncComponent(() => import('@/tabviews/custom')) const CommonTable = asyncComponent(() => import('@/tabviews/commontable')) const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) -const CalendarPage = asyncComponent(() => import('@/tabviews/calendar')) const TreePage = asyncComponent(() => import('@/tabviews/treepage')) const Iframe = asyncComponent(() => import('@/tabviews/iframe')) const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) @@ -88,25 +87,23 @@ selectcomponent = (view) => { // 鏍规嵁tab椤典腑鑿滃崟淇℃伅锛岄�夋嫨鎵�闇�鐨勭粍浠� if (view.type === 'BaseTable') { - return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + return (<BaseTable MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'CustomPage') { - return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + return (<CustomPage MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'Home') { - return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) + return (<Home MenuID={view.MenuID} MenuName={view.MenuName}/>) } else if (view.type === 'RolePermission') { - return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) + return (<RoleManage MenuID={view.MenuID}/>) } else if (view.type === 'CommonTable') { - return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'TreePage') { - return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) - } else if (view.type === 'CalendarPage') { - return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) + return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) } else if (view.type === 'FormTab') { - return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) + return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) } else if (view.type === 'iframe') { - return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>) + return (<Iframe MenuID={view.MenuID} title={view.MenuName} url={view.src}/>) } else { - return (<NotFount key={view.MenuID} />) + return (<NotFount />) } } diff --git a/src/components/breadview/index.scss b/src/components/breadview/index.scss index 810603f..84c6567 100644 --- a/src/components/breadview/index.scss +++ b/src/components/breadview/index.scss @@ -30,10 +30,11 @@ } iframe { width: 100%; - height: calc(100vh - 115px); + height: calc(100vh - 92px); overflow-y: scroll; border: 0; - margin-top: 16px; + margin: 0px; + vertical-align: top; } .ant-back-top { bottom: 10px; diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index def0339..5ddbc2a 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -80,8 +80,10 @@ changeMenu (value) { // 涓昏彍鍗曞垏鎹� - if (value.OpenType === 'outpage') { - window.open(value.linkUrl) + if (value.OpenType === 'newpage') { + window.open(value.src) + } else if (value.OpenType === 'newtab') { + MKEmitter.emit('modifyTabs', value) } else if (value.OpenType === 'menu') { this.props.modifyMainMenu(value) } @@ -188,8 +190,13 @@ let PageParam = JSON.parse(fst.PageParam) if (PageParam.OpenType === 'outpage' && PageParam.linkUrl) { - fstItem.OpenType = 'outpage' - fstItem.linkUrl = PageParam.linkUrl + fstItem.OpenType = 'newpage' + fstItem.src = PageParam.linkUrl + if (/#\/iframe\//.test(fstItem.src)) { + fstItem.src = fstItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) + fstItem.type = 'iframe' + fstItem.OpenType = 'newtab' + } } } catch (e) {} } @@ -237,16 +244,23 @@ trdItem.hidden = PageParam.hidden || 'false' if (trdItem.type === 'NewPage') { + trdItem.OpenType = 'newpage' trdItem.src = PageParam.url || '' + if (/#\/iframe\//.test(trdItem.src)) { + trdItem.src = trdItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) + trdItem.type = 'iframe' + trdItem.OpenType = 'newtab' + } + } else if (trdItem.OpenType === 'view') { + trdItem.OpenType = 'newpage' + trdItem.src = '#/view/' + trd.MenuID + } else { + trdItem.src = '#/tab/' + trd.MenuID } } catch (e) {} - } - - if (trdItem.type !== 'NewPage') { + } else { trdItem.src = '#/tab/' + trd.MenuID } - - trdItem.OpenType = trdItem.OpenType.toLowerCase() // NewPage涓烘墦寮�澶栭儴椤甸潰鍦板潃 if (names.has(trdItem.menu_name)) { doublenames.set(trdItem.menu_name, true) @@ -446,6 +460,8 @@ window.addEventListener('storage', (e) => { if (e.key === 'getSessionStorage' && e.newValue === window.GLOB.appkey) { localStorage.setItem('sessionStorage', JSON.stringify(sessionStorage)) + } else if (e.key === 'getSysPermission' && e.newValue === window.GLOB.appkey) { + localStorage.setItem('sysPermissions', JSON.stringify({mkThdMenus: window.GLOB.mkThdMenus, mkActions: window.GLOB.mkActions})) } else if (e.key === 'menuUpdate') { let menuId = e.newValue.split(',')[1] if (menuId) { @@ -482,8 +498,10 @@ changeVerMenu(menu, type) { if (type === 'first') { - if (menu.OpenType === 'outpage') { - window.open(menu.linkUrl) + if (menu.OpenType === 'newpage') { + window.open(menu.src) + } else if (menu.OpenType === 'newtab') { + MKEmitter.emit('modifyTabs', menu) } } else { if (menu.OpenType === 'newpage') { diff --git a/src/components/keyInterface/index.jsx b/src/components/keyInterface/index.jsx index 1319549..4e11761 100644 --- a/src/components/keyInterface/index.jsx +++ b/src/components/keyInterface/index.jsx @@ -205,8 +205,8 @@ message: '璇疯緭鍏ユ帴鍙e湴鍧�!' }, { - pattern: /^[0-9a-zA-Z:_./]+$/, - message: '鍙彲浣跨敤鑻辨枃銆佹暟瀛椾互鍙�:_./' + pattern: /^[0-9a-zA-Z:_\-./]+$/, + message: '鍙彲浣跨敤鑻辨枃銆佹暟瀛椾互鍙�:_-./' } ] })(<TextArea placeholder="http://******/webapi/dostars" rows={2}/>)} @@ -216,8 +216,8 @@ initialValue: setting.ssoInterface || '', rules: [ { - pattern: /^[0-9a-zA-Z:_./]+$/, - message: '鍙彲浣跨敤鑻辨枃銆佹暟瀛椾互鍙�:_./' + pattern: /^[0-9a-zA-Z:_\-./]+$/, + message: '鍙彲浣跨敤鑻辨枃銆佹暟瀛椾互鍙�:_-./' } ] })(<TextArea placeholder="http://sso.mk9h.cn/cloud/webapi/dostars" rows={2}/>)} diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index 1b5e633..dfd0c2b 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -18,7 +18,6 @@ const CustomPage = asyncComponent(() => import('@/tabviews/custom')) const CommonTable = asyncComponent(() => import('@/tabviews/commontable')) const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) -const CalendarPage = asyncComponent(() => import('@/tabviews/calendar')) const TreePage = asyncComponent(() => import('@/tabviews/treepage')) const Iframe = asyncComponent(() => import('@/tabviews/iframe')) const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) @@ -195,25 +194,23 @@ selectcomponent = (view) => { // 鏍规嵁tab椤典腑鑿滃崟淇℃伅锛岄�夋嫨鎵�闇�鐨勭粍浠� if (view.type === 'Home') { - return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) - } else if (view.type === 'CommonTable') { - return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + return (<Home MenuID={view.MenuID} MenuName={view.MenuName}/>) } else if (view.type === 'BaseTable') { - return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + return (<BaseTable MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'CustomPage') { - return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>) + return (<CustomPage MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) + } else if (view.type === 'CommonTable') { + return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>) } else if (view.type === 'TreePage') { - return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) - } else if (view.type === 'CalendarPage') { - return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) + return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) } else if (view.type === 'RolePermission') { - return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) + return (<RoleManage MenuID={view.MenuID}/>) } else if (view.type === 'FormTab') { - return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) + return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>) } else if (view.type === 'iframe') { - return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>) + return (<Iframe MenuID={view.MenuID} title={view.MenuName} url={view.src}/>) } else { - return (<NotFount key={view.MenuID} />) + return (<NotFount />) } } diff --git a/src/components/tabview/index.scss b/src/components/tabview/index.scss index 6f2fee2..13cb998 100644 --- a/src/components/tabview/index.scss +++ b/src/components/tabview/index.scss @@ -68,10 +68,11 @@ } iframe { width: 100%; - height: calc(100vh - 115px); + height: calc(100vh - 92px); overflow-y: scroll; border: 0; - margin-top: 16px; + margin: 0px; + vertical-align: top; } } .ant-back-top { diff --git a/src/index.js b/src/index.js index 21f3ba5..04c69e3 100644 --- a/src/index.js +++ b/src/index.js @@ -226,11 +226,11 @@ GLOB.baseurl = document.location.origin + '/' + GLOB.service GLOB.linkurl = GLOB.baseurl + 'index.html' } else { - GLOB.linkurl = '' GLOB.location = config.host GLOB.service = config.service GLOB.host = config.host.replace(/http(s)?:\/\//ig, '') + (config.service ? '_' + config.service.replace(/\//ig, '') : '') GLOB.baseurl = GLOB.location + '/' + GLOB.service + GLOB.linkurl = GLOB.baseurl + 'index.html' } let mark = sessionStorage.getItem('system_mark') diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.scss b/src/menu/components/card/cardcellcomponent/dragaction/index.scss index 51310de..56d6af8 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.scss +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.scss @@ -213,6 +213,7 @@ background-position: center center; background-repeat: no-repeat; background-size: cover; + position: unset!important; } .sort-wrap { position: relative; diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 2fb2157..e5a5029 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -171,6 +171,10 @@ options = ['padding', 'margin'] } + if (element.eleType !== 'button') { + options.push('position') + } + options.push('clear') this.setState({ diff --git a/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx index 39827f8..2be6ca1 100644 --- a/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-X6/chartcompile/formconfig.jsx @@ -1,3 +1,6 @@ + +import MenuUtils from '@/utils/utils-custom.js' + /** * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 * @param {object} card // 鍥捐〃瀵硅薄 @@ -197,24 +200,71 @@ * @param {object} card // 鍥捐〃瀵硅薄 * @param {Array} columns // 鏄剧ず鍒� */ -export function getOptionForm (card, columns) { +export function getOptionForm (card, uuid) { + let menu = window.GLOB.customMenu + let modules = MenuUtils.getSupModules(menu.components, uuid, menu.interfaces) + return [ { type: 'select', field: 'subtype', - label: '绫诲瀷', + label: '鍥捐〃绫诲瀷', initval: card.subtype || 'xflow', required: true, options: [{ value: 'xflow', label: '娴佺▼鍥�' }, { - value: 'indentTree', + value: 'lane', label: '娉抽亾鍥�' - }, { - value: 'kapmap', - label: '缁勭粐缁撴瀯鍥�' - }] + }], + controlFields: [ + {field: 'gridType', values: ['xflow']}, + {field: 'backgroundColor', values: ['xflow']} + ], + }, + { + type: 'radio', + field: 'function', + label: '鍔熻兘', + initval: card.function || 'show', + required: true, + options: [ + {value: 'edit', label: '娴佺▼缂栬緫'}, + {value: 'show', label: '娴佺▼灞曠ず'}, + ], + controlFields: [ + {field: 'empty', values: ['show']} + ] + }, + { + type: 'cascader', + field: 'supModule', + label: '涓婄骇缁勪欢', + initval: card.supModule || [], + required: false, + options: modules, + allowClear: true + }, + { + type: 'radio', + field: 'gridType', + label: '缃戞牸', + initval: card.gridType || 'none', + required: false, + options: [ + {value: 'none', label: '鏃�'}, + {value: 'dot', label: '鐐圭姸缃戞牸'}, + {value: 'mesh', label: '缃戠姸缃戞牸'} + ], + }, + { + type: 'color', + field: 'backgroundColor', + label: '鑳屾櫙鑹�', + initval: card.backgroundColor || '', + required: false, + allowClear: true }, { type: 'radio', diff --git a/src/menu/components/chart/antv-X6/chartcompile/index.jsx b/src/menu/components/chart/antv-X6/chartcompile/index.jsx index 4396a49..8d72d4c 100644 --- a/src/menu/components/chart/antv-X6/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-X6/chartcompile/index.jsx @@ -34,97 +34,86 @@ view: 'normal', plot: fromJS(config.plot).toJS(), baseFormlist: getBaseForm(config.plot, config.columns), - formlist: getOptionForm(config.plot, config.columns) + formlist: getOptionForm(config.plot, config.uuid) }) } onSubmit = () => { - const { config } = this.props const { plot, view } = this.state if (view === 'normal') { this.norRef.handleConfirm().then(res => { - let _plot = {...plot, ...res} - - if (_plot.click !== 'menus') { - delete _plot.menus - } - if (_plot.click !== 'menu') { - delete _plot.menu - delete _plot.MenuID - delete _plot.MenuName - delete _plot.MenuNo - delete _plot.tabType - } else if (sessionStorage.getItem('appType') === '' && _plot.menu) { - let list = null - try { - list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] - } catch (e) { - list = [] - } - - let id = _plot.menu[_plot.menu.length - 1] - - list.forEach(item => { - if (item.MenuID === id) { - _plot.MenuID = id - _plot.MenuName = item.MenuName - _plot.MenuNo = item.MenuNo - _plot.tabType = item.type - } - }) - } - - this.setState({ - plot: _plot, - visible: false - }) - - this.props.plotchange({...config, plot: _plot}) + this.resetPlot({...plot, ...res}) }) } else if (view === 'base') { this.baseRef.handleConfirm().then(res => { - let _plot = {...plot, ...res} - - if (_plot.click !== 'menus') { - delete _plot.menus - } - if (_plot.click !== 'menu') { - delete _plot.menu - delete _plot.MenuID - delete _plot.MenuName - delete _plot.MenuNo - delete _plot.tabType - } else if (sessionStorage.getItem('appType') === '' && _plot.menu) { - let list = null - try { - list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] - } catch (e) { - list = [] - } - - let id = _plot.menu[_plot.menu.length - 1] - - list.forEach(item => { - if (item.MenuID === id) { - _plot.MenuID = id - _plot.MenuName = item.MenuName - _plot.MenuNo = item.MenuNo - _plot.tabType = item.type - } - }) - } - - this.setState({ - plot: _plot, - visible: false - }) - - this.props.plotchange({...config, plot: _plot}) + this.resetPlot({...plot, ...res}) }) } } + resetPlot = (plot) => { + const { config } = this.props + + if (plot.click !== 'menus') { + delete plot.menus + } + if (plot.click !== 'menu') { + delete plot.menu + delete plot.MenuID + delete plot.MenuName + delete plot.MenuNo + delete plot.tabType + } else if (sessionStorage.getItem('appType') === '' && plot.menu) { + let list = null + try { + list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] + } catch (e) { + list = [] + } + + let id = plot.menu[plot.menu.length - 1] + + list.forEach(item => { + if (item.MenuID === id) { + plot.MenuID = id + plot.MenuName = item.MenuName + plot.MenuNo = item.MenuNo + plot.tabType = item.type + } + }) + } + + if (plot.gridType === 'none') { + plot.grid = {visible: false} + } else if (plot.gridType === 'dot') { + plot.grid = { + visible: true, + type: 'dot', + args: { + color: '#a0a0a0', + thickness: 1 + } + } + } else if (plot.gridType === 'mesh') { + plot.grid = { + visible: true, + type: 'mesh', + args: { + color: '#ddd', + thickness: 1 + } + } + } + + this.setState({ + plot: plot, + visible: false + }) + + this.props.plotchange({...config, plot: plot}) + } + changeTab = (tab) => { const { plot, view } = this.state diff --git a/src/menu/components/chart/antv-X6/index.jsx b/src/menu/components/chart/antv-X6/index.jsx index 6d20b17..c161470 100644 --- a/src/menu/components/chart/antv-X6/index.jsx +++ b/src/menu/components/chart/antv-X6/index.jsx @@ -1,92 +1,68 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Popover, Tooltip, message } from 'antd' -import { ToolOutlined, DeleteOutlined, FontColorsOutlined, VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined, DoubleLeftOutlined } from '@ant-design/icons' +import { Popover } from 'antd' +import { ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons' import { Graph, Shape } from '@antv/x6' -import { Stencil } from '@antv/x6-plugin-stencil' -import { Transform } from '@antv/x6-plugin-transform' -import { Selection } from '@antv/x6-plugin-selection' -import { Snapline } from '@antv/x6-plugin-snapline' -import { Keyboard } from '@antv/x6-plugin-keyboard' -import { Clipboard } from '@antv/x6-plugin-clipboard' -import { History } from '@antv/x6-plugin-history' import MKEmitter from '@/utils/events.js' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' -import { resetStyle, getTables, checkComponent } from '@/utils/utils-custom.js' +import { resetStyle } from '@/utils/utils-custom.js' +import lanes from './lane.json' +import xflows from './xflow.json' import './index.scss' -const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) const ChartCompileForm = asyncIconComponent(() => import('./chartcompile')) -const NodeUpdate = asyncIconComponent(() => import('./nodeupdate')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) -// #region 鍒濆鍖栧浘褰� -const groups = { - top: { - position: 'top', +Graph.registerNode( + 'lane', + { + inherit: 'rect', + markup: [ + { + tagName: 'rect', + selector: 'body', + }, + { + tagName: 'rect', + selector: 'name-rect', + }, + { + tagName: 'text', + selector: 'name-text', + }, + ], attrs: { - circle: { - r: 4, - magnet: true, - stroke: 'var(--mk-sys-color)', + body: { + fill: '#FFF', + stroke: '#5F95FF', strokeWidth: 1, + }, + 'name-rect': { + width: 200, + height: 36, + fill: '#5F95FF', + stroke: '#fff', + strokeWidth: 1, + x: -1, + }, + 'name-text': { + ref: 'name-rect', + refY: 0.5, + refX: 0.5, + textAnchor: 'middle', + fontWeight: 'bold', fill: '#fff', - style: { - visibility: 'hidden' - } - } - } + fontSize: 14, + }, + }, + zIndex: 0 }, - right: { - position: 'right', - attrs: { - circle: { - r: 4, - magnet: true, - stroke: 'var(--mk-sys-color)', - strokeWidth: 1, - fill: '#fff', - style: { - visibility: 'hidden' - } - } - } - }, - bottom: { - position: 'bottom', - attrs: { - circle: { - r: 4, - magnet: true, - stroke: 'var(--mk-sys-color)', - strokeWidth: 1, - fill: '#fff', - style: { - visibility: 'hidden' - } - } - } - }, - left: { - position: 'left', - attrs: { - circle: { - r: 4, - magnet: true, - stroke: 'var(--mk-sys-color)', - strokeWidth: 1, - fill: '#fff', - style: { - visibility: 'hidden' - } - } - } - } -} + true, +) Graph.registerNode( 'mk-rect', @@ -97,22 +73,13 @@ attrs: { body: { strokeWidth: 1, - stroke: '#5F95FF', - fill: '#EFF4FF' + stroke: '#000000', + fill: '#FFFFFF' }, text: { fontSize: 12, fill: '#262626' } - }, - ports: { - groups, - items: [ - { group: 'top' }, - { group: 'right' }, - { group: 'bottom' }, - { group: 'left' } - ] } }, true @@ -127,22 +94,13 @@ attrs: { body: { strokeWidth: 1, - stroke: '#5F95FF', - fill: '#EFF4FF' + stroke: '#000000', + fill: '#FFFFFF' }, text: { fontSize: 12, fill: '#262626' } - }, - ports: { - groups, - items: [ - { group: 'top' }, - { group: 'right' }, - { group: 'bottom' }, - { group: 'left' } - ] } }, true @@ -157,22 +115,13 @@ attrs: { body: { strokeWidth: 1, - stroke: '#5F95FF', - fill: '#EFF4FF' + stroke: '#000000', + fill: '#FFFFFF' }, text: { fontSize: 12, fill: '#262626' } - }, - ports: { - groups, - items: [ - { group: 'top' }, - { group: 'right' }, - { group: 'bottom' }, - { group: 'left' } - ] } }, true @@ -187,22 +136,13 @@ attrs: { body: { strokeWidth: 1, - stroke: '#5F95FF', - fill: '#EFF4FF' + stroke: '#000000', + fill: '#FFFFFF' }, text: { fontSize: 12, fill: '#262626' } - }, - ports: { - groups, - items: [ - { group: 'top' }, - { group: 'right' }, - { group: 'bottom' }, - { group: 'left' } - ] } }, true @@ -217,8 +157,8 @@ points: '100,10 40,198 190,78 10,78 160,198', attrs: { body: { - fill: '#EFF4FF', - stroke: '#5F95FF', + fill: '#FFFFFF', + stroke: '#000000', strokeWidth: 1, fillRule: 'nonzero' }, @@ -226,15 +166,26 @@ fontSize: 12, fill: '#262626' } - }, - ports: { - groups, - items: [ - { group: 'top' }, - { group: 'right' }, - { group: 'bottom' }, - { group: 'left' } - ] + } + }, + true +) + +Graph.registerNode( + 'mk-text', + { + inherit: 'rect', + width: 66, + height: 36, + attrs: { + body: { + strokeWidth: 0, + fill: 'transparent' + }, + text: { + fontSize: 12, + fill: '#262626' + } } }, true @@ -248,15 +199,8 @@ } state = { - card: null, - eventListener: null, - toolunfold: true, - nodeunfold: true, - node: null + card: null } - - selectNode = null - mkGraph = null UNSAFE_componentWillMount () { const { card } = this.props @@ -264,9 +208,20 @@ if (card.isNew) { let _plot = { width: card.width || 24, - height: 400, + height: 500, subtype: card.subtype, - name: card.name + name: card.name, + grid: { + visible: true, + type: 'dot', + args: { + color: '#a0a0a0', + thickness: 1 + } + }, + gridType: 'dot', + function: 'show', + supModule: [] } let _card = { @@ -278,7 +233,7 @@ width: _plot.width, name: _plot.name, subtype: card.subtype, - setting: { interType: 'system' }, + setting: { interType: '' }, style: { borderWidth: '1px', borderColor: 'rgb(217, 217, 217)', marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' @@ -318,47 +273,49 @@ }, 1000) } - viewrender = () => { - // const { card } = this.state - - // if (card.plot.subtype === 'mindmap') { - // this.ponitrender() - // } else if (card.plot.subtype === 'indentTree') { - // this.indentrender() - // } else if (card.plot.subtype === 'kapmap') { - this.kapmaprender() - // } - } - - kapmaprender = () => { + plotchange = (res) => { const { card } = this.state - // #region 鍒濆鍖栫敾甯� + if ( + card.plot.subtype !== res.plot.subtype || + (res.plot.gridType && card.plot.gridType !== res.plot.gridType) || + (res.plot.gridType && card.plot.backgroundColor !== res.plot.backgroundColor) + ) { + let _element = document.getElementById(card.uuid + 'container') + if (_element) { + _element.innerHTML = '' + } + setTimeout(() => { + this.viewrender() + }, 50) + } + + this.updateComponent(res) + } + + viewrender = () => { + const { card } = this.state + + if (card.plot.subtype === 'xflow') { + this.xflowrender() + } else if (card.plot.subtype === 'lane') { + this.lanerender() + } + } + + xflowrender = () => { + const { card } = this.state + const graph = new Graph({ container: document.getElementById(card.uuid + 'container'), - // grid: { - // visible: true, - // type: 'doubleMesh', - // args: [ - // { - // color: '#eee', // 涓荤綉鏍肩嚎棰滆壊 - // thickness: 1 // 涓荤綉鏍肩嚎瀹藉害 - // }, - // { - // color: '#ddd', // 娆$綉鏍肩嚎棰滆壊 - // thickness: 1, // 娆$綉鏍肩嚎瀹藉害 - // factor: 4 // 涓绘缃戞牸绾块棿闅� - // } - // ] - // }, + grid: card.plot.grid, scaling: { min: 0.5, max: 2 }, autoResize: true, - panning: true, background: { - color: '#ffffff' + color: card.plot.backgroundColor || 'transparent' }, mousewheel: { enabled: true, @@ -383,8 +340,8 @@ return new Shape.Edge({ attrs: { line: { - stroke: '#A2B1C3', - strokeWidth: 2, + stroke: '#000000', + strokeWidth: 1, targetMarker: { name: 'block', width: 12, @@ -412,272 +369,118 @@ } }) - // #region 浣跨敤鎻掍欢 - graph - .use(new Transform({ - resizing: true, - rotating: true - })) - .use(new Selection()) - .use(new Snapline()) - .use(new Keyboard()) - .use(new Clipboard()) - .use(new History()) + let cells = [] + xflows.forEach((item) => { + if (item.shape === 'edge') { + cells.push(graph.createEdge(item)) + } else { + cells.push(graph.createNode(item)) + } + }) + graph.resetCells(cells) + graph.positionContent('center') + } - // #region 鍒濆鍖� stencil - const stencil = new Stencil({ - title: '娴佺▼鍥�', - target: graph, - stencilGraphWidth: 180, - stencilGraphHeight: 180, - groups: [ - { - title: '閫氱敤鑺傜偣', - name: 'group1' + lanerender = () => { + const { card } = this.state + + const graph = new Graph({ + container: document.getElementById(card.uuid + 'container'), + scaling: { + min: 0.5, + max: 2 + }, + autoResize: true, + background: { color: '#ffffff' }, + mousewheel: { + enabled: true, + zoomAtMousePosition: true, + modifiers: 'ctrl' + }, + connecting: { + router: 'manhattan', + connector: { + name: 'rounded', + args: { + radius: 8 + } }, - { - title: '鑷畾涔�', - name: 'group2', - graphHeight: 120, - layoutOptions: { - rowHeight: 70 + anchor: 'center', + connectionPoint: 'anchor', + 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' + } } } - ], - layoutOptions: { - columns: 2, - columnWidth: 80, - rowHeight: 55 - } - }) - - document.getElementById(card.uuid + 'stencil').appendChild(stencil.container) - - // #region 蹇嵎閿笌浜嬩欢 - graph.bindKey(['meta+c', 'ctrl+c'], () => { - const cells = graph.getSelectedCells() - if (cells.length) { - graph.copy(cells) - } - return false - }) - graph.bindKey(['meta+x', 'ctrl+x'], () => { - const cells = graph.getSelectedCells() - if (cells.length) { - graph.cut(cells) - } - return false - }) - graph.bindKey(['meta+v', 'ctrl+v'], () => { - if (!graph.isClipboardEmpty()) { - graph.paste({ offset: 32 }) - } - return false - }) - - // undo redo - graph.bindKey(['meta+z', 'ctrl+z'], () => { - if (graph.canUndo()) { - graph.undo() - } - return false - }) - graph.bindKey(['meta+shift+z', 'ctrl+shift+z'], () => { - if (graph.canRedo()) { - graph.redo() - } - return false - }) - - // 鍒犻櫎鍏冪礌 - graph.bindKey(['backspace', 'delete'], () => { - const cells = graph.getSelectedCells() - if (cells.length) { - graph.removeCells(cells) - this.selectNode = null - this.setState({node: null}) - } - }) - - // 鎺у埗杩炴帴妗╂樉绀�/闅愯棌 - const showPorts = (ports, show) => { - for (let i = 0, len = ports.length; i < len; i += 1) { - ports[i].style.visibility = show ? 'visible' : 'hidden' - } - } - graph.on('node:mouseenter', () => { - const container = document.getElementById(card.uuid + 'container') - const ports = container.querySelectorAll('.x6-port-body') - showPorts(ports, true) - }) - graph.on('node:mouseleave', () => { - const container = document.getElementById(card.uuid + 'container') - const ports = container.querySelectorAll('.x6-port-body') - showPorts(ports, false) - }) - - graph.on('node:click', ({ e, x, y, node, view }) => { - this.selectNode = node - - this.setState({node: node.store.data}) - }) - graph.on('edge:click', ({ e, x, y, edge, view }) => { - this.selectNode = edge - - this.setState({node: edge.store.data}) - - graph.clearTransformWidgets() - }) - graph.on('blank:click', ({ e, x, y }) => { - this.selectNode = null - - this.setState({node: null}) - }) - - const r1 = graph.createNode({ - shape: 'mk-rect', - label: '寮�濮�', - attrs: { - body: { - rx: 20, - ry: 26 - } - } - }) - const r2 = graph.createNode({ - shape: 'mk-rect', - label: '杩囩▼' - }) - const r3 = graph.createNode({ - shape: 'mk-rect', - attrs: { - body: { - rx: 6, - ry: 6 - } }, - label: '鍙�夎繃绋�' - }) - const r4 = graph.createNode({ - shape: 'mk-polygon', - attrs: { - body: { - refPoints: '0,10 10,0 20,10 10,20' + 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() } - }, - label: '鍐崇瓥' - }) - const r5 = graph.createNode({ - shape: 'mk-polygon', - attrs: { - body: { - refPoints: '10,0 40,0 30,20 0,20' - } - }, - label: '鏁版嵁' - }) - const r6 = graph.createNode({ - shape: 'mk-circle', - label: '杩炴帴' - }) - - stencil.load([r1, r2, r3, r4, r5, r6], 'group1') - - const p1 = graph.createNode({ - shape: 'mk-ellipse', - label: 'ellipse' - }) - const p2 = graph.createNode({ - shape: 'mk-star', - label: '' - }) - - stencil.load([p1, p2], 'group2') - - this.mkGraph = graph - } - - setTop = () => { - if (!this.selectNode) { - message.warning('璇烽�夋嫨鑺傜偣锛�') - return - } - this.selectNode.toFront() - } - - setBottom = () => { - if (!this.selectNode) { - message.warning('璇烽�夋嫨鑺傜偣锛�') - return - } - // let cells = this.mkGraph.getCells() - this.selectNode.toBack() - } - - // zoom() 鍙幏鍙栨垨鑰呰缃缉鏀炬瘮渚� - setZoomIn = () => { - this.mkGraph.zoom(0.1) - } - - setZoomOut = () => { - this.mkGraph.zoom(-0.1) - } - - setZoomInt = () => { - this.mkGraph.zoomTo(1) - } - - save = () => { - // let nodes = this.mkGraph.toJSON() - } - - changeProps = (value, key) => { - const { node } = this.state - - if (node.shape === 'edge') { - if (key === 'title') { - this.selectNode.setLabels(value) - } else if (key === 'stroke') { - this.selectNode.attr('line/stroke', value) - } else if (key === 'strokeWidth') { - this.selectNode.attr('line/strokeWidth', value) - } else if (key === 'lineType') { - if (value === 'dash') { - this.selectNode.attr('line/strokeDasharray', 5) - } else { - this.selectNode.attr('line/strokeDasharray', 0) - } - } else if (key === 'fontSize') { - this.selectNode.attr('text/fontSize', value) - } else if (key === 'fontFill') { - this.selectNode.attr('text/fill', value) } - } else { - if (key === 'title') { - this.selectNode.attr('text/text', value) - } else if (key === 'fill') { - this.selectNode.attr('body/fill', value) - } else if (key === 'stroke') { - this.selectNode.attr('body/stroke', value) - } else if (key === 'fontSize') { - this.selectNode.attr('text/fontSize', value) - } else if (key === 'fontFill') { - this.selectNode.attr('text/fill', value) + }) + + let cells = [] + lanes.forEach((item) => { + if (item.shape === 'edge') { + cells.push(graph.createEdge(item)) + } else { + cells.push(graph.createNode(item)) } - } + }) + graph.resetCells(cells) + graph.positionContent('top') } updateComponent = (card) => { card.width = card.plot.width card.name = card.plot.name card.subtype = card.plot.subtype - - card.$c_ds = true - card.errors = checkComponent(card) - - if (card.errors.length === 0) { - card.$tables = getTables(card) - } + card.errors = [] + card.$tables = [] this.setState({ card: card @@ -710,74 +513,28 @@ } render() { - const { card, toolunfold, nodeunfold, node } = this.state + const { card } = this.state let _style = resetStyle(card.style) return ( <div className="menu-x6-chart-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <ChartCompileForm config={card} plotchange={this.updateComponent}/> - <CopyComponent type="antvG6" card={card}/> + <ChartCompileForm config={card} plotchange={this.plotchange}/> + <CopyComponent type="antvX6" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <DeleteOutlined className="close" title="delete" onClick={() => this.props.deletecomponent(card.uuid)}/> - <SettingComponent config={card} updateConfig={this.updateComponent}/> </div> } trigger="hover"> <ToolOutlined/> </Popover> <NormalHeader config={card} updateComponent={this.updateComponent}/> - <div className="mk-toolbar"> - <div className="left-tool"> - <Tooltip title="缃墠"> - <VerticalAlignTopOutlined onClick={this.setTop}/> - </Tooltip> - <Tooltip title="缃悗"> - <VerticalAlignBottomOutlined onClick={this.setBottom}/> - </Tooltip> - <Tooltip title="淇濆瓨"> - <SaveOutlined onClick={this.save}/> - </Tooltip> - </div> - <div className="right-tool"> - <Tooltip title="鏀惧ぇ"> - <ZoomInOutlined onClick={this.setZoomIn}/> - </Tooltip> - <Tooltip title="缂╁皬"> - <ZoomOutOutlined onClick={this.setZoomOut}/> - </Tooltip> - <Tooltip title="1:1"> - <OneToOneOutlined onClick={this.setZoomInt}/> - </Tooltip> - </div> - </div> <div className="canvas" style={{width: '100%', minHeight: card.plot.height, height: card.plot.height}} id={card.uuid + 'canvas'}> - <div id={card.uuid + 'stencil'} className={'mk-stencil ' + (toolunfold ? '' : 'merge')}> - <div className="tool-control" onClick={() => this.setState({toolunfold: !toolunfold})}> - <DoubleLeftOutlined /> - </div> - </div> <div id={card.uuid + 'container'} className="mk-container"></div> - <div className={'mk-node-edit ' + (nodeunfold ? '' : 'merge')}> - <div className="tool-control" onClick={() => this.setState({nodeunfold: !nodeunfold})}> - <DoubleLeftOutlined /> - </div> - <div className="header">璁剧疆</div> - {!node ? <div className="empty">鏈�変腑</div> : <NodeUpdate node={node} onChange={this.changeProps}/>} - </div> </div> <div className="component-name"> <div className="center"> <div className="title">{card.name}</div> - <div className="content"> - {card.errors && card.errors.map((err, index) => { - if (err.level === 0) { - return <span key={index} className="error">{err.detail}</span> - } else { - return <span key={index} className="waring">{err.detail}锛�</span> - } - })} - </div> </div> </div> </div> diff --git a/src/menu/components/chart/antv-X6/index.scss b/src/menu/components/chart/antv-X6/index.scss index bb28fcb..edf4d88 100644 --- a/src/menu/components/chart/antv-X6/index.scss +++ b/src/menu/components/chart/antv-X6/index.scss @@ -5,194 +5,23 @@ background-position: center center; background-repeat: no-repeat; background-size: cover; - - .mk-toolbar { - width: 100%; - height: 40px; - border: 1px solid #1890ff; - .left-tool { - float: left; - line-height: 40px; - .anticon { - margin: 0 10px; - font-size: 16px; - cursor: pointer; - } - } - .right-tool { - float: right; - line-height: 40px; - .anticon { - margin: 0 10px; - font-size: 16px; - cursor: pointer; - } - } - } .x6-graph-scroller::-webkit-scrollbar { display: none; } .x6-cell.x6-edge.x6-edge-selected path:nth-child(2) { stroke: #1890ff; } + .x6-cell[data-shape="lane"] { + cursor: default; + } .canvas { margin: 0px; letter-spacing: 0px; - display: flex; - - .mk-stencil { - width: 180px; - min-width: 180px; - height: 100%; - position: relative; - z-index: 2; - border-right: 1px solid #dfe3e8; - transition: all 0.2s; - - .x6-widget-stencil-title { - display: none; - } - .x6-widget-stencil-content { - overflow-y: auto; - } - .x6-widget-stencil-content::-webkit-scrollbar { - width: 7px; - } - .x6-widget-stencil-content::-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); - } - .x6-widget-stencil-content::-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); - } - .tool-control { - position: absolute; - right: -13px; - top: 5px; - z-index: 3; - background: #ffffff; - width: 25px; - height: 25px; - border: 1px solid #d8d8d8; - border-radius: 30px; - text-align: center; - line-height: 25px; - cursor: pointer; - } - } - .mk-stencil.merge { - width: 0px; - min-width: 0px; - - .tool-control { - right: -25px; - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; - .anticon-double-left { - transform: rotate(180deg); - } - } - } - - .mk-node-edit { - width: 180px; - min-width: 180px; - height: 100%; - position: relative; - z-index: 2; - border-left: 1px solid #dfe3e8; - transition: all 0.2s; - - .header { - width: 100%; - height: 32px; - text-align: center; - line-height: 32px; - background-color: #f5f5f5!important; - overflow-x: hidden; - white-space: nowrap; - } - .empty { - width: 100%; - text-align: center; - padding-top: 20px; - overflow-x: hidden; - white-space: nowrap; - } - - .tool-control { - position: absolute; - left: -13px; - top: 5px; - z-index: 3; - background: #ffffff; - width: 25px; - height: 25px; - border: 1px solid #d8d8d8; - border-radius: 30px; - text-align: center; - line-height: 25px; - cursor: pointer; - .anticon-double-left { - transform: rotate(180deg); - } - } - } - .mk-node-edit.merge { - width: 0px; - min-width: 0px; - - .tool-control { - left: -25px; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; - .anticon-double-left { - transform: rotate(0deg); - } - } - } .mk-container { - width: calc(100% - 180px); height: 100%; - } - .x6-widget-stencil { - background-color: #fff; - } - .x6-widget-stencil-title { - background-color: #fff; - } - .x6-widget-stencil-group-title { - background-color: #f5f5f5!important; - } - .x6-widget-transform { - margin: -1px 0 0 -1px; - padding: 0px; - border: 1px solid #239edd; - } - .x6-widget-transform > div { - border: 1px solid #239edd; - } - .x6-widget-transform > div:hover { - background-color: #3dafe4; - } - .x6-widget-transform-active-handle { - background-color: #3dafe4; - } - .x6-widget-transform-resize { - border-radius: 0; - } - .x6-widget-selection-inner { - border: 1px solid #239edd; - } - .x6-widget-selection-box { - opacity: 0; } } diff --git a/src/menu/components/chart/antv-X6/lane.json b/src/menu/components/chart/antv-X6/lane.json new file mode 100644 index 0000000..5029dce --- /dev/null +++ b/src/menu/components/chart/antv-X6/lane.json @@ -0,0 +1,1162 @@ +[{ + "position": { + "x": 0, + "y": 0 + }, + "size": { + "width": 200, + "height": 500 + }, + "attrs": { + "text": { + "text": "闃舵1" + } + }, + "visible": true, + "shape": "lane", + "id": "086eb967-7a70-4581-bb82-1dd87f6473e3", + "zIndex": 0 +}, { + "position": { + "x": 200, + "y": 0 + }, + "size": { + "width": 200, + "height": 500 + }, + "attrs": { + "text": { + "text": "闃舵2" + } + }, + "visible": true, + "shape": "lane", + "id": "eab0b7c3-3eb4-45da-8b43-cc215047edd4", + "zIndex": 0 +}, { + "position": { + "x": 400, + "y": 0 + }, + "size": { + "width": 200, + "height": 500 + }, + "attrs": { + "text": { + "text": "闃舵3" + } + }, + "visible": true, + "shape": "lane", + "id": "8666799f-c76c-4695-8804-0d3579caadc4", + "zIndex": 0 +}, { + "position": { + "x": 600, + "y": 0 + }, + "size": { + "width": 200, + "height": 500 + }, + "attrs": { + "text": { + "text": "闃舵4" + } + }, + "visible": true, + "shape": "lane", + "id": "68e49c35-cf6f-46f0-bcde-754c2a2b0ffe", + "zIndex": 0 +}, { + "position": { + "x": 67, + "y": 70 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Start" + }, + "body": { + "rx": 20, + "ry": 26 + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "7af1dd51-e0c8-45e2-8f72-96777215e0da" + }, { + "group": "right", + "id": "d0576432-07e4-4f9e-bb0a-81fc7eabdbb3" + }, { + "group": "bottom", + "id": "6faa8816-930d-4356-9fbe-c18bbdfc99ab" + }, { + "group": "left", + "id": "161b1890-3c4a-4758-b444-7a249763ee3a" + }] + }, + "id": "c6f49af2-3f6f-4b60-88e3-ea0f45223f34", + "zIndex": 1, + "parent": "086eb967-7a70-4581-bb82-1dd87f6473e3" +}, { + "position": { + "x": 267, + "y": 70 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Process" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, { + "group": "right", + "id": "5c37a597-97e2-4f2e-a676-017f66060bbd" + }, { + "group": "bottom", + "id": "5573dafd-2958-410c-a4a0-e38bc6a24065" + }, { + "group": "left", + "id": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }] + }, + "id": "26c76caa-ca35-4f72-abd3-9bdf348081b0", + "zIndex": 2, + "parent": "eab0b7c3-3eb4-45da-8b43-cc215047edd4" +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "78e0c6e9-a882-468e-91e1-f01399015440", + "zIndex": 2, + "source": { + "cell": "c6f49af2-3f6f-4b60-88e3-ea0f45223f34", + "port": "d0576432-07e4-4f9e-bb0a-81fc7eabdbb3" + }, + "target": { + "cell": "26c76caa-ca35-4f72-abd3-9bdf348081b0", + "port": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "6418ad5a-f6af-486f-9068-0642c5c2fb1f", + "zIndex": 2, + "source": { + "cell": "26c76caa-ca35-4f72-abd3-9bdf348081b0", + "port": "5c37a597-97e2-4f2e-a676-017f66060bbd" + }, + "target": { + "cell": "864acc4a-daa5-4fae-9b2a-c90c1eb7752e", + "port": "56c9c736-744a-48f3-84bb-706a0f15712f" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "458e8e95-f5e7-46a0-add3-e42c7b832178", + "zIndex": 2, + "source": { + "cell": "864acc4a-daa5-4fae-9b2a-c90c1eb7752e", + "port": "8e9111c6-83d2-44d5-b6be-2c5504d8ff72" + }, + "target": { + "cell": "aae00f04-39b6-403d-98a2-057ea251376b", + "port": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, + "labels": ["Yes"] +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "3f9348e4-d2bd-4300-b873-8915fe7cc152", + "zIndex": 2, + "source": { + "cell": "864acc4a-daa5-4fae-9b2a-c90c1eb7752e", + "port": "23e59070-cc3f-4005-80b8-0d8eec0eba8f" + }, + "target": { + "cell": "246493f4-865f-407e-9407-4df6f5dae340", + "port": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, + "labels": ["No"] +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "206575cf-9c23-4c95-8f98-e448f95b6bb3", + "zIndex": 2, + "source": { + "cell": "246493f4-865f-407e-9407-4df6f5dae340", + "port": "5573dafd-2958-410c-a4a0-e38bc6a24065" + }, + "target": { + "cell": "54347093-ddd3-46c4-b2d5-b65352c10ac3", + "port": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "e88f16a4-393c-4572-9bf4-0775dff8b021", + "zIndex": 2, + "source": { + "cell": "54347093-ddd3-46c4-b2d5-b65352c10ac3", + "port": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }, + "target": { + "cell": "d684e64f-6fac-4879-bd74-2749c9f2436f", + "port": "23e59070-cc3f-4005-80b8-0d8eec0eba8f" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "d5cc4a65-9209-422f-b971-7b0790938018", + "zIndex": 2, + "source": { + "cell": "d684e64f-6fac-4879-bd74-2749c9f2436f", + "port": "8e9111c6-83d2-44d5-b6be-2c5504d8ff72" + }, + "target": { + "cell": "37ef7b6f-659d-4e10-812d-df7dc7c4d66e", + "port": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, + "labels": ["Yes"] +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "18aa70cc-a580-48b2-9b14-a2313ee3e69c", + "zIndex": 2, + "source": { + "cell": "37ef7b6f-659d-4e10-812d-df7dc7c4d66e", + "port": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }, + "target": { + "cell": "1aa90d24-7fca-4298-a0e7-17b4bc88e33b", + "port": "d0576432-07e4-4f9e-bb0a-81fc7eabdbb3" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "30eff504-21f8-46ca-8809-28ce4aaadf03", + "zIndex": 2, + "source": { + "cell": "d684e64f-6fac-4879-bd74-2749c9f2436f", + "port": "56c9c736-744a-48f3-84bb-706a0f15712f" + }, + "target": { + "cell": "1aa90d24-7fca-4298-a0e7-17b4bc88e33b", + "port": "7af1dd51-e0c8-45e2-8f72-96777215e0da" + }, + "labels": ["No"] +}, { + "position": { + "x": 467, + "y": 70 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Judge" + }, + "body": { + "refPoints": "0,10 10,0 20,10 10,20" + } + }, + "visible": true, + "shape": "mk-polygon", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "52a617c4-1c62-4bd6-b827-6215feac4495" + }, { + "group": "right", + "id": "23e59070-cc3f-4005-80b8-0d8eec0eba8f" + }, { + "group": "bottom", + "id": "8e9111c6-83d2-44d5-b6be-2c5504d8ff72" + }, { + "group": "left", + "id": "56c9c736-744a-48f3-84bb-706a0f15712f" + }] + }, + "id": "864acc4a-daa5-4fae-9b2a-c90c1eb7752e", + "zIndex": 3, + "parent": "8666799f-c76c-4695-8804-0d3579caadc4" +}, { + "position": { + "x": 467, + "y": 170 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Process" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, { + "group": "right", + "id": "5c37a597-97e2-4f2e-a676-017f66060bbd" + }, { + "group": "bottom", + "id": "5573dafd-2958-410c-a4a0-e38bc6a24065" + }, { + "group": "left", + "id": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }] + }, + "id": "aae00f04-39b6-403d-98a2-057ea251376b", + "zIndex": 4, + "parent": "8666799f-c76c-4695-8804-0d3579caadc4" +}, { + "position": { + "x": 670, + "y": 170 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Process" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, { + "group": "right", + "id": "5c37a597-97e2-4f2e-a676-017f66060bbd" + }, { + "group": "bottom", + "id": "5573dafd-2958-410c-a4a0-e38bc6a24065" + }, { + "group": "left", + "id": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }] + }, + "id": "246493f4-865f-407e-9407-4df6f5dae340", + "zIndex": 5, + "parent": "68e49c35-cf6f-46f0-bcde-754c2a2b0ffe" +}, { + "position": { + "x": 670, + "y": 260 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Process" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, { + "group": "right", + "id": "5c37a597-97e2-4f2e-a676-017f66060bbd" + }, { + "group": "bottom", + "id": "5573dafd-2958-410c-a4a0-e38bc6a24065" + }, { + "group": "left", + "id": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }] + }, + "id": "54347093-ddd3-46c4-b2d5-b65352c10ac3", + "zIndex": 6, + "parent": "68e49c35-cf6f-46f0-bcde-754c2a2b0ffe" +}, { + "position": { + "x": 467, + "y": 260 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Judge" + }, + "body": { + "refPoints": "0,10 10,0 20,10 10,20" + } + }, + "visible": true, + "shape": "mk-polygon", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "52a617c4-1c62-4bd6-b827-6215feac4495" + }, { + "group": "right", + "id": "23e59070-cc3f-4005-80b8-0d8eec0eba8f" + }, { + "group": "bottom", + "id": "8e9111c6-83d2-44d5-b6be-2c5504d8ff72" + }, { + "group": "left", + "id": "56c9c736-744a-48f3-84bb-706a0f15712f" + }] + }, + "id": "d684e64f-6fac-4879-bd74-2749c9f2436f", + "zIndex": 7, + "parent": "8666799f-c76c-4695-8804-0d3579caadc4" +}, { + "position": { + "x": 467, + "y": 370 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "Process" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "c825ad9f-4b0a-4c6c-aee0-1c861955a794" + }, { + "group": "right", + "id": "5c37a597-97e2-4f2e-a676-017f66060bbd" + }, { + "group": "bottom", + "id": "5573dafd-2958-410c-a4a0-e38bc6a24065" + }, { + "group": "left", + "id": "7b15a915-f31a-4338-a68a-1fe5cf1f78da" + }] + }, + "id": "37ef7b6f-659d-4e10-812d-df7dc7c4d66e", + "zIndex": 8, + "parent": "8666799f-c76c-4695-8804-0d3579caadc4" +}, { + "position": { + "x": 270, + "y": 370 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "End" + }, + "body": { + "rx": 20, + "ry": 26 + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "7af1dd51-e0c8-45e2-8f72-96777215e0da" + }, { + "group": "right", + "id": "d0576432-07e4-4f9e-bb0a-81fc7eabdbb3" + }, { + "group": "bottom", + "id": "6faa8816-930d-4356-9fbe-c18bbdfc99ab" + }, { + "group": "left", + "id": "161b1890-3c4a-4758-b444-7a249763ee3a" + }] + }, + "id": "1aa90d24-7fca-4298-a0e7-17b4bc88e33b", + "zIndex": 9, + "parent": "eab0b7c3-3eb4-45da-8b43-cc215047edd4" +}] \ No newline at end of file diff --git a/src/menu/components/chart/antv-X6/nodeupdate/index.jsx b/src/menu/components/chart/antv-X6/nodeupdate/index.jsx deleted file mode 100644 index 5dcfb27..0000000 --- a/src/menu/components/chart/antv-X6/nodeupdate/index.jsx +++ /dev/null @@ -1,288 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { Form, Row, Col, Input, Select, Radio, InputNumber } from 'antd' - -import ColorSketch from '@/mob/colorsketch' - -import './index.scss' - -class NodeUpdate extends Component { - static propTpyes = { - node: PropTypes.object - } - - state = { - formlist: null - } - - UNSAFE_componentWillMount () { - this.setState({ - formlist: this.getFormList(this.props.node) - }) - } - - UNSAFE_componentWillReceiveProps(nextProps) { - if (!is(fromJS(this.props.node), fromJS(nextProps.node))) { - this.setState({ - formlist: null - }, () => { - this.setState({ - formlist: this.getFormList(nextProps.node) - }) - }) - } - } - - getFormList = (node) => { - let roleList = sessionStorage.getItem('sysRoles') - if (roleList) { - try { - roleList = JSON.parse(roleList) - } catch (e) { - roleList = [] - } - } else { - roleList = [] - } - - let title = '' - if (node.attrs && node.attrs.text) { - title = node.attrs.text.text || '' - } - - if (node.shape === 'edge') { - // let fontSize = 14 - // if (node.attrs && node.attrs.text) { - // fontSize = node.attrs.text.fontSize || 14 - // } - let stroke = '' - - if (node.attrs && node.attrs.line) { - stroke = node.attrs.line.stroke || '#A2B1C3' - } - - let strokeWidth = '' - - if (node.attrs && node.attrs.line) { - strokeWidth = node.attrs.line.strokeWidth || 2 - } - - let lineType = 'solid' - - if (node.attrs && node.attrs.line && node.attrs.line.strokeDasharray) { - lineType = 'dash' - } - - return [ - { - type: 'title', - label: '鍐呭' - }, - { - type: 'text', - field: 'title', - label: '鏍囩', - initval: title - }, - { - type: 'title', - label: '鏍峰紡' - }, - { - type: 'color', - field: 'stroke', - label: '棰滆壊', - initval: stroke - }, - { - type: 'number', - field: 'strokeWidth', - label: '绾垮', - initval: strokeWidth - }, - { - type: 'radio', - field: 'lineType', - label: '绾垮瀷', - initval: lineType, - options: [ - {value: 'solid', text: '瀹炵嚎'}, - {value: 'dash', text: '铏氱嚎'} - ] - }, - // { - // type: 'number', - // field: 'fontSize', - // label: '瀛楀彿', - // initval: fontSize - // }, - // { - // type: 'color', - // field: 'fontFill', - // label: '棰滆壊', - // initval: fontFill - // } - ] - } else { - let fontFill = '#262626' - if (node.attrs && node.attrs.text) { - fontFill = node.attrs.text.fill || '#262626' - } - - let fill = '' - - if (node.attrs && node.attrs.body) { - fill = node.attrs.body.fill || '' - } - let fontSize = 12 - if (node.attrs && node.attrs.text) { - fontSize = node.attrs.text.fontSize || 12 - } - let stroke = '' - - if (node.attrs && node.attrs.body) { - stroke = node.attrs.body.stroke || '' - } - return [ - { - type: 'title', - label: '鍐呭' - }, - { - type: 'text', - field: 'title', - label: '鏍囩', - initval: title - }, - { - type: 'title', - label: '鏍峰紡' - }, - { - type: 'color', - field: 'fill', - label: '鑳屾櫙', - initval: fill - }, - { - type: 'color', - field: 'stroke', - label: '杈规', - initval: stroke - }, - { - type: 'title', - label: '鏍囩鏍峰紡' - }, - { - type: 'number', - field: 'fontSize', - label: '瀛楀彿', - initval: fontSize - }, - { - type: 'color', - field: 'fontFill', - label: '棰滆壊', - initval: fontFill - } - ] - } - } - - change = (value, key) => { - if (key === 'fontSize') { - if (typeof(value) !== 'number' || value < 0) { - return - } - } - - this.props.onChange(value, key) - } - - getFields() { - const { formlist } = this.state - const fields = [] - - if (!formlist) return - - formlist.forEach((item, index) => { - if (item.type === 'title') { - fields.push( - <Col span={24} key={index}> - <span className="split-line">{item.label}</span> - </Col> - ) - } else if (item.type === 'text') { - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - <Input defaultValue={item.initval} placeholder="" autoComplete="off" onChange={(e) => this.change(e.target.value, item.field)} /> - </Form.Item> - </Col> - ) - } else if (item.type === 'number') { - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - <InputNumber defaultValue={item.initval} precision={0} min={0} onChange={(value) => this.change(value, item.field)} /> - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - <Select - showSearch - defaultValue={item.initval} - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={(value) => {this.change(value, item.field)}} - > - {item.options.map(option => - <Select.Option key={option.value} value={option.value}> - {option.text} - </Select.Option> - )} - </Select> - </Form.Item> - </Col> - ) - } else if (item.type === 'radio') { - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - <Radio.Group defaultValue={item.initval} style={{whiteSpace: 'nowrap'}} onChange={(e) => {this.change(e.target.value, item.field)}}> - {item.options.map(option => { - return ( - <Radio key={option.value} value={option.value}>{option.text}</Radio> - ) - })} - </Radio.Group> - </Form.Item> - </Col> - ) - } else if (item.type === 'color') { - fields.push( - <Col span={24} key={index}> - <Form.Item label={item.label}> - <ColorSketch defaultValue={item.initval} onChange={(value) => this.change(value, item.field)}/> - </Form.Item> - </Col> - ) - } - }) - return fields - } - - render() { - return ( - <Form className="node-edit-form"> - <Row>{this.getFields()}</Row> - </Form> - ) - } -} - -export default NodeUpdate \ No newline at end of file diff --git a/src/menu/components/chart/antv-X6/nodeupdate/index.scss b/src/menu/components/chart/antv-X6/nodeupdate/index.scss deleted file mode 100644 index 4434358..0000000 --- a/src/menu/components/chart/antv-X6/nodeupdate/index.scss +++ /dev/null @@ -1,67 +0,0 @@ -.node-edit-form { - padding-top: 10px; - .split-line { - display: block; - border-bottom: 1px solid #d9d9d9; - margin: 5px 12px 10px; - padding-bottom: 2px; - font-size: 13px; - } - .ant-form-item { - display: flex; - margin-bottom: 10px; - - .ant-form-item-label { - width: 40px; - line-height: 24px; - label { - color: rgba(0,0,0,0.45); - font-size: 13px; - } - label::after { - display: none; - } - } - .ant-form-item-control-wrapper { - padding: 0 8px; - flex: 1; - .ant-form-item-control { - line-height: 24px; - } - .ant-input { - height: 24px; - padding: 0px 4px; - font-size: 13px; - line-height: 24px; - border-radius: 0px; - } - .ant-input-number { - height: 24px; - border-radius: 0px; - .ant-input-number-input { - height: 22px; - padding: 2px 4px; - font-size: 13px; - } - } - .ant-radio-wrapper { - margin-right: 0px; - } - - .color-sketch-block { - height: 22px; - margin-top: 2px; - .color-sketch-block-box { - width: 22px; - height: 22px; - } - .color-sketch-value { - display: none; - } - .color-sketch-block-inner { - border-radius: 0px; - } - } - } - } -} \ No newline at end of file diff --git a/src/menu/components/chart/antv-X6/xflow.json b/src/menu/components/chart/antv-X6/xflow.json new file mode 100644 index 0000000..1062628 --- /dev/null +++ b/src/menu/components/chart/antv-X6/xflow.json @@ -0,0 +1,986 @@ +[{ + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "83fd4cbd-727e-4e99-b35a-854ea08a5a3e", + "zIndex": 0, + "source": { + "cell": "a464f73a-c12d-4612-ae76-55ae754618e2", + "port": "18cb49ca-e40a-4cb5-8a05-18c5ed7644fe" + }, + "target": { + "cell": "310c8213-f07a-4d30-9d35-36f03a7ceb8e", + "port": "c6e8912a-e3a3-4765-9aad-0767b55eb976" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "31c3bf79-0ea5-46d1-acd0-028de2161075", + "zIndex": 0, + "source": { + "cell": "310c8213-f07a-4d30-9d35-36f03a7ceb8e", + "port": "95ae6a99-3024-4667-8c77-8b3e0404b07a" + }, + "target": { + "cell": "ef3d1b04-c830-4146-89a4-23e330fce83d", + "port": "6c62d9ff-0d11-4d44-b234-76033f91b67d" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "79a4da44-2d8e-47fa-8449-fe3623805ffc", + "zIndex": 0, + "source": { + "cell": "ef3d1b04-c830-4146-89a4-23e330fce83d", + "port": "7024e8d6-df2f-4273-aadb-67ed01507bae" + }, + "target": { + "cell": "dba4e54b-96e7-4bb8-9d2f-d76d47ce662e", + "port": "e1ad288c-6567-413f-b2c3-132d43a566c5" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "ffb2b76e-2d42-494a-a646-eb50fd410168", + "zIndex": 0, + "source": { + "cell": "ef3d1b04-c830-4146-89a4-23e330fce83d", + "port": "6a767960-f16e-4b71-93f8-82400370fe2c" + }, + "target": { + "cell": "85e38883-641d-48ed-9701-15148be3cd7f", + "port": "e1ad288c-6567-413f-b2c3-132d43a566c5" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "ea73c7bb-645a-4198-a020-21b5df708e52", + "zIndex": 0, + "source": { + "cell": "ef3d1b04-c830-4146-89a4-23e330fce83d", + "port": "acd6bf40-8a98-481d-9280-a7df27da1743" + }, + "target": { + "cell": "aef01570-a760-4b9b-ae64-fae758f3b1ca", + "port": "c493019f-b8a3-4ac2-b250-b92fcb5553ae" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "0e9ddb8a-8587-406c-b9c3-4876ea47ee36", + "zIndex": 0, + "source": { + "cell": "dba4e54b-96e7-4bb8-9d2f-d76d47ce662e", + "port": "037a3476-fa69-4253-87a5-a96834358056" + }, + "target": { + "cell": "832fc8cc-140f-45c5-ada0-d58736d6e78c", + "port": "ec7d25b5-2c18-49ff-bfe7-37e77945b8b6" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "f3390158-6041-472e-b59e-c98b22a33926", + "zIndex": 0, + "source": { + "cell": "85e38883-641d-48ed-9701-15148be3cd7f", + "port": "037a3476-fa69-4253-87a5-a96834358056" + }, + "target": { + "cell": "832fc8cc-140f-45c5-ada0-d58736d6e78c", + "port": "c6e8912a-e3a3-4765-9aad-0767b55eb976" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "7a6ecc86-505f-41c6-ad1a-3627ed46d930", + "zIndex": 0, + "source": { + "cell": "aef01570-a760-4b9b-ae64-fae758f3b1ca", + "port": "1532799f-dd72-441e-b753-c4356a9a6589" + }, + "target": { + "cell": "832fc8cc-140f-45c5-ada0-d58736d6e78c", + "port": "f8b52aa8-fcf9-42c3-a573-badfec3097fb" + } +}, { + "shape": "edge", + "attrs": { + "line": { + "stroke": "#000000", + "strokeWidth": 1, + "targetMarker": { + "name": "block", + "width": 12, + "height": 8 + } + } + }, + "id": "2106ab62-284c-4889-bffa-194d8eec02da", + "zIndex": 0, + "source": { + "cell": "832fc8cc-140f-45c5-ada0-d58736d6e78c", + "port": "95ae6a99-3024-4667-8c77-8b3e0404b07a" + }, + "target": { + "cell": "66f14529-c53b-43be-be90-8408f6658b07", + "port": "748fb9f4-355c-4a6d-b8b2-f826c2dbbb42" + } +}, { + "position": { + "x": 110, + "y": 150 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "寮�濮�" + }, + "body": { + "rx": 20, + "ry": 26 + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "dae0a153-31a7-4d9d-ae2b-7fce5b86eda3" + }, { + "group": "right", + "id": "18cb49ca-e40a-4cb5-8a05-18c5ed7644fe" + }, { + "group": "bottom", + "id": "f2667aa6-1f8b-485b-9de6-ed61b6abe815" + }, { + "group": "left", + "id": "748fb9f4-355c-4a6d-b8b2-f826c2dbbb42" + }] + }, + "id": "a464f73a-c12d-4612-ae76-55ae754618e2", + "zIndex": 1 +}, { + "position": { + "x": 239, + "y": 150 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "杩囩▼" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "ec7d25b5-2c18-49ff-bfe7-37e77945b8b6" + }, { + "group": "right", + "id": "95ae6a99-3024-4667-8c77-8b3e0404b07a" + }, { + "group": "bottom", + "id": "f8b52aa8-fcf9-42c3-a573-badfec3097fb" + }, { + "group": "left", + "id": "c6e8912a-e3a3-4765-9aad-0767b55eb976" + }] + }, + "id": "310c8213-f07a-4d30-9d35-36f03a7ceb8e", + "zIndex": 2 +}, { + "position": { + "x": 470, + "y": 150 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "鍐崇瓥" + }, + "body": { + "refPoints": "0,10 10,0 20,10 10,20" + } + }, + "visible": true, + "shape": "mk-polygon", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "d4b5354c-82f3-4a4f-ae58-bf0085b514aa" + }, { + "group": "right", + "id": "037a3476-fa69-4253-87a5-a96834358056" + }, { + "group": "bottom", + "id": "3c1e94df-6424-4d63-b744-8f5f67c2e54a" + }, { + "group": "left", + "id": "e1ad288c-6567-413f-b2c3-132d43a566c5" + }] + }, + "id": "85e38883-641d-48ed-9701-15148be3cd7f", + "zIndex": 3 +}, { + "position": { + "x": 470, + "y": 80 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "鍐崇瓥" + }, + "body": { + "refPoints": "0,10 10,0 20,10 10,20" + } + }, + "visible": true, + "shape": "mk-polygon", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "d4b5354c-82f3-4a4f-ae58-bf0085b514aa" + }, { + "group": "right", + "id": "037a3476-fa69-4253-87a5-a96834358056" + }, { + "group": "bottom", + "id": "3c1e94df-6424-4d63-b744-8f5f67c2e54a" + }, { + "group": "left", + "id": "e1ad288c-6567-413f-b2c3-132d43a566c5" + }] + }, + "id": "dba4e54b-96e7-4bb8-9d2f-d76d47ce662e", + "zIndex": 4 +}, { + "position": { + "x": 470, + "y": 223 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "鍙�夎繃绋�" + }, + "body": { + "rx": 6, + "ry": 6 + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "9b1425a8-33db-4b10-a699-fb36fb452bb0" + }, { + "group": "right", + "id": "1532799f-dd72-441e-b753-c4356a9a6589" + }, { + "group": "bottom", + "id": "dfb1a762-247a-4056-8a8c-5f102eaebfac" + }, { + "group": "left", + "id": "c493019f-b8a3-4ac2-b250-b92fcb5553ae" + }] + }, + "id": "aef01570-a760-4b9b-ae64-fae758f3b1ca", + "zIndex": 5 +}, { + "position": { + "x": 365, + "y": 150 + }, + "size": { + "width": 36, + "height": 36 + }, + "attrs": { + "text": { + "text": "杩炴帴" + } + }, + "visible": true, + "shape": "mk-circle", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "7024e8d6-df2f-4273-aadb-67ed01507bae" + }, { + "group": "right", + "id": "6a767960-f16e-4b71-93f8-82400370fe2c" + }, { + "group": "bottom", + "id": "acd6bf40-8a98-481d-9280-a7df27da1743" + }, { + "group": "left", + "id": "6c62d9ff-0d11-4d44-b234-76033f91b67d" + }] + }, + "id": "ef3d1b04-c830-4146-89a4-23e330fce83d", + "zIndex": 6 +}, { + "position": { + "x": 590, + "y": 150 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "杩囩▼" + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "ec7d25b5-2c18-49ff-bfe7-37e77945b8b6" + }, { + "group": "right", + "id": "95ae6a99-3024-4667-8c77-8b3e0404b07a" + }, { + "group": "bottom", + "id": "f8b52aa8-fcf9-42c3-a573-badfec3097fb" + }, { + "group": "left", + "id": "c6e8912a-e3a3-4765-9aad-0767b55eb976" + }] + }, + "id": "832fc8cc-140f-45c5-ada0-d58736d6e78c", + "zIndex": 7 +}, { + "position": { + "x": 729, + "y": 150 + }, + "size": { + "width": 66, + "height": 36 + }, + "attrs": { + "text": { + "text": "缁撴潫" + }, + "body": { + "rx": 20, + "ry": 26 + } + }, + "visible": true, + "shape": "mk-rect", + "ports": { + "groups": { + "top": { + "position": "top", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "right": { + "position": "right", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "bottom": { + "position": "bottom", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + }, + "left": { + "position": "left", + "attrs": { + "circle": { + "r": 4, + "magnet": true, + "stroke": "var(--mk-sys-color)", + "strokeWidth": 1, + "fill": "#fff", + "style": { + "visibility": "hidden" + } + } + } + } + }, + "items": [{ + "group": "top", + "id": "dae0a153-31a7-4d9d-ae2b-7fce5b86eda3" + }, { + "group": "right", + "id": "18cb49ca-e40a-4cb5-8a05-18c5ed7644fe" + }, { + "group": "bottom", + "id": "f2667aa6-1f8b-485b-9de6-ed61b6abe815" + }, { + "group": "left", + "id": "748fb9f4-355c-4a6d-b8b2-f826c2dbbb42" + }] + }, + "id": "66f14529-c53b-43be-be90-8408f6658b07", + "zIndex": 8 +}] \ No newline at end of file diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx index 6be2240..ace6550 100644 --- a/src/menu/components/form/formaction/formconfig.jsx +++ b/src/menu/components/form/formaction/formconfig.jsx @@ -97,7 +97,7 @@ key: 'procMode', label: '鍙傛暟澶勭悊', initVal: card.procMode || 'system', - tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆�', + tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆傛敞锛氬綋閫夆�滄棤鈥濇椂锛屾寜閽�夎鏃朵細浼犻�掍富閿紝瀛樺湪琛ㄥ崟鏃朵細浼犻�掕〃鍗曞瓧娈碉紝瀛樺湪BID鏃朵細浼燘ID瀛楁銆�', required: true, options: [{ value: 'system', diff --git a/src/menu/components/group/groupcomponents/card.jsx b/src/menu/components/group/groupcomponents/card.jsx index 7dbdbb0..1ad8d52 100644 --- a/src/menu/components/group/groupcomponents/card.jsx +++ b/src/menu/components/group/groupcomponents/card.jsx @@ -25,6 +25,7 @@ const CustomChart = asyncComponent(() => import('@/menu/components/chart/chart-custom')) const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline')) const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('@/menu/components/chart/antv-X6')) const DoubleDataCard = asyncComponent(() => import('@/menu/components/card/double-data-card')) const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { @@ -109,6 +110,8 @@ return (<CustomChart card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'antvG6') { return (<AntvG6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'antvX6') { + return (<AntvX6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } } diff --git a/src/menu/components/group/groupcomponents/index.jsx b/src/menu/components/group/groupcomponents/index.jsx index 3d18434..5754e85 100644 --- a/src/menu/components/group/groupcomponents/index.jsx +++ b/src/menu/components/group/groupcomponents/index.jsx @@ -77,6 +77,7 @@ balcony: '娴姩鍗�', timeline: '鏃堕棿杞�', antvG6: '鏍戝浘', + antvX6: '娴佺▼鍥�', card: '鍗$墖' } let i = 1 diff --git a/src/menu/components/group/paste/index.jsx b/src/menu/components/group/paste/index.jsx index 8db0190..2660dd7 100644 --- a/src/menu/components/group/paste/index.jsx +++ b/src/menu/components/group/paste/index.jsx @@ -33,7 +33,7 @@ } if (appType !== 'mob') { - options.push('editable', 'antvG6', 'tree', 'dashboard', 'chart') + options.push('editable', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') } this.pasteFormRef.handleConfirm().then(res => { diff --git a/src/menu/components/iframe/options.jsx b/src/menu/components/iframe/options.jsx index b6e8ca6..2e74b01 100644 --- a/src/menu/components/iframe/options.jsx +++ b/src/menu/components/iframe/options.jsx @@ -63,7 +63,7 @@ field: 'height', label: '楂樺害', initval: wrap.height || '', - tooltip: 'ifram楂樺害銆�', + tooltip: 'ifram楂樺害銆傛敞锛氶珮搴�100vh鏃朵細鏍规嵁鏍囩椤电獥鍙h繘琛岃皟鏁�', required: true, options: ['px', 'vh', 'vw'] }, @@ -99,6 +99,7 @@ field: 'linkUrl', label: '鍦板潃閾炬帴', initval: wrap.linkUrl || '', + tooltip: '鍦板潃涓殑@loginuid@浼氳嚜鍔ㄦ浛鎹负褰撳墠绯荤粺鐨勭櫥褰曚俊鎭��', required: true, span: 24 }, diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 1f430f5..bd8ddb5 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -20,7 +20,7 @@ excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'width', 'hidden'], excelOut: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'], popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'maskStyle', 'closeButton', 'hidden'], - tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'], + tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden', 'openTab'], innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'refreshTab', 'title', 'hidden'] @@ -401,7 +401,7 @@ reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) if (this.record.pageTemplate === 'custom') { - shows.push('url', 'joint', 'open') + shows.push('url', 'proUrl', 'joint', 'open') } else if (this.record.pageTemplate === 'linkpage') { shows.push('linkmenu', 'open') @@ -906,6 +906,13 @@ { required: item.readonly ? false : item.required, message: '璇疯緭鍏�' + item.label + '!' } ] + if (item.key === 'url' || item.key === 'proUrl') { + rules.push({ + pattern: /^[^\s]*$/, + message: '鍦板潃涓笉鍙娇鐢ㄧ┖鏍硷紒' + }) + } + content = <TextArea rows={2} readOnly={item.readonly}/> } else if (item.type === 'keyinterface') { span = 24 diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 31b4a64..550b969 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -245,7 +245,7 @@ { type: 'select', key: 'OpenType', - label: '鎵撳紑鏂瑰紡', + label: '鎸夐挳绫诲瀷', initVal: card.OpenType, required: true, options: opentypes @@ -340,7 +340,7 @@ key: 'procMode', label: '鍙傛暟澶勭悊', initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), - tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆�', + tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆傛敞锛氬綋閫夆�滄棤鈥濇椂锛屾寜閽�夎鏃朵細浼犻�掍富閿紝瀛樺湪琛ㄥ崟鏃朵細浼犻�掕〃鍗曞瓧娈碉紝瀛樺湪BID鏃朵細浼燘ID瀛楁銆�', required: true, options: [{ value: 'system', @@ -424,7 +424,16 @@ key: 'url', label: '椤甸潰鍦板潃', initVal: card.url || '', + tooltip: appType === '' ? '鍦板潃鏍煎紡涓猴細http://******/admin/index.html#/iframe/menuId/loginuid/BID 浼氭墦寮�鏍囩椤点�傛敞锛氫娇鐢ˊloginuid@鏃惰嚜鍔ㄦ浛鎹负褰撳墠绯荤粺鐨刲oginuid锛涢�夋嫨鍗曡涓旀嫾鎺ュ弬鏁版椂浼氭嫾鎺ID銆�' : '', required: true + }, + { + type: 'textarea', + key: 'proUrl', + label: '姝e紡鍦板潃', + initVal: card.proUrl || '', + tooltip: appType === '' ? '鍦板潃鏍煎紡涓猴細http://******/admin/index.html#/iframe/menuId/loginuid/BID 浼氭墦寮�鏍囩椤点�傛敞锛氫娇鐢ˊloginuid@鏃惰嚜鍔ㄦ浛鎹负褰撳墠绯荤粺鐨刲oginuid锛涢�夋嫨鍗曡涓旀嫾鎺ュ弬鏁版椂浼氭嫾鎺ID銆�' : '', + required: false }, { type: 'radio', @@ -875,6 +884,19 @@ }, { type: 'radio', + key: 'openTab', + label: '鎵撳紑鏂瑰紡', + initVal: card.openTab || 'newtab', + tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆�', + forbid: appType !== '', + options: [ + {value: 'newtab', text: '鏍囩椤�'}, + // {value: 'newpage', text: '鏂伴〉闈紙鏍囩椤碉級'}, + {value: 'view', text: '鏂伴〉闈紙鍏ㄥ睆锛�'} + ] + }, + { + type: 'radio', key: 'display', label: '鏄剧ず鏂瑰紡', initVal: card.display || 'modal', @@ -1317,7 +1339,7 @@ { type: 'select', key: 'OpenType', - label: '鎵撳紑鏂瑰紡', + label: '鎸夐挳绫诲瀷', initVal: card.OpenType, required: true, options: opentypes @@ -1391,7 +1413,7 @@ key: 'procMode', label: '鍙傛暟澶勭悊', initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), - tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆�', + tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆傛敞锛氬綋閫夆�滄棤鈥濇椂锛屾寜閽�夎鏃朵細浼犻�掍富閿紝瀛樺湪琛ㄥ崟鏃朵細浼犻�掕〃鍗曞瓧娈碉紝瀛樺湪BID鏃朵細浼燘ID瀛楁銆�', required: true, options: [{ value: 'system', @@ -1467,7 +1489,16 @@ key: 'url', label: '椤甸潰鍦板潃', initVal: card.url || '', + tooltip: '鍦板潃鏍煎紡涓猴細http://******/admin/index.html#/iframe/menuId/loginuid/BID 浼氭墦寮�鏍囩椤点�傛敞锛氫娇鐢ˊloginuid@鏃惰嚜鍔ㄦ浛鎹负褰撳墠绯荤粺鐨刲oginuid锛涢�夋嫨鍗曡涓旀嫾鎺ュ弬鏁版椂浼氭嫾鎺ID銆�', required: true + }, + { + type: 'textarea', + key: 'proUrl', + label: '姝e紡鍦板潃', + initVal: card.proUrl || '', + tooltip: '鍦板潃鏍煎紡涓猴細http://******/admin/index.html#/iframe/menuId/loginuid/BID 浼氭墦寮�鏍囩椤点�傛敞锛氫娇鐢ˊloginuid@鏃惰嚜鍔ㄦ浛鎹负褰撳墠绯荤粺鐨刲oginuid锛涢�夋嫨鍗曡涓旀嫾鎺ュ弬鏁版椂浼氭嫾鎺ID銆�', + required: false }, { type: 'radio', @@ -1834,6 +1865,18 @@ }, { type: 'radio', + key: 'openTab', + label: '鎵撳紑鏂瑰紡', + initVal: card.openTab || 'newtab', + tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆�', + options: [ + {value: 'newtab', text: '鏍囩椤�'}, + // {value: 'newpage', text: '鏂伴〉闈紙鏍囩椤碉級'}, + {value: 'view', text: '鏂伴〉闈紙鍏ㄥ睆锛�'} + ] + }, + { + type: 'radio', key: 'display', label: '鏄剧ず鏂瑰紡', initVal: card.display || 'modal', diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx index 9391b7c..be4a281 100644 --- a/src/menu/components/tabs/paste/index.jsx +++ b/src/menu/components/tabs/paste/index.jsx @@ -63,7 +63,7 @@ if (appType === 'mob') { options.push('menubar') } else { - options.push('editable', 'antvG6', 'tree', 'dashboard', 'chart') + options.push('editable', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') } this.pasteFormRef.handleConfirm().then(res => { diff --git a/src/menu/components/tabs/tabcomponents/card.jsx b/src/menu/components/tabs/tabcomponents/card.jsx index cf77eba..74f3bf9 100644 --- a/src/menu/components/tabs/tabcomponents/card.jsx +++ b/src/menu/components/tabs/tabcomponents/card.jsx @@ -28,6 +28,7 @@ const CustomChart = asyncComponent(() => import('@/menu/components/chart/chart-custom')) const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline')) const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('@/menu/components/chart/antv-X6')) const DoubleDataCard = asyncComponent(() => import('@/menu/components/card/double-data-card')) const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => { @@ -118,6 +119,8 @@ return (<CustomChart card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'antvG6') { return (<AntvG6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'antvX6') { + return (<AntvX6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } } diff --git a/src/menu/components/tabs/tabcomponents/index.jsx b/src/menu/components/tabs/tabcomponents/index.jsx index bda63dd..62b0ac4 100644 --- a/src/menu/components/tabs/tabcomponents/index.jsx +++ b/src/menu/components/tabs/tabcomponents/index.jsx @@ -117,6 +117,7 @@ balcony: '娴姩鍗�', timeline: '鏃堕棿杞�', antvG6: '鏍戝浘', + antvX6: '娴佺▼鍥�', card: '鍗$墖' } let i = 1 diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx index bca6509..e655815 100644 --- a/src/menu/datasource/verifycard/customscript/index.jsx +++ b/src/menu/datasource/verifycard/customscript/index.jsx @@ -1,7 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Form, Row, Col, Button, notification, Select, Tooltip } from 'antd' +import { Form, Row, Col, Button, notification, Select, Tooltip, Modal } from 'antd' +import Toast from 'antd-mobile/es/components/toast' +import Dialog from 'antd-mobile/es/components/dialog' import Utils from '@/utils/utils.js' import CodeMirror from '@/templates/zshare/codemirror' @@ -209,38 +211,83 @@ }) } + showError = (type) => { + let appType = sessionStorage.getItem('appType') + + if (type === 'S') { + if (appType === 'mob') { + Toast.show({ icon: 'success', content: '鎵ц鎴愬姛锛�', duration: 3000 }) + } else { + notification.success({ + top: 92, + message: '鎵ц鎴愬姛锛�', + duration: 2 + }) + } + + } else if (type === 'Y') { + if (appType === 'mob') { + Dialog.alert({content: '鎵ц鎴愬姛锛�', confirmText: '鐭ラ亾浜�'}) + } else { + Modal.success({ + title: '鎵ц鎴愬姛锛�' + }) + } + } else if (type === 'N') { + if (appType === 'mob') { + Dialog.alert({content: '鎵ц澶辫触锛�', confirmText: '鐭ラ亾浜�'}) + } else { + Modal.error({ + title: '鎵ц澶辫触锛�' + }) + } + } else { + if (appType === 'mob') { + Toast.show({ icon: 'fail', content: '鎵ц澶辫触锛�', duration: 3000 }) + } else { + notification.error({ + top: 92, + message: '鎵ц澶辫触锛�', + duration: 10 + }) + } + } + } + render() { const { systemScripts, setting } = this.props const { getFieldDecorator } = this.props.form const { usefulFields } = this.state - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 8 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - } - } let urlFields = window.GLOB.urlFields ? window.GLOB.urlFields.join(', ') : '' return ( - <Form {...formItemLayout} className="modal-menu-setting-script"> + <Form className="modal-source-setting-script"> <Row gutter={24}> - {setting.tableName ? <Col span={8}> - <Form.Item label={'琛ㄥ悕'} style={{whiteSpace: 'nowrap', margin: 0}}> + {setting.tableName ? <Col span={5}> + <Form.Item label="琛ㄥ悕" style={{whiteSpace: 'nowrap', margin: 0}}> {setting.tableName} </Form.Item> </Col> : null} - <Col span={8}> - <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}> + <Col span={19}> + <Form.Item label="鎶ラ敊瀛楁" style={{margin: 0}}> ErrorCode, retmsg + <span style={{marginLeft: 25}}> + 鎴愬姛锛� + <span className="error-val" onClick={() => {this.showError('S')}}> S </span>銆� + <span className="error-val" onClick={() => {this.showError('Y')}}> Y </span>銆� + -1锛堜笉鎻愮ず锛� + </span> + <span style={{marginLeft: 20}}> + 澶辫触锛� + <span className="error-val" onClick={() => {this.showError('N')}}> N </span>銆� + -2锛堜笉鎻愮ず锛夈�� + <span className="error-val" onClick={() => {this.showError('')}}> 鍏朵粬 </span> + </span> </Form.Item> </Col> - <Col span={24} className="sqlfield"> - <Form.Item label={'鍙敤瀛楁'}> + <Col span={24}> + <Form.Item label="鍙敤瀛楁" className="field-able"> <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鎺掑簭銆佸垎椤典互鍙婃悳绱㈡潯浠跺彉閲忥紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}</Tooltip> @@ -248,7 +295,7 @@ </Form.Item> </Col> <Col span={10} style={{width: '43%'}}> - <Form.Item label={'蹇嵎娣诲姞'} labelCol={{xs: { span: 24 }, sm: { span: 6 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 18 }} } style={{marginBottom: 0}}> + <Form.Item label="蹇嵎娣诲姞" labelCol={{xs: { span: 24 }, sm: { span: 6 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 18 }} } style={{marginBottom: 0}}> <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} diff --git a/src/menu/datasource/verifycard/customscript/index.scss b/src/menu/datasource/verifycard/customscript/index.scss index 2a1d2d8..f663222 100644 --- a/src/menu/datasource/verifycard/customscript/index.scss +++ b/src/menu/datasource/verifycard/customscript/index.scss @@ -1,34 +1,44 @@ -.modal-menu-setting-script { - .sqlfield { - .ant-form-item { - margin-bottom: 5px; - } +.modal-source-setting-script { + .ant-form-item { + display: flex; + margin-bottom: 5px; + } + .ant-form-item-label { + width: 110px; + min-width: 110px; + } + .field-able { .ant-form-item-control { - line-height: 24px; - } - .ant-form-item-label { line-height: 25px; - } - .ant-form-item-children { - line-height: 22px; - } - .ant-col-sm-8 { - width: 10.5%; - } - .ant-col-sm-16 { - width: 89.5%; + padding-top: 7px; } } - .sql { - .ant-col-sm-8 { - width: 10.5%; - } - .ant-col-sm-16 { - width: 89.5%; - padding-top: 4px; - } - .CodeMirror { - height: 350px; - } + .ant-form-item-control-wrapper { + flex: auto; + } + .CodeMirror { + height: 350px; + } + .error-val { + display: inline-block; + margin-right: 5px; + color: #1890ff; + cursor: pointer; + } +} +.adm-mask { + z-index: 2000!important; +} +.adm-dialog { + z-index: 2000!important; + .adm-center-popup-body { + background-color: #ffffff; + } + .adm-center-popup-wrap { + z-index: 2000; + } + .adm-button { + color: #1890ff; + border-top: 1px solid #e9e9e9; } } \ No newline at end of file diff --git a/src/menu/menushell/card.jsx b/src/menu/menushell/card.jsx index 1719f71..49a3646 100644 --- a/src/menu/menushell/card.jsx +++ b/src/menu/menushell/card.jsx @@ -133,14 +133,6 @@ } } - // if (card.type === 'antvX6') { // 娴嬭瘯 - // return ( - // <div className={'ant-col mk-component-card ant-col-' + (card.width || 24)} style={style}> - // <AntvX6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/> - // </div> - // ) - // } - return ( <div className={'ant-col mk-component-card ant-col-' + (card.width || 24)} ref={node => drag(drop(node))} style={style}> {getCardComponent()} diff --git a/src/menu/modulesource/option.jsx b/src/menu/modulesource/option.jsx index 50d70b5..4b50498 100644 --- a/src/menu/modulesource/option.jsx +++ b/src/menu/modulesource/option.jsx @@ -29,7 +29,7 @@ import mindmap from '@/assets/mobimg/mindmap.png' import indent from '@/assets/mobimg/indent.jfif' import kapmap from '@/assets/mobimg/kapmap.jfif' -// import xflow from '@/assets/mobimg/xflow.png' +import xflow from '@/assets/mobimg/xflow.png' import Voucher from '@/assets/mobimg/voucher.png' import Account from '@/assets/mobimg/account.png' @@ -64,7 +64,7 @@ { type: 'menu', url: mindmap, component: 'antvG6', subtype: 'mindmap', title: '鎬濈淮瀵煎浘', width: 24 }, { type: 'menu', url: indent, component: 'antvG6', subtype: 'indentTree', title: '缂╄繘鏂囦欢鏍�', width: 24 }, { type: 'menu', url: kapmap, component: 'antvG6', subtype: 'kapmap', title: '鐭ヨ瘑鍥捐氨鏍�', width: 24 }, - // { type: 'menu', url: xflow, component: 'antvX6', subtype: 'xflow', title: '娴佺▼鍥�', width: 24 }, + { type: 'menu', url: xflow, component: 'antvX6', subtype: 'xflow', title: '娴佺▼鍥�', width: 24 }, { type: 'menu', url: chart, component: 'chart', subtype: 'custom', title: '鑷畾涔夊浘琛�', width: 24, forbid: ['billPrint'] }, { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '瀵屾枃鏈�', width: 24 }, { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '鑷畾涔�', width: 24 }, diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index 5179037..a39a3fb 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -63,7 +63,7 @@ options.push('menubar', 'singleSearch') } } else { - options.push('editable', 'mainsearch', 'antvG6', 'tree', 'dashboard', 'chart') + options.push('editable', 'mainsearch', 'antvG6', 'antvX6', 'tree', 'dashboard', 'chart') } this.pasteFormRef.handleConfirm().then(res => { diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index 6acd6cc..a781f01 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -1,5 +1,4 @@ import React, {Component} from 'react' -import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Collapse, Form, Col, InputNumber, Input, Select, Radio, Drawer, Button, message } from 'antd' import { @@ -46,11 +45,6 @@ const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) class MobController extends Component { - static propTpyes = { - editElem: PropTypes.any, - updateStyle: PropTypes.func, - } - state = { card: null, fonts: null, @@ -168,7 +162,7 @@ this.callback = null } - updateStyle = (style, prop) => { + updateStyle = (style) => { const { card } = this.state let _style = { @@ -176,8 +170,16 @@ ...style } - if (prop && !_style[prop]) { - delete _style[prop] + Object.keys(style).forEach(key => { + if (!_style[key] && _style[key] !== 0) { + delete _style[key] + } + }) + + if (_style.position === 'relative' || _style.position === 'absolute') { + _style.zIndex = 1 + } else { + delete _style.zIndex } this.setState({ @@ -283,7 +285,7 @@ * @description 淇敼鑳屾櫙棰滆壊 锛岄鑹叉帶浠� */ changeBackgroundColor = (val) => { - this.updateStyle({backgroundColor: val}, 'backgroundColor') + this.updateStyle({backgroundColor: val}) } changeBackground = (val) => { @@ -443,11 +445,11 @@ } changeWidth = (val) => { - this.updateStyle({width: val === '0px' ? '' : val}, 'width') + this.updateStyle({width: val}) } changeHeight = (val) => { - this.updateStyle({height: val === '0px' ? '' : val}, 'height') + this.updateStyle({height: val}) } changeNormalStyle = (val, type) => { @@ -564,7 +566,7 @@ label={<ColumnWidthOutlined title="瀹藉害"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%', 'auto']} onChange={this.changeWidth}/> + <StyleInput clear={true} defaultValue={card.width || ''} options={['px', 'vh', 'vw', '%', 'auto']} onChange={this.changeWidth}/> </Form.Item> </Col> </Panel> : null} @@ -575,7 +577,7 @@ label={<ColumnHeightOutlined title="楂樺害"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.height || ''} options={['px', 'vh', 'vw']} onChange={this.changeHeight}/> + <StyleInput clear={true} defaultValue={card.height || ''} options={['px', 'vh', 'vw']} onChange={this.changeHeight}/> </Form.Item> </Col> </Panel> : null} @@ -863,7 +865,7 @@ label={<RadiusSettingOutlined title="鍦嗚"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.borderRadius || '0px'} options={['px', '%']} onChange={(val) => this.changeNormalStyle(val, 'borderRadius')}/> + <StyleInput clear={true} defaultValue={card.borderRadius || ''} options={['px', '%']} onChange={(val) => this.changeNormalStyle(val, 'borderRadius')}/> </Form.Item> </Col> </Panel> : null} @@ -919,7 +921,7 @@ label={<ArrowUpOutlined title="涓婅竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.marginTop || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginTop')}/> + <StyleInput clear={true} defaultValue={card.marginTop || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginTop')}/> </Form.Item> </Col> <Col span={24}> @@ -928,7 +930,7 @@ label={<ArrowDownOutlined title="涓嬭竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.marginBottom || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginBottom')}/> + <StyleInput clear={true} defaultValue={card.marginBottom || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginBottom')}/> </Form.Item> </Col> <Col span={24}> @@ -937,7 +939,7 @@ label={<ArrowLeftOutlined title="宸﹁竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.marginLeft || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginLeft')}/> + <StyleInput clear={true} defaultValue={card.marginLeft || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginLeft')}/> </Form.Item> </Col> <Col span={24}> @@ -946,7 +948,7 @@ label={<ArrowRightOutlined title="鍙宠竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.marginRight || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginRight')}/> + <StyleInput clear={true} defaultValue={card.marginRight || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'marginRight')}/> </Form.Item> </Col> </Panel> : null} @@ -957,7 +959,7 @@ label={<ArrowUpOutlined title="涓婅竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.paddingTop || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingTop')}/> + <StyleInput clear={true} defaultValue={card.paddingTop || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingTop')}/> </Form.Item> </Col> <Col span={24}> @@ -966,7 +968,7 @@ label={<ArrowDownOutlined title="涓嬭竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.paddingBottom || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingBottom')}/> + <StyleInput clear={true} defaultValue={card.paddingBottom || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingBottom')}/> </Form.Item> </Col> <Col span={24}> @@ -975,7 +977,7 @@ label={<ArrowLeftOutlined title="宸﹁竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.paddingLeft || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingLeft')}/> + <StyleInput clear={true} defaultValue={card.paddingLeft || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingLeft')}/> </Form.Item> </Col> <Col span={24}> @@ -984,7 +986,7 @@ label={<ArrowRightOutlined title="鍙宠竟璺�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.paddingRight || '0px'} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> + <StyleInput clear={true} defaultValue={card.paddingRight || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> </Form.Item> </Col> </Panel> : null} @@ -1010,7 +1012,7 @@ label={<ColumnHeightOutlined title="鏈�灏忛珮搴�"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <StyleInput defaultValue={card.minHeight || ''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'minHeight')}/> + <StyleInput clear={true} defaultValue={card.minHeight || ''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'minHeight')}/> </Form.Item> </Col> </Panel> : null} @@ -1042,6 +1044,57 @@ </Form.Item> </Col> </Panel> : null} + {options.includes('position') ? <Panel header="瀹氫綅" key="position"> + <Col span={24}> + <Form.Item + colon={false} + label={<SwapOutlined title="瀹氫綅"/>} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.position || 'unset'} onChange={(e) => this.changeNormalStyle(e.target.value, 'position')}> + <Radio value="unset">鏃�</Radio> + <Radio value="relative">鐩稿瀹氫綅</Radio> + <Radio value="absolute">缁濆瀹氫綅</Radio> + </Radio.Group> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item + colon={false} + label={<ArrowUpOutlined title="涓�"/>} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <StyleInput clear={true} defaultValue={card.top || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'top')}/> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item + colon={false} + label={<ArrowDownOutlined title="涓�"/>} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <StyleInput clear={true} defaultValue={card.bottom || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'bottom')}/> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item + colon={false} + label={<ArrowLeftOutlined title="宸�"/>} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <StyleInput clear={true} defaultValue={card.left || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'left')}/> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item + colon={false} + label={<ArrowRightOutlined title="鍙�"/>} + labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } + > + <StyleInput clear={true} defaultValue={card.right || ''} options={['px', 'vh', 'vw', '%']} onChange={(val) => this.changeNormalStyle(val, 'right')}/> + </Form.Item> + </Col> + </Panel> : null} </Collapse> : null} </Form> <div style={{textAlign: 'right', lineHeight: '60px', marginBottom: '30px'}}> diff --git a/src/menu/stylecontroller/styleInput/index.jsx b/src/menu/stylecontroller/styleInput/index.jsx index d7661d0..d3a93a0 100644 --- a/src/menu/stylecontroller/styleInput/index.jsx +++ b/src/menu/stylecontroller/styleInput/index.jsx @@ -105,6 +105,7 @@ } changeValue = (e) => { + const { clear } = this.props const { unit } = this.state let val = e.target.value @@ -126,7 +127,7 @@ if (this.props.onChange) { if (!_val) { - this.props.onChange('0px') + this.props.onChange(clear ? '' : '0px') } else { this.props.onChange(`${_val}${unit}`) } diff --git a/src/router/index.js b/src/router/index.js index 5a7b168..efa1c0c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -24,6 +24,7 @@ const RoleManage = asyncLoadComponent(() => import('@/views/rolemanage')) const SystemFunc = asyncLoadComponent(() => import('@/views/systemfunc')) const SystemProc = asyncLoadComponent(() => import('@/views/systemproc')) +const MkIframe = asyncLoadComponent(() => import('@/views/mkiframe')) const routers = [ {path: '/login', name: 'login', component: Login}, @@ -47,6 +48,10 @@ {path: '/role/:param', name: 'role', component: RoleManage}, {path: '/hs', name: 'hs', component: SystemFunc}, {path: '/proc', name: 'proc', component: SystemProc}, + {path: '/iframe/:menuId/:loginUid', name: 'iframe', component: MkIframe}, + {path: '/iframe/:menuId/:loginUid/:bid', name: 'iframe', component: MkIframe}, + {path: '/view/:menuId', name: 'iframe', component: MkIframe}, + {path: '/view/:menuId/:bid', name: 'iframe', component: MkIframe}, {path: '/interface', name: 'interface', component: Interface} ] diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 59932b9..d979e0c 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -25,7 +25,6 @@ param: PropTypes.any, // 鍏朵粬椤甸潰浼犻�掔殑鍙傛暟 Tab: PropTypes.string, // 寮圭獥鏍囩 MenuID: PropTypes.string, // 鑿滃崟Id - MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 MenuName: PropTypes.string, // 鑿滃崟鍚嶇О changeTemp: PropTypes.func } @@ -51,7 +50,7 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { MenuID } = this.props + const { MenuID, MenuName } = this.props let _param = { func: 'sPC_Get_LongParam', @@ -67,6 +66,8 @@ config = window.decodeURIComponent(window.atob(result.LongParam)) config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) config = JSON.parse(config) + config.MenuID = MenuID + config.MenuName = MenuName || config.MenuName } catch (e) { console.warn('Parse Failure') config = '' @@ -156,7 +157,7 @@ }) } - config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID) + config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName) let autoMatic = null if (config.autoMatic && config.autoMatic.enable === 'true') { @@ -263,11 +264,11 @@ } } - filterComponent = (components, roleId, permAction, skip, urlparam, pageId) => { + filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName) => { return components.filter(item => { item.$pageId = pageId - item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '涓昏〃') + item.$menuname = (MenuName || '') + '-' + (item.name || '涓昏〃') if (item.type === 'tabs') { item.subtabs = item.subtabs.filter(tab => { @@ -286,13 +287,13 @@ if (tab.permission !== 'true') { // 鏉冮檺鏈紑鍚笉鍋氭潈闄愭帶鍒� skip = true } - tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId) + tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName) return tab }) return true } else { - item.name = (this.props.MenuName || '') + item.name = (MenuName || '') } // 鎼滅储鏉′欢鍒濆鍖� diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index f9887fb..d8e90c6 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -1010,7 +1010,7 @@ return ( <div className="commontable" id={this.state.ContainerId}> {loadingview ? <Spin size="large" /> : null} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null } {setting && config.charts ? <Row className="chart-view" gutter={16}> diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx index 9d68b21..119c77e 100644 --- a/src/tabviews/custom/components/card/balcony/index.jsx +++ b/src/tabviews/custom/components/card/balcony/index.jsx @@ -385,16 +385,32 @@ this.timer && this.timer.stop() } } + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index f87948f..33e1622 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -200,11 +200,6 @@ // } let Id = '' - let con = '?' - - if (/\?/ig.test(url)) { - con = '&' - } if (cards.subtype === 'propcard' && cardCell) { Id = cardCell.setting.primaryId || '' @@ -213,6 +208,12 @@ } if (card.joint === 'true') { + let con = '?' + + if (/\?/ig.test(url)) { + con = '&' + } + url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` } @@ -987,6 +988,7 @@ <div className={'ant-col mk-cell-btn ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> <NewPageButton btn={card} + BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} selectedData={_data} diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 1d2e850..d83be3c 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -768,16 +768,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index 3a19ad3..1fe03f6 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -703,16 +703,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 681652b..c8bc94d 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -461,16 +461,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index f453ff7..f89d678 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -365,17 +365,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 590bc98..45c79ef 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -316,17 +316,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index bfeba28..3084bba 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -337,17 +337,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/chart/antv-G6/index.jsx b/src/tabviews/custom/components/chart/antv-G6/index.jsx index f481f2e..d66d9c9 100644 --- a/src/tabviews/custom/components/chart/antv-G6/index.jsx +++ b/src/tabviews/custom/components/chart/antv-G6/index.jsx @@ -1114,16 +1114,30 @@ this.data = result.data || [] this.handleData() } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx new file mode 100644 index 0000000..66b6b4c --- /dev/null +++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx @@ -0,0 +1,1662 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Spin, Tooltip, message, Modal, notification } from 'antd' +import { UndoOutlined, RedoOutlined, VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined, QuestionCircleOutlined } from '@ant-design/icons' +import { Graph, Shape } from '@antv/x6' +import { Stencil } from '@antv/x6-plugin-stencil' +import { Transform } from '@antv/x6-plugin-transform' +import { Selection } from '@antv/x6-plugin-selection' +import { Snapline } from '@antv/x6-plugin-snapline' +import { Keyboard } from '@antv/x6-plugin-keyboard' +import { Clipboard } from '@antv/x6-plugin-clipboard' +import { History } from '@antv/x6-plugin-history' +import { Export } from '@antv/x6-plugin-export' + +import Api from '@/api' +import MKEmitter from '@/utils/events.js' +import asyncComponent from '@/utils/asyncComponent' +import NormalHeader from '@/tabviews/custom/components/share/normalheader' +import lanes from '@/menu/components/chart/antv-X6/lane.json' +import xflows from '@/menu/components/chart/antv-X6/xflow.json' +import './index.scss' + +const NodeUpdate = asyncComponent(() => import('./nodeupdate')) + +const groups = { + top: { + position: 'top', + attrs: { + circle: { + r: 4, + magnet: true, + stroke: 'var(--mk-sys-color)', + strokeWidth: 1, + fill: '#fff', + style: { + visibility: 'hidden' + } + } + } + }, + right: { + position: 'right', + attrs: { + circle: { + r: 4, + magnet: true, + stroke: 'var(--mk-sys-color)', + strokeWidth: 1, + fill: '#fff', + style: { + visibility: 'hidden' + } + } + } + }, + bottom: { + position: 'bottom', + attrs: { + circle: { + r: 4, + magnet: true, + stroke: 'var(--mk-sys-color)', + strokeWidth: 1, + fill: '#fff', + style: { + visibility: 'hidden' + } + } + } + }, + left: { + position: 'left', + attrs: { + circle: { + r: 4, + magnet: true, + stroke: 'var(--mk-sys-color)', + strokeWidth: 1, + fill: '#fff', + style: { + visibility: 'hidden' + } + } + } + } +} + +Graph.registerNode( + 'lane', + { + inherit: 'rect', + markup: [ + { + tagName: 'rect', + selector: 'body', + }, + { + tagName: 'rect', + selector: 'name-rect', + }, + { + tagName: 'text', + selector: 'name-text', + }, + ], + attrs: { + body: { + fill: '#FFF', + stroke: '#5F95FF', + strokeWidth: 1, + }, + 'name-rect': { + width: 200, + height: 36, + fill: '#5F95FF', + stroke: '#fff', + strokeWidth: 1, + x: -1, + }, + 'name-text': { + ref: 'name-rect', + refY: 0.5, + refX: 0.5, + textAnchor: 'middle', + fontWeight: 'bold', + fill: '#fff', + fontSize: 14, + }, + }, + zIndex: 0 + }, + true, +) + +Graph.registerNode( + 'mk-rect', + { + inherit: 'rect', + width: 66, + height: 36, + attrs: { + body: { + strokeWidth: 1, + stroke: '#000000', + fill: '#FFFFFF' + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups, + items: [ + { group: 'top' }, + { group: 'right' }, + { group: 'bottom' }, + { group: 'left' } + ] + } + }, + true +) + +Graph.registerNode( + 'mk-polygon', + { + inherit: 'polygon', + width: 66, + height: 36, + attrs: { + body: { + strokeWidth: 1, + stroke: '#000000', + fill: '#FFFFFF' + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups, + items: [ + { group: 'top' }, + { group: 'right' }, + { group: 'bottom' }, + { group: 'left' } + ] + } + }, + true +) + +Graph.registerNode( + 'mk-paral', + { + inherit: 'polygon', + width: 66, + height: 36, + attrs: { + body: { + strokeWidth: 1, + stroke: '#000000', + fill: '#FFFFFF' + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups, + items: [ + { group: 'top' }, + { group: 'bottom' } + ] + } + }, + true +) + +Graph.registerNode( + 'mk-circle', + { + inherit: 'circle', + width: 36, + height: 36, + attrs: { + body: { + strokeWidth: 1, + stroke: '#000000', + fill: '#FFFFFF' + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups, + items: [ + { group: 'top' }, + { group: 'right' }, + { group: 'bottom' }, + { group: 'left' } + ] + } + }, + true +) + +Graph.registerNode( + 'mk-ellipse', + { + inherit: 'ellipse', + width: 66, + height: 36, + attrs: { + body: { + strokeWidth: 1, + stroke: '#000000', + fill: '#FFFFFF' + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups, + items: [ + { group: 'top' }, + { group: 'right' }, + { group: 'bottom' }, + { group: 'left' } + ] + } + }, + true +) + +Graph.registerNode( + 'mk-star', + { + inherit: 'polygon', + width: 36, + height: 36, + points: '100,10 40,198 190,78 10,78 160,198', + attrs: { + body: { + fill: '#FFFFFF', + stroke: '#000000', + strokeWidth: 1, + fillRule: 'nonzero' + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups, + items: [ + { group: 'top' }, + { group: 'right' }, + { group: 'bottom' }, + { group: 'left' } + ] + } + }, + true +) + +Graph.registerNode( + 'mk-text', + { + inherit: 'text-block', + width: 66, + height: 36, + text: '鏂囨湰鍩�', + attrs: { + body: { + fill: '#ffffff', + stroke: '#000000', + strokeWidth: 1, + rx: 0, + ry: 0 + } + } + }, + // { + // inherit: 'rect', + // width: 66, + // height: 36, + // attrs: { + // body: { + // strokeWidth: 0, + // fill: 'transparent' + // }, + // text: { + // fontSize: 12, + // fill: '#262626' + // } + // } + // }, + true +) + +class antvX6Chart extends Component { + static propTpyes = { + config: PropTypes.object + } + + state = { + config: null, + editing: false, + node: null, + loading: false, + rolelist: [] + } + + selectNode = null + mkGraph = null + cells = [] + + UNSAFE_componentWillMount () { + const { config } = this.props + let _config = fromJS(config).toJS() + + let BID = '' + let BData = '' + + _config.setting.supModule = '' + + if (_config.plot.supModule && _config.plot.supModule.length > 0) { + _config.setting.supModule = _config.plot.supModule.pop() + } + + if (_config.setting.supModule) { + BData = window.GLOB.CacheData.get(_config.setting.supModule) + } else { + BData = window.GLOB.CacheData.get(config.$pageId) + } + if (BData) { + BID = BData.$BID || '' + } + + this.setState({ + config: _config, + BID: BID || '', + BData: BData || '', + plot: _config.plot + }, () => { + this.loadData() + + if (_config.plot.function === 'edit') { + this.getrolelist() + } + }) + } + + componentDidMount () { + MKEmitter.addListener('reloadData', this.reloadData) + MKEmitter.addListener('resetSelectLine', this.resetParentParam) + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 + */ + componentWillUnmount () { + this.setState = () => { + return + } + + MKEmitter.removeListener('reloadData', this.reloadData) + MKEmitter.removeListener('resetSelectLine', this.resetParentParam) + } + + reloadData = (menuId) => { + const { config } = this.state + + if (config.uuid !== menuId) return + + this.loadData() + } + + resetParentParam = (MenuID, id) => { + const { config } = this.state + + if (!config.setting.supModule || config.setting.supModule !== MenuID) return + if (id !== this.state.BID || id !== '') { + this.setState({ BID: id }, () => { + this.loadData() + }) + } + } + + getrolelist = () => { + Api.getSystemConfig({func: 's_get_rolelist', OrderCol: 'RoleID desc', PageIndex: 1, PageSize: 1000}).then(res => { + if (!res.status) { + notification.error({ + top: 92, + message: res.message, + duration: 10 + }) + return + } + + this.setState({rolelist: res.data || []}) + }) + } + + async loadData () { + const { config, BID } = this.state + + if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� + if (!is(fromJS(this.data), fromJS([]))) { + this.cells = [] + this.handleData() + } + return + } + + this.setState({ + loading: true + }) + + if (config) { + if (config.plot.subtype === 'xflow') { + this.cells = xflows + } else { + this.cells = lanes + } + this.handleData() + + setTimeout(() => { + this.setState({ + loading: false + }) + }, 2000) + return + } + + let param = { + func: '', + BID: BID + } + + let result = await Api.genericInterface(param) + if (result.status) { + this.setState({ + loading: false + }) + + this.cells = result.data || [] + this.handleData() + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } + } else { + this.setState({ + loading: false + }) + + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } + } + } + + handleData = () => { + const { config } = this.state + + MKEmitter.emit('resetSelectLine', config.uuid, '', '') + + let _element = document.getElementById(config.uuid + 'container') + if (_element) { + _element.innerHTML = '' + } + + setTimeout(() => { + this.viewrender() + }, 50) + } + + viewrender = () => { + const { plot } = this.state + + if (plot.function === 'show') { + if (plot.subtype === 'xflow') { + this.xflowSrender() + } else if (plot.subtype === 'lane') { + this.laneSrender() + } + } else { + if (plot.subtype === 'xflow') { + this.xflowrender() + } else if (plot.subtype === 'lane') { + this.lanerender() + } + } + } + + xflowSrender = () => { + const { config } = this.state + + const graph = new Graph({ + container: document.getElementById(config.uuid + 'container'), + grid: config.plot.grid, + scaling: { + min: 0.5, + max: 2 + }, + autoResize: true, + panning: true, + background: { + color: config.plot.backgroundColor || 'transparent' + }, + mousewheel: { + enabled: true, + zoomAtMousePosition: true, + modifiers: 'ctrl' + }, + connecting: { + router: 'manhattan', + connector: { + name: 'rounded', + args: { + radius: 8 + } + }, + anchor: 'center', + connectionPoint: 'anchor', + 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' + } + } + } + } + }) + + if (this.cells.length > 0) { + let cells = [] + this.cells.forEach((item) => { + if (item.shape === 'edge') { + cells.push(graph.createEdge(item)) + } else { + cells.push(graph.createNode(item)) + } + }) + graph.resetCells(cells) + graph.positionContent('center') + } + } + + laneSrender = () => { + const { config } = this.state + + const graph = new Graph({ + container: document.getElementById(config.uuid + 'container'), + scaling: { + min: 0.5, + max: 2 + }, + autoResize: true, + panning: true, + background: { color: '#ffffff' }, + mousewheel: { + enabled: true, + zoomAtMousePosition: true, + modifiers: 'ctrl' + }, + connecting: { + router: 'manhattan', + connector: { + name: 'rounded', + args: { + radius: 8 + } + }, + anchor: 'center', + connectionPoint: 'anchor', + 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() + } + } + }) + + if (this.cells.length > 0) { + let cells = [] + this.cells.forEach((item) => { + if (item.shape === 'edge') { + cells.push(graph.createEdge(item)) + } else { + cells.push(graph.createNode(item)) + } + }) + graph.resetCells(cells) + graph.positionContent('top') + } + } + + xflowrender = () => { + const { config } = this.state + + const graph = new Graph({ + container: document.getElementById(config.uuid + 'container'), + grid: config.plot.grid, + scaling: { + min: 0.5, + max: 2 + }, + autoResize: true, + panning: true, + background: { + color: config.plot.backgroundColor || 'transparent' + }, + mousewheel: { + enabled: true, + zoomAtMousePosition: true, + modifiers: 'ctrl' + }, + connecting: { + router: 'manhattan', + connector: { + name: 'rounded', + args: { + radius: 8 + } + }, + anchor: 'center', + connectionPoint: 'anchor', + 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' + } + } + } + } + }) + + graph + .use(new Transform({ + resizing: true, + rotating: true + })) + .use(new Selection()) + .use(new Snapline()) + .use(new Keyboard()) + .use(new Clipboard()) + .use(new History()) + .use(new Export()) + + const stencil = new Stencil({ + title: '娴佺▼鍥�', + target: graph, + stencilGraphWidth: 180, + stencilGraphHeight: 180, + groups: [ + { + title: '閫氱敤鑺傜偣', + name: 'group1' + }, + { + title: '鑷畾涔�', + name: 'group2', + graphHeight: 150, + layoutOptions: { + rowHeight: 70 + } + } + ], + layoutOptions: { + columns: 2, + columnWidth: 80, + rowHeight: 55 + } + }) + + document.getElementById(config.uuid + 'stencil').appendChild(stencil.container) + + graph.bindKey(['meta+c', 'ctrl+c'], () => { + const cells = graph.getSelectedCells() + if (cells.length) { + graph.copy(cells) + } + return false + }) + graph.bindKey(['meta+x', 'ctrl+x'], () => { + const cells = graph.getSelectedCells() + if (cells.length) { + graph.cut(cells) + } + return false + }) + graph.bindKey(['meta+v', 'ctrl+v'], () => { + if (!graph.isClipboardEmpty()) { + graph.paste({ offset: 32 }) + } + return false + }) + + graph.bindKey(['meta+z', 'ctrl+z'], () => { + if (graph.canUndo()) { + graph.undo() + } + return false + }) + graph.bindKey(['meta+shift+z', 'ctrl+shift+z'], () => { + if (graph.canRedo()) { + graph.redo() + } + return false + }) + + graph.bindKey(['backspace', 'delete'], () => { + const cells = graph.getSelectedCells() + if (cells.length) { + graph.removeCells(cells) + this.selectNode = null + this.setState({node: null}) + } + }) + + // 鎺у埗杩炴帴妗╂樉绀�/闅愯棌 + const showPorts = (ports, show) => { + for (let i = 0, len = ports.length; i < len; i += 1) { + ports[i].style.visibility = show ? 'visible' : 'hidden' + } + } + graph.on('node:mouseenter', () => { + const container = document.getElementById(config.uuid + 'container') + const ports = container.querySelectorAll('.x6-port-body') + showPorts(ports, true) + }) + graph.on('node:mouseleave', () => { + const container = document.getElementById(config.uuid + 'container') + const ports = container.querySelectorAll('.x6-port-body') + showPorts(ports, false) + }) + + graph.on('node:click', ({ e, x, y, node, view }) => { + this.selectNode = node + + this.setState({node: node.store.data}) + }) + graph.on('edge:click', ({ e, x, y, edge, view }) => { + this.selectNode = edge + + this.setState({node: edge.store.data}) + + graph.clearTransformWidgets() + }) + graph.on('blank:click', ({ e, x, y }) => { + this.selectNode = null + + this.setState({node: null}) + }) + + const r1 = graph.createNode({ + shape: 'mk-rect', + label: '寮�濮�', + attrs: { + body: { + rx: 20, + ry: 26 + } + } + }) + const r2 = graph.createNode({ + shape: 'mk-rect', + label: '杩囩▼' + }) + const r3 = graph.createNode({ + shape: 'mk-rect', + attrs: { + body: { + rx: 6, + ry: 6 + } + }, + label: '鍙�夎繃绋�' + }) + const r4 = graph.createNode({ + shape: 'mk-polygon', + attrs: { + body: { + refPoints: '0,10 10,0 20,10 10,20' + } + }, + label: '鍐崇瓥' + }) + const r5 = graph.createNode({ + shape: 'mk-paral', + attrs: { + body: { + refPoints: '10,0 40,0 30,20 0,20' + } + }, + label: '鏁版嵁' + }) + const r6 = graph.createNode({ + shape: 'mk-circle', + label: '杩炴帴' + }) + + stencil.load([r1, r2, r3, r4, r5, r6], 'group1') + + const p1 = graph.createNode({ + shape: 'mk-ellipse', + label: 'ellipse' + }) + const p2 = graph.createNode({ + shape: 'mk-star', + label: '' + }) + + const p3 = graph.createNode({ + shape: 'mk-text', + label: '鏂囨湰' + }) + + stencil.load([p1, p2, p3], 'group2') + + if (this.cells.length > 0) { + let cells = [] + this.cells.forEach((item) => { + if (item.shape === 'edge') { + cells.push(graph.createEdge(item)) + } else { + cells.push(graph.createNode(item)) + } + }) + graph.resetCells(cells) + graph.positionContent('center') + } + + this.mkGraph = graph + } + + lanerender = () => { + const { config } = this.state + + const graph = new Graph({ + container: document.getElementById(config.uuid + 'container'), + scaling: { + min: 0.5, + max: 2 + }, + autoResize: true, + panning: true, + background: { color: '#ffffff' }, + mousewheel: { + enabled: true, + zoomAtMousePosition: true, + modifiers: 'ctrl' + }, + connecting: { + router: 'manhattan', + connector: { + name: 'rounded', + args: { + radius: 8 + } + }, + anchor: 'center', + connectionPoint: 'anchor', + 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() + } + } + }) + + graph + .use(new Selection()) + .use(new Snapline()) + .use(new Keyboard()) + .use(new Clipboard()) + .use(new History()) + .use(new Export()) + + const stencil = new Stencil({ + title: '娴佺▼鍥�', + target: graph, + stencilGraphWidth: 180, + stencilGraphHeight: 180, + groups: [ + { + title: '閫氱敤鑺傜偣', + name: 'group1' + }, + { + title: '鑷畾涔�', + name: 'group2', + graphHeight: 150, + layoutOptions: { + rowHeight: 70 + } + }, + { + title: '娉抽亾', + name: 'group3', + graphHeight: 120, + layoutOptions: { + rowHeight: 70 + } + } + ], + layoutOptions: { + columns: 2, + columnWidth: 80, + rowHeight: 55 + } + }) + + document.getElementById(config.uuid + 'stencil').appendChild(stencil.container) + + graph.bindKey(['meta+c', 'ctrl+c'], () => { + const cells = graph.getSelectedCells() + if (cells.length) { + graph.copy(cells) + } + return false + }) + graph.bindKey(['meta+x', 'ctrl+x'], () => { + const cells = graph.getSelectedCells() + if (cells.length) { + graph.cut(cells) + } + return false + }) + graph.bindKey(['meta+v', 'ctrl+v'], () => { + if (!graph.isClipboardEmpty()) { + graph.paste({ offset: { dx: 0, dy: 20 } }) + } + return false + }) + + graph.bindKey(['meta+z', 'ctrl+z'], () => { + if (graph.canUndo()) { + graph.undo() + } + return false + }) + graph.bindKey(['meta+shift+z', 'ctrl+shift+z'], () => { + if (graph.canRedo()) { + graph.redo() + } + return false + }) + + graph.bindKey(['backspace', 'delete'], () => { + const cells = graph.getSelectedCells() + if (cells.length) { + graph.removeCells(cells) + this.selectNode = null + this.setState({node: null}) + } + }) + + const showPorts = (ports, show) => { + for (let i = 0, len = ports.length; i < len; i += 1) { + ports[i].style.visibility = show ? 'visible' : 'hidden' + } + } + graph.on('node:mouseenter', ({ cell }) => { + if (cell.prop('shape') === 'lane') return + + const container = document.getElementById(config.uuid + 'container') + const ports = container.querySelectorAll('.x6-port-body') + showPorts(ports, true) + }) + graph.on('node:mouseleave', () => { + const container = document.getElementById(config.uuid + 'container') + const ports = container.querySelectorAll('.x6-port-body') + showPorts(ports, false) + }) + + graph.on('node:added', ({ cell, index, options }) => { + if (cell.prop('shape') === 'lane') { + graph.startBatch('add-lane') + + this.addLane(cell, graph) + + graph.stopBatch('add-lane') + } else { + let num = graph.getCellCount() + + if (num <= 1) { + message.warning('璇锋坊鍔犳吵閬擄紒') + graph.removeCells([cell]) + } else { + this.addNode(cell, graph) + } + } + }) + graph.on('node:click', ({ e, x, y, node, view }) => { + this.selectNode = node + this.setState({node: node.store.data}) + }) + graph.on('edge:click', ({ e, x, y, edge, view }) => { + this.selectNode = edge + this.setState({node: edge.store.data}) + + graph.clearTransformWidgets() + }) + graph.on('blank:click', ({ e, x, y }) => { + this.selectNode = null + + this.setState({node: null}) + }) + + const r1 = graph.createNode({ + shape: 'mk-rect', + label: '寮�濮�', + attrs: { + body: { + rx: 20, + ry: 26 + } + } + }) + const r2 = graph.createNode({ + shape: 'mk-rect', + label: '杩囩▼' + }) + const r3 = graph.createNode({ + shape: 'mk-rect', + attrs: { + body: { + rx: 6, + ry: 6 + } + }, + label: '鍙�夎繃绋�' + }) + const r4 = graph.createNode({ + shape: 'mk-polygon', + attrs: { + body: { + refPoints: '0,10 10,0 20,10 10,20' + } + }, + label: '鍐崇瓥' + }) + const r5 = graph.createNode({ + shape: 'mk-paral', + attrs: { + body: { + refPoints: '10,0 40,0 30,20 0,20' + } + }, + label: '鏁版嵁' + }) + const r6 = graph.createNode({ + shape: 'mk-circle', + label: '杩炴帴' + }) + + stencil.load([r1, r2, r3, r4, r5, r6], 'group1') + + const p1 = graph.createNode({ + shape: 'mk-ellipse', + label: 'ellipse' + }) + const p2 = graph.createNode({ + shape: 'mk-star', + label: '' + }) + + const p3 = graph.createNode({ + shape: 'mk-text', + label: '鏂囨湰' + }) + + stencil.load([p1, p2, p3], 'group2') + + const g1 = graph.createNode({ + shape: 'lane', + label: '闃舵n' + }) + + stencil.load([g1], 'group3') + + if (this.cells.length > 0) { + let cells = [] + this.cells.forEach((item) => { + if (item.shape === 'edge') { + cells.push(graph.createEdge(item)) + } else { + cells.push(graph.createNode(item)) + } + }) + graph.resetCells(cells) + graph.positionContent('top') + } + + this.mkGraph = graph + } + + setTop = () => { + if (!this.selectNode) { + message.warning('璇烽�夋嫨鑺傜偣锛�') + return + } + this.selectNode.toFront() + } + + setBottom = () => { + if (!this.selectNode) { + message.warning('璇烽�夋嫨鑺傜偣锛�') + return + } + + this.selectNode.toBack() + } + + setback = () => { + if (this.mkGraph.canUndo()) { + this.mkGraph.undo() + } + } + + setprev = () => { + if (this.mkGraph.canRedo()) { + this.mkGraph.redo() + } + } + + setZoomIn = () => { + this.mkGraph.zoom(0.1) + } + + setZoomOut = () => { + this.mkGraph.zoom(-0.1) + } + + setZoomInt = () => { + this.mkGraph.zoomTo(1) + } + + save = () => { + // let nodes = this.mkGraph.toJSON() + // this.mkGraph.toPNG((dataUri) => { + // Api.fileuploadbase64({ + // Base64Img: dataUri + // }).then(res => { + // }) + // }, {padding: 20}) + } + + addLane = (cell, graph) => { + const { config } = this.state + + let nodes = graph.getNodes() + + cell.prop('zIndex', 0) + let basePoint = cell.prop('position/x') + + if (basePoint <= 0 || nodes.length <= 1) { + basePoint = 0 + } else { + let _h = false + let _l = 0 + nodes.forEach(item => { + if (item.id === cell.id) return + if (item.prop('shape') !== 'lane') return + + let x1 = item.prop('position/x') + let x2 = item.prop('position/x') + item.prop('size/width') + if (basePoint > x1 && basePoint <= x2) { + basePoint = x2 + _h = true + } + if (_l < x2) { + _l = x2 + } + }) + + if (!_h && _l) { + basePoint = _l + } + } + + let height = 400 + if (typeof(config.plot.height) === 'number' || /px/.test(config.plot.height)) { + height = parseInt(config.plot.height) + } + + cell.prop('size', {width: 200, height: height}) + cell.prop('position', {x: basePoint, y: 0}) + + this.resetlane(cell.id, basePoint, 200) + } + + addNode = (cell, graph) => { + let nodes = graph.getNodes() + + let cx1 = cell.prop('position/x') + let cx2 = cx1 + cell.prop('size/width') + let cx3 = parseInt((cx1 + cx2) / 2) + + nodes.forEach(item => { + if (item.prop('shape') !== 'lane') return + + let x1 = item.prop('position/x') + let x2 = item.prop('position/x') + item.prop('size/width') + + if (cx3 > x1 && cx3 <= x2) { + cell.prop('parent', item.id) + + if (cx1 < x1) { + cell.prop('position/x', x1) + } else if (cx2 > x2) { + cell.prop('position/x', x2 - cell.prop('size/width')) + } + + let y1 = item.prop('size/height') - cell.prop('size/height') + + if (cell.prop('position/y') < 36) { + cell.prop('position/y', 36) + } else if (cell.prop('position/y') > y1) { + cell.prop('position/y', y1) + } + } + }) + + if (!cell.prop('parent')) { + let flane = null + let llane = null + let lane = null + nodes.forEach(item => { + if (item.prop('shape') !== 'lane') return + if (!flane) { + flane = item + llane = item + } else { + if (item.prop('position/x') < flane.prop('position/x')) { + flane = item + } + if (item.prop('position/x') > llane.prop('position/x')) { + llane = item + } + } + }) + + if (cx1 <= flane.prop('position/x')) { + lane = flane + } else { + lane = llane + } + + let x1 = lane.prop('position/x') + let x2 = lane.prop('position/x') + lane.prop('size/width') + + cell.prop('parent', lane.id) + + if (cx1 < x1) { + cell.prop('position/x', x1) + } else if (cx2 > x2) { + cell.prop('position/x', x2 - cell.prop('size/width')) + } + + let y1 = lane.prop('size/height') - cell.prop('size/height') + + if (cell.prop('position/y') < 36) { + cell.prop('position/y', 36) + } else if (cell.prop('position/y') > y1) { + cell.prop('position/y', y1) + } + } + } + + changeProps = (value, key) => { + const { node } = this.state + + if (node.shape === 'edge') { + if (key === 'title') { + this.selectNode.setLabels(value) + } else if (key === 'stroke') { + this.selectNode.attr('line/stroke', value) + } else if (key === 'strokeWidth') { + this.selectNode.attr('line/strokeWidth', value) + } else if (key === 'lineType') { + if (value === 'dash') { + this.selectNode.attr('line/strokeDasharray', 5) + } else { + this.selectNode.attr('line/strokeDasharray', 0) + } + } + } else if (node.shape === 'lane') { + if (key === 'title') { + this.selectNode.attr('text/text', value) + } else if (key === 'fill') { + this.selectNode.attr('name-rect/fill', value) + } else if (key === 'stroke') { + this.selectNode.attr('body/stroke', value) + } else if (key === 'fontSize') { + this.selectNode.attr('name-text/fontSize', value) + } else if (key === 'fontFill') { + this.selectNode.attr('name-text/fill', value) + } else if (key === 'height') { + this.selectNode.prop('size/height', value) + } else if (key === 'width') { + this.mkGraph.startBatch('width-change') + let offset = value - this.selectNode.prop('size/width') + + this.selectNode.prop('size/width', value) + this.selectNode.attr('name-rect/width', value) + + this.resetlane(this.selectNode.id, this.selectNode.prop('position/x'), offset) + + this.mkGraph.stopBatch('width-change') + } + } else if (node.shape === 'mk-text') { + if (key === 'title') { + this.selectNode.attr('label/text', value) + } else if (key === 'fill') { + this.selectNode.attr('body/fill', value) + } else if (key === 'stroke') { + this.selectNode.attr('body/stroke', value) + } else if (key === 'fontSize') { + this.selectNode.attr('label/style/fontSize', value) + } else if (key === 'fontFill') { + this.selectNode.attr('label/style/color', value) + } + } else { + if (key === 'title') { + this.selectNode.attr('text/text', value) + } else if (key === 'fill') { + this.selectNode.attr('body/fill', value) + } else if (key === 'stroke') { + this.selectNode.attr('body/stroke', value) + } else if (key === 'fontSize') { + this.selectNode.attr('text/fontSize', value) + } else if (key === 'fontFill') { + this.selectNode.attr('text/fill', value) + } else if (key === 'mksign') { + this.selectNode.prop('mksign', value) + } + } + } + + resetlane = (id, x, offset) => { + let nodes = this.mkGraph.getNodes() + + nodes.forEach(item => { + if (item.id === id || item.prop('parent') === id) return + if (item.prop('shape') === 'edge') return + + let x1 = item.prop('position/x') + if (x1 < x) return + + item.prop('position/x', x1 + offset) + }) + } + + render() { + const { loading, config, node, rolelist } = this.state + + let style = {...config.style} + + if (config.plot.function === 'show') { + if (config.plot.empty === 'hidden' && this.cells.length === 0) { + style.display = 'none' + } + + return ( + <div className="custom-x6-plot-box" id={'anchor' + config.uuid} style={config.style}> + {loading ? + <div className="loading-mask"> + <div className="ant-spin-blur"></div> + <Spin /> + </div> : null + } + <NormalHeader config={config} /> + <div className="canvas" 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> + ) + } + + return ( + <div className="custom-x6-plot-box" id={'anchor' + config.uuid} style={config.style}> + {loading ? + <div className="loading-mask"> + <div className="ant-spin-blur"></div> + <Spin /> + </div> : null + } + <NormalHeader config={config} /> + <div className="mk-toolbar"> + <div className="left-tool"> + {config.plot.subtype === 'xflow' ? <Tooltip title="缃墠"> + <VerticalAlignTopOutlined onClick={this.setTop}/> + </Tooltip> : null} + {config.plot.subtype === 'xflow' ? <Tooltip title="缃悗"> + <VerticalAlignBottomOutlined onClick={this.setBottom}/> + </Tooltip> : null} + <Tooltip title="鏀惧ぇ"> + <ZoomInOutlined onClick={this.setZoomIn}/> + </Tooltip> + <Tooltip title="缂╁皬"> + <ZoomOutOutlined onClick={this.setZoomOut}/> + </Tooltip> + <Tooltip title="1:1"> + <OneToOneOutlined onClick={this.setZoomInt}/> + </Tooltip> + <Tooltip title="鍚庨��"> + <UndoOutlined onClick={this.setback}/> + </Tooltip> + <Tooltip title="鍓嶈繘"> + <RedoOutlined onClick={this.setprev}/> + </Tooltip> + <Tooltip overlayStyle={{maxWidth: 260}} title="蹇嵎閿細澶嶅埗锛坈trl+c锛夈�佸壀鍒囷紙ctrl+x锛夈�佺矘璐达紙ctrl+v锛夈�佸悗閫�锛坈trl+z锛夈�佸墠杩涳紙ctrl+shift+z锛夈�佸垹闄わ紙backspace 鎴� delete锛�"> + <QuestionCircleOutlined /> + </Tooltip> + </div> + <div className="right-tool"> + <Tooltip title="淇濆瓨"> + <SaveOutlined onClick={this.save}/> + </Tooltip> + </div> + </div> + <div className="canvas" style={{width: '100%', minHeight: config.plot.height, height: config.plot.height}} id={config.uuid + 'canvas'}> + <div id={config.uuid + 'stencil'} className="mk-stencil"></div> + <div id={config.uuid + 'container'} className="mk-container"></div> + <div className="mk-node-edit"> + <div className="header">璁剧疆</div> + {!node ? <div className="empty">鏈�変腑</div> : <NodeUpdate node={node} rolelist={rolelist} onChange={this.changeProps}/>} + </div> + </div> + </div> + ) + } +} + +export default antvX6Chart \ No newline at end of file diff --git a/src/tabviews/custom/components/chart/antv-X6/index.scss b/src/tabviews/custom/components/chart/antv-X6/index.scss new file mode 100644 index 0000000..7bf3861 --- /dev/null +++ b/src/tabviews/custom/components/chart/antv-X6/index.scss @@ -0,0 +1,207 @@ +.custom-x6-plot-box { + position: relative; + box-sizing: border-box; + background: #ffffff; + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + + .mk-toolbar { + width: 100%; + height: 40px; + border-bottom: 1px solid #dfe3e8; + + .left-tool { + float: left; + line-height: 40px; + .anticon { + margin: 0 10px; + font-size: 16px; + cursor: pointer; + } + } + .right-tool { + float: right; + line-height: 40px; + .anticon { + margin: 0 10px; + font-size: 16px; + cursor: pointer; + } + } + } + .x6-graph-scroller::-webkit-scrollbar { + display: none; + } + .x6-cell.x6-edge.x6-edge-selected path:nth-child(2) { + stroke: #1890ff; + } + .x6-cell[data-shape="lane"] { + cursor: default; + } + .x6-node[data-shape="mk-polygon"]:hover { + .x6-port { + circle { + visibility: visible!important; + } + } + } + + .canvas { + margin: 0px; + letter-spacing: 0px; + display: flex; + + .mk-stencil { + width: 180px; + min-width: 180px; + height: 100%; + position: relative; + z-index: 2; + border-right: 1px solid #dfe3e8; + transition: all 0.2s; + + .x6-widget-stencil-title { + display: none; + } + .x6-widget-stencil-content { + overflow-y: auto; + } + .x6-widget-stencil-content::-webkit-scrollbar { + width: 5px; + } + .x6-widget-stencil-content::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0.07); + } + .x6-widget-stencil-content::-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); + } + + .x6-widget-stencil-group[data-name="group3"] { + .x6-graph-svg { + top: 5px; + left: 5px; + right: 5px; + } + .x6-cell { + transform: none!important; + rect:nth-child(2) { + width: 165px!important; + } + text { + transform: matrix(1,0,0,1,85,18)!important; + } + } + } + } + + .mk-node-edit { + width: 180px; + min-width: 180px; + height: 100%; + position: relative; + z-index: 2; + border-left: 1px solid #dfe3e8; + background: #ffffff; + transition: all 0.2s; + + .header { + width: 100%; + height: 32px; + text-align: center; + line-height: 32px; + background-color: #f5f5f5!important; + overflow-x: hidden; + white-space: nowrap; + } + .empty { + width: 100%; + text-align: center; + padding-top: 20px; + overflow-x: hidden; + white-space: nowrap; + } + } + + .mk-container { + width: calc(100% - 180px); + height: 100%; + } + .x6-widget-stencil { + background-color: #fff; + } + .x6-widget-stencil-title { + background-color: #fff; + } + .x6-widget-stencil-group-title { + background-color: #f5f5f5!important; + } + .x6-widget-transform { + margin: -1px 0 0 -1px; + padding: 0px; + border: 1px solid #239edd; + } + .x6-widget-transform > div { + border: 1px solid #239edd; + } + .x6-widget-transform > div:hover { + background-color: #3dafe4; + } + .x6-widget-transform-active-handle { + background-color: #3dafe4; + } + .x6-widget-transform-resize { + border-radius: 0; + } + .x6-widget-selection-inner { + border: 1px solid #239edd; + } + .x6-widget-selection-box { + opacity: 0; + } + } + + .chart-header { + position: relative; + height: 45px; + border-bottom: 1px solid #e8e8e8; + overflow: hidden; + padding-right: 35px; + + .chart-title { + text-decoration: inherit; + font-weight: inherit; + font-style: inherit; + float: left; + line-height: 45px; + margin-left: 10px; + position: relative; + z-index: 1; + } + } + .loading-mask { + position: absolute; + left: 0px; + top: 0; + right: 0px; + bottom: 0px; + display: flex; + align-items: center; + justify-content: center; + text-align: justify; + z-index: 3; + + .ant-spin-blur { + position: absolute; + width: 100%; + height: 100%; + opacity: 0.5; + background: #ffffff; + } + } +} diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx new file mode 100644 index 0000000..e423161 --- /dev/null +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx @@ -0,0 +1,455 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Form, Row, Col, Input, Select, Radio, InputNumber } from 'antd' + +import ColorSketch from '@/mob/colorsketch' + +import './index.scss' + +class NodeUpdate extends Component { + static propTpyes = { + node: PropTypes.object, + rolelist: PropTypes.array + } + + state = { + formlist: null + } + + UNSAFE_componentWillMount () { + this.setState({ + formlist: this.getFormList(this.props.node) + }) + } + + UNSAFE_componentWillReceiveProps(nextProps) { + if (!is(fromJS(this.props.node), fromJS(nextProps.node))) { + this.setState({ + formlist: null + }, () => { + this.setState({ + formlist: this.getFormList(nextProps.node) + }) + }) + } + } + + getFormList = (node) => { + let roleList = sessionStorage.getItem('sysRoles') + if (roleList) { + try { + roleList = JSON.parse(roleList) + } catch (e) { + roleList = [] + } + } else { + roleList = [] + } + + let title = '' + if (node.attrs && node.attrs.text) { + title = node.attrs.text.text || '' + } + + if (node.shape === 'edge') { + let stroke = '' + + if (node.attrs && node.attrs.line) { + stroke = node.attrs.line.stroke || '#000000' + } + + let strokeWidth = '' + + if (node.attrs && node.attrs.line) { + strokeWidth = node.attrs.line.strokeWidth || 1 + } + + let lineType = 'solid' + + if (node.attrs && node.attrs.line && node.attrs.line.strokeDasharray) { + lineType = 'dash' + } + + return [ + { + type: 'title', + label: '鍐呭' + }, + { + type: 'text', + field: 'title', + label: '鏍囩', + initval: title + }, + { + type: 'title', + label: '鏍峰紡' + }, + { + type: 'color', + field: 'stroke', + label: '棰滆壊', + initval: stroke + }, + { + type: 'number', + field: 'strokeWidth', + label: '绾垮', + initval: strokeWidth + }, + { + type: 'radio', + field: 'lineType', + label: '绾垮瀷', + initval: lineType, + options: [ + {value: 'solid', text: '瀹炵嚎'}, + {value: 'dash', text: '铏氱嚎'} + ] + } + ] + } else if (node.shape === 'lane') { + let fontFill = '#262626' + if (node.attrs && node.attrs.text) { + fontFill = node.attrs.text.fill || '#262626' + } + + let fill = '' + if (node.attrs && node.attrs['name-rect']) { + fill = node.attrs['name-rect'].fill || '' + } + + let width = 100 + if (node.size) { + width = node.size.width || 100 + } + let height = 100 + if (node.size) { + height = node.size.height || 100 + } + + let fontSize = 12 + if (node.attrs && node.attrs.text) { + fontSize = node.attrs.text.fontSize || 12 + } + + let stroke = '' + if (node.attrs && node.attrs.body) { + stroke = node.attrs.body.stroke || '' + } + return [ + { + type: 'title', + label: '鏍囬' + }, + { + type: 'text', + field: 'title', + label: '鏍囩', + initval: title + }, + { + type: 'title', + label: '鏍峰紡' + }, + { + type: 'color', + field: 'stroke', + label: '杈规', + initval: stroke + }, + { + type: 'number', + field: 'width', + label: '瀹藉害', + help: '瀹藉害涓嶅彲灏忎簬100', + initval: width + }, + { + type: 'number', + field: 'height', + label: '楂樺害', + help: '楂樺害涓嶅彲灏忎簬100', + initval: height + }, + { + type: 'title', + label: '鏍囬鏍峰紡' + }, + { + type: 'color', + field: 'fill', + label: '鑳屾櫙', + initval: fill + }, + { + type: 'number', + field: 'fontSize', + label: '瀛楀彿', + initval: fontSize + }, + { + type: 'color', + field: 'fontFill', + label: '棰滆壊', + initval: fontFill + } + ] + } else if (node.shape === 'mk-text') { + if (node.attrs && node.attrs.label) { + title = node.attrs.label.text || '' + } + + let fill = '' + + if (node.attrs && node.attrs.body) { + fill = node.attrs.body.fill || '' + } + + let stroke = '' + + if (node.attrs && node.attrs.body) { + stroke = node.attrs.body.stroke || '' + } + + let fontFill = '#262626' + if (node.attrs && node.attrs.label) { + fontFill = node.attrs.label.style.color || '#262626' + } + + let fontSize = 14 + if (node.attrs && node.attrs.label) { + fontSize = node.attrs.label.style.fontSize || 14 + } + return [ + { + type: 'title', + label: '鍐呭' + }, + { + type: 'text', + field: 'title', + label: '鏍囩', + initval: title + }, + { + type: 'title', + label: '鏍峰紡' + }, + { + type: 'color', + field: 'fill', + label: '鑳屾櫙', + initval: fill + }, + { + type: 'color', + field: 'stroke', + label: '杈规', + initval: stroke + }, + { + type: 'title', + label: '鏂囨湰鏍峰紡' + }, + { + type: 'number', + field: 'fontSize', + label: '瀛楀彿', + initval: fontSize + }, + { + type: 'color', + field: 'fontFill', + label: '棰滆壊', + initval: fontFill + } + ] + } else { + let fontFill = '#262626' + if (node.attrs && node.attrs.text) { + fontFill = node.attrs.text.fill || '#262626' + } + + let fill = '' + + if (node.attrs && node.attrs.body) { + fill = node.attrs.body.fill || '' + } + let fontSize = 12 + if (node.attrs && node.attrs.text) { + fontSize = node.attrs.text.fontSize || 12 + } + let stroke = '' + + if (node.attrs && node.attrs.body) { + stroke = node.attrs.body.stroke || '' + } + return [ + { + type: 'title', + label: '鍐呭' + }, + { + type: 'text', + field: 'title', + label: '鏍囩', + initval: title + }, + { + type: 'title', + label: '鏍峰紡' + }, + { + type: 'color', + field: 'fill', + label: '鑳屾櫙', + initval: fill + }, + { + type: 'color', + field: 'stroke', + label: '杈规', + initval: stroke + }, + { + type: 'title', + label: '鏍囩鏍峰紡' + }, + { + type: 'number', + field: 'fontSize', + label: '瀛楀彿', + initval: fontSize + }, + { + type: 'color', + field: 'fontFill', + label: '棰滆壊', + initval: fontFill + }, + { + type: 'title', + label: '鑷畾涔変俊鎭�' + }, + { + type: 'text', + field: 'mksign', + label: '鏍囪', + initval: node.mksign || '' + }, + { + type: 'select', + field: 'mkroleid', + label: '瑙掕壊', + initval: node.mkroleid || '', + options: this.props.rolelist.map(item => ({value: item.RoleID, text: item.RoleName})) + }, + ] + } + } + + change = (value, key) => { + if (key === 'fontSize') { + if (typeof(value) !== 'number' || value < 0) { + return + } + } else if (key === 'width' || key === 'height') { + if (typeof(value) !== 'number') { + return + } else if (value < 100) { + return + } + } + + this.props.onChange(value, key) + } + + getFields() { + const { formlist } = this.state + const fields = [] + + if (!formlist) return + + formlist.forEach((item, index) => { + if (item.type === 'title') { + fields.push( + <Col span={24} key={index}> + <span className="split-line">{item.label}</span> + </Col> + ) + } else if (item.type === 'text') { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label}> + <Input defaultValue={item.initval} placeholder="" autoComplete="off" onChange={(e) => this.change(e.target.value, item.field)} /> + </Form.Item> + </Col> + ) + } else if (item.type === 'number') { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label} help={item.help || null}> + <InputNumber defaultValue={item.initval} precision={0} min={0} onChange={(value) => this.change(value, item.field)} /> + </Form.Item> + </Col> + ) + } else if (item.type === 'select') { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label}> + <Select + showSearch + defaultValue={item.initval} + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + onChange={(value) => {this.change(value, item.field)}} + > + {item.options.map(option => + <Select.Option key={option.value} value={option.value}> + {option.text} + </Select.Option> + )} + </Select> + </Form.Item> + </Col> + ) + } else if (item.type === 'radio') { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label}> + <Radio.Group defaultValue={item.initval} style={{whiteSpace: 'nowrap'}} onChange={(e) => {this.change(e.target.value, item.field)}}> + {item.options.map(option => { + return ( + <Radio key={option.value} value={option.value}>{option.text}</Radio> + ) + })} + </Radio.Group> + </Form.Item> + </Col> + ) + } else if (item.type === 'color') { + fields.push( + <Col span={24} key={index}> + <Form.Item label={item.label}> + <ColorSketch defaultValue={item.initval} onChange={(value) => this.change(value, item.field)}/> + </Form.Item> + </Col> + ) + } + }) + return fields + } + + render() { + return ( + <div className="node-edit-form-wrap"> + <Form className="node-edit-form"> + <Row>{this.getFields()}</Row> + </Form> + </div> + ) + } +} + +export default NodeUpdate \ No newline at end of file diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss new file mode 100644 index 0000000..096d405 --- /dev/null +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss @@ -0,0 +1,99 @@ +.node-edit-form { + padding-top: 10px; + overflow: hidden; + .split-line { + display: block; + border-bottom: 1px solid #d9d9d9; + margin: 5px 12px 10px; + padding-bottom: 2px; + font-size: 13px; + } + .ant-form-item { + display: flex; + margin-bottom: 10px; + + .ant-form-item-label { + width: 40px; + line-height: 24px; + label { + color: rgba(0,0,0,0.45); + font-size: 13px; + } + label::after { + display: none; + } + } + .ant-form-item-control-wrapper { + padding: 0 8px; + flex: 1; + .ant-form-item-control { + line-height: 24px; + } + .ant-form-explain { + font-size: 12px; + min-height: 18px; + color: #c8c8c8; + margin-top: 1px; + } + .ant-input { + height: 24px; + padding: 0px 4px; + font-size: 13px; + line-height: 24px; + border-radius: 0px; + } + .ant-input-number { + height: 24px; + border-radius: 0px; + .ant-input-number-input { + height: 22px; + padding: 2px 4px; + font-size: 13px; + } + } + .ant-radio-wrapper { + margin-right: 0px; + } + + .color-sketch-block { + height: 20px; + margin-top: 2px; + .color-sketch-block-box { + width: 20px; + height: 20px; + } + .color-sketch-value { + display: none; + } + .color-sketch-block-inner { + border-radius: 0px; + } + } + .ant-select-selection--single { + height: 26px; + border-radius: 0px; + } + .ant-select-selection__rendered { + line-height: 24px; + } + } + } +} +.node-edit-form-wrap { + height: calc(100% - 32px); + overflow-y: auto; +} +.node-edit-form-wrap::-webkit-scrollbar { + width: 5px; +} +.node-edit-form-wrap::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0.07); +} +.node-edit-form-wrap::-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); +} \ No newline at end of file diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index c76b83c..68651c3 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -17,7 +17,6 @@ import NormalHeader from '@/tabviews/custom/components/share/normalheader' import './index.scss' -// const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) const ExcelOutButton = asyncComponent(() => import('@/tabviews/zshare/actionList/exceloutbutton')) const ExcelInButton = asyncComponent(() => import('@/tabviews/zshare/actionList/excelInbutton')) @@ -555,17 +554,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index 5a584b0..3d69559 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -306,17 +306,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 46e5ccf..fcb3b7a 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -266,17 +266,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index abc0f0c..405cdc5 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -297,17 +297,31 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/chart/custom-chart/index.jsx b/src/tabviews/custom/components/chart/custom-chart/index.jsx index f2b717e..6d9ee7b 100644 --- a/src/tabviews/custom/components/chart/custom-chart/index.jsx +++ b/src/tabviews/custom/components/chart/custom-chart/index.jsx @@ -4,7 +4,7 @@ import { Chart } from '@antv/g2' import DataSet from '@antv/data-set' import * as echarts from 'echarts' -import { Spin, Empty, notification } from 'antd' +import { Spin, Empty, notification, Modal } from 'antd' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -287,16 +287,37 @@ this.timer && this.timer.stop() } } + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx index dc1a995..6bdaf07 100644 --- a/src/tabviews/custom/components/code/sand-box/index.jsx +++ b/src/tabviews/custom/components/code/sand-box/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification } from 'antd' +import { Spin, notification, Modal } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -208,15 +208,37 @@ result: _result, loading: false }) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx index a4084ac..891bfa6 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.jsx +++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Spin, notification } from 'antd' +import { Spin, notification, Modal } from 'antd' import asyncComponent from '@/utils/asyncComponent' import Api from '@/api' @@ -204,15 +204,37 @@ data: _data, loading: false }) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } } diff --git a/src/tabviews/custom/components/form/simple-form/index.jsx b/src/tabviews/custom/components/form/simple-form/index.jsx index 96156c2..9aa9dcb 100644 --- a/src/tabviews/custom/components/form/simple-form/index.jsx +++ b/src/tabviews/custom/components/form/simple-form/index.jsx @@ -255,16 +255,31 @@ }, () => { this.setState({data: _data}) }) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false, }) + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/form/step-form/index.jsx b/src/tabviews/custom/components/form/step-form/index.jsx index 561a5b7..50d09cc 100644 --- a/src/tabviews/custom/components/form/step-form/index.jsx +++ b/src/tabviews/custom/components/form/step-form/index.jsx @@ -333,16 +333,31 @@ }, () => { this.setState({group: _group}) }) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false, }) + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/form/tab-form/index.jsx b/src/tabviews/custom/components/form/tab-form/index.jsx index 0538eed..4909bf9 100644 --- a/src/tabviews/custom/components/form/tab-form/index.jsx +++ b/src/tabviews/custom/components/form/tab-form/index.jsx @@ -271,16 +271,31 @@ }, () => { this.setState({data: _data}) }) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false, }) + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/group/normal-group/index.jsx b/src/tabviews/custom/components/group/normal-group/index.jsx index 6cbc3cb..407241a 100644 --- a/src/tabviews/custom/components/group/normal-group/index.jsx +++ b/src/tabviews/custom/components/group/normal-group/index.jsx @@ -35,6 +35,7 @@ const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline')) const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) class TabTransfer extends Component { static propTpyes = { @@ -290,6 +291,12 @@ <AntvG6 config={item} data={data} mainSearch={mainSearch}/> </Col> ) + } else if (item.type === 'antvX6') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <AntvX6 config={item}/> + </Col> + ) } else { return null } diff --git a/src/tabviews/custom/components/iframe/index.jsx b/src/tabviews/custom/components/iframe/index.jsx index 62981a9..bdd506d 100644 --- a/src/tabviews/custom/components/iframe/index.jsx +++ b/src/tabviews/custom/components/iframe/index.jsx @@ -65,6 +65,10 @@ } } + if (_config.wrap.height === '100vh') { + _config.wrap.height = 'calc(100vh - 92px)' + } + this.setState({ linkUrl: linkUrl, sync: _sync, @@ -194,12 +198,27 @@ linkUrl: _data[config.wrap.linkField] || '', data: _data }) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, @@ -257,7 +276,7 @@ </div> : null} <div className="iframe-wrap" style={{height: config.wrap.height}}> {loading ? <div className="mask"><Spin size="large" /></div> : null} - {linkUrl ? <iframe title="mk" className="iframe" src={linkUrl} frameBorder="0"></iframe> : <Empty description={false}/>} + {linkUrl ? <iframe title="mk" className="iframe" src={linkUrl.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))} frameBorder="0"></iframe> : <Empty description={false}/>} </div> </div> ) diff --git a/src/tabviews/custom/components/interfaces/interItem/index.jsx b/src/tabviews/custom/components/interfaces/interItem/index.jsx index 3ba9519..7e8c885 100644 --- a/src/tabviews/custom/components/interfaces/interItem/index.jsx +++ b/src/tabviews/custom/components/interfaces/interItem/index.jsx @@ -132,15 +132,30 @@ if (config.setting.loadlevel === 'init') { MKEmitter.emit('interFinish', config.MenuID, config.uuid) } + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.loading = false this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index 79c6827..f2be4a6 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -39,6 +39,7 @@ const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart')) const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table')) const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) class TabTransfer extends Component { static propTpyes = { @@ -345,6 +346,12 @@ <AntvG6 config={item} data={data} mainSearch={mainSearch}/> </Col> ) + } else if (item.type === 'antvX6') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <AntvX6 config={item}/> + </Col> + ) } else { return null } diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 9658a04..d5d7bf5 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -219,6 +219,20 @@ MKEmitter.emit('autoMaticOver', config.MenuID) } } + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false @@ -228,11 +242,12 @@ MKEmitter.emit('autoMaticError', config.MenuID) } + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index f0cfdb3..ea9d56a 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -262,16 +262,31 @@ }) MKEmitter.emit('transferData', config.uuid, data) + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx index dc99a3a..3d87ac8 100644 --- a/src/tabviews/custom/components/table/normal-table/index.jsx +++ b/src/tabviews/custom/components/table/normal-table/index.jsx @@ -294,17 +294,32 @@ this.timer && this.timer.stop() } } + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx index 5126d9e..d629c77 100644 --- a/src/tabviews/custom/components/timeline/normal-timeline/index.jsx +++ b/src/tabviews/custom/components/timeline/normal-timeline/index.jsx @@ -358,17 +358,32 @@ this.timer && this.timer.stop() } } + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/components/tree/antd-tree/index.jsx b/src/tabviews/custom/components/tree/antd-tree/index.jsx index 2d63a92..4bde860 100644 --- a/src/tabviews/custom/components/tree/antd-tree/index.jsx +++ b/src/tabviews/custom/components/tree/antd-tree/index.jsx @@ -277,17 +277,32 @@ this.timer && this.timer.stop() } } + + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } } else { this.setState({ loading: false }) this.timer && this.timer.stop() + if (!result.message) return if (result.ErrCode === 'N') { Modal.error({ title: result.message, }) - } else { + } else if (result.ErrCode !== '-2') { notification.error({ top: 92, message: result.message, diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 3c6b9b3..c34c160 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin, Row, Col } from 'antd' +import { notification, Spin, Row, Col, Modal } from 'antd' import Api from '@/api' import zhCN from '@/locales/zh-CN/main.js' @@ -40,6 +40,7 @@ const CustomChart = asyncComponent(() => import('./components/chart/custom-chart')) const TimeLine = asyncComponent(() => import('./components/timeline/normal-timeline')) const AntvG6 = asyncComponent(() => import('./components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('./components/chart/antv-X6')) const Voucher = asyncComponent(() => import('./components/module/voucher')) const Account = asyncComponent(() => import('./components/module/account')) const Iframe = asyncComponent(() => import('./components/iframe')) @@ -52,7 +53,6 @@ param: PropTypes.any, // 鍏朵粬椤甸潰浼犻�掔殑鍙傛暟 Tab: PropTypes.string, // 寮圭獥鏍囩 MenuID: PropTypes.string, // 鑿滃崟Id - MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 MenuName: PropTypes.string, // 鑿滃崟鍚嶇О changeTemp: PropTypes.func } @@ -80,7 +80,7 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { MenuID } = this.props + const { MenuID, MenuName } = this.props let _param = { func: 'sPC_Get_LongParam', @@ -97,6 +97,7 @@ config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) config = JSON.parse(config) config.MenuID = MenuID + config.MenuName = MenuName || config.MenuName } catch (e) { console.warn('Parse Failure') config = '' @@ -207,7 +208,7 @@ let initInters = [] config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters) - config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache) + config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache, config.MenuName) // 鑾峰彇涓绘悳绱㈡潯浠� let mainSearch = [] @@ -336,7 +337,7 @@ } } - filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) => { + filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) => { return components.filter(item => { item.$pageId = pageId item.$cache = cache @@ -348,7 +349,7 @@ delete item.style.shadowColor } - item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '') + item.$menuname = (MenuName || '') + '-' + (item.name || '') if (item.type === 'tabs') { if ( @@ -423,7 +424,7 @@ item.subtabs = item.subtabs.map(tab => { tab.$pageId = pageId - tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) + tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) return tab }) @@ -436,10 +437,10 @@ return false } - item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) + item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) return true - } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { + } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) { if ( item.plot.blacklist && item.plot.blacklist.length > 0 && item.plot.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0 @@ -1087,6 +1088,20 @@ Api.genericInterface(param).then(result => { if (result.status) { + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } + delete result.status delete result.message delete result.ErrMesg @@ -1111,11 +1126,19 @@ data: '', loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } }) } @@ -1408,6 +1431,12 @@ <AntvG6 config={item} data={data} mainSearch={mainSearch}/> </Col> ) + } else if (item.type === 'antvX6') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <AntvX6 config={item}/> + </Col> + ) } else if (item.type === 'module' && item.subtype === 'voucher') { return ( <Col span={item.width} style={style} key={item.uuid}> diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 0093459..67bdd49 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { notification, Spin, Row, Col } from 'antd' +import { notification, Spin, Row, Col, Modal } from 'antd' import Api from '@/api' import zhCN from '@/locales/zh-CN/main.js' @@ -41,6 +41,7 @@ const Voucher = asyncComponent(() => import('../components/module/voucher')) const Iframe = asyncComponent(() => import('../components/iframe')) const AntvG6 = asyncComponent(() => import('../components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('../components/chart/antv-X6')) class CustomPage extends Component { static propTpyes = { @@ -797,6 +798,20 @@ Api.genericInterface(param).then(result => { if (result.status) { + if (result.message) { + if (result.ErrCode === 'Y') { + Modal.success({ + title: result.message + }) + } else if (result.ErrCode === 'S') { + notification.success({ + top: 92, + message: result.message, + duration: 2 + }) + } + } + delete result.status delete result.message delete result.ErrMesg @@ -821,11 +836,19 @@ data: '', loading: false }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) + + if (!result.message) return + if (result.ErrCode === 'N') { + Modal.error({ + title: result.message, + }) + } else if (result.ErrCode !== '-2') { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + } } }) } @@ -1053,6 +1076,12 @@ <AntvG6 config={item} data={data} mainSearch={mainSearch}/> </Col> ) + } else if (item.type === 'antvX6') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <AntvX6 config={item}/> + </Col> + ) } else { return null } diff --git a/src/tabviews/iframe/index.jsx b/src/tabviews/iframe/index.jsx index c1186d4..eae4d43 100644 --- a/src/tabviews/iframe/index.jsx +++ b/src/tabviews/iframe/index.jsx @@ -6,7 +6,6 @@ static propTypes = { title: PropTypes.string, MenuID: PropTypes.string, // 鑿滃崟Id - MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 url: PropTypes.string } diff --git a/src/tabviews/rolemanage/index.jsx b/src/tabviews/rolemanage/index.jsx index cbcbbf7..d90d131 100644 --- a/src/tabviews/rolemanage/index.jsx +++ b/src/tabviews/rolemanage/index.jsx @@ -20,7 +20,6 @@ export default class RoleManage extends Component { static propTpyes = { - MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 MenuID: PropTypes.string // 鑿滃崟Id } diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index cb9aefe..8cf8ac8 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -852,7 +852,7 @@ return ( <div className="subtable" id={'subtable' + this.props.MenuID}> {loadingview && <Spin />} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <SubSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null } {config && config.charts ? <Row className="chart-view" gutter={16}> diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 3388d62..24b4808 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -702,7 +702,7 @@ return ( <div className="subtabtable" id={'subtabtable' + this.props.MenuID}> {loadingview && <Spin />} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <SubSearch BID={this.props.BID} config={config} refreshdata={this.refreshbysearch}/> : null } {config ? <div style={{minHeight: '25px'}}> diff --git a/src/tabviews/zshare/actionList/index.jsx b/src/tabviews/zshare/actionList/index.jsx index 8723fa0..4852e23 100644 --- a/src/tabviews/zshare/actionList/index.jsx +++ b/src/tabviews/zshare/actionList/index.jsx @@ -129,6 +129,7 @@ key={item.uuid} show={item.show || 'actionList'} disabled={false} + BID={BID} btn={item} BData={BData} selectedData={selectedData} diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx index 94b50d8..c8f8539 100644 --- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx +++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx @@ -13,6 +13,7 @@ class NewPageButton extends Component { static propTpyes = { + BID: PropTypes.any, // BID BData: PropTypes.any, // 涓昏〃鏁版嵁 btn: PropTypes.object, // 鎸夐挳 selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 @@ -102,7 +103,7 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (triggerId, record, type) => { - const { btn, selectedData } = this.props + const { btn, selectedData, BID } = this.props const { disabled } = this.state if (disabled) return @@ -193,18 +194,43 @@ window.open(url) } else if (btn.pageTemplate === 'custom') { let url = btn.url + if (window.GLOB.systemType === 'production' && btn.proUrl) { + url = btn.proUrl + } + + if (btn.Ot === 'notRequired' && BID) { + Id = BID + } + + if (/#\/iframe\//.test(url)) { + url = url.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) + + if (btn.joint === 'true' && Id) { + url = url + '/' + Id + } + + let menu = { + MenuID: btn.uuid, + MenuName: btn.label, + type: 'iframe', + OpenType: 'newtab', + src: url + } + MKEmitter.emit('modifyTabs', menu) + + return + } + let con = '?' if (/\?/ig.test(url)) { con = '&' } - - if (btn.Ot === 'requiredSgl' && btn.joint !== 'false') { + + if (btn.joint === 'true') { url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` - } else if (btn.Ot === 'requiredSgl' && btn.joint === 'false') { + } else if (Id) { url = url + `${con}id=${Id}` - } else if (btn.joint !== 'false') { - url = url + `${con}appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` } window.open(url) diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index 9a7662a..7a7fee1 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -177,9 +177,14 @@ } } - MKEmitter.emit('modifyTabs', newtab, true) + if (btn.openTab === 'view') { + window.open('#/view/' + newtab.MenuID + '/' + primaryId) + } else { + MKEmitter.emit('modifyTabs', newtab, true) + + MKEmitter.emit('openNewTab') + } - MKEmitter.emit('openNewTab') if (window.GLOB.systemType === 'production') { MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '鏍囩椤�'}) } diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx index 9d9cb2c..a7dc070 100644 --- a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx +++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Col, Row } from 'antd' +import { Col, Row, Switch } from 'antd' import { CheckOutlined } from '@ant-design/icons' import MKEmitter from '@/utils/events.js' @@ -281,6 +281,29 @@ } } + onChange = (val) => { + if (val) { + let keys = [] + this.state.options.forEach(item => { + if (item.$disabled) return + + keys.push(item.$value) + }) + + this.setState({ + selectKeys: keys + }, () => { + this.props.onChange(keys.join(',')) + }) + } else { + this.setState({ + selectKeys: [] + }, () => { + this.props.onChange('') + }) + } + } + render() { const { config, options } = this.state @@ -295,6 +318,7 @@ return ( <div className={'check-card-form-box ' + extend}> + {config.checkAll === 'show' && options.length > 3 ? <Switch size="small" onChange={this.onChange}/> : null} <Row gutter={12}>{this.getCards()}</Row> </div> ) diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.scss b/src/tabviews/zshare/mutilform/mkCheckCard/index.scss index b97b1d8..7bb1021 100644 --- a/src/tabviews/zshare/mutilform/mkCheckCard/index.scss +++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.scss @@ -1,5 +1,6 @@ .check-card-form-box { margin-top: 5px; + position: relative; .card-cell { position: relative; border: 1px solid #bcbcbc; @@ -135,6 +136,13 @@ } } + .ant-switch { + position: absolute; + top: -22px; + right: 0px; + opacity: 0.7; + } + .card-cell.disabled { cursor: not-allowed; } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 2f6d9ab..ea0c51a 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -710,7 +710,7 @@ } if (item.joint === 'true' && _href) { - let _quary = `id=${record[this.props.setting.primaryKey]}&userid=${sessionStorage.getItem('UserID')}&appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}` + let _quary = `id=${record[this.props.setting.primaryKey]}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID')}` let _param = '' try { @@ -783,6 +783,7 @@ <NewPageButton key={btn.uuid} btn={btn} + BID={record.$$BID} disabled={record.$disabled} selectedData={[record]} BData={this.props.BData} @@ -912,7 +913,7 @@ } if (col.joint === 'true' && _href) { - let _quary = `id=${record[this.props.setting.primaryKey]}&userid=${sessionStorage.getItem('UserID')}&appkey=${window.GLOB.appkey}&LoginUID=${sessionStorage.getItem('LoginUID')}` + let _quary = `id=${record[this.props.setting.primaryKey]}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID')}` let _param = '' try { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 0984554..2dea436 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3476,6 +3476,22 @@ }, { type: 'radio', + key: 'checkAll', + label: '鍏ㄩ��', + initVal: card.checkAll || 'hide', + tooltip: '鍙閫夌殑閫夐」鍗℃槸鍚︽樉绀哄叏閫夊紑鍏筹紝娉細褰撻�夐」澶т簬3涓椂鏈夋晥銆�', + required: false, + forbid: appType !== '', + options: [{ + value: 'hide', + text: '闅愯棌' + }, { + value: 'show', + text: '鏄剧ず' + }] + }, + { + type: 'radio', key: 'selectStyle', label: '閫変腑鏁堟灉', tooltip: '鑳屾櫙鍙婃枃瀛楀彉鍖栨椂浼氫娇鐢ㄧ郴缁熻壊銆�', @@ -4135,8 +4151,7 @@ key: 'icon', label: '鍥炬爣', initVal: card.icon || '', - required: false, - forbid: type === 'CalendarPage' + required: false }, { type: 'select', @@ -4144,8 +4159,7 @@ label: '涓婄骇鏍囩', initVal: supMenu, required: false, - options: menus, - forbid: type === 'CalendarPage' + options: menus }, { type: 'mutilselect', @@ -4154,8 +4168,7 @@ tooltip: '濡傛灉瀛愭爣绛句腑鍚湁鍒锋柊鍚岀骇鏍囩鐨勬寜閽紝鍦ㄦ澶勬坊鍔犻渶瑕佸埛鏂扮殑鏍囩銆�', initVal: equalTab, required: false, - options: equalTabs, - forbid: type === 'CalendarPage' + options: equalTabs }, { type: 'text', @@ -4163,8 +4176,7 @@ label: '澶栭敭', tooltip: '澶栭敭鏃ㄥ湪鏍囩椤典腑鎵ц榛樿鍑芥暟锛堟坊鍔狅級鏃讹紝鏇挎崲BID瀛楁', initVal: card.foreignKey || '', - required: false, - forbid: type === 'CalendarPage' + required: false }, { type: 'number', @@ -4184,7 +4196,7 @@ initVal: card.searchPass || 'false', tooltip: '浣跨敤涓昏〃鎼滅储鏉′欢鏃讹紝涓昏〃鐨勬悳绱㈡潯浠朵細浼犲叆瀛愯〃涓��', required: false, - forbid: type !== 'CommonTable' && type !== 'CalendarPage', + forbid: type !== 'CommonTable', options: [{ value: 'true', text: '浣跨敤' diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 27260e3..ac5c8a7 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -221,7 +221,7 @@ shows.push('decimal') } } else { - shows.push('fieldlength') + shows.push('fieldlength', 'checkAll') reTooltip.initval = '娣诲姞澶氫釜鍒濆鍊艰浣跨敤閫楀彿鍒嗛殧銆�' } diff --git a/src/utils/option.js b/src/utils/option.js index e771dfe..4fe5606 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -1,7 +1,6 @@ import nortable from '@/assets/img/normaltable.jpg' // import mainsubtable from '@/assets/img/mainsubtable.jpg' import treepage from '@/assets/img/treepage.jpg' -import calendar from '@/assets/img/calendar.jpg' import customImg from '@/assets/img/custom.jpg' import newpage from '@/assets/img/newpage.jpg' import rolemanage from '@/assets/img/rolemanage.jpg' @@ -78,13 +77,6 @@ title: '鏍戝舰椤甸潰', type: 'TreePage', url: treepage, - baseconfig: '', - isSystem: true - }, - { - title: '鏃ュ巻', - type: 'CalendarPage', - url: calendar, baseconfig: '', isSystem: true }, diff --git a/src/views/basedesign/index.jsx b/src/views/basedesign/index.jsx index cfb79a4..b89d9cc 100644 --- a/src/views/basedesign/index.jsx +++ b/src/views/basedesign/index.jsx @@ -14,7 +14,6 @@ const Header = asyncComponent(() => import('@/menu/header')) const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig')) -const CalendarPageConfig = asyncLoadComponent(() => import('@/templates/calendarconfig')) const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) @@ -181,13 +180,6 @@ <Header/> {this.state.tabview === 'TreePage' ? <TreePageConfig - menu={this.state.editMenu} - reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} - handleView={this.handleView} - /> : null - } - {this.state.tabview === 'CalendarPage' ? - <CalendarPageConfig menu={this.state.editMenu} reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} handleView={this.handleView} diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index de28f47..a7be0ab 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -29,6 +29,7 @@ const BraftEditor = asyncComponent(() => import('@/tabviews/custom/components/editor/braft-editor')) const Balcony = asyncComponent(() => import('@/tabviews/custom/components/card/balcony')) const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6')) +const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) class BillPrint extends Component { @@ -961,6 +962,12 @@ <AntvG6 config={item} initdata={item.data} mainSearch={[]}/> </Col> ) + } else if (item.type === 'antvX6') { + return ( + <Col span={item.width} style={style} key={item.uuid}> + <AntvX6 config={item}/> + </Col> + ) } else { return null } diff --git a/src/views/design/sidemenu/editthdmenu/index.jsx b/src/views/design/sidemenu/editthdmenu/index.jsx index 7b575a2..2a4c64b 100644 --- a/src/views/design/sidemenu/editthdmenu/index.jsx +++ b/src/views/design/sidemenu/editthdmenu/index.jsx @@ -109,7 +109,7 @@ handleMVisible: true, sysMenu: _menu }) - } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(_menu.PageParam.Template)) { + } else if (['CommonTable', 'TreePage'].includes(_menu.PageParam.Template)) { sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) let _param = window.btoa(window.encodeURIComponent(JSON.stringify(_menu))) diff --git a/src/views/design/sidemenu/index.jsx b/src/views/design/sidemenu/index.jsx index 8729535..597ee0f 100644 --- a/src/views/design/sidemenu/index.jsx +++ b/src/views/design/sidemenu/index.jsx @@ -121,7 +121,7 @@ } _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) window.open(`#/menudesign/${_param}`) - } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(cell.type)) { + } else if (['CommonTable', 'TreePage'].includes(cell.type)) { sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) let _param = window.btoa(window.encodeURIComponent(JSON.stringify(cell))) diff --git a/src/views/design/sidemenu/thdmenuform/index.jsx b/src/views/design/sidemenu/thdmenuform/index.jsx index e393aa9..cb8f0da 100644 --- a/src/views/design/sidemenu/thdmenuform/index.jsx +++ b/src/views/design/sidemenu/thdmenuform/index.jsx @@ -1,7 +1,8 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Row, Col, Input, Select } from 'antd' +import { Form, Row, Col, Input, Select, Tooltip } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' // import './index.scss' const { TextArea } = Input @@ -74,7 +75,7 @@ <Form {...formItemLayout} style={{paddingRight: '20px'}}> <Row gutter={24}> <Col span={22}> - <Form.Item label={'涓�绾ц彍鍗�'}> + <Form.Item label="涓�绾ц彍鍗�"> {getFieldDecorator('fstMenuId', { initialValue: menu.fstMenuId, rules: [ @@ -97,7 +98,7 @@ </Form.Item> </Col> <Col span={22}> - <Form.Item label={'浜岀骇鑿滃崟'}> + <Form.Item label="浜岀骇鑿滃崟"> {getFieldDecorator('ParentID', { initialValue: menu.ParentId, rules: [ @@ -119,7 +120,7 @@ </Form.Item> </Col> <Col span={22}> - <Form.Item label={'鑿滃崟鍚嶇О'}> + <Form.Item label="鑿滃崟鍚嶇О"> {getFieldDecorator('MenuName', { initialValue: menu.MenuName || '', rules: [ @@ -132,7 +133,7 @@ </Form.Item> </Col> <Col span={22}> - <Form.Item label={'鑿滃崟鍙傛暟'}> + <Form.Item label="鑿滃崟鍙傛暟"> {getFieldDecorator('MenuNo', { initialValue: menu.MenuNo || '', rules: [ @@ -145,7 +146,9 @@ </Form.Item> </Col> {menu.Template === 'NewPage' ? <Col span={22}> - <Form.Item label={'閾炬帴鍦板潃'}> + <Form.Item label={ + <Tooltip overlayStyle={{minWidth: 500}} placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>浣跨敤鍚屼竴鍗曠偣绯荤粺涓嬬殑鍏朵粬涓氬姟绯荤粺锛岄摼鎺ユ牸寮忎负锛歨ttp://<span style={{color: 'orange'}}>******</span>/admin/index.html#/iframe/<span style={{color: 'orange'}}>menuId</span>/<span style={{color: 'orange'}}>loginuid</span>/<span style={{color: 'orange'}}>BID</span>銆傛敞锛�******涓哄煙鍚�+铏氭嫙鐩綍锛沵enuId涓鸿彍鍗旾D锛沴oginuid涓虹櫥褰曚俊鎭紙浣跨敤@loginuid@鏃惰嚜鍔ㄦ浛鎹负褰撳墠绯荤粺鐨刲oginuid锛夛紱BID鏄悜鑿滃崟涓殑浼犲弬锛屽彲涓虹┖銆�</div>}><QuestionCircleOutlined className="mk-form-tip" />閾炬帴鍦板潃</Tooltip> + }> {getFieldDecorator('url', { initialValue: menu.url || '', rules: [ diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index 55fba9b..9cce0f9 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -149,7 +149,13 @@ } } - this.props.history.replace('/main') + let iframe = sessionStorage.getItem('iframe') + if (iframe) { + sessionStorage.removeItem('iframe') + this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID)) + } else { + this.props.history.replace('/main') + } } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') { message.warning('搴旂敤灏氭湭鍒涘缓锛岃鍚戜簯绔悓姝ュ簲鐢紒') @@ -203,7 +209,13 @@ sessionStorage.removeItem('visitorUserID') sessionStorage.removeItem('visitorLoginUID') - this.props.history.replace('/main') + let iframe = sessionStorage.getItem('iframe') + if (iframe) { + sessionStorage.removeItem('iframe') + this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID)) + } else { + this.props.history.replace('/main') + } } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') { message.warning('搴旂敤灏氭湭鍒涘缓锛岃鍚戜簯绔悓姝ュ簲鐢紒') @@ -242,7 +254,13 @@ sessionStorage.removeItem('visitorUserID') sessionStorage.removeItem('visitorLoginUID') - this.props.history.replace('/main') + let iframe = sessionStorage.getItem('iframe') + if (iframe) { + sessionStorage.removeItem('iframe') + this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID)) + } else { + this.props.history.replace('/main') + } } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') { message.warning('搴旂敤灏氭湭鍒涘缓锛岃鍚戜簯绔悓姝ュ簲鐢紒') @@ -538,6 +556,8 @@ _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) Api.getSystemConfig(_param).then(res => { + if (!res) return + if (res.status) { // positecgroup // res.Banner = res.Banner ? res.Banner.replace(/:8080/ig, '').replace(/http:/ig, 'https:') : '' diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index f746df1..f7dd467 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -293,17 +293,13 @@ <Form.Item label="鎵撳紑鏂瑰紡"> {getFieldDecorator('OpenType', { initialValue: config.OpenType || 'newtab', - rules: [ - { - required: true, - message: '璇烽�夋嫨鎵撳紑鏂瑰紡!' - } - ] + rules: [{ required: true, message: '璇烽�夋嫨鎵撳紑鏂瑰紡!' }] })( - <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> - <Radio value="newtab">鏍囩椤�</Radio> - <Radio value="newpage">鏂伴〉闈�</Radio> - </Radio.Group> + <Select onChange={(value) => {this.selectChange('OpenType', value)}}> + <Select.Option value="newtab">鏍囩椤�</Select.Option> + <Select.Option value="newpage">鏂伴〉闈紙鏍囩椤碉級</Select.Option> + <Select.Option value="view">鏂伴〉闈紙鍏ㄥ睆锛�</Select.Option> + </Select> )} </Form.Item> </Col> diff --git a/src/views/mkiframe/index.jsx b/src/views/mkiframe/index.jsx new file mode 100644 index 0000000..b2f079b --- /dev/null +++ b/src/views/mkiframe/index.jsx @@ -0,0 +1,187 @@ +import React, {Component} from 'react' +import { Spin, notification } from 'antd' + +import Api from '@/api' +import asyncComponent from '@/utils/asyncLoadComponent' +import MKEmitter from '@/utils/events.js' +import './index.scss' + +const CustomPage = asyncComponent(() => import('@/tabviews/custom')) +const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) + +class MkIframe extends Component { + state = { + loading: true, + BID: '', + MenuId: '', + type: 'CustomPage' + } + + UNSAFE_componentWillMount() { + const { params, path } = this.props.match + const { menuId, loginUid, bid } = params + + if (/^\/view\//.test(path)) { + localStorage.setItem('getSysPermission', window.GLOB.appkey) + + window.addEventListener('storage', function(event) { + if (event.key === 'sysPermissions' && event.newValue) { + let values = event.newValue + values = JSON.parse(values) + + window.GLOB.mkThdMenus = values.mkThdMenus + window.GLOB.mkActions = values.mkActions + } + }) + + setTimeout(() => { + localStorage.removeItem('getSysPermission') + localStorage.removeItem('sysPermissions') + + if (window.GLOB.mkActions) { + this.setState({loading: false}) + } else { + this.getPermRole() + } + }, 20) + } else if (sessionStorage.getItem('UserID')) { + this.getPermRole() + } else { + sessionStorage.setItem('LoginUID', loginUid) + + Api.getTouristMsg('login_check').then(res => { + if (res.status) { + sessionStorage.setItem('UserID', res.UserID) + sessionStorage.setItem('LoginUID', res.LoginUID) + sessionStorage.setItem('User_Name', res.UserName) + sessionStorage.setItem('Full_Name', res.FullName) + sessionStorage.setItem('avatar', res.icon || '') + sessionStorage.setItem('dataM', res.dataM ? 'true' : '') + sessionStorage.setItem('debug', res.debug || '') + sessionStorage.setItem('role_id', res.role_id || '') + sessionStorage.setItem('departmentcode', res.departmentcode || '') + sessionStorage.setItem('organization', res.organization || '') + sessionStorage.setItem('mk_user_type', res.mk_user_type || '') + this.getPermRole() + } else { + sessionStorage.clear() + sessionStorage.setItem('iframe', `/iframe/${menuId}/@loginuid@/${bid || ''}`) + this.props.history.replace('/login') + } + }) + } + + this.setState({BID: bid || '', MenuId: menuId}) + } + + componentDidMount () { + MKEmitter.addListener('modifyTabs', this.modifyTabs) + MKEmitter.addListener('closeTabView', this.closeTabView) + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 + */ + componentWillUnmount () { + this.setState = () => { + return + } + MKEmitter.removeListener('modifyTabs', this.modifyTabs) + MKEmitter.removeListener('closeTabView', this.closeTabView) + } + + modifyTabs = (tab) => { + const { MenuId, BID } = this.state + + let _menuId = tab.MenuID + let _BID = tab.param && tab.param.$BID ? tab.param.$BID : '' + + let historys = sessionStorage.getItem('page_historys') + historys = historys ? JSON.parse(historys) : [] + + historys.push({MenuId: MenuId, BID: BID}) + + sessionStorage.setItem('page_historys', JSON.stringify(historys)) + + this.setState({ + MenuId: _menuId, + BID: _BID, + loading: true + }, () => { + this.setState({ + loading: false + }) + }) + } + + closeTabView = () => { + let historys = sessionStorage.getItem('page_historys') + historys = historys ? JSON.parse(historys) : [] + + if (historys.length === 0) return + + let tab = historys.shift() + + sessionStorage.setItem('page_historys', JSON.stringify(historys)) + + this.setState({ + MenuId: tab.MenuId, + BID: tab.BID, + loading: true + }, () => { + this.setState({ + loading: false + }) + }) + } + + getPermRole = () => { + Api.getSystemConfig({ + func: 's_Get_TrdMenu_Role', + edition_type: 'A', + pro_sys: window.GLOB.systemType === 'production' ? 'Y' : '' + }).then(result => { + if (!result.status) { + notification.error({ + top: 92, + message: result.message, + duration: 10 + }) + return + } + + let _permAction = {loaded: true} // 鎸夐挳鏉冮檺 + + if (result.UserRoles_Menu) { + result.UserRoles_Menu.forEach(menu => { + if (!menu.MenuID) return + _permAction[menu.MenuID] = true + }) + } + + window.GLOB.mkActions = _permAction + + this.setState({loading: false}) + }) + } + + changeTemp = (MenuID, Template) => { + this.setState({ + type: Template + }) + } + + render () { + const { loading, BID, MenuId, type } = this.state + + return ( + <div className="main-iframe"> + {loading ? <Spin size="large" /> : null} + {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} + {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} + </div> + ) + } +} + +export default MkIframe \ No newline at end of file diff --git a/src/views/mkiframe/index.scss b/src/views/mkiframe/index.scss new file mode 100644 index 0000000..9390276 --- /dev/null +++ b/src/views/mkiframe/index.scss @@ -0,0 +1,10 @@ +.main-iframe { + .ant-spin { + position: absolute; + left: calc(50vw - 22px); + top: 45vh; + } + .custom-table-wrap, .custom-page-wrap { + min-height: 100vh; + } +} \ No newline at end of file diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx index fe0a8e6..06fedc7 100644 --- a/src/views/tabledesign/menuform/index.jsx +++ b/src/views/tabledesign/menuform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, notification, Radio, Switch } from 'antd' +import { Form, Row, Col, Input, Select, notification, Switch } from 'antd' import Api from '@/api' import options from '@/store/options.js' @@ -324,10 +324,11 @@ } ] })( - <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> - <Radio value="newtab">鏍囩椤�</Radio> - <Radio value="newpage">鏂伴〉闈�</Radio> - </Radio.Group> + <Select onChange={(value) => {this.selectChange('OpenType', value)}}> + <Select.Option value="newtab">鏍囩椤�</Select.Option> + <Select.Option value="newpage">鏂伴〉闈紙鏍囩椤碉級</Select.Option> + <Select.Option value="view">鏂伴〉闈紙鍏ㄥ睆锛�</Select.Option> + </Select> )} </Form.Item> </Col> -- Gitblit v1.8.0