|
@@ -20,25 +20,25 @@ interface ServiceStyle {
|
|
|
|
|
|
export const defStyleType = {
|
|
|
id: 8,
|
|
|
- name: ui18n.t('sys.other'),
|
|
|
-}
|
|
|
+ name: ui18n.t("sys.other"),
|
|
|
+};
|
|
|
export const styleTypes = [
|
|
|
{
|
|
|
id: 1,
|
|
|
- name: ui18n.t('tagging.type.1'),
|
|
|
+ name: ui18n.t("tagging.type.1"),
|
|
|
children: [
|
|
|
- { id: 2, name: ui18n.t('tagging.type.2') },
|
|
|
- { id: 3, name: ui18n.t('tagging.type.3') },
|
|
|
- { id: 4, name: ui18n.t('tagging.type.4') },
|
|
|
- { id: 5, name: ui18n.t('tagging.type.5') },
|
|
|
- { id: 6, name: ui18n.t('tagging.type.6') },
|
|
|
+ { id: 2, name: ui18n.t("tagging.type.2") },
|
|
|
+ { id: 3, name: ui18n.t("tagging.type.3") },
|
|
|
+ { id: 4, name: ui18n.t("tagging.type.4") },
|
|
|
+ { id: 5, name: ui18n.t("tagging.type.5") },
|
|
|
+ { id: 6, name: ui18n.t("tagging.type.6") },
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
id: 7,
|
|
|
- name: ui18n.t('tagging.type.7'),
|
|
|
+ name: ui18n.t("tagging.type.7"),
|
|
|
},
|
|
|
- defStyleType
|
|
|
+ defStyleType,
|
|
|
];
|
|
|
|
|
|
export const getStyleTypeName = (id: number, all: any = styleTypes): string => {
|
|
@@ -55,7 +55,10 @@ export const getStyleTypeName = (id: number, all: any = styleTypes): string => {
|
|
|
return "";
|
|
|
};
|
|
|
|
|
|
-export const getStyleTypeId = (dictId: number, all: any = styleTypes): number => {
|
|
|
+export const getStyleTypeId = (
|
|
|
+ dictId: number,
|
|
|
+ all: any = styleTypes
|
|
|
+): number => {
|
|
|
for (const item of all) {
|
|
|
if (dictId === item.dictId) {
|
|
|
return item.id;
|
|
@@ -69,10 +72,9 @@ export const getStyleTypeId = (dictId: number, all: any = styleTypes): number =>
|
|
|
return -1;
|
|
|
};
|
|
|
export const getStyleDictId = (id: number, all: any = styleTypes): number => {
|
|
|
- return __map[id]
|
|
|
+ return __map[id];
|
|
|
};
|
|
|
|
|
|
-
|
|
|
export interface TaggingStyle {
|
|
|
id: string;
|
|
|
icon: string;
|
|
@@ -101,10 +103,10 @@ const toService = (style: TaggingStyle): ServiceStyle => ({
|
|
|
|
|
|
export type TaggingStyles = TaggingStyle[];
|
|
|
|
|
|
-const __map: Record<string, number> = {}
|
|
|
+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, {
|
|
|
+ let treeData = await axios.get<any>(TAGGING_STYLE_TREE, {
|
|
|
params: reqParams,
|
|
|
});
|
|
|
const styles: any[] = [];
|
|
@@ -114,7 +116,7 @@ export const fetchTaggingStyles = async () => {
|
|
|
if (level !== 0) {
|
|
|
delete parent.children;
|
|
|
}
|
|
|
- __map[item.iconId] = item.dictId || parent.dictId
|
|
|
+ __map[item.iconId] = item.dictId || parent.dictId;
|
|
|
styles.push(toLocal({ ...item, iconTitle: parent.id }));
|
|
|
} else {
|
|
|
const data = {
|
|
@@ -124,17 +126,36 @@ export const fetchTaggingStyles = async () => {
|
|
|
children: [],
|
|
|
};
|
|
|
parent.children.push(data);
|
|
|
- genTree(item.childrenList, data, ++level)
|
|
|
+ genTree(item.childrenList, data, ++level);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ // treeData = [{
|
|
|
+ // iconId: 279,
|
|
|
+ // iconTitle: "其他",
|
|
|
+ // iconUrl: null,
|
|
|
+ // userName: null,
|
|
|
+ // isSystem: 1,
|
|
|
+ // useNum: 13,
|
|
|
+ // lastUse: 1,
|
|
|
+ // isNew: 1,
|
|
|
+ // caseId: null,
|
|
|
+ // fusionId: null,
|
|
|
+ // sort: 2,
|
|
|
+ // parentId: null,
|
|
|
+ // tbStatus: 0,
|
|
|
+ // createTime: "2025-08-26 14:56:08",
|
|
|
+ // updateTime: "2025-09-25 19:59:10",
|
|
|
+ // childrenList: treeData,
|
|
|
+ // }];
|
|
|
const tree: any = { children: [] };
|
|
|
genTree(treeData, tree);
|
|
|
- styleTypes.length = 0
|
|
|
+ console.error("treeData", treeData, tree);
|
|
|
+ styleTypes.length = 0;
|
|
|
styleTypes.push(...tree.children)
|
|
|
- Object.assign(defStyleType, tree.children[tree.children.length - 1])
|
|
|
-
|
|
|
- console.error('StyleT', styleTypes)
|
|
|
+ Object.assign(defStyleType, tree.children[tree.children.length - 1]);
|
|
|
+
|
|
|
+ console.error("StyleT", styleTypes);
|
|
|
|
|
|
// const data = await axios.get<ServiceStyle[]>(TAGGING_STYLE_LIST, {
|
|
|
// params: reqParams,
|