@vtx/modals2 5.0.52 → 5.0.53
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/lib/_components/vm-custom/index.js +4 -2
- package/lib/vtx-cc-cp-modal/api.js +5 -5
- package/lib/vtx-cc-cp-modal/components/BaseInfo/AllWork.js +3 -2
- package/lib/vtx-cc-cp-modal/components/BaseInfo/index.js +4 -3
- package/lib/vtx-cc-cp-modal/components/Calendar/index.js +3 -2
- package/lib/vtx-cc-cp-modal/components/SyInfo/index.js +6 -2
- package/lib/vtx-cc-cp-modal/index.js +19 -5
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { getVtxToken } from '@vtx/utils';
|
|
2
2
|
import useSettings from "../../_hooks/useSettings";
|
|
3
3
|
import "./style/index.less";
|
|
4
|
+
import dayjs from 'dayjs';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
var VmCustom = function VmCustom(_ref) {
|
|
6
7
|
var id = _ref.id,
|
|
7
8
|
url = _ref.url;
|
|
8
9
|
var _useSettings = useSettings(),
|
|
9
|
-
theme = _useSettings.theme
|
|
10
|
+
theme = _useSettings.theme,
|
|
11
|
+
date = _useSettings.date;
|
|
10
12
|
var _getVtxToken = getVtxToken(),
|
|
11
13
|
token = _getVtxToken.token,
|
|
12
14
|
userId = _getVtxToken.userId,
|
|
13
15
|
tenantId = _getVtxToken.tenantId;
|
|
14
16
|
var param = (url === null || url === void 0 ? void 0 : url.indexOf('http')) > -1 ? "&userId=".concat(userId, "&tenantId=").concat(tenantId, "&token=").concat(token) : '';
|
|
15
17
|
return /*#__PURE__*/_jsx("iframe", {
|
|
16
|
-
src: "".concat(url).concat(id, "&theme=").concat(theme).concat(param),
|
|
18
|
+
src: "".concat(url).concat(id, "&theme=").concat(theme).concat(param, "&date=").concat(date ? dayjs(date).format('YYYY-MM-DD') : ''),
|
|
17
19
|
style: {
|
|
18
20
|
width: '100%',
|
|
19
21
|
height: 600,
|
|
@@ -124,11 +124,11 @@ export var BasicService = {
|
|
|
124
124
|
rows: []
|
|
125
125
|
};
|
|
126
126
|
},
|
|
127
|
-
useGetSyPointDaySummary: function useGetSyPointDaySummary(syPointId) {
|
|
127
|
+
useGetSyPointDaySummary: function useGetSyPointDaySummary(syPointId, date) {
|
|
128
128
|
var _useRequest6 = useRequest(function () {
|
|
129
129
|
return query("".concat(urlPrefix, "gisOnePage/getSyPointDaySummary"), {
|
|
130
130
|
syPointId: syPointId,
|
|
131
|
-
today: dayjs().format('YYYY-MM-DD')
|
|
131
|
+
today: dayjs(date).format('YYYY-MM-DD')
|
|
132
132
|
});
|
|
133
133
|
}, {
|
|
134
134
|
refreshDeps: [syPointId],
|
|
@@ -152,16 +152,16 @@ export var BasicService = {
|
|
|
152
152
|
data = _useRequest7.data;
|
|
153
153
|
return data;
|
|
154
154
|
},
|
|
155
|
-
useGetSyPointCollectLine: function useGetSyPointCollectLine(syPointId, startDay, endDay) {
|
|
155
|
+
useGetSyPointCollectLine: function useGetSyPointCollectLine(syPointId, startDay, endDay, garbageType) {
|
|
156
156
|
var _useRequest8 = useRequest(function () {
|
|
157
157
|
return query("".concat(urlPrefix, "gisOnePage/getSyPointCollectLine"), {
|
|
158
158
|
syPointId: syPointId,
|
|
159
159
|
startDay: startDay,
|
|
160
160
|
endDay: endDay,
|
|
161
|
-
garbageType: 'ccfqw'
|
|
161
|
+
garbageType: garbageType || 'ccfqw'
|
|
162
162
|
});
|
|
163
163
|
}, {
|
|
164
|
-
refreshDeps: [syPointId, startDay, endDay],
|
|
164
|
+
refreshDeps: [syPointId, startDay, endDay, garbageType],
|
|
165
165
|
ready: !!syPointId
|
|
166
166
|
}),
|
|
167
167
|
_useRequest8$data = _useRequest8.data,
|
|
@@ -15,8 +15,9 @@ var AllWork = function AllWork() {
|
|
|
15
15
|
var _useSettings = useSettings(),
|
|
16
16
|
isDark = _useSettings.isDark;
|
|
17
17
|
var _useContext = useContext(CcCpContext),
|
|
18
|
-
id = _useContext.id
|
|
19
|
-
|
|
18
|
+
id = _useContext.id,
|
|
19
|
+
date = _useContext.date;
|
|
20
|
+
var data = BasicService.useGetSyPointDaySummary(id, date);
|
|
20
21
|
var blockItem = function blockItem(title, value, unit) {
|
|
21
22
|
return /*#__PURE__*/_jsxs("div", {
|
|
22
23
|
className: "vtx-cc-cp-task-item-block-item",
|
|
@@ -12,7 +12,8 @@ import SyRecord from "./SyRecord";
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
var BaseInfo = function BaseInfo() {
|
|
14
14
|
var _useContext = useContext(CcCpContext),
|
|
15
|
-
id = _useContext.id
|
|
15
|
+
id = _useContext.id,
|
|
16
|
+
date = _useContext.date;
|
|
16
17
|
var data = BasicService.useInfo({
|
|
17
18
|
id: id
|
|
18
19
|
});
|
|
@@ -50,8 +51,8 @@ var BaseInfo = function BaseInfo() {
|
|
|
50
51
|
children: /*#__PURE__*/_jsx(VmWrapper, {
|
|
51
52
|
title: '收运明细',
|
|
52
53
|
children: /*#__PURE__*/_jsx(SyRecord, {
|
|
53
|
-
startTime: dayjs().format('YYYY-MM-DD'),
|
|
54
|
-
endTime: dayjs().format('YYYY-MM-DD'),
|
|
54
|
+
startTime: dayjs(date).format('YYYY-MM-DD'),
|
|
55
|
+
endTime: dayjs(date).format('YYYY-MM-DD'),
|
|
55
56
|
pagination: false
|
|
56
57
|
})
|
|
57
58
|
})
|
|
@@ -99,8 +99,9 @@ var CollectCalendar = function CollectCalendar() {
|
|
|
99
99
|
var _useSettings2 = useSettings(),
|
|
100
100
|
isDark = _useSettings2.isDark;
|
|
101
101
|
var _useContext = useContext(CcCpContext),
|
|
102
|
-
id = _useContext.id
|
|
103
|
-
|
|
102
|
+
id = _useContext.id,
|
|
103
|
+
defaultDate = _useContext.date;
|
|
104
|
+
var _useState3 = useState(defaultDate ? dayjs(defaultDate) : dayjs()),
|
|
104
105
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
105
106
|
date = _useState4[0],
|
|
106
107
|
setDate = _useState4[1];
|
|
@@ -7,15 +7,19 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { useSetState } from 'ahooks';
|
|
8
8
|
import { Col, Row } from 'antd';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
10
|
+
import { useContext } from 'react';
|
|
10
11
|
import { VmWrapper } from "../../../_components";
|
|
12
|
+
import { CcCpContext } from "../../index";
|
|
11
13
|
import SyRecord from "../BaseInfo/SyRecord";
|
|
12
14
|
import Ljcsl from "./Ljcsl";
|
|
13
15
|
import SummaryInfo from "./SummaryInfo";
|
|
14
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
17
|
var SyInfo = function SyInfo() {
|
|
18
|
+
var _useContext = useContext(CcCpContext),
|
|
19
|
+
defaultDate = _useContext.date;
|
|
16
20
|
var _useSetState = useSetState({
|
|
17
|
-
startDate: dayjs().subtract(1, 'week'),
|
|
18
|
-
endDate: dayjs()
|
|
21
|
+
startDate: defaultDate ? dayjs(defaultDate) : dayjs().subtract(1, 'week'),
|
|
22
|
+
endDate: defaultDate ? dayjs(defaultDate) : dayjs()
|
|
19
23
|
}),
|
|
20
24
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
21
25
|
date = _useSetState2[0],
|
|
@@ -18,6 +18,7 @@ import VtxCarModal from "../vtx-car-modal";
|
|
|
18
18
|
import VtxRestaurantModal from "../vtx-restaurant-modal";
|
|
19
19
|
import { AlarmInfo, BaseInfo, Calendar, ExceptionInfo, Restaurant, SyInfo } from "./components";
|
|
20
20
|
import "./style";
|
|
21
|
+
import { VmCustom } from "../_components";
|
|
21
22
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
23
|
var TABS_BASE = 'base';
|
|
23
24
|
var TABS_SY = 'sy';
|
|
@@ -37,10 +38,10 @@ var VtxCcCpModal = function VtxCcCpModal(props) {
|
|
|
37
38
|
_props$theme = props.theme,
|
|
38
39
|
theme = _props$theme === void 0 ? 'light' : _props$theme,
|
|
39
40
|
title = props.title,
|
|
40
|
-
_props$showOrder = props.showOrder,
|
|
41
|
-
showOrder = _props$showOrder === void 0 ? false : _props$showOrder,
|
|
42
41
|
_props$tabChose = props.tabChose,
|
|
43
|
-
tabChose = _props$tabChose === void 0 ? '' : _props$tabChose
|
|
42
|
+
tabChose = _props$tabChose === void 0 ? '' : _props$tabChose,
|
|
43
|
+
_props$date = props.date,
|
|
44
|
+
date = _props$date === void 0 ? dayjs().format('YYYY-MM-DD') : _props$date;
|
|
44
45
|
var _useState = useState({
|
|
45
46
|
visible: false,
|
|
46
47
|
id: '',
|
|
@@ -91,9 +92,21 @@ var VtxCcCpModal = function VtxCcCpModal(props) {
|
|
|
91
92
|
return {
|
|
92
93
|
id: id,
|
|
93
94
|
openCar: openCar,
|
|
94
|
-
openRestaurant: openRestaurant
|
|
95
|
+
openRestaurant: openRestaurant,
|
|
96
|
+
date: date
|
|
95
97
|
};
|
|
96
|
-
}, [id]);
|
|
98
|
+
}, [id, date]);
|
|
99
|
+
// 自定义页签可配置多个,包含custom即可
|
|
100
|
+
if (tabsData !== null && tabsData !== void 0 && tabsData.length) {
|
|
101
|
+
tabsData.forEach(function (ele) {
|
|
102
|
+
if (ele.url) {
|
|
103
|
+
tabContents[ele.key] = /*#__PURE__*/_jsx(VmCustom, {
|
|
104
|
+
id: id,
|
|
105
|
+
url: ele === null || ele === void 0 ? void 0 : ele.url
|
|
106
|
+
}, ele.key);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
97
110
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
98
111
|
children: [/*#__PURE__*/_jsx(Provider, {
|
|
99
112
|
value: value,
|
|
@@ -104,6 +117,7 @@ var VtxCcCpModal = function VtxCcCpModal(props) {
|
|
|
104
117
|
onCancel: onCancel,
|
|
105
118
|
tabs: tabsData,
|
|
106
119
|
tabChose: tabChose,
|
|
120
|
+
date: date,
|
|
107
121
|
contents: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, /*#__PURE__*/_jsx(BaseInfo, {})), TABS_RESTAURANT, /*#__PURE__*/_jsx(Restaurant, {})), TABS_SY, /*#__PURE__*/_jsx(SyInfo, {})), TABS_WARNNING, /*#__PURE__*/_jsx(AlarmInfo, {})), TABS_EXECEPTION, /*#__PURE__*/_jsx(ExceptionInfo, {})), TABS_CALENDAR, /*#__PURE__*/_jsx(Calendar, {}))
|
|
108
122
|
})
|
|
109
123
|
}), carModal.visible && /*#__PURE__*/_jsx(VtxCarModal, _objectSpread(_objectSpread({}, carModal), {}, {
|