@7365admin1/layer-common 1.10.9 → 1.11.0
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 +12 -0
- package/components/AccessCardAddForm.vue +1 -1
- package/components/AccessCardAssignToUnitForm.vue +10 -13
- package/components/AccessCardQrTagging.vue +2 -2
- package/components/BulletinBoardManagement.vue +18 -8
- package/components/Chat/SkeletonLoader.vue +71 -0
- package/components/DashboardMain.vue +176 -0
- package/components/DeliveryCompany.vue +240 -0
- package/components/EntryPassInformation.vue +38 -8
- package/components/FeedbackMain.vue +4 -19
- package/components/FileInputWithList.vue +304 -0
- package/components/IncidentReport/Authorities.vue +189 -151
- package/components/IncidentReport/IncidentInformation.vue +28 -12
- package/components/IncidentReport/IncidentInformationDownload.vue +225 -0
- package/components/IncidentReport/affectedEntities.vue +13 -57
- package/components/Signature.vue +133 -0
- package/components/SiteSettings.vue +285 -0
- package/components/SlideCardGroup.vue +194 -0
- package/components/Tooltip/Info.vue +33 -0
- package/components/VisitorForm.vue +65 -3
- package/components/VisitorManagement.vue +23 -6
- package/composables/useAccessManagement.ts +44 -6
- package/composables/useBulletin.ts +8 -3
- package/composables/useBulletinBoardPermission.ts +48 -0
- package/composables/useCleaningPermission.ts +2 -0
- package/composables/useComment.ts +147 -0
- package/composables/useCommonPermission.ts +29 -1
- package/composables/useFeedback.ts +79 -29
- package/composables/useFile.ts +6 -0
- package/composables/usePDFDownload.ts +1 -1
- package/composables/useSiteSettings.ts +1 -1
- package/composables/useVisitor.ts +6 -5
- package/composables/useWorkOrder.ts +61 -26
- package/constants/app.ts +12 -0
- package/nuxt.config.ts +2 -0
- package/package.json +3 -1
- package/plugins/vue-draggable-next.client.ts +5 -0
- package/public/default-image.svg +4 -0
- package/public/placeholder-image.svg +6 -0
- package/types/comment.d.ts +38 -0
- package/types/dashboard.d.ts +12 -0
- package/types/feedback.d.ts +56 -20
- package/types/site.d.ts +2 -1
- package/types/work-order.d.ts +54 -18
- package/utils/data.ts +31 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
const { currentUser } = useLocalAuth();
|
|
2
|
+
export default function useComment() {
|
|
3
|
+
class MComment implements TCommentChat {
|
|
4
|
+
_id?: string;
|
|
5
|
+
comment: string;
|
|
6
|
+
attachments?: TAttachment[];
|
|
7
|
+
createdBy: string;
|
|
8
|
+
workOrder: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
createdByName?: string;
|
|
12
|
+
createdByType?: string;
|
|
13
|
+
feedback?: string;
|
|
14
|
+
justify?: string | undefined;
|
|
15
|
+
seenByNames: string;
|
|
16
|
+
|
|
17
|
+
constructor(comment: Partial<TCommentChat> = {}) {
|
|
18
|
+
this._id = comment._id || "";
|
|
19
|
+
this.comment = comment.comment || "";
|
|
20
|
+
this.attachments = comment.attachments || [];
|
|
21
|
+
this.workOrder = comment.workOrder || "";
|
|
22
|
+
this.createdAt = comment.createdAt
|
|
23
|
+
? comment.createdAt.toString()
|
|
24
|
+
: undefined;
|
|
25
|
+
this.updatedAt = comment.updatedAt || "";
|
|
26
|
+
this.createdBy = comment.createdBy || "";
|
|
27
|
+
this.createdByName = comment.createdByName || "";
|
|
28
|
+
this.createdByType = comment.createdByType || "";
|
|
29
|
+
this.justify = comment.justify || "";
|
|
30
|
+
this.feedback = comment.feedback || "";
|
|
31
|
+
this.seenByNames = comment.seenByNames ?? "";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const comment = useState("comment", () => new MComment());
|
|
36
|
+
const comments = useState("comments", (): TCommentChat[] => []);
|
|
37
|
+
const page = useState("commentPage", () => 1);
|
|
38
|
+
const itemsPerPage = useState("itemsPerPage", () => 2);
|
|
39
|
+
const search = useState("commentSearch", () => "");
|
|
40
|
+
const pageRange = useState("commentPageRange", () => "-- - -- of --");
|
|
41
|
+
const isCommentsLoaded = useState("isCommentsLoaded", () => false);
|
|
42
|
+
|
|
43
|
+
function addComment(payload: TCommentChat) {
|
|
44
|
+
delete payload._id;
|
|
45
|
+
return useNuxtApp().$api<{ value?: { message: string } }>(
|
|
46
|
+
"/api/comments/v1",
|
|
47
|
+
{
|
|
48
|
+
method: "POST",
|
|
49
|
+
body: payload,
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function getCommentById(id: string) {
|
|
55
|
+
return useNuxtApp().$api(`/api/auth/comments/id/${id}`, {
|
|
56
|
+
method: "GET",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setComment(data?: TCommentChat) {
|
|
61
|
+
comment.value = new MComment(data);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const isInviteValid = useState("isInviteValid", () => false);
|
|
65
|
+
|
|
66
|
+
function getCommentsByWorkOrder(id: string) {
|
|
67
|
+
return useNuxtApp().$api(`/api/comments/v1/work-order/${id}`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getCommentsByWorkOrderId(id: string) {
|
|
71
|
+
return useNuxtApp().$api(`/api/comments/v1/work-order/${id}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getCommentsByFeedBackId(id: string, type?: string) {
|
|
75
|
+
const commentFeedbackOrWOD =
|
|
76
|
+
type === "workOrder" ? "work-order" : "feedback";
|
|
77
|
+
return useNuxtApp().$api(`/api/comments/v1/${commentFeedbackOrWOD}/${id}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function setComments(id: string, type?: string) {
|
|
81
|
+
try {
|
|
82
|
+
isCommentsLoaded.value = true;
|
|
83
|
+
const _comments = (await getCommentsByFeedBackId(
|
|
84
|
+
id,
|
|
85
|
+
type
|
|
86
|
+
)) as TCommentPaginated;
|
|
87
|
+
|
|
88
|
+
let updateSeenIds: any = [];
|
|
89
|
+
|
|
90
|
+
comments.value = _comments.items
|
|
91
|
+
.map((comment: any) => {
|
|
92
|
+
if (comment.createdBy === currentUser.value._id) {
|
|
93
|
+
comment.justify = "end";
|
|
94
|
+
} else {
|
|
95
|
+
comment.justify = "start";
|
|
96
|
+
if (
|
|
97
|
+
((Array.isArray(comment.seenBy) &&
|
|
98
|
+
!comment.seenBy.includes(currentUser.value._id)) ||
|
|
99
|
+
!comment?.seenBy) &&
|
|
100
|
+
comment?._id
|
|
101
|
+
) {
|
|
102
|
+
updateSeenIds.push(comment._id);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return comment;
|
|
106
|
+
})
|
|
107
|
+
.sort(
|
|
108
|
+
(firstComment: any, secondComment: any) =>
|
|
109
|
+
new Date(firstComment.createdAt).getTime() -
|
|
110
|
+
new Date(secondComment.createdAt).getTime()
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
if (Array.isArray(updateSeenIds) && updateSeenIds.length > 0) {
|
|
114
|
+
const seenBy = await updateSeenBy(updateSeenIds, currentUser.value._id);
|
|
115
|
+
}
|
|
116
|
+
} catch (error) {
|
|
117
|
+
console.log("error :", error);
|
|
118
|
+
} finally {
|
|
119
|
+
isCommentsLoaded.value = false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function updateSeenBy(ids: string[], seenById: string) {
|
|
124
|
+
return useNuxtApp().$api(`/api/comments/v1/seen-by`, {
|
|
125
|
+
method: "PUT",
|
|
126
|
+
body: { seenById, ids },
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
comment,
|
|
132
|
+
comments,
|
|
133
|
+
page,
|
|
134
|
+
itemsPerPage,
|
|
135
|
+
pageRange,
|
|
136
|
+
addComment,
|
|
137
|
+
setComment,
|
|
138
|
+
search,
|
|
139
|
+
isCommentsLoaded,
|
|
140
|
+
isInviteValid,
|
|
141
|
+
setComments,
|
|
142
|
+
getCommentById,
|
|
143
|
+
getCommentsByWorkOrderId,
|
|
144
|
+
updateSeenBy,
|
|
145
|
+
getCommentsByFeedBackId,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
@@ -192,8 +192,35 @@ export function useCommonPermissions() {
|
|
|
192
192
|
description:
|
|
193
193
|
"Allows the user to remove a building unit from the system permanently.",
|
|
194
194
|
},
|
|
195
|
+
|
|
195
196
|
};
|
|
196
197
|
|
|
198
|
+
|
|
199
|
+
const bulletinBoardPermissions: Record<string, TPermission> = {
|
|
200
|
+
"add-bulletin-board": {
|
|
201
|
+
check: true,
|
|
202
|
+
description: "Allows the user to add a new bulletin board to the system.",
|
|
203
|
+
},
|
|
204
|
+
"see-all-bulletin-boards": {
|
|
205
|
+
check: true,
|
|
206
|
+
description: "Allows the user to view the list of all bulletin boards.",
|
|
207
|
+
},
|
|
208
|
+
"see-bulletin-board-details": {
|
|
209
|
+
check: true,
|
|
210
|
+
description:
|
|
211
|
+
"Allows the user to view the details of a specific bulletin board.",
|
|
212
|
+
},
|
|
213
|
+
"update-bulletin-board": {
|
|
214
|
+
check: true,
|
|
215
|
+
description: "Allows the user to update bulletin board details.",
|
|
216
|
+
},
|
|
217
|
+
"delete-bulletin-board": {
|
|
218
|
+
check: true,
|
|
219
|
+
description:
|
|
220
|
+
"Allows the user to remove a bulletin board from the system permanently.",
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
|
|
197
224
|
return {
|
|
198
225
|
invitationPermissions,
|
|
199
226
|
memberPermissions,
|
|
@@ -202,6 +229,7 @@ export function useCommonPermissions() {
|
|
|
202
229
|
workOrderPermissions,
|
|
203
230
|
visitorManagementPermissions,
|
|
204
231
|
buildingManagementPermissions,
|
|
205
|
-
buildingUnitManagementPermissions
|
|
232
|
+
buildingUnitManagementPermissions,
|
|
233
|
+
bulletinBoardPermissions,
|
|
206
234
|
};
|
|
207
235
|
}
|
|
@@ -1,36 +1,63 @@
|
|
|
1
1
|
export default function useFeedback() {
|
|
2
|
-
|
|
2
|
+
class MFeedback implements TFeedback {
|
|
3
|
+
_id?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
subject?: string;
|
|
6
|
+
service?: string;
|
|
7
|
+
provider?: string | null;
|
|
8
|
+
location: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
createdBy?: any;
|
|
11
|
+
createdByName?: string;
|
|
12
|
+
createdByEmail?: string;
|
|
13
|
+
attachments?: TAttachment[];
|
|
14
|
+
workOrders?: object[];
|
|
15
|
+
workOrder?: Record<string, any>;
|
|
16
|
+
organization: string;
|
|
17
|
+
site: string;
|
|
18
|
+
createdAt?: string | Date;
|
|
19
|
+
updatedAt?: string | Date;
|
|
20
|
+
app: string;
|
|
21
|
+
assignee?: string;
|
|
22
|
+
assigneeName?: string;
|
|
23
|
+
assigneeInfo?: Record<string, any>;
|
|
24
|
+
statusUpdates?: any[];
|
|
25
|
+
attachedIR?: Array<Record<string, any>>;
|
|
26
|
+
|
|
27
|
+
constructor(feedback: Partial<TFeedback> = {}) {
|
|
28
|
+
this._id = feedback._id || "";
|
|
29
|
+
this.description = feedback.description || "";
|
|
30
|
+
this.subject = feedback.subject || "";
|
|
31
|
+
this.service = feedback.service || "";
|
|
32
|
+
this.status = feedback.status || "";
|
|
33
|
+
this.createdBy = feedback.createdBy || {};
|
|
34
|
+
this.provider = feedback.provider || null;
|
|
35
|
+
this.location = feedback.location || "";
|
|
36
|
+
this.attachments = feedback.attachments || [];
|
|
37
|
+
this.workOrders = feedback.workOrders || [];
|
|
38
|
+
this.workOrder = feedback.workOrder ?? {};
|
|
39
|
+
this.organization = feedback.organization || "";
|
|
40
|
+
this.site = feedback.site || "";
|
|
41
|
+
this.createdAt = "";
|
|
42
|
+
this.updatedAt = "";
|
|
43
|
+
this.app = feedback.app || "";
|
|
44
|
+
this.assignee = feedback.assignee || "";
|
|
45
|
+
this.assigneeName = feedback.assigneeName || "";
|
|
46
|
+
this.assigneeInfo = feedback.assigneeInfo ?? {};
|
|
47
|
+
this.statusUpdates = feedback.statusUpdates ?? [];
|
|
48
|
+
this.attachedIR = feedback.attachedIR ?? [];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const feedback = useState("feedback", () => new MFeedback());
|
|
53
|
+
const feedbacks = useState("feedbacks", (): TFeedback[] => []);
|
|
3
54
|
const page = useState("page", () => 1);
|
|
4
55
|
const pages = useState("pages", () => 0);
|
|
5
56
|
const pageRange = useState("pageRange", () => "-- - -- of --");
|
|
6
57
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
_id: "",
|
|
11
|
-
attachments: [],
|
|
12
|
-
category: "",
|
|
13
|
-
categoryInfo: "",
|
|
14
|
-
subject: "",
|
|
15
|
-
location: "",
|
|
16
|
-
description: "",
|
|
17
|
-
createdBy: "",
|
|
18
|
-
createdAt: "",
|
|
19
|
-
updatedAt: "",
|
|
20
|
-
status: "pending",
|
|
21
|
-
metadata: {
|
|
22
|
-
serviceProvider: "",
|
|
23
|
-
assignee: "",
|
|
24
|
-
organization: "",
|
|
25
|
-
site: "",
|
|
26
|
-
name: "",
|
|
27
|
-
signature: "",
|
|
28
|
-
attachments: "",
|
|
29
|
-
completedAt: "",
|
|
30
|
-
},
|
|
31
|
-
workOrderNo: "",
|
|
32
|
-
})
|
|
33
|
-
);
|
|
58
|
+
function setFeedback(data?: TFeedback) {
|
|
59
|
+
feedback.value = data || new MFeedback();
|
|
60
|
+
}
|
|
34
61
|
|
|
35
62
|
const { currentUser } = useLocalAuth();
|
|
36
63
|
|
|
@@ -89,7 +116,7 @@ export default function useFeedback() {
|
|
|
89
116
|
});
|
|
90
117
|
}
|
|
91
118
|
|
|
92
|
-
function createFeedback(payload:
|
|
119
|
+
function createFeedback(payload: TFeedback) {
|
|
93
120
|
return useNuxtApp().$api<Record<string, any>>("/api/feedbacks2", {
|
|
94
121
|
method: "POST",
|
|
95
122
|
body: payload,
|
|
@@ -135,8 +162,29 @@ export default function useFeedback() {
|
|
|
135
162
|
);
|
|
136
163
|
}
|
|
137
164
|
|
|
165
|
+
function addFeedBackWorkOrder(payload: any) {
|
|
166
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
167
|
+
"/api/feedbacks2/create-work-order",
|
|
168
|
+
{
|
|
169
|
+
method: "POST",
|
|
170
|
+
body: payload,
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function updateStatusFeedback(payload: any) {
|
|
176
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
177
|
+
"/api/feedbacks2/status-update",
|
|
178
|
+
{
|
|
179
|
+
method: "POST",
|
|
180
|
+
body: payload,
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
138
185
|
return {
|
|
139
186
|
feedbacks,
|
|
187
|
+
setFeedback,
|
|
140
188
|
feedback,
|
|
141
189
|
page,
|
|
142
190
|
pages,
|
|
@@ -148,5 +196,7 @@ export default function useFeedback() {
|
|
|
148
196
|
deleteFeedback,
|
|
149
197
|
updateFeedbackServiceProvider,
|
|
150
198
|
updateStatusComplete,
|
|
199
|
+
addFeedBackWorkOrder,
|
|
200
|
+
updateStatusFeedback,
|
|
151
201
|
};
|
|
152
202
|
}
|
package/composables/useFile.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export default function useFile() {
|
|
2
2
|
const baseUrl = useRuntimeConfig().public.API_DO_STORAGE_ENDPOINT;
|
|
3
|
+
const baseUrlAnpr = useRuntimeConfig().public.API_DO_STORAGE_ENDPOINT_ANPR;
|
|
3
4
|
|
|
4
5
|
function addFile(file: File | null) {
|
|
5
6
|
if (!file) {
|
|
@@ -19,6 +20,10 @@ export default function useFile() {
|
|
|
19
20
|
return `${baseUrl}/${id}`;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
function getFileUrlAnpr(id: string) {
|
|
24
|
+
return `${baseUrlAnpr}/${id}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
async function urlToFile(url: string, filename: string): Promise<File> {
|
|
23
28
|
const response = await fetch(url);
|
|
24
29
|
const blob = await response.blob();
|
|
@@ -49,5 +54,6 @@ export default function useFile() {
|
|
|
49
54
|
urlToFile,
|
|
50
55
|
getFileUrl,
|
|
51
56
|
getFileById,
|
|
57
|
+
getFileUrlAnpr
|
|
52
58
|
};
|
|
53
59
|
}
|
|
@@ -11,7 +11,7 @@ export default function(){
|
|
|
11
11
|
const downloadUrl = window.URL.createObjectURL(res);
|
|
12
12
|
const a = document.createElement("a");
|
|
13
13
|
a.href = downloadUrl;
|
|
14
|
-
a.download =
|
|
14
|
+
a.download = title; // Specify the file name
|
|
15
15
|
document.body.appendChild(a);
|
|
16
16
|
a.click(); // Trigger the download
|
|
17
17
|
window.URL.revokeObjectURL(downloadUrl); // Clean up
|
|
@@ -38,7 +38,7 @@ export default function () {
|
|
|
38
38
|
}
|
|
39
39
|
async function updateSitebyId(
|
|
40
40
|
siteId: string,
|
|
41
|
-
payload: { field
|
|
41
|
+
payload: { field?: string; value?: number, deliveryCompanyList?: string[] }
|
|
42
42
|
) {
|
|
43
43
|
return await useNuxtApp().$api<Record<string, any>>(
|
|
44
44
|
`/api/sites/id/${siteId}`,
|
|
@@ -13,11 +13,11 @@ export default function () {
|
|
|
13
13
|
{ label: "Drop-Off", value: "drop-off" },
|
|
14
14
|
];
|
|
15
15
|
|
|
16
|
-
const typeFieldMap: Record<TVisitorType, (keyof TVisitorPayload)[]> = {
|
|
16
|
+
const typeFieldMap: Record<TVisitorType, (keyof TVisitorPayload | 'delivery-company')[]> = {
|
|
17
17
|
guest: ['name', 'nric', 'contact', 'block', 'plateNumber', 'level', 'unit' , 'unitName', 'remarks'],
|
|
18
18
|
contractor: ['contractorType', 'name', 'nric', 'company', 'contact', 'plateNumber', 'block', 'level', 'unit', 'unitName', 'remarks'],
|
|
19
19
|
'walk-in': ['name', 'company', 'nric', 'contact', 'block', 'level', 'unit' , 'unitName', 'remarks'],
|
|
20
|
-
delivery: ['attachments', 'name', 'deliveryType', 'company', 'nric', 'contact', 'plateNumber', 'block', 'level', 'unit' , 'unitName', 'remarks'],
|
|
20
|
+
delivery: ['attachments', 'name', 'deliveryType', 'delivery-company', 'nric', 'contact', 'plateNumber', 'block', 'level', 'unit' , 'unitName', 'remarks'],
|
|
21
21
|
'pick-up': ['plateNumber', 'block', 'remarks'],
|
|
22
22
|
'drop-off': ['plateNumber', 'block', 'remarks'],
|
|
23
23
|
}
|
|
@@ -33,7 +33,7 @@ export default function () {
|
|
|
33
33
|
type GetVisitorsParams = {
|
|
34
34
|
page?: number
|
|
35
35
|
limit?: number
|
|
36
|
-
|
|
36
|
+
order?: "asc" | "desc"
|
|
37
37
|
search?: string
|
|
38
38
|
org?: string
|
|
39
39
|
site?: string
|
|
@@ -48,7 +48,7 @@ export default function () {
|
|
|
48
48
|
async function getVisitors({
|
|
49
49
|
page = 1,
|
|
50
50
|
limit = 10,
|
|
51
|
-
|
|
51
|
+
order = "desc",
|
|
52
52
|
search = "",
|
|
53
53
|
org = "",
|
|
54
54
|
site = "",
|
|
@@ -75,7 +75,8 @@ export default function () {
|
|
|
75
75
|
type,
|
|
76
76
|
status,
|
|
77
77
|
checkedOut,
|
|
78
|
-
plateNumber
|
|
78
|
+
plateNumber,
|
|
79
|
+
order
|
|
79
80
|
},
|
|
80
81
|
}
|
|
81
82
|
);
|
|
@@ -1,34 +1,68 @@
|
|
|
1
1
|
export default function useWorkOrder() {
|
|
2
|
+
class MWorkOrder implements TWorkOrder {
|
|
3
|
+
_id?: string;
|
|
4
|
+
description: string;
|
|
5
|
+
service: string;
|
|
6
|
+
subject: string | null;
|
|
7
|
+
provider: string | null;
|
|
8
|
+
providerName?: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
assignee?: string | TUser;
|
|
11
|
+
assigneeName?: string;
|
|
12
|
+
attachments?: string[];
|
|
13
|
+
createdBy?: string | TUser;
|
|
14
|
+
createdByName?: string;
|
|
15
|
+
site: string;
|
|
16
|
+
organization: string;
|
|
17
|
+
location?: string;
|
|
18
|
+
comments?: TComment[];
|
|
19
|
+
createdAt?: string | Date;
|
|
20
|
+
updatedAt?: string | Date;
|
|
21
|
+
feedback?: string;
|
|
22
|
+
statusUpdates?: any[];
|
|
23
|
+
prefix?: string;
|
|
24
|
+
noOfDigits?: any;
|
|
25
|
+
number?: number;
|
|
26
|
+
version?: number;
|
|
27
|
+
isHighPriority?: boolean;
|
|
28
|
+
|
|
29
|
+
constructor(workOrder: Partial<TWorkOrder> = {}) {
|
|
30
|
+
this._id = workOrder._id || "";
|
|
31
|
+
this.description = workOrder.description || "";
|
|
32
|
+
this.service = workOrder.service || "";
|
|
33
|
+
this.subject = workOrder.subject || null;
|
|
34
|
+
this.provider = workOrder.provider || null;
|
|
35
|
+
this.providerName = workOrder.providerName || "";
|
|
36
|
+
this.status = workOrder.status || "";
|
|
37
|
+
this.assignee = workOrder.assignee;
|
|
38
|
+
this.attachments = workOrder.attachments || [];
|
|
39
|
+
this.createdBy = workOrder.createdBy || "";
|
|
40
|
+
this.createdByName = workOrder.createdByName;
|
|
41
|
+
this.site = workOrder.site || "";
|
|
42
|
+
this.organization = workOrder.organization || "";
|
|
43
|
+
this.location = workOrder.location || "";
|
|
44
|
+
this.assigneeName = workOrder.assigneeName || "";
|
|
45
|
+
this.comments = workOrder.comments || [];
|
|
46
|
+
this.createdAt = "";
|
|
47
|
+
this.updatedAt = "";
|
|
48
|
+
this.feedback = workOrder.feedback || "";
|
|
49
|
+
this.prefix = workOrder.prefix || "";
|
|
50
|
+
this.noOfDigits = workOrder.noOfDigits || 1;
|
|
51
|
+
this.number = workOrder.number || 1;
|
|
52
|
+
this.version = workOrder.version || 0;
|
|
53
|
+
this.isHighPriority = workOrder.isHighPriority || false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const workOrder = useState("workOrder", () => new MWorkOrder());
|
|
2
58
|
const workOrders = useState<Array<TWorkOrder>>("workOrders", () => []);
|
|
3
59
|
const page = useState("page", () => 1);
|
|
4
60
|
const pages = useState("pages", () => 0);
|
|
5
61
|
const pageRange = useState("pageRange", () => "-- - -- of --");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
subject: "",
|
|
11
|
-
description: "",
|
|
12
|
-
createdBy: "",
|
|
13
|
-
service: "",
|
|
14
|
-
provider: "",
|
|
15
|
-
organization: "",
|
|
16
|
-
site: "",
|
|
17
|
-
createdByName: "",
|
|
18
|
-
assignee: "",
|
|
19
|
-
location: "",
|
|
20
|
-
attachments: [],
|
|
21
|
-
feedback: "",
|
|
22
|
-
status: "",
|
|
23
|
-
createdAt: "",
|
|
24
|
-
updatedAt: "",
|
|
25
|
-
deletedAt: "",
|
|
26
|
-
highPriority: false,
|
|
27
|
-
block: "",
|
|
28
|
-
level: "",
|
|
29
|
-
unit: "",
|
|
30
|
-
serviceProvider: "",
|
|
31
|
-
}));
|
|
62
|
+
|
|
63
|
+
function setWorkOrder(data?: TWorkOrder) {
|
|
64
|
+
workOrder.value = data || new MWorkOrder();
|
|
65
|
+
}
|
|
32
66
|
|
|
33
67
|
async function getWorkOrders({
|
|
34
68
|
page = 1,
|
|
@@ -100,6 +134,7 @@ export default function useWorkOrder() {
|
|
|
100
134
|
|
|
101
135
|
return {
|
|
102
136
|
workOrders,
|
|
137
|
+
setWorkOrder,
|
|
103
138
|
workOrder,
|
|
104
139
|
page,
|
|
105
140
|
pages,
|
package/constants/app.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const APP_CONSTANTS = {
|
|
2
|
+
PROPERTY_MANAGEMENT: "property_management_agency",
|
|
3
|
+
HYGIENE: "cleaning_services",
|
|
4
|
+
SECURITY: "security_agency",
|
|
5
|
+
MECHANICAL_ELECTRICAL: "mechanical_electrical",
|
|
6
|
+
RESIDENT: "resident",
|
|
7
|
+
LANDSCAPING: "landscaping_services",
|
|
8
|
+
PEST_CONTROL: "pest_control_services",
|
|
9
|
+
POOL_MAINTENANCE: "pool_maintenance_services"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
}
|
package/nuxt.config.ts
CHANGED
|
@@ -17,6 +17,8 @@ export default defineNuxtConfig({
|
|
|
17
17
|
APP: (process.env.APP as string) ?? "App",
|
|
18
18
|
API_DO_STORAGE_ENDPOINT:
|
|
19
19
|
(process.env.API_DO_STORAGE_ENDPOINT as string) ?? "",
|
|
20
|
+
API_DO_STORAGE_ENDPOINT_ANPR:
|
|
21
|
+
(process.env.API_DO_STORAGE_ENDPOINT_ANPR as string) ?? "",
|
|
20
22
|
APP_NAME: (process.env.APP_NAME as string) ?? "App",
|
|
21
23
|
APP_NAME_ROUTE: (process.env.APP_NAME_ROUTE as string) ?? "index",
|
|
22
24
|
APP_MAIN: (process.env.APP_MAIN as string) ?? "",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.11.0",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"publishConfig": {
|
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
"ckeditor5": "^47.2.0",
|
|
36
36
|
"html2pdf.js": "^0.10.2",
|
|
37
37
|
"moment-timezone": "^0.6.0",
|
|
38
|
+
"nuxt-signature-pad": "^1.8.0",
|
|
38
39
|
"qrcode": "^1.5.4",
|
|
39
40
|
"qrcode.vue": "^3.4.1",
|
|
40
41
|
"sass": "^1.80.6",
|
|
42
|
+
"vue-draggable-next": "^2.3.0",
|
|
41
43
|
"vue3-signature": "^0.2.4",
|
|
42
44
|
"zod": "^3.24.2"
|
|
43
45
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="500" height="500" fill="#E0E0E0"/>
|
|
3
|
+
<path d="M225.438 260.812L242.625 281.438L266.688 250.5L297.625 291.75H201.375L225.438 260.812ZM311.375 298.625V202.375C311.375 198.728 309.926 195.231 307.348 192.652C304.769 190.074 301.272 188.625 297.625 188.625H201.375C197.728 188.625 194.231 190.074 191.652 192.652C189.074 195.231 187.625 198.728 187.625 202.375V298.625C187.625 302.272 189.074 305.769 191.652 308.348C194.231 310.926 197.728 312.375 201.375 312.375H297.625C301.272 312.375 304.769 310.926 307.348 308.348C309.926 305.769 311.375 302.272 311.375 298.625Z" fill="black" fill-opacity="0.54"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="421" height="256" viewBox="0 0 421 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="0.5" width="420" height="256" rx="8" fill="#FAFAFA"/>
|
|
3
|
+
<rect x="1" y="0.5" width="419" height="255" rx="7.5" stroke="#B9B8C0" stroke-opacity="0.2"/>
|
|
4
|
+
<rect width="64" height="64" transform="translate(178.5 96)" fill="#FAFAFA"/>
|
|
5
|
+
<path d="M201.167 132L207.833 140L217.167 128L229.167 144H191.833L201.167 132ZM234.5 146.667V109.333C234.5 106.373 232.1 104 229.167 104H191.833C190.419 104 189.062 104.562 188.062 105.562C187.062 106.562 186.5 107.919 186.5 109.333V146.667C186.5 148.081 187.062 149.438 188.062 150.438C189.062 151.438 190.419 152 191.833 152H229.167C230.581 152 231.938 151.438 232.938 150.438C233.938 149.438 234.5 148.081 234.5 146.667Z" fill="#969696" fill-opacity="0.5"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare type TCommentChat = {
|
|
2
|
+
seenByNames: string;
|
|
3
|
+
_id?: string;
|
|
4
|
+
comment: string;
|
|
5
|
+
attachments?: TAttachment[];
|
|
6
|
+
createdBy: string;
|
|
7
|
+
workOrder: string;
|
|
8
|
+
createdAt?: string | Date;
|
|
9
|
+
updatedAt?: string;
|
|
10
|
+
createdByName?: string;
|
|
11
|
+
createdByType?: string;
|
|
12
|
+
justify?: string;
|
|
13
|
+
feedback?: string;
|
|
14
|
+
seenByNames: Person;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare type TCommentResponse = {
|
|
18
|
+
items: TCommentChat[];
|
|
19
|
+
pageRange: string;
|
|
20
|
+
pages: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare type TCommentPaginated = {
|
|
24
|
+
items: TCommentChat[];
|
|
25
|
+
pageRange: string;
|
|
26
|
+
pages: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
declare type TAttachment = {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
// other properties of the attachment, if any
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
declare type Person = {
|
|
36
|
+
givenName: string;
|
|
37
|
+
surname: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare type TDashboardValues = "today" | "thisWeek" | "thisMonth";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
declare type TPeriodState = Record<string, TDashboardValues>
|
|
5
|
+
|
|
6
|
+
declare type TDashboardCardValue = {
|
|
7
|
+
key: string;
|
|
8
|
+
periodKey: keyof TPeriodState;
|
|
9
|
+
title: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
color: string;
|
|
12
|
+
};
|