bill hai 1 semana
pai
achega
6160a8e725

+ 2 - 1
src/api/fuse-model.ts

@@ -135,7 +135,8 @@ export const fetchFuseModels = async () => {
   let serviceModels = await axios.get<ServiceFuseModel[]>(FUSE_MODEL_LIST, {
     params: { fusionId: params.caseId },
   });
-  serviceModels = serviceModels.slice(0, 1)
+  // serviceModels = [serviceModels[4]]
+
   return serviceModels.map((item, index) => serviceToLocal(item, index == 0));
 };
 

+ 31 - 6
src/api/material.ts

@@ -29,12 +29,13 @@ type ServiceMaterial = {
   fileFormat: string;
   fileName: string;
   fileSize: string;
-  fileType: string;
+  fileType: FileType;
   fileUrl: string;
   id: number;
   name: string;
   newFileName: string;
   typeKey: string;
+  content?: string
   updateTime: string;
   uploadId: number;
 };
@@ -45,6 +46,14 @@ export type MaterialGroup = {
   icons: string[];
 };
 
+export enum FileType {
+  IMAGE = 0,
+  VIDEO = 1,
+  MUSIC = 2,
+  MODEL = 3,
+  OTHER = 4,
+  DOC = 5
+}
 export type Material = {
   id: number;
   name: string;
@@ -56,12 +65,27 @@ export type Material = {
   group: string;
   uploadId?: number;
   isSystem?: number;
+  dictId?: number
   modelId?: number;
+  fileType: FileType,
+  dictIconList?: ({id :number})[]
+  content?: {
+    collectedTime: string;
+    createAccount: string;
+    feature: string;
+    leftPosition: string;
+    collectionModeName: string,
+    status: number;
+    title: string;
+  };
 };
 
 export type MaterialPageProps = PagingRequest<
-  Partial<Material> & { groupIds: number[]; formats: string[], 
-  useType?: string }
+  Partial<Material> & {
+    groupIds: number[];
+    formats: string[];
+    useType?: string;
+  }
 >;
 export const fetchMaterialPage = async (params: MaterialPageProps) => {
   const material = await axios.post<PagingResult<ServiceMaterial[]>>(
@@ -72,7 +96,7 @@ export const fetchMaterialPage = async (params: MaterialPageProps) => {
       name: params.name,
       dictIds: params.groupIds,
       fileFormats: params.formats,
-      useType: params.useType
+      // useType: params.useType
     }
   );
   const nm = {
@@ -89,6 +113,7 @@ export const fetchMaterialPage = async (params: MaterialPageProps) => {
         status: item.status,
         group: item.dictName,
         uploadId: item.uploadId,
+        content: item.content && JSON.parse(item.content)
       })
     ),
   };
