ls-pro-common 3.0.29 → 3.0.31
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/es/components/IconBack.d.ts +5 -4
- package/es/components/IconBack.js +1 -1
- package/es/components/IconBell.d.ts +2 -4
- package/es/components/IconBell.js +1 -1
- package/es/components/IconQuestion.d.ts +2 -4
- package/es/components/IconQuestion.js +1 -1
- package/es/components/IconSearch.d.ts +2 -4
- package/es/components/IconSearch.js +1 -1
- package/es/components/IconText.d.ts +2 -4
- package/es/components/IconText.js +1 -1
- package/es/utils/index.d.ts +2 -2
- package/es/utils/index.js +2 -2
- package/lib/components/404.js +7 -15
- package/lib/components/AreaCascader.js +23 -32
- package/lib/components/AreaCascaderPanel.js +52 -61
- package/lib/components/DescritionCard.js +23 -32
- package/lib/components/DtlLayout.js +28 -37
- package/lib/components/GroupTip.js +11 -19
- package/lib/components/IconBack.d.ts +5 -4
- package/lib/components/IconBack.js +7 -15
- package/lib/components/IconBell.d.ts +2 -4
- package/lib/components/IconBell.js +7 -15
- package/lib/components/IconQuestion.d.ts +2 -4
- package/lib/components/IconQuestion.js +9 -17
- package/lib/components/IconSearch.d.ts +2 -4
- package/lib/components/IconSearch.js +7 -15
- package/lib/components/IconSelector.js +49 -57
- package/lib/components/IconText.d.ts +2 -4
- package/lib/components/IconText.js +12 -20
- package/lib/components/ImageSelector.js +93 -101
- package/lib/components/InputMultiLine.js +35 -44
- package/lib/components/InputTable.js +71 -80
- package/lib/components/Loading.js +11 -19
- package/lib/components/Permission.js +7 -15
- package/lib/hooks/useDtl/index.js +88 -96
- package/lib/hooks/useGetState.js +6 -13
- package/lib/hooks/usePermission/index.js +14 -21
- package/lib/hooks/useSingle/index.js +74 -82
- package/lib/http/index.js +42 -56
- package/lib/index.js +26 -207
- package/lib/service/BaseService.js +33 -41
- package/lib/typing.js +1 -5
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +83 -180
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare
|
|
3
|
-
onClick?: (
|
|
4
|
-
}
|
|
1
|
+
import { CustomIconComponentProps } from '@ant-design/icons/es/components/Icon';
|
|
2
|
+
export declare type LsIconProps = Partial<CustomIconComponentProps> & {
|
|
3
|
+
onClick?: (e: any) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const IconBack: (props: LsIconProps) => JSX.Element;
|
|
5
6
|
export default IconBack;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import Icon from '@ant-design/icons';
|
|
3
|
+
import Icon from '@ant-design/icons/es/components/Icon';
|
|
4
4
|
var Svg = function Svg() {
|
|
5
5
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
6
|
width: "1em",
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const IconBell: (props:
|
|
3
|
-
onClick?: ((e: any) => any) | undefined;
|
|
4
|
-
}) => JSX.Element;
|
|
1
|
+
import { LsIconProps } from './IconBack';
|
|
2
|
+
declare const IconBell: (props: LsIconProps) => JSX.Element;
|
|
5
3
|
export default IconBell;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import Icon from '@ant-design/icons';
|
|
3
|
+
import Icon from '@ant-design/icons/es/components/Icon';
|
|
4
4
|
var Svg = function Svg() {
|
|
5
5
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
6
|
width: "1em",
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const IconQuestion: (props:
|
|
3
|
-
onClick?: ((e: any) => any) | undefined;
|
|
4
|
-
}) => JSX.Element;
|
|
1
|
+
import { LsIconProps } from './IconBack';
|
|
2
|
+
declare const IconQuestion: (props: LsIconProps) => JSX.Element;
|
|
5
3
|
export default IconQuestion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import Icon from '@ant-design/icons';
|
|
3
|
+
import Icon from '@ant-design/icons/es/components/Icon';
|
|
4
4
|
var Svg = function Svg() {
|
|
5
5
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
6
|
width: "1em",
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const IconSearch: (props:
|
|
3
|
-
onClick?: ((e: any) => any) | undefined;
|
|
4
|
-
}) => JSX.Element;
|
|
1
|
+
import { LsIconProps } from './IconBack';
|
|
2
|
+
declare const IconSearch: (props: LsIconProps) => JSX.Element;
|
|
5
3
|
export default IconSearch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import Icon from '@ant-design/icons';
|
|
3
|
+
import Icon from '@ant-design/icons/es/components/Icon';
|
|
4
4
|
var Svg = function Svg() {
|
|
5
5
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
6
|
width: "1em",
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const IconText: (props:
|
|
3
|
-
onClick?: ((e: any) => any) | undefined;
|
|
4
|
-
}) => JSX.Element;
|
|
1
|
+
import { LsIconProps } from './IconBack';
|
|
2
|
+
declare const IconText: (props: LsIconProps) => JSX.Element;
|
|
5
3
|
export default IconText;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import Icon from '@ant-design/icons';
|
|
3
|
+
import Icon from '@ant-design/icons/es/components/Icon';
|
|
4
4
|
var Svg = function Svg() {
|
|
5
5
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
6
|
width: "1em",
|
package/es/utils/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ModalFuncProps } from 'antd';
|
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export { throttle, debounce } from 'lodash';
|
|
5
|
-
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table';
|
|
5
|
+
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table/es/utils/index';
|
|
6
6
|
/**
|
|
7
7
|
* 设置文档title
|
|
8
8
|
* @param {*} title
|
|
@@ -15,7 +15,7 @@ export declare const setTitle: (title: string) => void;
|
|
|
15
15
|
* @param showTime 是否显示时间 默认true
|
|
16
16
|
* @returns YYYY-MM-DD hh:mm:ss
|
|
17
17
|
*/
|
|
18
|
-
export declare const formatDate: (dt
|
|
18
|
+
export declare const formatDate: (dt?: Date | null | undefined, showTime?: boolean | undefined) => string;
|
|
19
19
|
/**
|
|
20
20
|
* 返回当前日期
|
|
21
21
|
* @returns YYYY-MM-DD
|
package/es/utils/index.js
CHANGED
|
@@ -9,11 +9,11 @@ import _message from "antd/es/message";
|
|
|
9
9
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
11
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
12
|
-
import { dateFormat, toGatewayUrl } from 'ls-pro-table';
|
|
12
|
+
import { dateFormat, toGatewayUrl } from 'ls-pro-table/es/utils/index';
|
|
13
13
|
import { httpPost } from '../http';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
export { throttle, debounce } from 'lodash';
|
|
16
|
-
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table';
|
|
16
|
+
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table/es/utils/index';
|
|
17
17
|
/**
|
|
18
18
|
* 设置文档title
|
|
19
19
|
* @param {*} title
|
package/lib/components/404.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
require("./common.less");
|
|
11
|
-
var _default = function _default(props) {
|
|
12
|
-
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import './common.less';
|
|
4
|
+
export default (function (props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
13
6
|
className: "page404"
|
|
14
|
-
}, props), /*#__PURE__*/
|
|
7
|
+
}, props), /*#__PURE__*/React.createElement("img", {
|
|
15
8
|
src: require('./404.jpg')
|
|
16
9
|
}), " \u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728~~");
|
|
17
|
-
};
|
|
18
|
-
exports.default = _default;
|
|
10
|
+
});
|
|
@@ -1,39 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
-
var _http = require("../http");
|
|
17
|
-
var _utils = require("../utils");
|
|
18
|
-
var AreaCascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
19
|
-
var _useState = (0, _react.useState)([]),
|
|
20
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
1
|
+
import "antd/es/cascader/style";
|
|
2
|
+
import _Cascader from "antd/es/cascader";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
8
|
+
import { httpGet } from '../http';
|
|
9
|
+
import { getCache, setCache, treeEach } from '../utils';
|
|
10
|
+
var AreaCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11
|
+
var _useState = useState([]),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
13
|
options = _useState2[0],
|
|
22
14
|
setOptions = _useState2[1];
|
|
23
|
-
var areaRef =
|
|
24
|
-
|
|
15
|
+
var areaRef = useRef();
|
|
16
|
+
useImperativeHandle(ref, function () {
|
|
25
17
|
return areaRef.current;
|
|
26
18
|
});
|
|
27
|
-
|
|
19
|
+
useEffect(function () {
|
|
28
20
|
initOptions();
|
|
29
21
|
}, []);
|
|
30
22
|
var initOptions = /*#__PURE__*/function () {
|
|
31
|
-
var _ref = (
|
|
23
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
32
24
|
var cacheItems, api, result, opts;
|
|
33
|
-
return
|
|
25
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
34
26
|
while (1) switch (_context.prev = _context.next) {
|
|
35
27
|
case 0:
|
|
36
|
-
cacheItems =
|
|
28
|
+
cacheItems = getCache("areaOptions", true);
|
|
37
29
|
if (!(cacheItems && Array.isArray(cacheItems))) {
|
|
38
30
|
_context.next = 4;
|
|
39
31
|
break;
|
|
@@ -43,11 +35,11 @@ var AreaCascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
43
35
|
case 4:
|
|
44
36
|
api = '/petrel/petrel-location-center-api/sysAdministrativeDivision/allByTree';
|
|
45
37
|
_context.next = 7;
|
|
46
|
-
return
|
|
38
|
+
return httpGet(api, {}, false);
|
|
47
39
|
case 7:
|
|
48
40
|
result = _context.sent;
|
|
49
41
|
opts = result.rows || [];
|
|
50
|
-
|
|
42
|
+
treeEach(opts, function (item) {
|
|
51
43
|
item.label = item.name;
|
|
52
44
|
item.value = item.id;
|
|
53
45
|
if (item.level === 'district') {
|
|
@@ -58,7 +50,7 @@ var AreaCascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
58
50
|
delete item.level;
|
|
59
51
|
delete item.parentId;
|
|
60
52
|
});
|
|
61
|
-
|
|
53
|
+
setCache('areaOptions', opts, true);
|
|
62
54
|
setOptions(opts);
|
|
63
55
|
case 12:
|
|
64
56
|
case "end":
|
|
@@ -70,7 +62,7 @@ var AreaCascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
70
62
|
return _ref.apply(this, arguments);
|
|
71
63
|
};
|
|
72
64
|
}();
|
|
73
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/React.createElement(_Cascader, _extends({
|
|
74
66
|
options: options,
|
|
75
67
|
style: {
|
|
76
68
|
width: '100%'
|
|
@@ -81,5 +73,4 @@ var AreaCascader = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
81
73
|
ref: areaRef
|
|
82
74
|
}));
|
|
83
75
|
});
|
|
84
|
-
|
|
85
|
-
exports.default = _default;
|
|
76
|
+
export default AreaCascader;
|
|
@@ -1,64 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
var _http = require("../http");
|
|
20
|
-
var _utils = require("../utils");
|
|
21
|
-
require("./common.less");
|
|
22
|
-
var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
23
|
-
var propsConfig = (0, _objectSpread2.default)({
|
|
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({
|
|
24
16
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
25
17
|
var _document;
|
|
26
18
|
return (_document = document) === null || _document === void 0 ? void 0 : _document.body;
|
|
27
19
|
},
|
|
28
20
|
placeholder: "请选择"
|
|
29
21
|
}, props);
|
|
30
|
-
var _useState =
|
|
31
|
-
_useState2 = (
|
|
22
|
+
var _useState = useState(getCache('areaOptionsPanel', true) || []),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
24
|
options = _useState2[0],
|
|
33
25
|
setOptions = _useState2[1];
|
|
34
26
|
//显示数据
|
|
35
|
-
var _useState3 =
|
|
36
|
-
_useState4 = (
|
|
27
|
+
var _useState3 = useState(getCache('areaOptionsPanel', true) || []),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
29
|
showData = _useState4[0],
|
|
38
30
|
setShowData = _useState4[1];
|
|
39
31
|
//暂存值
|
|
40
|
-
var _useState5 =
|
|
41
|
-
_useState6 = (
|
|
32
|
+
var _useState5 = useState([]),
|
|
33
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
34
|
listData = _useState6[0],
|
|
43
35
|
setListData = _useState6[1];
|
|
44
36
|
//省市区实际值
|
|
45
|
-
var _useState7 =
|
|
46
|
-
_useState8 = (
|
|
37
|
+
var _useState7 = useState(props.value || []),
|
|
38
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
47
39
|
actualData = _useState8[0],
|
|
48
40
|
setActualData = _useState8[1];
|
|
49
41
|
//标题显示值
|
|
50
|
-
var _useState9 =
|
|
51
|
-
_useState10 = (
|
|
42
|
+
var _useState9 = useState('province'),
|
|
43
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
52
44
|
areaTitle = _useState10[0],
|
|
53
45
|
setAreaTitle = _useState10[1];
|
|
54
|
-
var areaRef =
|
|
55
|
-
|
|
46
|
+
var areaRef = useRef();
|
|
47
|
+
useImperativeHandle(ref, function () {
|
|
56
48
|
return areaRef.current;
|
|
57
49
|
});
|
|
58
|
-
|
|
50
|
+
useEffect(function () {
|
|
59
51
|
initOptions();
|
|
60
52
|
}, []);
|
|
61
|
-
|
|
53
|
+
useEffect(function () {
|
|
62
54
|
if (actualData.length !== 0) {
|
|
63
55
|
var _props$onChange;
|
|
64
56
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, actualData, listData);
|
|
@@ -66,10 +58,10 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
66
58
|
setAreaTitle('province');
|
|
67
59
|
}
|
|
68
60
|
}, [actualData]);
|
|
69
|
-
|
|
61
|
+
useEffect(function () {
|
|
70
62
|
var _props$value;
|
|
71
63
|
if (!options.length || !((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.length)) return;
|
|
72
|
-
var _props$value2 = (
|
|
64
|
+
var _props$value2 = _slicedToArray(props.value, 3),
|
|
73
65
|
pKey = _props$value2[0],
|
|
74
66
|
cKey = _props$value2[1],
|
|
75
67
|
dKey = _props$value2[2];
|
|
@@ -88,12 +80,12 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
88
80
|
setShowData(area.length === 3 ? city.children : area.length === 2 ? province.children : options);
|
|
89
81
|
}, [options]);
|
|
90
82
|
var initOptions = /*#__PURE__*/function () {
|
|
91
|
-
var _ref = (
|
|
83
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
92
84
|
var cacheItems, api, result, opts;
|
|
93
|
-
return
|
|
85
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
94
86
|
while (1) switch (_context.prev = _context.next) {
|
|
95
87
|
case 0:
|
|
96
|
-
cacheItems =
|
|
88
|
+
cacheItems = getCache('areaOptionsPanel', true);
|
|
97
89
|
if (!(cacheItems && Array.isArray(cacheItems) && cacheItems.length)) {
|
|
98
90
|
_context.next = 3;
|
|
99
91
|
break;
|
|
@@ -102,11 +94,11 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
102
94
|
case 3:
|
|
103
95
|
api = '/petrel/petrel-location-center-api/sysAdministrativeDivision/allByTree';
|
|
104
96
|
_context.next = 6;
|
|
105
|
-
return
|
|
97
|
+
return httpGet(api, {}, false);
|
|
106
98
|
case 6:
|
|
107
99
|
result = _context.sent;
|
|
108
100
|
opts = result.rows || [];
|
|
109
|
-
|
|
101
|
+
treeEach(opts, function (item) {
|
|
110
102
|
item.label = item.name;
|
|
111
103
|
item.value = item.id;
|
|
112
104
|
if (item.level === 'district') {
|
|
@@ -116,7 +108,7 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
116
108
|
delete item.id;
|
|
117
109
|
delete item.parentId;
|
|
118
110
|
});
|
|
119
|
-
|
|
111
|
+
setCache('areaOptionsPanel', opts, true);
|
|
120
112
|
setOptions(opts);
|
|
121
113
|
setShowData(opts);
|
|
122
114
|
case 12:
|
|
@@ -131,11 +123,11 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
131
123
|
}();
|
|
132
124
|
var dropdownRender = function dropdownRender(menus) {
|
|
133
125
|
var _listData$, _listData$3;
|
|
134
|
-
var title = /*#__PURE__*/
|
|
126
|
+
var title = /*#__PURE__*/React.createElement("div", {
|
|
135
127
|
className: "ls-area-cascaded-header"
|
|
136
|
-
}, /*#__PURE__*/
|
|
128
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
137
129
|
className: "ls-word-box-display"
|
|
138
|
-
}, /*#__PURE__*/
|
|
130
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
139
131
|
type: "text",
|
|
140
132
|
onClick: function onClick() {
|
|
141
133
|
setAreaTitle('province');
|
|
@@ -144,11 +136,11 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
144
136
|
return val.length ? [val[0]] : [];
|
|
145
137
|
});
|
|
146
138
|
}
|
|
147
|
-
}, /*#__PURE__*/
|
|
139
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
148
140
|
className: 'ls-myself-select-title-style'
|
|
149
|
-
}, listData[0] ? (_listData$ = listData[0]) === null || _listData$ === void 0 ? void 0 : _listData$.label : '省/直辖市'))), /*#__PURE__*/
|
|
141
|
+
}, listData[0] ? (_listData$ = listData[0]) === null || _listData$ === void 0 ? void 0 : _listData$.label : '省/直辖市'))), /*#__PURE__*/React.createElement("div", {
|
|
150
142
|
className: "ls-word-box-display"
|
|
151
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
152
144
|
type: "text",
|
|
153
145
|
disabled: listData.length < 2,
|
|
154
146
|
onClick: function onClick() {
|
|
@@ -161,22 +153,22 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
161
153
|
});
|
|
162
154
|
});
|
|
163
155
|
}
|
|
164
|
-
}, /*#__PURE__*/
|
|
156
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
165
157
|
className: 'ls-myself-select-title-style'
|
|
166
|
-
}, areaTitle !== 'province' && listData[1] ? (_listData$3 = listData[1]) === null || _listData$3 === void 0 ? void 0 : _listData$3.label : '市'))), /*#__PURE__*/
|
|
158
|
+
}, areaTitle !== 'province' && listData[1] ? (_listData$3 = listData[1]) === null || _listData$3 === void 0 ? void 0 : _listData$3.label : '市'))), /*#__PURE__*/React.createElement("div", {
|
|
167
159
|
className: "ls-word-box-display"
|
|
168
|
-
}, /*#__PURE__*/
|
|
160
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
169
161
|
type: "text",
|
|
170
162
|
disabled: listData.length < 3
|
|
171
|
-
}, /*#__PURE__*/
|
|
163
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
172
164
|
className: 'ls-myself-select-title-style'
|
|
173
165
|
}, listData[2] ? listData[2].label : '区'))));
|
|
174
|
-
return /*#__PURE__*/
|
|
166
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
175
167
|
className: "ls-area-cascaded-box"
|
|
176
|
-
}, title, /*#__PURE__*/
|
|
168
|
+
}, title, /*#__PURE__*/React.createElement("div", {
|
|
177
169
|
className: "ls-area-cascaded-body"
|
|
178
170
|
}, showData.map(function (item) {
|
|
179
|
-
return /*#__PURE__*/
|
|
171
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
180
172
|
className: "ls-area-cascaded-span ".concat(actualData.find(function (o) {
|
|
181
173
|
return o === item.value;
|
|
182
174
|
}) ? ' ls-area-selected' : ''),
|
|
@@ -219,7 +211,7 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
219
211
|
}, item.label);
|
|
220
212
|
})));
|
|
221
213
|
};
|
|
222
|
-
return /*#__PURE__*/
|
|
214
|
+
return /*#__PURE__*/React.createElement(_Cascader, _extends({
|
|
223
215
|
options: options,
|
|
224
216
|
style: {
|
|
225
217
|
width: '100%'
|
|
@@ -235,5 +227,4 @@ var AreaPicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
235
227
|
dropdownRender: dropdownRender
|
|
236
228
|
}, propsConfig));
|
|
237
229
|
});
|
|
238
|
-
|
|
239
|
-
exports.default = _default;
|
|
230
|
+
export default AreaPicker;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
var _icons = require("@ant-design/icons");
|
|
15
|
-
var _lsProCard = _interopRequireDefault(require("ls-pro-card"));
|
|
16
|
-
var _lsProDescriptions = _interopRequireDefault(require("ls-pro-descriptions"));
|
|
17
|
-
require("./common.less");
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
18
4
|
var _excluded = ["title", "extra", "className", "collapsible", "defaultCollapsed", "desc", "hasBackground", "collapseTitle"];
|
|
5
|
+
import React, { useMemo, useState } from 'react';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { UpOutlined } from '@ant-design/icons';
|
|
8
|
+
import ProCard from 'ls-pro-card';
|
|
9
|
+
import ProDescriptions from 'ls-pro-descriptions';
|
|
10
|
+
import './common.less';
|
|
19
11
|
function DescritionCard(props) {
|
|
20
12
|
var title = props.title,
|
|
21
13
|
extra = props.extra,
|
|
@@ -28,20 +20,20 @@ function DescritionCard(props) {
|
|
|
28
20
|
hasBackground = props.hasBackground,
|
|
29
21
|
_props$collapseTitle = props.collapseTitle,
|
|
30
22
|
collapseTitle = _props$collapseTitle === void 0 ? '展开/收起' : _props$collapseTitle,
|
|
31
|
-
rest = (
|
|
32
|
-
var _useState =
|
|
33
|
-
_useState2 = (
|
|
23
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
var _useState = useState(defaultCollapsed),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
26
|
collapsed = _useState2[0],
|
|
35
27
|
setCollapsed = _useState2[1];
|
|
36
|
-
var titleLayout =
|
|
28
|
+
var titleLayout = useMemo(function () {
|
|
37
29
|
if (typeof title === 'string') {
|
|
38
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/React.createElement("span", null, title);
|
|
39
31
|
}
|
|
40
32
|
return title;
|
|
41
33
|
}, [title]);
|
|
42
|
-
var collapsedDom =
|
|
34
|
+
var collapsedDom = useMemo(function () {
|
|
43
35
|
if (!collapsible) return null;
|
|
44
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/React.createElement(UpOutlined, {
|
|
45
37
|
rotate: !!collapsed ? 180 : undefined,
|
|
46
38
|
className: "btn-expand",
|
|
47
39
|
onClick: function onClick() {
|
|
@@ -50,9 +42,9 @@ function DescritionCard(props) {
|
|
|
50
42
|
title: collapseTitle || undefined
|
|
51
43
|
});
|
|
52
44
|
}, [collapsed, collapsible]);
|
|
53
|
-
var extraDom =
|
|
45
|
+
var extraDom = useMemo(function () {
|
|
54
46
|
if (extra && collapsedDom) {
|
|
55
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, extra, collapsedDom);
|
|
56
48
|
} else if (extra) {
|
|
57
49
|
return extra;
|
|
58
50
|
} else if (collapsedDom) {
|
|
@@ -60,15 +52,15 @@ function DescritionCard(props) {
|
|
|
60
52
|
}
|
|
61
53
|
return null;
|
|
62
54
|
}, [extra, collapsedDom]);
|
|
63
|
-
return desc ? /*#__PURE__*/
|
|
64
|
-
className: (
|
|
55
|
+
return desc ? /*#__PURE__*/React.createElement(ProCard, _extends({
|
|
56
|
+
className: classNames('description-card', {
|
|
65
57
|
'has-background': hasBackground
|
|
66
58
|
}, className),
|
|
67
59
|
title: titleLayout,
|
|
68
60
|
extra: extraDom,
|
|
69
61
|
collapsed: collapsed
|
|
70
|
-
}, rest), /*#__PURE__*/
|
|
71
|
-
className: (
|
|
62
|
+
}, rest), /*#__PURE__*/React.createElement(ProDescriptions, desc)) : /*#__PURE__*/React.createElement(ProCard, _extends({
|
|
63
|
+
className: classNames('description-card', {
|
|
72
64
|
'has-background': hasBackground
|
|
73
65
|
}, className),
|
|
74
66
|
title: titleLayout,
|
|
@@ -76,5 +68,4 @@ function DescritionCard(props) {
|
|
|
76
68
|
collapsed: collapsed
|
|
77
69
|
}, rest));
|
|
78
70
|
}
|
|
79
|
-
|
|
80
|
-
exports.default = _default;
|
|
71
|
+
export default DescritionCard;
|