@pisell/materials 1.0.407 → 1.0.409

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 (149) hide show
  1. package/build/lowcode/assets-daily.json +13 -13
  2. package/build/lowcode/assets-dev.json +4 -4
  3. package/build/lowcode/assets-prod.json +13 -13
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +59 -16
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +62 -19
  11. package/es/components/browserSelect/chevron-down.png +0 -0
  12. package/es/components/browserSelect/index.d.ts +15 -0
  13. package/es/components/browserSelect/index.js +36 -0
  14. package/es/components/browserSelect/index.less +18 -0
  15. package/es/components/date-picker/constants.d.ts +39 -0
  16. package/es/components/date-picker/constants.js +76 -0
  17. package/es/components/date-picker/datePickerCpt.d.ts +8 -0
  18. package/es/components/date-picker/datePickerCpt.js +370 -0
  19. package/es/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
  20. package/es/components/date-picker/hooks/useMediaQuery.js +28 -0
  21. package/es/components/date-picker/index.js +2 -2
  22. package/es/components/date-picker/index.less +1880 -0
  23. package/es/components/drag-sort-tree/index.d.ts +0 -1
  24. package/es/components/drag-sort-tree/index.js +2 -1
  25. package/es/components/page/index.js +4 -2
  26. package/es/components/picker-view/index.d.ts +2 -0
  27. package/es/components/picker-view/index.js +2 -0
  28. package/es/components/pisell-config-provider/index.js +2 -0
  29. package/es/components/pisellModal/components/functions/index.d.ts +23 -5
  30. package/es/components/pisellModal/components/functions/index.js +7 -2
  31. package/es/components/pisellModal/index.d.ts +20 -5
  32. package/es/components/pisellTags/index.d.ts +13 -0
  33. package/es/components/pisellTags/index.js +83 -0
  34. package/es/components/pisellTags/index.less +17 -0
  35. package/es/components/pisellTags/utils.d.ts +1 -0
  36. package/es/components/pisellTags/utils.js +89 -0
  37. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
  38. package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +33 -48
  39. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -9
  40. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
  41. package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +28 -43
  42. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
  43. package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +45 -44
  44. package/es/components/table/Actions/component/ExportImport/index.d.ts +3 -3
  45. package/es/components/table/Actions/component/ExportImport/index.js +34 -25
  46. package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
  47. package/es/components/table/Actions/component/ExportImport/utils/index.js +11 -0
  48. package/es/components/table/BasicTable/index.js +5 -3
  49. package/es/components/table/Gallery/index.js +2 -1
  50. package/es/components/table/Table/fields/rangePicker/Edit/index.js +13 -11
  51. package/es/components/table/Table/index.d.ts +2 -2
  52. package/es/components/table/Table/index.js +68 -42
  53. package/es/components/table/Table/index.less +3 -0
  54. package/es/components/table/Table/utils.d.ts +14 -2
  55. package/es/components/table/Table/utils.js +6 -2
  56. package/es/components/table/View/index.d.ts +2 -2
  57. package/es/components/table/View/index.js +27 -16
  58. package/es/components/table/hooks/useGenScroll.js +1 -1
  59. package/es/components/table/hooks/useTableSetting.js +29 -7
  60. package/es/components/table/hooks/useTransDataSource.d.ts +1 -0
  61. package/es/components/table/hooks/useTransDataSource.js +8 -6
  62. package/es/components/table/index.js +7 -5
  63. package/es/components/table/index.less +9 -0
  64. package/es/components/table/serve.d.ts +3 -1
  65. package/es/components/table/serve.js +71 -9
  66. package/es/components/table/types.d.ts +17 -4
  67. package/es/index.d.ts +3 -1
  68. package/es/index.js +3 -1
  69. package/es/locales/en-US.d.ts +12 -0
  70. package/es/locales/en-US.js +13 -0
  71. package/es/locales/zh-CN.d.ts +12 -0
  72. package/es/locales/zh-CN.js +13 -0
  73. package/es/locales/zh-TW.d.ts +12 -0
  74. package/es/locales/zh-TW.js +13 -0
  75. package/lib/components/browserSelect/chevron-down.png +0 -0
  76. package/lib/components/browserSelect/index.d.ts +15 -0
  77. package/lib/components/browserSelect/index.js +59 -0
  78. package/lib/components/browserSelect/index.less +18 -0
  79. package/lib/components/date-picker/constants.d.ts +39 -0
  80. package/lib/components/date-picker/constants.js +78 -0
  81. package/lib/components/date-picker/datePickerCpt.d.ts +8 -0
  82. package/lib/components/date-picker/datePickerCpt.js +403 -0
  83. package/lib/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
  84. package/lib/components/date-picker/hooks/useMediaQuery.js +43 -0
  85. package/lib/components/date-picker/index.js +2 -2
  86. package/lib/components/date-picker/index.less +1880 -0
  87. package/lib/components/drag-sort-tree/index.d.ts +0 -1
  88. package/lib/components/drag-sort-tree/index.js +0 -1
  89. package/lib/components/page/index.js +3 -2
  90. package/lib/components/picker-view/index.d.ts +2 -0
  91. package/lib/components/picker-view/index.js +36 -0
  92. package/lib/components/pisell-config-provider/index.js +2 -0
  93. package/lib/components/pisellModal/components/functions/index.d.ts +23 -5
  94. package/lib/components/pisellModal/components/functions/index.js +13 -7
  95. package/lib/components/pisellModal/index.d.ts +20 -5
  96. package/lib/components/pisellTags/index.d.ts +13 -0
  97. package/lib/components/pisellTags/index.js +113 -0
  98. package/lib/components/pisellTags/index.less +17 -0
  99. package/lib/components/pisellTags/utils.d.ts +1 -0
  100. package/lib/components/pisellTags/utils.js +86 -0
  101. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
  102. package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +9 -22
  103. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +3 -8
  104. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
  105. package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +9 -22
  106. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
  107. package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +5 -8
  108. package/lib/components/table/Actions/component/ExportImport/index.d.ts +3 -3
  109. package/lib/components/table/Actions/component/ExportImport/index.js +15 -8
  110. package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
  111. package/lib/components/table/Actions/component/ExportImport/utils/index.js +31 -0
  112. package/lib/components/table/BasicTable/index.js +2 -3
  113. package/lib/components/table/Gallery/index.js +2 -1
  114. package/lib/components/table/Table/fields/rangePicker/Edit/index.js +1 -9
  115. package/lib/components/table/Table/index.d.ts +2 -2
  116. package/lib/components/table/Table/index.js +61 -34
  117. package/lib/components/table/Table/index.less +3 -0
  118. package/lib/components/table/Table/utils.d.ts +14 -2
  119. package/lib/components/table/Table/utils.js +7 -1
  120. package/lib/components/table/View/index.d.ts +2 -2
  121. package/lib/components/table/View/index.js +28 -19
  122. package/lib/components/table/hooks/useGenScroll.js +1 -1
  123. package/lib/components/table/hooks/useTableSetting.js +26 -11
  124. package/lib/components/table/hooks/useTransDataSource.d.ts +1 -0
  125. package/lib/components/table/hooks/useTransDataSource.js +6 -5
  126. package/lib/components/table/index.js +4 -4
  127. package/lib/components/table/index.less +9 -0
  128. package/lib/components/table/serve.d.ts +3 -1
  129. package/lib/components/table/serve.js +38 -6
  130. package/lib/components/table/types.d.ts +17 -4
  131. package/lib/index.d.ts +3 -1
  132. package/lib/index.js +6 -0
  133. package/lib/locales/en-US.d.ts +12 -0
  134. package/lib/locales/en-US.js +13 -0
  135. package/lib/locales/zh-CN.d.ts +12 -0
  136. package/lib/locales/zh-CN.js +13 -0
  137. package/lib/locales/zh-TW.d.ts +12 -0
  138. package/lib/locales/zh-TW.js +13 -0
  139. package/lowcode/table/meta.ts +26 -18
  140. package/lowcode/table/snippets.ts +2 -3
  141. package/package.json +3 -3
  142. package/dist/umd/materials.min.css +0 -1
  143. package/dist/umd/materials.min.js +0 -1
  144. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  145. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  146. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  147. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  148. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  149. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import './index.less';
