litian
2024-10-15 1a5e46e6955225675d21fe04962e82b37e7890ed
assets/js/middleGround/tool.js
@@ -1,4 +1,6 @@
import { requestCtx } from "../config";
import {
  requestCtx
} from "../config";
// import defaultImg from "../../../images/default-book-img.png" 
import moment from 'moment'
// 处理列表查询结果
@@ -6,7 +8,7 @@
  datas,
  fields,
  path,
  storeInfo,
  storeInfo,
  repositoryInfo,
  coverSize,
  handelEBooK,
@@ -149,6 +151,7 @@
// 处理详情查询结果
export function handleDetailQueryRequestData({
  productId,
  item,
  fields,
  path,
@@ -255,14 +258,16 @@
            }
          }
        }
        if (subItem.productLinkInfo && subItem.productLinkInfo.length)
        if (subItem.productLinkInfo && subItem.productLinkInfo.length) {
          let itemProductLinkInfo = subItem.productLinkInfo.find(citem => citem.ProductId == productId)
          subItem.productLinkPath =
            subItem.productLinkInfo[0].LinkPath +
            itemProductLinkInfo?.LinkPath +
            "\\" +
            subItem.productLinkInfo[0].CmsItemId;
            itemProductLinkInfo?.CmsItemId;
        }
        if (subItem.linkInfo && subItem.linkInfo.length)
          subItem.linkPath =
            subItem.linkInfo[0].LinkPath + "\\" + subItem.linkInfo[0].CmsItemId;
          subItem.linkInfo[0].LinkPath + "\\" + subItem.linkInfo[0].CmsItemId;
      }
      linkItemsMap[tag] = sdata.datas;
    }
@@ -285,7 +290,7 @@
      md5: linkItem.Md5,
      icon: linkItem.Icon,
      size: linkItem.Size,
      metaData: JSON.parse(linkItem.MetaData ?? "{}"),
      // metaData: JSON.parse(linkItem.MetaData ?? "{}"),
      order: linkItem.Order,
      protectType: linkItem.ProtectType,
    };
@@ -314,10 +319,10 @@
  item.linkRepoId = item.datas.LinkRepository;
  item.childrenCount = parseInt(item.datas.ChildrenCount ?? "0");
  (item.childrenFolderCount = parseInt(item.datas.ChildrenFolderCount ?? "0")),
    (item.childrenChannelCount = parseInt(
      item.datas.ChildrenChannelCount ?? "0"
    )),
    (item.linkId = parseInt(item.datas.LinkId));
  (item.childrenChannelCount = parseInt(
    item.datas.ChildrenChannelCount ?? "0"
  )),
  (item.linkId = parseInt(item.datas.LinkId));
  item.linkOrg = JSON.parse(item.datas.LinkOrg ?? "[]")[0];
  item.linkDepartment = JSON.parse(item.datas.LinkDepartment ?? "[]")[0];
  item.linkInfo = JSON.parse(item.datas.LinkInfo ?? "[]");
@@ -419,9 +424,10 @@
  if (md5) {
    src = requestCtx + `/file/GetPreViewImage?md5=${md5}`;
  } else {
    return ""
    // return defaultImg;
  }
  if (width) src += `&width=${width}`;
  if (height) src += `&height=${height}`;
  return src;
}
}