ns-base-module 1.0.4 → 1.0.6
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/ChooseModal/index.d.ts +21 -0
- package/dist/ChooseModal/index.d.ts.map +1 -0
- package/dist/ChooseModal/index.js +164 -0
- package/dist/FilterPopover/Filter.d.ts.map +1 -1
- package/dist/FilterPopover/Filter.js +74 -51
- package/dist/FilterPopover/FilterClearIcon.d.ts +4 -4
- package/dist/FilterPopover/FilterClearIcon.d.ts.map +1 -1
- package/dist/FilterPopover/FilterClearIcon.js +1 -1
- package/dist/IconTools/index.d.ts +13 -0
- package/dist/IconTools/index.d.ts.map +1 -0
- package/dist/IconTools/index.js +125 -0
- package/dist/IconTools/utils.d.ts +15 -0
- package/dist/IconTools/utils.d.ts.map +1 -0
- package/dist/IconTools/utils.js +171 -0
- package/dist/SubtotalsModal/Increment.d.ts +18 -0
- package/dist/SubtotalsModal/Increment.d.ts.map +1 -0
- package/dist/SubtotalsModal/Increment.js +144 -0
- package/dist/SubtotalsModal/addSubtotals.d.ts +19 -0
- package/dist/SubtotalsModal/addSubtotals.d.ts.map +1 -0
- package/dist/SubtotalsModal/addSubtotals.js +129 -0
- package/dist/SubtotalsModal/dndQuota.d.ts +20 -0
- package/dist/SubtotalsModal/dndQuota.d.ts.map +1 -0
- package/dist/SubtotalsModal/dndQuota.js +384 -0
- package/dist/SubtotalsModal/index.d.ts +19 -0
- package/dist/SubtotalsModal/index.d.ts.map +1 -0
- package/dist/SubtotalsModal/index.js +192 -0
- package/dist/SubtotalsModal/subtotalTemplate.d.ts +20 -0
- package/dist/SubtotalsModal/subtotalTemplate.d.ts.map +1 -0
- package/dist/SubtotalsModal/subtotalTemplate.js +238 -0
- package/dist/SubtotalsModal/util.d.ts +3 -0
- package/dist/SubtotalsModal/util.d.ts.map +1 -0
- package/dist/SubtotalsModal/util.js +28 -0
- package/dist/SubtotalsModal/viewSubtotals.d.ts +10 -0
- package/dist/SubtotalsModal/viewSubtotals.d.ts.map +1 -0
- package/dist/SubtotalsModal/viewSubtotals.js +243 -0
- package/dist/TableHeaderConfigPopover/Dustbin.d.ts +5 -0
- package/dist/TableHeaderConfigPopover/Dustbin.d.ts.map +1 -0
- package/dist/TableHeaderConfigPopover/Dustbin.js +108 -0
- package/dist/TableHeaderConfigPopover/index.d.ts +19 -0
- package/dist/TableHeaderConfigPopover/index.d.ts.map +1 -0
- package/dist/TableHeaderConfigPopover/index.js +1031 -0
- package/dist/TableHeaderConfigPopover/utils.d.ts +3 -0
- package/dist/TableHeaderConfigPopover/utils.d.ts.map +1 -0
- package/dist/TableHeaderConfigPopover/utils.js +41 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/umd/ns-base-module.min.css +1 -1
- package/dist/umd/ns-base-module.min.js +1 -1
- package/dist/utils/language.d.ts +232 -231
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +234 -233
- package/dist/utils/request.d.ts +0 -14
- package/dist/utils/request.d.ts.map +1 -1
- package/dist/utils/request.js +181 -173
- package/dist/utils/services/global.d.ts +128 -0
- package/dist/utils/services/global.d.ts.map +1 -0
- package/dist/utils/services/global.js +406 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/package.json +3 -1
- package/style/components/SubtotalsModal.scss +293 -0
- package/style/components/TableHeaderConfigPopover.scss +105 -0
- package/style/components/index.scss +2 -0
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
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; }
|
|
8
|
+
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); } }
|
|
9
|
+
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); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { DeleteOutlined, SettingOutlined, UserOutlined } from "@ant-design/icons";
|
|
17
|
+
import { Button, Popconfirm, Radio, Tooltip } from "antd";
|
|
18
|
+
import React, { useEffect, useState } from "react";
|
|
19
|
+
// import { commonRequest } from '../../../../services/global';
|
|
20
|
+
// import { crossContext } from '@/my-context';
|
|
21
|
+
import "../../style/components/SubtotalsModal.scss";
|
|
22
|
+
import { initLang } from "../utils/language";
|
|
23
|
+
var Index = function Index(props) {
|
|
24
|
+
var menuCode = props.menuCode,
|
|
25
|
+
formTemplateCode = props.formTemplateCode,
|
|
26
|
+
commonRequest = props.commonRequest;
|
|
27
|
+
// const context = useContext(crossContext);
|
|
28
|
+
|
|
29
|
+
var _useState = useState(),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
value = _useState2[0],
|
|
32
|
+
setValue = _useState2[1];
|
|
33
|
+
var _useState3 = useState([]),
|
|
34
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
35
|
+
template = _useState4[0],
|
|
36
|
+
setTemplate = _useState4[1];
|
|
37
|
+
var _useState5 = useState(null),
|
|
38
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
39
|
+
curItem = _useState6[0],
|
|
40
|
+
setCurItem = _useState6[1];
|
|
41
|
+
console.log("commonRequest", commonRequest);
|
|
42
|
+
var getTemplate = /*#__PURE__*/function () {
|
|
43
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
44
|
+
var res;
|
|
45
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
46
|
+
while (1) switch (_context.prev = _context.next) {
|
|
47
|
+
case 0:
|
|
48
|
+
_context.next = 2;
|
|
49
|
+
return commonRequest === null || commonRequest === void 0 ? void 0 : commonRequest({
|
|
50
|
+
api: "/system/menu/menuform/customQuotaConfig",
|
|
51
|
+
params: {
|
|
52
|
+
menuCode: menuCode,
|
|
53
|
+
formTemplateCode: formTemplateCode
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
case 2:
|
|
57
|
+
res = _context.sent;
|
|
58
|
+
setTemplate(res.data);
|
|
59
|
+
case 4:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context.stop();
|
|
62
|
+
}
|
|
63
|
+
}, _callee);
|
|
64
|
+
}));
|
|
65
|
+
return function getTemplate() {
|
|
66
|
+
return _ref.apply(this, arguments);
|
|
67
|
+
};
|
|
68
|
+
}();
|
|
69
|
+
useEffect(function () {
|
|
70
|
+
getTemplate();
|
|
71
|
+
}, []);
|
|
72
|
+
|
|
73
|
+
// 确认删除
|
|
74
|
+
var confirm = /*#__PURE__*/function () {
|
|
75
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
76
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
77
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
_context2.next = 2;
|
|
80
|
+
return commonRequest === null || commonRequest === void 0 ? void 0 : commonRequest({
|
|
81
|
+
api: "/dataProcess/commonSave/userFormTemplates/userCustomColumnEdit/save",
|
|
82
|
+
params: {
|
|
83
|
+
menu_code: menuCode,
|
|
84
|
+
form_template_code: formTemplateCode,
|
|
85
|
+
is_deleted: "Y",
|
|
86
|
+
code: curItem === null || curItem === void 0 ? void 0 : curItem.value
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
case 2:
|
|
90
|
+
getTemplate();
|
|
91
|
+
case 3:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee2);
|
|
96
|
+
}));
|
|
97
|
+
return function confirm() {
|
|
98
|
+
return _ref2.apply(this, arguments);
|
|
99
|
+
};
|
|
100
|
+
}();
|
|
101
|
+
var cancel = function cancel() {};
|
|
102
|
+
// 点击删除
|
|
103
|
+
var handleDel = function handleDel(item) {
|
|
104
|
+
setCurItem(item);
|
|
105
|
+
};
|
|
106
|
+
var handleSet = function handleSet(item) {
|
|
107
|
+
var _props$handleSet;
|
|
108
|
+
(_props$handleSet = props.handleSet) === null || _props$handleSet === void 0 || _props$handleSet.call(props, item);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// 确定
|
|
112
|
+
var handleChoose = function handleChoose(_value) {
|
|
113
|
+
// chartDimensions:[{"code":"aaaa"}]
|
|
114
|
+
// chartQuotas:[{"code":"","sumType":"","expression":""}]
|
|
115
|
+
try {
|
|
116
|
+
var _props$onOk;
|
|
117
|
+
var chartDimensions = [];
|
|
118
|
+
var chartQuotas = [];
|
|
119
|
+
var chartColumns = [];
|
|
120
|
+
var crossQuery = false;
|
|
121
|
+
var val = typeof _value != "undefined" ? _value : value;
|
|
122
|
+
var dimension = [];
|
|
123
|
+
var quota = [];
|
|
124
|
+
for (var i = 0, l = template.length; i < l; i++) {
|
|
125
|
+
if (template[i].value === val) {
|
|
126
|
+
var _template$i, _config$quotaList, _config$chartColumns, _config$dimensionList, _config$quotaList2;
|
|
127
|
+
var _config = JSON.parse((_template$i = template[i]) === null || _template$i === void 0 ? void 0 : _template$i.define);
|
|
128
|
+
chartDimensions = _config.dimensionList.map(function (d) {
|
|
129
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
130
|
+
code: d.value
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
chartQuotas = (_config$quotaList = _config.quotaList) === null || _config$quotaList === void 0 ? void 0 : _config$quotaList.map(function (d) {
|
|
134
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
135
|
+
code: d.value
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
chartColumns = (_config$chartColumns = _config.chartColumns) === null || _config$chartColumns === void 0 ? void 0 : _config$chartColumns.map(function (d) {
|
|
139
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
140
|
+
code: d.value
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
crossQuery = (_config === null || _config === void 0 ? void 0 : _config.valueRadio) === "cross";
|
|
144
|
+
dimension = (_config$dimensionList = _config.dimensionList) === null || _config$dimensionList === void 0 ? void 0 : _config$dimensionList.map(function (d) {
|
|
145
|
+
return d.value;
|
|
146
|
+
});
|
|
147
|
+
quota = (_config$quotaList2 = _config.quotaList) === null || _config$quotaList2 === void 0 ? void 0 : _config$quotaList2.map(function (d) {
|
|
148
|
+
return d.value;
|
|
149
|
+
});
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
(_props$onOk = props.onOk) === null || _props$onOk === void 0 || _props$onOk.call(props, {
|
|
154
|
+
dimension: dimension,
|
|
155
|
+
quota: quota
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// context.onChangeDuoQim?.({ chartDimensions, chartQuotas, chartColumns, crossQuery });
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.log("errorerror", error);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
var onChange = function onChange(e) {
|
|
164
|
+
setValue(e.target.value);
|
|
165
|
+
handleChoose(e.target.value);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// 重置
|
|
169
|
+
var handleReset = function handleReset() {
|
|
170
|
+
setValue("");
|
|
171
|
+
handleChoose("");
|
|
172
|
+
};
|
|
173
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
174
|
+
onChange: onChange,
|
|
175
|
+
value: value,
|
|
176
|
+
style: {
|
|
177
|
+
width: "100%",
|
|
178
|
+
minHeight: 260
|
|
179
|
+
}
|
|
180
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: "list-title"
|
|
182
|
+
}, /*#__PURE__*/React.createElement(UserOutlined, {
|
|
183
|
+
className: "list-title-icon"
|
|
184
|
+
}), initLang({
|
|
185
|
+
id: "prompt.summaryTemplate"
|
|
186
|
+
})), /*#__PURE__*/React.createElement(React.Fragment, null, template === null || template === void 0 ? void 0 : template.map(function (item) {
|
|
187
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
188
|
+
className: "list-radio",
|
|
189
|
+
key: item.value
|
|
190
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
191
|
+
value: item.value,
|
|
192
|
+
className: "list-radio-label"
|
|
193
|
+
}, item.label), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Popconfirm, {
|
|
194
|
+
title: initLang({
|
|
195
|
+
id: "message.confirm.delete"
|
|
196
|
+
}),
|
|
197
|
+
onConfirm: confirm,
|
|
198
|
+
onCancel: cancel,
|
|
199
|
+
okText: initLang({
|
|
200
|
+
id: "button.ok"
|
|
201
|
+
}),
|
|
202
|
+
cancelText: initLang({
|
|
203
|
+
id: "button.cancel"
|
|
204
|
+
})
|
|
205
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
206
|
+
placement: "top",
|
|
207
|
+
title: initLang({
|
|
208
|
+
id: "prompt.delTemplate"
|
|
209
|
+
})
|
|
210
|
+
}, /*#__PURE__*/React.createElement(DeleteOutlined, {
|
|
211
|
+
className: "set-icon",
|
|
212
|
+
onClick: function onClick() {
|
|
213
|
+
return handleDel(item);
|
|
214
|
+
}
|
|
215
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
216
|
+
placement: "top",
|
|
217
|
+
title: initLang({
|
|
218
|
+
id: "prompt.setTemplate"
|
|
219
|
+
})
|
|
220
|
+
}, /*#__PURE__*/React.createElement(SettingOutlined, {
|
|
221
|
+
className: "set-icon",
|
|
222
|
+
onClick: function onClick() {
|
|
223
|
+
return handleSet(item);
|
|
224
|
+
}
|
|
225
|
+
}))));
|
|
226
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
227
|
+
style: {
|
|
228
|
+
textAlign: "right",
|
|
229
|
+
marginTop: 32
|
|
230
|
+
}
|
|
231
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
232
|
+
onClick: handleReset,
|
|
233
|
+
size: "small"
|
|
234
|
+
}, initLang({
|
|
235
|
+
id: "button.reset"
|
|
236
|
+
}))));
|
|
237
|
+
};
|
|
238
|
+
export default Index;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,GAAG,GAAE,GAAQ,QAiBrD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAQzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function loopColumns(list) {
|
|
2
|
+
var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
3
|
+
for (var i = 0, l = list.length; i < l; i++) {
|
|
4
|
+
var obj = {
|
|
5
|
+
dataIndex: list[i].code,
|
|
6
|
+
key: list[i].code,
|
|
7
|
+
title: list[i].label,
|
|
8
|
+
width: 120,
|
|
9
|
+
ellipsis: true,
|
|
10
|
+
children: null
|
|
11
|
+
};
|
|
12
|
+
arr.push(obj);
|
|
13
|
+
if (list[i].children && list[i].children.length) {
|
|
14
|
+
obj.children = [];
|
|
15
|
+
loopColumns(list[i].children, obj.children);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function getSummaryCol(_columns) {
|
|
20
|
+
var arr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
21
|
+
_columns.forEach(function (item) {
|
|
22
|
+
if (item.children) {
|
|
23
|
+
getSummaryCol(item.children, arr);
|
|
24
|
+
} else {
|
|
25
|
+
arr.push(item);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Iprops {
|
|
3
|
+
jsons: string;
|
|
4
|
+
columns: Record<string, any>;
|
|
5
|
+
menuCode: string;
|
|
6
|
+
formTemplateCode: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
declare const Index: React.FC<Iprops>;
|
|
9
|
+
export default Index;
|
|
10
|
+
//# sourceMappingURL=viewSubtotals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewSubtotals.d.ts","sourceRoot":"","sources":["viewSubtotals.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAU5D,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CA6L3B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,243 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
+
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."); }
|
|
12
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
import { Table } from "antd";
|
|
21
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
22
|
+
|
|
23
|
+
// import HeaderCell from '../HeaderCell';
|
|
24
|
+
// import BodyCell from '../BodyCell';
|
|
25
|
+
import { queryData } from "../utils/services/global";
|
|
26
|
+
// import { formatData } from '@/utils/utils';
|
|
27
|
+
import { find, get } from "lodash";
|
|
28
|
+
import { formatData } from "../utils/utils";
|
|
29
|
+
import { getSummaryCol, loopColumns } from "./util";
|
|
30
|
+
var Index = function Index(props) {
|
|
31
|
+
var jsons = props.jsons,
|
|
32
|
+
menuCode = props.menuCode,
|
|
33
|
+
formTemplateCode = props.formTemplateCode;
|
|
34
|
+
var _useState = useState(1),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
pageNum = _useState2[0],
|
|
37
|
+
setPageNum = _useState2[1];
|
|
38
|
+
var _useState3 = useState(20),
|
|
39
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
40
|
+
pageSize = _useState4[0];
|
|
41
|
+
var _useState5 = useState(1),
|
|
42
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
43
|
+
total = _useState6[0],
|
|
44
|
+
setTotal = _useState6[1];
|
|
45
|
+
var _useState7 = useState(false),
|
|
46
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
47
|
+
loading = _useState8[0],
|
|
48
|
+
setLoading = _useState8[1];
|
|
49
|
+
var _useState9 = useState([]),
|
|
50
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
51
|
+
dataSource = _useState10[0],
|
|
52
|
+
setDataSource = _useState10[1];
|
|
53
|
+
var _useState11 = useState([]),
|
|
54
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
55
|
+
_summary = _useState12[0],
|
|
56
|
+
setSummary = _useState12[1];
|
|
57
|
+
var _useState13 = useState([{}]),
|
|
58
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
59
|
+
columns = _useState14[0],
|
|
60
|
+
setColumns = _useState14[1];
|
|
61
|
+
var _useState15 = useState(false),
|
|
62
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
63
|
+
isCrossQuery = _useState16[0],
|
|
64
|
+
setIsCrossQuery = _useState16[1];
|
|
65
|
+
var initColumns = function initColumns() {
|
|
66
|
+
try {
|
|
67
|
+
var obj = JSON.parse(jsons);
|
|
68
|
+
var _columns = [];
|
|
69
|
+
var arr = [].concat(_toConsumableArray(obj.dimensionList), _toConsumableArray(obj.quotaList));
|
|
70
|
+
props.columns.forEach(function (item) {
|
|
71
|
+
var _findItem = find(arr, function (o) {
|
|
72
|
+
return o.value === item.value;
|
|
73
|
+
});
|
|
74
|
+
if (_findItem) {
|
|
75
|
+
_columns.push(_objectSpread(_objectSpread({}, item), {}, {
|
|
76
|
+
dataIndex: item.value,
|
|
77
|
+
title: item.label,
|
|
78
|
+
ellipsis: true
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
setIsCrossQuery(obj.valueRadio === "cross");
|
|
83
|
+
setColumns(_columns);
|
|
84
|
+
} catch (error) {}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// const loopColumns = (list, arr: any = []) => {
|
|
88
|
+
// for (let i = 0, l = list.length; i < l; i++) {
|
|
89
|
+
// const obj: any = {
|
|
90
|
+
// dataIndex: list[i].code,
|
|
91
|
+
// key: list[i].code,
|
|
92
|
+
// title: list[i].label,
|
|
93
|
+
// width: 120,
|
|
94
|
+
// ellipsis: true,
|
|
95
|
+
// children: null,
|
|
96
|
+
// };
|
|
97
|
+
// arr.push(obj);
|
|
98
|
+
|
|
99
|
+
// if (list[i].children && list[i].children.length) {
|
|
100
|
+
// obj.children = [];
|
|
101
|
+
// loopColumns(list[i].children, obj.children);
|
|
102
|
+
// }
|
|
103
|
+
// }
|
|
104
|
+
// };
|
|
105
|
+
|
|
106
|
+
var getData = /*#__PURE__*/function () {
|
|
107
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
108
|
+
var chartDimensions, chartQuotas, chartColumns, crossQuery, res, _res$data, code, data, _columns, arr;
|
|
109
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
110
|
+
while (1) switch (_context.prev = _context.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
chartDimensions = _ref.chartDimensions, chartQuotas = _ref.chartQuotas, chartColumns = _ref.chartColumns, crossQuery = _ref.crossQuery;
|
|
113
|
+
setLoading(true);
|
|
114
|
+
_context.next = 4;
|
|
115
|
+
return queryData({
|
|
116
|
+
arguments: {},
|
|
117
|
+
chartDimensions: chartDimensions,
|
|
118
|
+
chartQuotas: chartQuotas,
|
|
119
|
+
formTemplateCode: formTemplateCode,
|
|
120
|
+
chartColumns: chartColumns,
|
|
121
|
+
crossQuery: crossQuery,
|
|
122
|
+
menuCode: menuCode,
|
|
123
|
+
orderKey: "",
|
|
124
|
+
orderType: "",
|
|
125
|
+
pageNum: pageNum,
|
|
126
|
+
pageSize: pageSize
|
|
127
|
+
});
|
|
128
|
+
case 4:
|
|
129
|
+
res = _context.sent;
|
|
130
|
+
_res$data = res.data, code = _res$data.code, data = _res$data.data;
|
|
131
|
+
setLoading(false);
|
|
132
|
+
if (data !== null && data !== void 0 && data.listFields && data !== null && data !== void 0 && data.listFields.length) {
|
|
133
|
+
// 设置表头
|
|
134
|
+
_columns = _toConsumableArray(data === null || data === void 0 ? void 0 : data.listFields);
|
|
135
|
+
arr = [];
|
|
136
|
+
loopColumns(_columns, arr);
|
|
137
|
+
setColumns(arr);
|
|
138
|
+
} else {
|
|
139
|
+
initColumns();
|
|
140
|
+
}
|
|
141
|
+
if (data !== null && data !== void 0 && data.rows) {
|
|
142
|
+
setDataSource(data.rows);
|
|
143
|
+
setSummary(data.summary);
|
|
144
|
+
setTotal(data.total);
|
|
145
|
+
}
|
|
146
|
+
case 9:
|
|
147
|
+
case "end":
|
|
148
|
+
return _context.stop();
|
|
149
|
+
}
|
|
150
|
+
}, _callee);
|
|
151
|
+
}));
|
|
152
|
+
return function getData(_x) {
|
|
153
|
+
return _ref2.apply(this, arguments);
|
|
154
|
+
};
|
|
155
|
+
}();
|
|
156
|
+
useEffect(function () {
|
|
157
|
+
if (!jsons) return;
|
|
158
|
+
try {
|
|
159
|
+
var obj = JSON.parse(jsons);
|
|
160
|
+
var chartDimensions = obj.dimensionList.map(function (o) {
|
|
161
|
+
return _objectSpread(_objectSpread({}, o), {}, {
|
|
162
|
+
code: o.value
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
var chartQuotas = obj.quotaList.map(function (o) {
|
|
166
|
+
return _objectSpread(_objectSpread({}, o), {}, {
|
|
167
|
+
code: o.value
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
var chartColumns = obj.chartColumns.map(function (o) {
|
|
171
|
+
return _objectSpread(_objectSpread({}, o), {}, {
|
|
172
|
+
code: o.value
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
var crossQuery = obj.valueRadio === "cross";
|
|
176
|
+
setIsCrossQuery(crossQuery);
|
|
177
|
+
getData({
|
|
178
|
+
chartDimensions: chartDimensions,
|
|
179
|
+
chartQuotas: chartQuotas,
|
|
180
|
+
chartColumns: chartColumns,
|
|
181
|
+
crossQuery: crossQuery
|
|
182
|
+
});
|
|
183
|
+
} catch (error) {}
|
|
184
|
+
}, [jsons, menuCode, formTemplateCode, pageNum]);
|
|
185
|
+
useEffect(function () {
|
|
186
|
+
if (!jsons) {
|
|
187
|
+
setDataSource([]);
|
|
188
|
+
setSummary([]);
|
|
189
|
+
setTotal(1);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
}, [jsons, props.columns]);
|
|
193
|
+
var onChangePage = function onChangePage(page, _pageSize) {
|
|
194
|
+
setPageNum(page);
|
|
195
|
+
};
|
|
196
|
+
var summaryCol = useMemo(function () {
|
|
197
|
+
var arr = [];
|
|
198
|
+
getSummaryCol(columns, arr);
|
|
199
|
+
return arr;
|
|
200
|
+
}, [columns]);
|
|
201
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
style: {
|
|
203
|
+
marginTop: 12
|
|
204
|
+
}
|
|
205
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
206
|
+
rowKey: "id"
|
|
207
|
+
// bordered
|
|
208
|
+
// components={{
|
|
209
|
+
// header: {
|
|
210
|
+
// cell: HeaderCell,
|
|
211
|
+
// },
|
|
212
|
+
// body: {
|
|
213
|
+
// cell: BodyCell,
|
|
214
|
+
// },
|
|
215
|
+
// }}
|
|
216
|
+
,
|
|
217
|
+
columns: columns,
|
|
218
|
+
scroll: {
|
|
219
|
+
x: 520,
|
|
220
|
+
y: window.innerHeight - 220
|
|
221
|
+
},
|
|
222
|
+
dataSource: dataSource,
|
|
223
|
+
pagination: isCrossQuery ? {} : {
|
|
224
|
+
defaultPageSize: pageSize,
|
|
225
|
+
total: total,
|
|
226
|
+
onChange: onChangePage
|
|
227
|
+
},
|
|
228
|
+
loading: loading,
|
|
229
|
+
size: "small",
|
|
230
|
+
summary: function summary() {
|
|
231
|
+
return _summary ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table.Summary, {
|
|
232
|
+
fixed: true
|
|
233
|
+
}, /*#__PURE__*/React.createElement(Table.Summary.Row, null, summaryCol.map(function (c, index) {
|
|
234
|
+
return /*#__PURE__*/React.createElement(Table.Summary.Cell, {
|
|
235
|
+
key: "Summary-" + index,
|
|
236
|
+
align: c.align,
|
|
237
|
+
index: index
|
|
238
|
+
}, formatData(_summary[c.dataIndex], get(c, "entryAttr.dataFormat[0]", "") || get(c, "entryAttr.formatData[0]", "")));
|
|
239
|
+
})))) : undefined;
|
|
240
|
+
}
|
|
241
|
+
}));
|
|
242
|
+
};
|
|
243
|
+
export default Index;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dustbin.d.ts","sourceRoot":"","sources":["Dustbin.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,sDAAsD,CAAC;AAmB9D,QAAA,MAAM,OAAO,uCAAwC,GAAG,sBAwDvD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|