ls-pro-common 1.1.0 → 1.1.2

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 (52) hide show
  1. package/dist/common.css +138 -1
  2. package/dist/common.js +1 -1
  3. package/dist/common.js.LICENSE.txt +5 -3
  4. package/dist/common.min.css +138 -1
  5. package/dist/common.min.js +1 -1
  6. package/dist/common.min.js.LICENSE.txt +5 -3
  7. package/es/components/AreaCascader.js +35 -48
  8. package/es/components/AreaCascaderPanel.d.ts +5 -0
  9. package/es/components/AreaCascaderPanel.js +230 -0
  10. package/es/components/DescritionCard.js +14 -19
  11. package/es/components/DtlLayout.js +25 -38
  12. package/es/components/IconSelector.js +27 -50
  13. package/es/components/ImageSelector.js +89 -139
  14. package/es/components/InputMultiLine.js +33 -45
  15. package/es/components/InputTable.d.ts +2 -0
  16. package/es/components/InputTable.js +118 -160
  17. package/es/components/Loading.js +3 -6
  18. package/es/components/common.less +158 -1
  19. package/es/hooks/useDtl/index.d.ts +2 -0
  20. package/es/hooks/useDtl/index.js +676 -941
  21. package/es/hooks/usePermission/index.js +0 -9
  22. package/es/hooks/useSingle/index.d.ts +2 -0
  23. package/es/hooks/useSingle/index.js +440 -599
  24. package/es/http/index.js +113 -149
  25. package/es/index.d.ts +2 -1
  26. package/es/index.js +2 -2
  27. package/es/service/BaseService.js +121 -195
  28. package/es/utils/index.js +12 -111
  29. package/lib/components/404.js +1 -6
  30. package/lib/components/AreaCascader.js +37 -63
  31. package/lib/components/AreaCascaderPanel.d.ts +5 -0
  32. package/lib/components/AreaCascaderPanel.js +239 -0
  33. package/lib/components/DescritionCard.js +16 -33
  34. package/lib/components/DtlLayout.js +27 -49
  35. package/lib/components/IconSelector.js +29 -64
  36. package/lib/components/ImageSelector.js +91 -162
  37. package/lib/components/InputMultiLine.js +35 -61
  38. package/lib/components/InputTable.d.ts +2 -0
  39. package/lib/components/InputTable.js +120 -185
  40. package/lib/components/Loading.js +4 -16
  41. package/lib/components/common.less +158 -1
  42. package/lib/hooks/useDtl/index.d.ts +2 -0
  43. package/lib/hooks/useDtl/index.js +677 -957
  44. package/lib/hooks/usePermission/index.js +0 -12
  45. package/lib/hooks/useSingle/index.d.ts +2 -0
  46. package/lib/hooks/useSingle/index.js +441 -614
  47. package/lib/http/index.js +111 -158
  48. package/lib/index.d.ts +2 -1
  49. package/lib/index.js +9 -20
  50. package/lib/service/BaseService.js +121 -201
  51. package/lib/utils/index.js +13 -209
  52. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  /*!
2
- Copyright (c) 2018 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
2
+ Copyright (c) 2018 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
5
  */
6
6
 
