index.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * hudw
  3. * 2022.03.10
  4. * 系统入口
  5. */
  6. (function () {
  7. // 页面初始检测登录状态
  8. // 页面初始配置
  9. Prolog.loginUrl = "/api/auth/login";
  10. Prolog.loginPage = "/";
  11. Prolog.refreshTokenUrl = "/api/token/refresh";
  12. //判断是否需要修改密码
  13. var sid = getQueryString("sid");
  14. var name = getQueryString("name");
  15. //获取通用参照数据-长策
  16. //获取url参数
  17. function getQueryString(name) {
  18. var url = decodeURI(window.location.search.substr(1));
  19. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  20. var r = url.match(reg);
  21. if (r != null) return unescape(r[2]);
  22. return null;
  23. }
  24. //默认空事件,主要用于表格操作列(组件升级后空按钮会造成行错位)
  25. //获取打印服务地址
  26. Prolog.ajax({
  27. url: "/maindata/sysParameter/query",
  28. type: "post",
  29. contentType: "application/json",
  30. data: JSON.stringify({ "search": "printServiceIP", "pageSize": 100, "pageNum": 1 }),
  31. success: function (res) {
  32. if (res.success) {
  33. let url = "http://127.0.0.1:6060/print";
  34. res.data.list.forEach(t => {
  35. if (userinfo.p_companyid == t.branchCode && t.parameterCode == "printServiceIP") {
  36. let arr = t.parameterValue.split(":");
  37. if (arr.length > 1)
  38. url = "http://" + t.parameterValue + "/print";
  39. else
  40. url = "http://" + t.parameterValue + ":6060/print";
  41. }
  42. });
  43. localStorage.setItem("printserviceip", url);
  44. }
  45. },
  46. error: function () { }
  47. });
  48. alertMessage_count();
  49. window.badgeInfoShow = function () {
  50. alertMessage_count();
  51. Sidebar.leafClick("RES1000000376", {
  52. PY_code: "YJTX",
  53. hash: "RES1000000376",
  54. id: "RES1000000376",
  55. leaf: 1,
  56. level: 2,
  57. menuId: "RES1000000376",
  58. name: "预警提醒",
  59. parentMenuId: "RES1000000048",
  60. path: "menu?path=auth/early_warning_alert",
  61. systemId: "plg-std-tms"
  62. });
  63. };
  64. var addressAnalysis_data = {
  65. key: "",
  66. data: {}
  67. };
  68. // 地址解析
  69. window.addressAnalysis_to = function ({ key, data }) {
  70. addressAnalysis_data.key = key;
  71. addressAnalysis_data.data = data;
  72. // navTab.deleteTabs("RES1000000353");
  73. Sidebar.leafClick("RES1000000353", {
  74. PY_code: "KHZBWH-GD",
  75. hash: "RES1000000353",
  76. id: "RES1000000353",
  77. leaf: 1,
  78. level: 2,
  79. menuId: "RES1000000353",
  80. name: "客户坐标维护-高德",
  81. parentMenuId: "RES1000000051",
  82. path: "/menu?path=tms/basic/customerCoordinatesGD",
  83. systemId: "plg-std-tms"
  84. });
  85. };
  86. // 地址解析返回
  87. window.addressAnalysis_return = function () {
  88. Sidebar.leafClick(addressAnalysis_data.key, addressAnalysis_data.data);
  89. addressAnalysis_data = {
  90. key: "",
  91. data: {}
  92. };
  93. };
  94. })();