bill 1 hete
szülő
commit
b24c0b1f7e

+ 75 - 48
src/components/materials/index.vue

@@ -193,54 +193,80 @@ const rowSelection = ref({
 });
 const cloumns = computed(() => {
   const groupIds = params.groupIds;
-  const cloumns = [
-    {
-      title: "名称",
-      dataIndex: "name",
-      key: "name",
-    },
-    {
-      width: "100px",
-      title: "格式",
-      dataIndex: "format",
-      key: "format",
-    },
-    {
-      width: "100px",
-      title: "大小",
-      dataIndex: "size",
-      key: "size",
-    },
-    {
-      width: "100px",
-      title: "id",
-      dataIndex: "id",
-      key: "id",
-    },
-    {
-      width: "100px",
-      title: "状态",
-      dataIndex: "status",
-      key: "status",
-    },
-    {
-      width: "100px",
-      title: "分组",
-      dataIndex: "group",
-      key: "group",
-      filteredValue: groupIds,
-      filters: props.readonly
-        ? undefined
-        : groups.value.map((g) => ({
-            text: g.name,
-            value: g.id,
-          })),
-      // filters: groups.value.map((g) => ({
-      //   text: g.name,
-      //   value: g.id,
-      // })),
-    },
-  ];
+  const cloumns =
+    props.useType === "trace_evidence"
+      ? [
+          {
+            title: "名称",
+            dataIndex: "name",
+            key: "name",
+          },
+          {
+            width: "200px",
+            title: "案件",
+            dataIndex: "kno",
+            key: "kno",
+          },
+          {
+            width: "100px",
+            title: "分组",
+            dataIndex: "group",
+            key: "group",
+            filteredValue: groupIds,
+            filters: props.readonly
+              ? undefined
+              : groups.value.map((g) => ({
+                  text: g.name,
+                  value: g.id,
+                })),
+            // filters: groups.value.map((g) => ({
+            //   text: g.name,
+            //   value: g.id,
+            // })),
+          },
+        ]
+      : [
+          {
+            title: "名称",
+            dataIndex: "name",
+            key: "name",
+          },
+          {
+            width: "100px",
+            title: "格式",
+            dataIndex: "format",
+            key: "format",
+          },
+          {
+            width: "100px",
+            title: "大小",
+            dataIndex: "size",
+            key: "size",
+          },
+          {
+            width: "100px",
+            title: "状态",
+            dataIndex: "status",
+            key: "status",
+          },
+          {
+            width: "100px",
+            title: "分组",
+            dataIndex: "group",
+            key: "group",
+            filteredValue: groupIds,
+            filters: props.readonly
+              ? undefined
+              : groups.value.map((g) => ({
+                  text: g.name,
+                  value: g.id,
+                })),
+            // filters: groups.value.map((g) => ({
+            //   text: g.name,
+            //   value: g.id,
+            // })),
+          },
+        ];
   if (!props.readonly) {
     cloumns.push({
       width: "100px",
@@ -321,6 +347,7 @@ const handleTableChange: TableProps["onChange"] = (pag, filters) => {
   max-height: 500px;
   overflow-y: auto;
 }
+
 .up-se {
   display: flex;
   align-items: center;

+ 1 - 0
src/components/tagging/sign-new.vue

@@ -105,6 +105,7 @@ const queryItems = computed(() =>
     url: getResource(getFileUrl(image)),
   }))
 );
+console.log(props.tagging.styleId);
 const taggingStyle = computed(() => getTaggingStyle(props.tagging.styleId));
 const tag = markRaw(
   sdk.createTagging({

+ 1 - 1
src/layout/edit/fuse-edit.vue

@@ -48,8 +48,8 @@ import { initialAnimationModels } from "@/store/animation";
 const loaded = ref(false);
 const initialSys = async () => {
   await Promise.all([initialFuseModels(), initialScenes()]);
+  await initialTaggingStyles()
   await Promise.all([
-    initialTaggingStyles(),
     initialTaggings(),
     initialGuides(),
     initialPaths(),

+ 1 - 1
src/layout/show/index.vue

@@ -88,6 +88,7 @@ const fullHandler = async () => {
 
 const loaded = ref(false);
 const initialSys = async () => {
+    await initialTaggingStyles()
   await Promise.all([
     initialFuseModels(),
     initialScenes(),
@@ -95,7 +96,6 @@ const initialSys = async () => {
     initialRecords(),
     // initialFloders(),
     // initialFloderTypes(),
-    initialTaggingStyles(),
     initialTaggings(),
     initialGuides(),
     initMonitors(),

+ 1 - 1
src/store/tagging-style.ts

@@ -34,7 +34,7 @@ export const createTaggingStyle = (style: Partial<TaggingStyle> = {}): TaggingSt
 })
 
 export const getTaggingStyle = (id: TaggingStyle['id']) => {
-  return taggingStyles.value.find(style => style.id === id)
+  return taggingStyles.value.find(style => Number(style.id) === Number(id))
 }
 
 

+ 2 - 1
src/store/tagging.ts

@@ -108,8 +108,9 @@ export const deleteTagging = deleteStoreItem(taggings, async tagging => {
 })
 export const updateTagging = updateStoreItem(taggings, postUpdateTagging, transformTagging)
 export const initialTaggings = fetchStoreItems(taggings, async () => {
-  const taggings = await fetchTaggings()
+  let taggings = await fetchTaggings()
   await Promise.all(taggings.map(initTaggingPositionsByTagging))
+  taggings = taggings.filter(item => getTaggingStyle(item.styleId))
   return taggings
 }, backupTaggings)
 export const saveTaggings = saveStoreItems(

+ 1 - 2
src/views/record/index.vue

@@ -49,8 +49,7 @@ import { initialMeasures } from "@/store/measure";
 import { initialGuides } from "@/store/guide";
 
 initialRecords();
-initialTaggingStyles();
-initialTaggings();
+initialTaggingStyles().then(initialTaggings);
 initialMeasures();
 initialGuides();
 initialPaths();

+ 1 - 0
src/views/setting/index.vue

@@ -6,6 +6,7 @@
           :value="caseProject!.fusionTitle"
           @update:value="(title: string) => changeBack(undefined, title)"
           style="width: 100%; height: 40px"
+          :maxlength="500"
         />
       </ui-group-option>
     </ui-group>

+ 4 - 1
src/views/tagging/index.vue

@@ -80,13 +80,14 @@ const quiskAdd = async (key: string) => {
 const exposeTagging = async () => {
   const list = await selectMaterials({
     useType: "trace_evidence",
+    readonly: true,
     format: ["jpg", "png", "mp4", "mp3", "wav"],
   });
   if (!list) return;
 
   const addTaggings = list!.map((item) => {
     const tagging = createTagging({
-      styleId: defStyleType.id.toString(),
+      styleId: defaultStyle.value?.id,
       title: item.content?.title || item.name,
       desc: item.content?.feature || "",
       tqTime: formatDate(
@@ -107,9 +108,11 @@ const exposeTagging = async () => {
       tagging.audio = item.url;
       tagging.audioName = item.name;
     }
+    console.log(item.dictId, tagging.styleId);
     if (item.dictId) {
       const typeId = getStyleTypeId(item.dictId);
       const styles = taggingStyles.value.filter((item) => item.typeId === typeId);
+      console.log(styles);
       if (styles.length) {
         tagging.styleId = styles[0].id;
       }

+ 1 - 1
src/views/view/index.vue

@@ -48,7 +48,7 @@ import { ref, watch } from "vue";
 import type { View } from "@/store";
 
 // initialViews();
-initialTaggingStyles(), initialTaggings(), initialMeasures();
+initialTaggingStyles().then(initialTaggings), initialMeasures();
 const getView = async () => {
   try {
     const { image, flyData } = await loadPack(async () => {