7
7
  /*! *****************************************************************************
@@ -19,6 +19,8 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
19
  PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
21
 
22
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
23
+
22
24
  /** @license React v16.13.1
23
25
  * react-is.production.min.js
24
26
  *
@@ -1,18 +1,17 @@
1
1
  import "antd/es/cascader/style";
2
2
  import _Cascader from "antd/es/cascader";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
- import _regeneratorRuntime from "@babel/runtime/regenerator";
5
4
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
6
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
8
8
  import { httpGet } from '../http';
9
9
  import { getCache, setCache, treeEach } from '../utils';
10
10
  var AreaCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
11
  var _useState = useState([]),
12
- _useState2 = _slicedToArray(_useState, 2),
13
- options = _useState2[0],
14
- setOptions = _useState2[1];
15
-
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ options = _useState2[0],
14
+ setOptions = _useState2[1];
16
15
  var areaRef = useRef();
17
16
  useImperativeHandle(ref, function () {
18
17
  return areaRef.current;
@@ -20,61 +19,49 @@ var AreaCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
19
  useEffect(function () {
21
20
  initOptions();
22
21
  }, []);
23
-
24
22
  var initOptions = /*#__PURE__*/function () {
25
23
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
26
24
  var cacheItems, api, result, opts;
27
25
  return _regeneratorRuntime.wrap(function _callee$(_context) {
28
- while (1) {
29
- switch (_context.prev = _context.next) {
30
- case 0:
31
- cacheItems = getCache("areaOptions", true);
32
-
33
- if (!(cacheItems && Array.isArray(cacheItems))) {
34
- _context.next = 4;
35
- break;
26
+ while (1) switch (_context.prev = _context.next) {
27
+ case 0:
28
+ cacheItems = getCache("areaOptions", true);
29
+ if (!(cacheItems && Array.isArray(cacheItems))) {
30
+ _context.next = 4;
31
+ break;
32
+ }
33
+ setOptions(cacheItems);
34
+ return _context.abrupt("return");
35
+ case 4:
36
+ api = '/petrel/petrel-location-center-api/sysAdministrativeDivision/allByTree';
37
+ _context.next = 7;
38
+ return httpGet(api, {}, false);
39
+ case 7:
40
+ result = _context.sent;
41
+ opts = result.rows || [];
42
+ treeEach(opts, function (item) {
43
+ item.label = item.name;
44
+ item.value = item.id;
45
+ if (item.level === 'district') {
46
+ delete item.children;
36
47
  }
37
-
38
- setOptions(cacheItems);
39
- return _context.abrupt("return");
40
-
41
- case 4:
42
- api = '/petrel/petrel-location-center-api/sysAdministrativeDivision/allByTree';
43
- _context.next = 7;
44
- return httpGet(api, {}, false);
45
-
46
- case 7:
47
- result = _context.sent;
48
- opts = result.rows || [];
49
- treeEach(opts, function (item) {
50
- item.label = item.name;
51
- item.value = item.id;
52
-
53
- if (item.level === 'district') {
54
- delete item.children;
55
- }
56
-
57
- delete item.name;
58
- delete item.id;
59
- delete item.level;
60
- delete item.parentId;
61
- });
62
- setCache('areaOptions', opts, true);
63
- setOptions(opts);
64
-
65
- case 12:
66
- case "end":
67
- return _context.stop();
68
- }
48
+ delete item.name;
49
+ delete item.id;
50
+ delete item.level;
51
+ delete item.parentId;
52
+ });
53
+ setCache('areaOptions', opts, true);
54
+ setOptions(opts);
55
+ case 12:
56
+ case "end":
57
+ return _context.stop();
69
58
  }
70
59
  }, _callee);
71
60
  }));
72
-
73
61
  return function initOptions() {
74
62
  return _ref.apply(this, arguments);
75
63
  };
76
64
  }();
