bill 23 時間 前
コミット
7e79b2ee84
2 ファイル変更10 行追加1 行削除
  1. 7 0
      src/api/tagging-style.ts
  2. 3 1
      src/api/tagging.ts

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

@@ -64,6 +64,10 @@ export const getStyleTypeId = (dictId: number, all: any = styleTypes): number =>
   }
   return -1;
 };
+export const getStyleDictId = (id: number, all: any = styleTypes): number => {
+  return __map[id]
+};
+
 
 export interface TaggingStyle {
   id: string;
@@ -93,6 +97,7 @@ const toService = (style: TaggingStyle): ServiceStyle => ({
 
 export type TaggingStyles = TaggingStyle[];
 
+const __map: Record<string, number> = {}
 export const fetchTaggingStyles = async () => {
   const reqParams = params.share ? { fusionId: params.caseId } : {};
   const treeData = await axios.get<any>(TAGGING_STYLE_TREE, {
@@ -103,6 +108,7 @@ export const fetchTaggingStyles = async () => {
     for (const item of tree) {
       if (item.iconUrl) {
         delete parent.children;
+        __map[item.iconId] = item.dictId || parent.dictId
         styles.push(toLocal({ ...item, iconTitle: parent.id }));
       } else {
         const data = {
@@ -122,6 +128,7 @@ export const fetchTaggingStyles = async () => {
   styleTypes.push(...tree.children)
   Object.assign(defStyleType, tree.children[tree.children.length - 1])
   
+  console.error('StyleT', styleTypes)
 
   // const data = await axios.get<ServiceStyle[]>(TAGGING_STYLE_LIST, {
   //   params: reqParams,

+ 3 - 1
src/api/tagging.ts

@@ -10,13 +10,14 @@ import {
 
 import type { FuseModel } from './fuse-model'
 import { TaggingPosition, TaggingPositionType } from './tagging-position'
-import type { TaggingStyle } from './tagging-style'
+import { getStyleDictId, type TaggingStyle } from './tagging-style'
 import { Tagging3DProps } from '@/sdk'
 
 interface ServerTagging {
   "hotIconId": number,
   "hotIconUrl": string,
   "getMethod": string,
+  dictId?: string
   "getUser": string,
   "tagId": number,
   "tagImgUrl": string,
@@ -86,6 +87,7 @@ const localToService = (tagging: Tagging, update = false): PartialProps<ServerTa
   "fusionId": params.caseId,
   "getMethod": tagging.method,
   show3dTitle: Number(tagging.show3dTitle),
+  dictId: getStyleDictId(Number(tagging.styleId))?.toString(),
   "getUser": tagging.principal,
   fileName: tagging.audioName,
   "hotIconUrl": "static/img_default/lQLPDhrvVzvNvTswMLAOU-UNqYnnZQG1YPJUwLwA_48_48.png",