@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.
Files changed (115) hide show
  1. package/es/components/demo.js +1 -1
  2. package/es/constants/api.d.ts +37 -0
  3. package/es/constants/api.js +62 -1
  4. package/es/index.d.ts +3 -1
  5. package/es/index.js +3 -1
  6. package/es/modules/CutsModal.d.ts +66 -0
  7. package/es/modules/CutsModal.js +52 -0
  8. package/es/modules/dataManage/collectionAttributeList.d.ts +3 -0
  9. package/es/modules/dataManage/collectionAttributeList.js +524 -80
  10. package/es/modules/dataManage/collectionEventList.d.ts +6 -0
  11. package/es/modules/dataManage/collectionEventList.js +482 -62
  12. package/es/modules/dataManage/components/createAttrDrawer.d.ts +4 -0
  13. package/es/modules/dataManage/components/createAttrDrawer.js +264 -0
  14. package/es/modules/dataManage/components/createMetaDrawer.d.ts +4 -0
  15. package/es/modules/dataManage/components/createMetaDrawer.js +618 -0
  16. package/es/modules/dataManage/components/createVirtualDrawer.js +19 -19
  17. package/es/modules/dataManage/components/creditPop/imgs/link.png +0 -0
  18. package/es/modules/dataManage/components/creditPop/imgs/png01.png +0 -0
  19. package/es/modules/dataManage/components/creditPop/imgs/png02.png +0 -0
  20. package/es/modules/dataManage/components/creditPop/imgs/png03.png +0 -0
  21. package/es/modules/dataManage/components/creditPop/imgs/png04.png +0 -0
  22. package/es/modules/dataManage/components/creditPop/index.d.ts +6 -0
  23. package/es/modules/dataManage/components/creditPop/index.js +89 -0
  24. package/es/modules/dataManage/components/creditPop/index.less +121 -0
  25. package/es/modules/dataManage/components/deleteConfirm.d.ts +9 -0
  26. package/es/modules/dataManage/components/deleteConfirm.js +36 -0
  27. package/es/modules/dataManage/components/deleteUserAttrConfirm.d.ts +9 -0
  28. package/es/modules/dataManage/components/deleteUserAttrConfirm.js +57 -0
  29. package/es/modules/dataManage/components/depositPop/imgs/link.png +0 -0
  30. package/es/modules/dataManage/components/depositPop/imgs/png01.png +0 -0
  31. package/es/modules/dataManage/components/depositPop/imgs/png02.png +0 -0
  32. package/es/modules/dataManage/components/depositPop/index.d.ts +6 -0
  33. package/es/modules/dataManage/components/depositPop/index.js +89 -0
  34. package/es/modules/dataManage/components/depositPop/index.less +115 -0
  35. package/es/modules/dataManage/components/developModal/index.css +36 -0
  36. package/es/modules/dataManage/components/developModal/index.d.ts +6 -0
  37. package/es/modules/dataManage/components/developModal/index.js +224 -0
  38. package/es/modules/dataManage/components/developModal/index.less +36 -0
  39. package/es/modules/dataManage/components/editTxt/index.d.ts +3 -0
  40. package/es/modules/dataManage/components/editTxt/index.js +123 -0
  41. package/es/modules/dataManage/components/editTxt/index.less +44 -0
  42. package/es/modules/dataManage/components/editTxt/types.d.ts +48 -0
  43. package/es/modules/dataManage/components/editTxt/types.js +1 -0
  44. package/es/modules/dataManage/components/eventFilter/index.js +13 -13
  45. package/es/modules/dataManage/components/eventFilter/styles/index.less +72 -72
  46. package/es/modules/dataManage/components/eventGroupingDrawer.js +41 -44
  47. package/es/modules/dataManage/components/importAttrDialog/demo/index.d.ts +3 -0
  48. package/es/modules/dataManage/components/importAttrDialog/demo/index.js +28 -0
  49. package/es/modules/dataManage/components/importAttrDialog/index.d.ts +7 -0
  50. package/es/modules/dataManage/components/importAttrDialog/index.js +159 -0
  51. package/es/modules/dataManage/components/importAttrDialog/styles/index.less +90 -0
  52. package/es/modules/dataManage/components/importMetaDialog/demo/index.d.ts +3 -0
  53. package/es/modules/dataManage/components/importMetaDialog/demo/index.js +28 -0
  54. package/es/modules/dataManage/components/importMetaDialog/index.d.ts +7 -0
  55. package/es/modules/dataManage/components/importMetaDialog/index.js +159 -0
  56. package/es/modules/dataManage/components/importMetaDialog/styles/index.less +91 -0
  57. package/es/modules/dataManage/components/selectAttributes.js +10 -10
  58. package/es/modules/dataManage/components/tablePlus.d.ts +4 -0
  59. package/es/modules/dataManage/components/tablePlus.js +625 -94
  60. package/es/modules/dataManage/components/virtualTablePlus.js +7 -7
  61. package/es/modules/dataManage/demo/index.d.ts +2 -1
  62. package/es/modules/dataManage/demo/index.js +79 -16
  63. package/es/modules/dataManage/detailedData/DetailedDataForm.d.ts +5 -0
  64. package/es/modules/dataManage/detailedData/DetailedDataForm.js +216 -0
  65. package/es/modules/dataManage/detailedData/index.d.ts +24 -0
  66. package/es/modules/dataManage/detailedData/index.js +403 -0
  67. package/es/modules/dataManage/detailedData/useColumns.d.ts +34 -0
  68. package/es/modules/dataManage/detailedData/useColumns.js +135 -0
  69. package/es/modules/dataManage/index.d.ts +9 -4
  70. package/es/modules/dataManage/index.js +142 -50
  71. package/es/modules/dataManage/styles/detailed.less +74 -0
  72. package/es/modules/dataManage/styles/index.less +1195 -841
  73. package/es/modules/dataManage/types.d.ts +8 -0
  74. package/es/modules/dataManage/virtualEventList.js +13 -13
  75. package/es/modules/dataMap/component/data.d.ts +7 -0
  76. package/es/modules/dataMap/component/data.js +257 -0
  77. package/es/modules/dataMap/component/drawerAdd.d.ts +6 -0
  78. package/es/modules/dataMap/component/drawerAdd.js +379 -0
  79. package/es/modules/dataMap/component/leftTree.d.ts +6 -0
  80. package/es/modules/dataMap/component/leftTree.js +232 -0
  81. package/es/modules/dataMap/component/rightDetail.d.ts +7 -0
  82. package/es/modules/dataMap/component/rightDetail.js +694 -0
  83. package/es/modules/dataMap/component/selectAttr.d.ts +7 -0
  84. package/es/modules/dataMap/component/selectAttr.js +92 -0
  85. package/es/modules/dataMap/css/index.css +163 -0
  86. package/es/modules/dataMap/css/index.less +177 -0
  87. package/es/modules/dataMap/demo/index.d.ts +3 -0
  88. package/es/modules/dataMap/demo/index.js +6 -0
  89. package/es/modules/dataMap/img/empty-data.png +0 -0
  90. package/es/modules/dataMap/index.d.ts +3 -0
  91. package/es/modules/dataMap/index.js +80 -0
  92. package/es/modules/dataMap/mapDetail.d.ts +3 -0
  93. package/es/modules/dataMap/mapDetail.js +44 -0
  94. package/es/modules/dataMap/mapSetting.d.ts +6 -0
  95. package/es/modules/dataMap/mapSetting.js +156 -0
  96. package/es/modules/dataPlan/addEventOrUser.js +31 -30
  97. package/es/modules/dataPlan/addPlan.js +29 -27
  98. package/es/modules/dataPlan/eventList.js +2 -2
  99. package/es/modules/dataPlan/index.js +10 -10
  100. package/es/modules/dataPlan/search.js +6 -5
  101. package/es/modules/dataPlan/styles/index.less +316 -316
  102. package/es/modules/dataPlan/tablePlus.js +3 -3
  103. package/es/modules/dataPlan/userAttributeList.js +5 -5
  104. package/es/modules/dataReal/css/index.css +48 -0
  105. package/es/modules/dataReal/css/index.less +51 -0
  106. package/es/modules/dataReal/demo/index.d.ts +3 -0
  107. package/es/modules/dataReal/demo/index.js +6 -0
  108. package/es/modules/dataReal/index1.d.ts +28 -0
  109. package/es/modules/dataReal/index1.js +247 -0
  110. package/es/modules/dataReal/table.d.ts +5 -0
  111. package/es/modules/dataReal/table.js +260 -0
  112. package/es/store/index.js +11 -11
  113. package/es/utils/index.d.ts +1 -0
  114. package/es/utils/index.js +9 -1
  115. package/package.json +64 -58