77
-
78
65
  return /*#__PURE__*/React.createElement(_Cascader, _extends({
79
66
  options: options,
80
67
  style: {
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { CascaderProps } from 'antd';
3
+ import './common.less';
4
+ declare const AreaPicker: React.ForwardRefExoticComponent<CascaderProps<any> & React.RefAttributes<unknown>>;
5
+ export default AreaPicker;
@@ -0,0 +1,230 @@
1
+ import "antd/es/cascader/style";
2
+ import _Cascader from "antd/es/cascader";
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import "antd/es/button/style";
5
+ import _Button from "antd/es/button";
6
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
7
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
+ import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
11
+ import { httpGet } from '../http';
12
+ import { getCache, setCache, treeEach } from '../utils';
13
+ import './common.less';
14
+ var AreaPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
15
+ var propsConfig = _objectSpread({
16
+ getPopupContainer: function getPopupContainer(triggerNode) {
17
+ var _document;
18
+ return (_document = document) === null || _document === void 0 ? void 0 : _document.body;
19
+ },
20
+ placeholder: "请选择"
21
+ }, props);
22
+ var _useState = useState(getCache('areaOptionsPanel', true) || []),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ options = _useState2[0],
25
+ setOptions = _useState2[1];
26
+ //显示数据
27
+ var _useState3 = useState(getCache('areaOptionsPanel', true) || []),
28
+ _useState4 = _slicedToArray(_useState3, 2),
29
+ showData = _useState4[0],
30
+ setShowData = _useState4[1];
31
+ //暂存值
32
+ var _useState5 = useState([]),
33
+ _useState6 = _slicedToArray(_useState5, 2),
34
+ listData = _useState6[0],
35
+ setListData = _useState6[1];
36
+ //省市区实际值
37
+ var _useState7 = useState(props.value || []),
38
+ _useState8 = _slicedToArray(_useState7, 2),
39
+ actualData = _useState8[0],
40
+ setActualData = _useState8[1];
41
+ //标题显示值
42
+ var _useState9 = useState('province'),
43
+ _useState10 = _slicedToArray(_useState9, 2),
44
+ areaTitle = _useState10[0],
45
+ setAreaTitle = _useState10[1];
46
+ var areaRef = useRef();
47
+ useImperativeHandle(ref, function () {
48
+ return areaRef.current;
49
+ });
50
+ useEffect(function () {
51
+ initOptions();
52
+ }, []);
53
+ useEffect(function () {
54
+ if (actualData.length !== 0) {
55
+ var _props$onChange;
56
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, actualData, listData);
57
+ } else {
58
+ setAreaTitle('province');
59
+ }
60
+ }, [actualData]);
61
+ useEffect(function () {
62
+ var _props$value;
63
+ if (!options.length || !((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length)) return;
64
+ var _props$value2 = _slicedToArray(props.value, 3),
65
+ pKey = _props$value2[0],
66
+ cKey = _props$value2[1],
67
+ dKey = _props$value2[2];
68
+ var province = pKey ? options.find(function (o) {
69
+ return o.value === pKey;
70
+ }) : false;
71
+ var city = province && cKey ? province.children.find(function (o) {
72
+ return o.value === cKey;
73
+ }) : false;
74
+ var district = city && dKey ? city.children.find(function (o) {
75
+ return o.value === dKey;
76
+ }) : false;
77
+ var area = [province, city, district].filter(Boolean);
78
+ setListData(area);
79
+ setAreaTitle(area.length === 3 ? 'district' : area.length === 2 ? 'city' : 'province');
80
+ setShowData(area.length === 3 ? city.children : area.length === 2 ? province.children : options);
81
+ }, [options]);
82
+ var initOptions = /*#__PURE__*/function () {
83
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
84
+ var cacheItems, api, result, opts;
85
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
86
+ while (1) switch (_context.prev = _context.next) {
87
+ case 0:
88
+ cacheItems = getCache('areaOptionsPanel', true);
89
+ if (!(cacheItems && Array.isArray(cacheItems) && cacheItems.length)) {
90
+ _context.next = 3;
91
+ break;
92
+ }
93
+ return _context.abrupt("return");
94
+ case 3:
95
+ api = '/petrel/petrel-location-center-api/sysAdministrativeDivision/allByTree';
96
+ _context.next = 6;
97
+ return httpGet(api, {}, false);
98
+ case 6:
99
+ result = _context.sent;
100
+ opts = result.rows || [];
101
+ treeEach(opts, function (item) {
102
+ item.label = item.name;
103
+ item.value = item.id;
104
+ if (item.level === 'district') {
105
+ delete item.children;
106
+ }
107
+ delete item.name;
108
+ delete item.id;
109
+ delete item.parentId;
110
+ });
111
+ setCache('areaOptionsPanel', opts, true);
112
+ setOptions(opts);
113
+ setShowData(opts);
114
+ case 12:
115
+ case "end":
116
+ return _context.stop();
117
+ }
118
+ }, _callee);
119
+ }));
120
+ return function initOptions() {
121
+ return _ref.apply(this, arguments);
122
+ };
123
+ }();
124
+ var dropdownRender = function dropdownRender(menus) {
125
+ var _listData$, _listData$3;
126
+ var title = /*#__PURE__*/React.createElement("div", {
127
+ className: "ls-area-cascaded-header"
128
+ }, /*#__PURE__*/React.createElement("div", {
129
+ className: "ls-word-box-display"
130
+ }, /*#__PURE__*/React.createElement(_Button, {
131
+ type: "text",
132
+ onClick: function onClick() {
133
+ setAreaTitle('province');
134
+ setShowData(options);
135
+ setListData(function (val) {
136
+ return val.length ? [val[0]] : [];
137
+ });
138
+ }
139
+ }, /*#__PURE__*/React.createElement("span", {
140
+ className: 'ls-myself-select-title-style'
141
+ }, listData[0] ? (_listData$ = listData[0]) === null || _listData$ === void 0 ? void 0 : _listData$.label : '省/直辖市'))), /*#__PURE__*/React.createElement("div", {
142
+ className: "ls-word-box-display"
143
+ }, /*#__PURE__*/React.createElement(_Button, {
144
+ type: "text",
145
+ disabled: listData.length < 2,
146
+ onClick: function onClick() {
147
+ var _listData$2;
148
+ setAreaTitle('city');
149
+ setShowData((_listData$2 = listData[0]) === null || _listData$2 === void 0 ? void 0 : _listData$2.children);
150
+ setListData(function (val) {
151
+ return val.filter(function (o, i) {
152
+ return i < 2;
153
+ });
154
+ });
155
+ }
156
+ }, /*#__PURE__*/React.createElement("span", {
157
+ className: 'ls-myself-select-title-style'
158
+ }, areaTitle !== 'province' && listData[1] ? (_listData$3 = listData[1]) === null || _listData$3 === void 0 ? void 0 : _listData$3.label : '市'))), /*#__PURE__*/React.createElement("div", {
159
+ className: "ls-word-box-display"
160
+ }, /*#__PURE__*/React.createElement(_Button, {
161
+ type: "text",
162
+ disabled: listData.length < 3
163
+ }, /*#__PURE__*/React.createElement("span", {
164
+ className: 'ls-myself-select-title-style'
165
+ }, listData[2] ? listData[2].label : '区'))));
166
+ return /*#__PURE__*/React.createElement("div", {
167
+ className: "ls-area-cascaded-box"
168
+ }, title, /*#__PURE__*/React.createElement("div", {
169
+ className: "ls-area-cascaded-body"
170
+ }, showData.map(function (item) {
171
+ return /*#__PURE__*/React.createElement("div", {
172
+ className: "ls-area-cascaded-span ".concat(actualData.find(function (o) {
173
+ return o === item.value;
174
+ }) ? ' ls-area-selected' : ''),
175
+ title: item.label,
176
+ onClick: function onClick(e) {
177
+ var _areaRef$current;
178
+ switch ((item === null || item === void 0 ? void 0 : item.level) || '') {
179
+ case 'province':
180
+ setShowData(item === null || item === void 0 ? void 0 : item.children);
181
+ setActualData([item === null || item === void 0 ? void 0 : item.value]);
182
+ setListData(function (val) {
183
+ return [item];
184
+ });
185
+ //面板标题指向市
186
+ setAreaTitle('city');
187
+ break;
188
+ case 'city':
189
+ setShowData(item === null || item === void 0 ? void 0 : item.children);
190
+ setActualData(function (val) {
191
+ return [val[0], item === null || item === void 0 ? void 0 : item.value];
192
+ });
193
+ setListData(function (val) {
194
+ return [val[0], item];
195
+ });
196
+ setAreaTitle('district');
197
+ break;
198
+ case 'district':
199
+ setActualData(function (val) {
200
+ return [val[0], val[1], item === null || item === void 0 ? void 0 : item.value];
201
+ });
202
+ setListData(function (val) {
203
+ return [val[0], val[1], item];
204
+ });
205
+ (_areaRef$current = areaRef.current) === null || _areaRef$current === void 0 ? void 0 : _areaRef$current.blur();
206
+ break;
207
+ default:
208
+ break;
209
+ }
210
+ }
211
+ }, item.label);
212
+ })));
213
+ };
214
+ return /*#__PURE__*/React.createElement(_Cascader, _extends({
215
+ options: options,
216
+ style: {
217
+ width: '100%'
218
+ },
219
+ className: 'ls-area-box-position',
220
+ changeOnSelect: true,
221
+ ref: areaRef,
222
+ onClear: function onClear() {
223
+ setActualData([]);
224
+ setListData([]);
225
+ setShowData(options);
226
+ },
227
+ dropdownRender: dropdownRender
228
+ }, propsConfig));
229
+ });
230
+ export default AreaPicker;
@@ -8,26 +8,23 @@ import { UpOutlined } from '@ant-design/icons';
8
8
  import ProCard from 'ls-pro-card';
