@7365admin1/layer-common 3.0.22 → 3.0.23
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/CHANGELOG.md +6 -0
- package/components/DashboardMain.vue +981 -346
- package/components/Nfc/NFCPatrolReportMain.vue +48 -519
- package/components/Nfc/PatrolReport/DailyReportTab.vue +59 -0
- package/components/Nfc/PatrolReport/MonthlyReportTab.vue +59 -0
- package/components/Nfc/PatrolReport/PatrolActivityTable.vue +81 -0
- package/components/Nfc/PatrolReport/PatrolReportTab.vue +73 -0
- package/components/Nfc/PatrolReport/PatrolRouteSummary.vue +63 -0
- package/components/Nfc/PatrolReport/RemarksDialog.vue +37 -0
- package/components/Nfc/PatrolReport/ReportEmptyState.vue +24 -0
- package/components/Nfc/PatrolReport/ReportFilters.vue +88 -0
- package/components/Nfc/PatrolReport/ReportLocationHeader.vue +17 -0
- package/components/Nfc/PatrolReport/SummaryReportTable.vue +51 -0
- package/components/ServiceProviderMain.vue +182 -184
- package/components/VisitorManagement.vue +8 -0
- package/components/VisitorSocketPopUp.vue +10 -30
- package/composables/useNFCPatrolDailyReport.ts +27 -0
- package/composables/useNFCPatrolMonthlyReport.ts +27 -0
- package/composables/useNFCPatrolReport.ts +38 -0
- package/composables/useNFCPatrolReportExport.ts +31 -0
- package/composables/useNFCPatrolReportFilters.ts +39 -0
- package/package.json +1 -1
- package/services/nfcPatrolReport.ts +172 -0
- package/types/nfc-patrol-report.ts +73 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NFCPatrolReportExportRequest,
|
|
3
|
+
NFCPatrolReportFilters,
|
|
4
|
+
NFCPatrolReportTab,
|
|
5
|
+
} from "../types/nfc-patrol-report";
|
|
6
|
+
import { useNFCPatrolReportService } from "../services/nfcPatrolReport";
|
|
7
|
+
|
|
8
|
+
export function useNFCPatrolReportExport() {
|
|
9
|
+
const reportService = useNFCPatrolReportService();
|
|
10
|
+
const loading = ref(false);
|
|
11
|
+
|
|
12
|
+
async function exportReport(tab: NFCPatrolReportTab, filters: NFCPatrolReportFilters) {
|
|
13
|
+
loading.value = true;
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const request: NFCPatrolReportExportRequest = {
|
|
17
|
+
tab,
|
|
18
|
+
filters,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
await reportService.exportReport(request);
|
|
22
|
+
} finally {
|
|
23
|
+
loading.value = false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
loading,
|
|
29
|
+
exportReport,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NFCPatrolReportFilterOptions,
|
|
3
|
+
NFCPatrolReportFilters,
|
|
4
|
+
} from "../types/nfc-patrol-report";
|
|
5
|
+
import { useNFCPatrolReportService } from "../services/nfcPatrolReport";
|
|
6
|
+
|
|
7
|
+
export function useNFCPatrolReportFilters(site: string) {
|
|
8
|
+
const reportService = useNFCPatrolReportService();
|
|
9
|
+
|
|
10
|
+
const filters = reactive<NFCPatrolReportFilters>({
|
|
11
|
+
route: "WH01 Patrol Route",
|
|
12
|
+
timeRange: "15:00 - 17:00",
|
|
13
|
+
date: "2025-11-27",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const options = ref<NFCPatrolReportFilterOptions>({
|
|
17
|
+
routes: [],
|
|
18
|
+
timeRanges: [],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const loading = ref(false);
|
|
22
|
+
|
|
23
|
+
async function fetchOptions() {
|
|
24
|
+
loading.value = true;
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
options.value = await reportService.getFilterOptions(site);
|
|
28
|
+
} finally {
|
|
29
|
+
loading.value = false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
filters,
|
|
35
|
+
options,
|
|
36
|
+
loading,
|
|
37
|
+
fetchOptions,
|
|
38
|
+
};
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NFCPatrolReport,
|
|
3
|
+
NFCPatrolReportExportRequest,
|
|
4
|
+
NFCPatrolReportFilterOptions,
|
|
5
|
+
NFCPatrolReportFilters,
|
|
6
|
+
NFCPatrolSummaryReport,
|
|
7
|
+
} from "../types/nfc-patrol-report";
|
|
8
|
+
|
|
9
|
+
const filterOptions: NFCPatrolReportFilterOptions = {
|
|
10
|
+
routes: ["WH01 Patrol Route", "WH02 Patrol Route", "WH03 Patrol Route"],
|
|
11
|
+
timeRanges: ["15:00 - 17:00", "08:00 - 10:00", "13:00 - 15:00", "18:00 - 20:00"],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const location = {
|
|
15
|
+
name: "Winsland Homes",
|
|
16
|
+
address: "221A Upper Thomson Road THOMSON RIDGE ESTATE",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function useNFCPatrolReportService() {
|
|
20
|
+
async function getFilterOptions(_site: string): Promise<NFCPatrolReportFilterOptions> {
|
|
21
|
+
return filterOptions;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function getPatrolReport(filters: NFCPatrolReportFilters): Promise<NFCPatrolReport> {
|
|
25
|
+
return {
|
|
26
|
+
location,
|
|
27
|
+
routeSummary: {
|
|
28
|
+
routeName: filters.route,
|
|
29
|
+
tolerance: 30,
|
|
30
|
+
schedule: {
|
|
31
|
+
start: "14:00",
|
|
32
|
+
end: "15:00",
|
|
33
|
+
totalTime: "25 mins",
|
|
34
|
+
},
|
|
35
|
+
actual: {
|
|
36
|
+
start: "14:01",
|
|
37
|
+
end: "14:16",
|
|
38
|
+
totalTime: "15 mins",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
activities: [
|
|
42
|
+
{
|
|
43
|
+
id: "1",
|
|
44
|
+
checkpoint: "Point 1 WH01",
|
|
45
|
+
startTime: "14:01",
|
|
46
|
+
endTime: "14:04",
|
|
47
|
+
actualTime: "3:00 mins",
|
|
48
|
+
expectedTime: "5:00 mins",
|
|
49
|
+
status: "Skipped",
|
|
50
|
+
remarks: "Raining",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "2",
|
|
54
|
+
checkpoint: "Point 2 WH02",
|
|
55
|
+
startTime: "14:04",
|
|
56
|
+
endTime: "14:07",
|
|
57
|
+
actualTime: "3:00 mins",
|
|
58
|
+
expectedTime: "5:00 mins",
|
|
59
|
+
status: "Completed",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "3",
|
|
63
|
+
checkpoint: "Point 3 WH03",
|
|
64
|
+
startTime: "14:07",
|
|
65
|
+
endTime: "15:10",
|
|
66
|
+
actualTime: "3:00 mins",
|
|
67
|
+
expectedTime: "5:00 mins",
|
|
68
|
+
status: "Completed",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "4",
|
|
72
|
+
checkpoint: "Point 4 WH04",
|
|
73
|
+
startTime: "14:10",
|
|
74
|
+
endTime: "14:13",
|
|
75
|
+
actualTime: "3:00 mins",
|
|
76
|
+
expectedTime: "5:00 mins",
|
|
77
|
+
status: "Completed",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "5",
|
|
81
|
+
checkpoint: "Point 5 WH05",
|
|
82
|
+
startTime: "14:13",
|
|
83
|
+
endTime: "14:16",
|
|
84
|
+
actualTime: "3:00 mins",
|
|
85
|
+
expectedTime: "5:00 mins",
|
|
86
|
+
status: "Completed",
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function getDailyReport(
|
|
93
|
+
filters: NFCPatrolReportFilters,
|
|
94
|
+
): Promise<NFCPatrolSummaryReport> {
|
|
95
|
+
return getSummaryReport(`Patrol Route Summary: ${filters.route}`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function getMonthlyReport(
|
|
99
|
+
filters: NFCPatrolReportFilters,
|
|
100
|
+
): Promise<NFCPatrolSummaryReport> {
|
|
101
|
+
return getSummaryReport(`Patrol Route Summary: ${filters.route}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function exportReport(_request: NFCPatrolReportExportRequest): Promise<void> {
|
|
105
|
+
return Promise.resolve();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function getSummaryReport(title: string): NFCPatrolSummaryReport {
|
|
109
|
+
return {
|
|
110
|
+
location,
|
|
111
|
+
title,
|
|
112
|
+
rows: [
|
|
113
|
+
{
|
|
114
|
+
id: "1",
|
|
115
|
+
routeName: "1. WH01",
|
|
116
|
+
securityCheckSchedule: "14:00",
|
|
117
|
+
checked: 22,
|
|
118
|
+
missed: 0,
|
|
119
|
+
status: "Completed",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "2",
|
|
123
|
+
routeName: "2. WH01",
|
|
124
|
+
securityCheckSchedule: "15:00",
|
|
125
|
+
checked: 18,
|
|
126
|
+
missed: 3,
|
|
127
|
+
status: "Completed",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "3",
|
|
131
|
+
routeName: "3. WH01",
|
|
132
|
+
securityCheckSchedule: "16:00",
|
|
133
|
+
checked: 22,
|
|
134
|
+
missed: 0,
|
|
135
|
+
status: "Completed",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "4",
|
|
139
|
+
routeName: "4. WH01",
|
|
140
|
+
securityCheckSchedule: "17:00",
|
|
141
|
+
checked: 22,
|
|
142
|
+
missed: 0,
|
|
143
|
+
status: "Completed",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "5",
|
|
147
|
+
routeName: "5. WH01",
|
|
148
|
+
securityCheckSchedule: "18:00",
|
|
149
|
+
checked: 22,
|
|
150
|
+
missed: 0,
|
|
151
|
+
status: "Completed",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "6",
|
|
155
|
+
routeName: "6. WH01",
|
|
156
|
+
securityCheckSchedule: "19:00",
|
|
157
|
+
checked: 22,
|
|
158
|
+
missed: 0,
|
|
159
|
+
status: "Completed",
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return {
|
|
166
|
+
getFilterOptions,
|
|
167
|
+
getPatrolReport,
|
|
168
|
+
getDailyReport,
|
|
169
|
+
getMonthlyReport,
|
|
170
|
+
exportReport,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type NFCPatrolReportTab = "patrol" | "daily" | "monthly";
|
|
2
|
+
|
|
3
|
+
export type NFCPatrolActivityStatus = "Completed" | "Skipped";
|
|
4
|
+
|
|
5
|
+
export interface NFCPatrolReportFilters {
|
|
6
|
+
route: string;
|
|
7
|
+
timeRange: string;
|
|
8
|
+
date: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface NFCPatrolReportExportRequest {
|
|
12
|
+
tab: NFCPatrolReportTab;
|
|
13
|
+
filters: NFCPatrolReportFilters;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface NFCPatrolReportFilterOptions {
|
|
17
|
+
routes: string[];
|
|
18
|
+
timeRanges: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface NFCPatrolReportLocation {
|
|
22
|
+
name: string;
|
|
23
|
+
address: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface NFCPatrolRouteSummary {
|
|
27
|
+
routeName: string;
|
|
28
|
+
tolerance: number;
|
|
29
|
+
schedule: {
|
|
30
|
+
start: string;
|
|
31
|
+
end: string;
|
|
32
|
+
totalTime: string;
|
|
33
|
+
};
|
|
34
|
+
actual: {
|
|
35
|
+
start: string;
|
|
36
|
+
end: string;
|
|
37
|
+
totalTime: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface NFCPatrolActivity {
|
|
42
|
+
id: string;
|
|
43
|
+
checkpoint: string;
|
|
44
|
+
startTime: string;
|
|
45
|
+
endTime: string;
|
|
46
|
+
actualTime: string;
|
|
47
|
+
expectedTime: string;
|
|
48
|
+
status: NFCPatrolActivityStatus;
|
|
49
|
+
remarks?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface NFCPatrolReport {
|
|
53
|
+
location: NFCPatrolReportLocation;
|
|
54
|
+
routeSummary: NFCPatrolRouteSummary | null;
|
|
55
|
+
activities: NFCPatrolActivity[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type NFCPatrolReportSummaryStatus = "Completed" | "Incomplete";
|
|
59
|
+
|
|
60
|
+
export interface NFCPatrolReportSummaryRow {
|
|
61
|
+
id: string;
|
|
62
|
+
routeName: string;
|
|
63
|
+
securityCheckSchedule: string;
|
|
64
|
+
checked: number;
|
|
65
|
+
missed: number;
|
|
66
|
+
status: NFCPatrolReportSummaryStatus;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface NFCPatrolSummaryReport {
|
|
70
|
+
location: NFCPatrolReportLocation;
|
|
71
|
+
title: string;
|
|
72
|
+
rows: NFCPatrolReportSummaryRow[];
|
|
73
|
+
}
|