@vtx/modals2 5.0.37 → 5.0.38
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/vtx-staff-modal/api.js +4 -3
- package/lib/vtx-staff-modal/components/AlarmInfo/Charts.js +5 -3
- package/lib/vtx-staff-modal/components/AlarmInfo/List.js +40 -3
- package/lib/vtx-staff-modal/components/AlarmInfo/index.less +12 -0
- package/lib/vtx-staff-modal/components/Attendance/Record.js +27 -4
- package/package.json +1 -1
|
@@ -396,7 +396,7 @@ var AttendanceService = {
|
|
|
396
396
|
}) : []
|
|
397
397
|
};
|
|
398
398
|
},
|
|
399
|
-
useAttendRecord: function useAttendRecord(staffId, startTime, endTime, pageNo, service) {
|
|
399
|
+
useAttendRecord: function useAttendRecord(staffId, startTime, endTime, pageNo, service, shiftClockWay) {
|
|
400
400
|
var _useRequest17 = useRequest(function () {
|
|
401
401
|
return request.get("/cloud/".concat(service ? 'rygl' : 'zyry-reborn', "/api/v101/attendanceRecord"), {
|
|
402
402
|
data: {
|
|
@@ -404,11 +404,12 @@ var AttendanceService = {
|
|
|
404
404
|
startTime: startTime,
|
|
405
405
|
endTime: endTime,
|
|
406
406
|
pageNo: pageNo,
|
|
407
|
-
pageSize: 10
|
|
407
|
+
pageSize: 10,
|
|
408
|
+
shiftClockWay: shiftClockWay
|
|
408
409
|
}
|
|
409
410
|
});
|
|
410
411
|
}, {
|
|
411
|
-
refreshDeps: [staffId, startTime, endTime, pageNo]
|
|
412
|
+
refreshDeps: [staffId, startTime, endTime, pageNo, shiftClockWay]
|
|
412
413
|
}),
|
|
413
414
|
attendRecordRes = _useRequest17.data;
|
|
414
415
|
return {
|
|
@@ -16,6 +16,9 @@ var Charts = function Charts(_ref) {
|
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
+
var total = chartData === null || chartData === void 0 ? void 0 : chartData.reduce(function (acc, cur) {
|
|
20
|
+
return acc + cur.value;
|
|
21
|
+
}, 0);
|
|
19
22
|
return /*#__PURE__*/_jsxs("div", {
|
|
20
23
|
className: "staff-alarm-charts",
|
|
21
24
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -24,6 +27,8 @@ var Charts = function Charts(_ref) {
|
|
|
24
27
|
height: 216,
|
|
25
28
|
unit: "\u6B21",
|
|
26
29
|
name: "\u62A5\u8B66\u6B21\u6570",
|
|
30
|
+
subTitle: "\u603B\u6570(\u6B21)",
|
|
31
|
+
total: total,
|
|
27
32
|
innerRadius: ['50%', '65%'],
|
|
28
33
|
outerRadius: ['65%', '70%'],
|
|
29
34
|
dataList: (chartData === null || chartData === void 0 ? void 0 : chartData.filter(function (ele) {
|
|
@@ -35,9 +40,6 @@ var Charts = function Charts(_ref) {
|
|
|
35
40
|
var value = chartData.find(function (item) {
|
|
36
41
|
return item.name === name;
|
|
37
42
|
});
|
|
38
|
-
var total = chartData.reduce(function (acc, cur) {
|
|
39
|
-
return acc + cur.value;
|
|
40
|
-
}, 0);
|
|
41
43
|
if (value) {
|
|
42
44
|
return "\t\t".concat(name, "\t\t").concat(value.value, "\u6B21\t\t").concat((value.value / total * 100).toFixed(2), "%");
|
|
43
45
|
} else {
|
|
@@ -15,10 +15,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { useSetState } from 'ahooks';
|
|
18
|
+
import { Tag } from 'antd';
|
|
18
19
|
import { VmTable } from "../../../_components";
|
|
19
20
|
import { secondToFormatTime } from "../../../_util";
|
|
20
21
|
import { AlarmService } from "../../api";
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
23
|
var List = function List(props) {
|
|
23
24
|
var id = props.id,
|
|
24
25
|
startDate = props.startDate,
|
|
@@ -46,14 +47,50 @@ var List = function List(props) {
|
|
|
46
47
|
total: (alarmRecordRes === null || alarmRecordRes === void 0 ? void 0 : alarmRecordRes.total) || 0,
|
|
47
48
|
rows: (alarmRecordRes === null || alarmRecordRes === void 0 ? void 0 : alarmRecordRes.rows) || []
|
|
48
49
|
};
|
|
50
|
+
var getColor = function getColor(code) {
|
|
51
|
+
if ((code === null || code === void 0 ? void 0 : code.indexOf('脱岗')) > -1) {
|
|
52
|
+
return '#f00707';
|
|
53
|
+
} else if ((code === null || code === void 0 ? void 0 : code.indexOf('违规')) > -1) {
|
|
54
|
+
return '#961414';
|
|
55
|
+
} else if ((code === null || code === void 0 ? void 0 : code.indexOf('异常')) > -1) {
|
|
56
|
+
return '#c7292b';
|
|
57
|
+
}
|
|
58
|
+
return '#c44a4a';
|
|
59
|
+
};
|
|
60
|
+
var getColor2 = function getColor2(code) {
|
|
61
|
+
if ((code === null || code === void 0 ? void 0 : code.indexOf('一')) > -1) {
|
|
62
|
+
return '#f00707';
|
|
63
|
+
} else if ((code === null || code === void 0 ? void 0 : code.indexOf('二')) > -1) {
|
|
64
|
+
return '#f7c500';
|
|
65
|
+
} else if ((code === null || code === void 0 ? void 0 : code.indexOf('三')) > -1) {
|
|
66
|
+
return '#d3ec43';
|
|
67
|
+
}
|
|
68
|
+
return '#87972b';
|
|
69
|
+
};
|
|
49
70
|
var columns = [{
|
|
50
71
|
title: '报警类型',
|
|
51
72
|
dataIndex: 'alarmTypeName',
|
|
52
|
-
key: 'alarmTypeName'
|
|
73
|
+
key: 'alarmTypeName',
|
|
74
|
+
render: function render(text) {
|
|
75
|
+
return text ? /*#__PURE__*/_jsx(Tag, {
|
|
76
|
+
color: getColor(text),
|
|
77
|
+
children: text
|
|
78
|
+
}) : '--';
|
|
79
|
+
}
|
|
53
80
|
}, {
|
|
54
81
|
title: '报警等级',
|
|
55
82
|
dataIndex: 'alarmLevelName',
|
|
56
|
-
key: 'alarmLevelName'
|
|
83
|
+
key: 'alarmLevelName',
|
|
84
|
+
render: function render(text) {
|
|
85
|
+
return text ? /*#__PURE__*/_jsxs("div", {
|
|
86
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
87
|
+
className: 'staff-alarm-status',
|
|
88
|
+
style: {
|
|
89
|
+
backgroundColor: getColor2(text)
|
|
90
|
+
}
|
|
91
|
+
}), text]
|
|
92
|
+
}) : '--';
|
|
93
|
+
}
|
|
57
94
|
}, {
|
|
58
95
|
title: '报警开始时间',
|
|
59
96
|
dataIndex: 'startTime',
|
|
@@ -15,7 +15,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
15
15
|
*/
|
|
16
16
|
import { useSetState } from 'ahooks';
|
|
17
17
|
import dayjs from 'dayjs';
|
|
18
|
-
import { VmTable, VmWrapper } from "../../../_components";
|
|
18
|
+
import { VmExtraTab, VmTable, VmWrapper } from "../../../_components";
|
|
19
19
|
import { AttendanceService } from "../../api";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
export default function Record(props) {
|
|
@@ -24,6 +24,7 @@ export default function Record(props) {
|
|
|
24
24
|
var _useSetState = useSetState({
|
|
25
25
|
startDate: dayjs().startOf('M'),
|
|
26
26
|
endDate: dayjs(),
|
|
27
|
+
shiftClockWay: 'CLOCK_IN_OUT',
|
|
27
28
|
pagination: {
|
|
28
29
|
current: 1,
|
|
29
30
|
pageSize: 10,
|
|
@@ -35,8 +36,9 @@ export default function Record(props) {
|
|
|
35
36
|
setState = _useSetState2[1];
|
|
36
37
|
var pagination = state.pagination,
|
|
37
38
|
startDate = state.startDate,
|
|
38
|
-
endDate = state.endDate
|
|
39
|
-
|
|
39
|
+
endDate = state.endDate,
|
|
40
|
+
shiftClockWay = state.shiftClockWay;
|
|
41
|
+
var _AttendanceService$us = AttendanceService.useAttendRecord(id, "".concat(startDate.format('YYYY-MM-DD'), " 00:00:00"), "".concat(endDate.format('YYYY-MM-DD'), " 23:59:59"), pagination.current - 1, service, shiftClockWay),
|
|
40
42
|
attendRecordRes = _AttendanceService$us.attendRecordRes;
|
|
41
43
|
var records = {
|
|
42
44
|
total: (attendRecordRes === null || attendRecordRes === void 0 ? void 0 : attendRecordRes.total) || 0,
|
|
@@ -128,7 +130,8 @@ export default function Record(props) {
|
|
|
128
130
|
title: '用工类型',
|
|
129
131
|
dataIndex: 'workTypeName',
|
|
130
132
|
key: 'workTypeName',
|
|
131
|
-
width: 80
|
|
133
|
+
width: 80,
|
|
134
|
+
ellipsis: true
|
|
132
135
|
}];
|
|
133
136
|
var pageChange = function pageChange(page) {
|
|
134
137
|
setState({
|
|
@@ -163,6 +166,26 @@ export default function Record(props) {
|
|
|
163
166
|
filterChange: function filterChange(dates) {
|
|
164
167
|
return dates && handleDateChange(dates);
|
|
165
168
|
},
|
|
169
|
+
extra: service ? /*#__PURE__*/_jsx(VmExtraTab, {
|
|
170
|
+
data: [{
|
|
171
|
+
key: 'CLOCK_IN_OUT',
|
|
172
|
+
title: '上下班打卡'
|
|
173
|
+
}, {
|
|
174
|
+
key: 'SHIFT_CHECK_IN',
|
|
175
|
+
title: '班次内打卡'
|
|
176
|
+
}],
|
|
177
|
+
value: shiftClockWay,
|
|
178
|
+
onChange: function onChange(key) {
|
|
179
|
+
setState({
|
|
180
|
+
shiftClockWay: key,
|
|
181
|
+
pagination: {
|
|
182
|
+
current: 1,
|
|
183
|
+
pageSize: 10,
|
|
184
|
+
total: 0
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}) : null,
|
|
166
189
|
children: /*#__PURE__*/_jsx(VmTable, _objectSpread({
|
|
167
190
|
columns: columns,
|
|
168
191
|
rowKey: "id"
|