@@ -1,9 +1,9 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
2
  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."); }
3
- 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); }
4
- 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; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3
+ 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; } }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
7
  import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
8
8
  import { Input, Table, message, Modal, Popover } from 'antd';
9
9
  import request from '../../../utils/ajax';
@@ -144,7 +144,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
144
144
  }
145
145
  };
146
146
  var columns = [{
147
- title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
147
+ title: (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
148
148
  style: {
149
149
  color: markActive ? '#fd9f41' : '#999',
150
150
  marginRight: '4px'
@@ -154,7 +154,7 @@ var VirtualTablePlus = function VirtualTablePlus(props) {
154
154
  setMarkActive(!markActive);
155
155
  },
156
156
  type: markActive ? 'shoucang' : 'shoucang-kong'
157
- }), "\u540D\u79F0"),
157
+ }), "\u540D\u79F0")),
158
158
  dataIndex: 'eventName',
159
159
  key: 'eventName',
160
160
  fixed: 'left',
@@ -1,2 +1,3 @@
1
- declare const _default: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const _default: () => React.JSX.Element;
2
3
  export default _default;
@@ -1,28 +1,91 @@
1
- import React from 'react';
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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; } }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ import React, { useEffect, useState } from 'react';
2
8
  import { DataManage } from '@zgfe/modules-dm';
