@zgfe/business-lib 1.0.9 → 1.0.10

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 (56) hide show
  1. package/es/addToPanel/components/addPanel.d.ts +7 -0
  2. package/es/addToPanel/components/addPanel.js +101 -0
  3. package/es/addToPanel/components/radioGroup.d.ts +7 -0
  4. package/es/addToPanel/components/radioGroup.js +29 -0
  5. package/es/addToPanel/components/styleList.d.ts +5 -0
  6. package/es/{dialog/components/tab.js → addToPanel/components/styleList.js} +9 -6
  7. package/es/{dialog/demo/index2.d.ts → addToPanel/demo/edit.d.ts} +0 -0
  8. package/es/{dialog/components/list.js → addToPanel/demo/edit.js} +63 -44
  9. package/es/{dialog/demo/index3.d.ts → addToPanel/demo/index.d.ts} +0 -0
  10. package/es/addToPanel/demo/index.js +78 -0
  11. package/es/addToPanel/index.d.ts +6 -0
  12. package/es/addToPanel/index.js +233 -0
  13. package/es/addToPanel/styles/addPanel.less +25 -0
  14. package/es/addToPanel/styles/index.less +6 -0
  15. package/es/{dialog/components/styles/tab.less → addToPanel/styles/style.less} +7 -2
  16. package/es/addToPanel/types.d.ts +56 -0
  17. package/es/addToPanel/types.js +1 -0
  18. package/es/addToScene/addGroup.d.ts +11 -0
  19. package/es/addToScene/addGroup.js +34 -0
  20. package/es/addToScene/demo/index.d.ts +2 -0
  21. package/es/addToScene/demo/index.js +34 -0
  22. package/es/addToScene/index.d.ts +6 -0
  23. package/es/addToScene/index.js +187 -0
  24. package/es/addToScene/styles/index.less +23 -0
  25. package/es/addToScene/types.d.ts +29 -0
  26. package/es/addToScene/types.js +1 -0
  27. package/es/assets/styles/chunks.less +12 -0
  28. package/es/attrConditions/components/stringList.js +3 -3
  29. package/es/constants/apis.d.ts +8 -0
  30. package/es/constants/apis.js +8 -0
  31. package/es/dialog/demo/index.d.ts +0 -29
  32. package/es/dialog/demo/index.js +6 -130
  33. package/es/dialog/index.d.ts +1 -2
  34. package/es/dialog/index.js +14 -183
  35. package/es/dialog/types.d.ts +2 -74
  36. package/es/index.d.ts +3 -1
  37. package/es/index.js +3 -1
  38. package/es/select/index.js +1 -0
  39. package/es/select/overlay.js +3 -1
  40. package/es/select/styles/handle.less +1 -0
  41. package/es/select/types.d.ts +1 -0
  42. package/es/utils/ajax.d.ts +21 -7
  43. package/es/utils/ajax.js +205 -111
  44. package/package.json +3 -2
  45. package/es/dialog/components/itemNode.d.ts +0 -10
  46. package/es/dialog/components/itemNode.js +0 -109
  47. package/es/dialog/components/list.d.ts +0 -5
  48. package/es/dialog/components/selectToInput.d.ts +0 -6
  49. package/es/dialog/components/selectToInput.js +0 -175
  50. package/es/dialog/components/styles/handle.less +0 -39
  51. package/es/dialog/components/styles/list.less +0 -60
  52. package/es/dialog/components/tab.d.ts +0 -5
  53. package/es/dialog/data/data.d.ts +0 -20
  54. package/es/dialog/data/data.js +0 -73
  55. package/es/dialog/demo/index2.js +0 -109
  56. package/es/dialog/demo/index3.js +0 -61
@@ -1,207 +1,38 @@
1
- var _excluded = ["width", "initialValues", "fields", "visible", "showMark", "layout"];
2
-
3
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4
-
5
1
  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; }
6
2
 
7
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; }
8
4
 
9
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
6
 
