subscription_components.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. mgJsComponentHandler.addDefaultComponent('mg-subscription', {
  2. template: '#t-mg-subscription',
  3. props: [
  4. 'component_id',
  5. 'component_namespace',
  6. 'component_index'
  7. ],
  8. data: function () {
  9. return {
  10. data: {
  11. installation: [],
  12. details: {
  13. userins: {
  14. live_ins: {
  15. site_name: null
  16. }
  17. },
  18. },
  19. },
  20. loading_state: false,
  21. passwordShow: false,
  22. };
  23. },
  24. created: function () {
  25. var self = this;
  26. self.$nextTick(function () {
  27. self.loadAjaxData();
  28. });
  29. },
  30. methods: {
  31. loadAjaxData: function () {
  32. var self = this;
  33. self.loading_state = true;
  34. var requestParams = {
  35. loadData: self.component_id,
  36. namespace: self.component_namespace,
  37. index: self.component_index
  38. };
  39. var response = mgPageControler.vueLoader.vloadData(requestParams);
  40. return response.done(function (data) {
  41. self.data = data.data.rawData.data;
  42. self.loading_state = false;
  43. }).fail(function () {
  44. self.loading_state = false;
  45. });
  46. }
  47. }
  48. });