ls-pro-common 1.1.0 → 1.1.1
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.
- package/dist/common.css +73 -0
- package/dist/common.js +1 -1
- package/dist/common.min.css +73 -0
- package/dist/common.min.js +1 -1
- package/es/components/AreaCascaderPanel.d.ts +5 -0
- package/es/components/AreaCascaderPanel.js +260 -0
- package/es/components/InputTable.d.ts +2 -0
- package/es/components/common.less +95 -1
- package/es/hooks/useDtl/index.d.ts +2 -0
- package/es/hooks/useDtl/index.js +19 -13
- package/es/hooks/useSingle/index.d.ts +2 -0
- package/es/hooks/useSingle/index.js +52 -33
- package/es/http/index.js +8 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/lib/components/AreaCascaderPanel.d.ts +5 -0
- package/lib/components/AreaCascaderPanel.js +287 -0
- package/lib/components/InputTable.d.ts +2 -0
- package/lib/components/common.less +95 -1
- package/lib/hooks/useDtl/index.d.ts +2 -0
- package/lib/hooks/useDtl/index.js +19 -13
- package/lib/hooks/useSingle/index.d.ts +2 -0
- package/lib/hooks/useSingle/index.js +52 -33
- package/lib/http/index.js +8 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +8 -0
- package/package.json +2 -2
package/es/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import IconSelector from './components/IconSelector';
|
|
|
6
6
|
import ImageSelector from './components/ImageSelector';
|
|
7
7
|
import InputMultiLine from './components/InputMultiLine';
|
|
8
8
|
import AreaCascader from './components/AreaCascader';
|
|
9
|
+
import AreaCascaderPanel from './components/AreaCascaderPanel';
|
|
9
10
|
import DescritionCard from './components/DescritionCard';
|
|
10
11
|
import BaseService from './service/BaseService';
|
|
11
12
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
@@ -19,4 +20,4 @@ import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typin
|
|
|
19
20
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
20
21
|
import type { DescritionCardProps } from './components/DescritionCard';
|
|
21
22
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps };
|
|
22
|
-
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, DescritionCard, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
23
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
package/es/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import IconSelector from './components/IconSelector';
|
|
|
6
6
|
import ImageSelector from './components/ImageSelector';
|
|
7
7
|
import InputMultiLine from './components/InputMultiLine';
|
|
8
8
|
import AreaCascader from './components/AreaCascader';
|
|
9
|
+
import AreaCascaderPanel from './components/AreaCascaderPanel';
|
|
9
10
|
import DescritionCard from './components/DescritionCard';
|
|
10
11
|
import BaseService from './service/BaseService';
|
|
11
12
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
@@ -15,4 +16,4 @@ import * as utils from './utils';
|
|
|
15
16
|
import useSingle from './hooks/useSingle';
|
|
16
17
|
import useDtl from './hooks/useDtl';
|
|
17
18
|
import usePermission from './hooks/usePermission';
|
|
18
|
-
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, DescritionCard, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
19
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
require("antd/es/cascader/style");
|
|
13
|
+
|
|
14
|
+
var _cascader = _interopRequireDefault(require("antd/es/cascader"));
|
|
15
|
+
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
18
|
+
require("antd/es/button/style");
|
|
19
|
+
|
|
20
|
+
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
21
|
+
|
|
22
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
23
|
+
|
|
24
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
25
|
+
|
|
26
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
27
|
+
|
|
28
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
29
|
+
|
|
30
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
31
|
+
|
|
32
|
+
var _http = require("../http");
|
|
33
|
+
|
|
34
|
+
var _utils = require("../utils");
|
|
35
|
+
|
|
36
|
+
require("./common.less");
|
|
37
|
+
|
|
38
|
+
var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
39
|
+
var propsConfig = (0, _objectSpread2.default)({
|
|
40
|
+
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
41
|
+
var _document;
|
|
42
|
+
|
|
43
|
+
return (_document = document) === null || _document === void 0 ? void 0 : _document.body;
|
|
44
|
+
},
|
|
45
|
+
placeholder: "请选择"
|
|
46
|
+
}, props);
|
|
47
|
+
|
|
48
|
+
var _useState = (0, _react.useState)((0, _utils.getCache)('areaOptionsPanel', true) || []),
|
|
49
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
50
|
+
options = _useState2[0],
|
|
51
|
+
setOptions = _useState2[1]; //显示数据
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
var _useState3 = (0, _react.useState)((0, _utils.getCache)('areaOptionsPanel', true) || []),
|
|
55
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
56
|
+
showData = _useState4[0],
|
|
57
|
+
setShowData = _useState4[1]; //暂存值
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
var _useState5 = (0, _react.useState)([]),
|
|
61
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
62
|
+
listData = _useState6[0],
|
|
63
|
+
setListData = _useState6[1]; //省市区实际值
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
var _useState7 = (0, _react.useState)(props.value || []),
|
|
67
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
68
|
+
actualData = _useState8[0],
|
|
69
|
+
setActualData = _useState8[1]; //标题显示值
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
var _useState9 = (0, _react.useState)('province'),
|
|
73
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
74
|
+
areaTitle = _useState10[0],
|
|
75
|
+
setAreaTitle = _useState10[1];
|
|
76
|
+
|
|
77
|
+
var areaRef = (0, _react.useRef)();
|
|
78
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
79
|
+
return areaRef.current;
|
|
80
|
+
});
|
|
81
|
+
(0, _react.useEffect)(function () {
|
|
82
|
+
initOptions();
|
|
83
|
+
}, []);
|
|
84
|
+
(0, _react.useEffect)(function () {
|
|
85
|
+
if (actualData.length !== 0) {
|
|
86
|
+
var _props$onChange;
|
|
87
|
+
|
|
88
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, actualData, listData);
|
|
89
|
+
} else {
|
|
90
|
+
setAreaTitle('province');
|
|
91
|
+
}
|
|
92
|
+
}, [actualData]);
|
|
93
|
+
(0, _react.useEffect)(function () {
|
|
94
|
+
var _props$value;
|
|
95
|
+
|
|
96
|
+
if (!options.length || !((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length)) return;
|
|
97
|
+
|
|
98
|
+
var _props$value2 = (0, _slicedToArray2.default)(props.value, 3),
|
|
99
|
+
pKey = _props$value2[0],
|
|
100
|
+
cKey = _props$value2[1],
|
|
101
|
+
dKey = _props$value2[2];
|
|
102
|
+
|
|
103
|
+
var province = pKey ? options.find(function (o) {
|
|
104
|
+
return o.value === pKey;
|
|
105
|
+
}) : false;
|
|
106
|
+
var city = province && cKey ? province.children.find(function (o) {
|
|
107
|
+
return o.value === cKey;
|
|
108
|
+
}) : false;
|
|
109
|
+
var district = city && dKey ? city.children.find(function (o) {
|
|
110
|
+
return o.value === dKey;
|
|
111
|
+
}) : false;
|
|
112
|
+
var area = [province, city, district].filter(Boolean);
|
|
113
|
+
setListData(area);
|
|
114
|
+
setAreaTitle(area.length === 3 ? 'district' : area.length === 2 ? 'city' : 'province');
|
|
115
|
+
setShowData(area.length === 3 ? city.children : area.length === 2 ? province.children : options);
|
|
116
|
+
}, [options]);
|
|
117
|
+
|
|
118
|
+
var initOptions = /*#__PURE__*/function () {
|
|
119
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
120
|
+
var cacheItems, api, result, opts;
|
|
121
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
122
|
+
while (1) {
|
|
123
|
+
switch (_context.prev = _context.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
cacheItems = (0, _utils.getCache)('areaOptionsPanel', true);
|
|
126
|
+
|
|
127
|
+
if (!(cacheItems && Array.isArray(cacheItems) && cacheItems.length)) {
|
|
128
|
+
_context.next = 3;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return _context.abrupt("return");
|
|
133
|
+
|
|
134
|
+
case 3:
|
|
135
|
+
api = '/petrel/petrel-location-center-api/sysAdministrativeDivision/allByTree';
|
|
136
|
+
_context.next = 6;
|
|
137
|
+
return (0, _http.httpGet)(api, {}, false);
|
|
138
|
+
|
|
139
|
+
case 6:
|
|
140
|
+
result = _context.sent;
|
|
141
|
+
opts = result.rows || [];
|
|
142
|
+
(0, _utils.treeEach)(opts, function (item) {
|
|
143
|
+
item.label = item.name;
|
|
144
|
+
item.value = item.id;
|
|
145
|
+
|
|
146
|
+
if (item.level === 'district') {
|
|
147
|
+
delete item.children;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
delete item.name;
|
|
151
|
+
delete item.id;
|
|
152
|
+
delete item.parentId;
|
|
153
|
+
});
|
|
154
|
+
(0, _utils.setCache)('areaOptionsPanel', opts, true);
|
|
155
|
+
setOptions(opts);
|
|
156
|
+
setShowData(opts);
|
|
157
|
+
|
|
158
|
+
case 12:
|
|
159
|
+
case "end":
|
|
160
|
+
return _context.stop();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}, _callee);
|
|
164
|
+
}));
|
|
165
|
+
|
|
166
|
+
return function initOptions() {
|
|
167
|
+
return _ref.apply(this, arguments);
|
|
168
|
+
};
|
|
169
|
+
}();
|
|
170
|
+
|
|
171
|
+
var dropdownRender = function dropdownRender(menus) {
|
|
172
|
+
var _listData$, _listData$3;
|
|
173
|
+
|
|
174
|
+
var title = /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
+
className: "ls-area-cascaded-header"
|
|
176
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
className: "ls-word-box-display"
|
|
178
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
179
|
+
type: "text",
|
|
180
|
+
onClick: function onClick() {
|
|
181
|
+
setAreaTitle('province');
|
|
182
|
+
setShowData(options);
|
|
183
|
+
setListData(function (val) {
|
|
184
|
+
return val.length ? [val[0]] : [];
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
188
|
+
className: 'ls-myself-select-title-style'
|
|
189
|
+
}, listData[0] ? (_listData$ = listData[0]) === null || _listData$ === void 0 ? void 0 : _listData$.label : '省/直辖市'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
className: "ls-word-box-display"
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
192
|
+
type: "text",
|
|
193
|
+
disabled: listData.length < 2,
|
|
194
|
+
onClick: function onClick() {
|
|
195
|
+
var _listData$2;
|
|
196
|
+
|
|
197
|
+
setAreaTitle('city');
|
|
198
|
+
setShowData((_listData$2 = listData[0]) === null || _listData$2 === void 0 ? void 0 : _listData$2.children);
|
|
199
|
+
setListData(function (val) {
|
|
200
|
+
return val.filter(function (o, i) {
|
|
201
|
+
return i < 2;
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
206
|
+
className: 'ls-myself-select-title-style'
|
|
207
|
+
}, areaTitle !== 'province' && listData[1] ? (_listData$3 = listData[1]) === null || _listData$3 === void 0 ? void 0 : _listData$3.label : '市'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
208
|
+
className: "ls-word-box-display"
|
|
209
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
210
|
+
type: "text",
|
|
211
|
+
disabled: listData.length < 3
|
|
212
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
213
|
+
className: 'ls-myself-select-title-style'
|
|
214
|
+
}, listData[2] ? listData[2].label : '区'))));
|
|
215
|
+
|
|
216
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
className: "ls-area-cascaded-box"
|
|
218
|
+
}, title, /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
className: "ls-area-cascaded-body"
|
|
220
|
+
}, showData.map(function (item) {
|
|
221
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
222
|
+
className: "ls-area-cascaded-span ".concat(actualData.find(function (o) {
|
|
223
|
+
return o === item.value;
|
|
224
|
+
}) ? ' ls-area-selected' : ''),
|
|
225
|
+
title: item.label,
|
|
226
|
+
onClick: function onClick(e) {
|
|
227
|
+
var _areaRef$current;
|
|
228
|
+
|
|
229
|
+
switch ((item === null || item === void 0 ? void 0 : item.level) || '') {
|
|
230
|
+
case 'province':
|
|
231
|
+
setShowData(item === null || item === void 0 ? void 0 : item.children);
|
|
232
|
+
setActualData([item === null || item === void 0 ? void 0 : item.value]);
|
|
233
|
+
setListData(function (val) {
|
|
234
|
+
return [item];
|
|
235
|
+
}); //面板标题指向市
|
|
236
|
+
|
|
237
|
+
setAreaTitle('city');
|
|
238
|
+
break;
|
|
239
|
+
|
|
240
|
+
case 'city':
|
|
241
|
+
setShowData(item === null || item === void 0 ? void 0 : item.children);
|
|
242
|
+
setActualData(function (val) {
|
|
243
|
+
return [val[0], item === null || item === void 0 ? void 0 : item.value];
|
|
244
|
+
});
|
|
245
|
+
setListData(function (val) {
|
|
246
|
+
return [val[0], item];
|
|
247
|
+
});
|
|
248
|
+
setAreaTitle('district');
|
|
249
|
+
break;
|
|
250
|
+
|
|
251
|
+
case 'district':
|
|
252
|
+
setActualData(function (val) {
|
|
253
|
+
return [val[0], val[1], item === null || item === void 0 ? void 0 : item.value];
|
|
254
|
+
});
|
|
255
|
+
setListData(function (val) {
|
|
256
|
+
return [val[0], val[1], item];
|
|
257
|
+
});
|
|
258
|
+
(_areaRef$current = areaRef.current) === null || _areaRef$current === void 0 ? void 0 : _areaRef$current.blur();
|
|
259
|
+
break;
|
|
260
|
+
|
|
261
|
+
default:
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}, item.label);
|
|
266
|
+
})));
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
return /*#__PURE__*/_react.default.createElement(_cascader.default, (0, _extends2.default)({
|
|
270
|
+
options: options,
|
|
271
|
+
style: {
|
|
272
|
+
width: '100%'
|
|
273
|
+
},
|
|
274
|
+
className: 'ls-area-box-position',
|
|
275
|
+
changeOnSelect: true,
|
|
276
|
+
ref: areaRef,
|
|
277
|
+
onClear: function onClear() {
|
|
278
|
+
setActualData([]);
|
|
279
|
+
setListData([]);
|
|
280
|
+
setShowData(options);
|
|
281
|
+
},
|
|
282
|
+
dropdownRender: dropdownRender
|
|
283
|
+
}, propsConfig));
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
var _default = AreaPicker;
|
|
287
|
+
exports.default = _default;
|
|
@@ -35,6 +35,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
|
|
|
35
35
|
fillMap?: Record<string, string>;
|
|
36
36
|
/**@name 输入后检查数据的触发方式,默认为entry回车触发 */
|
|
37
37
|
triggerCheck?: 'entry' | 'blur';
|
|
38
|
+
/**@name 每次展示面板时都加载数据,接合 tableConfig里的 manualRequest 一起使用 */
|
|
38
39
|
loadOnShow?: boolean;
|
|
39
40
|
placement?: TooltipPlacement;
|
|
40
41
|
arrowPointAtCenter?: boolean;
|
|
@@ -88,6 +89,7 @@ declare const InputTable: React.ForwardRefExoticComponent<{
|
|
|
88
89
|
fillMap?: Record<string, string> | undefined;
|
|
89
90
|
/**@name 输入后检查数据的触发方式,默认为entry回车触发 */
|
|
90
91
|
triggerCheck?: "entry" | "blur" | undefined;
|
|
92
|
+
/**@name 每次展示面板时都加载数据,接合 tableConfig里的 manualRequest 一起使用 */
|
|
91
93
|
loadOnShow?: boolean | undefined;
|
|
92
94
|
placement?: TooltipPlacement | undefined;
|
|
93
95
|
arrowPointAtCenter?: boolean | undefined;
|
|
@@ -351,4 +351,98 @@ a:hover {
|
|
|
351
351
|
|
|
352
352
|
.ant-row {
|
|
353
353
|
width: 100%;
|
|
354
|
-
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.ant-popover {
|
|
357
|
+
max-width: min-content !important;
|
|
358
|
+
}
|
|
359
|
+
//-------------------省市区组件样式-----------
|
|
360
|
+
//最外层盒子
|
|
361
|
+
.ls-area-cascaded-box {
|
|
362
|
+
width: 600px;
|
|
363
|
+
display: flex;
|
|
364
|
+
flex-direction: column;
|
|
365
|
+
transition: all 0.3s;
|
|
366
|
+
|
|
367
|
+
.ls-area-cascaded-header {
|
|
368
|
+
width: 100%;
|
|
369
|
+
padding: 2px 0 6px;
|
|
370
|
+
border-bottom: 1px solid #f0f0f0;
|
|
371
|
+
display: flex;
|
|
372
|
+
flex-direction: row;
|
|
373
|
+
justify-content: space-around;
|
|
374
|
+
justify-content: center;
|
|
375
|
+
|
|
376
|
+
.ls-word-box-display {
|
|
377
|
+
margin: 0 10px;
|
|
378
|
+
font-size: 14px;
|
|
379
|
+
font-weight: 100;
|
|
380
|
+
|
|
381
|
+
button {
|
|
382
|
+
border: none;
|
|
383
|
+
background-color: var(--ant-primary-2, #f0f9ff);
|
|
384
|
+
|
|
385
|
+
&[disabled] {
|
|
386
|
+
background-color: #fafafa !important;
|
|
387
|
+
|
|
388
|
+
.ls-myself-select-title-style {
|
|
389
|
+
color: var(--ant-primary-4, #a3d7ff);
|
|
390
|
+
transition: all 0.3s;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.ls-myself-select-title-style {
|
|
396
|
+
color: var(--ant-primary-color, rgb(69, 154, 220));
|
|
397
|
+
font-size: 14px;
|
|
398
|
+
font-weight: 600;
|
|
399
|
+
transition: all 0.3s;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.ls-icon-box-display {
|
|
404
|
+
display: flex;
|
|
405
|
+
align-items: center;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.ls-area-cascaded-body {
|
|
410
|
+
width: 100%;
|
|
411
|
+
min-height: 100px;
|
|
412
|
+
max-height: 350px;
|
|
413
|
+
overflow: auto;
|
|
414
|
+
padding: 8px 12px 4px;
|
|
415
|
+
display: grid;
|
|
416
|
+
grid-template-columns: repeat(4, 1fr);
|
|
417
|
+
gap: 4px;
|
|
418
|
+
justify-content: start;
|
|
419
|
+
align-content: flex-start;
|
|
420
|
+
align-items: center;
|
|
421
|
+
|
|
422
|
+
.ls-area-cascaded-span {
|
|
423
|
+
text-align: center;
|
|
424
|
+
padding: 6px 10px;
|
|
425
|
+
|
|
426
|
+
//文字不换行,超出省略
|
|
427
|
+
overflow: hidden;
|
|
428
|
+
text-overflow: ellipsis;
|
|
429
|
+
white-space: nowrap;
|
|
430
|
+
cursor: pointer;
|
|
431
|
+
|
|
432
|
+
&.ls-area-selected,
|
|
433
|
+
&:hover {
|
|
434
|
+
color: var(--ant-primary-color, rgb(69, 154, 220));
|
|
435
|
+
transition: all 0.3s;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
//手动指定盒子位置
|
|
442
|
+
.ls-area-box-position {
|
|
443
|
+
.ls-ant-select-dropdown {
|
|
444
|
+
top: 36px !important;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
//-------------------省市区组件样式-----------
|
|
@@ -19,6 +19,8 @@ export declare type DtlParamType = SingleParamType & {
|
|
|
19
19
|
billType?: string;
|
|
20
20
|
/**@name 动态编码规则字段,主从表一起保存传参 */
|
|
21
21
|
codeRuleDynamicField?: string;
|
|
22
|
+
/**@是否查询历史数据 */
|
|
23
|
+
ifHistoryData?: 0 | 1;
|
|
22
24
|
};
|
|
23
25
|
declare function useDtl(dtlParam: DtlParamType): {
|
|
24
26
|
formRef: import("react").MutableRefObject<ProFormInstance<any> | undefined>;
|
|
@@ -55,7 +55,9 @@ function useDtl(dtlParam) {
|
|
|
55
55
|
afterRemove = dtlParam.afterRemove,
|
|
56
56
|
btnStatus = dtlParam.btnStatus,
|
|
57
57
|
beforeAudit = dtlParam.beforeAudit,
|
|
58
|
-
afterAudit = dtlParam.afterAudit
|
|
58
|
+
afterAudit = dtlParam.afterAudit,
|
|
59
|
+
_dtlParam$ifHistoryDa = dtlParam.ifHistoryData,
|
|
60
|
+
ifHistoryData = _dtlParam$ifHistoryDa === void 0 ? 0 : _dtlParam$ifHistoryDa;
|
|
59
61
|
|
|
60
62
|
var _usePermission = (0, _usePermission2.default)(),
|
|
61
63
|
canAdd = _usePermission.canAdd,
|
|
@@ -863,23 +865,28 @@ function useDtl(dtlParam) {
|
|
|
863
865
|
|
|
864
866
|
setSelectedRows([]);
|
|
865
867
|
(_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$cl = _tableRef$current3.clearSelected) === null || _tableRef$current3$cl === void 0 ? void 0 : _tableRef$current3$cl.call(_tableRef$current3);
|
|
868
|
+
|
|
869
|
+
if (ifHistoryData === 1) {
|
|
870
|
+
param.history = 1;
|
|
871
|
+
}
|
|
872
|
+
|
|
866
873
|
_context8.t0 = beforeLoad;
|
|
867
874
|
|
|
868
875
|
if (!_context8.t0) {
|
|
869
|
-
_context8.next =
|
|
876
|
+
_context8.next = 21;
|
|
870
877
|
break;
|
|
871
878
|
}
|
|
872
879
|
|
|
873
|
-
_context8.next =
|
|
880
|
+
_context8.next = 19;
|
|
874
881
|
return beforeLoad(param);
|
|
875
882
|
|
|
876
|
-
case
|
|
883
|
+
case 19:
|
|
877
884
|
_context8.t1 = _context8.sent;
|
|
878
885
|
_context8.t0 = _context8.t1 === false;
|
|
879
886
|
|
|
880
|
-
case
|
|
887
|
+
case 21:
|
|
881
888
|
if (!_context8.t0) {
|
|
882
|
-
_context8.next =
|
|
889
|
+
_context8.next = 23;
|
|
883
890
|
break;
|
|
884
891
|
}
|
|
885
892
|
|
|
@@ -888,15 +895,15 @@ function useDtl(dtlParam) {
|
|
|
888
895
|
success: true
|
|
889
896
|
});
|
|
890
897
|
|
|
891
|
-
case
|
|
898
|
+
case 23:
|
|
892
899
|
if (sumProperties && param.sort) {
|
|
893
900
|
delete param.sort;
|
|
894
901
|
}
|
|
895
902
|
|
|
896
|
-
_context8.next =
|
|
903
|
+
_context8.next = 26;
|
|
897
904
|
return dtlService.load(param);
|
|
898
905
|
|
|
899
|
-
case
|
|
906
|
+
case 26:
|
|
900
907
|
result = _context8.sent;
|
|
901
908
|
result.data = result.rows;
|
|
902
909
|
result.success = true;
|
|
@@ -907,7 +914,7 @@ function useDtl(dtlParam) {
|
|
|
907
914
|
|
|
908
915
|
return _context8.abrupt("return", result);
|
|
909
916
|
|
|
910
|
-
case
|
|
917
|
+
case 31:
|
|
911
918
|
case "end":
|
|
912
919
|
return _context8.stop();
|
|
913
920
|
}
|
|
@@ -977,17 +984,16 @@ function useDtl(dtlParam) {
|
|
|
977
984
|
return _context9.abrupt("return", false);
|
|
978
985
|
|
|
979
986
|
case 20:
|
|
980
|
-
_context9.next =
|
|
987
|
+
_context9.next = 26;
|
|
981
988
|
break;
|
|
982
989
|
|
|
983
990
|
case 22:
|
|
984
991
|
_context9.prev = 22;
|
|
985
992
|
_context9.t0 = _context9["catch"](6);
|
|
986
|
-
console.log(_context9.t0);
|
|
987
993
|
(0, _utils.showError)(_context9.t0.message);
|
|
988
994
|
return _context9.abrupt("return", false);
|
|
989
995
|
|
|
990
|
-
case
|
|
996
|
+
case 26:
|
|
991
997
|
case "end":
|
|
992
998
|
return _context9.stop();
|
|
993
999
|
}
|
|
@@ -49,5 +49,7 @@ declare function useSingle(inParam: SingleParamType): {
|
|
|
49
49
|
checkRight: (val: number) => boolean;
|
|
50
50
|
loginName: string | undefined;
|
|
51
51
|
isAudit: (row?: any) => boolean;
|
|
52
|
+
ifHistoryData: 0 | 1;
|
|
53
|
+
setIfHistoryData: import("react").Dispatch<import("react").SetStateAction<0 | 1>>;
|
|
52
54
|
};
|
|
53
55
|
export default useSingle;
|