11
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
-
13
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
-
15
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
-
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
-
19
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
20
-
21
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
22
-
23
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
-
25
- 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; }
26
-
27
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
28
-
29
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
-
31
- 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; }
32
-
33
- 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; }
34
-
35
- import { Form, Modal } from 'antd';
36
- import React, { useEffect, useState } from 'react';
7
+ import { Modal } from 'antd';
8
+ import React from 'react';
37
9
  import './styles/index.less';
38
- import ItemNode from './components/itemNode';
39
10
  export var classPrefix = 'biz-dialog';
40
11
 
41
12
  var BizDialog = function BizDialog(props) {
42
- var width = props.width,
43
- initialValues = props.initialValues,
44
- fields = props.fields,
45
- visible = props.visible,
46
- showMark = props.showMark,
47
- layout = props.layout,
48
- res = _objectWithoutProperties(props, _excluded);
49
-
50
- var _Form$useForm = Form.useForm(),
51
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
52
- form = _Form$useForm2[0];
53
-
54
- var _useState = useState(fields),
55
- _useState2 = _slicedToArray(_useState, 2),
56
- formFields = _useState2[0],
57
- setFormFields = _useState2[1];
58
-
59
- useEffect(function () {
60
- if (visible) {
61
- form.resetFields();
62
- }
63
- }, [visible]);
64
- useEffect(function () {
65
- setFormFields(function () {
66
- return _toConsumableArray(fields);
67
- });
68
- }, [fields]);
69
-
70
- var onOk = function onOk() {
71
- form.validateFields().then(function (values) {
72
- props.onOk && props.onOk(values);
73
- }).catch(function (info) {
74
- console.log('Validate Failed:', info);
75
- });
76
- };
77
-
78
- var onCancel = function onCancel() {
79
- if (props.onCancel) props.onCancel();
80
- };
81
-
82
- return /*#__PURE__*/React.createElement(Modal, _objectSpread(_objectSpread({
83
- width: width,
84
- centered: true,
85
- visible: visible,
13
+ return /*#__PURE__*/React.createElement(Modal, _objectSpread({
86
14
  maskStyle: {
87
15
  background: '#021429',
88
16
  opacity: 0.8
89
17
  },
90
18
  bodyStyle: {
91
19
  borderRadius: '10px'
92
- },
93
- cancelText: "\u53D6\u6D88",
94
- okText: "\u786E\u5B9A",
95
- closable: false
96
- }, res), {}, {
97
- onCancel: onCancel,
98
- onOk: onOk
99
- }), /*#__PURE__*/React.createElement(Form, {
100
- className: classPrefix,
101
- form: form,
102
- requiredMark: showMark,
103
- initialValues: initialValues,
104
- layout: layout
105
- }, formFields === null || formFields === void 0 ? void 0 : formFields.map(function (item) {
106
- if (item.dependenceFields && Object.keys(item.dependenceFields).length > 0) {
107
- var keys = Object.keys(item.dependenceFields);
108
- var dependenceFields = item.dependenceFields;
109
- return /*#__PURE__*/React.createElement(Form.Item, {
110
- key: item.name,
111
- noStyle: true,
112
- shouldUpdate: function shouldUpdate(prevValues, curValues) {
113
- var flag = false;
114
-
115
- var _iterator = _createForOfIteratorHelper(keys),
116
- _step;
117
-
118
- try {
119
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
120
- var key = _step.value;
121
-
122
- if (item.dependencekeys && item.dependencekeys[key]) {
123
- var dKey = item.dependencekeys[key];
124
-
125
- if (prevValues[key][dKey] !== curValues[key][dKey]) {
126
- flag = true;
127
- break;
128
- }
129
- } else {
130
- if (prevValues[key] !== curValues[key]) {
131
- flag = true;
132
- break;
133
- }
134
- }
135
- }
136
- } catch (err) {
137
- _iterator.e(err);
138
- } finally {
139
- _iterator.f();
140
- }
141
-
142
- return flag;
143
- }
144
- }, function (_ref) {
145
- var getFieldValue = _ref.getFieldValue;
146
- var flag = true;
147
-
148
- var _iterator2 = _createForOfIteratorHelper(keys),
149
- _step2;
150
-
151
- try {
152
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
153
- var key = _step2.value;
154
-
155
- if (getFieldValue(key) !== dependenceFields[key]) {
156
- flag = false;
157
- break;
158
- }
159
- }
160
- } catch (err) {
161
- _iterator2.e(err);
162
- } finally {
163
- _iterator2.f();
164
- }
165
-
166
- return flag ? /*#__PURE__*/React.createElement(Form.Item, {
167
- label: item.label,
168
- name: item.name,
169
- hidden: item.hidden,
170
- rules: item.rules,
171
- help: item.help,
172
- wrapperCol: {
173
- offset: !item.label && layout === 'horizontal' ? 2 : 0
174
- },
175
- shouldUpdate: true
176
- }, /*#__PURE__*/React.createElement(ItemNode, {
177
- field: item,
178
- fieldNames: item.fieldNames
179
- })) : null;
180
- });
181
- } else {
182
- return /*#__PURE__*/React.createElement(Form.Item, {
183
- key: item.name,
184
- label: item.label,
185
- name: item.name,
186
- hidden: item.hidden,
187
- rules: item.rules,
188
- help: item.help,
189
- wrapperCol: {
190
- offset: !item.label && layout === 'horizontal' ? 2 : 0
191
- },
192
- shouldUpdate: true
193
- }, /*#__PURE__*/React.createElement(ItemNode, {
194
- field: item,
195
- fieldNames: item.fieldNames
196
- }));
197
20
  }
198
- })));
21
+ }, props), props.children);
199
22
  };
