• antd tree渲染


      /**
       * 遍历单位基本信息树
       * @param data
       * @param parentId
       * @returns
       */
      const getTrees = (data: OrganizationResult[], parentId: number | null) => {
        let itemArr = [];
        for (let i = 0; i < data.length; i++) {
          let node = data[i];
          if (node.parent_id === parentId) {
            let newNode: TreeNode = {
              id: node.id,
              key: node.id as number,
              title: node.name,
              children: getTrees(data, node.id),
            };
            itemArr.push(newNode);
          }
        }
        return itemArr;
      };
    

      

      /**
       * 获取左侧集团架构树
       * @returns
       */
      const getBorderOrganizationData = async () => {
        let res = await getNewOrganizationInfo<OrganizationDataResult>();
        let resluts: OrganizationDataResult[] = res?.data;
        let roles = erji.includes(selector.user.organization_type);
        let data = getTrees(resluts, roles ? 1 : null);
        setTreeData(data);
        setCurrent(Number(data?.[0]?.id));
        setStateBorder({
          ...stateborder,
          companyType: selector?.user?.organization_type,
        });
        return getOrginationInfo(selector?.user?.organization_id);
      };
    

      

  • 相关阅读:
    0223_模拟2011
    0223_模拟2011
    0223_模拟2011
    0223_模拟2011
    12c DG broker DMON自动重启过程分析
    12c DG broker DMON自动重启过程分析
    12c DG broker DMON自动重启过程分析
    12c DG broker DMON自动重启过程分析
    CITA架构设计
    跨链合约示例
  • 原文地址:https://www.cnblogs.com/wjhaaa/p/16106539.html
Copyright © 2020-2023  润新知