This commit is contained in:
Viet An
2026-05-19 10:00:15 +07:00
parent 1283757903
commit 5768a8a9fb
7 changed files with 170 additions and 146 deletions

View File

@@ -73,9 +73,23 @@ export default defineNuxtPlugin(() => {
return val === undefined || val === null || val === "";
};
const toRawDeep = function (observed) {
const val = toRaw(observed);
if (val instanceof Date) return val;
if (Array.isArray(val)) return val.map(toRawDeep);
if (val === null) return null;
if (typeof val === "object") {
const entries = Object.entries(val).map(([key, val]) => [key, toRawDeep(val)]);
return Object.fromEntries(entries);
}
return val;
};
const copy = function (val) {
if (empty(val)) return val;
return JSON.parse(JSON.stringify(val));
return structuredClone(toRawDeep(val));
};
const clone = function (obj) {

View File

@@ -573,6 +573,10 @@ export default defineNuxtPlugin((nuxtApp) => {
params: {
values:
"id,code,name,manufacturer,manufacturer__name,os,os__name,battery,battery__code,screen,cpu,cpu__name,gpu,gpu__name,camera_system,camera_system__code,sim,sim__code,network_technology,network_technology__name,charging_technology,charging_technology__code,external_storage,external_storage__max_capacity,ip_rating,ip_rating__code,design,create_time,update_time",
distinct_values: {
label: { type: "Concat", field: ["name", "os__name", "manufacturer__name"] },
},
summary: "annotate",
},
},
{