@vtx/modals2 6.0.0-beta.14 → 6.0.0-beta.16
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-theme-provider/index.js +2 -1
- package/lib/_hooks/useSettings.js +4 -2
- package/lib/_util/http.js +4 -3
- package/lib/vtx-base-modal/index.js +5 -2
- package/lib/vtx-car-modal/api.js +255 -163
- package/lib/vtx-car-modal/content/Ljzy/BaseInfo/index.js +9 -7
- package/lib/vtx-car-modal/content/Ljzy/StaticInfo/index.js +11 -11
- package/lib/vtx-car-modal/content/Ljzy/WorkRecord/Detail.js +6 -3
- package/lib/vtx-car-modal/content/Ljzy/WorkRecord/Summary.js +8 -6
- package/lib/vtx-car-modal/index.js +4 -1
- package/lib/vtx-road-modal/index.js +14 -1
- package/lib/vtx-tfd-modal/api.js +2 -2
- package/lib/vtx-wr-modal/index.js +9 -2
- package/package.json +1 -1
|
@@ -27,18 +27,20 @@ var BaseInfo = function BaseInfo() {
|
|
|
27
27
|
startDate = _useContext.startDate,
|
|
28
28
|
info = _useContext.info;
|
|
29
29
|
var _useSettings = useSettings(),
|
|
30
|
-
isDark = _useSettings.isDark
|
|
30
|
+
isDark = _useSettings.isDark,
|
|
31
|
+
zdReborn = _useSettings.zdReborn;
|
|
31
32
|
var _useState = useState(dayjs(startDate)),
|
|
32
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
33
34
|
date = _useState2[0],
|
|
34
35
|
setDate = _useState2[1];
|
|
35
|
-
var _LjzyService
|
|
36
|
+
var _LjzyService = LjzyService[zdReborn ? 'useGetCarSumByDateZdReborn' : 'useGetCarSumByDate']({
|
|
36
37
|
carCode: info === null || info === void 0 ? void 0 : info.carCode,
|
|
37
38
|
startDate: dayjs(date).subtract(6, 'day').format('YYYY-MM-DD'),
|
|
38
39
|
endDate: dayjs(date).format('YYYY-MM-DD')
|
|
39
40
|
}),
|
|
40
|
-
taskDaySummary = _LjzyService
|
|
41
|
-
loading = _LjzyService
|
|
41
|
+
taskDaySummary = _LjzyService.taskDaySummary,
|
|
42
|
+
loading = _LjzyService.loading;
|
|
43
|
+
var fieldKey = zdReborn ? 'carNum' : 'carNums';
|
|
42
44
|
var xAxis = _.map(taskDaySummary, 'date');
|
|
43
45
|
var todayInfo = _.last(taskDaySummary) || {};
|
|
44
46
|
var blueColor = '#1677FF';
|
|
@@ -82,7 +84,7 @@ var BaseInfo = function BaseInfo() {
|
|
|
82
84
|
name: translateLocaleText("t('vtxdfmodal.times')"),
|
|
83
85
|
unit: translateLocaleText("t('common.timesUnit')"),
|
|
84
86
|
img: isDark ? darkCarNumIcon : carNumIcon,
|
|
85
|
-
value: (todayInfo === null || todayInfo === void 0 ? void 0 : todayInfo
|
|
87
|
+
value: (todayInfo === null || todayInfo === void 0 ? void 0 : todayInfo[fieldKey]) || 0
|
|
86
88
|
}), /*#__PURE__*/_jsx("div", {
|
|
87
89
|
style: {
|
|
88
90
|
height: 45,
|
|
@@ -92,7 +94,7 @@ var BaseInfo = function BaseInfo() {
|
|
|
92
94
|
showLegend: false,
|
|
93
95
|
dataList: [{
|
|
94
96
|
name: translateLocaleText("t('vtxdfmodal.times')"),
|
|
95
|
-
data: _.map(taskDaySummary,
|
|
97
|
+
data: _.map(taskDaySummary, fieldKey),
|
|
96
98
|
color: transformRgb(blueColor, colorOpacity),
|
|
97
99
|
smooth: true,
|
|
98
100
|
symbol: 'none',
|
|
@@ -203,7 +205,7 @@ var BaseInfo = function BaseInfo() {
|
|
|
203
205
|
lineList: [{
|
|
204
206
|
name: translateLocaleText("t('vtxdfmodal.times')"),
|
|
205
207
|
data: _.map(taskDaySummary, function (item) {
|
|
206
|
-
return "\u2000".concat(item
|
|
208
|
+
return "\u2000".concat(item[fieldKey]);
|
|
207
209
|
}),
|
|
208
210
|
color: isDark ? '#13F97A' : '#0FB964',
|
|
209
211
|
yAxisIndex: 1
|
|
@@ -25,25 +25,25 @@ import { translateLocaleText } from "./../../../../hooks/useTranslation.js";
|
|
|
25
25
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
var StaticInfo = function StaticInfo() {
|
|
27
27
|
var _useSettings = useSettings(),
|
|
28
|
-
isDark = _useSettings.isDark
|
|
28
|
+
isDark = _useSettings.isDark,
|
|
29
|
+
zdReborn = _useSettings.zdReborn;
|
|
29
30
|
var _useState = useState('calendar'),
|
|
30
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
32
|
type = _useState2[0],
|
|
32
33
|
setType = _useState2[1];
|
|
33
34
|
var _useContext = useContext(CarContext),
|
|
34
|
-
id = _useContext.id,
|
|
35
35
|
info = _useContext.info;
|
|
36
36
|
var _useState3 = useState(dayjs()),
|
|
37
37
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
38
|
month = _useState4[0],
|
|
39
39
|
setMonth = _useState4[1];
|
|
40
|
-
var _LjzyService
|
|
40
|
+
var _LjzyService = LjzyService[zdReborn ? 'useGetCarSumByDateAndDisposeUnitZdReborn' : 'useGetCarSumByDateAndDisposeUnit']({
|
|
41
41
|
carCode: info === null || info === void 0 ? void 0 : info.carCode,
|
|
42
42
|
startDate: month.startOf('M').format('YYYY-MM-DD'),
|
|
43
43
|
endDate: dayjs().isSame(month, 'month') ? dayjs().format('YYYY-MM-DD') : month.endOf('M').format('YYYY-MM-DD')
|
|
44
44
|
}),
|
|
45
|
-
taskDaySummary = _LjzyService
|
|
46
|
-
loading = _LjzyService
|
|
45
|
+
taskDaySummary = _LjzyService.taskDaySummary,
|
|
46
|
+
loading = _LjzyService.loading;
|
|
47
47
|
var keyByDate = keyBy(taskDaySummary || [], 'date');
|
|
48
48
|
var carNumIcon = lightCarNumIcon;
|
|
49
49
|
var jclIcon = lightJclIcon;
|
|
@@ -51,6 +51,7 @@ var StaticInfo = function StaticInfo() {
|
|
|
51
51
|
carNumIcon = darkCarNumIcon;
|
|
52
52
|
jclIcon = darkJclIcon;
|
|
53
53
|
}
|
|
54
|
+
var fieldKey = zdReborn ? 'carNum' : 'carNums';
|
|
54
55
|
var columns = [{
|
|
55
56
|
title: translateLocaleText("t('vtxareamodal.date')"),
|
|
56
57
|
dataIndex: 'date',
|
|
@@ -69,8 +70,8 @@ var StaticInfo = function StaticInfo() {
|
|
|
69
70
|
}
|
|
70
71
|
}, {
|
|
71
72
|
title: translateLocaleText("t('vtxcarmodal.timesTimes')"),
|
|
72
|
-
dataIndex:
|
|
73
|
-
key:
|
|
73
|
+
dataIndex: fieldKey,
|
|
74
|
+
key: fieldKey,
|
|
74
75
|
align: 'right',
|
|
75
76
|
render: function render(text) {
|
|
76
77
|
return /*#__PURE__*/_jsx("span", {
|
|
@@ -98,13 +99,12 @@ var StaticInfo = function StaticInfo() {
|
|
|
98
99
|
if (!item) {
|
|
99
100
|
return null;
|
|
100
101
|
}
|
|
101
|
-
var netWeight = item.netWeight
|
|
102
|
-
carNums = item.carNums;
|
|
102
|
+
var netWeight = item.netWeight;
|
|
103
103
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
104
104
|
children: [/*#__PURE__*/_jsx(VmCalendarInner, {
|
|
105
105
|
type: "blue",
|
|
106
106
|
img: jclIcon,
|
|
107
|
-
value:
|
|
107
|
+
value: item === null || item === void 0 ? void 0 : item[fieldKey],
|
|
108
108
|
style: {
|
|
109
109
|
width: '139px',
|
|
110
110
|
justifyContent: 'space-between',
|
|
@@ -182,7 +182,7 @@ var StaticInfo = function StaticInfo() {
|
|
|
182
182
|
lineList: [{
|
|
183
183
|
name: translateLocaleText("t('vtxdfmodal.times')"),
|
|
184
184
|
data: _.map(taskDaySummary, function (item) {
|
|
185
|
-
return "\u2000".concat(item
|
|
185
|
+
return "\u2000".concat(item === null || item === void 0 ? void 0 : item[fieldKey]);
|
|
186
186
|
}),
|
|
187
187
|
color: isDark ? '#13F97A' : '#0FB964',
|
|
188
188
|
yAxisIndex: 1
|
|
@@ -13,6 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import { useSetState } from 'ahooks';
|
|
14
14
|
import { useContext } from 'react';
|
|
15
15
|
import { VmTable, VmWrapper } from "../../../../_components";
|
|
16
|
+
import useSettings from "../../../../_hooks/useSettings";
|
|
16
17
|
import { LjzyService } from "../../../api";
|
|
17
18
|
import { CarContext } from "../../../index";
|
|
18
19
|
import { translateLocaleText } from "./../../../../hooks/useTranslation.js";
|
|
@@ -22,6 +23,8 @@ var Detail = function Detail(_ref) {
|
|
|
22
23
|
endDate = _ref.endDate;
|
|
23
24
|
var _useContext = useContext(CarContext),
|
|
24
25
|
info = _useContext.info;
|
|
26
|
+
var _useSettings = useSettings(),
|
|
27
|
+
zdReborn = _useSettings.zdReborn;
|
|
25
28
|
var _useSetState = useSetState({
|
|
26
29
|
pagination: {
|
|
27
30
|
current: 1,
|
|
@@ -37,7 +40,7 @@ var Detail = function Detail(_ref) {
|
|
|
37
40
|
var pagination = state.pagination,
|
|
38
41
|
sort = state.sort,
|
|
39
42
|
order = state.order;
|
|
40
|
-
var _LjzyService
|
|
43
|
+
var _LjzyService = LjzyService[zdReborn ? 'useGetWorkDetailZdReborn' : 'useGetWorkDetail']({
|
|
41
44
|
startTime: "".concat(startDate, " 00:00:00"),
|
|
42
45
|
endTime: "".concat(endDate, " 23:59:59"),
|
|
43
46
|
carNo: info === null || info === void 0 ? void 0 : info.carCode,
|
|
@@ -45,8 +48,8 @@ var Detail = function Detail(_ref) {
|
|
|
45
48
|
sort: sort,
|
|
46
49
|
order: order
|
|
47
50
|
}),
|
|
48
|
-
workDetailData = _LjzyService
|
|
49
|
-
loading = _LjzyService
|
|
51
|
+
workDetailData = _LjzyService.workDetailData,
|
|
52
|
+
loading = _LjzyService.loading;
|
|
50
53
|
var records = {
|
|
51
54
|
total: (workDetailData === null || workDetailData === void 0 ? void 0 : workDetailData.total) || 0,
|
|
52
55
|
rows: (workDetailData === null || workDetailData === void 0 ? void 0 : workDetailData.rows) || []
|
|
@@ -16,18 +16,20 @@ var Summary = function Summary(_ref) {
|
|
|
16
16
|
var startDate = _ref.startDate,
|
|
17
17
|
endDate = _ref.endDate;
|
|
18
18
|
var _useSettings = useSettings(),
|
|
19
|
-
isDark = _useSettings.isDark
|
|
19
|
+
isDark = _useSettings.isDark,
|
|
20
|
+
zdReborn = _useSettings.zdReborn;
|
|
20
21
|
var _useContext = useContext(CarContext),
|
|
21
22
|
id = _useContext.id,
|
|
22
23
|
info = _useContext.info;
|
|
23
|
-
var _LjzyService
|
|
24
|
+
var _LjzyService = LjzyService[zdReborn ? 'useGetCarSumByDateZdReborn' : 'useGetCarSumByDate']({
|
|
24
25
|
carCode: info === null || info === void 0 ? void 0 : info.carCode,
|
|
25
26
|
startDate: startDate,
|
|
26
27
|
endDate: endDate
|
|
27
28
|
}),
|
|
28
|
-
taskDaySummary = _LjzyService
|
|
29
|
-
loading = _LjzyService
|
|
30
|
-
var
|
|
29
|
+
taskDaySummary = _LjzyService.taskDaySummary,
|
|
30
|
+
loading = _LjzyService.loading;
|
|
31
|
+
var fieldKey = zdReborn ? 'carNum' : 'carNums';
|
|
32
|
+
var totalCarNums = _.sumBy(taskDaySummary, fieldKey);
|
|
31
33
|
var dailyCompletePercent = _.sumBy(taskDaySummary, 'netWeight').toFixed(2);
|
|
32
34
|
var xAxis = _.map(taskDaySummary, 'date');
|
|
33
35
|
return /*#__PURE__*/_jsx(VmWrapper, {
|
|
@@ -47,7 +49,7 @@ var Summary = function Summary(_ref) {
|
|
|
47
49
|
}), /*#__PURE__*/_jsx(VmBarCharts, {
|
|
48
50
|
dataList: [{
|
|
49
51
|
name: translateLocaleText("t('vtxdfmodal.times')"),
|
|
50
|
-
data: _.map(taskDaySummary,
|
|
52
|
+
data: _.map(taskDaySummary, fieldKey)
|
|
51
53
|
}],
|
|
52
54
|
unit: translateLocaleText("t('common.timesUnit')"),
|
|
53
55
|
xAxis: xAxis,
|
|
@@ -131,7 +131,9 @@ var VtxCarModal = function VtxCarModal(props) {
|
|
|
131
131
|
_props$iframeUrl = props.iframeUrl,
|
|
132
132
|
iframeUrl = _props$iframeUrl === void 0 ? '' : _props$iframeUrl,
|
|
133
133
|
_props$width = props.width,
|
|
134
|
-
width = _props$width === void 0 ? null : _props$width
|
|
134
|
+
width = _props$width === void 0 ? null : _props$width,
|
|
135
|
+
_props$zdReborn = props.zdReborn,
|
|
136
|
+
zdReborn = _props$zdReborn === void 0 ? false : _props$zdReborn;
|
|
135
137
|
var _BaseService$useBaseI = BaseService.useBaseInfo(id),
|
|
136
138
|
detail = _BaseService$useBaseI.detail,
|
|
137
139
|
info = _BaseService$useBaseI.info;
|
|
@@ -345,6 +347,7 @@ var VtxCarModal = function VtxCarModal(props) {
|
|
|
345
347
|
endDate: endDate,
|
|
346
348
|
showCollect: showCollect,
|
|
347
349
|
frameParams: frameParams,
|
|
350
|
+
zdReborn: zdReborn,
|
|
348
351
|
iframeUrl: iframeUrl,
|
|
349
352
|
tagList: [{
|
|
350
353
|
color: 'blue',
|
|
@@ -13,6 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import { useSetState } from 'ahooks';
|
|
14
14
|
import { VmIframeModal } from "../_components";
|
|
15
15
|
import Appraisal from "../_components/vm-appraisal-info";
|
|
16
|
+
import VmCustom from "../_components/vm-custom";
|
|
16
17
|
import useGetConfig from "../_hooks/useGetConfig";
|
|
17
18
|
import VtxBaseModal from "../vtx-base-modal";
|
|
18
19
|
import { translateLocaleText } from "./../hooks/useTranslation.js";
|
|
@@ -51,8 +52,10 @@ var VtxRoadModal = function VtxRoadModal(props) {
|
|
|
51
52
|
title: translateLocaleText("t('vtxroadmodal.statisticalInformation')")
|
|
52
53
|
});
|
|
53
54
|
}
|
|
55
|
+
// 配置尚未返回或未配置页签时,沿用道路弹窗原有的默认页签。
|
|
54
56
|
var _useGetConfig = useGetConfig('tr', tabs),
|
|
55
57
|
tabsData = _useGetConfig.tabsData;
|
|
58
|
+
var tabsList = tabsData || [];
|
|
56
59
|
var _useSetState = useSetState({
|
|
57
60
|
src: '',
|
|
58
61
|
visible: false,
|
|
@@ -88,6 +91,16 @@ var VtxRoadModal = function VtxRoadModal(props) {
|
|
|
88
91
|
var contents = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, baseContent), TABS_STATIC, statisticalContent), TABS_CALENDAR, calendarContent), TABS_LANE_BASE, laneBaseContent), TABS_LANE_STATIC, laneStatisticalContent), TABS_LANE_CALENDAR, laneCalendarContent), TABS_APPRAISAL, /*#__PURE__*/_jsx(Appraisal, {
|
|
89
92
|
id: id
|
|
90
93
|
}));
|
|
94
|
+
|
|
95
|
+
// 自定义页签可配置多个。
|
|
96
|
+
tabsList.forEach(function (tab) {
|
|
97
|
+
if (tab.url) {
|
|
98
|
+
contents[tab.key] = /*#__PURE__*/_jsx(VmCustom, {
|
|
99
|
+
id: id,
|
|
100
|
+
url: tab.url
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
91
104
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
92
105
|
children: [visible && /*#__PURE__*/_jsx(VtxBaseModal, {
|
|
93
106
|
title: title,
|
|
@@ -96,7 +109,7 @@ var VtxRoadModal = function VtxRoadModal(props) {
|
|
|
96
109
|
theme: theme,
|
|
97
110
|
visible: visible,
|
|
98
111
|
onCancel: onCancel,
|
|
99
|
-
tabs:
|
|
112
|
+
tabs: tabsList,
|
|
100
113
|
tabChose: tabChose,
|
|
101
114
|
startDate: startDate,
|
|
102
115
|
endDate: endDate,
|
package/lib/vtx-tfd-modal/api.js
CHANGED
|
@@ -42,9 +42,9 @@ var BaseService = {
|
|
|
42
42
|
}, {
|
|
43
43
|
label: translateLocaleText("t('vtxtfdmodal.hours')"),
|
|
44
44
|
key: 'householdNum',
|
|
45
|
-
value: info
|
|
45
|
+
value: info !== null && info !== void 0 && info.timePeriods && _typeof(info.timePeriods) === 'object' ? (_info$timePeriods = info.timePeriods) === null || _info$timePeriods === void 0 || (_info$timePeriods = _info$timePeriods.map(function (ele) {
|
|
46
46
|
return "".concat(ele.startTime, "~").concat(ele.endTime);
|
|
47
|
-
})) === null || _info$timePeriods === void 0 ? void 0 : _info$timePeriods.join('、')
|
|
47
|
+
})) === null || _info$timePeriods === void 0 ? void 0 : _info$timePeriods.join('、') : info === null || info === void 0 ? void 0 : info.timePeriods
|
|
48
48
|
}, {
|
|
49
49
|
label: translateLocaleText("t('vtxtfdmodal.supervisor')"),
|
|
50
50
|
key: 'supervisorName',
|
|
@@ -17,6 +17,7 @@ import VmCustom from "../_components/vm-custom";
|
|
|
17
17
|
import VmRepairMaintain from "../_components/vm-repair-maintain";
|
|
18
18
|
import VmVideo, { insertVideoTab } from "../_components/vm-video";
|
|
19
19
|
import useGetChannels from "../_hooks/useGetChannels";
|
|
20
|
+
import useGetConfig from "../_hooks/useGetConfig";
|
|
20
21
|
import { CommonService } from "../_service";
|
|
21
22
|
import VtxBaseModal from "../vtx-base-modal";
|
|
22
23
|
import VtxDefaultModal from "../vtx-default-modal";
|
|
@@ -40,8 +41,12 @@ var smallPop = function smallPop(params) {
|
|
|
40
41
|
data: params
|
|
41
42
|
});
|
|
42
43
|
};
|
|
44
|
+
var tabs = [{
|
|
45
|
+
key: 'base',
|
|
46
|
+
title: translateLocaleText("t('vtxdefaultmodal.basicInformation')")
|
|
47
|
+
}];
|
|
43
48
|
export default (function (props) {
|
|
44
|
-
var
|
|
49
|
+
var _config$;
|
|
45
50
|
var visible = props.visible,
|
|
46
51
|
theme = props.theme,
|
|
47
52
|
title = props.title,
|
|
@@ -59,7 +64,9 @@ export default (function (props) {
|
|
|
59
64
|
setConfig = _useState4[1];
|
|
60
65
|
var _CommonService$useBas = CommonService.useBaseInfo(id),
|
|
61
66
|
info = _CommonService$useBas.info;
|
|
62
|
-
var
|
|
67
|
+
var _useGetConfig = useGetConfig(info === null || info === void 0 ? void 0 : info.typeCode, tabs),
|
|
68
|
+
tabsData = _useGetConfig.tabsData;
|
|
69
|
+
var _useGetChannels = useGetChannels("".concat((info === null || info === void 0 ? void 0 : info.typeCode) || 'wr', "_").concat(info === null || info === void 0 ? void 0 : info.code), !!(info !== null && info !== void 0 && info.code) && (tabsData === null || tabsData === void 0 ? void 0 : tabsData.findIndex(function (ele) {
|
|
63
70
|
return ele.key === 'video';
|
|
64
71
|
})) > -1),
|
|
65
72
|
channels = _useGetChannels.channels;
|