@nokecy/qc-ui 0.4.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/ag-grid-plus/_utils/boolSelect.js +49 -0
- package/dist/esm/ag-grid-plus/ag-grid-theme-builder.css +404 -0
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +472 -0
- package/dist/esm/ag-grid-plus/context/gridContext.js +6 -0
- package/dist/esm/ag-grid-plus/gridManager/index.js +35 -0
- package/dist/esm/ag-grid-plus/index.js +10 -0
- package/dist/esm/ag-grid-plus/index.less +7 -0
- package/dist/esm/ag-grid-plus/interface.js +9 -0
- package/dist/esm/ag-grid-plus/queryForm/index.js +175 -0
- package/dist/esm/ag-grid-plus/queryForm/index.less +48 -0
- package/dist/esm/ag-grid-plus/queryForm/queryForm.js +84 -0
- package/dist/esm/ag-grid-plus/setting/index.js +198 -0
- package/dist/esm/ag-grid-plus/settingItem/index.js +15 -0
- package/dist/esm/ag-grid-plus/toolBar/index.js +171 -0
- package/dist/esm/ag-grid-plus/utils.js +137 -0
- package/dist/esm/array-table/arrayAddBtn.js +56 -0
- package/dist/esm/array-table/arrayBase.js +217 -0
- package/dist/esm/array-table/index.js +145 -0
- package/dist/esm/array-table/interface.js +1 -0
- package/dist/esm/array-table/preview.js +49 -0
- package/dist/esm/array-table/utils.js +124 -0
- package/dist/esm/array-table-index/index.js +10 -0
- package/dist/esm/dashboard/dashboard/components/index.js +2 -0
- package/dist/esm/dashboard/dashboard/components/modal/index.js +15 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/index.js +22 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/style/index.js +1 -0
- package/dist/esm/dashboard/dashboard/components/toolbar/style/index.less +49 -0
- package/dist/esm/dashboard/dashboard/index.js +525 -0
- package/dist/esm/dashboard/dashboard/index.less +173 -0
- package/dist/esm/dashboard/dashboard/service.js +86 -0
- package/dist/esm/dashboard/dashboard/utils.js +89 -0
- package/dist/esm/dashboard/index.js +3 -0
- package/dist/esm/dashboard/utils.js +125 -0
- package/dist/esm/dashboard/widget/index.js +47 -0
- package/dist/esm/dashboard/widget/index.less +7 -0
- package/dist/esm/dashboard/widget/selector/index.js +234 -0
- package/dist/esm/dashboard/widget/selector/index.less +172 -0
- package/dist/esm/dashboard/widget/utils.js +89 -0
- package/dist/esm/dialogSelect/index.js +70 -0
- package/dist/esm/dialogSelect/interface.js +0 -0
- package/dist/esm/dialogSelect/selectModal.js +138 -0
- package/dist/esm/editable/index.js +241 -0
- package/dist/esm/editable/style.js +46 -0
- package/dist/esm/extensible-grid/index.js +22 -0
- package/dist/esm/extensible-grid/interface.js +1 -0
- package/dist/esm/formDesigner/FormDesigner.js +222 -0
- package/dist/esm/formDesigner/ProCard/index.js +21 -0
- package/dist/esm/formDesigner/arrayTable/arrayTableSchema.js +106 -0
- package/dist/esm/formDesigner/arrayTable/index.js +1 -0
- package/dist/esm/formDesigner/arrayTable/preview.js +390 -0
- package/dist/esm/formDesigner/arrayTable/styles.less +3 -0
- package/dist/esm/formDesigner/index.js +2 -0
- package/dist/esm/formDesigner/index.less +3 -0
- package/dist/esm/formDesigner/preWidgets/arrayTableIndex/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/arrayTableIndex/preview.js +40 -0
- package/dist/esm/formDesigner/preWidgets/card/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/card/preview.js +38 -0
- package/dist/esm/formDesigner/preWidgets/index.js +12 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty1/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty1/preview.js +44 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty10/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty10/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty2/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty2/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty3/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty3/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty4/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty4/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty5/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty5/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty6/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty6/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty7/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty7/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty8/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty8/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty9/index.js +1 -0
- package/dist/esm/formDesigner/preWidgets/preDefineProperty9/preview.js +43 -0
- package/dist/esm/formDesigner/preWidgets/utils.js +219 -0
- package/dist/esm/formDesigner/widgets/ActionsWidget.js +29 -0
- package/dist/esm/formDesigner/widgets/LogoWidget.js +24 -0
- package/dist/esm/formDesigner/widgets/PreviewWidget.js +33 -0
- package/dist/esm/formDesigner/widgets/SchemaEditorWidget.js +17 -0
- package/dist/esm/formDesigner/widgets/index.js +4 -0
- package/dist/esm/formPro/context/formProContext.js +5 -0
- package/dist/esm/formPro/formLayoutPro.js +41 -0
- package/dist/esm/formPro/index.js +2 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/type.d.ts +1 -0
- package/dist/umd/qc-ui.min.css +1 -0
- package/dist/umd/qc-ui.min.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import _debounce from "lodash/debounce";
|
|
3
|
+
import _isArray from "lodash/isArray";
|
|
4
|
+
import _isEmpty from "lodash/isEmpty";
|
|
5
|
+
import _cloneDeep from "lodash/cloneDeep";
|
|
6
|
+
var _excluded = ["storageKey", "editMode", "widgets", "defaultLayout", "widgetWrapClassName", "widgetWrapStyle", "layout", "minHeight", "maxWidgetLength", "toolbar", "onLayoutChange", "onReset", "onReload", "onRemoveWidget", "onAddWidget", "onCancelEdit", "onEdit", "onRevert", "onSave"];
|
|
7
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
8
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
13
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
22
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
+
import { CheckOutlined, CloseOutlined, DashboardOutlined, DeleteOutlined, PlusOutlined, ReloadOutlined, RetweetOutlined } from '@ant-design/icons';
|
|
24
|
+
import { Button, Empty, message, Spin, Tooltip } from 'antd';
|
|
25
|
+
import classnames from 'classnames';
|
|
26
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef, useState } from 'react';
|
|
27
|
+
import { Responsive, WidthProvider } from 'react-grid-layout';
|
|
28
|
+
import KeyEvent from 'react-keyevent';
|
|
29
|
+
import { generateUuid, reducer } from "../utils";
|
|
30
|
+
import Widget from "../widget";
|
|
31
|
+
import WidgetSelector from "../widget/selector";
|
|
32
|
+
import { getWidgetType } from "../widget/utils";
|
|
33
|
+
import { Toolbar } from "./components";
|
|
34
|
+
import "./index.less";
|
|
35
|
+
import { fetch as fetchApi, update as updateApi } from "./service";
|
|
36
|
+
import { calcMinAndMax, copy, formatLayout } from "./utils";
|
|
37
|
+
var ResponsiveReactGridLayout = WidthProvider(Responsive);
|
|
38
|
+
var Dashboard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
39
|
+
var _props$storageKey = props.storageKey,
|
|
40
|
+
storageKey = _props$storageKey === void 0 ? 'default' : _props$storageKey,
|
|
41
|
+
_props$editMode = props.editMode,
|
|
42
|
+
editMode = _props$editMode === void 0 ? false : _props$editMode,
|
|
43
|
+
widgets = props.widgets,
|
|
44
|
+
_props$defaultLayout = props.defaultLayout,
|
|
45
|
+
defaultLayout = _props$defaultLayout === void 0 ? [] : _props$defaultLayout,
|
|
46
|
+
widgetWrapClassName = props.widgetWrapClassName,
|
|
47
|
+
widgetWrapStyle = props.widgetWrapStyle,
|
|
48
|
+
_props$layout = props.layout,
|
|
49
|
+
customLayout = _props$layout === void 0 ? null : _props$layout,
|
|
50
|
+
_props$minHeight = props.minHeight,
|
|
51
|
+
minHeight = _props$minHeight === void 0 ? 300 : _props$minHeight,
|
|
52
|
+
_props$maxWidgetLengt = props.maxWidgetLength,
|
|
53
|
+
maxWidgetLength = _props$maxWidgetLengt === void 0 ? 20 : _props$maxWidgetLengt,
|
|
54
|
+
_props$toolbar = props.toolbar,
|
|
55
|
+
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
56
|
+
_onLayoutChange = props.onLayoutChange,
|
|
57
|
+
onReset = props.onReset,
|
|
58
|
+
onReload = props.onReload,
|
|
59
|
+
onRemoveWidget = props.onRemoveWidget,
|
|
60
|
+
onAddWidget = props.onAddWidget,
|
|
61
|
+
onCancelEdit = props.onCancelEdit,
|
|
62
|
+
onEdit = props.onEdit,
|
|
63
|
+
onRevert = props.onRevert,
|
|
64
|
+
onSave = props.onSave,
|
|
65
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
66
|
+
var _useState = useState(editMode),
|
|
67
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
+
stateEditMode = _useState2[0],
|
|
69
|
+
setStateEditMode = _useState2[1];
|
|
70
|
+
var _useState3 = useState(editMode),
|
|
71
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
72
|
+
loading = _useState4[0],
|
|
73
|
+
setLoading = _useState4[1];
|
|
74
|
+
var _useReducer = useReducer(reducer, {
|
|
75
|
+
currentLayout: [],
|
|
76
|
+
dirtyCurrentLayout: []
|
|
77
|
+
}),
|
|
78
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
79
|
+
state = _useReducer2[0],
|
|
80
|
+
dispatch = _useReducer2[1];
|
|
81
|
+
var _state$currentLayout = state.currentLayout,
|
|
82
|
+
currentLayout = _state$currentLayout === void 0 ? [] : _state$currentLayout,
|
|
83
|
+
_state$dirtyCurrentLa = state.dirtyCurrentLayout,
|
|
84
|
+
dirtyCurrentLayout = _state$dirtyCurrentLa === void 0 ? [] : _state$dirtyCurrentLa;
|
|
85
|
+
var dom = useRef(null);
|
|
86
|
+
|
|
87
|
+
//获取操作
|
|
88
|
+
var fetch = useCallback(_debounce( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
89
|
+
var response, _layout, resArr, data;
|
|
90
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
91
|
+
while (1) switch (_context.prev = _context.next) {
|
|
92
|
+
case 0:
|
|
93
|
+
_context.prev = 0;
|
|
94
|
+
_context.next = 3;
|
|
95
|
+
return fetchApi({
|
|
96
|
+
id: storageKey
|
|
97
|
+
});
|
|
98
|
+
case 3:
|
|
99
|
+
response = _context.sent;
|
|
100
|
+
_layout = _isArray(defaultLayout) ? defaultLayout : [];
|
|
101
|
+
if (response) {
|
|
102
|
+
resArr = JSON.parse(response).currentLayout;
|
|
103
|
+
if (!_isEmpty(resArr)) {
|
|
104
|
+
_layout = resArr;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (_layout) {
|
|
108
|
+
data = calcMinAndMax(_layout, widgets);
|
|
109
|
+
dispatch({
|
|
110
|
+
type: 'save',
|
|
111
|
+
payload: {
|
|
112
|
+
currentLayout: data,
|
|
113
|
+
dirtyCurrentLayout: data
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
setLoading(false);
|
|
118
|
+
_context.next = 12;
|
|
119
|
+
break;
|
|
120
|
+
case 10:
|
|
121
|
+
_context.prev = 10;
|
|
122
|
+
_context.t0 = _context["catch"](0);
|
|
123
|
+
case 12:
|
|
124
|
+
case "end":
|
|
125
|
+
return _context.stop();
|
|
126
|
+
}
|
|
127
|
+
}, _callee, null, [[0, 10]]);
|
|
128
|
+
})), 200), [storageKey, widgets]);
|
|
129
|
+
|
|
130
|
+
//刷新
|
|
131
|
+
var reload = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
132
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
133
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
134
|
+
case 0:
|
|
135
|
+
setLoading(true);
|
|
136
|
+
onReload && onReload(formatLayout(currentLayout));
|
|
137
|
+
if (!customLayout) {
|
|
138
|
+
_context2.next = 4;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
return _context2.abrupt("return");
|
|
142
|
+
case 4:
|
|
143
|
+
fetch();
|
|
144
|
+
case 5:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context2.stop();
|
|
147
|
+
}
|
|
148
|
+
}, _callee2);
|
|
149
|
+
})), [fetch, customLayout]);
|
|
150
|
+
|
|
151
|
+
//设置布局信息
|
|
152
|
+
var update = useCallback( /*#__PURE__*/function () {
|
|
153
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(payload) {
|
|
154
|
+
var callback,
|
|
155
|
+
layout,
|
|
156
|
+
response,
|
|
157
|
+
_args3 = arguments;
|
|
158
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
159
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
callback = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : function () {};
|
|
162
|
+
layout = payload['layout'];
|
|
163
|
+
_context3.prev = 2;
|
|
164
|
+
_context3.next = 5;
|
|
165
|
+
return updateApi({
|
|
166
|
+
id: storageKey,
|
|
167
|
+
data: {
|
|
168
|
+
currentLayout: layout
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
case 5:
|
|
172
|
+
response = _context3.sent;
|
|
173
|
+
if (response) {
|
|
174
|
+
_context3.next = 8;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
return _context3.abrupt("return");
|
|
178
|
+
case 8:
|
|
179
|
+
callback();
|
|
180
|
+
_context3.next = 13;
|
|
181
|
+
break;
|
|
182
|
+
case 11:
|
|
183
|
+
_context3.prev = 11;
|
|
184
|
+
_context3.t0 = _context3["catch"](2);
|
|
185
|
+
case 13:
|
|
186
|
+
case "end":
|
|
187
|
+
return _context3.stop();
|
|
188
|
+
}
|
|
189
|
+
}, _callee3, null, [[2, 11]]);
|
|
190
|
+
}));
|
|
191
|
+
return function (_x) {
|
|
192
|
+
return _ref3.apply(this, arguments);
|
|
193
|
+
};
|
|
194
|
+
}(), [storageKey, widgets]);
|
|
195
|
+
|
|
196
|
+
//改变布局触发
|
|
197
|
+
var onLayoutChange = useCallback(_debounce(function (layout, layouts, callback) {
|
|
198
|
+
window.dispatchEvent(new Event('resize'));
|
|
199
|
+
if (!stateEditMode) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
dispatch({
|
|
203
|
+
type: 'save',
|
|
204
|
+
payload: {
|
|
205
|
+
dirtyCurrentLayout: layout
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
_onLayoutChange && _onLayoutChange(formatLayout(layout));
|
|
209
|
+
callback && callback();
|
|
210
|
+
}, 300), [stateEditMode]);
|
|
211
|
+
|
|
212
|
+
//添加小程序
|
|
213
|
+
var addWidget = useCallback(function (widget) {
|
|
214
|
+
if (dirtyCurrentLayout.length >= maxWidgetLength) {
|
|
215
|
+
message.warning("\u8D85\u8FC7\u4E86\u6700\u5927\u9650\u5236\u6570\u91CF".concat(maxWidgetLength) + ',' + '不能再添加了');
|
|
216
|
+
}
|
|
217
|
+
var lastItem = dirtyCurrentLayout[dirtyCurrentLayout.length - 1];
|
|
218
|
+
var newLayout = [].concat(_toConsumableArray(dirtyCurrentLayout), [{
|
|
219
|
+
w: widget.size.defaultWidth,
|
|
220
|
+
h: widget.size.defaultHeight,
|
|
221
|
+
x: 0,
|
|
222
|
+
y: lastItem ? lastItem['y'] + lastItem['h'] : 0,
|
|
223
|
+
i: widget.name + '-' + generateUuid(),
|
|
224
|
+
minW: widget.size.minWidth,
|
|
225
|
+
maxW: widget.size.maxWidth,
|
|
226
|
+
minH: widget.size.minHeight,
|
|
227
|
+
maxH: widget.size.maxHeight
|
|
228
|
+
}]);
|
|
229
|
+
onAddWidget && onAddWidget(widget, formatLayout(dirtyCurrentLayout), formatLayout(newLayout));
|
|
230
|
+
onLayoutChange(newLayout);
|
|
231
|
+
message.success('添加成功');
|
|
232
|
+
}, [dirtyCurrentLayout, onLayoutChange, maxWidgetLength]);
|
|
233
|
+
|
|
234
|
+
//删除小程序
|
|
235
|
+
var removeWidget = useCallback(function (widgetKey) {
|
|
236
|
+
var removedWidget;
|
|
237
|
+
var newLayout = _cloneDeep(dirtyCurrentLayout);
|
|
238
|
+
newLayout.map(function (item, index) {
|
|
239
|
+
if (item['i'] === widgetKey) {
|
|
240
|
+
removedWidget = item;
|
|
241
|
+
newLayout.splice(index, 1);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
onRemoveWidget && onRemoveWidget(removedWidget, formatLayout(dirtyCurrentLayout), formatLayout(newLayout));
|
|
245
|
+
dispatch({
|
|
246
|
+
type: 'save',
|
|
247
|
+
payload: {
|
|
248
|
+
dirtyCurrentLayout: newLayout
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}, [dirtyCurrentLayout, onLayoutChange]);
|
|
252
|
+
|
|
253
|
+
//重置
|
|
254
|
+
var reset = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
255
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
256
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
257
|
+
case 0:
|
|
258
|
+
onReset && onReset([], formatLayout(currentLayout));
|
|
259
|
+
onLayoutChange([]);
|
|
260
|
+
case 2:
|
|
261
|
+
case "end":
|
|
262
|
+
return _context4.stop();
|
|
263
|
+
}
|
|
264
|
+
}, _callee4);
|
|
265
|
+
})), [onLayoutChange]);
|
|
266
|
+
|
|
267
|
+
//最终的布局数据
|
|
268
|
+
var finLayout = useMemo(function () {
|
|
269
|
+
return stateEditMode ? dirtyCurrentLayout : currentLayout;
|
|
270
|
+
}, [stateEditMode, dirtyCurrentLayout, currentLayout]);
|
|
271
|
+
|
|
272
|
+
//取消编辑
|
|
273
|
+
var cancelEdit = useCallback(function () {
|
|
274
|
+
setStateEditMode(false);
|
|
275
|
+
onCancelEdit && onCancelEdit(formatLayout(dirtyCurrentLayout), formatLayout(currentLayout));
|
|
276
|
+
dispatch({
|
|
277
|
+
type: 'save',
|
|
278
|
+
payload: {
|
|
279
|
+
dirtyCurrentLayout: currentLayout
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}, [dirtyCurrentLayout, currentLayout]);
|
|
283
|
+
var revert = useCallback(function () {
|
|
284
|
+
onRevert && onRevert(formatLayout(dirtyCurrentLayout), formatLayout(currentLayout));
|
|
285
|
+
dispatch({
|
|
286
|
+
type: 'save',
|
|
287
|
+
payload: {
|
|
288
|
+
dirtyCurrentLayout: currentLayout
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}, [dirtyCurrentLayout, currentLayout]);
|
|
292
|
+
var edit = function edit() {
|
|
293
|
+
return setStateEditMode(true);
|
|
294
|
+
};
|
|
295
|
+
var save = useCallback(function () {
|
|
296
|
+
dispatch({
|
|
297
|
+
type: 'save',
|
|
298
|
+
payload: {
|
|
299
|
+
currentLayout: dirtyCurrentLayout,
|
|
300
|
+
widgets: widgets
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
onSave && onSave(formatLayout(dirtyCurrentLayout));
|
|
304
|
+
setStateEditMode(false);
|
|
305
|
+
if (customLayout) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
update({
|
|
309
|
+
layout: dirtyCurrentLayout
|
|
310
|
+
});
|
|
311
|
+
}, [dirtyCurrentLayout, update, customLayout]);
|
|
312
|
+
useImperativeHandle(ref, function () {
|
|
313
|
+
return {
|
|
314
|
+
dom: dom.current,
|
|
315
|
+
reset: reset,
|
|
316
|
+
//清空
|
|
317
|
+
removeWidget: removeWidget,
|
|
318
|
+
//删除
|
|
319
|
+
addWidget: addWidget,
|
|
320
|
+
//新增
|
|
321
|
+
reload: reload,
|
|
322
|
+
// 刷新
|
|
323
|
+
cancelEdit: cancelEdit,
|
|
324
|
+
//取消编辑
|
|
325
|
+
edit: edit,
|
|
326
|
+
//编辑
|
|
327
|
+
revert: revert,
|
|
328
|
+
//重置
|
|
329
|
+
save: save //保存
|
|
330
|
+
};
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
//打印布局数据
|
|
334
|
+
var onCtrlShiftC = useCallback(function () {
|
|
335
|
+
var res = formatLayout(currentLayout);
|
|
336
|
+
copy(JSON.stringify(res));
|
|
337
|
+
message.success('已复制布局数据到剪切板');
|
|
338
|
+
console.log('currentLayout', res);
|
|
339
|
+
}, [currentLayout]);
|
|
340
|
+
|
|
341
|
+
//默认存储
|
|
342
|
+
useEffect(function () {
|
|
343
|
+
if (customLayout) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
fetch();
|
|
347
|
+
}, [customLayout]);
|
|
348
|
+
|
|
349
|
+
//编辑状态改变副作用
|
|
350
|
+
useEffect(function () {
|
|
351
|
+
setStateEditMode(editMode);
|
|
352
|
+
}, [editMode]);
|
|
353
|
+
|
|
354
|
+
//响应外部数据
|
|
355
|
+
useEffect(function () {
|
|
356
|
+
if (!_isArray(customLayout)) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
var data = calcMinAndMax(customLayout, widgets);
|
|
360
|
+
dispatch({
|
|
361
|
+
type: 'save',
|
|
362
|
+
payload: {
|
|
363
|
+
customLayout: data,
|
|
364
|
+
dirtyCurrentLayout: data
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}, [customLayout, widgets]);
|
|
368
|
+
return /*#__PURE__*/React.createElement(Spin, {
|
|
369
|
+
spinning: loading,
|
|
370
|
+
style: {
|
|
371
|
+
width: '100%'
|
|
372
|
+
}
|
|
373
|
+
}, /*#__PURE__*/React.createElement(KeyEvent, {
|
|
374
|
+
style: {
|
|
375
|
+
width: '100%'
|
|
376
|
+
},
|
|
377
|
+
events: {
|
|
378
|
+
onCtrlShiftC: onCtrlShiftC
|
|
379
|
+
},
|
|
380
|
+
needFocusing: true
|
|
381
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
382
|
+
style: {
|
|
383
|
+
width: '100%'
|
|
384
|
+
},
|
|
385
|
+
ref: dom
|
|
386
|
+
}, /*#__PURE__*/React.createElement(ResponsiveReactGridLayout, {
|
|
387
|
+
className: "react-dashboard-layout",
|
|
388
|
+
layouts: {
|
|
389
|
+
lg: finLayout
|
|
390
|
+
},
|
|
391
|
+
rowHeight: 30,
|
|
392
|
+
isDraggable: stateEditMode,
|
|
393
|
+
breakpoints: {
|
|
394
|
+
lg: 1200,
|
|
395
|
+
md: 800,
|
|
396
|
+
sm: 600,
|
|
397
|
+
xs: 400,
|
|
398
|
+
xxs: 300
|
|
399
|
+
},
|
|
400
|
+
cols: {
|
|
401
|
+
lg: 12,
|
|
402
|
+
md: 12,
|
|
403
|
+
sm: 2,
|
|
404
|
+
xs: 2,
|
|
405
|
+
xxs: 2
|
|
406
|
+
}
|
|
407
|
+
// onBreakpointChange={onBreakpointChange} //断点回调
|
|
408
|
+
,
|
|
409
|
+
onLayoutChange: onLayoutChange //布局改变回调
|
|
410
|
+
,
|
|
411
|
+
isResizable: stateEditMode //准许改变大小
|
|
412
|
+
// onWidthChange={()=>onWidthChange()} //宽度改变回调
|
|
413
|
+
,
|
|
414
|
+
measureBeforeMount: true //动画相关
|
|
415
|
+
}, finLayout.map(function (item) {
|
|
416
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
417
|
+
key: item.i,
|
|
418
|
+
className: classnames('react-dashboard-item', stateEditMode ? 'react-dashboard-item-edit' : '')
|
|
419
|
+
}, widgets[getWidgetType(item.i, widgets)] ? /*#__PURE__*/React.createElement(Widget, _extends({}, restProps, {
|
|
420
|
+
widgetKey: item.i,
|
|
421
|
+
widgetType: getWidgetType(item.i, widgets),
|
|
422
|
+
height: item.h * 40 - 10,
|
|
423
|
+
editMode: stateEditMode,
|
|
424
|
+
onDeleteWidget: function onDeleteWidget() {
|
|
425
|
+
return removeWidget(item.i);
|
|
426
|
+
},
|
|
427
|
+
widgets: widgets,
|
|
428
|
+
widgetWrapClassName: widgetWrapClassName,
|
|
429
|
+
widgetWrapStyle: widgetWrapStyle
|
|
430
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
431
|
+
className: "react-dashboard-aligncenter react-dashboard-full"
|
|
432
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
433
|
+
style: {
|
|
434
|
+
textAlign: 'center'
|
|
435
|
+
}
|
|
436
|
+
}, /*#__PURE__*/React.createElement("div", null, '数据有误', " ", item.i), stateEditMode && /*#__PURE__*/React.createElement(Button, {
|
|
437
|
+
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null),
|
|
438
|
+
size: "small",
|
|
439
|
+
style: {
|
|
440
|
+
margin: '10px 0'
|
|
441
|
+
},
|
|
442
|
+
onClick: function onClick() {
|
|
443
|
+
return removeWidget(item.i);
|
|
444
|
+
}
|
|
445
|
+
}, '删除'))));
|
|
446
|
+
})), toolbar && finLayout.length > 0 ? !stateEditMode && /*#__PURE__*/React.createElement("div", {
|
|
447
|
+
style: {
|
|
448
|
+
display: 'flex',
|
|
449
|
+
margin: '0 10px',
|
|
450
|
+
marginBottom: '10px'
|
|
451
|
+
}
|
|
452
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
453
|
+
size: "small",
|
|
454
|
+
icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),
|
|
455
|
+
loading: loading,
|
|
456
|
+
style: {
|
|
457
|
+
marginRight: '10px'
|
|
458
|
+
},
|
|
459
|
+
onClick: function onClick() {
|
|
460
|
+
return reload();
|
|
461
|
+
}
|
|
462
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
463
|
+
size: "small",
|
|
464
|
+
type: "default",
|
|
465
|
+
style: {
|
|
466
|
+
flex: 1
|
|
467
|
+
},
|
|
468
|
+
onClick: edit
|
|
469
|
+
}, /*#__PURE__*/React.createElement(DashboardOutlined, null), '编辑仪表板')) : /*#__PURE__*/React.createElement(React.Fragment, null, !stateEditMode ? /*#__PURE__*/React.createElement(Spin, {
|
|
470
|
+
spinning: loading
|
|
471
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
472
|
+
className: "react-dashboard-emptyContent",
|
|
473
|
+
style: {
|
|
474
|
+
minHeight: minHeight
|
|
475
|
+
}
|
|
476
|
+
}, !loading && /*#__PURE__*/React.createElement(Empty, {
|
|
477
|
+
description: /*#__PURE__*/React.createElement("span", null, '当前仪表板没有小程序')
|
|
478
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
479
|
+
size: "small",
|
|
480
|
+
type: "primary",
|
|
481
|
+
onClick: edit
|
|
482
|
+
}, /*#__PURE__*/React.createElement(DashboardOutlined, null), '编辑仪表板')))) : /*#__PURE__*/React.createElement("div", {
|
|
483
|
+
className: classnames('react-dashboard-full', 'react-dashboard-aligncenter'),
|
|
484
|
+
style: {
|
|
485
|
+
minHeight: minHeight
|
|
486
|
+
}
|
|
487
|
+
}, /*#__PURE__*/React.createElement(WidgetSelector, {
|
|
488
|
+
widgets: widgets,
|
|
489
|
+
currentLayout: finLayout,
|
|
490
|
+
addWidget: addWidget
|
|
491
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
492
|
+
title: '添加'
|
|
493
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
494
|
+
type: "dashed",
|
|
495
|
+
shape: "circle",
|
|
496
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
497
|
+
size: "large"
|
|
498
|
+
})))))), toolbar && stateEditMode && /*#__PURE__*/React.createElement(Toolbar, {
|
|
499
|
+
fixed: false,
|
|
500
|
+
extraRight: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
501
|
+
size: "small",
|
|
502
|
+
onClick: cancelEdit,
|
|
503
|
+
icon: /*#__PURE__*/React.createElement(CloseOutlined, null)
|
|
504
|
+
}, '取消'), /*#__PURE__*/React.createElement(Button, {
|
|
505
|
+
size: "small",
|
|
506
|
+
onClick: revert,
|
|
507
|
+
icon: /*#__PURE__*/React.createElement(RetweetOutlined, null)
|
|
508
|
+
}, '恢复'), !_isEmpty(finLayout) && /*#__PURE__*/React.createElement(Button, {
|
|
509
|
+
size: "small",
|
|
510
|
+
danger: true,
|
|
511
|
+
onClick: reset,
|
|
512
|
+
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
|
|
513
|
+
}, '清空'), /*#__PURE__*/React.createElement(WidgetSelector, {
|
|
514
|
+
widgets: widgets,
|
|
515
|
+
currentLayout: finLayout,
|
|
516
|
+
addWidget: addWidget
|
|
517
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
518
|
+
size: "small",
|
|
519
|
+
onClick: save,
|
|
520
|
+
type: "primary",
|
|
521
|
+
icon: /*#__PURE__*/React.createElement(CheckOutlined, null)
|
|
522
|
+
}, '保存'))
|
|
523
|
+
}))));
|
|
524
|
+
});
|
|
525
|
+
export default Dashboard;
|