3
9
  import DemoWrapper from '../../../components/demo';
10
+ var classPrefix = '111111';
11
+ // export default () => {
12
+ // const [isShowSelectList, setIsShowSelectList] = useState(false);
13
+ // const [selectObj, setSelectObj] = useState();
14
+ // const [saveObj, setSaveObj] = useState()
15
+ // const save = () => {
16
+ // console.log('selectObj-- save', selectObj);
17
+ // // setSaveObj(selectObj)
18
+ // setIsShowSelectList(false)
19
+ // }
20
+ // return (
21
+ // <DemoWrapper>
22
+ // <Button onClick={() => setIsShowSelectList(true)}>xxxxxx</Button>
23
+ // {/* <CreateDemand
24
+ // saveObj={saveObj}
25
+ // setSaveObj={(data: any) => {
26
+ // setSaveObj(data)
27
+ // // setSelectObj(data)
28
+ // }}
29
+ // setIsShowSelectList={setIsShowSelectList}
30
+ // /> */}
31
+ // {
32
+ // isShowSelectList ? <div style={{position:'absolute', top: 0, left: 0, right: 0, bottom: 0, zIndex: 10}}>
33
+ // <div className={`${classPrefix}-header`}>
34
+ // <div className={`${classPrefix}-header-left`}>
35
+ // <span onClick={() => {
36
+ // setSelectObj(saveObj)
37
+ // setIsShowSelectList(false)
38
+ // }} className={`${classPrefix}-header-back`}>
39
+ // <IconFont type="fanhuiicon" />
40
+ // 返回
41
+ // </span>
42
+ // 选择埋点信息
43
+ // </div>
44
+ // {
45
+ // <div className={`${classPrefix}-header-right`}>
46
+ // <Button onClick={() => {
47
+ // setSelectObj(saveObj)
48
+ // setIsShowSelectList(false)
49
+ // }}>取消</Button>
50
+ // <Button type={'primary'} onClick={save}>保存</Button>
51
+ // </div>
52
+ // }
53
+ // </div>
54
+ // <div style={{padding: 16, height: 'calc(100% - 64px)', background: '#FAFAFB'}}>
55
+ // <DataManage
56
+ // isSelect={true}
57
+ // isSelectTab={'1'}
58
+ // onChangeSelectObj={setSelectObj}
59
+ // selectObj={selectObj}
60
+ // />
61
+ // </div>
62
+ // </div> : null
63
+ // }
64
+ // </DemoWrapper>
65
+ // );
66
+ // };
4
67
  export default (function () {
5
68
  var subTabs = [{
6
69
  key: 'session',
7
70
  label: 'Session管理',
8
71
  children: /*#__PURE__*/React.createElement("div", null, "Session\u7BA1\u7406")
9
72
  }];
73
+ var _useState = useState(),
74
+ _useState2 = _slicedToArray(_useState, 2),
75
+ selectObj = _useState2[0],
76
+ setSelectObj = _useState2[1];
77
+ useEffect(function () {
78
+ console.log('selectObj', selectObj);
79
+ }, [selectObj]);
10
80
  return /*#__PURE__*/React.createElement(DemoWrapper, null, /*#__PURE__*/React.createElement(DataManage
11
- // extraTabs={[
12
- // {
13
- // key: 'aaa',
14
- // label: '拓展菜单',
15
- // children: <div>aaa</div>,
16
- // },
17
- // ]}
81
+ // isSelect={true}
82
+ // isSelectTab={'1'}
83
+ // selectTreeName="新页面_点击"
18
84
  , {
19
- // extraTabs={[
20
- // {
21
- // key: 'aaa',
22
- // label: '拓展菜单',
23
- // children: <div>aaa</div>,
24
- // },
25
- // ]}
26
- extraSubTabs: subTabs
85
+ // isSelect={true}
86
+ // isSelectTab={'1'}
87
+ // selectTreeName="新页面_点击"
88
+ onChangeSelectObj: setSelectObj,
89
+ selectObj: selectObj
27
90
  }));
28
91
  });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import '../styles/detailed.less';
