@luck-design-biz/luckda 0.0.25-7 → 0.0.25-8

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 (187) hide show
  1. package/es/components/LDActions/index.js +8 -10
  2. package/es/components/LDActions/index.less +7 -4
  3. package/es/components/LdAutoForm/index.js +8 -6
  4. package/es/components/LdFormList/index.js +12 -4
  5. package/es/components/LdGrid/index.js +11 -5
  6. package/es/components/LdGridForm/index.js +4 -2
  7. package/es/components/LdTree/index.js +30 -13
  8. package/es/helper/form.js +9 -5
  9. package/es/locales/zh-CN.js +15 -10
  10. package/es/lowcode/constants/api-url.js +112 -26
  11. package/es/lowcode/constants/event-topics.js +2 -0
  12. package/es/lowcode/engine/meta/box.props.json +3 -3
  13. package/es/lowcode/engine/meta/button.props.json +3 -3
  14. package/es/lowcode/engine/meta/components-list.json +6 -0
  15. package/es/lowcode/engine/meta/dialog.props.json +5 -5
  16. package/es/lowcode/engine/meta/drawer.props.json +8 -20
  17. package/es/lowcode/engine/meta/form.props.json +13 -7
  18. package/es/lowcode/engine/meta/imex.props.default.json +8 -1
  19. package/es/lowcode/engine/meta/imex.props.json +54 -22
  20. package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
  21. package/es/lowcode/engine/meta/layout.props.json +2 -2
  22. package/es/lowcode/engine/meta/page.props.json +2 -2
  23. package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
  24. package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
  25. package/es/lowcode/engine/meta/section.props.json +2 -2
  26. package/es/lowcode/engine/meta/split.props.default.json +1 -1
  27. package/es/lowcode/engine/meta/split.props.json +4 -4
  28. package/es/lowcode/engine/meta/table.props.json +15 -9
  29. package/es/lowcode/engine/meta/tabs.props.json +3 -3
  30. package/es/lowcode/engine/meta/tree.props.default.json +1 -0
  31. package/es/lowcode/engine/meta/tree.props.json +55 -6
  32. package/es/lowcode/engine/provider/ContextProvider/index.js +12 -3
  33. package/es/lowcode/engine/provider/RemoteSourceProvider.js +55 -6
  34. package/es/lowcode/engine/tools/dataProcess.js +4 -0
  35. package/es/lowcode/engine/tools/usePageDataStore.js +4 -2
  36. package/es/lowcode/painter/DesignOperator.js +1 -1
  37. package/es/lowcode/painter/DesignToolbar.js +2 -1
  38. package/es/lowcode/painter/Panel.js +3 -3
  39. package/es/lowcode/painter/components/ActionBindModal.js +25 -13
  40. package/es/lowcode/painter/components/AdvancePanel.js +6 -1
  41. package/es/lowcode/painter/components/AttrsPanel.js +13 -11
  42. package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
  43. package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
  44. package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
  45. package/es/lowcode/painter/components/field-setting/SettingUI.js +156 -24
  46. package/es/lowcode/painter/components/field-setting/index.js +32 -63
  47. package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
  48. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +6 -9
  49. package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -12
  50. package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
  51. package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
  52. package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
  53. package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
  54. package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
  55. package/es/lowcode/painter/style/action-bind-modal.less +3 -3
  56. package/es/lowcode/painter/style/page-layout-display.less +28 -0
  57. package/es/lowcode/painter/style/split-display.less +0 -9
  58. package/es/lowcode/preview/index.js +4 -2
  59. package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
  60. package/es/lowcode/view/lc-components/Box/meta.json +3 -3
  61. package/es/lowcode/view/lc-components/Button/index.js +2 -6
  62. package/es/lowcode/view/lc-components/Button/meta.json +3 -3
  63. package/es/lowcode/view/lc-components/Dialog/index.js +27 -2
  64. package/es/lowcode/view/lc-components/Dialog/meta.json +5 -5
  65. package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
  66. package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
  67. package/es/lowcode/view/lc-components/Form/index.js +99 -21
  68. package/es/lowcode/view/lc-components/Form/meta.json +13 -7
  69. package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
  70. package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
  71. package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
  72. package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
  73. package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
  74. package/es/lowcode/view/lc-components/Page/meta.json +2 -2
  75. package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
  76. package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
  77. package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
  78. package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
  79. package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
  80. package/es/lowcode/view/lc-components/Section/meta.json +2 -2
  81. package/es/lowcode/view/lc-components/Split/FunctionDesign.js +11 -5
  82. package/es/lowcode/view/lc-components/Split/index.js +5 -9
  83. package/es/lowcode/view/lc-components/Split/meta.json +4 -4
  84. package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
  85. package/es/lowcode/view/lc-components/Table/index.js +60 -17
  86. package/es/lowcode/view/lc-components/Table/meta.json +15 -9
  87. package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +1 -0
  88. package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
  89. package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
  90. package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
  91. package/es/lowcode/view/lc-components/Tree/index.js +60 -18
  92. package/es/lowcode/view/lc-components/Tree/meta.json +55 -7
  93. package/es/upload/FormItem/index.js +1 -4
  94. package/lib/components/LDActions/index.js +7 -9
  95. package/lib/components/LDActions/index.less +7 -4
  96. package/lib/components/LdAutoForm/index.js +7 -5
  97. package/lib/components/LdFormList/index.js +11 -3
  98. package/lib/components/LdGrid/index.js +11 -5
  99. package/lib/components/LdGridForm/index.js +4 -2
  100. package/lib/components/LdTree/index.js +30 -13
  101. package/lib/helper/form.js +8 -4
  102. package/lib/locales/zh-CN.js +15 -10
  103. package/lib/lowcode/constants/api-url.js +113 -26
  104. package/lib/lowcode/constants/event-topics.js +3 -1
  105. package/lib/lowcode/engine/meta/box.props.json +3 -3
  106. package/lib/lowcode/engine/meta/button.props.json +3 -3
  107. package/lib/lowcode/engine/meta/components-list.json +6 -0
  108. package/lib/lowcode/engine/meta/dialog.props.json +5 -5
  109. package/lib/lowcode/engine/meta/drawer.props.json +8 -20
  110. package/lib/lowcode/engine/meta/form.props.json +13 -7
  111. package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
  112. package/lib/lowcode/engine/meta/imex.props.json +54 -22
  113. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
  114. package/lib/lowcode/engine/meta/layout.props.json +2 -2
  115. package/lib/lowcode/engine/meta/page.props.json +2 -2
  116. package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
  117. package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
  118. package/lib/lowcode/engine/meta/section.props.json +2 -2
  119. package/lib/lowcode/engine/meta/split.props.default.json +1 -1
  120. package/lib/lowcode/engine/meta/split.props.json +4 -4
  121. package/lib/lowcode/engine/meta/table.props.json +15 -9
  122. package/lib/lowcode/engine/meta/tabs.props.json +3 -3
  123. package/lib/lowcode/engine/meta/tree.props.default.json +1 -0
  124. package/lib/lowcode/engine/meta/tree.props.json +55 -6
  125. package/lib/lowcode/engine/provider/ContextProvider/index.js +11 -2
  126. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +54 -5
  127. package/lib/lowcode/engine/tools/dataProcess.js +4 -0
  128. package/lib/lowcode/engine/tools/usePageDataStore.js +4 -2
  129. package/lib/lowcode/painter/DesignOperator.js +1 -1
  130. package/lib/lowcode/painter/DesignToolbar.js +2 -1
  131. package/lib/lowcode/painter/Panel.js +3 -3
  132. package/lib/lowcode/painter/components/ActionBindModal.js +23 -11
  133. package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
  134. package/lib/lowcode/painter/components/AttrsPanel.js +12 -10
  135. package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
  136. package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
  137. package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
  138. package/lib/lowcode/painter/components/field-setting/SettingUI.js +153 -21
  139. package/lib/lowcode/painter/components/field-setting/index.js +32 -63
  140. package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
  141. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +6 -9
  142. package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -12
  143. package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
  144. package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
  145. package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
  146. package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
  147. package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
  148. package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
  149. package/lib/lowcode/painter/style/page-layout-display.less +28 -0
  150. package/lib/lowcode/painter/style/split-display.less +0 -9
  151. package/lib/lowcode/preview/index.js +4 -2
  152. package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
  153. package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
  154. package/lib/lowcode/view/lc-components/Button/index.js +2 -6
  155. package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
  156. package/lib/lowcode/view/lc-components/Dialog/index.js +29 -4
  157. package/lib/lowcode/view/lc-components/Dialog/meta.json +5 -5
  158. package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
  159. package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
  160. package/lib/lowcode/view/lc-components/Form/index.js +96 -18
  161. package/lib/lowcode/view/lc-components/Form/meta.json +13 -7
  162. package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
  163. package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
  164. package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
  165. package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
  166. package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
  167. package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
  168. package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
  169. package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
  170. package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
  171. package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
  172. package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
  173. package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
  174. package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +12 -6
  175. package/lib/lowcode/view/lc-components/Split/index.js +2 -6
  176. package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
  177. package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
  178. package/lib/lowcode/view/lc-components/Table/index.js +59 -16
  179. package/lib/lowcode/view/lc-components/Table/meta.json +15 -9
  180. package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +3 -2
  181. package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
  182. package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
  183. package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
  184. package/lib/lowcode/view/lc-components/Tree/index.js +58 -16
  185. package/lib/lowcode/view/lc-components/Tree/meta.json +55 -7
  186. package/lib/upload/FormItem/index.js +1 -4
  187. package/package.json +2 -2
