Project.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. options: {
  4. addGlobalClass: true,
  5. },
  6. properties: {
  7. update: {
  8. type: Function
  9. }
  10. },
  11. lifetimes: {
  12. attached: function () {
  13. getApp().globalData.Language.getLanguagePackage(this)
  14. this.triggerEvent('update', "Client")
  15. }
  16. },
  17. data: {
  18. tabsActive: 0,
  19. tabsList: [{
  20. label: "数据概况",
  21. model: "#DataOverview"
  22. }, {
  23. label: "近12月项目报价分析",
  24. model: "#ProjectQuotationQuantity"
  25. }],
  26. init: false
  27. },
  28. methods: {
  29. getList() {
  30. this.partialRenewal()
  31. this.data.init = true;
  32. },
  33. tabsChange({
  34. detail
  35. }) {
  36. this.setData({
  37. tabsActive: detail
  38. });
  39. this.partialRenewal();
  40. },
  41. //局部数据更新 tabs
  42. partialRenewal() {
  43. const model = this.data.tabsList[this.data.tabsActive].model;
  44. if (model) {
  45. const Component = this.selectComponent(model);
  46. Component.getList(true);
  47. }
  48. this.data.model = model;
  49. },
  50. getContent() {
  51. const model = this.data.tabsList[this.data.tabsActive].model;
  52. if (model) return this.selectComponent(model).data.content
  53. }
  54. }
  55. })