products.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * @Author: PoJun
  3. * @Date: 2023-08-28 11:22:46
  4. * @LastEditors: XuanJi
  5. * @LastEditTime: 2024-05-08 19:46:23
  6. * @Message: 产品目录相关
  7. */
  8. import { $get, $post } from "../config/http.js";
  9. /** 产品目录树 */
  10. export const getProductsTree = reqConfig => {
  11. return $get({ url: "/product_dirs/tree", reqConfig });
  12. };
  13. /** 获取产品目录树(无需权限) */
  14. export const getProductsTreeNoAuth = reqConfig => {
  15. return $get({ url: "/product_dirs/tree_noauth", reqConfig });
  16. };
  17. /** 新建产品目录 */
  18. export const addProductsDir = data => {
  19. return $post({ url: `/product_dirs/`, data, reqConfig: { showMsg: true } });
  20. };
  21. /** 编辑产品目录 */
  22. export const editProductsDir = (data, id) => {
  23. return $post({ url: `/product_dirs/${id}/info`, data, reqConfig: { showMsg: true } });
  24. };
  25. /** 删除产品目录 */
  26. export const deleteProductsDir = id => {
  27. return $post({ url: `/product_dirs/${id}/`, reqConfig: { showMsg: true } });
  28. };
  29. /** 根据id查找产品目录表 */
  30. export const getProductsInfo = (id, reqConfig) => {
  31. return $get({ url: `/product_dirs/${id}/info`, reqConfig });
  32. };
  33. /** 根据id集合查找产品目录表 */
  34. export const getProductsInfoFromIds = params => {
  35. return $get({ url: `/product_dirs/batch_info`, params });
  36. };