From 569ccb3c1ff82f30ffefa7d3700571448d742662 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 十二月 2020 11:46:28 +0800 Subject: [PATCH] 2020-12-03 --- src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 91 ++- src/menu/components/table/normal-table/wrapsetting/index.jsx | 85 +++ package-lock.json | 456 ++++++++++++------- src/tabviews/zshare/calendar/index.jsx | 2 src/components/header/index.jsx | 5 src/menu/components/card/cardcellcomponent/index.jsx | 1 src/menu/components/table/normal-table/wrapsetting/index.scss | 7 src/menu/actioncomponent/formconfig.jsx | 1 src/menu/actioncomponent/actionform/index.jsx | 6 src/menu/components/card/cardcomponent/index.jsx | 3 /dev/null | 7 src/menu/modelsource/option.jsx | 4 src/menu/components/table/normal-table/columns/editColumn/index.jsx | 78 +- src/menu/components/table/normal-table/index.scss | 4 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 45 - src/menu/components/table/normal-table/columns/index.scss | 24 src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx | 161 +++++++ package.json | 2 src/menu/components/table/normal-table/index.jsx | 63 -- src/components/header/loginform.jsx | 8 src/menu/components/table/normal-table/columns/index.jsx | 269 +++++++++- src/menu/components/table/normal-table/wrapsetting/settingform/index.scss | 11 src/tabviews/zshare/calendar/index.scss | 3 src/views/login/index.jsx | 11 24 files changed, 964 insertions(+), 383 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6834560..8ca9298 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,21 +5,26 @@ "requires": true, "dependencies": { "@ant-design/colors": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-3.2.1.tgz", - "integrity": "sha512-ibJybOcR1+h2IEr0Yxx4y/Wcz8obEtKvl2EYvxh8ugMkYniGSItpLKGzKNyyqzOaum5jb6fVCyH1aR9VkdpFRA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-3.2.2.tgz", + "integrity": "sha512-YKgNbG2dlzqMhA9NtI3/pbY16m3Yl/EeWBRa+lB1X1YaYxHrxNexiQYCLTWO/uDvAjLFMEDU+zR901waBtMtjQ==", "requires": { "tinycolor2": "^1.4.1" } }, "@ant-design/create-react-context": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@ant-design/create-react-context/-/create-react-context-0.2.4.tgz", - "integrity": "sha512-8sw+/w6r+aEbd+OJ62ojoSE4zDt/3yfQydmbWFznoftjr8v/opOswGjM+/MU0rSaREbluqzOmZ6xdecHpSaS2w==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@ant-design/create-react-context/-/create-react-context-0.2.5.tgz", + "integrity": "sha512-1rMAa4qgP2lfl/QBH9i78+Gjxtj9FTMpMyDGZsEBW5Kih72EuUo9958mV8PgpRkh4uwPSQ7vVZWXeyNZXVAFDg==", "requires": { "gud": "^1.0.0", "warning": "^4.0.3" } + }, + "@ant-design/css-animation": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@ant-design/css-animation/-/css-animation-1.7.3.tgz", + "integrity": "sha512-LrX0OGZtW+W6iLnTAqnTaoIsRelYeuLZWsrmBJFUXDALQphPsN8cE5DCsmoSlL0QYb94BQxINiuS70Ar/8BNgA==" }, "@ant-design/icons": { "version": "2.1.1", @@ -2951,9 +2956,9 @@ "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=" }, "antd": { - "version": "3.23.2", - "resolved": "https://registry.npmjs.org/antd/-/antd-3.23.2.tgz", - "integrity": "sha512-S62EvyxPV0IoFR650qtCjUy2E7nY3JkxTP1t71LER09DTTK4fJGw4wWhalNCjkIHR2hPHWGfu0MSHocov3F4dw==", + "version": "3.26.20", + "resolved": "https://registry.npmjs.org/antd/-/antd-3.26.20.tgz", + "integrity": "sha512-VIous4ofZfxFtd9K1h9MpRX2sDDpj3QcOFi3YgIc9B/uyDli/GlLb8SWKfQfJaMkaxwatIv503dag2Tog+hiEg==", "requires": { "@ant-design/create-react-context": "^0.2.4", "@ant-design/icons": "~2.1.1", @@ -2966,47 +2971,82 @@ "css-animation": "^1.5.0", "dom-closest": "^0.2.0", "enquire.js": "^2.1.6", + "is-mobile": "^2.1.0", "lodash": "^4.17.13", "moment": "^2.24.0", "omit.js": "^1.0.2", "prop-types": "^15.7.2", "raf": "^3.4.1", - "rc-animate": "^2.8.3", - "rc-calendar": "~9.15.5", + "rc-animate": "^2.10.2", + "rc-calendar": "~9.15.7", "rc-cascader": "~0.17.4", "rc-checkbox": "~2.1.6", "rc-collapse": "~1.11.3", - "rc-dialog": "~7.5.2", - "rc-drawer": "~2.0.1", + "rc-dialog": "~7.6.0", + "rc-drawer": "~3.1.1", "rc-dropdown": "~2.4.1", "rc-editor-mention": "^1.1.13", - "rc-form": "^2.4.5", + "rc-form": "^2.4.10", "rc-input-number": "~4.5.0", "rc-mentions": "~0.4.0", - "rc-menu": "~7.4.23", + "rc-menu": "~7.5.1", "rc-notification": "~3.3.1", - "rc-pagination": "~1.20.5", + "rc-pagination": "~1.20.11", "rc-progress": "~2.5.0", "rc-rate": "~2.5.0", + "rc-resize-observer": "^0.1.0", "rc-select": "~9.2.0", - "rc-slider": "~8.6.11", + "rc-slider": "~8.7.1", "rc-steps": "~3.5.0", "rc-switch": "~1.9.0", - "rc-table": "~6.7.0", - "rc-tabs": "~9.6.4", + "rc-table": "~6.10.5", + "rc-tabs": "~9.7.0", "rc-time-picker": "~3.7.1", "rc-tooltip": "~3.7.3", "rc-tree": "~2.1.0", "rc-tree-select": "~2.9.1", "rc-trigger": "^2.6.2", - "rc-upload": "~2.7.0", - "rc-util": "^4.10.0", + "rc-upload": "~2.9.1", + "rc-util": "^4.16.1", "react-lazy-load": "^3.0.13", "react-lifecycles-compat": "^3.0.4", "react-slick": "~0.25.2", "resize-observer-polyfill": "^1.5.1", "shallowequal": "^1.1.0", "warning": "~4.0.3" + }, + "dependencies": { + "rc-animate": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.11.1.tgz", + "integrity": "sha512-1NyuCGFJG/0Y+9RKh5y/i/AalUCA51opyyS/jO2seELpgymZm2u9QV3xwODwEuzkmeQ1BDPxMLmYLcTJedPlkQ==", + "requires": { + "babel-runtime": "6.x", + "classnames": "^2.2.6", + "css-animation": "^1.3.2", + "prop-types": "15.x", + "raf": "^3.4.0", + "rc-util": "^4.15.3", + "react-lifecycles-compat": "^3.0.4" + } + }, + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", + "requires": { + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } } }, "antd-mobile": { @@ -4997,9 +5037,9 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, "copy-to-clipboard": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.2.0.tgz", - "integrity": "sha512-eOZERzvCmxS8HWzugj4Uxl8OJxa7T2k1Gi0X5qavwydHIfuSHq2dTD09LOg/XyGq4Zpb5IsR/2OJ5lbOegz78w==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz", + "integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==", "requires": { "toggle-selection": "^1.0.6" } @@ -10257,6 +10297,11 @@ "is-extglob": "^2.1.1" } }, + "is-mobile": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-2.2.2.tgz", + "integrity": "sha512-wW/SXnYJkTjs++tVK5b6kVITZpAZPtUrt9SF80vvxGiF/Oywal+COk1jlRkiVq15RFNEQKQY31TkV24/1T5cVg==" + }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -10387,11 +10432,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "ismobilejs": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-0.5.2.tgz", - "integrity": "sha512-ta9UdV60xVZk/ZafFtSFslQaE76SvNkcs1r73d2PVR21zVzx9xuYv9tNe4MxA1NN7WoeCc2RjGot3Bz1eHDx3Q==" }, "isobject": { "version": "3.0.1", @@ -13203,9 +13243,9 @@ "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" }, "mutationobserver-shim": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz", - "integrity": "sha512-gciOLNN8Vsf7YzcqRjKzlAJ6y7e+B86u7i3KXes0xfxx/nfLmozlW1Vn+Sc9x3tPIePFgc1AeIFhtRgkqTjzDQ==" + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/mutationobserver-shim/-/mutationobserver-shim-0.3.7.tgz", + "integrity": "sha512-oRIDTyZQU96nAiz2AQyngwx1e89iApl2hN5AOYwyxLUB47UYsU3Wv9lJWqH5y/QdiYkc5HQLi23ZNB3fELdHcQ==" }, "mute-stream": { "version": "0.0.7", @@ -15567,9 +15607,9 @@ } }, "rc-calendar": { - "version": "9.15.5", - "resolved": "https://registry.npmjs.org/rc-calendar/-/rc-calendar-9.15.5.tgz", - "integrity": "sha512-nvoEXk5P0DADt5b7FHlKiXKj+IhoWawQGSkb5soa6gXQIfoqQJ5+zB2Ogy7k1RxNbxQu4iIkEW/a3+HObVRDdA==", + "version": "9.15.11", + "resolved": "https://registry.npmjs.org/rc-calendar/-/rc-calendar-9.15.11.tgz", + "integrity": "sha512-qv0VXfAAnysMWJigxaP6se4bJHvr17D9qsLbi8BOpdgEocsS0RkgY1IUiFaOVYKJDy/EyLC447O02sV/y5YYBg==", "requires": { "babel-runtime": "6.x", "classnames": "2.x", @@ -15595,9 +15635,9 @@ } }, "rc-checkbox": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/rc-checkbox/-/rc-checkbox-2.1.7.tgz", - "integrity": "sha512-8L+0XuucUOMUM6F/7qH+hnQpEHPZfW1Um02lUHEVdpZNor5mC0Fj4x8GvTtwcM1pAl5tD3I6lHYD8cE1W8RZJw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/rc-checkbox/-/rc-checkbox-2.1.8.tgz", + "integrity": "sha512-6qOgh0/by0nVNASx6LZnhRTy17Etcgav+IrI7kL9V9kcDZ/g7K14JFlqrtJ3NjDq/Kyn+BPI1st1XvbkhfaJeg==", "requires": { "babel-runtime": "^6.23.0", "classnames": "2.x", @@ -15606,9 +15646,9 @@ } }, "rc-collapse": { - "version": "1.11.7", - "resolved": "https://registry.npmjs.org/rc-collapse/-/rc-collapse-1.11.7.tgz", - "integrity": "sha512-ge3EEzIFtrDGuPX4bxXdQqwb91JnPIdj3B+FU88yNOUeOroNuA2q9kVK+UatpQ1Eft5hNo/ICTDrVFi8+685ng==", + "version": "1.11.8", + "resolved": "https://registry.npmjs.org/rc-collapse/-/rc-collapse-1.11.8.tgz", + "integrity": "sha512-8EhfPyScTYljkbRuIoHniSwZagD5UPpZ3CToYgoNYWC85L2qCbPYF7+OaC713FOrIkp6NbfNqXsITNxmDAmxog==", "requires": { "classnames": "2.x", "css-animation": "1.x", @@ -15620,24 +15660,61 @@ } }, "rc-dialog": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/rc-dialog/-/rc-dialog-7.5.7.tgz", - "integrity": "sha512-hSKzxdbkWylenjdyNwUPz2Wb4pkmpFld/Qp7u5uhXhlLUTUjQceCj+VFXHWKfBGlesm34SD4wNl4ZvyEYIAdNA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/rc-dialog/-/rc-dialog-7.6.1.tgz", + "integrity": "sha512-KUKf+2eZ4YL+lnXMG3hR4ZtIhC9glfH27NtTVz3gcoDIPAf3uUvaXVRNoDCiSi+OGKLyIb/b6EoidFh6nQC5Wg==", "requires": { "babel-runtime": "6.x", "rc-animate": "2.x", - "rc-util": "^4.8.1" + "rc-util": "^4.16.1" + }, + "dependencies": { + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", + "requires": { + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } } }, "rc-drawer": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-2.0.9.tgz", - "integrity": "sha512-7qwEND3TLvJeyuUvZfMDkL2pHsR/XHX5HvoaBlIH9mTcFWBmMNrvYGDuGHgGsdNKZZgIBwlkvl5vhckydTUc9Q==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-3.1.3.tgz", + "integrity": "sha512-2z+RdxmzXyZde/1OhVMfDR1e/GBswFeWSZ7FS3Fdd0qhgVdpV1wSzILzzxRaT481ItB5hOV+e8pZT07vdJE8kg==", "requires": { - "babel-runtime": "6.x", - "classnames": "^2.2.5", - "rc-util": "^4.7.0", + "classnames": "^2.2.6", + "rc-util": "^4.16.1", "react-lifecycles-compat": "^3.0.4" + }, + "dependencies": { + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", + "requires": { + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } } }, "rc-dropdown": { @@ -15738,9 +15815,9 @@ } }, "rc-hammerjs": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/rc-hammerjs/-/rc-hammerjs-0.6.9.tgz", - "integrity": "sha512-4llgWO3RgLyVbEqUdGsDfzUDqklRlQW5VEhE3x35IvhV+w//VPRG34SBavK3D2mD/UaLKaohgU41V4agiftC8g==", + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/rc-hammerjs/-/rc-hammerjs-0.6.10.tgz", + "integrity": "sha512-Vgh9qIudyN5CHRop4M+v+xUniQBFWXKrsJxQRVtJOi2xgRrCeI52/bkpaL5HWwUhqTK9Ayq0n7lYTItT6ld5rg==", "requires": { "babel-runtime": "6.x", "hammerjs": "^2.0.8", @@ -15748,9 +15825,9 @@ } }, "rc-input-number": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-4.5.0.tgz", - "integrity": "sha512-0igTdXuxVykBB82jafUmhbRVmgtd0FuGSIX4SbrynGNrLDOyze3EUKsZl+LyQ4JMRXLrcuZKJg385880RVLA2w==", + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-4.5.7.tgz", + "integrity": "sha512-99PrQ90sTOKyyj7eu0VzwxY17xQ+bwG1XTQd+bTwFQ+IOUkIw7L4qSAYxt58sVYL+Cw+bu/RAtT2IpT9yC2pCQ==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.0", @@ -15760,9 +15837,9 @@ } }, "rc-mentions": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/rc-mentions/-/rc-mentions-0.4.0.tgz", - "integrity": "sha512-xnkQBTUFp4llaJuDOLVFKX9ELrXFHk1FuUdIIC/ijQ6cLjDhCUu+jpHNcXWuQ/yIFzF376VlXkmT57iqxSnZzw==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/rc-mentions/-/rc-mentions-0.4.2.tgz", + "integrity": "sha512-DTZurQzacLXOfVuiHydGzqkq7cFMHXF18l2jZ9PhWUn2cqvOSY3W4osN0Pq29AOMOBpcxdZCzgc7Lb0r/bgkDw==", "requires": { "@ant-design/create-react-context": "^0.2.4", "classnames": "^2.2.6", @@ -15773,21 +15850,52 @@ } }, "rc-menu": { - "version": "7.4.28", - "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-7.4.28.tgz", - "integrity": "sha512-H61QBokniClkAVSLm2ZT5BMg7P2t1Vz7TwmUSuoF3Gbc1Q2M5ZFvnNnZBIQr8waHsLKfClsWyQVdA0BZe6iUfw==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-7.5.5.tgz", + "integrity": "sha512-4YJXJgrpUGEA1rMftXN7bDhrV5rPB8oBJoHqT+GVXtIWCanfQxEnM3fmhHQhatL59JoAFMZhJaNzhJIk4FUWCQ==", "requires": { - "babel-runtime": "6.x", "classnames": "2.x", "dom-scroll-into-view": "1.x", - "ismobilejs": "^0.5.1", "mini-store": "^2.0.0", "mutationobserver-shim": "^0.3.2", - "prop-types": "^15.5.6", - "rc-animate": "2.x", + "rc-animate": "^2.10.1", "rc-trigger": "^2.3.0", - "rc-util": "^4.1.0", - "resize-observer-polyfill": "^1.5.0" + "rc-util": "^4.13.0", + "resize-observer-polyfill": "^1.5.0", + "shallowequal": "^1.1.0" + }, + "dependencies": { + "rc-animate": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.11.1.tgz", + "integrity": "sha512-1NyuCGFJG/0Y+9RKh5y/i/AalUCA51opyyS/jO2seELpgymZm2u9QV3xwODwEuzkmeQ1BDPxMLmYLcTJedPlkQ==", + "requires": { + "babel-runtime": "6.x", + "classnames": "^2.2.6", + "css-animation": "^1.3.2", + "prop-types": "15.x", + "raf": "^3.4.0", + "rc-util": "^4.15.3", + "react-lifecycles-compat": "^3.0.4" + } + }, + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", + "requires": { + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } } }, "rc-notification": { @@ -15803,9 +15911,9 @@ } }, "rc-pagination": { - "version": "1.20.5", - "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-1.20.5.tgz", - "integrity": "sha512-gnVAowVIbRilW6bXYWCEpTsrtmAWTpM3qO/bltYfqTVKxgb6/sDqjRvCksJGy/D81pYkEkKeA9foWsgUgbUsQw==", + "version": "1.20.15", + "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-1.20.15.tgz", + "integrity": "sha512-/Xr4/3GOa1DtL8iCYl7qRUroEMrRDhZiiuHwcVFfSiwa9LYloMlUWcOJsnr8LN6A7rLPdm3/CHStUNeYd+2pKw==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.6", @@ -15814,18 +15922,18 @@ } }, "rc-progress": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/rc-progress/-/rc-progress-2.5.2.tgz", - "integrity": "sha512-ajI+MJkbBz9zYDuE9GQsY5gsyqPF7HFioZEDZ9Fmc+ebNZoiSeSJsTJImPFCg0dW/5WiRGUy2F69SX1aPtSJgA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/rc-progress/-/rc-progress-2.5.3.tgz", + "integrity": "sha512-K2fa4CnqGehLZoMrdmBeZ86ONSTVcdk5FlqetbwJ3R/+42XfqhwQVOjWp2MH4P7XSQOMAGcNOy1SFfCP3415sg==", "requires": { "babel-runtime": "6.x", "prop-types": "^15.5.8" } }, "rc-rate": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/rc-rate/-/rc-rate-2.5.0.tgz", - "integrity": "sha512-aXX5klRqbVZxvLghcKnLqqo7LvLVCHswEDteWsm5Gb7NBIPa1YKTcAbvb5SZ4Z4i4EeRoZaPwygRAWsQgGtbKw==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/rc-rate/-/rc-rate-2.5.1.tgz", + "integrity": "sha512-3iJkNJT8xlHklPCdeZtUZmJmRVUbr6AHRlfSsztfYTXVlHrv2TcPn3XkHsH+12j812WVB7gvilS2j3+ffjUHXg==", "requires": { "classnames": "^2.2.5", "prop-types": "^15.5.8", @@ -15833,10 +15941,39 @@ "react-lifecycles-compat": "^3.0.4" } }, + "rc-resize-observer": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/rc-resize-observer/-/rc-resize-observer-0.1.3.tgz", + "integrity": "sha512-uzOQEwx83xdQSFOkOAM7x7GHIQKYnrDV4dWxtCxyG1BS1pkfJ4EvDeMfsvAJHSYkQXVBu+sgRHGbRtLG3qiuUg==", + "requires": { + "classnames": "^2.2.1", + "rc-util": "^4.13.0", + "resize-observer-polyfill": "^1.5.1" + }, + "dependencies": { + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", + "requires": { + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + } + } + }, "rc-select": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/rc-select/-/rc-select-9.2.1.tgz", - "integrity": "sha512-nW/Zr2OCgxN26OX8ff3xcO1wK0e1l5ixnEfyN15Rbdk7TNI/rIPJIjPCQAoihRpk9A2C/GH8pahjlvKV1Vj++g==", + "version": "9.2.3", + "resolved": "https://registry.npmjs.org/rc-select/-/rc-select-9.2.3.tgz", + "integrity": "sha512-WhswxOMWiNnkXRbxyrj0kiIvyCfo/BaRPaYbsDetSIAU2yEDwKHF798blCP5u86KLOBKBvtxWLFCkSsQw1so5w==", "requires": { "babel-runtime": "^6.23.0", "classnames": "2.x", @@ -15853,16 +15990,17 @@ } }, "rc-slider": { - "version": "8.6.13", - "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-8.6.13.tgz", - "integrity": "sha512-fCUe8pPn8n9pq1ARX44nN2nzJoATtna4x/PdskUrxIvZXN8ja7HuceN/hq6kokZjo3FBD2B1yMZvZh6oi68l6Q==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-8.7.1.tgz", + "integrity": "sha512-WMT5mRFUEcrLWwTxsyS8jYmlaMsTVCZIGENLikHsNv+tE8ThU2lCoPfi/xFNUfJFNFSBFP3MwPez9ZsJmNp13g==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.5", "prop-types": "^15.5.4", "rc-tooltip": "^3.7.0", "rc-util": "^4.0.4", - "shallowequal": "^1.0.1", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0", "warning": "^4.0.3" } }, @@ -15889,9 +16027,9 @@ } }, "rc-switch": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/rc-switch/-/rc-switch-1.9.0.tgz", - "integrity": "sha512-Isas+egaK6qSk64jaEw4GgPStY4umYDbT7ZY93bZF1Af+b/JEsKsJdNOU2qG3WI0Z6tXo2DDq0kJCv8Yhu0zww==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/rc-switch/-/rc-switch-1.9.2.tgz", + "integrity": "sha512-qaK7mY4FLDKy99Hq3A1tf8CcqfzKtHp9LPX8WTnZ0MzdHCTneSARb1XD7Eqeu8BactasYGsi2bF9p18Q+/5JEw==", "requires": { "classnames": "^2.2.1", "prop-types": "^15.5.6", @@ -15899,36 +16037,43 @@ } }, "rc-table": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-6.7.0.tgz", - "integrity": "sha512-zzu7UtEHLTzZibB1EOoeKQejH21suoxRQx3evlGGLwz5NUh2HDUHobSr12z5Kd8EPr1+y/LPzXJdX1ctFPC+hA==", + "version": "6.10.15", + "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-6.10.15.tgz", + "integrity": "sha512-LAr0M/gqt+irOjvPNBLApmQ0CUHNOfKsEBhu1uIuB3OlN1ynA9z+sdoTQyNd9+8NSl0MYnQOOfhtLChAY7nU0A==", "requires": { - "babel-runtime": "6.x", "classnames": "^2.2.5", "component-classes": "^1.2.6", "lodash": "^4.17.5", "mini-store": "^2.0.0", "prop-types": "^15.5.8", - "rc-util": "^4.0.4", + "rc-util": "^4.13.0", "react-lifecycles-compat": "^3.0.2", - "shallowequal": "^1.0.2", - "warning": "^3.0.0" + "shallowequal": "^1.0.2" }, "dependencies": { - "warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", "requires": { - "loose-envify": "^1.0.0" + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" } } }, "rc-tabs": { - "version": "9.6.6", - "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-9.6.6.tgz", - "integrity": "sha512-8Vs4tLZKQODl72RetTNm+yVOuboAhtJlvf9fbxWJ4WiYuzMxU7Y8RZ8yVNDGt3+4WzCJUI53CtobptBWwcUkDA==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-9.7.0.tgz", + "integrity": "sha512-kvmgp8/MfLzFZ06hWHignqomFQ5nF7BqKr5O1FfhE4VKsGrep52YSF/1MvS5oe0NPcI9XGNS2p751C5v6cYDpQ==", "requires": { "@ant-design/create-react-context": "^0.2.4", "babel-runtime": "6.x", @@ -15944,9 +16089,9 @@ } }, "rc-time-picker": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/rc-time-picker/-/rc-time-picker-3.7.2.tgz", - "integrity": "sha512-UVWO9HXGyZoM4I2THlJsEAFcZQz+tYwdcpoHXCEFZsRLz9L2+7vV4EMp9Wa3UrtzMFEt83qSAX/90dCJeKl9sg==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/rc-time-picker/-/rc-time-picker-3.7.3.tgz", + "integrity": "sha512-Lv1Mvzp9fRXhXEnRLO4nW6GLNxUkfAZ3RsiIBsWjGjXXvMNjdr4BX/ayElHAFK0DoJqOhm7c5tjmIYpEOwcUXg==", "requires": { "classnames": "2.x", "moment": "2.x", @@ -15967,9 +16112,9 @@ } }, "rc-tree": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-2.1.2.tgz", - "integrity": "sha512-IQG0bkY4bfK11oVIF44Y4V3IuIOAmIIc5j8b8XGkRjsnUOElRr/BNqKCvg9h2UsNJm1J2xv4OA0HfEIv70765Q==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-2.1.4.tgz", + "integrity": "sha512-Xey794Iavgs8YldFlXcZLOhfcIhlX5Oz/yfKufknBXf2AlZCOkc7aHqSM9uTF7fBPtTGPhPxNEfOqHfY7b7xng==", "requires": { "@ant-design/create-react-context": "^0.2.4", "classnames": "2.x", @@ -15981,51 +16126,27 @@ } }, "rc-tree-select": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-2.9.1.tgz", - "integrity": "sha512-AfJQC1ZzaeH+Onmx84TtVLUL2guBZe7exA8XSfj1RRB1doDbYGTtybzpP3CEw/tuSftSRnz+iPt+iaxRTrgXRw==", + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-2.9.4.tgz", + "integrity": "sha512-0HQkXAN4XbfBW20CZYh3G+V+VMrjX42XRtDCpyv6PDUm5vikC0Ob682ZBCVS97Ww2a5Hf6Ajmu0ahWEdIEpwhg==", "requires": { "classnames": "^2.2.1", "dom-scroll-into-view": "^1.2.1", "prop-types": "^15.5.8", "raf": "^3.4.0", "rc-animate": "^2.8.2", - "rc-tree": "~2.0.0", - "rc-trigger": "^3.0.0-rc.2", + "rc-tree": "~2.1.0", + "rc-trigger": "^3.0.0", "rc-util": "^4.5.0", "react-lifecycles-compat": "^3.0.4", "shallowequal": "^1.0.2", "warning": "^4.0.1" }, "dependencies": { - "rc-tree": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-2.0.0.tgz", - "integrity": "sha512-DAT/jsbnFbHqG9Df9OaVG93CAVtTsJVnJiwKX+wqsG8TChpty3s6QX3zJZ+gBgjkq4ikLbu1kuFJtX63EKhSAA==", - "requires": { - "babel-runtime": "^6.23.0", - "classnames": "2.x", - "prop-types": "^15.5.8", - "rc-animate": "^2.6.0", - "rc-util": "^4.5.1", - "react-lifecycles-compat": "^3.0.4", - "warning": "^3.0.0" - }, - "dependencies": { - "warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", - "requires": { - "loose-envify": "^1.0.0" - } - } - } - }, "rc-trigger": { - "version": "3.0.0-rc.3", - "resolved": "https://registry.npmjs.org/rc-trigger/-/rc-trigger-3.0.0-rc.3.tgz", - "integrity": "sha512-4vB6cpxcUdm2qO5VtB9q1TZz0MoWm9BzFLvGknulphGrl1qI6uxUsPDCvqnmujdpDdAKGGfjxntFpA7RtAwkFQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rc-trigger/-/rc-trigger-3.0.0.tgz", + "integrity": "sha512-hQxbbJpo23E2QnYczfq3Ec5J5tVl2mUDhkqxrEsQAqk16HfADQg+iKNWzEYXyERSncdxfnzYuaBgy764mNRzTA==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.6", @@ -16033,25 +16154,38 @@ "raf": "^3.4.0", "rc-align": "^2.4.1", "rc-animate": "^3.0.0-rc.1", - "rc-util": "^4.4.0" + "rc-util": "^4.15.7" }, "dependencies": { "rc-animate": { - "version": "3.0.0-rc.6", - "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-3.0.0-rc.6.tgz", - "integrity": "sha512-oBLPpiT6Q4t6YvD/pkLcmofBP1p01TX0Otse8Q4+Mxt8J+VSDflLZGIgf62EwkvRwsQUkLPjZVFBsldnPKLzjg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-3.1.1.tgz", + "integrity": "sha512-8wg2Zg3EETy0k/9kYuis30NJNQg1D6/WSQwnCiz6SvyxQXNet/rVraRz3bPngwY6rcU2nlRvoShiYOorXyF7Sg==", "requires": { - "babel-runtime": "6.x", - "classnames": "^2.2.5", - "component-classes": "^1.2.6", - "fbjs": "^0.8.16", - "prop-types": "15.x", + "@ant-design/css-animation": "^1.7.2", + "classnames": "^2.2.6", "raf": "^3.4.0", - "rc-util": "^4.5.0", - "react-lifecycles-compat": "^3.0.4" + "rc-util": "^4.15.3" + } + }, + "rc-util": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", + "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", + "requires": { + "add-dom-event-listener": "^1.1.0", + "prop-types": "^15.5.10", + "react-is": "^16.12.0", + "react-lifecycles-compat": "^3.0.4", + "shallowequal": "^1.1.0" } } } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" } } }, @@ -16070,9 +16204,9 @@ } }, "rc-upload": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/rc-upload/-/rc-upload-2.7.0.tgz", - "integrity": "sha512-Oh9EJB4xE8MQUZ2D0OUST3UMIBjHjnO2IjPNW/cbPredxZz+lzbLPCZxcxRwUwu1gt0LA968UWXAgT1EvZdFfA==", + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/rc-upload/-/rc-upload-2.9.4.tgz", + "integrity": "sha512-WXt0HGxXyzLrPV6iec/96Rbl/6dyrAW8pKuY6wwD7yFYwfU5bjgKjv7vC8KNMJ6wzitFrZjnoiogNL3dF9dj3Q==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.5", @@ -16359,9 +16493,9 @@ "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==" }, "react-lazy-load": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/react-lazy-load/-/react-lazy-load-3.0.13.tgz", - "integrity": "sha1-OwqS0zbUPT8Nc8vm81sXBQsIuCQ=", + "version": "3.1.13", + "resolved": "https://registry.npmjs.org/react-lazy-load/-/react-lazy-load-3.1.13.tgz", + "integrity": "sha512-eAVNUn3vhNj79Iv04NOCwy/sCLyqDEhL3j9aJKV7VJuRBDg6rCiB+BIWHuG7VXJGCgb//6nX/soR8PTyWRhFvQ==", "requires": { "eventlistener": "0.0.1", "lodash.debounce": "^4.0.0", @@ -17925,9 +18059,9 @@ } }, "shallow-equal": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.2.0.tgz", - "integrity": "sha512-Z21pVxR4cXsfwpMKMhCEIO1PCi5sp7KEp+CmOpBQ+E8GpHwKOw2sEzk7sgblM3d/j4z4gakoWEoPcjK0VJQogA==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-1.2.1.tgz", + "integrity": "sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==" }, "shallowequal": { "version": "1.1.0", diff --git a/package.json b/package.json index 0f67642..0a81c07 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@typescript-eslint/eslint-plugin": "1.13.0", "@typescript-eslint/parser": "1.13.0", "@uiw/react-codemirror": "^2.2.1", - "antd": "^3.23.2", + "antd": "^3.26.20", "antd-mobile": "^2.3.3", "axios": "^0.19.0", "babel-eslint": "10.0.2", diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index ebe4961..486af95 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -595,10 +595,7 @@ if (visible) { setTimeout(() => { let input = document.getElementById('thdMenu-search') - - if (input) { - input.focus() - } + input && input.focus() }, 500) } }) diff --git a/src/components/header/loginform.jsx b/src/components/header/loginform.jsx index e887b12..7010577 100644 --- a/src/components/header/loginform.jsx +++ b/src/components/header/loginform.jsx @@ -32,9 +32,7 @@ if (e.target.value) { if (!this.props.form.getFieldValue(key)) { const input = document.getElementById(key) - if (input) { - input.focus() - } + input && input.focus() return } this.props.handleSubmit() @@ -45,9 +43,7 @@ componentDidMount () { const input = document.getElementById('username') - if (input) { - input.focus() - } + input && input.focus() } render() { diff --git a/src/menu/actioncomponent/actionform/index.jsx b/src/menu/actioncomponent/actionform/index.jsx index 99a6a01..176e55f 100644 --- a/src/menu/actioncomponent/actionform/index.jsx +++ b/src/menu/actioncomponent/actionform/index.jsx @@ -169,7 +169,7 @@ if (card.focus) { try { let _form = document.getElementById('label') - _form.select() + _form && _form.select() } catch { console.warn('琛ㄥ崟focus澶辫触锛�') } @@ -292,6 +292,10 @@ _fieldval.Ot = 'requiredSgl' } + if (card.$type === 'tableButton') { // 琛ㄦ牸鎸夐挳 + delete _fieldval.Ot + } + this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'pageTemplate') { diff --git a/src/menu/actioncomponent/formconfig.jsx b/src/menu/actioncomponent/formconfig.jsx index 9461434..c339476 100644 --- a/src/menu/actioncomponent/formconfig.jsx +++ b/src/menu/actioncomponent/formconfig.jsx @@ -211,6 +211,7 @@ label: Formdict['header.form.isRequired'], initVal: card.Ot || 'requiredSgl', required: true, + forbid: card.$type === 'tableButton', options: [] }, { diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 9d8b224..7ffc65a 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -363,6 +363,7 @@ let _elements = elements.map(cell => { if (cell.uuid === res.uuid) { res.style = cell.style || {} + res.$type = cell.$type || '' if (res.eleType === 'splitline' && cell.eleType !== 'splitline') { res.style.paddingTop = '5px' res.style.paddingBottom = '5px' diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index ab07f66..73d84ce 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -134,9 +134,6 @@ newcard.eleType = 'text' newcard.datatype = 'dynamic' - newcard.color = 'rgba(0,0,0,0.85)' - newcard.padding = '5px' - newcard.align = 'left' // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 MKEmitter.emit('cardAddElement', [cards.uuid, card.uuid], newcard) diff --git a/src/menu/components/table/normal-table/columncomponent/colspanform/index.jsx b/src/menu/components/table/normal-table/columncomponent/colspanform/index.jsx deleted file mode 100644 index 8474416..0000000 --- a/src/menu/components/table/normal-table/columncomponent/colspanform/index.jsx +++ /dev/null @@ -1,211 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, InputNumber, Select, Radio, Tooltip, Icon } from 'antd' -import { formRule } from '@/utils/option.js' -import TransferForm from '@/templates/zshare/transferform' -import './index.scss' - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - columns: PropTypes.array, - card: PropTypes.any, - inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 - } - - componentDidMount () { - try { - let _form = document.getElementById('label') - if (_form && _form.select) { - _form.select() - } - } catch { - console.warn('琛ㄥ崟focus澶辫触锛�') - } - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - let targetKeys = this.refs['column-transfer'].state.targetKeys - - delete values.type // 鍒犻櫎type锛屾澶勫�间负'鍚堝苟鍒�'鏂囧瓧 - - let subfield = [] // 鐢ㄤ簬鏌ョ湅鍚堝苟鍒楀瓧娈� - this.props.columns.forEach(col => { - if (col.field && targetKeys.includes(col.uuid)) { - subfield.push(col.field) - } - }) - subfield = subfield.join(', ') - - let _card = {...this.props.card, ...values, sublist: targetKeys, subfield: subfield} - - delete _card.focus - - resolve(_card) - } else { - reject(err) - } - }) - }) - } - - handleSubmit = (e) => { - e.preventDefault() - - if (this.props.inputSubmit) { - this.props.inputSubmit() - } - } - - render() { - const { card } = this.props - const { getFieldDecorator } = this.props.form - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - } - } - return ( - <Form {...formItemLayout} className="commontable-cospan-column-form" id="columncolspan"> - <Row gutter={24}> - <Col span={12}> - <Form.Item label={this.props.dict['model.name']}> - {getFieldDecorator('label', { - initialValue: card.label, - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.name'] + '!' - }, - { - max: formRule.input.max, - message: formRule.input.message - } - ] - })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['model.form.type']}> - {getFieldDecorator('type', { - initialValue: this.props.dict['model.form.colspan'], - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.type'] + '!' - } - ] - })(<Input placeholder="" autoComplete="off" disabled={true}/>)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['model.form.align']}> - {getFieldDecorator('Align', { - initialValue: card.Align, - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['model.form.align'] + '!' - } - ] - })( - <Select - getPopupContainer={() => document.getElementById('columncolspan')} - > - <Select.Option value="left">{this.props.dict['model.form.alignLeft']}</Select.Option> - <Select.Option value="right">{this.props.dict['model.form.alignRight']}</Select.Option> - <Select.Option value="center">{this.props.dict['model.form.alignCenter']}</Select.Option> - </Select> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['model.form.columnWidth']}> - {getFieldDecorator('Width', { - initialValue: card.Width, - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + this.props.dict['model.form.columnWidth'] + '!' - } - ] - })(<InputNumber min={1} max={1000} precision={0} />)} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={ - <Tooltip placement="topLeft" title="閫夋嫨鏄剧ず鍒嗙粍锛岃〃鏍间細灞曞紑娣诲姞鍒嗙粍鐨勫瓙鍒楋紝姝ゆ椂鎺掑垪鏂瑰紡浼氬け鏁堛��"> - <Icon type="question-circle" /> - 鏄剧ず鍒嗙粍 - </Tooltip> - }> - {getFieldDecorator('unfold', { - initialValue: card.unfold || 'false' - })( - <Radio.Group> - <Radio value="true">{this.props.dict['model.true']}</Radio> - <Radio value="false">{this.props.dict['model.false']}</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['model.hidden']}> - {getFieldDecorator('Hide', { - initialValue: card.Hide || 'false', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['model.hidden'] + '!' - } - ] - })( - <Radio.Group> - <Radio value="true">{this.props.dict['model.true']}</Radio> - <Radio value="false">{this.props.dict['model.false']}</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label={this.props.dict['header.form.order']}> - {getFieldDecorator('order', { - initialValue: card.order, - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + this.props.dict['header.form.order'] + '!' - } - ] - })( - <Select - getPopupContainer={() => document.getElementById('columncolspan')} - > - <Select.Option value="vertical">{this.props.dict['header.form.vertical']}</Select.Option> - <Select.Option value="horizontal">{this.props.dict['header.form.horizontal']}</Select.Option> - <Select.Option value="vertical2">{this.props.dict['header.form.vertical2']}</Select.Option> - <Select.Option value="topPicBottomText">{this.props.dict['header.form.topPicBottomText']}</Select.Option> - <Select.Option value="leftPicRightText">{this.props.dict['header.form.leftPicRightText']}</Select.Option> - </Select> - )} - </Form.Item> - </Col> - <Col span={24}> - <TransferForm columns={this.props.columns} ref="column-transfer" selected={card.sublist}/> - </Col> - </Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/colspanform/index.scss b/src/menu/components/table/normal-table/columncomponent/colspanform/index.scss deleted file mode 100644 index d39b484..0000000 --- a/src/menu/components/table/normal-table/columncomponent/colspanform/index.scss +++ /dev/null @@ -1,13 +0,0 @@ -.commontable-cospan-column-form { - min-height: 190px; - .ant-form-item { - .ant-input-number { - width: 100%; - } - } - .anticon-question-circle { - color: #c49f47; - position: relative; - left: -3px; - } -} \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/columnform/index.jsx b/src/menu/components/table/normal-table/columncomponent/columnform/index.jsx deleted file mode 100644 index bce73f1..0000000 --- a/src/menu/components/table/normal-table/columncomponent/columnform/index.jsx +++ /dev/null @@ -1,336 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon, Cascader } from 'antd' - -import { formRule } from '@/utils/option.js' -import './index.scss' - -const columnTypeOptions = { - text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'fieldlength', 'blacklist', 'perspective', 'rowspan'], - number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum'], - link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], - textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], - picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'] -} - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - formlist: PropTypes.any, - card: PropTypes.any, - inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 - } - - state = { - formlist: null, - type: '', - menulist: null - } - - UNSAFE_componentWillMount () { - const { card } = this.props - let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' - - let _options = JSON.parse(JSON.stringify(columnTypeOptions[card.type])) - if (card.type === 'text' || card.type === 'number') { - if (card.perspective !== 'linkurl') { - _options.push('linkmenu') - } else { - _options.push('linkurl') - } - } - - this.setState({ - type: card.type, - menulist: _menulist.options || [], - formlist: this.props.formlist.map(item => { - item.hidden = !_options.includes(item.key) - - return item - }) - }) - } - - /** - * @description 鍒濇娣诲姞鐨勬樉绀哄垪鍏冪礌锛岃仛鐒︽彁绀烘枃瀛� - */ - componentDidMount () { - const { card } = this.props - - if (card.focus) { - try { - let _form = document.getElementById('label') - _form.select() - } catch { - console.warn('琛ㄥ崟focus澶辫触锛�') - } - } - } - - typeChange = (key, value) => { - const { card } = this.props - if (key === 'type') { - let _options = JSON.parse(JSON.stringify(columnTypeOptions[value])) - - if (card.type === 'text' || card.type === 'number') { - if (card.perspective !== 'linkurl') { - _options.push('linkmenu') - } else { - _options.push('linkurl') - } - } - - let fieldlength = 50 - - if (value !== 'text') { - fieldlength = 512 - } - - this.setState({ - type: value, - formlist: this.props.formlist.map(item => { - item.hidden = !_options.includes(item.key) - - return item - }) - }, () => { - if (this.props.form.getFieldValue('fieldlength') !== undefined) { - this.props.form.setFieldsValue({fieldlength: fieldlength}) - } - }) - } else if (key === 'format' && value === 'percent') { - this.props.form.setFieldsValue({postfix: '%'}) - } - } - - changeRadio = (key, value) => { - if (key === 'perspective') { - let _options = JSON.parse(JSON.stringify(columnTypeOptions[this.state.type])) - - if (value !== 'linkurl') { - _options.push('linkmenu') - } else { - _options.push('linkurl') - } - - this.setState({ - formlist: this.props.formlist.map(item => { - item.hidden = !_options.includes(item.key) - - return item - }) - }) - } - - } - - handleSubmit = (e) => { - e.preventDefault() - - if (this.props.inputSubmit) { - this.props.inputSubmit() - } - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.state.formlist.forEach((item, index) => { - if (item.hidden) return - - if (item.type === 'text') { // 鏂囨湰鎼滅储 - let rules = [] - if (item.key === 'field' || item.key === 'nameField') { - rules = [{ - pattern: formRule.field.pattern, - message: formRule.field.message - }, { - max: formRule.field.max, - message: formRule.field.maxMessage - }] - } else if (item.key !== 'linkurl') { - rules = [{ - max: formRule.input.max, - message: formRule.input.message - }] - } - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> - <Icon type="question-circle" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - }, - ...rules - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'number') { - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> - <Icon type="question-circle" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(item.unlimit ? <InputNumber /> : - <InputNumber min={item.min} max={item.max} precision={item.decimal} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={(value) => {this.typeChange(item.key, value)}} - getPopupContainer={() => document.getElementById('columnwinter')} - > - {item.options.map((option, index) => - <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}> - {option.text} - </Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'radio') { - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> - <Icon type="question-circle" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Radio.Group onChange={(e) => {this.changeRadio(item.key, e.target.value)}}> - { - item.options.map(option => { - return ( - <Radio key={option.value} value={option.value}>{option.text}</Radio> - ) - }) - } - </Radio.Group> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'multiselect') { // 澶氶�� - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || [] - })( - <Select - showSearch - mode="multiple" - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - > - {item.options.map((option, i) => - <Select.Option id={i} key={i} value={option.value}>{option.text}</Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'cascader') { // 澶氶�� - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || [] - })( - <Cascader - options={this.state.menulist} - placeholder="" - getPopupContainer={() => document.getElementById('columnwinter')} - /> - )} - </Form.Item> - </Col> - ) - } - }) - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - values.uuid = this.props.card.uuid - values.marks = this.props.card.marks || '' - - resolve(values) - } else { - reject(err) - } - }) - }) - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - } - } - return ( - <Form {...formItemLayout} className="commontable-column-form" id="columnwinter"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/columnform/index.scss b/src/menu/components/table/normal-table/columncomponent/columnform/index.scss deleted file mode 100644 index fcf59ac..0000000 --- a/src/menu/components/table/normal-table/columncomponent/columnform/index.scss +++ /dev/null @@ -1,19 +0,0 @@ -.commontable-column-form { - min-height: 190px; - .ant-form-item { - .ant-input-number { - width: 100%; - } - } - .anticon-question-circle { - color: #c49f47; - position: relative; - left: -3px; - } - .ant-cascader-menus { - padding: 5px 0px; - .ant-cascader-menu:last-child { - padding-right: 3px; - } - } -} diff --git a/src/menu/components/table/normal-table/columncomponent/dragcolumn/card.jsx b/src/menu/components/table/normal-table/columncomponent/dragcolumn/card.jsx deleted file mode 100644 index f98d56e..0000000 --- a/src/menu/components/table/normal-table/columncomponent/dragcolumn/card.jsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react' -import { useDrag, useDrop } from 'react-dnd' -import { Icon, Popover } from 'antd' -import './index.scss' - -const Card = ({ id, card, showfield, moveCard, findCard, editCard, delCard, markCard }) => { - const originalIndex = findCard(id).index - const [{ isDragging }, drag] = useDrag({ - item: { type: 'columns', id, originalIndex }, - collect: monitor => ({ - isDragging: monitor.isDragging(), - }), - }) - const [, drop] = useDrop({ - accept: 'columns', - canDrop: () => true, - drop: (item) => { - const { id: draggedId, originalIndex } = item - - if (originalIndex === undefined) { - item.dropTargetId = id - } else if (draggedId && draggedId !== id) { - const { index: overIndex } = findCard(id) - moveCard(draggedId, overIndex) - } - } - }) - - const opacity = isDragging ? 0 : 1 - - return ( - <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ - <div className="mk-popover-control"> - <Icon className="edit" title="edit" type="edit" onClick={() => editCard(id)} /> - <Icon className="close" title="delete" type="close" onClick={() => delCard(id)} /> - {['text', 'number'].includes(card.type) && !card.origin ? <Icon className="profile" title="mark" type="ant-design" onClick={() => markCard(id)} /> : null} - </div> - } trigger="hover"> - <div className="page-card" style={{ flex: card.Width, opacity: opacity}}> - <div ref={node => drag(drop(node))}> - <span className="ant-table-header-column"> - <div className="ant-table-column-sorters" title={card.label} style={{textAlign: card.Align}}> - <span className="ant-table-column-title">{card.label}</span> - {card.IsSort === 'true' ? - <span className="ant-table-column-sorter"> - <Icon type="caret-up" /> - <Icon type="caret-down" /> - </span> : null - } - </div> - {showfield ? - <div className="ant-table-column-fields"> - <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span> - </div> : null - } - </span> - </div> - </div> - </Popover> - ) -} -export default Card diff --git a/src/menu/components/table/normal-table/columncomponent/dragcolumn/index.jsx b/src/menu/components/table/normal-table/columncomponent/dragcolumn/index.jsx deleted file mode 100644 index 1fa8a7c..0000000 --- a/src/menu/components/table/normal-table/columncomponent/dragcolumn/index.jsx +++ /dev/null @@ -1,174 +0,0 @@ -import React, { useState } from 'react' -import { useDrop } from 'react-dnd' -import { is, fromJS } from 'immutable' -import update from 'immutability-helper' -import { Icon, Popover } from 'antd' -import Utils from '@/utils/utils.js' -import Card from './card' -import './index.scss' - -const Container = ({list, setting, gridBtn, showfield, placeholder, handleList, handleMenu, handleGridBtn, deleteMenu, markMenu }) => { - const [cards, setCards] = useState(list) - const moveCard = (id, atIndex) => { - const { card, index } = findCard(id) - const _cards = update(cards, { $splice: [[index, 1], [atIndex, 0, card]] }) - handleList(_cards) - } - - if (!is(fromJS(cards), fromJS(list))) { - setCards(list) - } - - const findCard = id => { - const card = cards.filter(c => `${c.uuid}` === id)[0] - return { - card, - index: cards.indexOf(card), - } - } - - const editCard = id => { - const { card } = findCard(id) - delete card.focus // 鍏煎鏃╂湡鐨勫悎骞跺垪 - - handleMenu(card) - } - - - const delCard = id => { - const { card } = findCard(id) - deleteMenu(card) - } - - const markCard = id => { - const { card } = findCard(id) - markMenu(card) - } - - const [, drop] = useDrop({ - accept: 'columns', - drop(item) { - if (item.hasOwnProperty('originalIndex')) { - return - } - - let newcard = {} - newcard.uuid = Utils.getuuid() - newcard.focus = true - - newcard.Align = 'left' - newcard.label = 'label' - newcard.field = '' - newcard.Hide = 'false' - newcard.contrastType = 'static' - newcard.IsSort = 'true' - newcard.type = item.subType - newcard.Width = 120 - if (item.subType === 'colspan') { - newcard.sublist = [] - newcard.subfield = [] - newcard.IsSort = 'false' - newcard.order = 'vertical' - } - - let targetId = '' - - if (item.dropTargetId) { - targetId = item.dropTargetId - delete item.dropTargetId - } else if (cards.length > 0) { - targetId = cards[cards.length - 1].uuid - } - - const { index: overIndex } = findCard(`${targetId}`) - const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] }) - - handleList(_cards, newcard) - } - }) - - let columns = [] - let _colCards = [] - - // 杩囨护鍚堝苟鍒� - let _hideCol = [] - - if (!showfield) { - cards.forEach(col => { - if (col.type === 'colspan' && col.sublist) { - _hideCol.push(...col.sublist) - } - }) - } - cards.forEach(col => { - if (_hideCol.includes(col.uuid)) return - - _colCards.push(col) - }) - - // 鏄剧ず鍒楀垎琛� - if (_colCards.length > 10) { - let number = Math.ceil(_colCards.length / Math.ceil(_colCards.length / 10)) - for (let i = 0, len = _colCards.length; i < len; i += number) { - columns.push(_colCards.slice(i, i + number)) - } - } else { - columns.push(_colCards) - } - - return ( - <div ref={drop} className="ant-row"> - {columns.map((column, i) => ( - <div key={i} className="column-box"> - {/* 澶氶�� */} - {i === 0 && column.length > 0 && setting.tableType === 'checkbox' ? - <div className="page-card" style={{flex: 60}}> - <span className="ant-checkbox-inner"></span> - </div> : null - } - {/* 鍗曢�� */} - {i === 0 && column.length > 0 && setting.tableType === 'radio' ? - <div className="page-card" style={{flex: 60}}></div> : null - } - {column.map(card => ( - <Card - key={card.uuid} - id={card.uuid} - card={card} - showfield={showfield} - moveCard={moveCard} - editCard={editCard} - delCard={delCard} - markCard={markCard} - findCard={findCard} - /> - ))} - {i === (columns.length - 1) && gridBtn && gridBtn.display ? - <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ - <div className="mk-popover-control"> - <Icon className="edit" type="edit" onClick={handleGridBtn}/> - </div> - } trigger="hover"> - <div className="page-card" style={{flex: gridBtn.Width}}> - <div style={{cursor: 'default'}}> - <span className="ant-table-header-column"> - <div className="ant-table-column-sorters" title={gridBtn.label} style={{textAlign: gridBtn.Align}}> - <span className="ant-table-column-title">{gridBtn.label}</span> - </div> - </span> - </div> - </div> - </Popover> : null - } - </div> - ))} - - {cards.length === 0 ? - <div className="common-drawarea-placeholder"> - {placeholder} - </div> : null - } - </div> - ) -} -export default Container diff --git a/src/menu/components/table/normal-table/columncomponent/dragcolumn/index.scss b/src/menu/components/table/normal-table/columncomponent/dragcolumn/index.scss deleted file mode 100644 index 1bbed5f..0000000 --- a/src/menu/components/table/normal-table/columncomponent/dragcolumn/index.scss +++ /dev/null @@ -1,6 +0,0 @@ -.common-drawarea-placeholder { - width: 100%; - line-height: 65px; - text-align: center; - color: #bcbcbc; -} diff --git a/src/menu/components/table/normal-table/columncomponent/gridbtnform/index.jsx b/src/menu/components/table/normal-table/columncomponent/gridbtnform/index.jsx deleted file mode 100644 index ccbb363..0000000 --- a/src/menu/components/table/normal-table/columncomponent/gridbtnform/index.jsx +++ /dev/null @@ -1,218 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, InputNumber, Radio } from 'antd' -import { formRule } from '@/utils/option.js' -import './index.scss' - -class MainSearch extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - card: PropTypes.any, - inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 - } - - state = { - formlist: [ - { - type: 'text', - key: 'label', - label: this.props.dict['model.name'], - initVal: this.props.card.label, - required: true - }, - { - type: 'select', - key: 'Align', - label: this.props.dict['model.form.align'], - initVal: this.props.card.Align, - required: true, - options: [{ - MenuID: 'left', - text: this.props.dict['model.form.alignLeft'] - }, { - MenuID: 'right', - text: this.props.dict['model.form.alignRight'] - }, { - MenuID: 'center', - text: this.props.dict['model.form.alignCenter'] - }] - }, - { - type: 'number', - key: 'Width', - decimal: 0, - label: this.props.dict['model.form.columnWidth'], - initVal: this.props.card.Width, - required: true - }, - // { - // type: 'select', - // key: 'style', - // label: this.props.dict['model.form.style'], - // initVal: this.props.card.style, - // required: true, - // options: [{ - // MenuID: 'button', - // text: this.props.dict['header.form.button'] - // }, { - // MenuID: 'text', - // text: this.props.dict['model.form.href'] - // }] - // }, - // { - // type: 'select', - // key: 'show', - // label: this.props.dict['header.form.order'], - // initVal: this.props.card.show, - // required: true, - // options: [{ - // MenuID: 'horizontal', - // text: this.props.dict['header.form.horizontal'] - // }, { - // MenuID: 'vertical', - // text: this.props.dict['header.form.vertical'] - // }] - // } - ] - } - - handleSubmit = (e) => { - e.preventDefault() - - if (this.props.inputSubmit) { - this.props.inputSubmit() - } - } - - getFields() { - const { getFieldDecorator } = this.props.form - const fields = [] - this.state.formlist.forEach((item, index) => { - if (item.type === 'text') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - }, - { - max: formRule.input.max, - message: formRule.input.message - } - ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'number') { // 鏂囨湰鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<InputNumber min={1} max={1000} precision={item.decimal} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'select') { // 涓嬫媺鎼滅储 - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal || '', - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - getPopupContainer={() => document.getElementById('gridbtncolumnwinter')} - > - {item.options.map(option => - <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}> - {option.text} - </Select.Option> - )} - </Select> - )} - </Form.Item> - </Col> - ) - } else if (item.type === 'radio') { - fields.push( - <Col span={12} key={index}> - <Form.Item label={item.label}> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.select'] + item.label + '!' - } - ] - })( - <Radio.Group> - { - item.options.map(option => { - return ( - <Radio key={option.MenuID} value={option.MenuID}>{option.text}</Radio> - ) - }) - } - </Radio.Group> - )} - </Form.Item> - </Col> - ) - } - }) - return fields - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - return new Promise((resolve, reject) => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - resolve({...this.props.card, ...values}) - } else { - reject(err) - } - }) - }) - } - - render() { - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 6 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 } - } - } - return ( - <Form {...formItemLayout} className="commontable-gridbtn-column-form" id="gridbtncolumnwinter"> - <Row gutter={24}>{this.getFields()}</Row> - </Form> - ) - } -} - -export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/gridbtnform/index.scss b/src/menu/components/table/normal-table/columncomponent/gridbtnform/index.scss deleted file mode 100644 index abb563c..0000000 --- a/src/menu/components/table/normal-table/columncomponent/gridbtnform/index.scss +++ /dev/null @@ -1,8 +0,0 @@ -.commontable-gridbtn-column-form { - min-height: 190px; - .ant-form-item { - .ant-input-number { - width: 100%; - } - } -} \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/index.jsx b/src/menu/components/table/normal-table/columncomponent/index.jsx deleted file mode 100644 index cd4d1d1..0000000 --- a/src/menu/components/table/normal-table/columncomponent/index.jsx +++ /dev/null @@ -1,507 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { Icon, Modal, notification, Switch, message } from 'antd' - -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' -import { getColumnForm } from '@/templates/zshare/formconfig' - -import ColumnForm from './columnform' -import ColspanForm from './colspanform' -import GridBtnForm from './gridbtnform' -import DragElement from './dragcolumn' -import MarkColumn from './markcolumn' -import './index.scss' - -const { confirm } = Modal - -class ColumnComponent extends Component { - static propTpyes = { - config: PropTypes.object, // 閰嶇疆淇℃伅 - updatecolumn: PropTypes.func // 鏇存柊 - } - - state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - columnlist: null, // 鏄剧ず鍒� - showField: false, // 鏄剧ず鍒楀瓧娈� - modaltype: '', // 妯℃�佹鎺у埗 - card: null // 缂栬緫涓厓绱� - } - - /** - * @description 鏄剧ず鍒楀垵濮嬪寲 - */ - UNSAFE_componentWillMount () { - this.setState({ - columnlist: fromJS(this.props.config.cols).toJS() - }) - } - - /** - * @description 鐩戝惉鍒版樉绀哄垪澶嶅埗鏃讹紝瑙﹀彂鏄剧ず鍒楃紪杈� - */ - UNSAFE_componentWillReceiveProps (nextProps) { - const { config } = this.props - const { columnlist } = this.state - - if (!is(fromJS(nextProps.config.cols), fromJS(config.cols)) && !is(fromJS(nextProps.config.cols), fromJS(columnlist))) { - this.setState({columnlist: fromJS(nextProps.config.cols).toJS()}) - } - } - - /** - * @description 鏄剧ず鍒楅『搴忚皟鏁达紝鎴栨嫋鎷芥坊鍔� - */ - handleList = (list, card) => { - const { config } = this.props - - if (card) { - this.setState({columnlist: list}) - this.handleColumn(card) - } else { - this.setState({columnlist: list}, ()=> { - this.props.updatecolumn({...config, cols: list}) - }) - } - } - - /** - * @description 鏄剧ず鍒椾笌鍚堝苟鍒楃紪杈戯紝鑾峰彇琛ㄥ崟淇℃伅 - */ - handleColumn = (card) => { - if (card.type !== 'colspan') { - let menulist = sessionStorage.getItem('fstMenuList') - if (menulist) { - try { - menulist = JSON.parse(menulist) - } catch { - menulist = [] - } - } else { - menulist = [] - } - - this.setState({ - modaltype: 'cols', - card: card, - formlist: getColumnForm(card, menulist) - }) - } else { - this.setState({ - modaltype: 'colspan', - card: card - }) - } - } - - /** - * @description 璁剧疆鏍囧織 - */ - markElement = (card) => { - this.setState({ - modaltype: 'mark', - card: card - }) - } - - /** - * @description 鎿嶄綔鍒楃紪杈� - */ - handleGridBtn = () => { - this.setState({ - modaltype: 'gridbtn' - }) - } - - /** - * @description 鍙栨秷淇濆瓨锛屽鏋滃厓绱犱负鏂版坊鍏冪礌锛屽垯浠庡簭鍒椾腑鍒犻櫎 - */ - editModalCancel = () => { - const { card } = this.state - - if (card && card.focus) { - let _columnlist = fromJS(this.state.columnlist).toJS() - - _columnlist = _columnlist.filter(item => item.uuid !== card.uuid) - - this.setState({ - card: null, - modaltype: '', - columnlist: _columnlist - }) - } else { - this.setState({ - card: null, - modaltype: '' - }) - } - } - - /** - * @description 鎼滅储淇敼鍚庢彁浜や繚瀛� - * 1銆佸幓闄ょ郴缁熼粯璁ゆ樉绀哄垪 - * 2銆佸瓧娈靛強鎻愮ず鏂囧瓧閲嶅鏍¢獙 - * 3銆佹洿鏂颁笅鎷夎彍鍗曞彲閫夐泦鍚� - * 4銆佷笅鎷夎彍鍗曟暟鎹簮璇硶楠岃瘉 - */ - handleSubmit = () => { - const { config } = this.props - const { modaltype, card } = this.state - - let _columnlist = fromJS(this.state.columnlist).toJS() - - if (modaltype === 'cols' || modaltype === 'colspan') { - this.columnFormRef.handleConfirm().then(res => { - let fieldrepet = false // 瀛楁閲嶅 - let labelrepet = false // 鎻愮ず鏂囧瓧閲嶅 - let rowspanLabel = '' // 宸插瓨鍦ㄧ殑琛屽悎骞跺瓧娈� - - _columnlist = _columnlist.filter(item => !item.origin || item.uuid === res.uuid) // 鍘婚櫎鍒濆鍒� - _columnlist = _columnlist.map(item => { - if (item.uuid !== res.uuid && res.field && item.field) { - if (item.field === res.field) { - fieldrepet = true - } else if (item.label === res.label) { - labelrepet = true - } else if (res.rowspan === 'true' && item.rowspan === 'true') { - rowspanLabel = item.label - } - } - - if (item.uuid === res.uuid) { - return res - } else { - return item - } - }) - - if (fieldrepet) { - notification.warning({ - top: 92, - message: this.state.dict['model.field.exist'] + ' !', - duration: 5 - }) - return - } else if (labelrepet) { - notification.warning({ - top: 92, - message: this.state.dict['model.name.exist'] + ' !', - duration: 5 - }) - return - } else if (rowspanLabel) { - notification.warning({ - top: 92, - message: `宸插瓨鍦ㄨ鍚堝苟瀛楁銆�${rowspanLabel}銆�!`, - duration: 5 - }) - return - } - - if (!card.focus && (card.type !== res.type || (res.field && card.field !== res.field))) { - let refers = [] - _columnlist.forEach(column => { - if (column.marks && column.marks.filter(mark => mark.field === card.field || mark.contrastField === card.field).length > 0) { - refers.push(column.label) - } - if (column.type === 'colspan') { - let _length = column.sublist.length - column.sublist = column.sublist.filter(cell => cell !== card.uuid) - - if (column.sublist.length < _length) { - let subfield = [] // 鍚堝苟鍒楀瓧娈� - _columnlist.forEach(col => { - if (col.field && column.sublist.includes(col.uuid)) { - subfield.push(col.field) - } - }) - column.subfield = subfield.join(', ') - } - } - }) - - if (refers.length > 0) { - notification.warning({ - top: 92, - message: '鏄剧ず鍒椼��' + refers.join('銆�') + '銆嬫爣璁颁腑鍚湁璇ュ瓧娈碉紝姝ゆ淇敼浼氬鑷存爣璁板け鏁堬紝璇蜂慨鏀圭浉搴旂殑鏍囪璁剧疆锛�', - duration: 5 - }) - } - } - - this.setState({ - card: null, - columnlist: _columnlist, - modaltype: '' - }, ()=> { - this.props.updatecolumn({...config, cols: _columnlist}) - }) - }) - } else if (modaltype === 'gridbtn') { - this.gridBtnFormRef.handleConfirm().then(res => { - this.setState({ - modaltype: '' - }) - - this.props.updatecolumn({...config, gridBtn: res}) - }) - } - } - - /** - * @description 鏄剧ず鍒楀垹闄� - */ - deleteElement = (card) => { - const { config } = this.props - const { dict } = this.state - let _this = this - - confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, - onOk() { - let _columnlist = fromJS(_this.state.columnlist).toJS() - - _columnlist = _columnlist.filter(item => item.uuid !== card.uuid) - - if (card.field) { - let refers = [] - _columnlist.forEach(column => { - if (column.marks && column.marks.filter(mark => mark.field === card.field || mark.contrastField === card.field).length > 0) { - refers.push(column.label) - } - if (column.type === 'colspan') { - let _length = column.sublist.length - column.sublist = column.sublist.filter(cell => cell !== card.uuid) - - if (column.sublist.length < _length) { - let subfield = [] // 鍚堝苟鍒楀瓧娈� - _columnlist.forEach(col => { - if (col.field && column.sublist.includes(col.uuid)) { - subfield.push(col.field) - } - }) - column.subfield = subfield.join(', ') - } - } - }) - - if (refers.length > 0) { - notification.warning({ - top: 92, - message: '鏄剧ず鍒椼��' + refers.join('銆�') + '銆嬫爣璁颁腑鍚湁璇ュ瓧娈碉紝鍒犻櫎浼氬鑷存爣璁板け鏁堬紝璇蜂慨鏀圭浉搴旂殑鏍囪璁剧疆锛�', - duration: 5 - }) - } - } - - _this.setState({ - columnlist: _columnlist - }, ()=> { - _this.props.updatecolumn({...config, cols: _columnlist}) - }) - }, - onCancel() {} - }) - } - - /** - * @description 鏄剧ず鍒楀鍒� - */ - copycolumn = () => { - const { columnlist } = this.state - - let oInput = document.createElement('input') - let val = { - copyType: 'columns', - columns: columnlist - } - - oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) - document.body.appendChild(oInput) - oInput.select() - document.execCommand('Copy') - oInput.className = 'oInput' - oInput.style.display = 'none' - - message.success('澶嶅埗鎴愬姛銆�') - - document.body.removeChild(oInput) - } - - /** - * @description 鏄剧ず鍒楀瓧娈靛悕鏄剧ず鎴栭殣钘忔帶鍒� - */ - onFieldChange = () => { - const { showField, columnlist } = this.state - - if (!showField) { - let fields = [] - columnlist.forEach(col => { - if (col.field) { - fields.push(col.field) - } - }) - - fields = fields.join(',') - - let textArea = document.createElement('textarea') - textArea.value = fields - document.body.appendChild(textArea) - textArea.select() - - try { - document.execCommand('copy') - document.body.removeChild(textArea) - } catch (err) { - document.body.removeChild(textArea) - } - } - - this.setState({ - showField: !showField - }) - } - - markSubmit = () => { - const { config } = this.props - const { card } = this.state - let _columnlist = fromJS(this.state.columnlist).toJS() - let _marks = this.refs.markRef.state.marks - - if (_marks.length === 0) { - _marks = '' - } - - _columnlist = _columnlist.map(item => { - if (item.uuid === card.uuid) { - item.marks = _marks - } - - return item - }) - - this.setState({ - card: null, - columnlist: _columnlist, - modaltype: '' - }, ()=> { - this.props.updatecolumn({...config, cols: _columnlist}) - }) - } - - shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) - } - - /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 - */ - componentWillUnmount () { - this.setState = () => { - return - } - } - - render() { - const { config } = this.props - const { modaltype, columnlist, dict, card } = this.state - - return ( - <div className="model-custom-table-column-list"> - {columnlist && columnlist.length > 0 ? - <Icon className="column-copy" title="copy" type="copy" onClick={this.copycolumn} /> : null - } - <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={this.onFieldChange} /> - <DragElement - list={columnlist} - setting={config.setting} - gridBtn={config.gridBtn} - handleList={this.handleList} - handleMenu={this.handleColumn} - deleteMenu={this.deleteElement} - markMenu={this.markElement} - handleGridBtn={this.handleGridBtn} - showfield={this.state.showField} - placeholder={this.state.dict['header.form.column.placeholder']} - /> - {/* 鏄剧ず鍒楃紪杈� */} - <Modal - title={dict['header.modal.column.edit']} - visible={modaltype === 'cols'} - width={800} - maskClosable={false} - onOk={this.handleSubmit} - onCancel={this.editModalCancel} - destroyOnClose - > - <ColumnForm - dict={dict} - card={card} - inputSubmit={this.handleSubmit} - formlist={this.state.formlist} - wrappedComponentRef={(inst) => this.columnFormRef = inst} - /> - </Modal> - {/* 鍚堝苟鍒楃紪杈� */} - <Modal - title={dict['model.form.colspan'] + '-' + dict['model.edit']} - visible={modaltype === 'colspan'} - width={800} - maskClosable={false} - onOk={this.handleSubmit} - onCancel={this.editModalCancel} - destroyOnClose - > - <ColspanForm - dict={dict} - card={card} - inputSubmit={this.handleSubmit} - columns={columnlist} - wrappedComponentRef={(inst) => this.columnFormRef = inst} - /> - </Modal> - {/* 鎿嶄綔鍒楃紪杈� */} - <Modal - title={dict['header.modal.gridbtn.edit']} - visible={modaltype === 'gridbtn'} - width={800} - maskClosable={false} - onOk={this.handleSubmit} - onCancel={this.editModalCancel} - destroyOnClose - > - <GridBtnForm - dict={dict} - inputSubmit={this.handleSubmit} - card={config.gridBtn} - wrappedComponentRef={(inst) => this.gridBtnFormRef = inst} - /> - </Modal> - {/* 鎸夐挳浣跨敤绯荤粺瀛樺偍杩囩▼鏃讹紝楠岃瘉淇℃伅妯℃�佹 */} - <Modal - wrapClassName="model-table-column-mark-modal" - title={'鏍囪璁剧疆'} - visible={modaltype === 'mark'} - width={'75vw'} - maskClosable={false} - style={{minWidth: '900px', maxWidth: '1200px'}} - okText={dict['model.submit']} - onOk={this.markSubmit} - onCancel={() => { this.setState({ modaltype: '' }) }} - destroyOnClose - > - <MarkColumn - ref="markRef" - card={card} - dict={dict} - columns={columnlist} - /> - </Modal> - </div> - ) - } -} - -export default ColumnComponent \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/index.scss b/src/menu/components/table/normal-table/columncomponent/index.scss deleted file mode 100644 index 707fe37..0000000 --- a/src/menu/components/table/normal-table/columncomponent/index.scss +++ /dev/null @@ -1,99 +0,0 @@ -.model-custom-table-column-list { - position: relative; - padding: 0px 0px 50px; - - .ant-switch { - position: absolute; - right: 5px; - top: -25px; - } - .column-copy { - position: absolute; - font-size: 16px; - right: 70px; - top: -22px; - color: #26C281; - cursor: pointer; - } - > .ant-row { - background: #fafafa; - border-radius: 4px; - min-height: 47px; - border: 1px solid #e8e8e8; - .column-box { - display: flex; - overflow: hidden; - text-overflow: ellipsis; - } - .column-box:not(:first-child) { - border-top: 1px solid #e8e8e8; - } - .page-card { - position: relative; - padding: 0px; - min-height: 45px; - > div { - padding: 12px 0px 0px; - cursor: move; - height: 100%; - .ant-table-column-sorters { - padding: 0px 8px 12px; - // white-space: nowrap; - } - .ant-table-column-fields { - padding: 0px 8px 5px; - } - } - .ant-table-column-sorter { - position: relative; - display: inline-block; - width: 24px; - font-size: 12px; - color: #bfbfbf; - .anticon-caret-up { - position: relative; - left: 10px; - top: -3px; - } - .anticon-caret-down { - position: relative; - left: -2px; - top: 3px; - } - } - .ant-checkbox-inner { - margin-top: 14px; - margin-left: calc(50% - 8px); - } - } - .page-card:not(:last-child) { - border-right: 1px solid #e8e8e8; - } - } -} - -.model-table-column-mark-modal { - .ant-modal { - top: 50px; - padding-bottom: 5px; - .ant-modal-body { - max-height: calc(100vh - 190px); - min-height: 350px; - overflow-y: auto; - } - .ant-modal-body::-webkit-scrollbar { - width: 7px; - } - .ant-modal-body::-webkit-scrollbar-thumb { - border-radius: 5px; - box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); - background: rgba(0, 0, 0, 0.13); - } - .ant-modal-body::-webkit-scrollbar-track { - box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); - border-radius: 3px; - border: 1px solid rgba(0, 0, 0, 0.07); - background: rgba(0, 0, 0, 0); - } - } -} \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/markcolumn/index.jsx b/src/menu/components/table/normal-table/columncomponent/markcolumn/index.jsx deleted file mode 100644 index f98be64..0000000 --- a/src/menu/components/table/normal-table/columncomponent/markcolumn/index.jsx +++ /dev/null @@ -1,242 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { fromJS } from 'immutable' -import { Table, Popconfirm, Icon } from 'antd' - -import Utils from '@/utils/utils.js' - -import MarkForm from './markform' -import './index.scss' -import '@/assets/css/table.scss' - -class MarkColumn extends Component { - static propTpyes = { - columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� - card: PropTypes.object, - } - - state = { - marks: null, - columns: null, - markColumns: [ - { - title: '瀛楁', - dataIndex: 'field', - width: '20%', - render: (text, record) => { - let item = this.props.columns.filter(col => col.field === record.field)[0] - if (item) { - return item.label + '锛�' + item.field + '锛�' - } else { - return '' - } - } - }, - { - title: '瀵规瘮绫诲瀷', - dataIndex: 'contrastType', - width: '15%', - render: (text, record) => { - if (record.contrastType === 'static') { - return '闈欐��' - } else { - return '鍔ㄦ��' - } - } - }, - { - title: '瀵规瘮鍊�/瀛楁', - dataIndex: 'contrastValue', - width: '20%', - render: (text, record) => { - if (record.contrastType === 'static') { - return '瀵规瘮鍊�: ' + text - } else { - let item = this.props.columns.filter(col => col.field === record.contrastField)[0] - if (item) { - return '瀛楁: ' + item.label + '锛�' + item.field + '锛�' - } else { - return '' - } - } - } - }, - { - title: '瀵规瘮鏂瑰紡', - dataIndex: 'match', - width: '12%' - }, - { - title: '鏍囪鏁堟灉', - dataIndex: 'signType', - width: '13%', - render: (text, record) => { - let item = this.props.columns.filter(col => col.field === record.field)[0] - if (!item) return '' - - let content = '' - if (item.type === 'text') { - content = '鏂囨湰' - } else { - content = Math.ceil(Math.random() * 100) * 10 - } - - let _outerclass = '' - if (record.signType === 'font') { - _outerclass = 'font ' + record.color[1] - } else if (record.signType === 'background') { - _outerclass = 'background ' + record.color[1] - } else if (record.signType === 'card') { - _outerclass = 'background ' + record.color[1] - content = '鏁堟灉鍦ㄥ崱鐗囦腑鍙' - } else if (record.signType === 'icon') { - if (record.position === 'front') { - content = <div><Icon className={'font ' + record.color[1]} type={record.icon} /> {content} </div> - } else { - content = <div> {content} <Icon className={'font ' + record.color[1]} type={record.icon} /> </div> - } - } - - return <div className={_outerclass}> - <div className="baseboard"></div> - <div className="content"> - {content} - </div> - </div> - } - }, - { - title: '鎿嶄綔', - align: 'center', - dataIndex: 'operation', - render: (text, record) => - ( - <div> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><Icon type="edit" /></span> - <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> - <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> - <Popconfirm - overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} - onConfirm={() => this.handleDelete(record) - }> - <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> - </Popconfirm> - </div> - ) - } - ] - } - - UNSAFE_componentWillMount() { - const { columns, card } = this.props - - this.setState({ - columns: columns.filter(col => col.type === 'text' || col.type === 'number'), - marks: card.marks ? fromJS(card.marks).toJS() : [] - }) - } - - markChange = (values) => { - let _marks = fromJS(this.state.marks).toJS() - - if (values.uuid) { - _marks = _marks.map(item => { - if (item.uuid === values.uuid) { - return values - } else { - return item - } - }) - } else { - values.uuid = Utils.getuuid() - _marks.push(values) - } - - this.setState({ - marks: _marks - }) - } - - handleDelete = (record) => { - const { marks } = this.state - - let _marks = marks.filter(item => item.uuid !== record.uuid) - - this.setState({ marks: _marks }) - } - - handleEdit = (record) => { - this.markForm.edit(record) - - let node = document.getElementById('mark-column-box-modal').parentNode - - if (node && node.scrollTop) { - let inter = Math.ceil(node.scrollTop / 10) - - let timer = setInterval(() => { - if (node.scrollTop - inter > 0) { - node.scrollTop = node.scrollTop - inter - } else { - node.scrollTop = 0 - clearInterval(timer) - } - }, 10) - } - } - - handleUpDown = (record, direction) => { - let _marks = fromJS(this.state.marks).toJS() - let index = 0 - - _marks = _marks.filter((item, i) => { - if (item.uuid === record.uuid) { - index = i - } - - return item.uuid !== record.uuid - }) - if ((index === 0 && direction === 'up') || (index === _marks.length && direction === 'down')) { - return - } - - if (direction === 'up') { - _marks.splice(index - 1, 0, record) - } else { - _marks.splice(index + 1, 0, record) - } - - this.setState({ - marks: _marks - }) - } - - render() { - const { card } = this.props - const { marks, markColumns, columns } = this.state - - return ( - <div id="mark-column-box-modal" className=""> - <MarkForm - dict={this.props.dict} - card={card} - columns={columns} - markChange={this.markChange} - wrappedComponentRef={(inst) => this.markForm = inst} - /> - <Table - bordered - rowKey="uuid" - className="mingke-table" - dataSource={marks} - rowClassName={(record) => record.signType === 'line' ? 'mk-table-line background ' + record.color[1] : ''} - columns={markColumns} - pagination={false} - /> - </div> - ) - } -} - -export default MarkColumn \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/markcolumn/index.scss b/src/menu/components/table/normal-table/columncomponent/markcolumn/index.scss deleted file mode 100644 index 3502583..0000000 --- a/src/menu/components/table/normal-table/columncomponent/markcolumn/index.scss +++ /dev/null @@ -1,67 +0,0 @@ -#mark-column-box-modal { - .ant-form-item-label .anticon-question-circle { - color: #c49f47; - position: relative; - left: -3px; - } - table tr td { - word-wrap: break-word; - word-break: break-word; - } - .ant-input-number { - width: 100%; - } - - .mingke-table .ant-empty { - margin: 20px 8px!important; - } - .mingke-table { - td { - position: relative; - } - } - .errorval { - display: inline-block; - width: 30px; - } - .operation-btn { - display: inline-block; - font-size: 16px; - padding: 0 5px; - cursor: pointer; - } - .ant-tabs-tabpane { - position: relative; - .excel-col-add { - position: absolute; - right: 0; - top: 90px; - } - } - - .ant-table-tbody tr.background td { - background: unset!important; - } - .background { - .baseboard { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - } - .content { - position: relative; - } - } - - .mk-table-line.background { - .baseboard { - background: unset!important; - } - } - - .ant-form-item { - white-space: nowrap; - } -} \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/markcolumn/markform/index.jsx b/src/menu/components/table/normal-table/columncomponent/markcolumn/markform/index.jsx deleted file mode 100644 index 07d195f..0000000 --- a/src/menu/components/table/normal-table/columncomponent/markcolumn/markform/index.jsx +++ /dev/null @@ -1,384 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Form, Row, Col, Select, Button, Input, InputNumber, Radio, Icon, Cascader, Tooltip } from 'antd' - -import { minkeColorSystem, minkeIconSystem } from '@/utils/option.js' -import './index.scss' - -class UniqueForm extends Component { - static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� - card: PropTypes.object, // 瀛楁淇℃伅 - columns: PropTypes.array, // 鍒楀悕闆嗗悎 - markChange: PropTypes.func // 淇敼鍑芥暟 - } - - state = { - editItem: null, // 缂栬緫鍏冪礌 - contrastType: 'static', - originField: this.props.card, - signType: 'background', - selectIcon: '', - options: JSON.parse(JSON.stringify(minkeColorSystem)), - icons: minkeIconSystem.direction - } - - UNSAFE_componentWillMount() { - this.setState({ - options: this.state.options.map(option => { - option.children = option.children.map(cell => { - cell.label = <div className={'background ' + cell.value}>{cell.value}</div> - - return cell - }) - return option - }) - }) - } - - edit = (record) => { - const { columns } = this.props - let item = columns.filter(col => col.field === record.field)[0] - - let _type = 'background ' - if (record.signType === 'icon' || record.signType === 'font') { - _type = 'font ' - } - - this.setState({ - originField: item || '', - editItem: record, - contrastType: record.contrastType || '', - signType: record.signType || '', - selectIcon: record.icon || '', - options: this.state.options.map(option => { - option.children = option.children.map(cell => { - cell.label = <div className={_type + cell.value}>{record.icon ? <Icon type={record.icon} /> : cell.value}</div> - - return cell - }) - return option - }) - }, () => { - let fieldvalue = {} - Object.keys(record).forEach(key => { - if (this.props.form.getFieldValue(key) !== undefined) { - fieldvalue[key] = record[key] - } - }) - - this.props.form.setFieldsValue(fieldvalue) - }) - } - - /** - * @description 瀛楁鍒囨崲 - */ - fieldChange = (value) => { - const { columns } = this.props - let item = columns.filter(col => col.field === value)[0] - - this.setState({ - originField: item - }) - - if (this.state.contrastType !== 'static') { - this.props.form.setFieldsValue({contrastField: ''}) - } else { - this.props.form.setFieldsValue({contrastValue: ''}) - } - } - - /** - * @description 瀵规瘮鍊肩被鍨嬪垏鎹� - */ - changeType = (val) => { - this.setState({ - contrastType: val - }) - } - - /** - * @description 鏍囪绫诲瀷鍒囨崲 - */ - changeSignType = (val) => { - let _type = 'background ' - if (val === 'icon' || val === 'font') { - _type = 'font ' - } - - let newState = { - signType: val, - selectIcon: '' - } - - if (val !== 'icon') { - newState.options = this.state.options.map(option => { - option.children = option.children.map(cell => { - cell.label = <div className={_type + cell.value}>{cell.value}</div> - - return cell - }) - return option - }) - } - - this.setState(newState) - } - - /** - * @description 鍥炬爣绫诲瀷鍒囨崲 - */ - changeIconType = (val) => { - this.setState({ - icons: minkeIconSystem[val], - selectIcon: '' - }) - this.props.form.setFieldsValue({icon: ''}) - } - - /** - * @description 鍒囨崲鍥炬爣 - */ - changeIcon = (val) => { - this.setState({ - selectIcon: val, - options: this.state.options.map(option => { - option.children = option.children.map(cell => { - cell.label = <div className={'font ' + cell.value}><Icon type={val} /></div> - - return cell - }) - return option - }) - }) - } - - handleConfirm = () => { - // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - values.uuid = this.state.editItem ? this.state.editItem.uuid : '' - - this.props.markChange(values) - this.setState({ - editItem: null - }) - } - }) - } - - render() { - const { columns } = this.props - const { originField, contrastType, signType, options, selectIcon, icons } = this.state - const { getFieldDecorator } = this.props.form - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 8 } - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 } - } - } - - let contFields = columns.filter(col => originField.field !== col.field && originField.type === col.type) - - return ( - <Form {...formItemLayout} id="model-mark-form-box" className="mingke-table"> - <Row gutter={24}> - <Col span={6}> - <Form.Item label={'瀛楁'}> - {getFieldDecorator('field', { - initialValue: originField.field, - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + '瀛楁!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={this.fieldChange} - > - {columns.map(item => ( - <Select.Option key={item.uuid} title={item.label + '(' + item.field + ')'} value={item.field}>{item.label + '(' + item.field + ')'}</Select.Option> - ))} - </Select> - )} - </Form.Item> - </Col> - <Col span={6}> - <Form.Item label={'瀵规瘮绫诲瀷'}> - {getFieldDecorator('contrastType', { - initialValue: 'static' - })( - <Radio.Group onChange={(e) => this.changeType(e.target.value)}> - <Radio value="static">闈欐��</Radio> - <Radio value="dynamic">鍔ㄦ��</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> - <Col span={6}> - <Form.Item label={'瀵规瘮鏂瑰紡'}> - {getFieldDecorator('match', { - initialValue: '=', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮鏂瑰紡!' - } - ] - })( - <Select> - <Select.Option value="="> = </Select.Option> - <Select.Option value="!="> != </Select.Option> - {originField.type === 'number' ? <Select.Option value=">"> > </Select.Option> : null} - {originField.type === 'number' ? <Select.Option value="<"> < </Select.Option> : null} - {originField.type === 'text' ? <Select.Option value="like"> like </Select.Option> : null} - </Select> - )} - </Form.Item> - </Col> - {contrastType === 'static' ? <Col span={6}> - <Form.Item label={'瀵规瘮鍊�'}> - {getFieldDecorator('contrastValue', { - initialValue: '', - rules: [ - { - required: true, - message: this.props.dict['form.required.input'] + '瀵规瘮鍊�!' - } - ] - })(originField.type === 'number' ? <InputNumber /> : <Input placeholder="" autoComplete="off" />)} - </Form.Item> - </Col> : null} - {contrastType === 'dynamic' ? <Col span={6}> - <Form.Item label={'瀵规瘮瀛楁'}> - {getFieldDecorator('contrastField', { - initialValue: '', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮瀛楁!' - } - ] - })( - <Select - showSearch - filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} - > - {contFields.map(item => ( - <Select.Option key={item.uuid} title={item.label + '(' + item.field + ')'} value={item.field}>{item.label + '(' + item.field + ')'}</Select.Option> - ))} - </Select> - )} - </Form.Item> - </Col> : null} - <Col span={6}> - <Form.Item label={ - <Tooltip placement="topLeft" title="鍗$墖绫诲瀷锛屽湪鍗$墖鍥捐〃涓捣鏁�"> - <Icon type="question-circle" /> - {'鏍囪'} - </Tooltip> - }> - {getFieldDecorator('signType', { - initialValue: 'background', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + '鏍囪鏂瑰紡!' - } - ] - })( - <Select onChange={this.changeSignType}> - <Select.Option value="font">鍗曞厓鏍硷紙鏂囧瓧锛�</Select.Option> - <Select.Option value="background">鍗曞厓鏍硷紙鑳屾櫙锛�</Select.Option> - <Select.Option value="line">琛�</Select.Option> - <Select.Option value="icon">鍥炬爣</Select.Option> - <Select.Option value="card">鍗$墖</Select.Option> - </Select> - )} - </Form.Item> - </Col> - {signType === 'icon' ? <Col span={6}> - <Form.Item label={'鍥炬爣浣嶇疆'}> - {getFieldDecorator('position', { - initialValue: 'back' - })( - <Radio.Group> - <Radio value="front">鍓�</Radio> - <Radio value="back">鍚�</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> : null} - {signType === 'icon' ? <Col span={6}> - <Form.Item label={'鍥炬爣绫诲瀷'}> - {getFieldDecorator('iconType', { - initialValue: 'direction' - })( - <Select onChange={this.changeIconType}> - <Select.Option value="direction">鏂瑰悜鎬у浘鏍�</Select.Option> - <Select.Option value="hint">鎻愮ず寤鸿鎬у浘鏍�</Select.Option> - <Select.Option value="edit">缂栬緫绫诲浘鏍�</Select.Option> - <Select.Option value="data">鏁版嵁绫诲浘鏍�</Select.Option> - <Select.Option value="trademark">鍝佺墝鍜屾爣璇�</Select.Option> - <Select.Option value="normal">缃戠珯閫氱敤鍥炬爣</Select.Option> - </Select> - )} - </Form.Item> - </Col> : null} - {signType === 'icon' ? <Col span={6}> - <Form.Item label={'鍥炬爣'}> - {getFieldDecorator('icon', { - initialValue: '', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + '鍥炬爣!' - } - ] - })( - <Select onChange={this.changeIcon} getPopupContainer={() => document.getElementById('model-mark-form-box')}> - {icons.map(icon => <Select.Option key={icon} value={icon}><Icon type={icon} /></Select.Option>)} - </Select> - )} - </Form.Item> - </Col> : null} - {(signType === 'icon' && selectIcon) || signType !== 'icon' ? <Col span={6}> - <Form.Item label="棰滆壊"> - {getFieldDecorator('color', { - initialValue: '', - rules: [ - { - required: true, - message: this.props.dict['form.required.select'] + '棰滆壊!' - } - ] - })( - <Cascader - options={options} - placeholder="" - displayRender={(label, selectedOptions) => selectedOptions[0] ? selectedOptions[0].label + (selectedOptions[1] ? ' / ' + selectedOptions[1].value : '') : ''} - getPopupContainer={() => document.getElementById('model-mark-form-box')} - /> - )} - </Form.Item> - </Col> : null} - <Col span={signType === 'icon' ? (!selectIcon ? 24 : 18) : 12} style={{textAlign: 'right', marginBottom: 10}}> - <Button onClick={this.handleConfirm} type="primary" className="mk-green"> - 淇濆瓨 - </Button> - </Col> - </Row> - </Form> - ) - } -} - -export default Form.create()(UniqueForm) \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columncomponent/markcolumn/markform/index.scss b/src/menu/components/table/normal-table/columncomponent/markcolumn/markform/index.scss deleted file mode 100644 index 4b38df3..0000000 --- a/src/menu/components/table/normal-table/columncomponent/markcolumn/markform/index.scss +++ /dev/null @@ -1,7 +0,0 @@ -#model-mark-form-box { - .ant-select-dropdown-menu-item { - .anticon { - font-size: 18px; - } - } -} \ No newline at end of file diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx index 3d816a0..bb35a59 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -20,6 +20,36 @@ roleList = [] } + let options = [{ + value: 'text', + text: Formdict['model.form.text'] + }, { + value: 'number', + text: Formdict['model.form.number'] + }, { + value: 'picture', + text: Formdict['model.form.picture'] + }, { + value: 'link', + text: Formdict['model.form.href'] + }, { + value: 'textarea', + text: Formdict['model.form.textarea'] + }, { + value: 'custom', + text: '鑷畾涔夊垪' + }] + + if (!card.isSub) { + options.push({ + value: 'colspan', + text: '鍚堝苟鍒�' + }, { + value: 'action', + text: '鎿嶄綔' + }) + } + return [ { type: 'text', @@ -34,22 +64,7 @@ label: Formdict['model.form.type'], initVal: card.type, required: true, - options: [{ - value: 'text', - text: Formdict['model.form.text'] - }, { - value: 'number', - text: Formdict['model.form.number'] - }, { - value: 'picture', - text: Formdict['model.form.picture'] - }, { - value: 'link', - text: Formdict['model.form.href'] - }, { - value: 'textarea', - text: Formdict['model.form.textarea'] - }] + options: options }, { type: 'select', @@ -62,11 +77,11 @@ { type: 'number', key: 'Width', - min: 1, + min: 20, max: 1000, decimal: 0, label: Formdict['model.form.columnWidth'], - initVal: card.Width, + initVal: card.Width || 120, required: true }, { @@ -133,7 +148,7 @@ key: 'rowspan', label: '琛屽悎骞�', initVal: card.rowspan || 'false', - tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆傛敞锛氫负闃叉琛ㄦ牸淇℃伅閿欎贡锛岃鍚堝苟鍙兘娣诲姞涓�涓瓧娈点��', + tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆�', required: false, options: [{ value: 'true', @@ -148,7 +163,7 @@ key: 'sum', label: '鏄剧ず鍚堣', initVal: card.sum || 'false', - tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愶紝涓斿綋鍓嶅垪鏈殣钘忔椂鏈夋晥銆�', + tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愭椂鏈夋晥銆�', required: false, options: [{ value: 'true', @@ -169,19 +184,12 @@ required: true }, { - type: 'number', - key: 'fieldlength', - label: Formdict['model.form.field'] + Formdict['model.length'], - initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), - required: true - }, - { type: 'select', key: 'format', label: Formdict['header.form.format'], - initVal: card.format || '', + initVal: card.format || 'none', options: [{ - value: '', + value: 'none', text: Formdict['model.empty'] }, { value: 'thdSeparator', @@ -196,9 +204,9 @@ type: 'select', key: 'textFormat', label: Formdict['header.form.format'], - initVal: card.textFormat || '', + initVal: card.textFormat || 'none', options: [{ - value: '', + value: 'none', text: Formdict['model.empty'] }, { value: 'YYYY-MM-DD', @@ -227,16 +235,17 @@ readonly: false }, { - type: 'number', - key: 'maxHeight', - min: 1, - max: 1000, - decimal: 0, - label: '鏈�澶ч珮搴�', - tooltip: '鍥剧墖鍦ㄨ〃鏍间腑鏄剧ず鐨勬渶澶ч珮搴�', - tooltipClass: 'middle', - initVal: card.maxHeight || 128, - required: true + type: 'select', + key: 'lenWidRadio', + label: '闀垮姣�', + initVal: card.lenWidRadio || '1:1', + required: true, + options: [ + { value: '1:1', text: '1:1' }, + { value: '3:2', text: '3:2' }, + { value: '4:3', text: '4:3' }, + { value: '16:9', text: '16:9' } + ] }, { type: 'radio', diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx index 5ab0873..2c86c2c 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { fromJS } from 'immutable' +import { is, fromJS } from 'immutable' import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon, Cascader, Modal } from 'antd' import { getColumnForm } from './formconfig' @@ -8,20 +8,24 @@ import './index.scss' const columnTypeOptions = { - text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'fieldlength', 'blacklist', 'perspective', 'rowspan'], + text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'blacklist', 'perspective', 'rowspan'], number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum'], - link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], - textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], - picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'] + link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist'], + textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], + picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio'], + colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], + custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], + action: ['label', 'type', 'Align', 'Width'] } class MainSearch extends Component { static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� + visible: PropTypes.bool, column: PropTypes.object, fields: PropTypes.array, - updateCol: PropTypes.func, // 鎻愪氦浜嬩欢 - deleteCol: PropTypes.func // 鍙栨秷鏃跺垹闄や簨浠� + submitCol: PropTypes.func, // 鎻愪氦浜嬩欢 + cancelCol: PropTypes.func // 鍙栨秷鏃跺垹闄や簨浠� } state = { @@ -29,16 +33,13 @@ formlist: null } - /** - * @description 鍒濇娣诲姞鐨勬樉绀哄垪鍏冪礌锛岃仛鐒︽彁绀烘枃瀛� - */ - componentDidMount () { - if (this.props.column.focus) { - this.editColumn() + UNSAFE_componentWillReceiveProps (nextProps) { + if (nextProps.column && !is(fromJS(this.props.column), fromJS(nextProps.column))) { + this.editColumn(nextProps.column) } } - editColumn = () => { + editColumn = (column) => { let menulist = sessionStorage.getItem('fstMenuList') if (menulist) { try { @@ -50,14 +51,29 @@ menulist = [] } + let formlist = getColumnForm(column, menulist, this.props.fields) + let _options = fromJS(columnTypeOptions[column.type]).toJS() + if (column.type === 'text' || column.type === 'number') { + if (column.perspective !== 'linkurl') { + _options.push('linkmenu') + } else { + _options.push('linkurl') + } + } + this.setState({ visible: true, - formlist: getColumnForm(this.props.column, menulist, this.props.fields) + type: column.type, + formlist: formlist.map(item => { + item.hidden = !_options.includes(item.key) + + return item + }) }, () => { - if (this.props.column.focus) { + if (column.focus) { try { let _form = document.getElementById('label') - _form.select() + _form && _form.select() } catch { console.warn('琛ㄥ崟focus澶辫触锛�') } @@ -73,12 +89,6 @@ _options.push('linkmenu') } - let fieldlength = 50 - - if (value !== 'text') { - fieldlength = 512 - } - this.setState({ type: value, formlist: this.state.formlist.map(item => { @@ -87,10 +97,12 @@ return item }) }, () => { - if (this.props.form.getFieldValue('fieldlength') !== undefined) { - this.props.form.setFieldsValue({fieldlength: fieldlength}) - } else if (this.props.form.getFieldValue('perspective') !== undefined) { + if (value === 'link' || value === 'textarea' || value === 'picture') { + this.props.form.setFieldsValue({IsSort: 'false'}) + } else if (value === 'text' || value === 'number') { this.props.form.setFieldsValue({perspective: 'linkmenu'}) + } else if (value === 'action' || value === 'colspan') { + this.props.form.setFieldsValue({Align: 'center'}) } }) } else if (key === 'field') { @@ -176,8 +188,8 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(item.unlimit ? <InputNumber /> : - <InputNumber min={item.min} max={item.max} precision={item.decimal} />)} + })(item.unlimit ? <InputNumber onPressEnter={this.handleSubmit}/> : + <InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.handleSubmit}/>)} </Form.Item> </Col> ) @@ -201,7 +213,7 @@ getPopupContainer={() => document.getElementById('columnwinter')} > {item.options.map((option, index) => - <Select.Option key={index} value={option.value || option.field}> + <Select.Option key={`${index}`} value={option.value || option.field}> {option.text || option.label} </Select.Option> )} @@ -287,7 +299,7 @@ this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { this.setState({visible: false, formlist: null}) - this.props.updateCol(values) + this.props.submitCol(values) } }) } @@ -295,9 +307,7 @@ editModalCancel = () => { this.setState({visible: false, formlist: null}) - if (this.props.column.focus) { - this.props.deleteCol() - } + this.props.cancelCol() } render() { @@ -312,9 +322,9 @@ sm: { span: 18 } } } + return ( <div style={{display: 'inline-block'}}> - <Icon className="edit" title="缂栬緫" type="edit" onClick={this.editColumn} /> <Modal title="鏄剧ず鍒楃紪杈�" visible={visible} diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index 8a5d67c..afcd6ac 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -2,56 +2,80 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { DndProvider, DragSource, DropTarget } from 'react-dnd' -import { Table, Form, Popover, Icon } from 'antd' +import { Table, Form, Popover, Icon, Modal } from 'antd' +import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' +import MKEmitter from '@/utils/events.js' import './index.scss' +const { confirm } = Modal const coldict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS const EditColumn = asyncIconComponent(() => import('./editColumn')) +const CardCellComponent = asyncComponent(() => import('@/menu/components/card/cardcellcomponent')) class HeaderCol extends Component { - updateCol = (values) => { - const { column } = this.props - this.props.updateCol({...column, ...values}) + deleteCol = () => { + const _this = this + + confirm({ + content: '纭畾鍒犻櫎鏄剧ず鍒楀悧锛�', + onOk() { + _this.props.deleteCol(_this.props.column) + }, + onCancel() {} + }) } - deleteCol = () => { - this.props.deleteCol(this.props.column) + shouldComponentUpdate (nextProps, nextState) { + + if (!nextProps.column) return false + + return !is(fromJS(this.props.column), fromJS(nextProps.column)) || + !is(fromJS(this.props.fields), fromJS(nextProps.fields)) || + this.props.index !== nextProps.index } render() { - const { connectDragSource, connectDropTarget, moveCol, updateCol, deleteCol, index, column, fields, children, ...restProps } = this.props + const { connectDragSource, connectDropTarget, moveCol, addElement, editColumn, deleteCol, index, column, align, fields, children, ...restProps } = this.props if (index !== undefined) { return connectDragSource( - connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move' }}> + connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <EditColumn column={column} dict={coldict} fields={fields} updateCol={this.updateCol} deleteCol={this.deleteCol}/> - <Icon className="close" title="delete" type="delete" onClick={this.deleteCol} /> + {column && (column.type === 'custom' || column.type === 'colspan' || column.type === 'action') ? + <Icon className="plus" title="娣诲姞" type="plus" onClick={() => this.props.addElement(column)} /> : null + } + <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.props.editColumn(column)} /> + <Icon className="close" title="鍒犻櫎" type="delete" onClick={this.deleteCol} /> </div> } trigger="hover"> {children} </Popover> </th>), ) - } else { + } else if (column) { return ( <th {...restProps}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <EditColumn column={column} dict={coldict} fields={fields} updateCol={this.updateCol} deleteCol={this.deleteCol}/> - <Icon className="close" title="delete" type="delete" onClick={this.deleteCol} /> + {column && column.type === 'custom' ? + <Icon className="plus" title="娣诲姞" type="plus" onClick={() => this.props.addElement(column)} /> : null + } + <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.props.editColumn(column)} /> + <Icon className="close" title="鍒犻櫎" type="delete" onClick={this.deleteCol} /> </div> } trigger="hover"> {children} </Popover> </th> ) + } else { + return (<th {...restProps}>{children}</th>) } } } @@ -87,18 +111,45 @@ ) class EditableCell extends Component { - render() { - const { column, children, style } = this.props + updateCard = (vals) => { + const { column } = this.props + this.props.upComponent({...column, elements: vals}) + } - if (column) { + shouldComponentUpdate (nextProps, nextState) { + const { config, column } = this.props + + if (!nextProps.column) return true + + return !is(fromJS(column), fromJS(nextProps.column)) || + !is(fromJS(config.columns), fromJS(nextProps.config.columns)) || + !is(fromJS(config.search), fromJS(nextProps.config.search)) + } + + render() { + const { column, config, children, className, style } = this.props + + if (column && column.type === 'custom') { return ( - <td style={style}> + <td style={{padding: 0, verticalAlign: 'top', minWidth: column.Width || 100}} className={className}> + <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> + </td> + ) + } else if (column && column.type === 'action') { + return ( + <td style={{padding: '0 5px', textAlign: column.Align, minWidth: column.Width || 100}} className={className}> + <CardCellComponent cards={config} cardCell={column} elements={column.elements} updateElement={this.updateCard}/> + </td> + ) + } else if (column) { + return ( + <td style={{...style, minWidth: column.Width || 100}} className={className}> {column.field} </td> ) } else { return ( - <td style={style}> + <td style={style} className={className}> {children} </td> ) @@ -108,10 +159,8 @@ class EditTable extends Component { static propTpyes = { - actions: PropTypes.any, // 鎿嶄綔椤� - data: PropTypes.any, // 鏁版嵁鍒楄〃 - columns: PropTypes.array, // 鏄剧ず鍒� - onChange: PropTypes.func // 鏁版嵁鍙樺寲 + config: PropTypes.object, // 閰嶇疆淇℃伅 + updatecolumn: PropTypes.func // 鏁版嵁鍙樺寲 } state = { @@ -121,21 +170,32 @@ } UNSAFE_componentWillMount () { + const { config } = this.props + this.setState({ - columns: fromJS(this.props.config.cols).toJS(), - fields: fromJS(this.props.config.columns).toJS() + columns: fromJS(config.cols).toJS(), + fields: fromJS(config.columns).toJS() }) } UNSAFE_componentWillReceiveProps (nextProps) { if (!is(fromJS(this.state.columns), fromJS(nextProps.config.cols))) { - this.setState({columns: fromJS(nextProps.config.cols).toJS()}) + let _columns = fromJS(nextProps.config.cols).toJS() + this.setState({columns: _columns}) + if (_columns[_columns.length - 1] && _columns[_columns.length - 1].focus) { + this.editColumn(_columns[_columns.length - 1]) + } } else if (!is(fromJS(this.state.fields), fromJS(nextProps.config.columns))) { this.setState({fields: fromJS(nextProps.config.columns).toJS()}) } } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.state), fromJS(nextState)) + const { config } = this.props + + return !is(fromJS(this.state), fromJS(nextState)) || + !is(fromJS(config.wrap), fromJS(nextProps.config.wrap)) || + !is(fromJS(config.search), fromJS(nextProps.config.search)) || + config.setting.laypage !== nextProps.config.setting.laypage } moveCol = (dragIndex, hoverIndex) => { @@ -146,20 +206,139 @@ this.setState({ columns: _columns }, () => { - // this.props.onChange(_data) + this.props.updatecolumn({...this.props.config, cols: _columns}) }) } updateCol = (col) => { + let _columns = fromJS(this.state.columns).toJS() + if (col.isSub) { + _columns = _columns.map(column => { + if (column.type === 'colspan') { + column.subcols = column.subcols.map(item => { + if (item.uuid === col.uuid) { + return col + } + return item + }) + } + return column + }) + } else { + _columns = _columns.map(column => { + if (column.uuid === col.uuid) { + return col + } + return column + }) + } + + this.setState({ + columns: _columns, + }, () => { + this.props.updatecolumn({...this.props.config, cols: _columns}) + }) + } + + editColumn = (col) => { + this.setState({ + card: fromJS(col).toJS() + }) + } + + addElement = (col) => { + const { config } = this.props + let column = fromJS(col).toJS() + + if (column.type === 'colspan') { + column.subcols = column.subcols || [] + let subcol = { isSub: true, focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' } + column.subcols.push(subcol) + + this.setState({ + card: subcol + }) + this.updateCol(column) + } else if (column.type === 'custom') { + let newcard = {uuid: Utils.getuuid(), focus: true, eleType: 'text', datatype: 'dynamic'} + + // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 + MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) + } else if (column.type === 'action') { + let newcard = { + uuid: Utils.getuuid(), + focus: true, + eleType: 'button', + label: 'button', + OpenType: 'prompt', + class: 'primary', + intertype: 'system', + execSuccess: 'grid', + execError: 'never', + show: 'link', + $type: 'tableButton' + } + + // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 + MKEmitter.emit('cardAddElement', [config.uuid, column.uuid], newcard) + } + } + + submitCol = (col) => { + const { card } = this.state + + col.uuid = card.uuid + col.isSub = card.isSub === true + col.marks = card.marks || [] + + if (col.type === 'colspan') { + col.subcols = card.subcols || [] + } else if (col.type === 'custom') { + col.elements = card.type === 'custom' ? (card.elements || []) : [] + } else if (col.type === 'action') { + col.elements = card.type === 'action' ? (card.elements || []) : [] + } + + this.setState({card: null}) + this.updateCol(col) + } + + cancelCol = () => { + const { card } = this.state + + if (card.focus) { + this.deleteCol(card) + } + + this.setState({card: null}) } deleteCol = (col) => { + let _columns = fromJS(this.state.columns).toJS() + if (col.isSub) { + _columns = _columns.map(column => { + if (column.type !== 'colspan') return column + if (column.subcols && column.subcols.length > 0) { + column.subcols = column.subcols.filter(item => item.uuid !== col.uuid) + } + return column + }) + } else { + _columns = _columns.filter(column => column.uuid !== col.uuid) + } + + this.setState({ + columns: _columns + }, () => { + this.props.updatecolumn({...this.props.config, cols: _columns}) + }) } render() { - const { fields } = this.state + const { config } = this.props + const { fields, card } = this.state const components = { header: { cell: DragableHeaderCol @@ -173,48 +352,53 @@ return { title: col.label, dataIndex: col.field, - align: 'right', + align: col.Align, sorter: col.IsSort === 'true', onCell: () => ({ column: col, - fields: fields + width: col.Width, + config: config, + upComponent: this.updateCol }), children: col.subcols && col.subcols.length > 0 ? col.subcols.map(cell => ({ - align: 'left', + align: col.Align, title: cell.label, key: cell.uuid, onCell: () => ({ column: cell, - fields: fields + width: cell.Width, + config: config, + upComponent: this.updateCol }), onHeaderCell: () => ({ column: cell, - fields: fields, - updateCol: this.updateCol, + align: cell.Align, + addElement: this.addElement, + editColumn: this.editColumn, deleteCol: this.deleteCol, }) })) : null, onHeaderCell: () => ({ index, column: col, - fields: fields, + align: col.Align, moveCol: this.moveCol, - updateCol: this.updateCol, + addElement: this.addElement, + editColumn: this.editColumn, deleteCol: this.deleteCol, }) } }) return ( - <div className="normal-table-columns"> + <div className={`normal-table-columns ${config.setting.laypage} ${config.wrap.tableType}`}> <DndProvider> <Table - bordered rowKey="uuid" - // bordered={false} + bordered={config.wrap.border !== 'false'} components={components} dataSource={this.state.data} - rowSelection={{type: 'radio'}} + rowSelection={config.wrap.tableType ? { type: 'radio' } : null} columns={columns} rowClassName="editable-row" pagination={{ @@ -225,12 +409,9 @@ total: 58, showTotal: (total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉 }} - // onRow={(record, index) => ({ - // index, - // moveRow: this.moveRow, - // })} /> </DndProvider> + <EditColumn column={card} dict={coldict} fields={fields} submitCol={this.submitCol} cancelCol={this.cancelCol}/> </div> ) } diff --git a/src/menu/components/table/normal-table/columns/index.scss b/src/menu/components/table/normal-table/columns/index.scss index dc02829..c3f5d58 100644 --- a/src/menu/components/table/normal-table/columns/index.scss +++ b/src/menu/components/table/normal-table/columns/index.scss @@ -1,7 +1,7 @@ .normal-table-columns { .ant-table-body { overflow-x: auto; - padding-bottom: 10px; + padding-bottom: 20px; } .ant-table-thead { th { @@ -15,6 +15,26 @@ content: ''; } } + > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner { + .ant-table-column-sorter-up.on, .ant-table-column-sorter-down.on { + color: unset; + } + } } } - +.normal-table-columns.false { + .ant-pagination { + display: none; + } +} +.normal-table-columns.checkbox { + .ant-radio-inner { + border-radius: 0; + } + .ant-radio-inner::after { + border-radius: 0; + } + .ant-radio-checked::after { + border-radius: 0; + } +} diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 8388216..d3831f8 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -18,8 +18,7 @@ const SearchComponent = asyncComponent(() => import('@/templates/sharecomponent/searchcomponent')) const ActionComponent = asyncComponent(() => import('@/menu/actioncomponent')) const ColumnComponent = asyncComponent(() => import('./columns')) -// const WrapComponent = asyncIconComponent(() => import('../data-card/wrapsetting')) -// const SearchComponent = asyncComponent(() => import('@/menu/searchcomponent')) +const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) const { confirm } = Modal @@ -64,32 +63,13 @@ name: card.name, subtype: card.subtype, setting: { interType: 'system' }, - wrap: { name: card.name, width: 24 }, + wrap: { name: card.name, width: 24, border: 'true', tableType: 'checkbox' }, style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, - headerStyle: { fontSize: '16px' }, columns: [], cols: [ - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: 'field1', Hide: 'false', type: 'text', Width: 120, subcols: [ - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label11', field: 'field11', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label12', field: 'field12', Hide: 'false', type: 'text', Width: 120 }, - ] }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: 'field2', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: 'field3', Hide: 'false', type: 'text', Width: 120, subcols: [ - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label31', field: 'field31', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label32', field: 'field32', Hide: 'false', type: 'text', Width: 120 }, - ] }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label4', field: 'field4', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label5', field: 'field5', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label6', field: 'field6', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label7', field: 'field7', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label8', field: 'field8', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label9', field: 'field9', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label10', field: 'field10', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label11', field: 'field11', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label12', field: 'field12', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label13', field: 'field13', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label14', field: 'field14', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label15', field: 'field15', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 } + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 }, + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, ], scripts: [] } @@ -161,12 +141,6 @@ MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) } - changeTitleStyle = () => { - const { card } = this.state - - MKEmitter.emit('changeStyle', [card.uuid, 'header'], ['font', 'border'], card.headerStyle) - } - getStyle = (comIds, style) => { const { card } = this.state @@ -175,8 +149,6 @@ let _card = {} if (comIds.length === 1) { _card = {...card, style} - } else if (comIds.length === 2 && comIds[1] === 'header') { - _card = {...card, headerStyle: style} } else { return } @@ -204,18 +176,18 @@ this.props.updateConfig(card) } + addColumns = () => { + let card = fromJS(this.state.card).toJS() + + card.cols.push({ focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' }) + + this.setState({card}) + } + addSearch = () => { let card = fromJS(this.state.card).toJS() - let newcard = {} - newcard.uuid = Utils.getuuid() - newcard.focus = true - - newcard.label = 'label' - newcard.type = 'text' - newcard.match = '=' - - card.search.push(newcard) + card.search.push({uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}) this.setState({card}) } @@ -261,9 +233,6 @@ setSubConfig = (btn) => { } - updateaction = (config) => { - - } render() { const { menu } = this.props @@ -273,9 +242,10 @@ <div className="menu-normal-table-edit-box" style={{...card.style, height: card.wrap.height}}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> + <Icon className="plus" title="娣诲姞鍒�" onClick={this.addColumns} type="plus" /> {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" /> : null} {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> : null} - {/* {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} */} + {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <Icon className="close" title="鍒犻櫎缁勪欢" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> <SettingComponent config={card} updateConfig={this.updateComponent} /> @@ -287,6 +257,7 @@ <ActionComponent type="normaltable" config={card} + setSubConfig={this.setSubConfig} updateaction={this.updateComponent} /> <ColumnComponent config={card} updatecolumn={this.updateconfig}/> diff --git a/src/menu/components/table/normal-table/index.scss b/src/menu/components/table/normal-table/index.scss index cdbcbe6..dd6694d 100644 --- a/src/menu/components/table/normal-table/index.scss +++ b/src/menu/components/table/normal-table/index.scss @@ -48,6 +48,10 @@ margin-right: 10px; } } + + .ant-btn.mk-link { + padding: 0; + } } .menu-normal-table-edit-box::after { display: block; diff --git a/src/menu/components/table/normal-table/wrapsetting/index.jsx b/src/menu/components/table/normal-table/wrapsetting/index.jsx new file mode 100644 index 0000000..be4a8c4 --- /dev/null +++ b/src/menu/components/table/normal-table/wrapsetting/index.jsx @@ -0,0 +1,85 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Icon, Modal } from 'antd' + +import zhCN from '@/locales/zh-CN/model.js' +import enUS from '@/locales/en-US/model.js' +import SettingForm from './settingform' +import './index.scss' + +class DataSource extends Component { + static propTpyes = { + config: PropTypes.any, + MenuType: PropTypes.any, + updateConfig: PropTypes.func + } + + state = { + dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + visible: false, + wrap: null + } + + UNSAFE_componentWillMount () { + const { config } = this.props + + this.setState({wrap: fromJS(config.wrap).toJS()}) + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) + } + + editDataSource = () => { + this.setState({ + visible: true + }) + } + + verifySubmit = () => { + const { config } = this.props + + this.verifyRef.handleConfirm().then(res => { + + this.setState({ + wrap: res, + visible: false + }) + this.props.updateConfig({...config, wrap: res}) + }) + } + + render () { + const { config, MenuType } = this.props + const { visible, dict, wrap } = this.state + + return ( + <div className="model-menu-setting-wrap"> + <Icon type="edit" onClick={() => this.editDataSource()} /> + <Modal + wrapClassName="popview-modal" + title="琛ㄦ牸璁剧疆" + visible={visible} + width={700} + maskClosable={false} + okText={dict['model.submit']} + onOk={this.verifySubmit} + onCancel={() => { this.setState({ visible: false }) }} + destroyOnClose + > + <SettingForm + dict={dict} + wrap={wrap} + config={config} + MenuType={MenuType} + inputSubmit={this.verifySubmit} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + </Modal> + </div> + ) + } +} + +export default DataSource \ No newline at end of file diff --git a/src/menu/components/table/normal-table/wrapsetting/index.scss b/src/menu/components/table/normal-table/wrapsetting/index.scss new file mode 100644 index 0000000..04372e6 --- /dev/null +++ b/src/menu/components/table/normal-table/wrapsetting/index.scss @@ -0,0 +1,7 @@ +.model-menu-setting-wrap { + display: inline-block; + + >.anticon-edit { + color: #1890ff; + } +} \ No newline at end of file diff --git a/src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx b/src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx new file mode 100644 index 0000000..3ed64be --- /dev/null +++ b/src/menu/components/table/normal-table/wrapsetting/settingform/index.jsx @@ -0,0 +1,161 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { Form, Row, Col, Input, Radio, Tooltip, Icon, InputNumber, Select } from 'antd' + +import './index.scss' + +class SettingForm extends Component { + static propTpyes = { + MenuType: PropTypes.any, // 鑿滃崟绫诲瀷 + dict: PropTypes.object, // 瀛楀吀椤� + config: PropTypes.object, // 鍗$墖琛屼俊鎭� + wrap: PropTypes.object, // 鏁版嵁婧愰厤缃� + inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 + } + + state = { + roleList: [] + } + + UNSAFE_componentWillMount () { + let roleList = sessionStorage.getItem('sysRoles') + if (roleList) { + try { + roleList = JSON.parse(roleList) + } catch { + roleList = [] + } + } else { + roleList = [] + } + + this.setState({roleList}) + } + + handleConfirm = () => { + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� + return new Promise((resolve, reject) => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + resolve(values) + } else { + reject(err) + } + }) + }) + } + + handleSubmit = (e) => { + e.preventDefault() + + if (this.props.inputSubmit) { + this.props.inputSubmit() + } + } + + render() { + const { wrap, MenuType } = this.props + const { getFieldDecorator } = this.props.form + const { roleList } = this.state + + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + } + } + + return ( + <div className="model-menu-setting-form"> + <Form {...formItemLayout}> + <Row gutter={24}> + <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�"> + <Icon type="question-circle" /> + 缁勪欢鍚嶇О + </Tooltip> + }> + {getFieldDecorator('name', { + initialValue: wrap.name, + rules: [ + { + required: true, + message: this.props.dict['form.required.input'] + '缁勪欢鍚嶇О!' + } + ] + })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��"> + <Icon type="question-circle" /> + 瀹藉害 + </Tooltip> + }> + {getFieldDecorator('width', { + initialValue: wrap.width || 24, + rules: [ + { + required: true, + message: this.props.dict['form.required.input'] + '瀹藉害!' + } + ] + })(<InputNumber min={1} max={24} precision={0} onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="琛ㄦ牸灞炴��"> + {getFieldDecorator('tableType', { + initialValue: wrap.tableType + })( + <Radio.Group style={{whiteSpace: 'nowrap'}}> + <Radio key="" value=""> 涓嶅彲閫� </Radio> + <Radio key="radio" value={'radio'}> 鍗曢�� </Radio> + <Radio key="checkbox" value={'checkbox'}> 澶氶�� </Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="杈规"> + {getFieldDecorator('border', { + initialValue: wrap.border || 'true' + })( + <Radio.Group style={{whiteSpace: 'nowrap'}}> + <Radio key="true" value={'true'}> 鏈� </Radio> + <Radio key="false" value={'false'}> 鏃� </Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + {MenuType !== 'billPrint' ? <Col span={12}> + <Form.Item label="榛戝悕鍗�"> + {getFieldDecorator('blacklist', { + initialValue: wrap.blacklist || [] + })( + <Select + showSearch + mode="multiple" + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + > + {roleList.map(option => + <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> : null} + </Row> + </Form> + </div> + ) + } +} + +export default Form.create()(SettingForm) \ No newline at end of file diff --git a/src/menu/components/table/normal-table/wrapsetting/settingform/index.scss b/src/menu/components/table/normal-table/wrapsetting/settingform/index.scss new file mode 100644 index 0000000..159130b --- /dev/null +++ b/src/menu/components/table/normal-table/wrapsetting/settingform/index.scss @@ -0,0 +1,11 @@ +.model-menu-setting-form { + position: relative; + + .anticon-question-circle { + color: #c49f47; + margin-right: 3px; + } + .ant-input-number { + width: 100%; + } +} \ No newline at end of file diff --git a/src/menu/modelsource/option.jsx b/src/menu/modelsource/option.jsx index 4bd287c..d6bf059 100644 --- a/src/menu/modelsource/option.jsx +++ b/src/menu/modelsource/option.jsx @@ -8,7 +8,7 @@ import card1 from '@/assets/mobimg/card1.png' import card2 from '@/assets/mobimg/card2.png' import TableCard from '@/assets/mobimg/table-card.png' -// import NormalTable from '@/assets/mobimg/normal-table.png' +import NormalTable from '@/assets/mobimg/normal-table.png' import Pie from '@/assets/mobimg/pie.png' import Pie1 from '@/assets/mobimg/ring.png' import Pie2 from '@/assets/mobimg/nightingale.png' @@ -22,7 +22,7 @@ { type: 'menu', url: Mainsearch, component: 'search', subtype: 'mainsearch', title: '鎼滅储鏉′欢', width: 24, forbid: ['billPrint'] }, { type: 'menu', url: card1, component: 'card', subtype: 'datacard', title: '鏁版嵁鍗�', config: `[{"uuid":"160135809128212dm7i29fim9ksto9od","setting":{"width":6},"style":{"paddingTop":"15px","marginTop":"4px","paddingRight":"15px","marginRight":"8px","marginLeft":"8px","backgroundColor":"rgba(255, 255, 255, 1)","borderColor":"#e8e8e8","paddingLeft":"15px","marginBottom":"4px","borderWidth":"1px","paddingBottom":"10px"},"backStyle":{},"elements":[{"datatype":"static","width":12,"marks":null,"height":1,"value":"鍏冲崟","style":{},"prefix":"","postfix":"","format":"","eleType":"text","uuid":"160231860159931untbea62sgokunc5s"},{"datatype":"static","width":12,"marks":null,"style":{"color":"rgba(250, 219, 20, 1)","textAlign":"right"},"btnstyle":{},"eleType":"icon","icon":"question-circle","field":"","uuid":"1602318768361nv8ql4t47sgcsn88b0u"},{"datatype":"static","width":24,"marks":null,"height":1,"innerHeight":36,"value":"100","style":{"fontSize":"24px","fontWeight":"500","color":"rgba(0, 0, 0, 1)"},"prefix":"","btnstyle":{},"postfix":"","format":"","eleType":"text","uuid":"1602318817884v70gtgb65ubnm8mbcvv"},{"color":"#1890ff","width":24,"marks":null,"maxValue":100,"style":{"color":"rgba(250, 140, 22, 1)","paddingTop":"20px","paddingBottom":"10px"},"btnstyle":{},"eleType":"slider","field":"int1","uuid":"16023188871233rkktuvpp1h077igrsu"},{"eleType":"splitline","width":24,"color":"#e8e8e8","uuid":"1602320017038n31bk9o831ggug0tu0b","marks":null,"style":{"marginTop":"10px","marginBottom":"10px"},"btnstyle":{}},{"datatype":"static","width":12,"marks":null,"height":1,"value":"100","style":{"marginTop":"6px"},"prefix":"鍏冲崟","btnstyle":{},"postfix":"","format":"","eleType":"text","uuid":"1602320061243drd7lf3agvn04kgr175"}],"backElements":[]}]` }, { type: 'menu', url: card2, component: 'card', subtype: 'propcard', title: '灞炴�у崱', config: `[{"uuid":"1603681387259qaqf1127f72esmtchge","setting":{"width":6,"type":"simple"},"style":{"paddingTop":"15px","marginTop":"8px","paddingRight":"15px","marginRight":"8px","marginLeft":"8px","borderColor":"#e8e8e8","paddingLeft":"15px","marginBottom":"8px","borderWidth":"1px","paddingBottom":"15px"},"backStyle":{},"elements":[{"datatype":"static","width":12,"marks":null,"height":1,"value":"瓒呮椂宸ュ崟","style":{"color":"rgba(67, 67, 67, 0.51)"},"prefix":"","postfix":"","format":"","eleType":"text","uuid":"1603681402945qnkgm7q8cng65evn5ev"},{"eleType":"icon","datatype":"static","width":12,"icon":"question-circle","tooltip":"瓒呮椂宸ュ崟","uuid":"1603681473384i2crkbtofg4pu76k06a","marks":null,"style":{"textAlign":"right","color":"rgba(250, 219, 20, 1)"}},{"datatype":"static","width":24,"marks":null,"height":1,"innerHeight":36,"value":"100","style":{"fontSize":"24px","color":"rgba(0, 0, 0, 1)"},"prefix":"","postfix":"","format":"","eleType":"number","uuid":"1603681539870d704ufqf98kc6t7537t"},{"color":"rgba(250, 219, 20, 1)","datatype":"static","width":24,"marks":null,"maxValue":100,"value":50,"style":{"paddingTop":"10px","paddingBottom":"10px"},"eleType":"slider","uuid":"1603683067556mvupau0odvrtv45u7o8"},{"eleType":"splitline","width":24,"color":"#e8e8e8","uuid":"1603683117981t9k55k8an430fuppmci","marks":null,"style":{"paddingTop":"5px","paddingBottom":"5px"}},{"datatype":"static","width":12,"marks":null,"height":1,"value":"100","style":{"color":"rgba(0, 0, 0, 0.65)","marginTop":"10px"},"prefix":"瓒呮椂宸ュ崟 ","postfix":"","format":"","eleType":"text","uuid":"1603683136553uvsmkfohkft9idbfkhu"}],"backElements":[]}]` }, - // { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '甯哥敤琛�', width: 24 }, + { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '甯哥敤琛�', width: 24 }, { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '琛ㄦ牸', width: 12 }, { type: 'menu', url: line, component: 'line', subtype: 'line', title: '鎶樼嚎鍥�' }, { type: 'menu', url: line1, component: 'line', subtype: 'line1', title: '闃舵鎶樼嚎鍥�' }, diff --git a/src/tabviews/zshare/calendar/index.jsx b/src/tabviews/zshare/calendar/index.jsx index 3f9f15a..67a2bf2 100644 --- a/src/tabviews/zshare/calendar/index.jsx +++ b/src/tabviews/zshare/calendar/index.jsx @@ -377,7 +377,7 @@ <ul className="content"> {item.subData.map((data, index) => ( <li key={index} className="message"> - <Badge color={item.style ? (data.color === item.style.background ? '#ffffff' : data.color) : data.color} text={`${data.remark}(${data.startTime} ~ ${data.endTime})`}/> + <Badge color={item.style ? (data.color === item.style.background ? '#ffffff' : data.color) : data.color} text={`${data.remark} (${data.startTime} ~ ${data.endTime})`}/> </li> ))} </ul> diff --git a/src/tabviews/zshare/calendar/index.scss b/src/tabviews/zshare/calendar/index.scss index 917f694..52faea5 100644 --- a/src/tabviews/zshare/calendar/index.scss +++ b/src/tabviews/zshare/calendar/index.scss @@ -150,8 +150,9 @@ } .message { width: 100%; - white-space: nowrap; + // white-space: nowrap; overflow: hidden; + margin-bottom: 5px; text-overflow: ellipsis; } } diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 108bc1d..af3c4ba 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -27,9 +27,20 @@ } UNSAFE_componentWillMount () { - const {usefulfields, btn} = this.props + this.resetfield(this.props.usefulfields) + } - let fields = usefulfields.map(item => item.Column) + UNSAFE_componentWillReceiveProps (nextProps) { + if (nextProps.usefulfields && !is(fromJS(this.props.usefulfields), fromJS(nextProps.usefulfields))) { + this.resetfield(nextProps.usefulfields) + } + } + + resetfield = (columns) => { + const { btn } = this.props + columns = columns.filter(item => item.import !== 'false') + let fields = columns.map(item => item.Column) + if (!fields.includes('ID')) { fields.unshift('ID') } @@ -37,7 +48,7 @@ fields.unshift('BID') } - let _sql = `Declare @${btn.sheet} table (${usefulfields.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) + let _sql = `Declare @${btn.sheet} table (${columns.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) Select @ErrorCode='', @retmsg='' ` @@ -46,31 +57,6 @@ verifySql: _sql, usefulfields: fields.join(', ') }) - } - - UNSAFE_componentWillReceiveProps (nextProps) { - const { btn } = this.props - - if (nextProps.usefulfields && !is(fromJS(this.props.usefulfields), fromJS(nextProps.usefulfields))) { - - let fields = nextProps.usefulfields.map(item => item.Column) - if (!fields.includes('ID')) { - fields.unshift('ID') - } - if (!fields.includes('BID')) { - fields.unshift('BID') - } - - let _sql = `Declare @${btn.sheet} table (${nextProps.usefulfields.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) - Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) - Select @ErrorCode='', @retmsg='' - ` - - this.setState({ - verifySql: _sql, - usefulfields: fields.join(', ') - }) - } } edit = (record) => { @@ -196,7 +182,8 @@ let _value = '' if (value === 'default') { - let fields = usefulfields.map(col => col.Column).join(',') + let fields = usefulfields.filter(item => item.import !== 'false') + fields = fields.map(col => col.Column).join(',') if (fields) { fields = fields + ',' diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index ddee480..51528d3 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -126,6 +126,17 @@ }) } else { message.warning(res.message) + if (res.message.indexOf('瀵嗙爜閿欒') > -1) { + const input = document.getElementById('password') + if (input) { + input.select() + } + } else if (res.message.indexOf('鐧诲綍鏉冮檺') > -1) { + const input = document.getElementById('username') + if (input) { + input.select() + } + } this.setState({ isDisabled: false }) -- Gitblit v1.8.0