3
+ import { RecordType } from '.';
4
+ declare const _default: React.ForwardRefExoticComponent<Omit<RecordType, "ref"> & React.RefAttributes<React.FC<{}>>>;
5
+ export default _default;
@@ -0,0 +1,216 @@
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 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; }
3
+ 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); }
4
+ 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); }); }; }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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; } }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
+ import React, { forwardRef, useContext, useEffect, useImperativeHandle, useState } from 'react';
12
+ import { BizGlobalDataContext, BizSelect } from '@zgfe/business-lib';
13
+ import { Form, Input, notification } from 'antd';
14
+ import '../styles/detailed.less';
15
+ import { classPrefix } from '.';
16
+ import request from '../../../utils/ajax';
17
+ import apis from '../../../constants/api';
18
+ import { cloneDeep } from 'lodash-es';
19
+ var DetailedDataForm = function DetailedDataForm(props, ref) {
20
+ var _useState = useState([]),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ identificationFieldList = _useState2[0],
23
+ setIdentificationFieldList = _useState2[1];
24
+ var _Form$useForm = Form.useForm(),
25
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
26
+ form = _Form$useForm2[0];
27
+ var disabled = Boolean(props === null || props === void 0 ? void 0 : props.datasetId);
28
+ var _useContext = useContext(BizGlobalDataContext),
29
+ currentApp = _useContext.currentApp,
30
+ currentProject = _useContext.currentProject;
31
+ var initialSubjectValue = currentProject.appList.find(function (item) {
32
+ return item.id == (currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId);
33
+ });
34
+ useEffect(function () {
35
+ if ((props === null || props === void 0 ? void 0 : props.datasetId) && (props === null || props === void 0 ? void 0 : props.subjectIdentifier)) {
36
+ var dataset = props === null || props === void 0 ? void 0 : props.datasetList.find(function (item) {
37
+ return item.value == (props === null || props === void 0 ? void 0 : props.datasetId);
38
+ });
39
+ if (dataset) {
40
+ handleDatasetIdChange(dataset.tableName);
41
+ }
42
+ }
43
+ }, []);
44
+ var handleDatasetIdChange = /*#__PURE__*/function () {
45
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
46
+ var res, _res$data, list;
47
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
48
+ while (1) switch (_context.prev = _context.next) {
49
+ case 0:
50
+ _context.prev = 0;
51
+ _context.next = 3;
52
+ return request(apis.queryTableInfo, {
53
+ method: 'get',
54
+ params: {
55
+ tableName: val
56
+ }
57
+ });
58
+ case 3:
59
+ res = _context.sent;
60
+ if (res === null || res === void 0 ? void 0 : res.data) {
61
+ list = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
62
+ return {
63
+ label: item.name,
64
+ value: item.name
65
+ };
66
+ });
67
+ setIdentificationFieldList(list);
68
+ } else {
69
+ setIdentificationFieldList([]);
70
+ }
71
+ _context.next = 11;
72
+ break;
73
+ case 7:
74
+ _context.prev = 7;
75
+ _context.t0 = _context["catch"](0);
76
+ console.log(_context.t0);
77
+ notification.error({
78
+ message: _context.t0
79
+ });
80
+ case 11:
81
+ case "end":
82
+ return _context.stop();
83
+ }
84
+ }, _callee, null, [[0, 7]]);
85
+ }));
86
+ return function handleDatasetIdChange(_x) {
87
+ return _ref.apply(this, arguments);
88
+ };
89
+ }();
90
+ useImperativeHandle(ref, function () {
91
+ return {
92
+ submit: function submit() {
93
+ return form.submit();
94
+ },
95
+ getFieldsValue: function getFieldsValue() {
96
+ var data = cloneDeep(form.getFieldsValue(true));
97
+ Object.keys(data).forEach(function (key) {
98
+ if (Object.prototype.toString.call(data[key]).toLowerCase() === '[object object]') {
99
+ data[key] = data[key].value;
100
+ }
101
+ });
102
+ return data;
103
+ },
104
+ isFieldsValidating: function isFieldsValidating() {
105
+ return form.isFieldsValidating(['identifier', 'name']);
106
+ },
107
+ validateFields: function validateFields() {
108
+ return form.validateFields();
109
+ }
110
+ };
111
+ }, []);
112
+ return /*#__PURE__*/React.createElement(Form, {
113
+ labelCol: {
114
+ span: 6
115
+ },
116
+ layout: "horizontal",
117
+ form: form,
118
+ initialValues: {
119
+ subjectId: {
120
+ value: initialSubjectValue.id,
121
+ label: initialSubjectValue.appName
122
+ },
123
+ name: props === null || props === void 0 ? void 0 : props.name,
124
+ datasetId: (props === null || props === void 0 ? void 0 : props.datasetId) ? props.datasetList.find(function (item) {
125
+ return item.value == (props === null || props === void 0 ? void 0 : props.datasetId);
126
+ }) : '',
127
+ subjectIdentifier: (props === null || props === void 0 ? void 0 : props.subjectIdentifier) && {
128
+ label: props === null || props === void 0 ? void 0 : props.subjectIdentifier,
129
+ value: props === null || props === void 0 ? void 0 : props.subjectIdentifier
130
+ }
131
+ }
132
+ }, /*#__PURE__*/React.createElement(Form.Item, {
133
+ required: true,
134
+ label: "\u660E\u7EC6\u6570\u636E\u540D\u79F0",
135
+ name: "name",
136
+ rules: [{
137
+ required: true,
138
+ validateTrigger: 'submit',
139
+ validator: function validator(rule, value, callback) {
140
+ if (!value) {
141
+ return Promise.reject('明细数据名称不可为空');
142
+ }
143
+ return Promise.resolve();
144
+ }
145
+ }]
146
+ }, /*#__PURE__*/React.createElement(Input, {
147
+ className: "".concat(classPrefix, "-input-340"),
148
+ showCount: true,
149
+ maxLength: 20,
150
+ placeholder: "\u8BF7\u8F93\u5165\u660E\u7EC6\u6570\u636E\u540D\u79F0"
151
+ })), /*#__PURE__*/React.createElement(Form.Item, {
152
+ required: true,
153
+ label: "\u9009\u62E9\u6570\u636E\u96C6",
154
+ name: "datasetId",
155
+ rules: [{
156
+ required: true,
157
+ validateTrigger: 'submit',
158
+ validator: function validator(rule, value, callback) {
159
+ if (!value) {
160
+ return Promise.reject('数据集不可为空');
161
+ }
162
+ return Promise.resolve();
163
+ }
164
+ }]
165
+ }, /*#__PURE__*/React.createElement(BizSelect, {
166
+ disable: disabled,
167
+ enableSearch: true,
168
+ labelField: "label",
169
+ keyField: "value",
170
+ className: "".concat(classPrefix, "-input-340"),
171
+ options: props.datasetList || [],
172
+ placeholder: "\u8BF7\u9009\u62E9\u6570\u636E\u96C6",
173
+ onChange: function onChange(val) {
174
+ form.setFieldValue('subjectIdentifier', {
175
+ label: '',
176
+ value: ''
177
+ });
178
+ setTimeout(function () {
179
+ handleDatasetIdChange(val.tableName);
180
+ }, 0);
181
+ }
182
+ })), props.isOpen && (/*#__PURE__*/React.createElement(Form.Item, {
183
+ required: true,
184
+ label: "\u5173\u8054\u4E3B\u4F53",
185
+ name: "subjectId"
186
+ }, /*#__PURE__*/React.createElement(BizSelect, {
187
+ keyField: "value",
188
+ labelField: "label",
189
+ disable: true,
190
+ className: "".concat(classPrefix, "-input-340"),
191
+ options: []
192
+ }))), /*#__PURE__*/React.createElement(Form.Item, {
193
+ required: true,
194
+ label: (props.isOpen ? '主体' : '用户') + '标识字段',
195
+ name: "subjectIdentifier",
196
+ rules: [{
197
+ required: true,
198
+ validateTrigger: 'submit',
199
+ validator: function validator(rule, value, callback) {
200
+ if (!value || !value.value) {
201
+ return Promise.reject((props.isOpen ? '主体' : '用户') + '标识字段不可为空');
202
+ }
203
+ return Promise.resolve();
204
+ }
205
+ }]
206
+ }, /*#__PURE__*/React.createElement(BizSelect, {
207
+ enableSearch: true,
208
+ disable: disabled,
209
+ // labelField="label"
210
+ keyField: "value",
211
+ className: "".concat(classPrefix, "-input-340"),
212
+ options: identificationFieldList,
213
+ placeholder: '请选择' + (props.isOpen ? '主体' : '用户') + '标识字段'
214
+ })));
215
+ };
216
+ export default /*#__PURE__*/forwardRef(DetailedDataForm);
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import '../styles/detailed.less';
3
+ export declare const classPrefix = "detailed-data";
4
+ export interface RecordType {
5
+ datasetName?: string;
6
+ datasetId?: number;
7
+ creatorId?: number;
8
+ creatorName?: string;
9
+ createOn?: string;
10
+ subjectId?: number;
11
+ subjectIdentifier?: string;
12
+ [key: string]: any;
13
+ }
14
+ export interface ResultData {
15
+ pageCount?: number;
16
+ pageNo?: number;
17
+ pageSize?: number;
18
+ total?: number;
19
+ results?: RecordType[];
20
+ }
21
+ declare const DetailedData: React.FC<{
22
+ companyId?: number;
23
+ }>;
24
+ export default DetailedData;