200
23
 
201
24
  BizDialog.defaultProps = {
202
25
  width: 520,
203
26
  visible: false,
204
- showMark: false,
205
- layout: 'horizontal'
27
+ cancelText: '取消',
28
+ okText: '确定',
29
+ closable: false,
30
+ centered: true,
31
+ okButtonProps: {
32
+ size: 'large'
33
+ },
34
+ cancelButtonProps: {
35
+ size: 'large'
36
+ }
206
37
  };
207
38
  export default BizDialog;
@@ -1,77 +1,5 @@
1
- import { FormItemProps } from 'antd';
2
- import { ReactNode } from 'react';
3
- import { BizSelectTypes } from '../select/types';
4
- export declare namespace TabTypes {
5
- interface Props {
6
- value?: string;
7
- options: Array<TabItem>;
8
- onChange?: (value: string) => void;
9
- }
10
- interface TabItemChild {
11
- label: string;
12
- value: string;
13
- icon: string;
14
- disabled?: boolean;
15
- }
16
- interface TabItem extends TabItemChild {
17
- children?: Array<TabItemChild>;
18
- }
19
- }
20
- export interface SelectInputProps {
21
- name?: string;
22
- extendName?: string;
23
- value?: string;
24
- onChange?: (value?: BizSelectTypes.Option | undefined) => void;
25
- }
26
- export interface ItemProps {
27
- id: string | number;
28
- title?: string;
29
- content?: string;
30
- icon?: string;
31
- }
32
- export interface ListProps {
33
- value?: string | number;
34
- options?: Array<ItemProps>;
35
- onChange?: (value: string | number) => void;
36
- }
1
+ import { ModalProps } from 'antd';
37
2
  export declare namespace DialogTypes {
38
- export interface FieldOption {
39
- label: string;
40
- value: string;
41
- }
42
- interface Option {
43
- [otherProp: string]: any;
44
- }
45
- export interface FieldProps {
46
- label?: string;
47
- type?: string;
48
- value?: string | number;
49
- dependenceFields?: {
50
- [pro: string]: string;
51
- };
52
- dependencekeys?: {
53
- [pro: string]: string;
54
- };
55
- placeholder?: string;
56
- direction?: 'horizontal' | 'vertical';
57
- options?: Option[];
58
- extendName?: string;
59
- fieldNames?: FieldOption;
60
- children?: Array<string>;
61
- multiple?: boolean;
62
- selectType?: 'group' | 'normal';
63
- enableSearch?: boolean;
64
- overlayWidth?: number;
65
- extra?: (option: Option) => ReactNode;
66
- onChange?: (value?: any) => void;
67
- }
68
- export interface Props {
69
- layout?: 'horizontal' | 'vertical' | 'inline';
70
- fields: Array<FieldProps & FormItemProps>;
71
- initialValues?: object;
72
- showMark?: boolean;
73
- onOk?: (data: object) => void;
74
- onCancel?: () => void;
3
+ interface Props extends ModalProps {
75
4
  }
76
- export {};
77
5
  }
package/es/index.d.ts CHANGED
@@ -19,7 +19,9 @@ import convertAttributeData from './attributeSelector/util';
19
19
  import BizGlobalDataContext from './context';
20
20
  import BizUserCondition from './userCondition';
21
21
  import BizSearchInput from './searchInput';
22
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, ajax, util, theme, convertAttributeData, };
22
+ import BizAddToScene from './addToScene';
23
+ import BizAddToPanel from './addToPanel';
24
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData, };
23
25
  export type { UserGroupTypes } from './userGroup/types';
