@7365admin1/layer-common 1.11.34 → 1.11.36
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
CHANGED
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
</v-col>
|
|
173
173
|
|
|
174
174
|
<v-col v-if="shouldShowField('unit')" cols="12">
|
|
175
|
-
<InputLabel class="text-capitalize" title="Registered Unit Company Name" required />
|
|
175
|
+
<InputLabel class="text-capitalize" title="Registered Unit Company Name" required :key="'unit-key' + visitor.level" />
|
|
176
176
|
<v-text-field v-model.trim="registeredUnitCompanyName" density="comfortable"
|
|
177
177
|
:loading="buildingUnitDataPending" readonly class="no-pointer" />
|
|
178
178
|
</v-col>
|
|
@@ -807,6 +807,7 @@ function handleChangeBlock(value: any) {
|
|
|
807
807
|
|
|
808
808
|
function handleChangeLevel(value: any) {
|
|
809
809
|
visitor.unit = "";
|
|
810
|
+
visitor.unitName = "";
|
|
810
811
|
}
|
|
811
812
|
|
|
812
813
|
function handleUpdateUnit(value: any) {
|
|
@@ -952,7 +953,7 @@ async function submit() {
|
|
|
952
953
|
|
|
953
954
|
if (passType.value === "QR") {
|
|
954
955
|
console.log("[QR Print] passRes:", passRes);
|
|
955
|
-
const accessCards: any[] = (passRes as any)?.accessCards ?? [];
|
|
956
|
+
const accessCards: any[] = (passRes as any)?.data?.accessCards ?? [];
|
|
956
957
|
console.log("[QR Print] accessCards:", accessCards);
|
|
957
958
|
const printer = entryPassSettings.value?.data?.settings?.printer;
|
|
958
959
|
console.log("[QR Print] printer config:", printer);
|
|
@@ -130,15 +130,15 @@ export default function useFeedback() {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
function deleteFeedback(id: string) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
133
|
+
// function deleteFeedback(id: string) {
|
|
134
|
+
// return useNuxtApp().$api<Record<string, any>>(
|
|
135
|
+
// `/api/feedbacks/deleted/feedback/${id}`,
|
|
136
|
+
// {
|
|
137
|
+
// method: "PUT",
|
|
138
|
+
// // query: { id },
|
|
139
|
+
// }
|
|
140
|
+
// );
|
|
141
|
+
// }
|
|
142
142
|
|
|
143
143
|
function updateFeedbackServiceProvider(id: string, serviceProvider: string) {
|
|
144
144
|
return useNuxtApp().$api<Record<string, any>>(
|
|
@@ -182,6 +182,12 @@ export default function useFeedback() {
|
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
function deleteFeedback(id: string) {
|
|
186
|
+
return useNuxtApp().$api<Record<string, any>>(`/api/feedbacks/${id}`, {
|
|
187
|
+
method: "DELETE",
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
185
191
|
return {
|
|
186
192
|
feedbacks,
|
|
187
193
|
setFeedback,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type ProfilePhotoMessageLike = {
|
|
2
|
+
createdByProfile?: unknown;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export default function useProfilePhotoSrc() {
|
|
6
|
+
const { API_DO_STORAGE_ENDPOINT } = useRuntimeConfig().public;
|
|
7
|
+
|
|
8
|
+
const isProbablyUrl = (value: string) =>
|
|
9
|
+
/^(https?:\/\/|data:|blob:)/i.test(value);
|
|
10
|
+
|
|
11
|
+
const trimSlashes = (value: string) => value.replace(/^\/+|\/+$/g, "");
|
|
12
|
+
|
|
13
|
+
const joinUrl = (base: string, ...parts: string[]) => {
|
|
14
|
+
const safeBase = base.replace(/\/+$/g, "");
|
|
15
|
+
const safeParts = parts.map((p) => trimSlashes(p)).filter(Boolean);
|
|
16
|
+
return [safeBase, ...safeParts].join("/");
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const getProfilePhotoSrc = (message: ProfilePhotoMessageLike) => {
|
|
20
|
+
const rawKey = message?.createdByProfile;
|
|
21
|
+
if (typeof rawKey !== "string") return "";
|
|
22
|
+
|
|
23
|
+
const key = rawKey.trim();
|
|
24
|
+
if (!key) return "";
|
|
25
|
+
|
|
26
|
+
if (isProbablyUrl(key)) return key;
|
|
27
|
+
|
|
28
|
+
return joinUrl(String(API_DO_STORAGE_ENDPOINT || ""), key);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
getProfilePhotoSrc,
|
|
33
|
+
};
|
|
34
|
+
}
|