You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
2.8 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.03.22
  6. * 描 述:个人中心
  7. */
  8. var baseinfo;
  9. var refreshGirdData;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initleft();
  15. page.bind();
  16. page.initData();
  17. },
  18. bind: function () {
  19. },
  20. initleft: function () {
  21. $('#lr_left_list li').on('click', function () {
  22. var $this = $(this);
  23. if (!$this.hasClass('active')) {
  24. var $parent = $this.parent();
  25. $parent.find('.active').removeClass('active');
  26. $this.addClass('active');
  27. var _type = $this.attr('data-value');
  28. $('.lr-layout-wrap-item').removeClass('active');
  29. $('#lr_layout_item' + _type).addClass('active');
  30. }
  31. });
  32. },
  33. initData: function () {
  34. learun.httpAsyncGet(top.$.rootUrl + '/UserCenter/GetUserInfo', function (res) {
  35. if (res.code == 200) {
  36. baseinfo = res.data.baseinfo;
  37. /*基础信息*/
  38. $('#F_Account').val(baseinfo.account);
  39. $('#F_EnCode').val(baseinfo.enCode);
  40. $('#F_RealName').val(baseinfo.realName);
  41. $('#F_Gender').val(baseinfo.gender == 0 ? '女' : '男');
  42. learun.clientdata.getAsync('company', {
  43. key: baseinfo.companyId,
  44. callback: function (_data) {
  45. $('#F_Company').val(_data.name);
  46. }
  47. });
  48. learun.clientdata.getAsync('department', {
  49. key: baseinfo.departmentId,
  50. callback: function (_data) {
  51. $('#F_Department').val(_data.name);
  52. }
  53. });
  54. var post = [], role = [];
  55. $.each(res.data.post, function (id, item) {
  56. post.push(item.F_Name);
  57. });
  58. $.each(res.data.role, function (id, item) {
  59. role.push(item.F_FullName);
  60. });
  61. $('#Post').val(String(post));
  62. $('#Role').val(String(role));
  63. $('#F_Description').val(baseinfo.description);
  64. }
  65. else {
  66. learun.alert.error('数据加载失败');
  67. }
  68. }.bind(this));
  69. }
  70. };
  71. refreshGirdData = function () {
  72. location.reload();
  73. };
  74. page.init();
  75. }