3
2
  import { SortType } from './types';
4
3
  declare const DragSortTree: (props: SortType) => React.JSX.Element;
5
4
  export default DragSortTree;
@@ -13,7 +13,8 @@ import { DndContext, useSensor, useSensors, PointerSensor } from '@dnd-kit/core'
13
13
  import { SortableContext, verticalListSortingStrategy, arrayMove } from '@dnd-kit/sortable';
14
14
  import TreeItem from "./TreeItem";
15
15
  import { restrictToVerticalAxis, restrictToParentElement } from '@dnd-kit/modifiers';
16
- import "./index.less";
16
+ // import './index.less';
17
+
17
18
  var DragSortTree = function DragSortTree(props) {
18
19
  var value = props.value,
19
20
  rowKey = props.rowKey,
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["children", "style", "locale"];
2
+ var _excluded = ["children", "style", "className", "locale"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -47,6 +47,7 @@ var Page = function Page(props) {
47
47
  var _context$appHelper, _context$engine, _context$engine$props, _localeDateMap;
48
48
  var children = props.children,
49
49
  style = props.style,
50
+ className = props.className,
50
51
  propsLocale = props.locale,
51
52
  others = _objectWithoutProperties(props, _excluded);
52
53
  var context = useEngineContext();
@@ -252,7 +253,8 @@ var Page = function Page(props) {
252
253
  }, /*#__PURE__*/React.createElement("div", {
253
254
  style: _objectSpread(_objectSpread({}, style), {}, {
254
255
  '--theme-color': themeColor || '#7F56D9'
255
- })
256
+ }),
257
+ className: className
256
258
  }, children)))))));
