wargerm 0.6.24 → 0.7.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/components/Calendar/index.d.ts +1 -1
- package/dist/components/Calendar/utils.d.ts +8 -8
- package/dist/components/Cascader/index.d.ts +3 -3
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DragBox/index.d.ts +2 -2
- package/dist/components/Modal/dialog.d.ts +2 -2
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/ModalTips/dialog.d.ts +1 -1
- package/dist/components/ModalTips/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Video/index.d.ts +13 -4
- package/dist/components/WDatePicker/index.d.ts +1 -1
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useForceUpdate.d.ts +3 -0
- package/dist/index.css +12414 -82
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.css +12414 -82
- package/dist/index.esm.js +512 -393
- package/dist/index.js +513 -415
- package/dist/utils/useModelPlugin/Provider.d.ts +4 -0
- package/dist/utils/useModelPlugin/composeRootApp.d.ts +2 -0
- package/dist/utils/useModelPlugin/helpers/dispatcher.d.ts +5 -0
- package/dist/utils/useModelPlugin/helpers/executor.d.ts +7 -0
- package/dist/utils/useModelPlugin/helpers/storeContext.d.ts +3 -0
- package/dist/utils/useModelPlugin/index.d.ts +5 -0
- package/dist/utils/useModelPlugin/useModel.d.ts +1 -0
- package/package.json +90 -91
package/dist/index.esm.js
CHANGED
@@ -1,66 +1,23 @@
|
|
1
|
+
import 'antd/dist/reset.css';
|
1
2
|
import React, { useRef, useEffect, useMemo, useState, useCallback, useImperativeHandle, memo, forwardRef, createRef } from 'react';
|
2
3
|
import { cloneDeep, uniqBy, isEmpty } from 'lodash-es';
|
3
4
|
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
4
|
-
import 'antd
|
5
|
-
import
|
6
|
-
import 'antd/es/dropdown/style';
|
7
|
-
import _Dropdown from 'antd/es/dropdown';
|
8
|
-
import 'antd/es/menu/style';
|
9
|
-
import _Menu from 'antd/es/menu';
|
10
|
-
import { createFromIconfontCN, PlusOutlined, SearchOutlined, ReloadOutlined, CloseCircleOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
11
|
-
import 'antd/es/input/style';
|
12
|
-
import _Input from 'antd/es/input';
|
13
|
-
import 'antd/es/modal/style';
|
14
|
-
import _Modal from 'antd/es/modal';
|
15
|
-
import 'antd/es/message/style';
|
16
|
-
import _message from 'antd/es/message';
|
17
|
-
import 'antd/es/upload/style';
|
18
|
-
import _Upload from 'antd/es/upload';
|
5
|
+
import { Menu, Dropdown, Button, Input, Upload as Upload$1, Modal as Modal$2, message, InputNumber, DatePicker, Radio, Space, Checkbox, Select, Switch, Tooltip, TreeSelect as TreeSelect$1, Cascader, Form, Row, Col, Spin, Pagination, Breadcrumb, ConfigProvider } from 'antd';
|
6
|
+
import { createFromIconfontCN, PlusOutlined, CloseCircleOutlined, SearchOutlined, ReloadOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
19
7
|
import FileViewer from 'react-file-viewer';
|
20
|
-
import 'antd/es/input-number/style';
|
21
|
-
import _InputNumber from 'antd/es/input-number';
|
22
|
-
import 'antd/es/pagination/style';
|
23
|
-
import _Pagination from 'antd/es/pagination';
|
24
|
-
import 'antd/es/spin/style';
|
25
|
-
import _Spin from 'antd/es/spin';
|
26
|
-
import 'antd/es/tooltip/style';
|
27
|
-
import _Tooltip from 'antd/es/tooltip';
|
28
8
|
import classnames from 'classnames';
|
29
|
-
import 'antd/es/space/style';
|
30
|
-
import _Space from 'antd/es/space';
|
31
|
-
import 'antd/es/radio/style';
|
32
|
-
import _Radio from 'antd/es/radio';
|
33
|
-
import 'antd/es/date-picker/style';
|
34
|
-
import _DatePicker from 'antd/es/date-picker';
|
35
9
|
import zhCN from 'antd/es/date-picker/locale/zh_CN';
|
36
|
-
import
|
37
|
-
import '
|
38
|
-
import 'antd/es/checkbox/style';
|
39
|
-
import _Checkbox from 'antd/es/checkbox';
|
40
|
-
import 'antd/es/row/style';
|
41
|
-
import _Row from 'antd/es/row';
|
42
|
-
import 'antd/es/col/style';
|
43
|
-
import _Col from 'antd/es/col';
|
44
|
-
import 'antd/es/form/style';
|
45
|
-
import _Form from 'antd/es/form';
|
46
|
-
import 'antd/es/select/style';
|
47
|
-
import _Select from 'antd/es/select';
|
48
|
-
import 'antd/es/switch/style';
|
49
|
-
import _Switch from 'antd/es/switch';
|
50
|
-
import 'antd/es/tree-select/style';
|
51
|
-
import _TreeSelect from 'antd/es/tree-select';
|
52
|
-
import 'antd/es/cascader/style';
|
53
|
-
import _Cascader from 'antd/es/cascader';
|
10
|
+
import dayjs, { extend, weekdaysMin } from 'dayjs';
|
11
|
+
import 'dayjs/locale/zh-cn';
|
54
12
|
import CountUp from 'react-countup';
|
55
13
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
56
|
-
import SwiperCore, { Pagination, Navigation, Autoplay, Virtual } from 'swiper';
|
57
|
-
import 'antd/es/breadcrumb/style';
|
58
|
-
import _Breadcrumb from 'antd/es/breadcrumb';
|
14
|
+
import SwiperCore, { Pagination as Pagination$1, Navigation, Autoplay, Virtual } from 'swiper';
|
59
15
|
import ReactDOM from 'react-dom';
|
60
16
|
import ProTable from '@ant-design/pro-table';
|
61
|
-
import '
|
62
|
-
import
|
17
|
+
import weekday from 'dayjs/plugin/weekday';
|
18
|
+
import localeData from 'dayjs/plugin/localeData';
|
63
19
|
import zhCN$1 from 'antd/es/locale/zh_CN';
|
20
|
+
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
64
21
|
import Player from 'xgplayer';
|
65
22
|
import FlvPlayer from 'xgplayer-flv.js';
|
66
23
|
import HlsJsPlayer from 'xgplayer-hls.js';
|
@@ -1834,7 +1791,9 @@ function getNodePath(node) {
|
|
1834
1791
|
var result;
|
1835
1792
|
|
1836
1793
|
while (parent) {
|
1837
|
-
|
1794
|
+
var _result;
|
1795
|
+
|
1796
|
+
result = order === 'asc' ? (_result = result) === null || _result === void 0 ? void 0 : _result.concat(parent) : [parent].concat(result);
|
1838
1797
|
parent = parent.parentElement;
|
1839
1798
|
}
|
1840
1799
|
|
@@ -1869,6 +1828,8 @@ function getNodeXPath(node) {
|
|
1869
1828
|
|
1870
1829
|
function clickCollection() {
|
1871
1830
|
document.addEventListener('click', function (e) {
|
1831
|
+
var _path;
|
1832
|
+
|
1872
1833
|
// 点击事件
|
1873
1834
|
var _config = new RequestTemplateClick({
|
1874
1835
|
eventType: 'click'
|
@@ -1876,7 +1837,7 @@ function clickCollection() {
|
|
1876
1837
|
var path = e.path;
|
1877
1838
|
if (path === undefined) path = e.target ? getNodePath(e.target) : []; // 获取被点击的元素到最外层元素组成的数组
|
1878
1839
|
|
1879
|
-
var target = path.find(function (el) {
|
1840
|
+
var target = (_path = path) === null || _path === void 0 ? void 0 : _path.find(function (el) {
|
1880
1841
|
return el.hasAttribute && (el.hasAttribute('data-warden-container') || el.hasAttribute('data-warden-event-id') || el.hasAttribute('data-warden-title'));
|
1881
1842
|
});
|
1882
1843
|
if (!target) return;
|
@@ -2245,23 +2206,40 @@ var wTracing = _objectSpread2({
|
|
2245
2206
|
var _excluded = ["multiple", "children", "disabled"];
|
2246
2207
|
|
2247
2208
|
var WButton = function WButton(props) {
|
2209
|
+
var _multiple$children;
|
2210
|
+
|
2248
2211
|
var multiple = props.multiple,
|
2249
2212
|
children = props.children,
|
2250
2213
|
disabled = props.disabled,
|
2251
2214
|
extraProps = _objectWithoutProperties(props, _excluded);
|
2252
2215
|
|
2253
|
-
var menu = /*#__PURE__*/React.createElement(
|
2216
|
+
var menu = /*#__PURE__*/React.createElement(Menu, {
|
2254
2217
|
onClick: multiple && multiple.handleMenuClick
|
2255
2218
|
}, multiple && multiple.children && multiple.children.map(function (child, index) {
|
2256
|
-
return /*#__PURE__*/React.createElement(
|
2219
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
2257
2220
|
key: index
|
2258
2221
|
}, child);
|
2259
2222
|
}));
|
2260
|
-
return multiple ?
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2223
|
+
return multiple ?
|
2224
|
+
/*#__PURE__*/
|
2225
|
+
// <Dropdown.Button
|
2226
|
+
// disabled={disabled}
|
2227
|
+
// onClick={multiple && multiple.handleClick}
|
2228
|
+
// overlay={menu}
|
2229
|
+
// >
|
2230
|
+
// {children}
|
2231
|
+
// </Dropdown.Button>
|
2232
|
+
React.createElement(Dropdown.Button, {
|
2233
|
+
menu: {
|
2234
|
+
items: multiple === null || multiple === void 0 ? void 0 : (_multiple$children = multiple.children) === null || _multiple$children === void 0 ? void 0 : _multiple$children.map(function (child, index) {
|
2235
|
+
return {
|
2236
|
+
key: (child === null || child === void 0 ? void 0 : child.key) || index,
|
2237
|
+
label: (child === null || child === void 0 ? void 0 : child.label) || child
|
2238
|
+
};
|
2239
|
+
}),
|
2240
|
+
onClick: multiple && multiple.handleMenuClick
|
2241
|
+
}
|
2242
|
+
}, children) : /*#__PURE__*/React.createElement(Button, _objectSpread2({
|
2265
2243
|
disabled: disabled
|
2266
2244
|
}, extraProps), children);
|
2267
2245
|
};
|
@@ -2290,15 +2268,15 @@ var index = createFromIconfontCN({
|
|
2290
2268
|
var WInput = function WInput(props) {
|
2291
2269
|
var extraProps = _extends({}, props);
|
2292
2270
|
|
2293
|
-
return /*#__PURE__*/React.createElement(
|
2271
|
+
return /*#__PURE__*/React.createElement(Input, _objectSpread2({}, extraProps));
|
2294
2272
|
};
|
2295
2273
|
|
2296
2274
|
var Index = WInput;
|
2297
|
-
Index.TextArea =
|
2275
|
+
Index.TextArea = Input.TextArea;
|
2298
2276
|
WInput.defaultProps = {};
|
2299
2277
|
|
2300
2278
|
var _excluded$1 = ["value", "onChange", "onRemove", "beforeUpload", "uploadButton", "maxCount", "splitStr", "fetchMethod", "getFileList", "type"];
|
2301
|
-
var Dragger =
|
2279
|
+
var Dragger = Upload$1.Dragger;
|
2302
2280
|
|
2303
2281
|
function Index$1(_ref, ref) {
|
2304
2282
|
var value = _ref.value,
|
@@ -2379,13 +2357,13 @@ function Index$1(_ref, ref) {
|
|
2379
2357
|
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
2380
2358
|
|
2381
2359
|
if (!isJpgOrPng) {
|
2382
|
-
|
2360
|
+
message.error('You can only upload JPG/PNG file!');
|
2383
2361
|
}
|
2384
2362
|
|
2385
2363
|
var isLt2M = file.size / 1024 / 1024 < 2;
|
2386
2364
|
|
2387
2365
|
if (!isLt2M) {
|
2388
|
-
|
2366
|
+
message.error('Image must smaller than 2MB!');
|
2389
2367
|
}
|
2390
2368
|
|
2391
2369
|
return beforeUpload ? beforeUpload(file) : isJpgOrPng && isLt2M;
|
@@ -2557,7 +2535,7 @@ function Index$1(_ref, ref) {
|
|
2557
2535
|
|
2558
2536
|
return setProgress(Math.floor(percent));
|
2559
2537
|
}
|
2560
|
-
}, props), fileList.length >= maxCount ? null : uploadButton ? uploadButton : uploadButtonDom) : /*#__PURE__*/React.createElement(
|
2538
|
+
}, props), fileList.length >= maxCount ? null : uploadButton ? uploadButton : uploadButtonDom) : /*#__PURE__*/React.createElement(Upload$1, _objectSpread2({
|
2561
2539
|
accept: "image/*",
|
2562
2540
|
fileList: fileList,
|
2563
2541
|
listType: "picture-card",
|
@@ -2578,8 +2556,8 @@ function Index$1(_ref, ref) {
|
|
2578
2556
|
|
2579
2557
|
return setProgress(Math.floor(percent));
|
2580
2558
|
}
|
2581
|
-
}, props), fileList.length >= maxCount ? null : uploadButton ? uploadButton : uploadButtonDom), /*#__PURE__*/React.createElement(
|
2582
|
-
|
2559
|
+
}, props), fileList.length >= maxCount ? null : uploadButton ? uploadButton : uploadButtonDom), /*#__PURE__*/React.createElement(Modal$2, {
|
2560
|
+
open: previewVisible,
|
2583
2561
|
title: previewTitle,
|
2584
2562
|
footer: null,
|
2585
2563
|
onCancel: handleCancel
|
@@ -2604,20 +2582,32 @@ var Upload = /*#__PURE__*/React.forwardRef(Index$1);
|
|
2604
2582
|
var WInputNumber = function WInputNumber(props) {
|
2605
2583
|
var extraProps = _extends({}, props);
|
2606
2584
|
|
2607
|
-
return /*#__PURE__*/React.createElement(
|
2585
|
+
return /*#__PURE__*/React.createElement(InputNumber, _objectSpread2({}, extraProps));
|
2608
2586
|
};
|
2609
2587
|
|
2610
2588
|
WInputNumber.defaultProps = {};
|
2611
2589
|
|
2612
2590
|
var _excluded$2 = ["getRangePickerValue", "panelType"];
|
2613
|
-
|
2591
|
+
dayjs.locale('zh-cn');
|
2614
2592
|
|
2615
2593
|
var WDatePicker = function WDatePicker(props) {
|
2616
2594
|
var extraProps = _extends({}, props);
|
2617
2595
|
|
2618
|
-
return /*#__PURE__*/React.createElement(
|
2596
|
+
return /*#__PURE__*/React.createElement(DatePicker, _objectSpread2(_objectSpread2({
|
2619
2597
|
locale: zhCN
|
2620
|
-
}, extraProps)
|
2598
|
+
}, extraProps), {}, {
|
2599
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2600
|
+
className: "clearIconBox"
|
2601
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2602
|
+
className: "clearIcon"
|
2603
|
+
})),
|
2604
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2605
|
+
className: "dateIcon"
|
2606
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2607
|
+
className: "datePickerIcon",
|
2608
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2609
|
+
}))
|
2610
|
+
}));
|
2621
2611
|
};
|
2622
2612
|
|
2623
2613
|
WDatePicker.defaultProps = {};
|
@@ -2644,6 +2634,17 @@ var RangePicker = function RangePicker(props) {
|
|
2644
2634
|
if (panelType === 'within') {
|
2645
2635
|
return /*#__PURE__*/React.createElement(RangePicker, _objectSpread2({
|
2646
2636
|
locale: zhCN,
|
2637
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2638
|
+
className: "clearIconBox"
|
2639
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2640
|
+
className: "clearIcon"
|
2641
|
+
})),
|
2642
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2643
|
+
className: "dateIcon"
|
2644
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2645
|
+
className: "datePickerIcon",
|
2646
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2647
|
+
})),
|
2647
2648
|
value: rangePickerValue,
|
2648
2649
|
onChange: function onChange(date) {
|
2649
2650
|
setRadioValue('');
|
@@ -2667,41 +2668,41 @@ var RangePicker = function RangePicker(props) {
|
|
2667
2668
|
}
|
2668
2669
|
}, /*#__PURE__*/React.createElement("div", {
|
2669
2670
|
id: "withinDateNav"
|
2670
|
-
}, /*#__PURE__*/React.createElement(
|
2671
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
2671
2672
|
optionType: "button",
|
2672
2673
|
buttonStyle: "solid",
|
2673
2674
|
value: radioValue,
|
2674
2675
|
onChange: function onChange(e) {
|
2675
2676
|
setRadioValue(e.target.value);
|
2676
2677
|
}
|
2677
|
-
}, /*#__PURE__*/React.createElement(
|
2678
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
2678
2679
|
direction: "vertical",
|
2679
|
-
size:
|
2680
|
-
}, /*#__PURE__*/React.createElement(
|
2680
|
+
size: 28
|
2681
|
+
}, /*#__PURE__*/React.createElement(Radio.Button, {
|
2681
2682
|
value: '1',
|
2682
2683
|
onClick: function onClick() {
|
2683
|
-
setRangePickerValue([
|
2684
|
+
setRangePickerValue([dayjs().startOf('day'), dayjs().endOf('day')]);
|
2684
2685
|
}
|
2685
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u4ECA\u65E5")), /*#__PURE__*/React.createElement(
|
2686
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u4ECA\u65E5")), /*#__PURE__*/React.createElement(Radio.Button, {
|
2686
2687
|
value: '2',
|
2687
2688
|
onClick: function onClick() {
|
2688
|
-
setRangePickerValue([
|
2689
|
+
setRangePickerValue([dayjs().startOf('week'), dayjs().endOf('week')]);
|
2689
2690
|
}
|
2690
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u672C\u5468")), /*#__PURE__*/React.createElement(
|
2691
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u672C\u5468")), /*#__PURE__*/React.createElement(Radio.Button, {
|
2691
2692
|
value: '3',
|
2692
2693
|
onClick: function onClick() {
|
2693
|
-
setRangePickerValue([
|
2694
|
+
setRangePickerValue([dayjs().startOf('month'), dayjs().endOf('month')]);
|
2694
2695
|
}
|
2695
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u672C\u6708")), /*#__PURE__*/React.createElement(
|
2696
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u672C\u6708")), /*#__PURE__*/React.createElement(Radio.Button, {
|
2696
2697
|
value: '4',
|
2697
2698
|
onClick: function onClick() {
|
2698
|
-
setRangePickerValue([
|
2699
|
+
setRangePickerValue([dayjs().startOf('year'), dayjs().endOf('year')]);
|
2699
2700
|
}
|
2700
2701
|
}, /*#__PURE__*/React.createElement("span", null, "\u672C\u5E74")))))), /*#__PURE__*/React.createElement("div", null, originalPanel));
|
2701
2702
|
}
|
2702
2703
|
}, extraProps));
|
2703
2704
|
} else if (panelType === 'outside') {
|
2704
|
-
return /*#__PURE__*/React.createElement(
|
2705
|
+
return /*#__PURE__*/React.createElement(Space, {
|
2705
2706
|
split: /*#__PURE__*/React.createElement("span", {
|
2706
2707
|
style: {
|
2707
2708
|
color: '#768CAD'
|
@@ -2709,30 +2710,41 @@ var RangePicker = function RangePicker(props) {
|
|
2709
2710
|
}, "\u2014\u2014")
|
2710
2711
|
}, /*#__PURE__*/React.createElement("div", {
|
2711
2712
|
id: "outsideNav"
|
2712
|
-
}, /*#__PURE__*/React.createElement(
|
2713
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
2713
2714
|
optionType: "button",
|
2714
2715
|
buttonStyle: "solid",
|
2715
2716
|
value: radioValue,
|
2716
2717
|
onChange: function onChange(e) {
|
2717
2718
|
setRadioValue(e.target.value);
|
2718
2719
|
}
|
2719
|
-
}, /*#__PURE__*/React.createElement(
|
2720
|
+
}, /*#__PURE__*/React.createElement(Radio.Button, {
|
2720
2721
|
value: '1',
|
2721
2722
|
onClick: function onClick() {
|
2722
|
-
setRangePickerValue([
|
2723
|
+
setRangePickerValue([dayjs().startOf('year'), dayjs().endOf('year')]);
|
2723
2724
|
}
|
2724
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u5E74")), /*#__PURE__*/React.createElement(
|
2725
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u5E74")), /*#__PURE__*/React.createElement(Radio.Button, {
|
2725
2726
|
value: '2',
|
2726
2727
|
onClick: function onClick() {
|
2727
|
-
setRangePickerValue([
|
2728
|
+
setRangePickerValue([dayjs().startOf('month'), dayjs().endOf('month')]);
|
2728
2729
|
}
|
2729
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u6708")), /*#__PURE__*/React.createElement(
|
2730
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u6708")), /*#__PURE__*/React.createElement(Radio.Button, {
|
2730
2731
|
value: '3',
|
2731
2732
|
onClick: function onClick() {
|
2732
|
-
setRangePickerValue([
|
2733
|
+
setRangePickerValue([dayjs().startOf('day'), dayjs().endOf('day')]);
|
2733
2734
|
}
|
2734
2735
|
}, /*#__PURE__*/React.createElement("span", null, "\u65E5")))), /*#__PURE__*/React.createElement(RangePicker, _objectSpread2({
|
2735
2736
|
locale: zhCN,
|
2737
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2738
|
+
className: "clearIconBox"
|
2739
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2740
|
+
className: "clearIcon"
|
2741
|
+
})),
|
2742
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2743
|
+
className: "dateIcon"
|
2744
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2745
|
+
className: "datePickerIcon",
|
2746
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2747
|
+
})),
|
2736
2748
|
value: rangePickerValue,
|
2737
2749
|
onChange: function onChange(date) {
|
2738
2750
|
setRadioValue('');
|
@@ -2741,7 +2753,18 @@ var RangePicker = function RangePicker(props) {
|
|
2741
2753
|
}, extraProps)));
|
2742
2754
|
}
|
2743
2755
|
|
2744
|
-
return /*#__PURE__*/React.createElement(
|
2756
|
+
return /*#__PURE__*/React.createElement(DatePicker.RangePicker, _objectSpread2({
|
2757
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2758
|
+
className: "clearIconBox"
|
2759
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2760
|
+
className: "clearIcon"
|
2761
|
+
})),
|
2762
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2763
|
+
className: "dateIcon"
|
2764
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2765
|
+
className: "datePickerIcon",
|
2766
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2767
|
+
})),
|
2745
2768
|
locale: zhCN
|
2746
2769
|
}, extraProps));
|
2747
2770
|
};
|
@@ -2756,23 +2779,23 @@ var WRadio = function WRadio(props) {
|
|
2756
2779
|
var sideButtonStyle = props.sideButtonStyle,
|
2757
2780
|
extraProps = _objectWithoutProperties(props, _excluded$3);
|
2758
2781
|
|
2759
|
-
return /*#__PURE__*/React.createElement(
|
2782
|
+
return /*#__PURE__*/React.createElement(Radio, _objectSpread2({}, extraProps));
|
2760
2783
|
};
|
2761
2784
|
|
2762
2785
|
var Index$3 = WRadio;
|
2763
|
-
Index$3.Group =
|
2764
|
-
Index$3.Button =
|
2786
|
+
Index$3.Group = Radio.Group;
|
2787
|
+
Index$3.Button = Radio.Button;
|
2765
2788
|
WRadio.defaultProps = {};
|
2766
2789
|
|
2767
2790
|
var WCheckbox = function WCheckbox(props) {
|
2768
2791
|
var extraProps = _extends({}, props);
|
2769
2792
|
|
2770
|
-
return /*#__PURE__*/React.createElement(
|
2793
|
+
return /*#__PURE__*/React.createElement(Checkbox, _objectSpread2({}, extraProps));
|
2771
2794
|
};
|
2772
2795
|
|
2773
2796
|
WCheckbox.defaultProps = {};
|
2774
2797
|
var Index$4 = WCheckbox;
|
2775
|
-
Index$4.Group =
|
2798
|
+
Index$4.Group = Checkbox.Group;
|
2776
2799
|
|
2777
2800
|
/*
|
2778
2801
|
* @Author: lijin
|
@@ -2986,7 +3009,7 @@ var WSelect = function WSelect(props) {
|
|
2986
3009
|
label = _ref2.label,
|
2987
3010
|
extraProps = _objectWithoutProperties(_ref2, _excluded2);
|
2988
3011
|
|
2989
|
-
return /*#__PURE__*/React.createElement(
|
3012
|
+
return /*#__PURE__*/React.createElement(Select.Option, _objectSpread2({
|
2990
3013
|
key: value,
|
2991
3014
|
value: value
|
2992
3015
|
}, extraProps), label) || /*#__PURE__*/React.createElement(React.Fragment, null);
|
@@ -3020,7 +3043,7 @@ var WSelect = function WSelect(props) {
|
|
3020
3043
|
label: text,
|
3021
3044
|
value: key
|
3022
3045
|
});
|
3023
|
-
valueEnumNode.push( /*#__PURE__*/React.createElement(
|
3046
|
+
valueEnumNode.push( /*#__PURE__*/React.createElement(Select.Option, {
|
3024
3047
|
key: key,
|
3025
3048
|
value: key
|
3026
3049
|
}, text));
|
@@ -3033,7 +3056,7 @@ var WSelect = function WSelect(props) {
|
|
3033
3056
|
isUnmount = true;
|
3034
3057
|
};
|
3035
3058
|
}, [JSON.stringify(params || {})]);
|
3036
|
-
return /*#__PURE__*/React.createElement(
|
3059
|
+
return /*#__PURE__*/React.createElement(Select, _objectSpread2({
|
3037
3060
|
showSearch: true,
|
3038
3061
|
filterOption: function filterOption(input, option) {
|
3039
3062
|
var _ref3;
|
@@ -3051,20 +3074,20 @@ var Option = function Option(props) {
|
|
3051
3074
|
var children = props.children,
|
3052
3075
|
extraProps = _objectWithoutProperties(props, _excluded3);
|
3053
3076
|
|
3054
|
-
return /*#__PURE__*/React.createElement(
|
3077
|
+
return /*#__PURE__*/React.createElement(Select.Option, _objectSpread2({}, extraProps), children);
|
3055
3078
|
};
|
3056
3079
|
|
3057
3080
|
var Index$5 = WSelect;
|
3058
3081
|
Index$5.Option = Option;
|
3059
|
-
var Select = /*#__PURE__*/memo(Index$5);
|
3060
3082
|
|
3061
3083
|
var _excluded$6 = ["defaultValue", "format", "value", "onChange"],
|
3062
3084
|
_excluded2$1 = ["defaultValue", "value", "format", "showTime", "onChange"];
|
3063
|
-
|
3085
|
+
dayjs.locale('zh-cn');
|
3064
3086
|
|
3065
3087
|
var momentValue = function momentValue(value) {
|
3066
3088
|
if (value) {
|
3067
|
-
|
3089
|
+
var a = dayjs.isDayjs(value);
|
3090
|
+
return a ? value : dayjs(value);
|
3068
3091
|
}
|
3069
3092
|
|
3070
3093
|
return value;
|
@@ -3077,7 +3100,7 @@ var WDatePicker$1 = function WDatePicker(props) {
|
|
3077
3100
|
_onChange = props.onChange,
|
3078
3101
|
extraProps = _objectWithoutProperties(props, _excluded$6);
|
3079
3102
|
|
3080
|
-
return /*#__PURE__*/React.createElement(
|
3103
|
+
return /*#__PURE__*/React.createElement(DatePicker, _objectSpread2(_objectSpread2({
|
3081
3104
|
locale: zhCN,
|
3082
3105
|
defaultValue: momentValue(defaultValue),
|
3083
3106
|
value: momentValue(value)
|
@@ -3085,9 +3108,9 @@ var WDatePicker$1 = function WDatePicker(props) {
|
|
3085
3108
|
format: format
|
3086
3109
|
} : {}), {}, {
|
3087
3110
|
onChange: function onChange(v) {
|
3088
|
-
var
|
3111
|
+
var _momentValue, _momentValue2;
|
3089
3112
|
|
3090
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange((
|
3113
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange((_momentValue = momentValue(v)) === null || _momentValue === void 0 ? void 0 : _momentValue.format(format || (extraProps.showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')), (_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || (extraProps.showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')));
|
3091
3114
|
}
|
3092
3115
|
}, extraProps));
|
3093
3116
|
};
|
@@ -3102,15 +3125,15 @@ var RangePicker$1 = function RangePicker(props) {
|
|
3102
3125
|
_onChange2 = props.onChange,
|
3103
3126
|
extraProps = _objectWithoutProperties(props, _excluded2$1);
|
3104
3127
|
|
3105
|
-
return /*#__PURE__*/React.createElement(
|
3128
|
+
return /*#__PURE__*/React.createElement(DatePicker.RangePicker, _objectSpread2({
|
3106
3129
|
locale: zhCN,
|
3107
3130
|
showTime: showTime,
|
3108
3131
|
defaultValue: defaultValue ? [momentValue(defaultValue[0]), momentValue(defaultValue[1])] : undefined,
|
3109
3132
|
value: value ? [momentValue(value[0]), momentValue(value[1])] : undefined,
|
3110
3133
|
onChange: function onChange(v) {
|
3111
|
-
var _momentValue4, _momentValue5, _momentValue6
|
3134
|
+
var _momentValue3, _momentValue4, _momentValue5, _momentValue6;
|
3112
3135
|
|
3113
|
-
_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2([((
|
3136
|
+
_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2([((_momentValue3 = momentValue(v[0])) === null || _momentValue3 === void 0 ? void 0 : _momentValue3.format(format || (showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'))) || '', ((_momentValue4 = momentValue(v[1])) === null || _momentValue4 === void 0 ? void 0 : _momentValue4.format(format || (showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'))) || ''], [((_momentValue5 = momentValue(v[0])) === null || _momentValue5 === void 0 ? void 0 : _momentValue5.format(format || (showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'))) || '', ((_momentValue6 = momentValue(v[1])) === null || _momentValue6 === void 0 ? void 0 : _momentValue6.format(format || (showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'))) || '']);
|
3114
3137
|
}
|
3115
3138
|
}, extraProps));
|
3116
3139
|
};
|
@@ -3122,7 +3145,7 @@ Index$6.RangePicker = RangePicker$1;
|
|
3122
3145
|
var WSwitch = function WSwitch(props) {
|
3123
3146
|
var extraProps = _extends({}, props);
|
3124
3147
|
|
3125
|
-
return /*#__PURE__*/React.createElement(
|
3148
|
+
return /*#__PURE__*/React.createElement(Switch, _objectSpread2({}, extraProps));
|
3126
3149
|
};
|
3127
3150
|
|
3128
3151
|
WSwitch.defaultProps = {};
|
@@ -3186,7 +3209,7 @@ var NumericInput = /*#__PURE__*/function (_React$Component) {
|
|
3186
3209
|
valueTemp = value.slice(0, -1);
|
3187
3210
|
}
|
3188
3211
|
|
3189
|
-
onChange && onChange(valueTemp.replace(/0*(\d+)/, '$1'));
|
3212
|
+
valueTemp && onChange && onChange(valueTemp.replace(/0*(\d+)/, '$1'));
|
3190
3213
|
|
3191
3214
|
if (onBlur) {
|
3192
3215
|
onBlur && onBlur();
|
@@ -3203,12 +3226,12 @@ var NumericInput = /*#__PURE__*/function (_React$Component) {
|
|
3203
3226
|
var title = value ? /*#__PURE__*/React.createElement("span", {
|
3204
3227
|
className: "numeric-input-title"
|
3205
3228
|
}, value !== '-' ? formatNumber(value) : '-') : '输入一个数字';
|
3206
|
-
return /*#__PURE__*/React.createElement(
|
3229
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
3207
3230
|
trigger: ['focus'],
|
3208
3231
|
title: title,
|
3209
3232
|
placement: "topLeft",
|
3210
3233
|
overlayClassName: "numeric-input"
|
3211
|
-
}, /*#__PURE__*/React.createElement(
|
3234
|
+
}, /*#__PURE__*/React.createElement(Input, _objectSpread2(_objectSpread2({}, this.props), {}, {
|
3212
3235
|
onChange: this.onChange,
|
3213
3236
|
onBlur: this.onBlur,
|
3214
3237
|
maxLength: 64
|
@@ -3236,7 +3259,7 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
3236
3259
|
|
3237
3260
|
var renderTree = function renderTree(data) {
|
3238
3261
|
return data === null || data === void 0 ? void 0 : data.map(function (item) {
|
3239
|
-
return /*#__PURE__*/React.createElement(
|
3262
|
+
return /*#__PURE__*/React.createElement(TreeSelect$1.TreeNode, {
|
3240
3263
|
value: item[treeNodeValueProp],
|
3241
3264
|
title: item[treeNodeLabelProp],
|
3242
3265
|
key: item[treeNodeValueProp]
|
@@ -3297,7 +3320,7 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
3297
3320
|
isUnmount = true;
|
3298
3321
|
};
|
3299
3322
|
}, [JSON.stringify(params)]);
|
3300
|
-
return /*#__PURE__*/React.createElement(
|
3323
|
+
return /*#__PURE__*/React.createElement(TreeSelect$1, _objectSpread2({
|
3301
3324
|
showSearch: true,
|
3302
3325
|
treeNodeFilterProp: "title",
|
3303
3326
|
treeDefaultExpandAll: true
|
@@ -3305,7 +3328,7 @@ var TreeSelect = function TreeSelect(_ref) {
|
|
3305
3328
|
};
|
3306
3329
|
|
3307
3330
|
var Index$7 = TreeSelect;
|
3308
|
-
Index$7.TreeNode =
|
3331
|
+
Index$7.TreeNode = TreeSelect$1.TreeNode;
|
3309
3332
|
|
3310
3333
|
var _excluded$8 = ["request", "options", "onLoad", "value", "onChange", "params"];
|
3311
3334
|
|
@@ -3373,7 +3396,7 @@ var WCascader = function WCascader(props) {
|
|
3373
3396
|
isUnmount = true;
|
3374
3397
|
};
|
3375
3398
|
}, [JSON.stringify(params)]);
|
3376
|
-
return /*#__PURE__*/React.createElement(
|
3399
|
+
return /*#__PURE__*/React.createElement(Cascader, _objectSpread2({
|
3377
3400
|
value: typeof value === 'string' ? [value] : value,
|
3378
3401
|
onChange: function onChange(v, options) {
|
3379
3402
|
_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, options);
|
@@ -3402,7 +3425,7 @@ var WForm = function WForm(props, ref) {
|
|
3402
3425
|
deps = props.deps,
|
3403
3426
|
extraProps = _objectWithoutProperties(props, _excluded$9);
|
3404
3427
|
|
3405
|
-
var _Form$useForm =
|
3428
|
+
var _Form$useForm = Form.useForm(),
|
3406
3429
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
3407
3430
|
form = _Form$useForm2[0];
|
3408
3431
|
|
@@ -3462,17 +3485,17 @@ var WForm = function WForm(props, ref) {
|
|
3462
3485
|
};
|
3463
3486
|
}
|
3464
3487
|
|
3465
|
-
return /*#__PURE__*/React.createElement(
|
3488
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3466
3489
|
className: "pl12 pr12"
|
3467
3490
|
}, colProps), {}, {
|
3468
3491
|
key: c.dataIndex
|
3469
|
-
}), /*#__PURE__*/React.createElement(
|
3492
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3470
3493
|
initialValue: c.initialValue
|
3471
3494
|
}, c.formItemProps), {}, {
|
3472
3495
|
name: c.dataIndex,
|
3473
3496
|
label: c.title,
|
3474
3497
|
labelCol: labelCol
|
3475
|
-
}), /*#__PURE__*/React.createElement(
|
3498
|
+
}), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
|
3476
3499
|
placeholder: "\u8BF7\u9009\u62E9",
|
3477
3500
|
disabled: disabled,
|
3478
3501
|
onLoad: function onLoad(opt) {
|
@@ -3505,11 +3528,11 @@ var WForm = function WForm(props, ref) {
|
|
3505
3528
|
};
|
3506
3529
|
}
|
3507
3530
|
|
3508
|
-
return /*#__PURE__*/React.createElement(
|
3531
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3509
3532
|
className: "pl12 pr12"
|
3510
3533
|
}, colProps), {}, {
|
3511
3534
|
key: c.dataIndex
|
3512
|
-
}), /*#__PURE__*/React.createElement(
|
3535
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3513
3536
|
initialValue: c.initialValue
|
3514
3537
|
}, c.formItemProps), {}, {
|
3515
3538
|
name: c.dataIndex,
|
@@ -3533,11 +3556,11 @@ var WForm = function WForm(props, ref) {
|
|
3533
3556
|
};
|
3534
3557
|
}
|
3535
3558
|
|
3536
|
-
return /*#__PURE__*/React.createElement(
|
3559
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3537
3560
|
className: "pl12 pr12"
|
3538
3561
|
}, colProps), {}, {
|
3539
3562
|
key: c.dataIndex
|
3540
|
-
}), /*#__PURE__*/React.createElement(
|
3563
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3541
3564
|
initialValue: c.initialValue
|
3542
3565
|
}, c.formItemProps), {}, {
|
3543
3566
|
name: c.dataIndex,
|
@@ -3569,11 +3592,11 @@ var WForm = function WForm(props, ref) {
|
|
3569
3592
|
};
|
3570
3593
|
}
|
3571
3594
|
|
3572
|
-
return /*#__PURE__*/React.createElement(
|
3595
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3573
3596
|
className: "pl12 pr12"
|
3574
3597
|
}, colProps), {}, {
|
3575
3598
|
key: c.dataIndex
|
3576
|
-
}), /*#__PURE__*/React.createElement(
|
3599
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3577
3600
|
initialValue: c.initialValue
|
3578
3601
|
}, c.formItemProps), {}, {
|
3579
3602
|
name: c.dataIndex,
|
@@ -3616,11 +3639,11 @@ var WForm = function WForm(props, ref) {
|
|
3616
3639
|
};
|
3617
3640
|
}
|
3618
3641
|
|
3619
|
-
return /*#__PURE__*/React.createElement(
|
3642
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3620
3643
|
className: "pl12 pr12"
|
3621
3644
|
}, colProps), {}, {
|
3622
3645
|
key: c.dataIndex
|
3623
|
-
}), /*#__PURE__*/React.createElement(
|
3646
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3624
3647
|
initialValue: c.initialValue
|
3625
3648
|
}, c.formItemProps), {}, {
|
3626
3649
|
name: c.dataIndex,
|
@@ -3649,11 +3672,11 @@ var WForm = function WForm(props, ref) {
|
|
3649
3672
|
};
|
3650
3673
|
}
|
3651
3674
|
|
3652
|
-
return /*#__PURE__*/React.createElement(
|
3675
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3653
3676
|
className: "pl12 pr12"
|
3654
3677
|
}, colProps), {}, {
|
3655
3678
|
key: c.dataIndex
|
3656
|
-
}), /*#__PURE__*/React.createElement(
|
3679
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3657
3680
|
initialValue: c.initialValue
|
3658
3681
|
}, c.formItemProps), {}, {
|
3659
3682
|
name: c.dataIndex,
|
@@ -3693,11 +3716,11 @@ var WForm = function WForm(props, ref) {
|
|
3693
3716
|
};
|
3694
3717
|
}
|
3695
3718
|
|
3696
|
-
return /*#__PURE__*/React.createElement(
|
3719
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3697
3720
|
className: "pl12 pr12"
|
3698
3721
|
}, colProps), {}, {
|
3699
3722
|
key: c.dataIndex
|
3700
|
-
}), /*#__PURE__*/React.createElement(
|
3723
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3701
3724
|
initialValue: c.initialValue
|
3702
3725
|
}, c.formItemProps), {}, {
|
3703
3726
|
name: c.dataIndex,
|
@@ -3748,11 +3771,11 @@ var WForm = function WForm(props, ref) {
|
|
3748
3771
|
};
|
3749
3772
|
}
|
3750
3773
|
|
3751
|
-
return /*#__PURE__*/React.createElement(
|
3774
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3752
3775
|
className: "pl12 pr12"
|
3753
3776
|
}, colProps), {}, {
|
3754
3777
|
key: c.dataIndex
|
3755
|
-
}), /*#__PURE__*/React.createElement(
|
3778
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3756
3779
|
initialValue: c.initialValue
|
3757
3780
|
}, c.formItemProps), {}, {
|
3758
3781
|
name: c.dataIndex,
|
@@ -3791,11 +3814,11 @@ var WForm = function WForm(props, ref) {
|
|
3791
3814
|
setColumnsFields(function (preColumnsFields) {
|
3792
3815
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options2));
|
3793
3816
|
});
|
3794
|
-
return /*#__PURE__*/React.createElement(
|
3817
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3795
3818
|
className: "pl12 pr12"
|
3796
3819
|
}, colProps), {}, {
|
3797
3820
|
key: c.dataIndex
|
3798
|
-
}), /*#__PURE__*/React.createElement(
|
3821
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3799
3822
|
initialValue: c.initialValue,
|
3800
3823
|
valuePropName: "checked"
|
3801
3824
|
}, c.formItemProps), {}, {
|
@@ -3814,11 +3837,11 @@ var WForm = function WForm(props, ref) {
|
|
3814
3837
|
};
|
3815
3838
|
}
|
3816
3839
|
|
3817
|
-
return /*#__PURE__*/React.createElement(
|
3840
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3818
3841
|
className: "pl12 pr12"
|
3819
3842
|
}, colProps), {}, {
|
3820
3843
|
key: c.dataIndex
|
3821
|
-
}), /*#__PURE__*/React.createElement(
|
3844
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3822
3845
|
initialValue: c.initialValue
|
3823
3846
|
}, c.formItemProps), {}, {
|
3824
3847
|
name: c.dataIndex,
|
@@ -3844,11 +3867,11 @@ var WForm = function WForm(props, ref) {
|
|
3844
3867
|
columnsFields: columnsFields // columnsFieldsRef,
|
3845
3868
|
|
3846
3869
|
}), form);
|
3847
|
-
return baseitem ? /*#__PURE__*/React.createElement(
|
3870
|
+
return baseitem ? /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3848
3871
|
className: "pl12 pr12"
|
3849
3872
|
}, colProps), {}, {
|
3850
3873
|
key: c.dataIndex
|
3851
|
-
}), /*#__PURE__*/React.createElement(
|
3874
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3852
3875
|
initialValue: c.initialValue
|
3853
3876
|
}, c.formItemProps), {}, {
|
3854
3877
|
name: c.dataIndex,
|
@@ -3864,11 +3887,11 @@ var WForm = function WForm(props, ref) {
|
|
3864
3887
|
};
|
3865
3888
|
}
|
3866
3889
|
|
3867
|
-
return /*#__PURE__*/React.createElement(
|
3890
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3868
3891
|
className: "pl12 pr12"
|
3869
3892
|
}, colProps), {}, {
|
3870
3893
|
key: c.dataIndex
|
3871
|
-
}), /*#__PURE__*/React.createElement(
|
3894
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3872
3895
|
initialValue: c.initialValue
|
3873
3896
|
}, c.formItemProps), {}, {
|
3874
3897
|
name: c.dataIndex,
|
@@ -3888,11 +3911,11 @@ var WForm = function WForm(props, ref) {
|
|
3888
3911
|
};
|
3889
3912
|
}
|
3890
3913
|
|
3891
|
-
return /*#__PURE__*/React.createElement(
|
3914
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3892
3915
|
className: "pl12 pr12"
|
3893
3916
|
}, colProps), {}, {
|
3894
3917
|
key: c.dataIndex
|
3895
|
-
}), /*#__PURE__*/React.createElement(
|
3918
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3896
3919
|
initialValue: c.initialValue
|
3897
3920
|
}, c.formItemProps), {}, {
|
3898
3921
|
name: c.dataIndex,
|
@@ -3911,11 +3934,11 @@ var WForm = function WForm(props, ref) {
|
|
3911
3934
|
};
|
3912
3935
|
}
|
3913
3936
|
|
3914
|
-
return /*#__PURE__*/React.createElement(
|
3937
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2(_objectSpread2({
|
3915
3938
|
className: "pl12 pr12"
|
3916
3939
|
}, colProps), {}, {
|
3917
3940
|
key: c.dataIndex
|
3918
|
-
}), /*#__PURE__*/React.createElement(
|
3941
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
3919
3942
|
initialValue: c.initialValue
|
3920
3943
|
}, c.formItemProps), {}, {
|
3921
3944
|
name: c.dataIndex,
|
@@ -3970,32 +3993,32 @@ var WForm = function WForm(props, ref) {
|
|
3970
3993
|
if (c.valueType === 'date' && searchForm[c.dataIndex]) {
|
3971
3994
|
var _c$fieldProps;
|
3972
3995
|
|
3973
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
3996
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps = c.fieldProps) === null || _c$fieldProps === void 0 ? void 0 : _c$fieldProps.format) || 'YYYY-MM-DD');
|
3974
3997
|
}
|
3975
3998
|
|
3976
3999
|
if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
|
3977
4000
|
var _c$fieldProps2;
|
3978
4001
|
|
3979
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4002
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps2 = c.fieldProps) === null || _c$fieldProps2 === void 0 ? void 0 : _c$fieldProps2.format) || 'YYYY-MM-DD HH:mm:ss');
|
3980
4003
|
}
|
3981
4004
|
|
3982
4005
|
if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
|
3983
4006
|
var _c$fieldProps3;
|
3984
4007
|
|
3985
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4008
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps3 = c.fieldProps) === null || _c$fieldProps3 === void 0 ? void 0 : _c$fieldProps3.format) || 'YYYY-MM');
|
3986
4009
|
}
|
3987
4010
|
|
3988
4011
|
if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
|
3989
4012
|
var _c$fieldProps4;
|
3990
4013
|
|
3991
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4014
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps4 = c.fieldProps) === null || _c$fieldProps4 === void 0 ? void 0 : _c$fieldProps4.format) || 'YYYY');
|
3992
4015
|
}
|
3993
4016
|
|
3994
4017
|
if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
|
3995
4018
|
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
3996
4019
|
var _c$fieldProps5;
|
3997
4020
|
|
3998
|
-
return item && searchForm[c.dataIndex] &&
|
4021
|
+
return item && searchForm[c.dataIndex] && dayjs(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps5 = c.fieldProps) === null || _c$fieldProps5 === void 0 ? void 0 : _c$fieldProps5.format) || 'YYYY-MM-DD');
|
3999
4022
|
});
|
4000
4023
|
}
|
4001
4024
|
|
@@ -4003,7 +4026,7 @@ var WForm = function WForm(props, ref) {
|
|
4003
4026
|
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
4004
4027
|
var _c$fieldProps6;
|
4005
4028
|
|
4006
|
-
return item &&
|
4029
|
+
return item && dayjs(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps6 = c.fieldProps) === null || _c$fieldProps6 === void 0 ? void 0 : _c$fieldProps6.format) || 'YYYY-MM-DD HH:mm:ss');
|
4007
4030
|
});
|
4008
4031
|
}
|
4009
4032
|
}
|
@@ -4030,32 +4053,32 @@ var WForm = function WForm(props, ref) {
|
|
4030
4053
|
if (c.valueType === 'date' && searchForm[c.dataIndex]) {
|
4031
4054
|
var _c$fieldProps7;
|
4032
4055
|
|
4033
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4056
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps7 = c.fieldProps) === null || _c$fieldProps7 === void 0 ? void 0 : _c$fieldProps7.format) || 'YYYY-MM-DD');
|
4034
4057
|
}
|
4035
4058
|
|
4036
4059
|
if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
|
4037
4060
|
var _c$fieldProps8;
|
4038
4061
|
|
4039
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4062
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps8 = c.fieldProps) === null || _c$fieldProps8 === void 0 ? void 0 : _c$fieldProps8.format) || 'YYYY-MM-DD HH:mm:ss');
|
4040
4063
|
}
|
4041
4064
|
|
4042
4065
|
if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
|
4043
4066
|
var _c$fieldProps9;
|
4044
4067
|
|
4045
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4068
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps9 = c.fieldProps) === null || _c$fieldProps9 === void 0 ? void 0 : _c$fieldProps9.format) || 'YYYY-MM');
|
4046
4069
|
}
|
4047
4070
|
|
4048
4071
|
if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
|
4049
4072
|
var _c$fieldProps10;
|
4050
4073
|
|
4051
|
-
searchForm[c.dataIndex] = searchForm[c.dataIndex] &&
|
4074
|
+
searchForm[c.dataIndex] = searchForm[c.dataIndex] && dayjs(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps10 = c.fieldProps) === null || _c$fieldProps10 === void 0 ? void 0 : _c$fieldProps10.format) || 'YYYY');
|
4052
4075
|
}
|
4053
4076
|
|
4054
4077
|
if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
|
4055
4078
|
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
4056
4079
|
var _c$fieldProps11;
|
4057
4080
|
|
4058
|
-
return item && searchForm[c.dataIndex] &&
|
4081
|
+
return item && searchForm[c.dataIndex] && dayjs(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps11 = c.fieldProps) === null || _c$fieldProps11 === void 0 ? void 0 : _c$fieldProps11.format) || 'YYYY-MM-DD');
|
4059
4082
|
});
|
4060
4083
|
}
|
4061
4084
|
|
@@ -4063,7 +4086,7 @@ var WForm = function WForm(props, ref) {
|
|
4063
4086
|
searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
|
4064
4087
|
var _c$fieldProps12;
|
4065
4088
|
|
4066
|
-
return item &&
|
4089
|
+
return item && dayjs(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps12 = c.fieldProps) === null || _c$fieldProps12 === void 0 ? void 0 : _c$fieldProps12.format) || 'YYYY-MM-DD HH:mm:ss');
|
4067
4090
|
});
|
4068
4091
|
}
|
4069
4092
|
}
|
@@ -4121,7 +4144,7 @@ var WForm = function WForm(props, ref) {
|
|
4121
4144
|
}
|
4122
4145
|
};
|
4123
4146
|
}, []);
|
4124
|
-
return /*#__PURE__*/React.createElement(
|
4147
|
+
return /*#__PURE__*/React.createElement(Form, _objectSpread2({
|
4125
4148
|
style: {
|
4126
4149
|
width: '100%'
|
4127
4150
|
},
|
@@ -4134,9 +4157,9 @@ var WForm = function WForm(props, ref) {
|
|
4134
4157
|
setchangedValues(changedValues);
|
4135
4158
|
},
|
4136
4159
|
form: form
|
4137
|
-
}, extraProps), /*#__PURE__*/React.createElement(
|
4160
|
+
}, extraProps), /*#__PURE__*/React.createElement(Row, null, filterForm, filterExtraColumnsForm, search && search.hideSubmit ? null : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, _objectSpread2({
|
4138
4161
|
className: "pl20"
|
4139
|
-
}, search ? search === null || search === void 0 ? void 0 : search.searchButtonConfig : {}), /*#__PURE__*/React.createElement(
|
4162
|
+
}, search ? search === null || search === void 0 ? void 0 : search.searchButtonConfig : {}), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement("div", {
|
4140
4163
|
style: {
|
4141
4164
|
display: 'flex'
|
4142
4165
|
}
|
@@ -4180,9 +4203,9 @@ var WForm = function WForm(props, ref) {
|
|
4180
4203
|
icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),
|
4181
4204
|
onClick: handleRest
|
4182
4205
|
}, search && search.resetText ? search.resetText : '重置')) : null))), search && (search === null || search === void 0 ? void 0 : search.tableBarDom) && (search === null || search === void 0 ? void 0 : search.tableBarDom.map(function (dom) {
|
4183
|
-
return /*#__PURE__*/React.createElement(
|
4206
|
+
return /*#__PURE__*/React.createElement(Col, _objectSpread2({
|
4184
4207
|
className: "pr20"
|
4185
|
-
}, search ? search === null || search === void 0 ? void 0 : search.searchButtonConfig : {}), /*#__PURE__*/React.createElement(
|
4208
|
+
}, search ? search === null || search === void 0 ? void 0 : search.searchButtonConfig : {}), /*#__PURE__*/React.createElement(Form.Item, null, dom));
|
4186
4209
|
})))));
|
4187
4210
|
};
|
4188
4211
|
|
@@ -4405,7 +4428,7 @@ function Table(_ref) {
|
|
4405
4428
|
if (c.showTitle) {
|
4406
4429
|
var _columnsFields$c$data;
|
4407
4430
|
|
4408
|
-
return /*#__PURE__*/React.createElement(
|
4431
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
4409
4432
|
key: c.dataIndex,
|
4410
4433
|
placement: "top",
|
4411
4434
|
title: record[c.dataIndex]
|
@@ -4658,7 +4681,7 @@ function Table(_ref) {
|
|
4658
4681
|
setFormSearch({});
|
4659
4682
|
};
|
4660
4683
|
|
4661
|
-
return /*#__PURE__*/React.createElement(
|
4684
|
+
return /*#__PURE__*/React.createElement(Spin, {
|
4662
4685
|
spinning: loading
|
4663
4686
|
}, /*#__PURE__*/React.createElement("div", {
|
4664
4687
|
className: "form"
|
@@ -4748,7 +4771,7 @@ function Table(_ref) {
|
|
4748
4771
|
justifyContent: 'center',
|
4749
4772
|
alignItems: 'center'
|
4750
4773
|
}
|
4751
|
-
}, none || '暂无数据')))), _typeof(pagination) === 'object' && /*#__PURE__*/React.createElement(
|
4774
|
+
}, none || '暂无数据')))), _typeof(pagination) === 'object' && /*#__PURE__*/React.createElement(Pagination, _objectSpread2({
|
4752
4775
|
style: {
|
4753
4776
|
textAlign: 'right'
|
4754
4777
|
},
|
@@ -5199,7 +5222,7 @@ var Index$b = function Index(_ref) {
|
|
5199
5222
|
|
5200
5223
|
var _excluded$f = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
|
5201
5224
|
|
5202
|
-
SwiperCore.use([Pagination, Navigation, Autoplay, Virtual]);
|
5225
|
+
SwiperCore.use([Pagination$1, Navigation, Autoplay, Virtual]);
|
5203
5226
|
|
5204
5227
|
var Index$c = function Index(props) {
|
5205
5228
|
var data = props.data,
|
@@ -5880,7 +5903,7 @@ var Index$d = function Index(_ref) {
|
|
5880
5903
|
className = _ref.className,
|
5881
5904
|
props = _objectWithoutProperties(_ref, _excluded$g);
|
5882
5905
|
|
5883
|
-
return /*#__PURE__*/React.createElement(
|
5906
|
+
return /*#__PURE__*/React.createElement(Breadcrumb, _objectSpread2({
|
5884
5907
|
className: className || 'default',
|
5885
5908
|
separator: ">>",
|
5886
5909
|
itemRender: itemRender,
|
@@ -5952,7 +5975,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
|
|
5952
5975
|
|
5953
5976
|
function DialogModel(props, ref) {
|
5954
5977
|
var width = props.width,
|
5955
|
-
|
5978
|
+
open = props.open,
|
5956
5979
|
destroyOnClose = props.destroyOnClose,
|
5957
5980
|
closeCb = props.closeCb,
|
5958
5981
|
onClose = props.onClose,
|
@@ -5962,17 +5985,17 @@ function DialogModel(props, ref) {
|
|
5962
5985
|
className = _props$className === void 0 ? 'default-dialog' : _props$className,
|
5963
5986
|
style = props.style;
|
5964
5987
|
|
5965
|
-
var _useState = useState(
|
5988
|
+
var _useState = useState(open),
|
5966
5989
|
_useState2 = _slicedToArray(_useState, 2),
|
5967
5990
|
modelShow = _useState2[0],
|
5968
5991
|
setModelShow = _useState2[1];
|
5969
5992
|
|
5970
|
-
var _useState3 = useState(
|
5993
|
+
var _useState3 = useState(open),
|
5971
5994
|
_useState4 = _slicedToArray(_useState3, 2),
|
5972
5995
|
modelShowAync = _useState4[0],
|
5973
5996
|
setModelShowAync = _useState4[1];
|
5974
5997
|
|
5975
|
-
var _useState5 = useState(
|
5998
|
+
var _useState5 = useState(open),
|
5976
5999
|
_useState6 = _slicedToArray(_useState5, 2),
|
5977
6000
|
flag = _useState6[0],
|
5978
6001
|
setFlag = _useState6[1];
|
@@ -6111,18 +6134,18 @@ function DialogModel(props, ref) {
|
|
6111
6134
|
}, []);
|
6112
6135
|
useEffect(function () {
|
6113
6136
|
var timer;
|
6114
|
-
setFlag(
|
6137
|
+
setFlag(open);
|
6115
6138
|
|
6116
|
-
if (
|
6117
|
-
timer = controlShow(setModelShow, setModelShowAync,
|
6139
|
+
if (open) {
|
6140
|
+
timer = controlShow(setModelShow, setModelShowAync, open, 30);
|
6118
6141
|
} else {
|
6119
|
-
timer = controlShow(setModelShowAync, setModelShow,
|
6142
|
+
timer = controlShow(setModelShowAync, setModelShow, open, 1000);
|
6120
6143
|
}
|
6121
6144
|
|
6122
6145
|
return function () {
|
6123
6146
|
timer && clearTimeout(timer);
|
6124
6147
|
};
|
6125
|
-
}, [
|
6148
|
+
}, [open]);
|
6126
6149
|
useEffect(function () {
|
6127
6150
|
if (modelShow) {
|
6128
6151
|
setHasVisit(true);
|
@@ -6143,8 +6166,8 @@ function DialogModel(props, ref) {
|
|
6143
6166
|
|
6144
6167
|
var Dialog = /*#__PURE__*/React.forwardRef(DialogModel);
|
6145
6168
|
|
6146
|
-
var _excluded$i = ["
|
6147
|
-
_excluded2$3 = ["
|
6169
|
+
var _excluded$i = ["open", "width", "closeCb", "onClose", "className", "style"],
|
6170
|
+
_excluded2$3 = ["open"];
|
6148
6171
|
|
6149
6172
|
var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
6150
6173
|
_inherits(Modal, _React$PureComponent);
|
@@ -6255,7 +6278,7 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6255
6278
|
key: "render",
|
6256
6279
|
value: function render() {
|
6257
6280
|
var _this$props4 = this.props,
|
6258
|
-
|
6281
|
+
open = _this$props4.open,
|
6259
6282
|
width = _this$props4.width,
|
6260
6283
|
closeCb = _this$props4.closeCb,
|
6261
6284
|
onClose = _this$props4.onClose,
|
@@ -6267,7 +6290,7 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6267
6290
|
ref: this.containerRef,
|
6268
6291
|
closeCb: closeCb,
|
6269
6292
|
onClose: onClose,
|
6270
|
-
|
6293
|
+
open: open,
|
6271
6294
|
width: width,
|
6272
6295
|
className: className,
|
6273
6296
|
style: style
|
@@ -6292,7 +6315,7 @@ Modal.show = function (config) {
|
|
6292
6315
|
if (Modals[modelSysbol]) return;
|
6293
6316
|
|
6294
6317
|
var props = _objectSpread2(_objectSpread2({}, config), {}, {
|
6295
|
-
|
6318
|
+
open: true
|
6296
6319
|
});
|
6297
6320
|
|
6298
6321
|
var container = document.createElement('div');
|
@@ -6322,18 +6345,18 @@ Modal.show = function (config) {
|
|
6322
6345
|
|
6323
6346
|
manager.setShow = setShow;
|
6324
6347
|
|
6325
|
-
var
|
6348
|
+
var open = props.open,
|
6326
6349
|
trueProps = _objectWithoutProperties(props, _excluded2$3);
|
6327
6350
|
|
6328
6351
|
useEffect(function () {
|
6329
6352
|
manager.mounted = true;
|
6330
|
-
setShow(
|
6353
|
+
setShow(open);
|
6331
6354
|
}, []);
|
6332
6355
|
return /*#__PURE__*/React.createElement(Modal, _objectSpread2(_objectSpread2({}, trueProps), {}, {
|
6333
6356
|
closeCb: function closeCb() {
|
6334
6357
|
return manager.mounted && manager.destory();
|
6335
6358
|
},
|
6336
|
-
|
6359
|
+
open: show
|
6337
6360
|
}));
|
6338
6361
|
};
|
6339
6362
|
|
@@ -6367,24 +6390,24 @@ var controlShow$1 = function controlShow(f1, f2, value, timer) {
|
|
6367
6390
|
|
6368
6391
|
function DialogModel$1(props) {
|
6369
6392
|
var width = props.width,
|
6370
|
-
|
6393
|
+
open = props.open,
|
6371
6394
|
closeCb = props.closeCb,
|
6372
6395
|
onClose = props.onClose,
|
6373
6396
|
_props$className = props.className,
|
6374
6397
|
className = _props$className === void 0 ? 'default-dialog' : _props$className,
|
6375
6398
|
style = props.style;
|
6376
6399
|
|
6377
|
-
var _useState = useState(
|
6400
|
+
var _useState = useState(open),
|
6378
6401
|
_useState2 = _slicedToArray(_useState, 2),
|
6379
6402
|
modelShow = _useState2[0],
|
6380
6403
|
setModelShow = _useState2[1];
|
6381
6404
|
|
6382
|
-
var _useState3 = useState(
|
6405
|
+
var _useState3 = useState(open),
|
6383
6406
|
_useState4 = _slicedToArray(_useState3, 2),
|
6384
6407
|
modelShowAync = _useState4[0],
|
6385
6408
|
setModelShowAync = _useState4[1];
|
6386
6409
|
|
6387
|
-
var _useState5 = useState(
|
6410
|
+
var _useState5 = useState(open),
|
6388
6411
|
_useState6 = _slicedToArray(_useState5, 2),
|
6389
6412
|
flag = _useState6[0],
|
6390
6413
|
setFlag = _useState6[1];
|
@@ -6426,25 +6449,25 @@ function DialogModel$1(props) {
|
|
6426
6449
|
}, [modelShowAync, modelShow, props]);
|
6427
6450
|
useEffect(function () {
|
6428
6451
|
var timer;
|
6429
|
-
setFlag(
|
6452
|
+
setFlag(open);
|
6430
6453
|
|
6431
|
-
if (
|
6432
|
-
timer = controlShow$1(setModelShow, setModelShowAync,
|
6454
|
+
if (open) {
|
6455
|
+
timer = controlShow$1(setModelShow, setModelShowAync, open, 30);
|
6433
6456
|
} else {
|
6434
|
-
timer = controlShow$1(setModelShowAync, setModelShow,
|
6457
|
+
timer = controlShow$1(setModelShowAync, setModelShow, open, 1000);
|
6435
6458
|
}
|
6436
6459
|
|
6437
6460
|
return function () {
|
6438
6461
|
timer && clearTimeout(timer);
|
6439
6462
|
};
|
6440
|
-
}, [
|
6463
|
+
}, [open]);
|
6441
6464
|
useEffect(function () {
|
6442
6465
|
!modelShow && typeof closeCb === 'function' && closeCb();
|
6443
6466
|
}, [modelShow]);
|
6444
6467
|
return renderChildren;
|
6445
6468
|
}
|
6446
6469
|
|
6447
|
-
var _excluded$j = ["
|
6470
|
+
var _excluded$j = ["open"];
|
6448
6471
|
|
6449
6472
|
var Modal$1 = /*#__PURE__*/function (_React$PureComponent) {
|
6450
6473
|
_inherits(Modal, _React$PureComponent);
|
@@ -6527,7 +6550,7 @@ var Modal$1 = /*#__PURE__*/function (_React$PureComponent) {
|
|
6527
6550
|
key: "render",
|
6528
6551
|
value: function render() {
|
6529
6552
|
var _this$props4 = this.props,
|
6530
|
-
|
6553
|
+
open = _this$props4.open,
|
6531
6554
|
width = _this$props4.width,
|
6532
6555
|
closeCb = _this$props4.closeCb,
|
6533
6556
|
onClose = _this$props4.onClose,
|
@@ -6536,7 +6559,7 @@ var Modal$1 = /*#__PURE__*/function (_React$PureComponent) {
|
|
6536
6559
|
return /*#__PURE__*/React.createElement(DialogModel$1, {
|
6537
6560
|
closeCb: closeCb,
|
6538
6561
|
onClose: onClose,
|
6539
|
-
|
6562
|
+
open: open,
|
6540
6563
|
width: width,
|
6541
6564
|
className: className,
|
6542
6565
|
style: style
|
@@ -6558,7 +6581,7 @@ Modal$1.show = function (config) {
|
|
6558
6581
|
if (ModalContainer) return;
|
6559
6582
|
|
6560
6583
|
var props = _objectSpread2(_objectSpread2({}, config), {}, {
|
6561
|
-
|
6584
|
+
open: true
|
6562
6585
|
});
|
6563
6586
|
|
6564
6587
|
var container = ModalContainer = document.createElement('div');
|
@@ -6584,18 +6607,18 @@ Modal$1.show = function (config) {
|
|
6584
6607
|
|
6585
6608
|
manager.setShow = setShow;
|
6586
6609
|
|
6587
|
-
var
|
6610
|
+
var open = props.open,
|
6588
6611
|
trueProps = _objectWithoutProperties(props, _excluded$j);
|
6589
6612
|
|
6590
6613
|
useEffect(function () {
|
6591
6614
|
manager.mounted = true;
|
6592
|
-
setShow(
|
6615
|
+
setShow(open);
|
6593
6616
|
}, []);
|
6594
6617
|
return /*#__PURE__*/React.createElement(Modal$1, _objectSpread2(_objectSpread2({}, trueProps), {}, {
|
6595
6618
|
closeCb: function closeCb() {
|
6596
6619
|
return manager.mounted && manager.destory();
|
6597
6620
|
},
|
6598
|
-
|
6621
|
+
open: show
|
6599
6622
|
}));
|
6600
6623
|
};
|
6601
6624
|
|
@@ -6614,7 +6637,7 @@ function DragBox(_ref) {
|
|
6614
6637
|
children = _ref.children,
|
6615
6638
|
closeIcon = _ref.closeIcon,
|
6616
6639
|
onClose = _ref.onClose,
|
6617
|
-
|
6640
|
+
open = _ref.open,
|
6618
6641
|
isDrag = _ref.isDrag,
|
6619
6642
|
isResize = _ref.isResize,
|
6620
6643
|
className = _ref.className,
|
@@ -6633,18 +6656,18 @@ function DragBox(_ref) {
|
|
6633
6656
|
useEffect(function () {
|
6634
6657
|
var timer = null;
|
6635
6658
|
|
6636
|
-
if (
|
6637
|
-
setDelayVisiable(
|
6659
|
+
if (open) {
|
6660
|
+
setDelayVisiable(open);
|
6638
6661
|
} else {
|
6639
6662
|
timer = setTimeout(function () {
|
6640
|
-
setDelayVisiable(
|
6663
|
+
setDelayVisiable(open);
|
6641
6664
|
}, 1000);
|
6642
6665
|
}
|
6643
6666
|
|
6644
6667
|
return function () {
|
6645
6668
|
timer && clearTimeout(timer);
|
6646
6669
|
};
|
6647
|
-
}, [
|
6670
|
+
}, [open]);
|
6648
6671
|
useEffect(function () {
|
6649
6672
|
var tltleEl = titleRef.current;
|
6650
6673
|
var containerEl = containerRef.current;
|
@@ -6754,10 +6777,10 @@ function DragBox(_ref) {
|
|
6754
6777
|
rElOnmousedown = null;
|
6755
6778
|
}
|
6756
6779
|
};
|
6757
|
-
}, [isDrag, delayVisiable,
|
6780
|
+
}, [isDrag, delayVisiable, open, isResize]);
|
6758
6781
|
return delayVisiable ? /*#__PURE__*/React.createElement("div", {
|
6759
6782
|
ref: containerRef,
|
6760
|
-
className: "drag-container ".concat(
|
6783
|
+
className: "drag-container ".concat(open ? 'animation-fade' : 'animation-fade-out', " ").concat(className),
|
6761
6784
|
style: _objectSpread2({
|
6762
6785
|
animationDelay: "0.3s"
|
6763
6786
|
}, style || {})
|
@@ -6785,14 +6808,14 @@ function DragBox(_ref) {
|
|
6785
6808
|
}, children)) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
6786
6809
|
}
|
6787
6810
|
|
6788
|
-
var _excluded$k = ["columns", "extraColumns", "search", "
|
6811
|
+
var _excluded$k = ["columns", "extraColumns", "search", "open", "setOpen", "modalFormOpend", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange", "formItemChild", "onCancel", "modalHeaderSolt", "modalFooterSolt", "formProps"];
|
6789
6812
|
|
6790
6813
|
var ModalForm = function ModalForm(props, ref) {
|
6791
6814
|
var columns = props.columns,
|
6792
6815
|
extraColumns = props.extraColumns,
|
6793
6816
|
search = props.search,
|
6794
|
-
|
6795
|
-
|
6817
|
+
open = props.open,
|
6818
|
+
setOpen = props.setOpen,
|
6796
6819
|
modalFormOpend = props.modalFormOpend,
|
6797
6820
|
disabled = props.disabled,
|
6798
6821
|
submitMethod = props.submitMethod,
|
@@ -6849,7 +6872,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6849
6872
|
return {
|
6850
6873
|
formRef: formRef.current,
|
6851
6874
|
onSubmit: onSubmit,
|
6852
|
-
modalFormvisible:
|
6875
|
+
modalFormvisible: open,
|
6853
6876
|
setFieldsValue: setFieldsValue
|
6854
6877
|
};
|
6855
6878
|
});
|
@@ -6877,7 +6900,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6877
6900
|
|
6878
6901
|
var handleCancel = function handleCancel() {
|
6879
6902
|
onCancel && onCancel();
|
6880
|
-
|
6903
|
+
setOpen(false);
|
6881
6904
|
};
|
6882
6905
|
|
6883
6906
|
var onSubmit = /*#__PURE__*/function () {
|
@@ -6897,7 +6920,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6897
6920
|
|
6898
6921
|
_context2.next = 5;
|
6899
6922
|
return submitMethod(values, function () {
|
6900
|
-
|
6923
|
+
setOpen(false);
|
6901
6924
|
onCancel && onCancel();
|
6902
6925
|
});
|
6903
6926
|
|
@@ -6926,10 +6949,10 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6926
6949
|
if (formIntance) {
|
6927
6950
|
setFieldsValue(record);
|
6928
6951
|
}
|
6929
|
-
}, [
|
6930
|
-
return /*#__PURE__*/React.createElement(
|
6952
|
+
}, [open, record, formIntance]);
|
6953
|
+
return /*#__PURE__*/React.createElement(Modal$2, _objectSpread2(_objectSpread2({
|
6931
6954
|
title: title,
|
6932
|
-
|
6955
|
+
open: open,
|
6933
6956
|
forceRender: true
|
6934
6957
|
}, disabled ? {
|
6935
6958
|
footer: null
|
@@ -6981,8 +7004,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
6981
7004
|
|
6982
7005
|
var _useState = useState(false),
|
6983
7006
|
_useState2 = _slicedToArray(_useState, 2),
|
6984
|
-
|
6985
|
-
|
7007
|
+
open = _useState2[0],
|
7008
|
+
setOpen = _useState2[1];
|
6986
7009
|
|
6987
7010
|
var _useState3 = useState({}),
|
6988
7011
|
_useState4 = _slicedToArray(_useState3, 2),
|
@@ -7002,7 +7025,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7002
7025
|
});
|
7003
7026
|
|
7004
7027
|
var openFormModel = function openFormModel(options) {
|
7005
|
-
|
7028
|
+
setOpen(true);
|
7006
7029
|
setModalFormConfig(options);
|
7007
7030
|
};
|
7008
7031
|
|
@@ -7079,7 +7102,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7079
7102
|
});
|
7080
7103
|
},
|
7081
7104
|
delete: function _delete(item, record, index) {
|
7082
|
-
|
7105
|
+
Modal$2.confirm({
|
7083
7106
|
title: '删除',
|
7084
7107
|
icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
|
7085
7108
|
content: '是否确定要删除吗?',
|
@@ -7174,71 +7197,106 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7174
7197
|
|
7175
7198
|
if (tableAction && showMoreNum > 0 && showMoreNum < tableActionList.length) {
|
7176
7199
|
var tableAction1 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(0, showMoreNum);
|
7177
|
-
var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum);
|
7178
|
-
|
7179
|
-
|
7180
|
-
|
7181
|
-
|
7182
|
-
|
7183
|
-
|
7184
|
-
|
7185
|
-
|
7186
|
-
|
7187
|
-
|
7188
|
-
|
7189
|
-
|
7190
|
-
|
7191
|
-
|
7192
|
-
|
7193
|
-
|
7194
|
-
|
7195
|
-
|
7196
|
-
|
7197
|
-
|
7198
|
-
|
7199
|
-
|
7200
|
-
|
7201
|
-
|
7202
|
-
|
7200
|
+
var tableAction2 = tableActionList === null || tableActionList === void 0 ? void 0 : tableActionList.slice(showMoreNum); // const menu = (
|
7201
|
+
// <Menu>
|
7202
|
+
// {tableAction2.map((item: any, i: number) => {
|
7203
|
+
// let btn = actionConfig[item.type];
|
7204
|
+
// if (btn) {
|
7205
|
+
// return (
|
7206
|
+
// <Menu.Item key={i}>
|
7207
|
+
// <a
|
7208
|
+
// key={btn.key}
|
7209
|
+
// onClick={async e => {
|
7210
|
+
// e.stopPropagation();
|
7211
|
+
// let info = null;
|
7212
|
+
// if (item.fetchInfo) {
|
7213
|
+
// info = await item.fetchInfo(record);
|
7214
|
+
// }
|
7215
|
+
// actionHandler[item.type]?.(item, info || record, index);
|
7216
|
+
// }}
|
7217
|
+
// >
|
7218
|
+
// {btn.icon} {btn.title}
|
7219
|
+
// </a>
|
7220
|
+
// </Menu.Item>
|
7221
|
+
// );
|
7222
|
+
// }
|
7223
|
+
// return (
|
7224
|
+
// <Menu.Item key={i}>
|
7225
|
+
// {actionHandler[item.type]?.(item, record, index)}
|
7226
|
+
// </Menu.Item>
|
7227
|
+
// );
|
7228
|
+
// })}
|
7229
|
+
// </Menu>
|
7230
|
+
// );
|
7231
|
+
|
7232
|
+
var menu = {
|
7233
|
+
items: tableAction2.map(function (item, i) {
|
7234
|
+
var _actionHandler$item$t2;
|
7235
|
+
|
7236
|
+
var btn = actionConfig[item.type];
|
7237
|
+
|
7238
|
+
if (btn) {
|
7239
|
+
return {
|
7240
|
+
key: i,
|
7241
|
+
label: /*#__PURE__*/React.createElement("a", {
|
7242
|
+
key: btn.key,
|
7243
|
+
onClick: function () {
|
7244
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(e) {
|
7245
|
+
var _actionHandler$item$t;
|
7246
|
+
|
7247
|
+
var info;
|
7248
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
7249
|
+
while (1) {
|
7250
|
+
switch (_context5.prev = _context5.next) {
|
7251
|
+
case 0:
|
7252
|
+
e.stopPropagation();
|
7253
|
+
info = null;
|
7254
|
+
|
7255
|
+
if (!item.fetchInfo) {
|
7256
|
+
_context5.next = 6;
|
7257
|
+
break;
|
7258
|
+
}
|
7259
|
+
|
7260
|
+
_context5.next = 5;
|
7261
|
+
return item.fetchInfo(record);
|
7262
|
+
|
7263
|
+
case 5:
|
7264
|
+
info = _context5.sent;
|
7265
|
+
|
7266
|
+
case 6:
|
7267
|
+
(_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, info || record, index);
|
7268
|
+
|
7269
|
+
case 7:
|
7270
|
+
case "end":
|
7271
|
+
return _context5.stop();
|
7203
7272
|
}
|
7273
|
+
}
|
7274
|
+
}, _callee5);
|
7275
|
+
}));
|
7204
7276
|
|
7205
|
-
|
7206
|
-
|
7207
|
-
|
7208
|
-
case 5:
|
7209
|
-
info = _context5.sent;
|
7210
|
-
|
7211
|
-
case 6:
|
7212
|
-
(_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, info || record, index);
|
7213
|
-
|
7214
|
-
case 7:
|
7215
|
-
case "end":
|
7216
|
-
return _context5.stop();
|
7217
|
-
}
|
7277
|
+
function onClick(_x3) {
|
7278
|
+
return _onClick.apply(this, arguments);
|
7218
7279
|
}
|
7219
|
-
}, _callee5);
|
7220
|
-
}));
|
7221
|
-
|
7222
|
-
function onClick(_x3) {
|
7223
|
-
return _onClick.apply(this, arguments);
|
7224
|
-
}
|
7225
7280
|
|
7226
|
-
|
7227
|
-
|
7228
|
-
|
7229
|
-
|
7281
|
+
return onClick;
|
7282
|
+
}()
|
7283
|
+
}, btn.icon, " ", btn.title)
|
7284
|
+
};
|
7285
|
+
}
|
7230
7286
|
|
7231
|
-
|
7232
|
-
|
7233
|
-
|
7234
|
-
|
7287
|
+
return {
|
7288
|
+
key: i,
|
7289
|
+
label: (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index)
|
7290
|
+
};
|
7291
|
+
})
|
7292
|
+
};
|
7235
7293
|
return [].concat(_toConsumableArray(tableAction1.map(function (item, i) {
|
7236
7294
|
var _actionHandler$item$t4;
|
7237
7295
|
|
7238
7296
|
var btn = actionConfig[item.type];
|
7239
7297
|
|
7240
7298
|
if (btn) {
|
7241
|
-
return /*#__PURE__*/React.createElement(
|
7299
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
7242
7300
|
title: btn.title,
|
7243
7301
|
key: i
|
7244
7302
|
}, /*#__PURE__*/React.createElement("a", {
|
@@ -7289,8 +7347,8 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7289
7347
|
return /*#__PURE__*/React.createElement("span", {
|
7290
7348
|
key: i
|
7291
7349
|
}, (_actionHandler$item$t4 = actionHandler[item.type]) === null || _actionHandler$item$t4 === void 0 ? void 0 : _actionHandler$item$t4.call(actionHandler, item, record, index));
|
7292
|
-
})), [/*#__PURE__*/React.createElement(
|
7293
|
-
|
7350
|
+
})), [/*#__PURE__*/React.createElement(Dropdown, {
|
7351
|
+
menu: menu,
|
7294
7352
|
key: 'more'
|
7295
7353
|
}, /*#__PURE__*/React.createElement("a", {
|
7296
7354
|
key: "more"
|
@@ -7302,7 +7360,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7302
7360
|
var btn = actionConfig[item.type];
|
7303
7361
|
|
7304
7362
|
if (btn) {
|
7305
|
-
return /*#__PURE__*/React.createElement(
|
7363
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
7306
7364
|
title: btn.title,
|
7307
7365
|
key: i
|
7308
7366
|
}, /*#__PURE__*/React.createElement("a", {
|
@@ -7326,10 +7384,10 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7326
7384
|
var tableBarDom = useMemo(function () {
|
7327
7385
|
return renderTableBar === null || renderTableBar === void 0 ? void 0 : renderTableBar.map(function (item) {
|
7328
7386
|
if (item.type === 'add') {
|
7329
|
-
return /*#__PURE__*/React.createElement(
|
7387
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
7330
7388
|
title: "\u65B0\u589E",
|
7331
7389
|
key: "add"
|
7332
|
-
}, /*#__PURE__*/React.createElement(
|
7390
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
7333
7391
|
key: "add",
|
7334
7392
|
type: "primary",
|
7335
7393
|
onClick: function onClick() {
|
@@ -7418,14 +7476,14 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7418
7476
|
formSearchRef.current = obj;
|
7419
7477
|
}
|
7420
7478
|
}, [columns]);
|
7421
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
7479
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, open && /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
7422
7480
|
ref: modalFormRef,
|
7423
7481
|
title: modalFormConfig.type || '新增',
|
7424
|
-
|
7482
|
+
open: open,
|
7425
7483
|
record: modalFormConfig.record,
|
7426
7484
|
formItemChild: modalFormConfig.formItemChild,
|
7427
7485
|
disabled: modalFormConfig.type == '查看',
|
7428
|
-
|
7486
|
+
setOpen: setOpen,
|
7429
7487
|
submitMethod: function () {
|
7430
7488
|
var _submitMethod = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(values, loading) {
|
7431
7489
|
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
@@ -7636,12 +7694,13 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7636
7694
|
|
7637
7695
|
var index$4 = /*#__PURE__*/React.forwardRef(TabelCard);
|
7638
7696
|
|
7697
|
+
extend(localeData);
|
7639
7698
|
var YEAER_MONTH_FORMAT_EN = 'YYYY-MM';
|
7640
7699
|
|
7641
|
-
var
|
7642
|
-
|
7643
|
-
_ =
|
7644
|
-
rest =
|
7700
|
+
var _dayjs$weekdaysMin = weekdaysMin(),
|
7701
|
+
_dayjs$weekdaysMin2 = _toArray(_dayjs$weekdaysMin),
|
7702
|
+
_ = _dayjs$weekdaysMin2[0],
|
7703
|
+
rest = _dayjs$weekdaysMin2.slice(1); // 将星期天放置数组最后
|
7645
7704
|
|
7646
7705
|
|
7647
7706
|
var WEEk_HEADER = [].concat(_toConsumableArray(rest), [_]); // 日历布局为6 * 7单元格
|
@@ -7652,33 +7711,34 @@ var INIT_DAYS = Array(TOTAL_LENGTH).fill(0).map(function (_, index) {
|
|
7652
7711
|
return +index + 1;
|
7653
7712
|
});
|
7654
7713
|
|
7655
|
-
|
7714
|
+
dayjs.extend(weekday);
|
7715
|
+
dayjs.locale('zh-cn');
|
7656
7716
|
/**
|
7657
7717
|
* 获取当前月的天数
|
7658
7718
|
*/
|
7659
7719
|
|
7660
|
-
console.log(
|
7720
|
+
console.log(dayjs().format('YYYY-MM-DD'), 'dayjs()');
|
7661
7721
|
function getMonthDays(date) {
|
7662
|
-
return
|
7722
|
+
return dayjs(date).daysInMonth();
|
7663
7723
|
}
|
7664
7724
|
/**
|
7665
7725
|
* 获取当前月第一天是星期几
|
7666
7726
|
*/
|
7667
7727
|
|
7668
7728
|
function getWeekDays(date) {
|
7669
|
-
return
|
7729
|
+
return dayjs(date).startOf('month').weekday();
|
7670
7730
|
}
|
7671
7731
|
/**
|
7672
7732
|
* 获取当前星期第一天到星期天
|
7673
7733
|
*/
|
7674
7734
|
|
7675
7735
|
function getWeekList(date) {
|
7676
|
-
var weekOfDay = parseInt(
|
7677
|
-
// let last_monday =
|
7678
|
-
// let last_sunday =
|
7736
|
+
var weekOfDay = parseInt(dayjs(date).format('E')); //计算今天是这周第几天
|
7737
|
+
// let last_monday = dayjs().startOf('day').subtract(weekOfDay - 1, 'days').format('YYYY-MM-DD');//周一日期
|
7738
|
+
// let last_sunday = dayjs().startOf('day').subtract(weekOfDay - 7, 'days').format('YYYY-MM-DD');//周日日期
|
7679
7739
|
|
7680
7740
|
return ['时间'].concat(_toConsumableArray(new Array(7).fill('').map(function (item, index) {
|
7681
|
-
return
|
7741
|
+
return dayjs(date).startOf('day').subtract(weekOfDay - (index + 1), 'days').format('YYYY-MM-DD');
|
7682
7742
|
})));
|
7683
7743
|
}
|
7684
7744
|
/**
|
@@ -7686,7 +7746,7 @@ function getWeekList(date) {
|
|
7686
7746
|
*/
|
7687
7747
|
|
7688
7748
|
function getLastMonth(date) {
|
7689
|
-
return
|
7749
|
+
return dayjs(date).subtract(1, 'month').format(YEAER_MONTH_FORMAT_EN);
|
7690
7750
|
}
|
7691
7751
|
/**
|
7692
7752
|
* 格式化日期为两个单词,例如:‘1’号 格式为 ‘01’
|
@@ -7725,36 +7785,36 @@ function initCalendar(date) {
|
|
7725
7785
|
// 填充上个月的天数
|
7726
7786
|
if (i < currentWeekDay) {
|
7727
7787
|
// lastDays.push(totalDaysInLastMonth);
|
7728
|
-
var daySting =
|
7788
|
+
var daySting = dayjs(dayjs(date).subtract(1, 'month').format(YEAER_MONTH_FORMAT_EN) + '-' + totalDaysInLastMonth).format('YYYY-MM-DD');
|
7729
7789
|
lastDays.push({
|
7730
7790
|
date: daySting,
|
7731
7791
|
text: formatDayWithTwoWords(totalDaysInLastMonth),
|
7732
7792
|
isCurrentMonth: false,
|
7733
|
-
isCurrentDay:
|
7793
|
+
isCurrentDay: dayjs().format('YYYY-MM-DD') == daySting
|
7734
7794
|
});
|
7735
7795
|
totalDaysInLastMonth--;
|
7736
7796
|
} // 填充下个月的天数
|
7737
7797
|
else if (i >= totalDaysInMonth + currentWeekDay) {
|
7738
7798
|
// nextDays.push(nextFirstDate);
|
7739
|
-
var _daySting =
|
7799
|
+
var _daySting = dayjs(dayjs(date).add(1, 'month').format(YEAER_MONTH_FORMAT_EN) + '-' + nextFirstDate).format('YYYY-MM-DD');
|
7740
7800
|
|
7741
7801
|
nextDays.push({
|
7742
7802
|
date: _daySting,
|
7743
7803
|
text: formatDayWithTwoWords(nextFirstDate),
|
7744
7804
|
isCurrentMonth: false,
|
7745
|
-
isCurrentDay:
|
7805
|
+
isCurrentDay: dayjs().format('YYYY-MM-DD') == _daySting
|
7746
7806
|
});
|
7747
7807
|
nextFirstDate++;
|
7748
7808
|
} // 填充当前月天数
|
7749
7809
|
else {
|
7750
7810
|
// currentDays.push(i - currentWeekDay + 1);
|
7751
|
-
var _daySting2 =
|
7811
|
+
var _daySting2 = dayjs(dayjs(date).format(YEAER_MONTH_FORMAT_EN) + '-' + (i - currentWeekDay + 1)).format('YYYY-MM-DD');
|
7752
7812
|
|
7753
7813
|
currentDays.push({
|
7754
7814
|
date: _daySting2,
|
7755
7815
|
text: formatDayWithTwoWords(i - currentWeekDay + 1),
|
7756
7816
|
isCurrentMonth: true,
|
7757
|
-
isCurrentDay:
|
7817
|
+
isCurrentDay: dayjs().format('YYYY-MM-DD') == _daySting2
|
7758
7818
|
});
|
7759
7819
|
}
|
7760
7820
|
} // 上个月需要倒序显示
|
@@ -7769,7 +7829,7 @@ function initCalendar(date) {
|
|
7769
7829
|
function initWeekCalendar(type, date) {
|
7770
7830
|
var weekLength = type == 'week' ? 8 : 2;
|
7771
7831
|
var dayTime = ['08:00', '08:30', '09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30'];
|
7772
|
-
var weekOfDay = parseInt(
|
7832
|
+
var weekOfDay = parseInt(dayjs(date).format('E')); //计算今天是这周第几天
|
7773
7833
|
|
7774
7834
|
var days = [];
|
7775
7835
|
|
@@ -7782,7 +7842,7 @@ function initWeekCalendar(type, date) {
|
|
7782
7842
|
});
|
7783
7843
|
} else {
|
7784
7844
|
days.push({
|
7785
|
-
date: type == 'week' ?
|
7845
|
+
date: type == 'week' ? dayjs(date).startOf('day').subtract(weekOfDay - i % weekLength, 'days').format('YYYY-MM-DD') + " ".concat(dayTime[timeIndex]) : dayjs(date).format('YYYY-MM-DD') + " ".concat(dayTime[timeIndex])
|
7786
7846
|
});
|
7787
7847
|
}
|
7788
7848
|
}
|
@@ -7790,7 +7850,8 @@ function initWeekCalendar(type, date) {
|
|
7790
7850
|
return days;
|
7791
7851
|
}
|
7792
7852
|
|
7793
|
-
|
7853
|
+
dayjs.extend(weekOfYear);
|
7854
|
+
dayjs.locale('zh-cn');
|
7794
7855
|
|
7795
7856
|
function Calendar(_ref, ref) {
|
7796
7857
|
var value = _ref.value,
|
@@ -7809,7 +7870,7 @@ function Calendar(_ref, ref) {
|
|
7809
7870
|
days = _useState2[0],
|
7810
7871
|
setDays = _useState2[1];
|
7811
7872
|
|
7812
|
-
var _useState3 = useState(
|
7873
|
+
var _useState3 = useState(dayjs()),
|
7813
7874
|
_useState4 = _slicedToArray(_useState3, 2),
|
7814
7875
|
datevalue = _useState4[0],
|
7815
7876
|
setDatevalue = _useState4[1];
|
@@ -7822,7 +7883,7 @@ function Calendar(_ref, ref) {
|
|
7822
7883
|
var weekLabelArray = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
|
7823
7884
|
|
7824
7885
|
var getweekDay = function getweekDay(date) {
|
7825
|
-
var index =
|
7886
|
+
var index = dayjs(date).day();
|
7826
7887
|
|
7827
7888
|
if (index == 0) {
|
7828
7889
|
index = 7;
|
@@ -7845,7 +7906,7 @@ function Calendar(_ref, ref) {
|
|
7845
7906
|
}
|
7846
7907
|
}, [type, datevalue, dateString]);
|
7847
7908
|
useEffect(function () {
|
7848
|
-
setDatevalue(value ||
|
7909
|
+
setDatevalue(value || dayjs());
|
7849
7910
|
}, [value]);
|
7850
7911
|
useEffect(function () {
|
7851
7912
|
onChange && onChange(datevalue);
|
@@ -7854,18 +7915,18 @@ function Calendar(_ref, ref) {
|
|
7854
7915
|
var handleUp = function handleUp() {
|
7855
7916
|
if (type == 'day' || type == 'week') {
|
7856
7917
|
if (type == 'day') {
|
7857
|
-
var lastDay =
|
7918
|
+
var lastDay = dayjs(datevalue).subtract(1, 'days');
|
7858
7919
|
setOneWeekDays(['时间'].concat(_toConsumableArray(getweekDay(lastDay))));
|
7859
7920
|
setDays(initWeekCalendar(type, lastDay));
|
7860
7921
|
setDatevalue(lastDay);
|
7861
7922
|
} else {
|
7862
|
-
var lastWeek =
|
7923
|
+
var lastWeek = dayjs().week(dayjs(datevalue).week() - 1);
|
7863
7924
|
setOneWeekDays(getWeekList(lastWeek));
|
7864
7925
|
setDays(initWeekCalendar(type, lastWeek));
|
7865
7926
|
setDatevalue(lastWeek);
|
7866
7927
|
}
|
7867
7928
|
} else {
|
7868
|
-
var lastMonth =
|
7929
|
+
var lastMonth = dayjs(datevalue).subtract(1, 'month');
|
7869
7930
|
setDays(initCalendar(lastMonth));
|
7870
7931
|
setDatevalue(lastMonth);
|
7871
7932
|
}
|
@@ -7874,18 +7935,18 @@ function Calendar(_ref, ref) {
|
|
7874
7935
|
var handleDown = function handleDown() {
|
7875
7936
|
if (type == 'day' || type == 'week') {
|
7876
7937
|
if (type == 'day') {
|
7877
|
-
var lastDay =
|
7938
|
+
var lastDay = dayjs(datevalue).add(1, 'days');
|
7878
7939
|
setOneWeekDays(['时间'].concat(_toConsumableArray(getweekDay(lastDay))));
|
7879
7940
|
setDays(initWeekCalendar(type, lastDay));
|
7880
7941
|
setDatevalue(lastDay);
|
7881
7942
|
} else {
|
7882
|
-
var lastWeek =
|
7943
|
+
var lastWeek = dayjs().week(dayjs(datevalue).week() + 1);
|
7883
7944
|
setOneWeekDays(getWeekList(lastWeek));
|
7884
7945
|
setDays(initWeekCalendar(type, lastWeek));
|
7885
7946
|
setDatevalue(lastWeek);
|
7886
7947
|
}
|
7887
7948
|
} else {
|
7888
|
-
var lastMonth =
|
7949
|
+
var lastMonth = dayjs(datevalue).add(1, 'month');
|
7889
7950
|
setDays(initCalendar(lastMonth));
|
7890
7951
|
setDatevalue(lastMonth);
|
7891
7952
|
}
|
@@ -7905,15 +7966,15 @@ function Calendar(_ref, ref) {
|
|
7905
7966
|
});
|
7906
7967
|
return /*#__PURE__*/React.createElement("div", {
|
7907
7968
|
className: "content_container"
|
7908
|
-
}, /*#__PURE__*/React.createElement(
|
7969
|
+
}, /*#__PURE__*/React.createElement(ConfigProvider, {
|
7909
7970
|
locale: zhCN$1
|
7910
7971
|
}, !dateString && /*#__PURE__*/React.createElement("div", {
|
7911
7972
|
className: "toolbar_container"
|
7912
|
-
}, /*#__PURE__*/React.createElement(
|
7973
|
+
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
7913
7974
|
icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
|
7914
7975
|
type: "text",
|
7915
7976
|
onClick: handleUp
|
7916
|
-
}), type == 'day' ? /*#__PURE__*/React.createElement(
|
7977
|
+
}), type == 'day' ? /*#__PURE__*/React.createElement(DatePicker, {
|
7917
7978
|
allowClear: false,
|
7918
7979
|
value: datevalue,
|
7919
7980
|
onChange: function onChange(date) {
|
@@ -7924,20 +7985,20 @@ function Calendar(_ref, ref) {
|
|
7924
7985
|
style: {
|
7925
7986
|
width: '250px'
|
7926
7987
|
}
|
7927
|
-
}) : type == 'week' ? /*#__PURE__*/React.createElement(
|
7988
|
+
}) : type == 'week' ? /*#__PURE__*/React.createElement(DatePicker, {
|
7928
7989
|
allowClear: false,
|
7929
7990
|
value: datevalue,
|
7930
7991
|
style: {
|
7931
7992
|
width: '250px'
|
7932
7993
|
},
|
7933
|
-
format: "".concat(
|
7994
|
+
format: "".concat(dayjs(datevalue).startOf('week').format('YYYY-MM-DD'), " ~ ").concat(dayjs(datevalue).endOf('week').format('YYYY-MM-DD')),
|
7934
7995
|
picker: "week",
|
7935
7996
|
onChange: function onChange(date) {
|
7936
7997
|
setOneWeekDays(getWeekList(date));
|
7937
7998
|
setDays(initWeekCalendar(type, date));
|
7938
7999
|
setDatevalue(date);
|
7939
8000
|
}
|
7940
|
-
}) : /*#__PURE__*/React.createElement(
|
8001
|
+
}) : /*#__PURE__*/React.createElement(DatePicker, {
|
7941
8002
|
allowClear: false,
|
7942
8003
|
value: datevalue,
|
7943
8004
|
picker: "month",
|
@@ -7948,7 +8009,7 @@ function Calendar(_ref, ref) {
|
|
7948
8009
|
style: {
|
7949
8010
|
width: '250px'
|
7950
8011
|
}
|
7951
|
-
}), /*#__PURE__*/React.createElement(
|
8012
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
7952
8013
|
icon: /*#__PURE__*/React.createElement(RightOutlined, null),
|
7953
8014
|
type: "text",
|
7954
8015
|
onClick: handleDown
|
@@ -8334,6 +8395,9 @@ function VideoPlayer(_ref, ref) {
|
|
8334
8395
|
useEffect(function () {
|
8335
8396
|
setUrls(url);
|
8336
8397
|
}, [url]);
|
8398
|
+
useEffect(function () {
|
8399
|
+
setCurrentLayoutIndex(layoutIndex);
|
8400
|
+
}, [layoutIndex]);
|
8337
8401
|
var initPlayerIndex = allLayouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : allLayouts[layoutIndex || 0].span - 1;
|
8338
8402
|
|
8339
8403
|
var _useState5 = useState(initPlayerIndex),
|
@@ -8471,7 +8535,7 @@ function VideoPlayer(_ref, ref) {
|
|
8471
8535
|
setCurrentPlayerIndex(playerIndex);
|
8472
8536
|
setCurrentLayoutIndex(index);
|
8473
8537
|
}
|
8474
|
-
}, /*#__PURE__*/React.createElement(
|
8538
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
8475
8539
|
placement: "top",
|
8476
8540
|
title: item.title
|
8477
8541
|
}, item.icon || /*#__PURE__*/React.createElement(IconFont, {
|
@@ -8489,7 +8553,7 @@ var DEFAULT_PLAY_BACK_RATE = [0.5, 0.75, 1, 1.5, 2]; // 默认记忆提示文字
|
|
8489
8553
|
var DEFAULT_LAST_PLAY_TIME_DELAY = 5; // 默认音量大小
|
8490
8554
|
|
8491
8555
|
var DEFAULT_VOLUME = 0.6;
|
8492
|
-
var index$7 = (function (_ref) {
|
8556
|
+
var index$7 = /*#__PURE__*/forwardRef(function (_ref, playerRef) {
|
8493
8557
|
var id = _ref.id,
|
8494
8558
|
_ref$videoUrls = _ref.videoUrls,
|
8495
8559
|
videoUrls = _ref$videoUrls === void 0 ? [] : _ref$videoUrls,
|
@@ -8516,19 +8580,26 @@ var index$7 = (function (_ref) {
|
|
8516
8580
|
props = _objectWithoutProperties(_ref, _excluded$m);
|
8517
8581
|
|
8518
8582
|
var player = useRef();
|
8519
|
-
var currentPlayerIndex = useRef(0); // 内置的 index 状态管理
|
8520
8583
|
|
8521
|
-
var _useState = useState(
|
8584
|
+
var _useState = useState(true),
|
8522
8585
|
_useState2 = _slicedToArray(_useState, 2),
|
8523
|
-
|
8524
|
-
|
8525
|
-
|
8526
|
-
var
|
8527
|
-
|
8528
|
-
|
8529
|
-
|
8530
|
-
|
8531
|
-
|
8586
|
+
firstRender = _useState2[0],
|
8587
|
+
setFirstRender = _useState2[1];
|
8588
|
+
|
8589
|
+
var _useState3 = useState(false),
|
8590
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
8591
|
+
ready = _useState4[0],
|
8592
|
+
setReady = _useState4[1];
|
8593
|
+
|
8594
|
+
var currentPlayerIndex = useRef(0); // 内置的 index 状态管理
|
8595
|
+
|
8596
|
+
var _useState5 = useState(0),
|
8597
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
8598
|
+
videoIndex = _useState6[0],
|
8599
|
+
setVideoIndex = _useState6[1];
|
8600
|
+
|
8601
|
+
var currentIndex = parentIndex !== null && parentIndex !== void 0 ? parentIndex : videoIndex;
|
8602
|
+
var setCurrentIndex = setParentIndex !== null && setParentIndex !== void 0 ? setParentIndex : setVideoIndex;
|
8532
8603
|
var config = useRef(_objectSpread2({
|
8533
8604
|
url: videoUrls[0],
|
8534
8605
|
playbackRate: DEFAULT_PLAY_BACK_RATE,
|
@@ -8542,25 +8613,52 @@ var index$7 = (function (_ref) {
|
|
8542
8613
|
}, props));
|
8543
8614
|
/** 设置当前播放 index */
|
8544
8615
|
|
8545
|
-
var handleSetCurrentIndex = useCallback(function (
|
8616
|
+
var handleSetCurrentIndex = useCallback(function (_ref2) {
|
8617
|
+
var currentIdx = _ref2.currentIdx,
|
8618
|
+
videoUrls = _ref2.videoUrls;
|
8546
8619
|
var newIdx = currentIdx !== null && currentIdx !== void 0 ? currentIdx : currentPlayerIndex.current + 1;
|
8547
8620
|
|
8548
8621
|
if (newIdx >= videoUrls.length) {
|
8549
|
-
|
8550
|
-
// 允许循环则播放起始视频
|
8551
|
-
newIdx = 0;
|
8552
|
-
} else if (player.current && player.current.video) {
|
8553
|
-
// 不允许循环则进度条快进到最后
|
8554
|
-
player.current.currentTime = player.current.video.duration;
|
8555
|
-
return;
|
8556
|
-
}
|
8622
|
+
newIdx = 0;
|
8557
8623
|
}
|
8558
8624
|
|
8559
8625
|
setCurrentIndex(newIdx);
|
8560
|
-
}, [
|
8626
|
+
}, [setCurrentIndex]);
|
8627
|
+
/** 结束事件 */
|
8628
|
+
|
8629
|
+
var onEnd = useCallback(function (isLoop, videoUrls) {
|
8630
|
+
return function () {
|
8631
|
+
// 如果是循环或有其他视频未播放完,继续播放下一个
|
8632
|
+
if (isLoop || !isLoop && currentPlayerIndex.current < videoUrls.length - 1) {
|
8633
|
+
setTimeout(function () {
|
8634
|
+
var _player$current;
|
8635
|
+
|
8636
|
+
return (_player$current = player.current) === null || _player$current === void 0 ? void 0 : _player$current.play();
|
8637
|
+
});
|
8638
|
+
}
|
8639
|
+
|
8640
|
+
handleSetCurrentIndex({
|
8641
|
+
videoUrls: videoUrls
|
8642
|
+
});
|
8643
|
+
};
|
8644
|
+
}, [handleSetCurrentIndex]);
|
8645
|
+
/** 点击下一个事件 */
|
8646
|
+
|
8647
|
+
var onPlayNextBtnClick = useCallback(function (videoUrls) {
|
8648
|
+
return function () {
|
8649
|
+
if (player.current) {
|
8650
|
+
// 防止 next 按钮消失
|
8651
|
+
player.current.currentVideoIndex = videoUrls.length - 2;
|
8652
|
+
}
|
8653
|
+
|
8654
|
+
handleSetCurrentIndex({
|
8655
|
+
videoUrls: videoUrls
|
8656
|
+
});
|
8657
|
+
};
|
8658
|
+
}, [handleSetCurrentIndex]);
|
8561
8659
|
/** 播放下一个 */
|
8562
8660
|
|
8563
|
-
var handlePlayNext = useCallback(function (currentIdx) {
|
8661
|
+
var handlePlayNext = useCallback(function (currentIdx, isLoop) {
|
8564
8662
|
if (!player.current) {
|
8565
8663
|
return;
|
8566
8664
|
}
|
@@ -8574,7 +8672,7 @@ var index$7 = (function (_ref) {
|
|
8574
8672
|
// 防止 next 按钮消失
|
8575
8673
|
player.current.currentVideoIndex = -videoUrls.length;
|
8576
8674
|
}
|
8577
|
-
}, [videoUrls
|
8675
|
+
}, [videoUrls]);
|
8578
8676
|
/** 重置视频 */
|
8579
8677
|
|
8580
8678
|
var handleReset = useCallback(function () {
|
@@ -8601,36 +8699,36 @@ var index$7 = (function (_ref) {
|
|
8601
8699
|
return;
|
8602
8700
|
}
|
8603
8701
|
|
8604
|
-
handlePlayNext(currentIndex !== null && currentIndex !== void 0 ? currentIndex : currentPlayerIndex.current);
|
8605
|
-
}, [currentIndex, handlePlayNext, visible]);
|
8702
|
+
handlePlayNext(currentIndex !== null && currentIndex !== void 0 ? currentIndex : currentPlayerIndex.current, isLoop);
|
8703
|
+
}, [currentIndex, handlePlayNext, isLoop, visible]);
|
8606
8704
|
/** 播放器初始化并绑定事件 */
|
8607
8705
|
|
8608
8706
|
useEffect(function () {
|
8707
|
+
var _player$current4;
|
8708
|
+
|
8609
8709
|
if (!visible || isEmpty(videoUrls) || player.current) {
|
8610
8710
|
return;
|
8611
8711
|
}
|
8612
8712
|
|
8613
|
-
|
8614
|
-
|
8615
|
-
|
8616
|
-
|
8617
|
-
|
8618
|
-
|
8619
|
-
setTimeout(function () {
|
8620
|
-
var _player$current;
|
8713
|
+
var newConfig = _objectSpread2(_objectSpread2({}, config.current), {}, {
|
8714
|
+
muted: muted,
|
8715
|
+
volume: muted ? 0 : DEFAULT_VOLUME,
|
8716
|
+
autoplay: autoplay,
|
8717
|
+
videoInit: videoInit
|
8718
|
+
});
|
8621
8719
|
|
8622
|
-
|
8623
|
-
|
8624
|
-
} else {
|
8625
|
-
var _player$current2;
|
8720
|
+
setReady(false);
|
8721
|
+
setFirstRender(false); // @ts-ignore
|
8626
8722
|
|
8627
|
-
|
8628
|
-
|
8629
|
-
|
8723
|
+
player.current = new Player(newConfig);
|
8724
|
+
player.current.currentVideoIndex = -videoUrls.length;
|
8725
|
+
player.current.on('ended', onEnd(isLoop, videoUrls)); // 播放记忆缓存
|
8630
8726
|
|
8631
8727
|
if (enableMemory) {
|
8728
|
+
var _player$current2;
|
8729
|
+
|
8632
8730
|
var videoPlayedTimeObj = JSON.parse(localStorage.getItem('videoPlayedTime') || '{}');
|
8633
|
-
player.current.on('timeupdate', function () {
|
8731
|
+
(_player$current2 = player.current) === null || _player$current2 === void 0 ? void 0 : _player$current2.on('timeupdate', function () {
|
8634
8732
|
var _player$current3;
|
8635
8733
|
|
8636
8734
|
if (currentPlayerIndex.current === -1) {
|
@@ -8644,27 +8742,23 @@ var index$7 = (function (_ref) {
|
|
8644
8742
|
});
|
8645
8743
|
}
|
8646
8744
|
|
8647
|
-
player.current.on('playNextBtnClick',
|
8648
|
-
|
8649
|
-
// 防止 next 按钮消失
|
8650
|
-
player.current.currentVideoIndex = videoUrls.length - 2;
|
8651
|
-
}
|
8652
|
-
|
8653
|
-
handleSetCurrentIndex();
|
8654
|
-
});
|
8655
|
-
}, [autoplay, enableMemory, handleSetCurrentIndex, id, isLoop, videoUrls, videoUrls.length, visible]);
|
8745
|
+
(_player$current4 = player.current) === null || _player$current4 === void 0 ? void 0 : _player$current4.on('playNextBtnClick', onPlayNextBtnClick(videoUrls));
|
8746
|
+
}, [ready, autoplay, enableMemory, handleSetCurrentIndex, id, isLoop, videoUrls, videoUrls.length, visible, muted, videoInit, onEnd, onPlayNextBtnClick]);
|
8656
8747
|
/** 读取缓存的播放记忆并跳转 */
|
8657
8748
|
|
8658
8749
|
useEffect(function () {
|
8659
8750
|
if (enableMemory && visible) {
|
8660
8751
|
var _JSON$parse;
|
8661
8752
|
|
8662
|
-
var
|
8663
|
-
lastPlayTime =
|
8664
|
-
_videoIndex =
|
8753
|
+
var _ref3 = ((_JSON$parse = JSON.parse(localStorage.getItem('videoPlayedTime') || '{}')) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse[id]) || {},
|
8754
|
+
lastPlayTime = _ref3.lastPlayTime,
|
8755
|
+
_videoIndex = _ref3.videoIndex;
|
8665
8756
|
|
8666
8757
|
setTimeout(function () {
|
8667
|
-
handleSetCurrentIndex(
|
8758
|
+
handleSetCurrentIndex({
|
8759
|
+
currentIdx: _videoIndex,
|
8760
|
+
videoUrls: videoUrls
|
8761
|
+
});
|
8668
8762
|
setTimeout(function () {
|
8669
8763
|
if (player.current) {
|
8670
8764
|
player.current.currentTime = lastPlayTime;
|
@@ -8672,7 +8766,7 @@ var index$7 = (function (_ref) {
|
|
8672
8766
|
});
|
8673
8767
|
});
|
8674
8768
|
}
|
8675
|
-
}, [visible, enableMemory, handleSetCurrentIndex, id]);
|
8769
|
+
}, [visible, enableMemory, handleSetCurrentIndex, id, videoUrls]);
|
8676
8770
|
/** 加载清晰度配置 */
|
8677
8771
|
|
8678
8772
|
useEffect(function () {
|
@@ -8680,6 +8774,19 @@ var index$7 = (function (_ref) {
|
|
8680
8774
|
player.current.emit('resourceReady', definitionList[currentIndex]);
|
8681
8775
|
}
|
8682
8776
|
}, [currentIndex, definitionList]);
|
8777
|
+
useEffect(function () {
|
8778
|
+
var _player$current5, _player$current6, _player$current7;
|
8779
|
+
|
8780
|
+
if (firstRender) {
|
8781
|
+
return;
|
8782
|
+
}
|
8783
|
+
|
8784
|
+
(_player$current5 = player.current) === null || _player$current5 === void 0 ? void 0 : _player$current5.off('ended', onEnd(isLoop, videoUrls));
|
8785
|
+
(_player$current6 = player.current) === null || _player$current6 === void 0 ? void 0 : _player$current6.off('playNextBtnClick', onPlayNextBtnClick(videoUrls));
|
8786
|
+
(_player$current7 = player.current) === null || _player$current7 === void 0 ? void 0 : _player$current7.destroy();
|
8787
|
+
player.current = undefined;
|
8788
|
+
setReady(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
8789
|
+
}, [muted, isLoop, videoUrls, autoplay, videoInit, onEnd, onPlayNextBtnClick]);
|
8683
8790
|
var getRef = useCallback(function (ref) {
|
8684
8791
|
if (ref && visible) {
|
8685
8792
|
var newConfig = _objectSpread2(_objectSpread2({}, config.current), {}, {
|
@@ -8693,8 +8800,8 @@ var index$7 = (function (_ref) {
|
|
8693
8800
|
if (enableMemory) {
|
8694
8801
|
var _JSON$parse2;
|
8695
8802
|
|
8696
|
-
var
|
8697
|
-
lastPlayTime =
|
8803
|
+
var _ref4 = ((_JSON$parse2 = JSON.parse(localStorage.getItem('videoPlayedTime') || '{}')) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2[id]) || {},
|
8804
|
+
lastPlayTime = _ref4.lastPlayTime;
|
8698
8805
|
|
8699
8806
|
Object.assign(newConfig, {
|
8700
8807
|
lastPlayTime: lastPlayTime,
|
@@ -8704,7 +8811,15 @@ var index$7 = (function (_ref) {
|
|
8704
8811
|
|
8705
8812
|
config.current = newConfig;
|
8706
8813
|
}
|
8707
|
-
|
8814
|
+
|
8815
|
+
if (playerRef) {
|
8816
|
+
if (typeof playerRef === 'function') {
|
8817
|
+
playerRef(player.current);
|
8818
|
+
} else {
|
8819
|
+
playerRef.current = player.current;
|
8820
|
+
}
|
8821
|
+
}
|
8822
|
+
}, [visible, playerRef, videoUrls, enableMemory, id, lastPlayTimeHideDelay]);
|
8708
8823
|
return /*#__PURE__*/React.createElement("div", {
|
8709
8824
|
className: className,
|
8710
8825
|
ref: getRef,
|
@@ -8967,7 +9082,7 @@ function NtTable(_ref) {
|
|
8967
9082
|
if (c.showTitle) {
|
8968
9083
|
var _columnsFields$c$data;
|
8969
9084
|
|
8970
|
-
return /*#__PURE__*/React.createElement(
|
9085
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
8971
9086
|
key: c.dataIndex,
|
8972
9087
|
placement: "top",
|
8973
9088
|
title: record[c.dataIndex]
|
@@ -8993,7 +9108,7 @@ function NtTable(_ref) {
|
|
8993
9108
|
return item.value == record[c.dataIndex];
|
8994
9109
|
})) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex])));
|
8995
9110
|
} else {
|
8996
|
-
var _columnsFields$c$data2, _columnsFields$c$data3;
|
9111
|
+
var _columnsFields$c$data2, _columnsFields$c$data3, _columnsFields$c$data4, _columnsFields$c$data5;
|
8997
9112
|
|
8998
9113
|
return /*#__PURE__*/React.createElement("div", {
|
8999
9114
|
key: c.dataIndex,
|
@@ -9017,9 +9132,13 @@ function NtTable(_ref) {
|
|
9017
9132
|
}
|
9018
9133
|
}, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data2 = columnsFields[c.dataIndex].find(function (item) {
|
9019
9134
|
return item.value == record[c.dataIndex];
|
9020
|
-
})) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]) : c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data3 = columnsFields[c.dataIndex].find(function (item) {
|
9135
|
+
})) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]) : c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? ((_columnsFields$c$data3 = columnsFields[c.dataIndex].find(function (item) {
|
9021
9136
|
return item.value == record[c.dataIndex];
|
9022
|
-
})) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label
|
9137
|
+
})) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label) && ((_columnsFields$c$data4 = columnsFields[c.dataIndex].find(function (item) {
|
9138
|
+
return item.value == record[c.dataIndex];
|
9139
|
+
})) === null || _columnsFields$c$data4 === void 0 ? void 0 : _columnsFields$c$data4.label) !== 0 ? (_columnsFields$c$data5 = columnsFields[c.dataIndex].find(function (item) {
|
9140
|
+
return item.value == record[c.dataIndex];
|
9141
|
+
})) === null || _columnsFields$c$data5 === void 0 ? void 0 : _columnsFields$c$data5.label : '-' : record[c.dataIndex]);
|
9023
9142
|
}
|
9024
9143
|
}
|
9025
9144
|
});
|
@@ -9220,7 +9339,7 @@ function NtTable(_ref) {
|
|
9220
9339
|
setFormSearch({});
|
9221
9340
|
};
|
9222
9341
|
|
9223
|
-
return /*#__PURE__*/React.createElement(
|
9342
|
+
return /*#__PURE__*/React.createElement(Spin, {
|
9224
9343
|
spinning: loading
|
9225
9344
|
}, /*#__PURE__*/React.createElement("div", {
|
9226
9345
|
className: "form"
|
@@ -9311,7 +9430,7 @@ function NtTable(_ref) {
|
|
9311
9430
|
justifyContent: 'center',
|
9312
9431
|
alignItems: 'center'
|
9313
9432
|
}
|
9314
|
-
}, none || '暂无数据')))), _typeof(pagination) === 'object' && /*#__PURE__*/React.createElement(
|
9433
|
+
}, none || '暂无数据')))), _typeof(pagination) === 'object' && /*#__PURE__*/React.createElement(Pagination, _objectSpread2({
|
9315
9434
|
style: {
|
9316
9435
|
textAlign: 'right',
|
9317
9436
|
marginTop: '10px'
|
@@ -10106,7 +10225,7 @@ function WaterLevelCharts(config) {
|
|
10106
10225
|
/*
|
10107
10226
|
* @Author: lijin
|
10108
10227
|
* @Date: 2021-09-09 11:02:54
|
10109
|
-
* @LastEditTime: 2023-02-
|
10228
|
+
* @LastEditTime: 2023-02-21 14:29:33
|
10110
10229
|
* @LastEditors: lijin
|
10111
10230
|
* @Description:
|
10112
10231
|
* @FilePath: \wargerm\src\index.ts
|
@@ -10116,7 +10235,7 @@ console.log(REACT_APP_ENV, 'REACT_APP_ENV');
|
|
10116
10235
|
|
10117
10236
|
if (REACT_APP_ENV == 'development') {
|
10118
10237
|
var COLOR_ATTR_NAME = 'data-prefers-color';
|
10119
|
-
document.documentElement.setAttribute(COLOR_ATTR_NAME, '
|
10238
|
+
document.documentElement.setAttribute(COLOR_ATTR_NAME, 'nt');
|
10120
10239
|
}
|
10121
10240
|
|
10122
|
-
export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$5 as Calendar, index$3 as Card, WCascader as Cascader, Index$4 as Checkbox, Index$a as CountUp, Index$2 as DatePicker, DragBox, index as IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, index$2 as RequestRenderDom, Select, Index$c as Swiper, WSwitch as Switch, index$4 as TabelCard, index$1 as Table, Index$7 as TreeSelect, Upload, index$7 as Video, index$6 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, useStateWithCall, wTracing, create as whox, wmox };
|
10241
|
+
export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$5 as Calendar, index$3 as Card, WCascader as Cascader, Index$4 as Checkbox, Index$a as CountUp, Index$2 as DatePicker, DragBox, index as IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, index$2 as RequestRenderDom, Index$5 as Select, Index$c as Swiper, WSwitch as Switch, index$4 as TabelCard, index$1 as Table, Index$7 as TreeSelect, Upload, index$7 as Video, index$6 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, useStateWithCall, wTracing, create as whox, wmox };
|