@@ -1,5 +1,4 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
2
  import _extends from "@babel/runtime/helpers/esm/extends";
4
3
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
@@ -10,7 +9,7 @@ import { useCreation, useMemoizedFn } from 'ahooks';
10
9
  import { Modal, recheck } from '@luck-design-biz/base';
11
10
  import { Button, Menu, Dropdown, Icon, Divider } from 'luck-design/antd';
12
11
  import classNames from 'classnames';
13
- import { reduce } from 'lodash';
12
+ import { reduce, isNil } from 'lodash';
14
13
  import { getResources } from "../../helper/ldComBuild";
15
14
  import styles from "./index.less";
16
15
  var DisplayComp = function DisplayComp(_ref) {
@@ -64,22 +63,21 @@ var LDActions = function LDActions(_ref2) {
64
63
  });
65
64
  var actionMap = useCreation(function () {
66
65
  return reduce(todoList, function (ret, action, index) {
67
- ret[action.serial] = _objectSpread(_objectSpread({}, action), {}, {
68
- serialValue: Math.pow(2, index)
69
- });
66
+ if (!isNil(action.serial) && !ret[action.serial]) {
67
+ ret[action.serial] = Math.pow(2, index);
68
+ }
70
69
  return ret;
71
70
  }, {});
72
71
  }, [todoList]);
73
72
  var mySerialsValue = useCreation(function () {
74
73
  return reduce(resources, function (ret, resKey) {
75
- var _actionMap$resKey;
76
- ret |= ((_actionMap$resKey = actionMap[resKey]) === null || _actionMap$resKey === void 0 ? void 0 : _actionMap$resKey.serialValue) || 0;
74
+ ret |= actionMap[resKey] || 0;
77
75
  return ret;
78
76
  }, 0);
79
77
  }, [resources, actionMap]);
