diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index adb0b25..e0b33ed 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -2,9 +2,7 @@
import { Dialog } from "primevue";
import { useErrorStore } from "./stores/error.store";
import CommentScheme from "./comment/CommentScheme.vue";
-import PostScheme from "./post/PostScheme.vue";
import PosttypeScheme from "./posttype/PosttypeScheme.vue";
-import AuthorScheme from "./author/AuthorScheme.vue";
const errorStore = useErrorStore();
@@ -19,9 +17,6 @@ const errorStore = useErrorStore();
{{ errorStore.message }}
-
-
-
diff --git a/frontend/src/posttype/PosttypeScheme.vue b/frontend/src/posttype/PosttypeScheme.vue
index 5d93377..babbb74 100644
--- a/frontend/src/posttype/PosttypeScheme.vue
+++ b/frontend/src/posttype/PosttypeScheme.vue
@@ -7,7 +7,6 @@ import type { Scheme } from "../types/scheme.type";
import { PostType } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
-import { ImportFromExcel } from "../../bindings/app/internal/services/posttypeservice.ts";
const service = new Service();
@@ -20,7 +19,6 @@ const load = async () => {
onMounted(async () => {
await load();
- await ImportFromExcel();
});
const scheme: Scheme = reactive({
@@ -48,10 +46,17 @@ const validate: Validate = (entity) => {
status: "success",
};
};
+
+const colorize = (data: PostType): string => {
+ if (data.Name === "test") {
+ return "red";
+ }
+
+}
-
+
diff --git a/frontend/src/table/Table.vue b/frontend/src/table/Table.vue
index ffe6668..c579e87 100644
--- a/frontend/src/table/Table.vue
+++ b/frontend/src/table/Table.vue
@@ -64,6 +64,18 @@ const slots = defineSlots();
const createSlotName = (key: any) => key + "Create";
const updateSlotName = (key: any) => key + "Update";
+
+watch(() => props.items, () => {
+ if (props.colorize) {
+ const trs = document.querySelectorAll("tr");
+ props.items.forEach(item => {
+ const tr = trs[item.Id];
+ if (tr) {
+ tr.style.backgroundColor = props.colorize(item);
+ }
+ })
+ }
+})
@@ -117,7 +129,7 @@ const updateSlotName = (key: any) => key + "Update";
v-if="!props.scheme[key].hidden"
>
-
+
{{
viewDate(manyStructsView(
data[key],
diff --git a/frontend/src/types/table-props.type.ts b/frontend/src/types/table-props.type.ts
index 3679539..275026d 100644
--- a/frontend/src/types/table-props.type.ts
+++ b/frontend/src/types/table-props.type.ts
@@ -11,4 +11,5 @@ export interface TableProps {
validate: Validate
load(): Promise
items: T[]
+ colorize?: (data: T) => string
}
\ No newline at end of file