257
259
  };
258
260
  export default Page;
@@ -0,0 +1,2 @@
1
+ import PickerView from 'antd-mobile/es/components/picker-view';
2
+ export default PickerView;
@@ -0,0 +1,2 @@
1
+ import PickerView from 'antd-mobile/es/components/picker-view';
2
+ export default PickerView;
@@ -4,6 +4,7 @@ import PisellContext, { globalConfig } from "./context";
4
4
  import { useResponsive } from "../../hooks";
5
5
  import useEngineContext from "../../hooks/useEngineContext";
6
6
  import { setMessage } from "../pisellMessage";
7
+ import { setModal } from "../pisellModal/components/functions";
7
8
  var platformMap = {
8
9
  phone: 'h5',
9
10
  pc: 'pc',
@@ -28,6 +29,7 @@ var PisellConfigProvider = function PisellConfigProvider(props) {
28
29
  };
29
30
  var staticFunction = App.useApp();
30
31
  setMessage(staticFunction.message);
32
+ setModal(staticFunction.modal);
31
33
  globalConfig.setConfig(config);
32
34
  return /*#__PURE__*/React.createElement(PisellContext.Provider, {
33
35
  value: config
@@ -1,12 +1,30 @@
1
1
  import { ModalFuncProps } from 'antd';
2
+ import { useAppProps } from 'antd/es/app/context';
2
3
  import { PisellContextType } from '../../../pisell-config-provider/context';
3
4
  import './index.less';
5
+ declare const setModal: (m: useAppProps['modal']) => void;
4
6
  export interface PisellModalFuncProps extends ModalFuncProps {
5
7
  platform?: PisellContextType['platform'];
6
8
  }
7
- export declare const info: (props: PisellModalFuncProps) => any;
8
- export declare const success: (props: PisellModalFuncProps) => any;
9
- export declare const error: (props: PisellModalFuncProps) => any;
10
- export declare const warning: (props: PisellModalFuncProps) => any;
9
+ export declare const info: (props: PisellModalFuncProps) => {
10
+ destroy: () => void;
11
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
12
+ };
13
+ export declare const success: (props: PisellModalFuncProps) => {
14
+ destroy: () => void;
15
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
16
+ };
17
+ export declare const error: (props: PisellModalFuncProps) => {
18
+ destroy: () => void;
19
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
20
+ };
21
+ export declare const warning: (props: PisellModalFuncProps) => {
22
+ destroy: () => void;
23
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
24
+ };
11
25
  export declare const warn: (props: PisellModalFuncProps) => any;
12
- export declare const confirm: (props: PisellModalFuncProps) => any;
26
+ export declare const confirm: (props: PisellModalFuncProps) => {
27
+ destroy: () => void;
28
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
29
+ };
30
+ export { setModal };
@@ -4,15 +4,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import Modal from "../../../modal";
8
7
  import classNames from 'classnames';
9
8
  import { globalConfig } from "../../../pisell-config-provider/context";
10
9
  import "./index.less";
10
+ var Modal;
11
+ var setModal = function setModal(m) {
12
+ Modal = m;
13
+ };
11
14
  var genConfig = function genConfig(props) {
12
15
  var _globalConfig$getConf = globalConfig.getConfig(),
13
16
  platform = _globalConfig$getConf.platform;
14
17
  return _objectSpread(_objectSpread({}, props), {}, {
15
18
  wrapClassName: classNames('pisell-modal-function-wrap', _defineProperty({}, 'pisell-modal-mobile-function-wrap', platform === 'h5')),
19
+ transitionName: "pisell-move-down",
16
20
  cancelButtonProps: _objectSpread({
17
21
  block: true,
18
22
  size: 'large'
@@ -41,4 +45,5 @@ export var warn = function warn(props) {
41
45
  };
42
46
  export var confirm = function confirm(props) {
43
47
  return Modal.confirm(genConfig(props));
44
- };
48
+ };
49
+ export { setModal };
@@ -32,12 +32,27 @@ export interface PisellModalProps extends ModalProps {
32
32
  }
33
33
  declare const PisellModal: {
34
34
  (props: PisellModalProps): React.JSX.Element;
35
- confirm: (props: import("./components/functions").PisellModalFuncProps) => any;
36
- info: (props: import("./components/functions").PisellModalFuncProps) => any;
37
- error: (props: import("./components/functions").PisellModalFuncProps) => any;
35
+ confirm: (props: import("./components/functions").PisellModalFuncProps) => {
36
+ destroy: () => void;
37
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
38
+ };
39
+ info: (props: import("./components/functions").PisellModalFuncProps) => {
40
+ destroy: () => void;
41
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
42
+ };
43
+ error: (props: import("./components/functions").PisellModalFuncProps) => {
44
+ destroy: () => void;
45
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
46
+ };
38
47
  warn: (props: import("./components/functions").PisellModalFuncProps) => any;
39
- warning: (props: import("./components/functions").PisellModalFuncProps) => any;
40
- success: (props: import("./components/functions").PisellModalFuncProps) => any;
48
+ warning: (props: import("./components/functions").PisellModalFuncProps) => {
49
+ destroy: () => void;
50
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
51
+ };
52
+ success: (props: import("./components/functions").PisellModalFuncProps) => {
53
+ destroy: () => void;
54
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
55
+ };
41
56
  Information: (props: import("./components/Information").InformationProps) => React.JSX.Element;
42
57
  };
43
58
  export default PisellModal;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export declare type PisellTagsType = 'pill_color' | 'pill_outline';
4
+ export declare type PisellTagsColor = 'success' | 'warning' | 'error' | 'gray' | string;
5
+ export interface PisellTagsProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {
6
+ children?: React.ReactNode;
7
+ others?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
8
+ type: PisellTagsType;
9
+ icon?: React.ReactNode;
10
+ color?: PisellTagsColor;
11
+ }
12
+ declare const PisellTags: (props: PisellTagsProps) => React.JSX.Element;
13
+ export default PisellTags;
@@ -0,0 +1,83 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["children", "type", "icon", "color", "style", "others"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ import React, { useMemo } from 'react';
12
+ import classNames from 'classnames';
13
+ import { generateColorShades } from "./utils";
14
+ import "./index.less";
15
+
16
+ // Pisell Tags 样式类型
17
+
18
+ // 预设颜色枚举
19
+ var pisellTagsColors = {
20
+ success: '#067647',
21
+ warning: '#B54708',
22
+ error: '#B42318',
23
+ gray: '#344054'
24
+ };
25
+
26
+ /**
27
+ * @title: 获取颜色
28
+ * @description:
29
+ * @param {PisellTagsColor} _color
30
+ * @return {*}
31
+ * @Author: zhiwei.Wang
32
+ * @Date: 2024-08-23 16:07
33
+ */
34
+ var getColor = function getColor(_color) {
35
+ if (_color) {
36
+ return pisellTagsColors[_color] || _color;
37
+ }
38
+ return '#344054';
39
+ };
40
+ var getPillColorStyles = function getPillColorStyles(_color) {
41
+ var colorShades = generateColorShades(_color);
42
+ return {
43
+ '--pisell-tags-bg-color': colorShades['color_50'],
44
+ '--pisell-tags-font-color': colorShades['color_700'],
45
+ '--pisell-tags-border-color': colorShades['color_200']
46
+ };
47
+ };
48
+ var getPillOutlineStyles = function getPillOutlineStyles(_color) {
49
+ var colorShades = generateColorShades(_color);
50
+ return {
51
+ '--pisell-tags-bg-color': 'transparent',
52
+ '--pisell-tags-font-color': colorShades['color_700'],
53
+ '--pisell-tags-border-color': colorShades['color_600']
54
+ };
55
+ };
56
+ var PisellTags = function PisellTags(props) {
57
+ var children = props.children,
58
+ type = props.type,
59
+ icon = props.icon,
60
+ color = props.color,
61
+ _props$style = props.style,
62
+ style = _props$style === void 0 ? {} : _props$style,
63
+ _props$others = props.others,
64
+ others = _props$others === void 0 ? {} : _props$others,
65
+ otherProps = _objectWithoutProperties(props, _excluded);
66
+ var styles = useMemo(function () {
67
+ var obj = _objectSpread(_objectSpread({}, style), others.style);
68
+ var _color = getColor(props.color);
69
+ if (type === 'pill_color') {
70
+ obj = _objectSpread(_objectSpread({}, obj), getPillColorStyles(_color));
71
+ }
72
+ if (type === 'pill_outline') {
73
+ obj = _objectSpread(_objectSpread({}, obj), getPillOutlineStyles(_color));
74
+ }
75
+ return obj;
76
+ }, [color, style, others.style, type]);
77
+ return /*#__PURE__*/React.createElement("span", _extends({
78
+ style: _objectSpread(_objectSpread({}, styles), style)
79
+ }, others, otherProps, {
80
+ className: classNames('pisell-tags', others.className, otherProps.className)
81
+ }), icon ? icon : null, children);
82
+ };
83
+ export default PisellTags;
@@ -0,0 +1,17 @@
1
+ .pisell-tags {
2
+ --pisell-tags-bg-color: #F9FAFB;
3
+ --pisell-tags-font-color: #344054;
4
+ --pisell-tags-border-color: #EAECF0;
5
+ border-radius: 16px;
6
+ border: 1px solid var(--pisell-tags-border-color);
7
+ background: var(--pisell-tags-bg-color);
8
+ display: inline-flex;
9
+ padding: 4px 12px;
10
+ align-items: center;
11
+ gap: 6px;
12
+
13
+ color: var(--pisell-tags-font-color);
14
+ font-size: 14px;
15
+ font-style: normal;
16
+ font-weight: 500;
17
+ }
@@ -0,0 +1 @@
1
+ export declare const generateColorShades: (color: string) => Record<string, string>;
@@ -0,0 +1,89 @@
1
+ // 定义 RGB 类型,包括 r, g, b 和可选的 a(透明度)分量
2
+
3
+ // 辅助函数:将 16 进制颜色转换为 RGB
4
+ var hexToRgb = function hexToRgb(hex) {
5
+ hex = hex.replace(/^#/, ''); // 去掉开头的 #
6
+ if (hex.length === 3) {
7
+ // 处理三位颜色码,扩展为六位颜色码
8
+ hex = hex.split('').map(function (h) {
9
+ return h + h;
10
+ }).join('');
11
+ }
12
+ var intVal = parseInt(hex, 16); // 将 16 进制转换为整数
13
+ return {
14
+ r: intVal >> 16 & 255,
15
+ // 提取红色分量
16
+ g: intVal >> 8 & 255,
17
+ // 提取绿色分量
18
+ b: intVal & 255 // 提取蓝色分量
19
+ };
20
+ };
21
+
22
+ // 辅助函数:将 RGB 转换为 16 进制颜色
23
+ var rgbToHex = function rgbToHex(r, g, b) {
24
+ return '#' + [r, g, b].map(function (x) {
25
+ var hex = x.toString(16); // 将数值转换为 16 进制字符串
26
+ return hex.length === 1 ? '0' + hex : hex; // 确保每个分量都是两位
27
+ }).join(''); // 将 RGB 分量组合为 16 进制颜色码
28
+ };
29
+
30
+ // 辅助函数:解析输入的颜色字符串,并返回 RGB 或 RGBA 对象
31
+ var parseColor = function parseColor(color) {
32
+ if (color.startsWith('#')) {
33
+ return hexToRgb(color); // 处理 16 进制颜色
34
+ } else if (color.startsWith('rgb')) {
35
+ // 处理 RGB 或 RGBA 颜色
36
+ var rgba = color.replace(/rgba?\(|\s+|\)/g, '').split(',').map(Number);
37
+ return {
38
+ r: rgba[0],
39
+ g: rgba[1],
40
+ b: rgba[2],
41
+ a: rgba[3] !== undefined ? rgba[3] : 1
42
+ };
43
+ } else {
44
+ throw new Error('无效的颜色格式');
45
+ }
46
+ };
47
+
48
+ // 生成颜色阶梯的函数
49
+ export var generateColorShades = function generateColorShades(color) {
50
+ var _parseColor = parseColor(color),
51
+ r = _parseColor.r,
52
+ g = _parseColor.g,
53
+ b = _parseColor.b,
54
+ a = _parseColor.a;
55
+ var max = 700;
56
+ var gap = 1 / max;
57
+
58
+ // 定义相对于 700 阶梯的 50, 200, 500 阶梯的比例
59
+ var ratios = {
60
+ 50: gap * 50,
61
+ 200: gap * 200,
62
+ 500: gap * 500,
63
+ 600: gap * 600,
64
+ 700: gap * 700
65
+ };
66
+
67
+ // 调整颜色分量的函数,基于比例计算新的分量值
68
+ var adjustColorComponent = function adjustColorComponent(component, ratio) {
69
+ return Math.round(component * ratio + 255 * (1 - ratio));
70
+ };
71
+
72
+ // 生成不同阶梯的颜色
73
+ var shades = {
74
+ 'color_50': rgbToHex(adjustColorComponent(r, ratios[50]), adjustColorComponent(g, ratios[50]), adjustColorComponent(b, ratios[50])),
75
+ 'color_200': rgbToHex(adjustColorComponent(r, ratios[200]), adjustColorComponent(g, ratios[200]), adjustColorComponent(b, ratios[200])),
76
+ 'color_500': rgbToHex(adjustColorComponent(r, ratios[500]), adjustColorComponent(g, ratios[500]), adjustColorComponent(b, ratios[500])),
77
+ 'color_600': rgbToHex(adjustColorComponent(r, ratios[600]), adjustColorComponent(g, ratios[600]), adjustColorComponent(b, ratios[600])),
78
+ 'color_700': color
79
+ };
80
+
81
+ // 如果原始颜色带有透明度 (RGBA),在返回结果中包含透明度信息
82
+ if (a !== undefined) {
83
+ shades['color_50'] = "rgba(".concat(adjustColorComponent(r, ratios[50]), ", ").concat(adjustColorComponent(g, ratios[50]), ", ").concat(adjustColorComponent(b, ratios[50]), ", ").concat(a, ")");
84
+ shades['color_200'] = "rgba(".concat(adjustColorComponent(r, ratios[200]), ", ").concat(adjustColorComponent(g, ratios[200]), ", ").concat(adjustColorComponent(b, ratios[200]), ", ").concat(a, ")");
85
+ shades['color_500'] = "rgba(".concat(adjustColorComponent(r, ratios[500]), ", ").concat(adjustColorComponent(g, ratios[500]), ", ").concat(adjustColorComponent(b, ratios[500]), ", ").concat(a, ")");
86
+ shades['color_600'] = "rgba(".concat(adjustColorComponent(r, ratios[600]), ", ").concat(adjustColorComponent(g, ratios[600]), ", ").concat(adjustColorComponent(b, ratios[600]), ", ").concat(a, ")");
87
+ }
88
+ return shades;
89
+ };
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { ExportImportType } from "../../../../../types";
3
- import "./index.less";
1
+ import React from 'react';
2
+ import { ExportImportType } from '../../../../../types';
3
+ import './index.less';
4
4
  declare const ExportFile: (props: {
5
5
  exportImport: ExportImportType;
6
6
  }) => React.JSX.Element;
@@ -10,52 +10,36 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  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; }
11
11
  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; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { useRequest } from "ahooks";
14
- import { Spin, Table } from "antd";
15
- import React, { useEffect, useState } from "react";
13
+ import { useRequest } from 'ahooks';
14
+ import { Spin, Table } from 'antd';
15
+ import React, { useEffect, useState } from 'react';
16
16
  import useEngineContext from "../../../../../../../hooks/useEngineContext";
17
17
  import { getText } from "../../../../../../../locales/index";
18
- import { historyData } from "../../../../../serve";
19
- import { defaultOptions } from "../../../../../status";
18
+ import { getExportFile } from "../../../../../serve";
20
19
  import { request } from "../../../../../utils";
21
20
  import { formatDate } from "../../utils/date";
22
21
  import download from "../../utils/download";
23
22
  import "./index.less";
24
23
  var defaultData = {
25
- type: defaultOptions.exportValue,
26
24
  skip: 1,
27
25
  num: 10
28
26
  };
29
27
  var exportStatusOptions = {
30
- pending: getText("table-action-export-import-file-pending"),
31
- processing: getText("table-action-export-import-file-processing"),
32
- completed: getText("table-action-export-import-file-completed"),
33
- complete: getText("table-action-export-import-file-completed")
28
+ pending: getText('table-action-export-import-file-pending'),
29
+ processing: getText('table-action-export-import-file-processing'),
30
+ completed: getText('table-action-export-import-file-completed'),
31
+ complete: getText('table-action-export-import-file-completed')
34
32
  };
35
33
  var ExportFile = function ExportFile(props) {
36
34
  var exportImport = props.exportImport;
37
- var formId = exportImport.formId,
38
- formCode = exportImport.formCode;
35
+ var apiUrl = exportImport.apiUrl,
36
+ otherParams = exportImport.otherParams;
39
37
  var _useState = useState([]),
40
38
  _useState2 = _slicedToArray(_useState, 2),
41
39
  list = _useState2[0],
42
40
  setList = _useState2[1];
43
- var _useState3 = useState(defaultData),
44
- _useState4 = _slicedToArray(_useState3, 2),
45
- defaultParams = _useState4[0],
46
- setDefaultParams = _useState4[1];
47
41
  var context = useEngineContext();
48
42
  request.setRequest(context.appHelper.utils.request);
49
- useEffect(function () {
50
- var params = {};
51
- if (formId) {
52
- params.form_id = formId;
53
- }
54
- if (formCode) {
55
- params.code = formCode;
56
- }
57
- setDefaultParams(_objectSpread(_objectSpread({}, defaultParams), params));
58
- }, [formId, formCode]);
59
43
 
60
44
  /**
61
45
  * @title: 导出文件
@@ -64,7 +48,7 @@ var ExportFile = function ExportFile(props) {
64
48
  * @Author: WangHan
65
49
  * @Date: 2024-06-29 15:17
66
50
  */
67
- var _historyList = useRequest(historyData, {
51
+ var _historyList = useRequest(getExportFile, {
68
52
  manual: true,
69
53
  onSuccess: function onSuccess(res) {
70
54
  if (res.code == 200) {
@@ -74,60 +58,61 @@ var ExportFile = function ExportFile(props) {
74
58
  }
75
59
  });
76
60
  var init = function init() {
77
- if (defaultParams !== null && defaultParams !== void 0 && defaultParams.form_id || defaultParams !== null && defaultParams !== void 0 && defaultParams.code) {
78
- _historyList.run(defaultParams);
79
- }
61
+ var _defaultParams = _objectSpread(_objectSpread(_objectSpread({}, defaultData), otherParams), {}, {
62
+ url: apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export_file
63
+ });
64
+ _historyList.run(_defaultParams);
80
65
  };
81
66
  useEffect(function () {
82
67
  init();
83
- }, [defaultParams]);
68
+ }, [exportImport]);
84
69
  var columns = [{
85
- title: getText("table-action-export-import-file-name"),
86
- dataIndex: "file_name",
70
+ title: getText('table-action-export-import-file-name'),
71
+ dataIndex: 'file_name',
87
72
  render: function render(text, record) {
88
- return /*#__PURE__*/React.createElement(React.Fragment, null, record.status == "completed" || record.status == "complete" ? /*#__PURE__*/React.createElement("a", {
73
+ return /*#__PURE__*/React.createElement(React.Fragment, null, record.status == 'completed' || record.status == 'complete' ? /*#__PURE__*/React.createElement("a", {
89
74
  onClick: function onClick() {
90
75
  download(record.url, text);
91
76
  }
92
77
  }, text) : /*#__PURE__*/React.createElement("span", null, text));
93
78
  }
94
79
  }, {
95
- title: getText("table-action-export-import-file-content"),
96
- dataIndex: "setting",
80
+ title: getText('table-action-export-import-file-content'),
81
+ dataIndex: 'setting',
97
82
  render: function render(text, record) {
98
83
  var _text$params, _text$params$ids, _record$result;
99
- return /*#__PURE__*/React.createElement("div", null, text !== null && text !== void 0 && (_text$params = text.params) !== null && _text$params !== void 0 && (_text$params$ids = _text$params.ids) !== null && _text$params$ids !== void 0 && _text$params$ids.length ? getText("table-action-export-import-file-content-part") : getText("table-action-export-import-file-content-all"), " ", getText("table-action-export-import-file-record")("".concat((record === null || record === void 0 ? void 0 : (_record$result = record.result) === null || _record$result === void 0 ? void 0 : _record$result.total) || 0)));
84
+ return /*#__PURE__*/React.createElement("div", null, text !== null && text !== void 0 && (_text$params = text.params) !== null && _text$params !== void 0 && (_text$params$ids = _text$params.ids) !== null && _text$params$ids !== void 0 && _text$params$ids.length ? getText('table-action-export-import-file-content-part') : getText('table-action-export-import-file-content-all'), ' ', getText('table-action-export-import-file-record')("".concat((record === null || record === void 0 ? void 0 : (_record$result = record.result) === null || _record$result === void 0 ? void 0 : _record$result.total) || 0)));
100
85
  }
101
86
  }, {
102
- title: getText("table-action-export-import-file-status"),
103
- dataIndex: "status",
87
+ title: getText('table-action-export-import-file-status'),
88
+ dataIndex: 'status',
104
89
  render: function render(text) {
105
90
  return exportStatusOptions[text];
106
91
  }
107
92
  }, {
108
- title: getText("table-action-export-import-file-account"),
109
- dataIndex: "account",
93
+ title: getText('table-action-export-import-file-account'),
94
+ dataIndex: 'account',
110
95
  render: function render(text) {
111
- return text ? /*#__PURE__*/React.createElement("div", null, "".concat((text === null || text === void 0 ? void 0 : text.first_name) || "", " ").concat((text === null || text === void 0 ? void 0 : text.last_name) || "")) : null;
96
+ return text ? /*#__PURE__*/React.createElement("div", null, "".concat((text === null || text === void 0 ? void 0 : text.first_name) || '', " ").concat((text === null || text === void 0 ? void 0 : text.last_name) || '')) : null;
112
97
  }
113
98
  }, {
114
- title: getText("table-action-export-import-file-created"),
115
- dataIndex: "created_at",
99
+ title: getText('table-action-export-import-file-created'),
100
+ dataIndex: 'created_at',
116
101
  render: function render(text) {
117
102
  return formatDate(text);
118
103
  }
119
104
  }];
120
105
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
121
- className: "export-history-content"
106
+ className: 'export-history-content'
122
107
  }, /*#__PURE__*/React.createElement(Spin, {
123
108
  spinning: _historyList === null || _historyList === void 0 ? void 0 : _historyList.loading
124
109
  }, /*#__PURE__*/React.createElement("div", {
125
- className: "content-hint"
126
- }, getText("table-action-export-import-file-hint"), /*#__PURE__*/React.createElement("a", {
110
+ className: 'content-hint'
111
+ }, getText('table-action-export-import-file-hint'), /*#__PURE__*/React.createElement("a", {
127
112
  onClick: function onClick() {
128
113
  return init();
129
114
  }
130
- }, getText("table-action-export-import-file-refresh"))), /*#__PURE__*/React.createElement(Table, {
115
+ }, getText('table-action-export-import-file-refresh'))), /*#__PURE__*/React.createElement(Table, {
131
116
  rowClassName: "antd-table-row",
132
117
  columns: columns,
133
118
  dataSource: list,
@@ -1,4 +1,9 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
7
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
9
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -44,16 +49,11 @@ var _batchExport = /*#__PURE__*/function () {
44
49
  // 导出格式化
45
50
  export var batchExport = function batchExport(exportParams, exportImport) {
46
51
  var selectLists = exportImport.selectLists,
47
- formId = exportImport.formId,
48
- formCode = exportImport.formCode;
52
+ apiUrl = exportImport.apiUrl,
53
+ otherParams = exportImport.otherParams;
49
54
  var _name = getFileDateName();
50
- var params = {};
51
- if (formId) {
52
- params.form_id = formId;
53
- }
54
- if (formCode) {
55
- params.code = formCode;
56
- }
55
+ var params = _objectSpread({}, otherParams);
56
+ params.url = apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export;
57
57
  console.log("exportParams", exportParams);
58
58
  var type = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.type) || defaultOptions.exportType;
59
59
 
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { ExportImportType } from "../../../../../types";
3
- import "./index.less";
1
+ import React from 'react';
2
+ import { ExportImportType } from '../../../../../types';
3
+ import './index.less';
4
4
  declare const ImportLog: (props: {
5
5
  exportImport: ExportImportType;
6
6
  }) => React.JSX.Element;