80
78
  var _useCreation = useCreation(function () {
81
- var approvedActions = reduce(actionMap, function (ret, action) {
82
- if (mySerialsValue & action.serialValue) {
79
+ var approvedActions = reduce(todoList, function (ret, action) {
80
+ if (isNil(action.serial) || mySerialsValue & actionMap[action.serial]) {
83
81
  ret.push(action);
84
82
  } else if (action.serialEffect === 'disable') {
85
83
  ret.push(action);
@@ -89,7 +87,7 @@ var LDActions = function LDActions(_ref2) {
89
87
  var _length = approvedActions.length;
90
88
  var _permanent = approvedActions.splice(0, max >= _length ? _length : max - 1);
91
89
  return [_permanent, approvedActions];
92
- }, [max, mySerialsValue, actionMap]),
90
+ }, [max, mySerialsValue, actionMap, todoList]),
93
91
  _useCreation2 = _slicedToArray(_useCreation, 2),
94
92
  permanent = _useCreation2[0],
95
93
  more = _useCreation2[1];
@@ -1,12 +1,15 @@
1
1
  @spanDefault: #262626;
2
- @spanPrimary: var(--luck-color-primary);
2
+ @spanPrimary: var(--ant-primary-color);
3
3
  @spanDanger: #ff4d4f;
4
4
  @spanDestroy: #820014;
5
5
 
6
6
  .ldActions {
7
7
 
8
8
  button:not(:last-child) {
9
- margin-right: 2px;
9
+ margin-right: 4px;
10
+ }
11
+ button:not(:first-child) {
12
+ margin-left: 4px;
10
13
  }
11
14
  span {
12
15
  cursor: pointer;
@@ -20,8 +23,8 @@
20
23
  }
21
24
 
22
25
  button.primary {
23
- background-color: var(--luck-color-primary);
24
- border-color: var(--luck-color-primary);
26
+ background-color: var(--ant-primary-color);
27
+ border-color: var(--ant-primary-color);
25
28
  color: white;
26
29
  }
27
30
  span.primary {
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData", "relationKey", "fields"];
5
+ var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "filedsRewrite", "mainFormLdId", "mainDataSetKey", "onValueChange", "onQuery", "onAdd", "onUpdate", "moduleCode", "defaultDataSourceFormat", "ticketData", "relationKey", "fields", "setVerifyRules"];
6
6
  import React, { createRef, useContext } from 'react';
7
- import { reduce, keyBy, isEmpty, pick } from 'lodash';
7
+ import { reduce, keyBy, isEmpty, pick, union } from 'lodash';
8
8
  import { BasicDivider } from 'luck-design';
9
9
  import { AutoForm } from '@luck-design-biz/base/FormList';
10
10
  import ldBuilder from "../../helper/ldBuilder";
@@ -43,6 +43,7 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
43
43
  _ref$relationKey = _ref.relationKey,
44
44
  relationKey = _ref$relationKey === void 0 ? window.appConfig.constraintKeys.PRIMARY : _ref$relationKey,
45
45
  fields = _ref.fields,
46
+ setVerifyRules = _ref.setVerifyRules,
46
47
  props = _objectWithoutProperties(_ref, _excluded);
47
48
  var _ref2 = useContext(LuckDaContext) || {},
48
49
  setFieldProps = _ref2.setFieldProps;
@@ -51,22 +52,23 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
51
52
  var basicItems = function () {
52
53
  var fieldsObj = keyBy(fields, 'field');
53
54
  var columnsObj = keyBy(columns, 'field');
54
- var keys = isEmpty(fields) ? Object.keys(columnsObj) : Object.keys(fieldsObj);
55
+ var keys = isEmpty(fields) ? Object.keys(columnsObj) : union(Object.keys(fieldsObj), Object.keys(columnsObj));
55
56
  var _defaultValues = {};
56
57
  var _nodes = reduce(keys, function (result, key) {
57
58
  var setting = fieldsObj[key];
58
59
  var col = columnsObj[key];
59
60
  if ((setting === null || setting === void 0 ? void 0 : setting._type) === 'divider') {
60
61
  result.push( /*#__PURE__*/React.createElement(BasicDivider, {
61
- title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName
62
+ title: setting === null || setting === void 0 ? void 0 : setting.aliasName
62
63
  }));
63
- } else if (col.isShowInForm) {
64
+ } else if (col !== null && col !== void 0 && col.isShowInForm) {
64
65
  var customFiled = filedsRewrite.find(function (_field) {
65
66
  return _field.name === col.aliaName;
66
67
  }) || {};
67
68
  _defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, _defineProperty(_defineProperty({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
68
69
  var newCol = _objectSpread(_objectSpread({}, col), {}, {
69
- fieldName: (setting === null || setting === void 0 ? void 0 : setting.fieldAliasName) || col.fieldName
70
+ setVerifyRules: setVerifyRules,
71
+ fieldName: (setting === null || setting === void 0 ? void 0 : setting.aliasName) || col.fieldName
70
72
  }, pick(setting, ['col', 'row', 'note', 'tip', 'placeholder']));
71
73
  result.push(getFormItem(newCol, _objectSpread(_objectSpread({
72
74
  formId: ldId,
@@ -6,11 +6,11 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
7
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
9
- var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps"],
9
+ var _excluded = ["namespace", "formState", "formMode", "formOperates", "loading", "wrapperRef", "readOnly", "mainFormLdId", "renderFormList", "renderAffixLeft", "renderAffixRight", "beforeSubmit", "showSaveBtn", "saveBtnTitle", "affixLayout", "onValueChange", "afterSubmit", "renderFormExtra", "bpmButtonProps", "setVerifyRules"],
10
10
  _excluded2 = ["dataSets", "doAction", "resources"],
11
11
  _excluded3 = ["id", "header", "title", "readOnly", "extraConfig", "renderTopLeft", "serial"],
12
12
  _excluded4 = ["ldId", "initData", "overModel"];
13
- import React, { useContext, useRef, forwardRef, Fragment, useImperativeHandle, useState } from 'react';
13
+ import React, { useContext, useRef, forwardRef, Fragment, useImperativeHandle, useState, useEffect } from 'react';
14
14
  import { connect, getDvaApp, useRouteMatch } from 'umi';
15
15
  import PropTypes from 'prop-types';
16
16
  import { isArray, sortBy, mapValues, reduce, includes } from 'lodash';
@@ -55,8 +55,10 @@ var LdFormList = function LdFormList(_ref) {
55
55
  } : _ref$renderFormExtra,
56
56
  _ref$bpmButtonProps = _ref.bpmButtonProps,
57
57
  bpmButtonProps = _ref$bpmButtonProps === void 0 ? {} : _ref$bpmButtonProps,
58
+ setVerifyRules = _ref.setVerifyRules,
58
59
  props = _objectWithoutProperties(_ref, _excluded);
59
60
  var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
61
+ var currentValueRef = useRef(null);
60
62
  var _useState = useState(false),
61
63
  _useState2 = _slicedToArray(_useState, 2),
62
64
  submitLoading = _useState2[0],
@@ -86,6 +88,9 @@ var LdFormList = function LdFormList(_ref) {
86
88
  var formListRef = useRef(null);
87
89
  useImperativeHandle(wrapperRef, function () {
88
90
  return _objectSpread(_objectSpread({}, formListRef.current), {}, {
91
+ getCValue: function getCValue() {
92
+ return currentValueRef.current || props.formData;
93
+ },
89
94
  onLdQuery: function onLdQuery() {
90
95
  var _params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
91
96
  if (props.formMode !== 'add') {
@@ -109,6 +114,7 @@ var LdFormList = function LdFormList(_ref) {
109
114
  var getValue = ((_formRefs$key = formRefs[key]) !== null && _formRefs$key !== void 0 && (_formRefs$key = _formRefs$key.formRef) !== null && _formRefs$key !== void 0 && _formRefs$key.current ? formRefs[key].getData : null) || ((_formRefs$key$current = formRefs[key].current) === null || _formRefs$key$current === void 0 ? void 0 : _formRefs$key$current.getFieldsValue);
110
115
  return _defineProperty({}, key, getValue && getValue());
111
116
  });
117
+ currentValueRef.current = data;
112
118
  onValueChange(change, data);
113
119
  });
114
120
  var renderExtra = useMemoizedFn(function (formId, extraConfig, type) {
@@ -302,7 +308,8 @@ var LdFormList = function LdFormList(_ref) {
302
308
  ticketData: props.ticketData,
303
309
  renderTopLeft: function renderTopLeft() {
304
310
  return type === 'auto' ? _renderTopLeft() : [renderExtra(ldId, extraConfig, 'text'), _renderTopLeft()];
305
- }
311
+ },
312
+ setVerifyRules: setVerifyRules
306
313
  })));
307
314
  return /*#__PURE__*/React.createElement(Fragment, {
308
315
  key: ldId
@@ -322,7 +329,8 @@ var LdFormList = function LdFormList(_ref) {
322
329
  ticketData: props.ticketData,
323
330
  renderTopLeft: function renderTopLeft() {
324
331
  return type === 'auto' ? _renderTopLeft() : [renderExtra(ldId, extraConfig, luckTheme === 'base' ? 'text' : 'graphic'), _renderTopLeft()];
325
- }
332
+ },
333
+ setVerifyRules: setVerifyRules
326
334
  })));
327
335
  }
328
336
  return ChildrenUtil.deepMap(formProps, function (child) {
@@ -67,6 +67,12 @@ var LdGrid = function LdGrid(_ref) {
67
67
  }, [params, filters]);
68
68
  useImperativeHandle(wrapperRef, function () {
69
69
  return _objectSpread(_objectSpread({}, gridRef.current), {}, {
70
+ getProps: function getProps() {
71
+ var _getDvaApp;
72
+ return {
73
+ apiUrl: (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || (_getDvaApp = _getDvaApp._store.getState()[namespace]) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp.apiUrl
74
+ };
75
+ },
70
76
  onLdQuery: function onLdQuery() {
71
77
  var _params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
72
78
  doQuery({
@@ -174,11 +180,11 @@ var LdIndex = function LdIndex(_ref2) {
174
180
  props = _objectWithoutProperties(_ref2, _excluded2);
175
181
  var isTreeGrid = isNil(_isTreeGrid) ? includes(props.isTree, props.dataSetKey) : _isTreeGrid;
176
182
  var Component = useCreation(function () {
177
- var _getDvaApp, _getDvaApp2;
178
- (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 || _getDvaApp.unmodel(namespace);
179
- if (!((_getDvaApp2 = getDvaApp()) !== null && _getDvaApp2 !== void 0 && _getDvaApp2._store.getState()[namespace])) {
180
- var _getDvaApp3;
181
- (_getDvaApp3 = getDvaApp()) === null || _getDvaApp3 === void 0 || _getDvaApp3.model(createModel(namespace, _objectSpread(_objectSpread({
183
+ var _getDvaApp2, _getDvaApp3;
184
+ (_getDvaApp2 = getDvaApp()) === null || _getDvaApp2 === void 0 || _getDvaApp2.unmodel(namespace);
185
+ if (!((_getDvaApp3 = getDvaApp()) !== null && _getDvaApp3 !== void 0 && _getDvaApp3._store.getState()[namespace])) {
186
+ var _getDvaApp4;
187
+ (_getDvaApp4 = getDvaApp()) === null || _getDvaApp4 === void 0 || _getDvaApp4.model(createModel(namespace, _objectSpread(_objectSpread({
182
188
  behaviorKey: isTreeGrid ? 'readTree' : 'readGrid'
183
189
  }, overModel), {}, {
184
190
  isFlow: isTreeGrid || !!props.isFlow,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "columnsRewrite", "columnsReset", "onQuery", "onAdd", "onUpdate", "onDelete", "mainFormLdId", "mainDataSetKey", "onValueChange", "type", "afterOperate", "moduleCode", "defaultDataSourceFormat", "ticketData", "className", "formRef", "formMode", "fields"];
5
+ var _excluded = ["columns", "resources", "actions", "doAction", "ldId", "dataSetKey", "columnsRewrite", "columnsReset", "onQuery", "onAdd", "onUpdate", "onDelete", "mainFormLdId", "mainDataSetKey", "onValueChange", "type", "afterOperate", "moduleCode", "defaultDataSourceFormat", "ticketData", "className", "formRef", "formMode", "fields", "setVerifyRules"];
6
6
  import React, { createRef, useContext } from 'react';
7
7
  import { reduce, keyBy, isEmpty, pick } from 'lodash';
8
8
  import classNames from 'classnames';
@@ -52,6 +52,7 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
52
52
  formRef = _ref.formRef,
53
53
  formMode = _ref.formMode,
54
54
  fields = _ref.fields,
55
+ setVerifyRules = _ref.setVerifyRules,
55
56
  props = _objectWithoutProperties(_ref, _excluded);
56
57
  var _ref2 = useContext(LuckDaContext) || {},
57
58
  setFieldProps = _ref2.setFieldProps;
@@ -82,7 +83,8 @@ var buildLdGridForm = function buildLdGridForm(_ref) {
82
83
  });
83
84
  _defaultValues = _objectSpread(_objectSpread({}, _defaultValues), {}, _defineProperty(_defineProperty({}, col.aliaName, col['optDefaultValue']), "".concat(col.aliaName, "_virtual"), col['optDefaultValueCvt']));
84
85
  var newCol = _objectSpread(_objectSpread({}, col), {}, {
85
- fieldName: (setting === null || setting === void 0 ? void 0 : setting.fieldAliasName) || col.fieldName
86
+ setVerifyRules: setVerifyRules,
87
+ fieldName: (setting === null || setting === void 0 ? void 0 : setting.aliasName) || col.fieldName
86
88
  });
87
89
  result.push(getFormColumn(type, newCol, _objectSpread(_objectSpread(_objectSpread({}, pick(setting, ['width', 'align', 'headerAlign', 'pinned', 'tip'])), customColumn), {}, {
88
90
  formItemRewrite: _objectSpread(_objectSpread({}, (_customColumn = customColumn) === null || _customColumn === void 0 ? void 0 : _customColumn.formItemRewrite), {}, {
@@ -1,3 +1,4 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
1
2
  import _extends from "@babel/runtime/helpers/esm/extends";
2
3
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
4
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
@@ -76,6 +77,7 @@ var LdTree = function LdTree(_ref) {
76
77
  defaultExpandedProps = _useState4[0],
77
78
  setDefaultExpandedProps = _useState4[1];
78
79
  var treeRef = useRef(null);
80
+ var onceRef = useRef(true);
79
81
  var defaultParams = useCreation(function () {
80
82
  var _params = [_objectSpread({
81
83
  moduleCode: moduleCode,
@@ -113,7 +115,8 @@ var LdTree = function LdTree(_ref) {
113
115
  }
114
116
  var treeData = dataToTreeFormat ? dataToTreeFormat(data) : dataToTree(data, null, window.appConfig.constraintKeys.PRIMARY, window.appConfig.constraintKeys.PARENT);
115
117
  setDataSource(treeData);
116
- afterInit && afterInit(treeData);
118
+ onceRef.current && afterInit && afterInit(treeData, data);
119
+ onceRef.current = false;
117
120
  }
118
121
  }
119
122
  }),
@@ -219,7 +222,22 @@ var LdTree = function LdTree(_ref) {
219
222
  });
220
223
  var handleDrop = useMemoizedFn(function (info) {
221
224
  var dragInfo = dragTreeData(info, dataSource);
222
- onDrop && onDrop(info, dragInfo);
225
+ if (onDrop) onDrop(info, dragInfo);else if (dragInfo !== false) {
226
+ doAction('drag', {
227
+ get: {
228
+ datasetCode: dataSetKey
229
+ },
230
+ post: {
231
+ fromId: info.dragNode.props.dataRef[PRIMARY],
232
+ toId: info.node.props.dataRef[PRIMARY]
233
+ }
234
+ }, {
235
+ showConfirm: false,
236
+ callback: function callback(success) {
237
+ return success && onLdQuery();
238
+ }
239
+ });
240
+ }
223
241
  });
224
242
  var onAdd = useCreation(function () {
225
243
  return !(readOnly || !rootAdd || rootAdd.resource && !includes(resources, rootAdd.resource) || onlyRoot && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0) ? function () {
@@ -234,18 +252,17 @@ var LdTree = function LdTree(_ref) {
234
252
  return;
235
253
  }
236
254
  (service || behaviorCall)(_objectSpread(_objectSpread({}, params[0]), {}, _defineProperty({}, parentKey, treeNode.props.dataRef[window.appConfig.constraintKeys.PRIMARY]))).then(function (res) {
237
- console.log(res);
255
+ var code = res.code,
256
+ list = res.list,
257
+ detail = res.detail;
258
+ if (code === 1) {
259
+ treeNode.props.dataRef.children = list.map(function (i) {
260
+ return detail[i];
261
+ });
262
+ setDataSource(_toConsumableArray(dataSource));
263
+ resolve();
264
+ }
238
265
  });
239
- // setTimeout(() => {
240
- // treeNode.props.dataRef.children = [
241
- // { title: 'Child Node', key: `${treeNode.props.eventKey}-0` },
242
- // { title: 'Child Node', key: `${treeNode.props.eventKey}-1` },
243
- // ];
244
- // this.setState({
245
- // treeData: [...this.state.treeData],
246
- // });
247
- // resolve();
248
- // }, 1000);
249
266
  });
250
267
  });
251
268
  var asyncLoadData = useCreation(function () {
package/es/helper/form.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["extra"];
4
- import { isNil } from 'lodash';
3
+ var _excluded = ["extra", "verifyList", "setVerifyRules"];
4
+ import { isNil, keyBy } from 'lodash';
5
5
  import { formatMessage } from '@luck-design-biz/base/utils';
6
6
 
7
7
  // 属性类型=》控件
@@ -55,6 +55,8 @@ export var splitStrToObj = function splitStrToObj(keyStr, labelStr) {
55
55
  export function translator() {
56
56
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
57
57
  extra = _ref.extra,
58
+ verifyList = _ref.verifyList,
59
+ setVerifyRules = _ref.setVerifyRules,
58
60
  props = _objectWithoutProperties(_ref, _excluded);
59
61
  var allConfig = _objectSpread(_objectSpread({}, props), JSON.parse(extra || '{}'));
60
62
  var _props = {
@@ -73,9 +75,10 @@ export function translator() {
73
75
  if (allConfig.note) _props.extra = allConfig.note;
74
76
  if (allConfig.tip) _props.tip = allConfig.tip;
75
77
  /* *********************************** extra ******************************* */
76
- if (allConfig['opt_length']) _props.config.length = allConfig['opt_length'];
77
- if (!isNil(allConfig['opt_number_min'])) _props.config.min = allConfig['opt_number_min'];
78
- if (!isNil(allConfig['opt_number_max'])) _props.config.max = allConfig['opt_number_max'];
78
+ var verifyListObj = keyBy(verifyList, 'verifyType');
79
+ if (allConfig['opt_length'] && !verifyListObj.length) _props.config.length = allConfig['opt_length'];
80
+ if (!isNil(allConfig['opt_number_min']) && !verifyListObj.min) _props.config.min = allConfig['opt_number_min'];
81
+ if (!isNil(allConfig['opt_number_max']) && !verifyListObj.max) _props.config.max = allConfig['opt_number_max'];
79
82
  if (!isNil(allConfig['opt_decimal'])) _props.config.precision = allConfig['opt_decimal'];
80
83
  // 兼容部分组件多选移至props
81
84
  if (!isNil(allConfig['opt_multiple'])) _props.multiple = !!allConfig['opt_multiple'];
@@ -90,6 +93,7 @@ export function translator() {
90
93
  })
91
94
  }];
92
95
  if (allConfig['desensitized']) _props.desensitized = allConfig['desensitized']; // 脱敏
96
+ if ((verifyList === null || verifyList === void 0 ? void 0 : verifyList.length) > 0 && setVerifyRules) return setVerifyRules(_props, verifyListObj);
93
97
  return _props;
94
98
  }
95
99
 
@@ -1,4 +1,9 @@
1
1
  export default {
2
+ "luckda.lowcode.painter.import": "导入",
3
+ "lc.form.validator.maxLength": "字数不得超过",
4
+ "lc.form.validator.textNum": "个字符",
5
+ "lc.form.validator.numberBelowMin": "低于最小值",
6
+ "lc.form.validator.numberExceedMax": "超过最大值",
2
7
  "luckda.lowcode.painter.panel.attrs": "属性",
3
8
  "luckda.lowcode.painter.panel.css": "样式",
4
9
  "luckda.lowcode.painter.panel.advance": "高级",
@@ -57,10 +62,11 @@ export default {
57
62
  "luckda.lowcode.painter.panel-section.Layoutratio.err": "必须是数字或者数字加:号的组合",
58
63
  "luckda.lowcode.painter.panel-section.Layoutratio.label": "列比例",
59
64
  "luckda.lowcode.painter.panel-section.style-panel.sourceedit": "源码编辑",
60
- "luckda.lowcode.painter.import": "导入",
61
- "luckda.lowcode.painter.panel-section.impexp.impUrl.placeholder": "请输入模版ID或自定义接口",
62
- "luckda.lowcode.painter.export": "导出",
63
65
  "luckda.lowcode.painter.panel-section.impexp.expUrl.placeholder": "请输入自定义接口",
66
+ "luckda.lowcode.painter.panel-section.impexp.expType.placeholder": "请选择自定义行为",
67
+ "luckda.lowcode.painter.panel-section.impexp.impUrl.placeholder": "请输入自定义接口",
68
+ "luckda.lowcode.painter.panel-section.impexp.impType.placeholder": "请选择自定义行为",
69
+ "luckda.lowcode.painter.export": "导出",
64
70
  "luckda.lowcode.painter.bindCondition": "绑定条件",
65
71
  "luckda.lowcode.painter.panel-section.iconConditionSelector.add": "添加条件",
66
72
  "luckda.lowcode.painter.panel-section.fieldsSetting.field": "数据字段",
@@ -184,6 +190,7 @@ export default {
184
190
  "luckda.lowcode.painter.panel-section.fieldsSetting.fixed.none": "不固定",
185
191
  "luckda.lowcode.painter.panel-section.fieldsSetting.fixed.left": "左",
186
192
  "luckda.lowcode.painter.panel-section.fieldsSetting.fixed.right": "右",
193
+ "luckda.lowcode.painter.delete.tip": "确定删除吗?",
187
194
  "luckda.lowcode.painter.panel-section.fieldsSetting.width": "列宽",
188
195
  "luckda.lowcode.painter.panel-section.fieldsSetting.align": "内容对齐",
189
196
  "luckda.lowcode.painter.panel-section.fieldsSetting.headerAlign": "表头对齐",
@@ -196,15 +203,16 @@ export default {
196
203
  "luckda.lowcode.painter.panel-section.fieldsSetting.placeholder": "默认提示",
197
204
  "luckda.lowcode.painter.panel-section.fieldsSetting.isEqual": "唯一校验",
198
205
  "luckda.lowcode.painter.panel-section.fieldsSetting.required": "是否必填",
199
- "luckda.lowcode.painter.panel-section.fieldsSetting.display": "是否显示",
206
+ "luckda.lowcode.painter.panel-section.fieldsSetting.table.display": "表格中显示",
207
+ "luckda.lowcode.painter.panel-section.fieldsSetting.form.display": "表单中显示",
200
208
  "luckda.lowcode.painter.panel-section.fieldsSetting.writable": "是否可写",
201
209
  "luckda.lowcode.painter.panel-section.fieldsSetting.readonly": "是否只读",
202
210
  "luckda.lowcode.painter.panel-section.fieldsSetting.defaultValue": "默认值",
203
211
  "luckda.lowcode.painter.settingTo": "设置为",
204
212
  "luckda.lowcode.painter.setting": "设置",
205
- "luckda.lowcode.painter.panel-section.fieldsSetting.rules": "校验规则",
213
+ "luckda.lowcode.painter.panel-section.fieldsSetting.rules.front": "前端校验规则",
206
214
  "luckda.lowcode.painter.panel-section.fieldsSetting.addRules": "添加校验规则",
207
- "luckda.lowcode.painter.delete.tip": "确定删除吗?",
215
+ "luckda.lowcode.painter.panel-section.fieldsSetting.rules": "校验规则",
208
216
  "luckda.lowcode.painter.panel-section.fieldsSetting.defaultValue.assign": "赋值事件",
209
217
  "luckda.lowcode.painter.panel-section.fieldsSetting.defaultValue.message.assign": "请选择赋值事件",
210
218
  "luckda.lowcode.painter.expression": "表达式",
@@ -221,11 +229,8 @@ export default {
221
229
  "luckda.lowcode.painter.panel-section.fieldsSetting.attrs.contrary": "取反",
222
230
  "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.verifyType": "校验规则",
223
231
  "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.message.verifyType": "请选择校验规则",
224
- "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.verifyScope": "校验类型",
225
- "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.message.verifyScope": "请选择校验类型",
226
- "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.frontend": "前端",
227
- "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.backend": "后端",
228
232
  "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.errorMsg": "错误提示",
229
233
  "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.message.errorMsg": "请输入错误提示",
234
+ "luckda.lowcode.painter.panel-section.fieldsSetting.checkRules.logic": "校验逻辑",
230
235
  "luckda.lowcode.painter.components.fullscreen.tip": "全屏"
231
236
  };
@@ -47,9 +47,9 @@ export function fetchDesignModlueData(_x2, _x3) {
47
47
 
48
48
  /**
49
49
  * 获取preview时模块数据
50
- * @param {*} dmCode
51
- * @param {*} params
52
- * @returns
50
+ * @param {*} dmCode
51
+ * @param {*} params
52
+ * @returns
53
53
  */
54
54
  function _fetchDesignModlueData() {
55
55
  _fetchDesignModlueData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_, params) {
@@ -393,6 +393,12 @@ function _fetchAllBehavior() {
393
393
  export function fetchAllSerials(_x19) {
394
394
  return _fetchAllSerials.apply(this, arguments);
395
395
  }
396
+
397
+ /**
398
+ * 读取导入导出数据源
399
+ * @param {{moduleCode, behaviorMode:[IMPORT, EXPORT]}} params
400
+ * @returns
401
+ */
396
402
  function _fetchAllSerials() {
397
403
  _fetchAllSerials = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
398
404
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
@@ -409,6 +415,25 @@ function _fetchAllSerials() {
409
415
  }));
410
416
  return _fetchAllSerials.apply(this, arguments);
411
417
  }
418
+ export function fetchAllBehaviorEx(_x20) {
419
+ return _fetchAllBehaviorEx.apply(this, arguments);
420
+ }
421
+ function _fetchAllBehaviorEx() {
422
+ _fetchAllBehaviorEx = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
423
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
424
+ while (1) switch (_context17.prev = _context17.next) {
425
+ case 0:
426
+ return _context17.abrupt("return", request("".concat(API_PREFIX_PAGE, "/option/noAuthGetBehavior"), {
427
+ params: params
428
+ }));
429
+ case 1:
430
+ case "end":
431
+ return _context17.stop();
432
+ }
433
+ }, _callee17);
434
+ }));
435
+ return _fetchAllBehaviorEx.apply(this, arguments);
436
+ }
412
437
  export function getBehaviorUrl() {
413
438
  var mdCode = window[DATA_MODEL_CODE_KEY];
414
439
  return "".concat(api.API_HOST, "/").concat(mdCode, "/to/behavior/call");
@@ -420,7 +445,7 @@ export function getBehaviorUrl() {
420
445
  * @param {*} data
421
446
  * @returns
422
447
  */
423
- export function fetchCallBehavior(_x20, _x21) {
448
+ export function fetchCallBehavior(_x21, _x22) {
424
449
  return _fetchCallBehavior.apply(this, arguments);
425
450
  }
426
451
 
@@ -430,11 +455,11 @@ export function fetchCallBehavior(_x20, _x21) {
430
455
  * @returns
431
456
  */
432
457
  function _fetchCallBehavior() {
433
- _fetchCallBehavior = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params, data) {
434
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
435
- while (1) switch (_context17.prev = _context17.next) {
458
+ _fetchCallBehavior = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params, data) {
459
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
460
+ while (1) switch (_context18.prev = _context18.next) {
436
461
  case 0:
437
- return _context17.abrupt("return", request(getBehaviorUrl(), {
462
+ return _context18.abrupt("return", request(getBehaviorUrl(), {
438
463
  method: 'POST',
439
464
  data: data,
440
465
  params: params,
@@ -444,54 +469,115 @@ function _fetchCallBehavior() {
444
469
  }));
445
470
  case 1:
446
471
  case "end":
447
- return _context17.stop();
472
+ return _context18.stop();
448
473
  }
449
- }, _callee17);
474
+ }, _callee18);
450
475
  }));
451
476
  return _fetchCallBehavior.apply(this, arguments);
452
477
  }
453
- export function fetchClearCache(_x22) {
478
+ export function fetchClearCache(_x23) {
454
479
  return _fetchClearCache.apply(this, arguments);
455
480
  }
456
481
 
457
482
  /**
458
483
  * 更新页面配置数据
459
- * @param {*} data
460
- * @returns
484
+ * @param {*} data
485
+ * @returns
461
486
  */
462
487
  function _fetchClearCache() {
463
- _fetchClearCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
464
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
465
- while (1) switch (_context18.prev = _context18.next) {
488
+ _fetchClearCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
489
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
490
+ while (1) switch (_context19.prev = _context19.next) {
466
491
  case 0:
467
- return _context18.abrupt("return", request("".concat(api.LUCKDA_HOST, "/cache/manage/noAuthModuleConfigClear"), {
492
+ return _context19.abrupt("return", request("".concat(api.LUCKDA_HOST, "/cache/manage/noAuthModuleConfigClear"), {
468
493
  params: params
469
494
  }));
470
495
  case 1:
471
496
  case "end":
472
- return _context18.stop();
497
+ return _context19.stop();
473
498
  }
474
- }, _callee18);
499
+ }, _callee19);
475
500
  }));
476
501
  return _fetchClearCache.apply(this, arguments);
477
502
  }
478
- export function fetchUpdatePageData(_x23) {
503
+ export function fetchUpdatePageData(_x24) {
479
504
  return _fetchUpdatePageData.apply(this, arguments);
480
505
  }
506
+
507
+ /**
508
+ * 导出excel
509
+ * @param {*} data
510
+ * @returns
511
+ */
481
512
  function _fetchUpdatePageData() {
482
- _fetchUpdatePageData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data) {
483
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
484
- while (1) switch (_context19.prev = _context19.next) {
513
+ _fetchUpdatePageData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(data) {
514
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
515
+ while (1) switch (_context20.prev = _context20.next) {
485
516
  case 0:
486
- return _context19.abrupt("return", request("".concat(API_PREFIX_PAGE, "/data/update"), {
517
+ return _context20.abrupt("return", request("".concat(API_PREFIX_PAGE, "/data/update"), {
487
518
  method: 'POST',
488
519
  data: data
489
520
  }));
490
521
  case 1:
491
522
  case "end":
492
- return _context19.stop();
523
+ return _context20.stop();
493
524
  }
494
- }, _callee19);
525
+ }, _callee20);
495
526
  }));
496
527
  return _fetchUpdatePageData.apply(this, arguments);
528
+ }
529
+ export function exportExcel(_x25) {
530
+ return _exportExcel.apply(this, arguments);
531
+ }
532
+ function _exportExcel() {
533
+ _exportExcel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(data) {
534
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
535
+ while (1) switch (_context21.prev = _context21.next) {
536
+ case 0:
537
+ return _context21.abrupt("return", new Promise(function (resolve, reject) {
538
+ resolve('getexportExcel-res');
539
+ }));
540
+ case 1:
541
+ case "end":
542
+ return _context21.stop();
543
+ }
544
+ }, _callee21);
545
+ }));
546
+ return _exportExcel.apply(this, arguments);
547
+ }
548
+ var cpage = 0,
549
+ total = 100;
550
+ /**
551
+ * 导出excel
552
+ * @param {*} data
553
+ * @returns
554
+ */
555
+ export function readExportExcelState(_x26) {
556
+ return _readExportExcelState.apply(this, arguments);
557
+ }
558
+ function _readExportExcelState() {
559
+ _readExportExcelState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(url) {
560
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
561
+ while (1) switch (_context22.prev = _context22.next) {
562
+ case 0:
563
+ // return request(`${api.API_HOST}${url}`);
564
+ console.log('readExportExcelState', url);
565
+ cpage += 10;
566
+ return _context22.abrupt("return", new Promise(function (resolve, reject) {
567
+ setTimeout(function () {
568
+ // resolve({
569
+ // cpage, total, downloadUrl: '/api'
570
+ // })
571
+ reject({
572
+ message: 'XXX'
573
+ });
574
+ }, 1000);
575
+ }));
576
+ case 3:
577
+ case "end":
578
+ return _context22.stop();
579
+ }
580
+ }, _callee22);
581
+ }));
582
+ return _readExportExcelState.apply(this, arguments);
497
583
  }