24
26
  export type { BizSelectTypes } from './select/types';
25
27
  export type { AttributeSelect } from './attributeSelector/types';
package/es/index.js CHANGED
@@ -18,4 +18,6 @@ import convertAttributeData from './attributeSelector/util';
18
18
  import BizGlobalDataContext from './context';
19
19
  import BizUserCondition from './userCondition';
20
20
  import BizSearchInput from './searchInput';
21
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, ajax, util, theme, convertAttributeData };
21
+ import BizAddToScene from './addToScene';
22
+ import BizAddToPanel from './addToPanel';
23
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, ajax, util, theme, convertAttributeData };
@@ -193,6 +193,7 @@ var BizSelect = function BizSelect(props) {
193
193
  ref: boxRef,
194
194
  value: current,
195
195
  labelField: labelField,
196
+ placeholder: props.placeholder,
196
197
  keyField: keyField,
197
198
  disable: props.disable,
198
199
  multiple: props.multiple,
@@ -164,7 +164,9 @@ var SelectOverlay = function SelectOverlay(props) {
164
164
  if (showList && showList.length) {
165
165
  return showList;
166
166
  } else {
167
- return /*#__PURE__*/React.createElement("span", null, "\u6682\u65E0\u6570\u636E");
167
+ return /*#__PURE__*/React.createElement("span", {
168
+ className: "".concat(classPrefix, "-nodata")
169
+ }, "\u6682\u65E0\u6570\u636E");
168
170
  }
169
171
  }
170
172
 
@@ -22,6 +22,7 @@
22
22
 
23
23
  &.lg {
24
24
  height: @height-lg;
25
+ font-size: @font-size-lg;
25
26
  line-height: @height-lg;
26
27
  }
27
28
 
@@ -10,6 +10,7 @@ export declare namespace BizSelectTypes {
10
10
  }
11
11
  interface Props {
12
12
  disable?: boolean;
13
+ placeholder?: string;
13
14
  defaultValue?: Option | Option[];
14
15
  value?: Option | Option[];
15
16
  className?: string;
@@ -1,7 +1,21 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- declare const ajax: (option?: AxiosRequestConfig & {
3
- responseOnce?: Boolean;
4
- unique?: Boolean;
5
- delay?: number;
6
- }) => Promise<unknown>;
7
- export default ajax;
1
+ import { RequestOptionsInit } from 'umi-request';
2
+ declare enum ResponseStatus {
3
+ success = 200,
4
+ exists = 201,
5
+ fail = 500,
6
+ sysNotInit = 501,
7
+ sysInited = 502,
8
+ notLoggin = 503,
9
+ paramError = 504,
10
+ success2 = 106000,
11
+ fail2 = 106001,
12
+ paramError2 = 106002,
13
+ paramError3 = 106003
14
+ }
15
+ export interface InterfaceApiResult<T> {
16
+ code: ResponseStatus;
17
+ data?: T;
18
+ msg?: string;
19
+ }
20
+ declare function request<T>(url: string, options?: RequestOptionsInit): Promise<InterfaceApiResult<T> | null>;
21
+ export default request;