9
9
  import ProDescriptions from 'ls-pro-descriptions';
10
10
  import './common.less';
11
-
12
11
  function DescritionCard(props) {
13
12
  var title = props.title,
14
- extra = props.extra,
15
- className = props.className,
16
- _props$collapsible = props.collapsible,
17
- collapsible = _props$collapsible === void 0 ? true : _props$collapsible,
18
- _props$defaultCollaps = props.defaultCollapsed,
19
- defaultCollapsed = _props$defaultCollaps === void 0 ? false : _props$defaultCollaps,
20
- desc = props.desc,
21
- hasBackground = props.hasBackground,
22
- _props$collapseTitle = props.collapseTitle,
23
- collapseTitle = _props$collapseTitle === void 0 ? '展开/收起' : _props$collapseTitle,
24
- rest = _objectWithoutProperties(props, _excluded);
25
-
13
+ extra = props.extra,
14
+ className = props.className,
15
+ _props$collapsible = props.collapsible,
16
+ collapsible = _props$collapsible === void 0 ? true : _props$collapsible,
17
+ _props$defaultCollaps = props.defaultCollapsed,
18
+ defaultCollapsed = _props$defaultCollaps === void 0 ? false : _props$defaultCollaps,
19
+ desc = props.desc,
20
+ hasBackground = props.hasBackground,
21
+ _props$collapseTitle = props.collapseTitle,
22
+ collapseTitle = _props$collapseTitle === void 0 ? '展开/收起' : _props$collapseTitle,
23
+ rest = _objectWithoutProperties(props, _excluded);
26
24
  var _useState = useState(defaultCollapsed),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- collapsed = _useState2[0],
29
- setCollapsed = _useState2[1];
30
-
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ collapsed = _useState2[0],
27
+ setCollapsed = _useState2[1];
31
28
  var titleLayout = useMemo(function () {
32
29
  if (typeof title === 'string') {
33
30
  return /*#__PURE__*/React.createElement("div", {
@@ -61,7 +58,6 @@ function DescritionCard(props) {
61
58
  } else if (collapsedDom) {
62
59
  return collapsedDom;
63
60
  }
64
-
65
61
  return null;
66
62
  }, [extra, collapsedDom]);
67
63
  return desc ? /*#__PURE__*/React.createElement(ProCard, _extends({
@@ -80,5 +76,4 @@ function DescritionCard(props) {
80
76
  collapsed: collapsed
81
77
  }, rest));
82
78
  }
83
-
84
79
  export default DescritionCard;
@@ -5,55 +5,47 @@ import classNames from 'classnames';
5
5
  import { LeftOutlined, SaveOutlined, AuditOutlined } from '@ant-design/icons';
6
6
  import './common.less';
7
7
  import usePermission from '../hooks/usePermission';
8
-
9
8
  function DtlLayout(props) {
10
9
  var title = props.title,
11
- _props$keyField = props.keyField,
12
- keyField = _props$keyField === void 0 ? 'id' : _props$keyField,
13
- masterObject = props.masterObject,
14
- children = props.children,
15
- headerClass = props.headerClass,
16
- headerStyle = props.headerStyle,
17
- bodyClass = props.bodyClass,
18
- bodyStyle = props.bodyStyle,
19
- formRef = props.formRef,
20
- _props$btnSaveText = props.btnSaveText,
21
- btnSaveText = _props$btnSaveText === void 0 ? '保存' : _props$btnSaveText,
22
- _props$btnExitText = props.btnExitText,
23
- btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText,
24
- btnStatus = props.btnStatus,
25
- statusField = props.statusField,
26
- auditStatus = props.auditStatus,
27
- _props$isView = props.isView,
28
- isView = _props$isView === void 0 ? false : _props$isView;
29
-
10
+ _props$keyField = props.keyField,
11
+ keyField = _props$keyField === void 0 ? 'id' : _props$keyField,
12
+ masterObject = props.masterObject,
13
+ children = props.children,
14
+ headerClass = props.headerClass,
15
+ headerStyle = props.headerStyle,
16
+ bodyClass = props.bodyClass,
17
+ bodyStyle = props.bodyStyle,
18
+ formRef = props.formRef,
19
+ _props$btnSaveText = props.btnSaveText,
20
+ btnSaveText = _props$btnSaveText === void 0 ? '保存' : _props$btnSaveText,
21
+ _props$btnExitText = props.btnExitText,
22
+ btnExitText = _props$btnExitText === void 0 ? '返回' : _props$btnExitText,
23
+ btnStatus = props.btnStatus,
24
+ statusField = props.statusField,
25
+ auditStatus = props.auditStatus,
26
+ _props$isView = props.isView,
27
+ isView = _props$isView === void 0 ? false : _props$isView;
30
28
  var _usePermission = usePermission(),
31
- checkRight = _usePermission.checkRight;
32
-
29
+ checkRight = _usePermission.checkRight;
33
30
  var dtlTitle = useMemo(function () {
34
31
  if (title) return title;
35
32
  if (!masterObject) return '';
36
33
  return masterObject[keyField] ? '编辑' : '新增';
37
34
  }, [title, masterObject, keyField]);
38
-
39
35
  var isAudit = function isAudit() {
40
36
  if (masterObject && statusField && auditStatus) {
41
37
  return Number(masterObject[statusField] || 0) >= auditStatus;
42
38
  }
43
-
44
39
  return false;
45
40
  };
46
-
47
41
  var btnDisabled = function btnDisabled(btnKey) {
48
- if (isView) return true; // 优先处理自定义的状态
49
-
42
+ if (isView) return true;
43
+ // 优先处理自定义的状态
50
44
  if (btnStatus && typeof btnStatus(btnKey) === 'boolean') {
51
45
  return btnStatus(btnKey) || false;
52
46
  }
53
-
54
47
  return isAudit();
55
48
  };
56
-
57
49
  var btns = useMemo(function () {
58
50
  // const b = [
59
51
  // <Button
@@ -63,26 +55,23 @@ function DtlLayout(props) {
63
55
  // {btnExitText}
64
56
  // </Button>
65
57
  // ]
66
- var b = []; // 有新增或更改权限且未审核,开放出保存按钮
67
-
58
+ var b = [];
59
+ // 有新增或更改权限且未审核,开放出保存按钮
68
60
  if ((checkRight(2) || checkRight(4)) && !isAudit() && !isView) {
69
61
  b.unshift( /*#__PURE__*/React.createElement(_Button, {
70
62
  key: "btnSave",
71
63
  onClick: function onClick() {
72
64
  var _formRef$current;
73
-
74
65
  if (props.onSave) {
75
66
  return props.onSave();
76
67
  }
77
-
78
68
  formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.submit();
79
69
  },
80
70
  disabled: btnDisabled('btnSave'),
81
71
  icon: /*#__PURE__*/React.createElement(SaveOutlined, null)
82
72
  }, btnSaveText));
83
- } // 转入onAudit方法且有审核权限,数据未审核,开放出审核按钮
84
-
85
-
73
+ }
74
+ // 转入onAudit方法且有审核权限,数据未审核,开放出审核按钮
86
75
  if (props.onAudit && checkRight(64) && !isAudit() && !isView) {
87
76
  b.unshift( /*#__PURE__*/React.createElement(_Button, {
88
77
  key: "btnAudit",
@@ -94,7 +83,6 @@ function DtlLayout(props) {
94
83
  icon: /*#__PURE__*/React.createElement(AuditOutlined, null)
95
84
  }, "\u5BA1\u6838"));
96
85
  }
97
-
98
86
  if (props.renderButton) return props.renderButton(b);
99
87
  return b;
100
88
  }, [props]);
@@ -118,5 +106,4 @@ function DtlLayout(props) {
118
106
  style: bodyStyle
119
107
  }, children));
120
108
  }
121
-
122
109
  export default DtlLayout;