query.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. const _Http = getApp().globalData.http;
  2. let obj = {
  3. stagename: {
  4. "id": 20221128143604,
  5. "content": {
  6. "pageNumber": 1,
  7. "pageSize": 1000,
  8. "where": {
  9. "condition": "",
  10. "allprojecttype": "",
  11. "projecttype": ""
  12. }
  13. }
  14. },
  15. brandname: {
  16. "content": {
  17. "isExport": 0,
  18. "pageNumber": 1,
  19. "pageSize": 1000,
  20. "isauth": 1,
  21. "where": {
  22. "condition": "",
  23. "tablefilter": {}
  24. }
  25. },
  26. "id": 20220922085103
  27. },
  28. tags: {
  29. "id": 20221013104401,
  30. "content": {
  31. "isExport": 1,
  32. "pageNumber": 1,
  33. "pageSize": 1000,
  34. "sys_systemtagid": 1,
  35. "where": {
  36. "condition": ""
  37. }
  38. }
  39. }
  40. }
  41. module.exports = {
  42. /**
  43. * 获取筛选分类查询 无分页
  44. * 项目类型:projecttype
  45. * 项目等级:projectgrade
  46. * 项目阶段:stagename
  47. * 领域:tradefield
  48. * 品牌:brandname
  49. * 客户标签:tags
  50. */
  51. async getTypes(name) {
  52. let params = null;
  53. if (["projecttype", 'projectgrade', 'tradefield'].includes(name)) {
  54. params = {
  55. "classname": "sysmanage.develop.optiontype.optiontype",
  56. "method": "optiontypeselect",
  57. "content": {
  58. "nochace": true,
  59. "pageNumber": 1,
  60. "pageSize": 1000,
  61. "typename": name,
  62. "parameter": {
  63. "siteid": wx.getStorageSync('userMsg').siteid
  64. }
  65. }
  66. }
  67. } else {
  68. params = obj[name];
  69. }
  70. if (!params) return;
  71. let res = await _Http.basic(params);
  72. console.log(`查询${name}`, res)
  73. return res.code == '1' ? res.data : [];
  74. }
  75. }