mainVue.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. mainVM = new Vue({
  2. el: "html",
  3. data: {
  4. loading: true,
  5. dataList:"",
  6. userInfo:""
  7. },
  8. computed: {},
  9. ready: function () {
  10. this.getDataList();
  11. this.getUserInfo();
  12. },
  13. methods: {
  14. getDataList: function () {
  15. var _self = this;
  16. $.ajax({
  17. url: baseConfig.URL.menuList + "",
  18. type: "get",
  19. data:{},
  20. cache: false,
  21. success:function (res) {
  22. console.log(res);
  23. _self.dataList = res.list;
  24. },
  25. complete:function (XHR, TS) {
  26. // $('.ui-dialog-buttonpane').find('button:contains("保存添加信息")').removeAttr("disabled");
  27. },
  28. error:function (XMLHttpRequest, textStatus, errorThrown) {
  29. alert(textStatus);
  30. }
  31. });
  32. },
  33. getUserInfo: function () {
  34. var _self = this;
  35. $.ajax({
  36. url: baseConfig.URL.loginInfo + "",
  37. type: "get",
  38. data:{},
  39. cache: false,
  40. success:function (res) {
  41. console.log(res);
  42. _self.userInfo = res.loginInfo;
  43. },
  44. complete:function (XHR, TS) {
  45. // $('.ui-dialog-buttonpane').find('button:contains("保存添加信息")').removeAttr("disabled");
  46. },
  47. error:function (XMLHttpRequest, textStatus, errorThrown) {
  48. alert(textStatus);
  49. }
  50. });
  51. }
  52. }
  53. });