Project.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. init: false
  24. },
  25. methods: {
  26. getList() {
  27. this.partialRenewal()
  28. this.data.init = true;
  29. },
  30. tabsChange({
  31. detail
  32. }) {
  33. this.setData({
  34. tabsActive: detail
  35. });
  36. this.partialRenewal();
  37. },
  38. //局部数据更新 tabs
  39. partialRenewal() {
  40. const model = this.data.tabsList[this.data.tabsActive].model;
  41. if (model) {
  42. const Component = this.selectComponent(model);
  43. Component.getList(true);
  44. }
  45. this.data.model = model;
  46. },
  47. getContent() {
  48. const model = this.data.tabsList[this.data.tabsActive].model;
  49. if (model) return this.selectComponent(model).data.content
  50. }
  51. }
  52. })