index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. siteid: {
  5. type: String
  6. },
  7. },
  8. lifetimes: {
  9. attached: function () {
  10. getApp().globalData.Language.getLanguagePackage(this)
  11. }
  12. },
  13. methods: {
  14. queryList(condition) {
  15. return _Http.basic({
  16. "id": 20230727134902,
  17. "content": {
  18. "pageNumber": 1,
  19. "pageSize": 9999,
  20. "where": {
  21. condition
  22. }
  23. }
  24. }).then(res => {
  25. console.log("项目名称", res)
  26. if (res.code == 0) {
  27. wx.showToast({
  28. title: res.msg,
  29. icon: "none"
  30. })
  31. return res.msg
  32. }
  33. this.setData({
  34. repetitionList: res.data.map(v => {
  35. v.chars = v.chars.reduce((acc, item) => ({
  36. ...acc,
  37. ...item
  38. }), {});
  39. v.projectname = v.projectname.split('').map(text => {
  40. let projectname = v.chars.projectname.join("") || ''
  41. return projectname.includes(text) ? {
  42. text,
  43. color: "red"
  44. } : {
  45. text,
  46. color: "#666666"
  47. }
  48. })
  49. return v
  50. }),
  51. show: this.data.siteid == 'HY' ? false : res.data.length != 0
  52. })
  53. return res.data.length != 0
  54. })
  55. },
  56. repClose() {
  57. this.setData({
  58. show: false
  59. })
  60. }
  61. }
  62. })