changes
This commit is contained in:
@@ -4,6 +4,9 @@ export default defineNuxtPlugin(() => {
|
||||
|
||||
//==========Find & filter=================
|
||||
const find = function (arr, obj, attr) {
|
||||
if (typeof arr === "object" && !Array.isArray(arr)) {
|
||||
arr = Object.values(arr);
|
||||
}
|
||||
const keys = Object.keys(obj);
|
||||
let found = arr.find((v) => {
|
||||
let valid = true;
|
||||
|
||||
@@ -1012,7 +1012,16 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
name: "Screen",
|
||||
url: "data/Screen/",
|
||||
url_detail: "data-detail/Screen/",
|
||||
params: {},
|
||||
params: {
|
||||
values: "id,code,resolution,standard,technology,size,create_time",
|
||||
distinct_values: {
|
||||
label: {
|
||||
type: "Concat",
|
||||
field: ["resolution", "standard", "technology"],
|
||||
},
|
||||
},
|
||||
summary: "annotate",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "CPU",
|
||||
@@ -1078,7 +1087,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "color",
|
||||
name: "Color",
|
||||
url: "data/Color/",
|
||||
url_detail: "data-detail/Color/",
|
||||
params: {},
|
||||
@@ -1170,7 +1179,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
try {
|
||||
let found = findapi(name);
|
||||
let curpath = found.path ? paths.find((x) => x.name === found.path).url : path;
|
||||
var rs;
|
||||
let rs;
|
||||
if (!Array.isArray(data)) {
|
||||
rs = await $fetch(`${curpath}${found.url}`, {
|
||||
method: "POST",
|
||||
@@ -1241,7 +1250,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
? $snackbar("Data has been successfully saved to the system.", "Success", "Success")
|
||||
: $snackbar("Dữ liệu đã được lưu vào hệ thống", "Thành công", "Success");
|
||||
}
|
||||
return rs.data;
|
||||
return rs;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
return "error";
|
||||
@@ -1450,7 +1459,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
let index = copy.findIndex((v) => v.id === id);
|
||||
if (index >= 0) $remove(copy, index);
|
||||
} else {
|
||||
rs.data.forEach((element) => {
|
||||
rs.forEach((element) => {
|
||||
let index = copy.findIndex((v) => v.id === element.id);
|
||||
if (index >= 0) $remove(copy, index);
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@ import AddDesign from "@/components/imports/addons/AddDesign.vue";
|
||||
import AddColor from "@/components/imports/addons/AddColor.vue";
|
||||
import AddRAM from "@/components/imports/addons/AddRAM.vue";
|
||||
import AddInternalStorage from "@/components/imports/addons/AddInternalStorage.vue";
|
||||
import Color from "@/components/imports/Color.vue";
|
||||
import Returns from "@/components/imports/Returns.vue";
|
||||
import Exports from "@/components/exports/Exports.vue";
|
||||
import ExportsDamaged from "@/components/exports/ExportsDamaged.vue";
|
||||
@@ -177,6 +178,7 @@ const components = {
|
||||
AddColor,
|
||||
AddRAM,
|
||||
AddInternalStorage,
|
||||
Color,
|
||||
Returns,
|
||||
Exports,
|
||||
ExportsDamaged,
|
||||
|
||||
Reference in New Issue
Block a user