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