@zgfe/modules-dm 1.0.42-alpha.9 → 1.0.56-zhongyuan.5
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/es/components/demo.js +1 -1
- package/es/constants/api.d.ts +37 -0
- package/es/constants/api.js +62 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/modules/CutsModal.d.ts +66 -0
- package/es/modules/CutsModal.js +52 -0
- package/es/modules/dataManage/collectionAttributeList.d.ts +3 -0
- package/es/modules/dataManage/collectionAttributeList.js +524 -80
- package/es/modules/dataManage/collectionEventList.d.ts +6 -0
- package/es/modules/dataManage/collectionEventList.js +482 -62
- package/es/modules/dataManage/components/createAttrDrawer.d.ts +4 -0
- package/es/modules/dataManage/components/createAttrDrawer.js +264 -0
- package/es/modules/dataManage/components/createMetaDrawer.d.ts +4 -0
- package/es/modules/dataManage/components/createMetaDrawer.js +618 -0
- package/es/modules/dataManage/components/createVirtualDrawer.js +19 -19
- package/es/modules/dataManage/components/creditPop/imgs/link.png +0 -0
- package/es/modules/dataManage/components/creditPop/imgs/png01.png +0 -0
- package/es/modules/dataManage/components/creditPop/imgs/png02.png +0 -0
- package/es/modules/dataManage/components/creditPop/imgs/png03.png +0 -0
- package/es/modules/dataManage/components/creditPop/imgs/png04.png +0 -0
- package/es/modules/dataManage/components/creditPop/index.d.ts +6 -0
- package/es/modules/dataManage/components/creditPop/index.js +89 -0
- package/es/modules/dataManage/components/creditPop/index.less +121 -0
- package/es/modules/dataManage/components/deleteConfirm.d.ts +9 -0
- package/es/modules/dataManage/components/deleteConfirm.js +36 -0
- package/es/modules/dataManage/components/deleteUserAttrConfirm.d.ts +9 -0
- package/es/modules/dataManage/components/deleteUserAttrConfirm.js +57 -0
- package/es/modules/dataManage/components/depositPop/imgs/link.png +0 -0
- package/es/modules/dataManage/components/depositPop/imgs/png01.png +0 -0
- package/es/modules/dataManage/components/depositPop/imgs/png02.png +0 -0
- package/es/modules/dataManage/components/depositPop/index.d.ts +6 -0
- package/es/modules/dataManage/components/depositPop/index.js +89 -0
- package/es/modules/dataManage/components/depositPop/index.less +115 -0
- package/es/modules/dataManage/components/developModal/index.css +36 -0
- package/es/modules/dataManage/components/developModal/index.d.ts +6 -0
- package/es/modules/dataManage/components/developModal/index.js +224 -0
- package/es/modules/dataManage/components/developModal/index.less +36 -0
- package/es/modules/dataManage/components/editTxt/index.d.ts +3 -0
- package/es/modules/dataManage/components/editTxt/index.js +123 -0
- package/es/modules/dataManage/components/editTxt/index.less +44 -0
- package/es/modules/dataManage/components/editTxt/types.d.ts +48 -0
- package/es/modules/dataManage/components/editTxt/types.js +1 -0
- package/es/modules/dataManage/components/eventFilter/index.js +13 -13
- package/es/modules/dataManage/components/eventFilter/styles/index.less +72 -72
- package/es/modules/dataManage/components/eventGroupingDrawer.js +41 -44
- package/es/modules/dataManage/components/importAttrDialog/demo/index.d.ts +3 -0
- package/es/modules/dataManage/components/importAttrDialog/demo/index.js +28 -0
- package/es/modules/dataManage/components/importAttrDialog/index.d.ts +7 -0
- package/es/modules/dataManage/components/importAttrDialog/index.js +159 -0
- package/es/modules/dataManage/components/importAttrDialog/styles/index.less +90 -0
- package/es/modules/dataManage/components/importMetaDialog/demo/index.d.ts +3 -0
- package/es/modules/dataManage/components/importMetaDialog/demo/index.js +28 -0
- package/es/modules/dataManage/components/importMetaDialog/index.d.ts +7 -0
- package/es/modules/dataManage/components/importMetaDialog/index.js +159 -0
- package/es/modules/dataManage/components/importMetaDialog/styles/index.less +91 -0
- package/es/modules/dataManage/components/selectAttributes.js +10 -10
- package/es/modules/dataManage/components/tablePlus.d.ts +4 -0
- package/es/modules/dataManage/components/tablePlus.js +625 -94
- package/es/modules/dataManage/components/virtualTablePlus.js +7 -7
- package/es/modules/dataManage/demo/index.d.ts +2 -1
- package/es/modules/dataManage/demo/index.js +79 -16
- package/es/modules/dataManage/detailedData/DetailedDataForm.d.ts +5 -0
- package/es/modules/dataManage/detailedData/DetailedDataForm.js +216 -0
- package/es/modules/dataManage/detailedData/index.d.ts +24 -0
- package/es/modules/dataManage/detailedData/index.js +403 -0
- package/es/modules/dataManage/detailedData/useColumns.d.ts +34 -0
- package/es/modules/dataManage/detailedData/useColumns.js +135 -0
- package/es/modules/dataManage/index.d.ts +9 -4
- package/es/modules/dataManage/index.js +142 -50
- package/es/modules/dataManage/styles/detailed.less +74 -0
- package/es/modules/dataManage/styles/index.less +1195 -841
- package/es/modules/dataManage/types.d.ts +8 -0
- package/es/modules/dataManage/virtualEventList.js +13 -13
- package/es/modules/dataMap/component/data.d.ts +7 -0
- package/es/modules/dataMap/component/data.js +257 -0
- package/es/modules/dataMap/component/drawerAdd.d.ts +6 -0
- package/es/modules/dataMap/component/drawerAdd.js +379 -0
- package/es/modules/dataMap/component/leftTree.d.ts +6 -0
- package/es/modules/dataMap/component/leftTree.js +232 -0
- package/es/modules/dataMap/component/rightDetail.d.ts +7 -0
- package/es/modules/dataMap/component/rightDetail.js +694 -0
- package/es/modules/dataMap/component/selectAttr.d.ts +7 -0
- package/es/modules/dataMap/component/selectAttr.js +92 -0
- package/es/modules/dataMap/css/index.css +163 -0
- package/es/modules/dataMap/css/index.less +177 -0
- package/es/modules/dataMap/demo/index.d.ts +3 -0
- package/es/modules/dataMap/demo/index.js +6 -0
- package/es/modules/dataMap/img/empty-data.png +0 -0
- package/es/modules/dataMap/index.d.ts +3 -0
- package/es/modules/dataMap/index.js +80 -0
- package/es/modules/dataMap/mapDetail.d.ts +3 -0
- package/es/modules/dataMap/mapDetail.js +44 -0
- package/es/modules/dataMap/mapSetting.d.ts +6 -0
- package/es/modules/dataMap/mapSetting.js +156 -0
- package/es/modules/dataPlan/addEventOrUser.js +31 -30
- package/es/modules/dataPlan/addPlan.js +29 -27
- package/es/modules/dataPlan/eventList.js +2 -2
- package/es/modules/dataPlan/index.js +10 -10
- package/es/modules/dataPlan/search.js +6 -5
- package/es/modules/dataPlan/styles/index.less +316 -316
- package/es/modules/dataPlan/tablePlus.js +3 -3
- package/es/modules/dataPlan/userAttributeList.js +5 -5
- package/es/modules/dataReal/css/index.css +48 -0
- package/es/modules/dataReal/css/index.less +51 -0
- package/es/modules/dataReal/demo/index.d.ts +3 -0
- package/es/modules/dataReal/demo/index.js +6 -0
- package/es/modules/dataReal/index1.d.ts +28 -0
- package/es/modules/dataReal/index1.js +247 -0
- package/es/modules/dataReal/table.d.ts +5 -0
- package/es/modules/dataReal/table.js +260 -0
- package/es/store/index.js +11 -11
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +9 -1
- package/package.json +64 -58
|
@@ -0,0 +1,403 @@
|
|
|
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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
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 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 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 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; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
13
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
14
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
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(r) { if (Array.isArray(r)) return r; }
|
|
20
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
21
|
+
import '../styles/detailed.less';
|
|
22
|
+
import { BizSearchInput, IconFont, BizGlobalDataContext, BizTable } from '@zgfe/business-lib';
|
|
23
|
+
import { Button, Modal, message, notification } from 'antd';
|
|
24
|
+
import request from '../../../utils/ajax';
|
|
25
|
+
import apis from '../../../constants/api';
|
|
26
|
+
import DetailedDataForm from './DetailedDataForm';
|
|
27
|
+
import useColumns from './useColumns';
|
|
28
|
+
export var classPrefix = 'detailed-data';
|
|
29
|
+
var modalConfig = {
|
|
30
|
+
className: "".concat(classPrefix, "-modal"),
|
|
31
|
+
width: '520px',
|
|
32
|
+
closable: true,
|
|
33
|
+
cancelText: '取消',
|
|
34
|
+
okText: '确认',
|
|
35
|
+
destroyOnClose: true
|
|
36
|
+
};
|
|
37
|
+
var DetailedData = function DetailedData(props) {
|
|
38
|
+
var _basicConfig$publicCo, _basicConfig$publicCo2;
|
|
39
|
+
var _props$companyId = props.companyId,
|
|
40
|
+
companyId = _props$companyId === void 0 ? 1 : _props$companyId;
|
|
41
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
42
|
+
currentApp = _useContext.currentApp,
|
|
43
|
+
currentProject = _useContext.currentProject,
|
|
44
|
+
basicConfig = _useContext.basicConfig,
|
|
45
|
+
authority = _useContext.authority;
|
|
46
|
+
var isOpen = Boolean(basicConfig === null || basicConfig === void 0 ? void 0 : (_basicConfig$publicCo = basicConfig.publicConfig) === null || _basicConfig$publicCo === void 0 ? void 0 : (_basicConfig$publicCo2 = _basicConfig$publicCo.subject) === null || _basicConfig$publicCo2 === void 0 ? void 0 : _basicConfig$publicCo2.isOpen);
|
|
47
|
+
var _useState = useState(''),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
search = _useState2[0],
|
|
50
|
+
setSearch = _useState2[1];
|
|
51
|
+
var _useState3 = useState([]),
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
dataSource = _useState4[0],
|
|
54
|
+
setDataSource = _useState4[1];
|
|
55
|
+
var _useState5 = useState(false),
|
|
56
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
57
|
+
loading = _useState6[0],
|
|
58
|
+
setLoading = _useState6[1];
|
|
59
|
+
var formRef = useRef('');
|
|
60
|
+
var _Modal$useModal = Modal.useModal(),
|
|
61
|
+
_Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
|
|
62
|
+
modal = _Modal$useModal2[0],
|
|
63
|
+
contextHolder = _Modal$useModal2[1];
|
|
64
|
+
var _useColumns = useColumns(handleQueryList),
|
|
65
|
+
columns = _useColumns.columns,
|
|
66
|
+
pagination = _useColumns.pagination,
|
|
67
|
+
sorterRef = _useColumns.sorterRef,
|
|
68
|
+
datasetList = _useColumns.datasetList,
|
|
69
|
+
paginationRef = _useColumns.paginationRef,
|
|
70
|
+
setPagination = _useColumns.setPagination,
|
|
71
|
+
handleTableChange = _useColumns.handleTableChange;
|
|
72
|
+
function handleQueryList() {
|
|
73
|
+
return _handleQueryList.apply(this, arguments);
|
|
74
|
+
}
|
|
75
|
+
function _handleQueryList() {
|
|
76
|
+
_handleQueryList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
77
|
+
var data, res, _res$data, _res$data2;
|
|
78
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
79
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
setLoading(true);
|
|
82
|
+
_context4.prev = 1;
|
|
83
|
+
data = {
|
|
84
|
+
name: search,
|
|
85
|
+
sort: sorterRef.order,
|
|
86
|
+
pageSize: paginationRef.pageSize,
|
|
87
|
+
pageNo: paginationRef.pageNo,
|
|
88
|
+
subjectId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
89
|
+
};
|
|
90
|
+
Object.keys(data).forEach(function (key) {
|
|
91
|
+
if (data[key] === undefined || data[key] === '') {
|
|
92
|
+
Reflect.deleteProperty(data, key);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
_context4.next = 6;
|
|
96
|
+
return request(apis.queryMetaDataSet, {
|
|
97
|
+
method: 'post',
|
|
98
|
+
data: data
|
|
99
|
+
});
|
|
100
|
+
case 6:
|
|
101
|
+
res = _context4.sent;
|
|
102
|
+
setLoading(false);
|
|
103
|
+
if (['101000', '100000'].includes(res === null || res === void 0 ? void 0 : res.code)) {
|
|
104
|
+
if (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.results) {
|
|
105
|
+
setDataSource(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.results);
|
|
106
|
+
setPagination(function (pre) {
|
|
107
|
+
var _res$data3;
|
|
108
|
+
return _objectSpread(_objectSpread({}, pre), {}, {
|
|
109
|
+
total: (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.total
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
setDataSource([]);
|
|
114
|
+
setPagination(function (pre) {
|
|
115
|
+
return _objectSpread(_objectSpread({}, pre), {}, {
|
|
116
|
+
pageNo: 1,
|
|
117
|
+
total: 0
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
_context4.next = 16;
|
|
123
|
+
break;
|
|
124
|
+
case 11:
|
|
125
|
+
_context4.prev = 11;
|
|
126
|
+
_context4.t0 = _context4["catch"](1);
|
|
127
|
+
console.log(_context4.t0);
|
|
128
|
+
setLoading(false);
|
|
129
|
+
notification.error({
|
|
130
|
+
message: _context4.t0
|
|
131
|
+
});
|
|
132
|
+
case 16:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context4.stop();
|
|
135
|
+
}
|
|
136
|
+
}, _callee4, null, [[1, 11]]);
|
|
137
|
+
}));
|
|
138
|
+
return _handleQueryList.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
useEffect(function () {
|
|
141
|
+
paginationRef.pageNo = 1;
|
|
142
|
+
setPagination(function (pre) {
|
|
143
|
+
return _objectSpread(_objectSpread({}, pre), {}, {
|
|
144
|
+
pageNo: 1
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
setTimeout(function () {
|
|
148
|
+
handleQueryList();
|
|
149
|
+
}, 500);
|
|
150
|
+
}, [search]);
|
|
151
|
+
var hasNoPermission = function hasNoPermission() {
|
|
152
|
+
return message.error('无修改权限');
|
|
153
|
+
};
|
|
154
|
+
var operateColumn = {
|
|
155
|
+
title: '操作',
|
|
156
|
+
dataIndex: 'operate',
|
|
157
|
+
key: 'operate',
|
|
158
|
+
render: function render(val, record) {
|
|
159
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
className: "".concat(classPrefix, "-operate")
|
|
161
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
162
|
+
className: !authority[1716287056] ? "".concat(classPrefix, "-a-disabled") : '',
|
|
163
|
+
onClick: function onClick() {
|
|
164
|
+
return authority[1716287056] ? handleEditClick(record) : hasNoPermission();
|
|
165
|
+
}
|
|
166
|
+
}, "\u7F16\u8F91"), /*#__PURE__*/React.createElement("a", {
|
|
167
|
+
className: !authority[1716287098] ? "".concat(classPrefix, "-a-disabled") : '',
|
|
168
|
+
onClick: function onClick() {
|
|
169
|
+
return authority[1716287098] ? handleDeleteClick(record) : hasNoPermission();
|
|
170
|
+
}
|
|
171
|
+
}, "\u5220\u9664"));
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
var handleEditClick = function handleEditClick(record) {
|
|
175
|
+
modal.confirm(_objectSpread(_objectSpread({}, modalConfig), {}, {
|
|
176
|
+
icon: null,
|
|
177
|
+
title: '编辑明细数据',
|
|
178
|
+
onCancel: function onCancel() {},
|
|
179
|
+
onOk: function () {
|
|
180
|
+
var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
181
|
+
var _formRef$current, _formRef$current2, data, dataset, res;
|
|
182
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
183
|
+
while (1) switch (_context.prev = _context.next) {
|
|
184
|
+
case 0:
|
|
185
|
+
_context.prev = 0;
|
|
186
|
+
_context.next = 3;
|
|
187
|
+
return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.validateFields();
|
|
188
|
+
case 3:
|
|
189
|
+
data = (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue();
|
|
190
|
+
dataset = datasetList.find(function (item) {
|
|
191
|
+
return item.value == data.datasetId;
|
|
192
|
+
});
|
|
193
|
+
_context.next = 7;
|
|
194
|
+
return request(apis.editMetaDataSet, {
|
|
195
|
+
method: 'post',
|
|
196
|
+
data: _objectSpread(_objectSpread({}, data), {}, {
|
|
197
|
+
id: record === null || record === void 0 ? void 0 : record.id,
|
|
198
|
+
datasetName: dataset === null || dataset === void 0 ? void 0 : dataset.label
|
|
199
|
+
}),
|
|
200
|
+
intercept: false
|
|
201
|
+
});
|
|
202
|
+
case 7:
|
|
203
|
+
res = _context.sent;
|
|
204
|
+
if (!((res === null || res === void 0 ? void 0 : res.code) != '100000')) {
|
|
205
|
+
_context.next = 11;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
message.error(res === null || res === void 0 ? void 0 : res.msg);
|
|
209
|
+
return _context.abrupt("return", Promise.reject());
|
|
210
|
+
case 11:
|
|
211
|
+
message.success('编辑成功');
|
|
212
|
+
handleQueryList();
|
|
213
|
+
_context.next = 19;
|
|
214
|
+
break;
|
|
215
|
+
case 15:
|
|
216
|
+
_context.prev = 15;
|
|
217
|
+
_context.t0 = _context["catch"](0);
|
|
218
|
+
console.log(_context.t0);
|
|
219
|
+
return _context.abrupt("return", Promise.reject(_context.t0));
|
|
220
|
+
case 19:
|
|
221
|
+
case "end":
|
|
222
|
+
return _context.stop();
|
|
223
|
+
}
|
|
224
|
+
}, _callee, null, [[0, 15]]);
|
|
225
|
+
}));
|
|
226
|
+
function onOk() {
|
|
227
|
+
return _onOk.apply(this, arguments);
|
|
228
|
+
}
|
|
229
|
+
return onOk;
|
|
230
|
+
}(),
|
|
231
|
+
content: (/*#__PURE__*/React.createElement(DetailedDataForm, _objectSpread(_objectSpread({}, record), {}, {
|
|
232
|
+
isOpen: isOpen,
|
|
233
|
+
ref: formRef,
|
|
234
|
+
datasetList: datasetList,
|
|
235
|
+
currentApp: currentApp,
|
|
236
|
+
currentProject: currentProject
|
|
237
|
+
})))
|
|
238
|
+
}));
|
|
239
|
+
};
|
|
240
|
+
var handleCreateClick = function handleCreateClick() {
|
|
241
|
+
modal.confirm(_objectSpread(_objectSpread({}, modalConfig), {}, {
|
|
242
|
+
icon: null,
|
|
243
|
+
title: '新增明细数据',
|
|
244
|
+
onCancel: function onCancel() {},
|
|
245
|
+
onOk: function () {
|
|
246
|
+
var _onOk2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
247
|
+
var _formRef$current3, data, dataset, res;
|
|
248
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
249
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
250
|
+
case 0:
|
|
251
|
+
_context2.prev = 0;
|
|
252
|
+
_context2.next = 3;
|
|
253
|
+
return (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.validateFields();
|
|
254
|
+
case 3:
|
|
255
|
+
data = formRef.current.getFieldsValue();
|
|
256
|
+
dataset = datasetList.find(function (item) {
|
|
257
|
+
return item.value == data.datasetId;
|
|
258
|
+
});
|
|
259
|
+
_context2.next = 7;
|
|
260
|
+
return request(apis.addMetaDataSet, {
|
|
261
|
+
method: 'post',
|
|
262
|
+
data: _objectSpread(_objectSpread({}, data), {}, {
|
|
263
|
+
companyId: companyId,
|
|
264
|
+
datasetTableName: dataset === null || dataset === void 0 ? void 0 : dataset.tableName,
|
|
265
|
+
datasetName: dataset === null || dataset === void 0 ? void 0 : dataset.label
|
|
266
|
+
}),
|
|
267
|
+
intercept: false
|
|
268
|
+
});
|
|
269
|
+
case 7:
|
|
270
|
+
res = _context2.sent;
|
|
271
|
+
if (!((res === null || res === void 0 ? void 0 : res.code) != '100000')) {
|
|
272
|
+
_context2.next = 11;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
message.error(res === null || res === void 0 ? void 0 : res.msg);
|
|
276
|
+
return _context2.abrupt("return", Promise.reject());
|
|
277
|
+
case 11:
|
|
278
|
+
message.success('创建成功');
|
|
279
|
+
handleQueryList();
|
|
280
|
+
_context2.next = 19;
|
|
281
|
+
break;
|
|
282
|
+
case 15:
|
|
283
|
+
_context2.prev = 15;
|
|
284
|
+
_context2.t0 = _context2["catch"](0);
|
|
285
|
+
console.log(_context2.t0);
|
|
286
|
+
return _context2.abrupt("return", Promise.reject(_context2.t0));
|
|
287
|
+
case 19:
|
|
288
|
+
case "end":
|
|
289
|
+
return _context2.stop();
|
|
290
|
+
}
|
|
291
|
+
}, _callee2, null, [[0, 15]]);
|
|
292
|
+
}));
|
|
293
|
+
function onOk() {
|
|
294
|
+
return _onOk2.apply(this, arguments);
|
|
295
|
+
}
|
|
296
|
+
return onOk;
|
|
297
|
+
}(),
|
|
298
|
+
content: (/*#__PURE__*/React.createElement(DetailedDataForm, {
|
|
299
|
+
ref: formRef,
|
|
300
|
+
isOpen: isOpen,
|
|
301
|
+
datasetList: datasetList,
|
|
302
|
+
currentApp: currentApp,
|
|
303
|
+
currentProject: currentProject
|
|
304
|
+
}))
|
|
305
|
+
}));
|
|
306
|
+
};
|
|
307
|
+
var handleDeleteClick = function handleDeleteClick(record) {
|
|
308
|
+
modal.confirm(_objectSpread(_objectSpread({}, modalConfig), {}, {
|
|
309
|
+
title: '提示',
|
|
310
|
+
content: '删除后不可恢复,绑定该明细数据的标签、分群,需要重新计算和绑定。',
|
|
311
|
+
onCancel: function onCancel() {},
|
|
312
|
+
onOk: function () {
|
|
313
|
+
var _onOk3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
314
|
+
var res;
|
|
315
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
316
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
317
|
+
case 0:
|
|
318
|
+
_context3.prev = 0;
|
|
319
|
+
_context3.next = 3;
|
|
320
|
+
return request(apis.deleteMetaDataSet, {
|
|
321
|
+
method: 'post',
|
|
322
|
+
data: {
|
|
323
|
+
id: record === null || record === void 0 ? void 0 : record.id
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
case 3:
|
|
327
|
+
res = _context3.sent;
|
|
328
|
+
if (!((res === null || res === void 0 ? void 0 : res.code) != '100000')) {
|
|
329
|
+
_context3.next = 6;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
return _context3.abrupt("return");
|
|
333
|
+
case 6:
|
|
334
|
+
message.success('删除成功');
|
|
335
|
+
handleQueryList();
|
|
336
|
+
_context3.next = 14;
|
|
337
|
+
break;
|
|
338
|
+
case 10:
|
|
339
|
+
_context3.prev = 10;
|
|
340
|
+
_context3.t0 = _context3["catch"](0);
|
|
341
|
+
console.log(_context3.t0);
|
|
342
|
+
return _context3.abrupt("return", Promise.reject(_context3.t0));
|
|
343
|
+
case 14:
|
|
344
|
+
case "end":
|
|
345
|
+
return _context3.stop();
|
|
346
|
+
}
|
|
347
|
+
}, _callee3, null, [[0, 10]]);
|
|
348
|
+
}));
|
|
349
|
+
function onOk() {
|
|
350
|
+
return _onOk3.apply(this, arguments);
|
|
351
|
+
}
|
|
352
|
+
return onOk;
|
|
353
|
+
}()
|
|
354
|
+
}));
|
|
355
|
+
};
|
|
356
|
+
var handleWindowOpen = function handleWindowOpen() {
|
|
357
|
+
window.open('https://docs.zhugeio.com/datamanager/detail_data.html', '_blank');
|
|
358
|
+
};
|
|
359
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
360
|
+
className: "".concat(classPrefix)
|
|
361
|
+
}, contextHolder, /*#__PURE__*/React.createElement("div", {
|
|
362
|
+
className: "".concat(classPrefix, "-header")
|
|
363
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
364
|
+
className: "".concat(classPrefix, "-header-left")
|
|
365
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizSearchInput, {
|
|
366
|
+
placeholder: "\u8BF7\u8F93\u5165\u660E\u7EC6\u6570\u636E\u540D\u79F0",
|
|
367
|
+
value: search,
|
|
368
|
+
onChange: setSearch
|
|
369
|
+
})), /*#__PURE__*/React.createElement("div", null, "\u5171\u641C\u7D22\u5230", /*#__PURE__*/React.createElement("a", null, " ", pagination.total, " "), "\u6761\u6570\u636E")), /*#__PURE__*/React.createElement("div", {
|
|
370
|
+
className: "".concat(classPrefix, "-header-right")
|
|
371
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
372
|
+
disabled: !authority[1716286977],
|
|
373
|
+
type: "primary",
|
|
374
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
375
|
+
type: "zengjia"
|
|
376
|
+
}),
|
|
377
|
+
onClick: handleCreateClick
|
|
378
|
+
}, "\u521B\u5EFA\u660E\u7EC6\u6570\u636E"))), /*#__PURE__*/React.createElement(BizTable, {
|
|
379
|
+
rowKey: "id",
|
|
380
|
+
loading: loading,
|
|
381
|
+
columns: [].concat(_toConsumableArray(columns), [operateColumn]),
|
|
382
|
+
dataSource: dataSource,
|
|
383
|
+
scroll: {
|
|
384
|
+
x: 1000,
|
|
385
|
+
y: 550
|
|
386
|
+
},
|
|
387
|
+
pagination: {
|
|
388
|
+
className: 'biz-pagination',
|
|
389
|
+
current: pagination.pageNo,
|
|
390
|
+
pageSize: pagination.pageSize,
|
|
391
|
+
showQuickJumper: true,
|
|
392
|
+
showSizeChanger: true,
|
|
393
|
+
total: pagination.total,
|
|
394
|
+
showTotal: function showTotal(totalNum) {
|
|
395
|
+
return /*#__PURE__*/React.createElement("span", null, "\u5171 ", /*#__PURE__*/React.createElement("a", {
|
|
396
|
+
className: "biz-table-total"
|
|
397
|
+
}, totalNum), " \u6761");
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
onChange: handleTableChange
|
|
401
|
+
}));
|
|
402
|
+
};
|
|
403
|
+
export default DetailedData;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ColumnProps } from 'antd/lib/table';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { RecordType } from '.';
|
|
4
|
+
export interface DatasetOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
tableName: string;
|
|
8
|
+
}
|
|
9
|
+
export default function useColumns(handleQueryList: () => void): {
|
|
10
|
+
columns: ColumnProps<RecordType>[];
|
|
11
|
+
pagination: {
|
|
12
|
+
pageCount: number;
|
|
13
|
+
pageNo: number;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
total: number;
|
|
16
|
+
};
|
|
17
|
+
datasetList: DatasetOption[];
|
|
18
|
+
sorterRef: {
|
|
19
|
+
order: 0 | 1 | undefined;
|
|
20
|
+
};
|
|
21
|
+
paginationRef: {
|
|
22
|
+
pageCount: number;
|
|
23
|
+
pageNo: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
total: number;
|
|
26
|
+
};
|
|
27
|
+
setPagination: React.Dispatch<React.SetStateAction<{
|
|
28
|
+
pageCount: number;
|
|
29
|
+
pageNo: number;
|
|
30
|
+
pageSize: number;
|
|
31
|
+
total: number;
|
|
32
|
+
}>>;
|
|
33
|
+
handleTableChange: (pagination: any, filters: any, sorter: any) => void;
|
|
34
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
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(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : 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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
|
+
import { Tooltip } from 'antd';
|
|
15
|
+
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
16
|
+
import request from '../../../utils/ajax';
|
|
17
|
+
import apis from '../../../constants/api';
|
|
18
|
+
export default function useColumns(handleQueryList) {
|
|
19
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
20
|
+
basicConfig = _useContext.basicConfig,
|
|
21
|
+
currentProject = _useContext.currentProject;
|
|
22
|
+
var _useState = useState({
|
|
23
|
+
pageCount: 0,
|
|
24
|
+
pageNo: 1,
|
|
25
|
+
pageSize: 20,
|
|
26
|
+
total: 0
|
|
27
|
+
}),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
pagination = _useState2[0],
|
|
30
|
+
setPagination = _useState2[1];
|
|
31
|
+
var _useState3 = useState([]),
|
|
32
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
+
datasetList = _useState4[0],
|
|
34
|
+
setDatasetList = _useState4[1]; // 关联数据集
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
request(apis.querySimpleDataset, {
|
|
37
|
+
method: 'post',
|
|
38
|
+
data: {
|
|
39
|
+
projectId: currentProject === null || currentProject === void 0 ? void 0 : currentProject.projectId
|
|
40
|
+
}
|
|
41
|
+
}).then(function (res) {
|
|
42
|
+
if (!res) return;
|
|
43
|
+
var data = res === null || res === void 0 ? void 0 : res.data.filter(function (item) {
|
|
44
|
+
return Boolean(item.tableName);
|
|
45
|
+
}).map(function (item) {
|
|
46
|
+
return {
|
|
47
|
+
label: item.name,
|
|
48
|
+
value: item.id,
|
|
49
|
+
tableName: item.tableName
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
setDatasetList(data);
|
|
53
|
+
});
|
|
54
|
+
}, []);
|
|
55
|
+
var sorterRef = useRef({
|
|
56
|
+
order: undefined
|
|
57
|
+
});
|
|
58
|
+
var paginationRef = useRef({
|
|
59
|
+
pageCount: 0,
|
|
60
|
+
pageNo: 1,
|
|
61
|
+
pageSize: 20,
|
|
62
|
+
total: 0
|
|
63
|
+
});
|
|
64
|
+
var handleTableChange = function handleTableChange(pagination, filters, sorter) {
|
|
65
|
+
if (!sorter.order) {
|
|
66
|
+
sorterRef.current.order = undefined;
|
|
67
|
+
} else {
|
|
68
|
+
sorterRef.current.order = sorter.order == 'ascend' ? 1 : 0;
|
|
69
|
+
}
|
|
70
|
+
paginationRef.current.pageNo = pagination.current;
|
|
71
|
+
paginationRef.current.pageSize = pagination.pageSize;
|
|
72
|
+
setPagination(function (pre) {
|
|
73
|
+
return _objectSpread(_objectSpread({}, pre), {}, {
|
|
74
|
+
pageNo: pagination.current,
|
|
75
|
+
pageSize: pagination.pageSize
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
handleQueryList();
|
|
79
|
+
};
|
|
80
|
+
var columns = useMemo(function () {
|
|
81
|
+
var array = [{
|
|
82
|
+
title: '明细数据名称',
|
|
83
|
+
dataIndex: 'name',
|
|
84
|
+
ellipsis: true,
|
|
85
|
+
render: function render(value) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
87
|
+
title: value
|
|
88
|
+
}, /*#__PURE__*/React.createElement("span", null, value));
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
title: '关联数据集',
|
|
92
|
+
dataIndex: 'datasetName'
|
|
93
|
+
}, {
|
|
94
|
+
title: '关联主体',
|
|
95
|
+
dataIndex: 'subjectId',
|
|
96
|
+
render: function render(value) {
|
|
97
|
+
var _currentProject$appLi, _obj$label;
|
|
98
|
+
var obj = currentProject === null || currentProject === void 0 ? void 0 : (_currentProject$appLi = currentProject.appList) === null || _currentProject$appLi === void 0 ? void 0 : _currentProject$appLi.map(function (item) {
|
|
99
|
+
return {
|
|
100
|
+
label: item.appName,
|
|
101
|
+
value: item.id
|
|
102
|
+
};
|
|
103
|
+
}).find(function (item) {
|
|
104
|
+
return (item === null || item === void 0 ? void 0 : item.value) == value;
|
|
105
|
+
});
|
|
106
|
+
return (_obj$label = obj === null || obj === void 0 ? void 0 : obj.label) !== null && _obj$label !== void 0 ? _obj$label : value;
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
title: '创建人',
|
|
110
|
+
dataIndex: 'creatorName'
|
|
111
|
+
}, {
|
|
112
|
+
title: '创建时间',
|
|
113
|
+
dataIndex: 'createOn',
|
|
114
|
+
showSorterTooltip: false,
|
|
115
|
+
sorter: true
|
|
116
|
+
}];
|
|
117
|
+
array = array.filter(function (item) {
|
|
118
|
+
var _basicConfig$publicCo, _basicConfig$publicCo2;
|
|
119
|
+
if (Boolean(basicConfig === null || basicConfig === void 0 ? void 0 : (_basicConfig$publicCo = basicConfig.publicConfig) === null || _basicConfig$publicCo === void 0 ? void 0 : (_basicConfig$publicCo2 = _basicConfig$publicCo.subject) === null || _basicConfig$publicCo2 === void 0 ? void 0 : _basicConfig$publicCo2.isOpen)) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
return item.dataIndex !== 'subjectId';
|
|
123
|
+
});
|
|
124
|
+
return array;
|
|
125
|
+
}, [currentProject, basicConfig]);
|
|
126
|
+
return {
|
|
127
|
+
columns: columns,
|
|
128
|
+
pagination: pagination,
|
|
129
|
+
datasetList: datasetList,
|
|
130
|
+
sorterRef: sorterRef.current,
|
|
131
|
+
paginationRef: paginationRef.current,
|
|
132
|
+
setPagination: setPagination,
|
|
133
|
+
handleTableChange: handleTableChange
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -10,10 +10,15 @@ interface DataManageProps {
|
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
[other: string]: any;
|
|
12
12
|
}[];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
isSelect?: boolean;
|
|
14
|
+
isSingleSelect?: boolean;
|
|
15
|
+
isSelectTab?: string;
|
|
16
|
+
selectObj: {
|
|
17
|
+
selectEventList: [];
|
|
18
|
+
selectAttrList: [];
|
|
19
|
+
};
|
|
20
|
+
selectTreeName: '';
|
|
21
|
+
onChangeSelectObj?: (data: any) => void;
|
|
17
22
|
}
|
|
18
23
|
declare const DataManage: React.FC<DataManageProps>;
|
|
19
24
|
export default DataManage;
|