@@ -125,8 +150,8 @@ export const fetchMaterialGroups = async (useType?: string) => {
 };
 
 export const syncMaterialAll = async () => {
-  await axios.get(SYNC_MATERIAL + params.caseId)
-}
+  await axios.get(SYNC_MATERIAL + params.caseId);
+};
 
 export const addMaterial = (file: File) => {
   return axios<string>({

+ 1 - 1
src/api/scene.ts

@@ -82,7 +82,7 @@ export const fetchScenesAll = async (params: {
   pageNum: number;
   pageSize: number;
 }) => {
-  const data = await axios.post<{ total: number, list: Scenes  }>(SCENE_LIST_ALL, params);
+  const data = await axios.post<{ total: number, list: Scenes  }>(SCENE_LIST_ALL, {...params, sceneStatus: -2});
   data.list = data.list.map(toLocalScene);
   return data
 };

+ 17 - 0
src/api/tagging-style.ts

@@ -20,11 +20,13 @@ interface ServiceStyle {
 export const defStyleType = {
   id: -999,
   name: "其他",
+  dictId: -1
 };
 export const styleTypes = [
   {
     id: 1,
     name: "痕迹",
+    dictId: -1,
     children: [
       { id: 2, name: "手印" },
       { id: 3, name: "足迹" },
@@ -49,6 +51,20 @@ export const getStyleTypeName = (id: number, all: any = styleTypes): string => {
   return "";
 };
 
+export const getStyleTypeId = (dictId: number, all: any = styleTypes): number => {
+  for (const item of all) {
+    if (dictId === item.dictId) {
+      return item.id;
+    } else if ("children" in item && item.children) {
+      const cid = getStyleTypeId(dictId, item.children);
+      if (cid) {
+        return cid;
+      }
+    }
+  }
+  return -1;
+};
+
 export interface TaggingStyle {
   id: string;
   icon: string;
@@ -91,6 +107,7 @@ export const fetchTaggingStyles = async () => {
       } else {
         const data = {
           id: item.iconId,
+          dictId: item.dictId,
           name: item.iconTitle,
           children: [],
         };

+ 10 - 8
src/components/materials/index.vue

@@ -16,14 +16,6 @@
           已选择数据<span>( {{ rowSelection.selectedRowKeys.length }} )</span>
         </p>
         <div class="up-se">
-          <Button
-            type="primary"
-            ghost
-            v-if="useType === 'trace_evidence'"
-            @click="foreceRefresh"
-          >
-            刷新
-          </Button>
           <span class="upload fun-ctrls" v-if="!readonly">
             <ui-input
               class="input"
@@ -47,6 +39,15 @@
             allow-clear
             style="width: 244px"
           />
+          <Button
+            type="primary"
+            ghost
+            v-if="useType === 'trace_evidence'"
+            style="margin-left: 10px"
+            @click="foreceRefresh"
+          >
+            刷新
+          </Button>
         </div>
       </div>
 
@@ -176,6 +177,7 @@ const rowSelection = ref({
       Message.error(`最多选择${props.count}项`);
     }
   },
+  hideSelectAll: true,
   onSelectAll: (selected: boolean, selectedRows: Material[], changeRows: Material[]) => {
     // 显式处理全选逻辑
     console.log("全选状态变化:", selected);

+ 0 - 1
src/components/materials/quisk.ts

@@ -16,7 +16,6 @@ export const selectMaterials = async (props: {
   return new Promise<Material[] | null>((resolve) => {
     const mprops = reactive({
       ...props,
-      count: 3,
       visible: true,
       onSelectMaterials: (val: Material[]) => {
         resolve(val);

+ 3 - 1
src/layout/edit/scene-select.vue

@@ -161,6 +161,8 @@ const cache = {} as any
 const selects = ref<Key[]>(selectIds.value);
 const rowSelection: any = ref({
   selectedRowKeys: selects,
+
+  hideSelectAll: true,
   onChange: (ids: string[]) => {
     console.error(ids)
     ids = ids.filter(id => !selectIds.value.includes(id))
@@ -236,7 +238,7 @@ const okHandler = createLoadPack(async () => {
     const num = item.split(spStr)[1]
     return {isObj, num}
   }).filter(({isObj, num}) =>
-    !fuseModels.value.some((model) => model.raw.isObj === isObj && model.raw.num === num)
+    num && !fuseModels.value.some((model) => model.raw.isObj === isObj && model.raw.num === num)
   )
   await addModelHandler(attachs);
   visible.value = false;

+ 2 - 2
src/main.ts

@@ -31,9 +31,9 @@ addHook({
     const type = isView ? "view" : "edit";
     if (config.headers) {
       config.headers["page-type"] = type;
-      config.headers["caseId"] = params.caseId;
+      config.headers["fusionId"] = params.caseId;
     } else {
-      config.headers = { "page-type": type, caseId: params.caseId };
+      config.headers = { "page-type": type, fusionId: params.caseId };
     }
   },
 });

+ 12 - 1
src/views/tagging/hot/edit.vue

@@ -215,6 +215,8 @@ const tqStatusOptions = [
   { label: tqStatusEnum.END, value: tqStatusEnum.END },
 ];
 
+const props = defineProps<EditProps>();
+
 const tqMethodOptions = [
   { label: "未送检", value: "未送检" },
   { label: "鉴定委托", value: "鉴定委托" },
@@ -237,6 +239,16 @@ const tqMethodOptions = [
   { label: "不予受理", value: "不予受理" },
 ];
 
+if (
+  props.data.method &&
+  !tqMethodOptions.some((item) => item.value === props.data.method)
+) {
+  tqMethodOptions.push({
+    label: props.data.method,
+    value: props.data.method,
+  });
+}
+
 const imageSize = 100 * 1024 * 1024;
 const imageCount = 10;
 const imageFormat = ["jpg", "png", "mp4"];
@@ -244,7 +256,6 @@ const audioSize = 30 * 1024 * 1024;
 const audioCount = 1;
 const audioFormat = ["mp3", "wav"];
 
-const props = defineProps<EditProps>();
 const emit = defineEmits<{ (e: "quit"): void; (e: "save", data: Tagging): void }>();
 const tagging = ref<Tagging>({ ...props.data, images: [...props.data.images] });
 const activeStyle = computed(() => getTaggingStyle(tagging.value.styleId));

+ 50 - 2
src/views/tagging/index.vue

@@ -40,7 +40,16 @@
 </template>
 
 <script lang="ts" setup>
-import { isEdit, monitors, taggings } from "@/store";
+import {
+  autoSaveTaggings,
+  createTagging,
+  defaultStyle,
+  isEdit,
+  monitors,
+  saveTaggings,
+  taggings,
+  taggingStyles,
+} from "@/store";
 import Hot from "./hot/index.vue";
 import Monitor from "./monitor/index.vue";
 import { RightFillPano } from "@/layout";
@@ -48,6 +57,9 @@ import { nextTick, reactive, ref, watchEffect } from "vue";
 import { currentIsFullView } from "@/utils/full";
 import { Dropdown, MenuItem, Menu } from "ant-design-vue";
 import { selectMaterials } from "@/components/materials/quisk";
+import { defStyleType, getStyleTypeId, tqStatusEnum } from "@/api";
+import { formatDate } from "@/utils";
+import { FileType } from "@/api/material";
 
 const current = ref("tagging");
 const tabs = reactive([
@@ -68,8 +80,44 @@ const quiskAdd = async (key: string) => {
 const exposeTagging = async () => {
   const list = await selectMaterials({
     useType: "trace_evidence",
+    format: ["jpg", "png", "mp4", "mp3", "wav"],
   });
-  console.log(list);
+  if (!list) return;
+
+  const addTaggings = list!.map((item) => {
+    const tagging = createTagging({
+      styleId: defStyleType.id.toString(),
+      title: item.content?.title || item.name,
+      desc: item.content?.feature || "",
+      tqTime: formatDate(
+        new Date(Number(item.content?.collectedTime) || Date.now()),
+        "yyyy-MM-dd hh:mm:ss"
+      ),
+      part: item.content?.leftPosition || "",
+      method: item.content?.collectionModeName || "未送检",
+      principal: item.content?.createAccount || "",
+      tqStatus: [tqStatusEnum.UN, tqStatusEnum.ING, tqStatusEnum.END][
+        item.content?.status || 0
+      ],
+    });
+    if (item.fileType === FileType.IMAGE || item.fileType === FileType.VIDEO) {
+      tagging.images.push(item.url);
+    }
+    if (item.fileType === FileType.MUSIC) {
+      tagging.audio = item.url;
+      tagging.audioName = item.name;
+    }
+    if (item.dictId) {
+      const typeId = getStyleTypeId(item.dictId);
+      const styles = taggingStyles.value.filter((item) => item.typeId === typeId);
+      if (styles.length) {
+        tagging.styleId = styles[0].id;
+      }
+    }
+    return tagging;
+  });
+
+  taggings.value.push(...addTaggings);
 };
 </script>