modeler_read.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. 'use strict';
  2. var app = angular.module('app', [
  3. ]);
  4. app.controller("formeditCtrl", ["$scope", "$http", "$timeout", '$sce', function ($scope, $http, $timeout, $sce) {
  5. var self = this;
  6. var s4 = new SM4Util();
  7. self.userId = $.cookie("GlWorkPlatform-userid");
  8. self.userName = $.cookie("GlWorkPlatform-chineseName");
  9. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  10. self.routeid = sp.getUrlName("routeid");
  11. self.routeinfoid = sp.getUrlName("routeinfoid");
  12. self.directionid = sp.getUrlName("directionid");
  13. self.formeditid = sp.getUrlName("formeditid");
  14. self.docmode = sp.getUrlName("docmode");
  15. self.dotype = sp.getUrlName("dotype");
  16. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  17. self.get_lastReturnPage = sp.getUrlName("lastReturnPage");
  18. self.get_type = sp.getUrlName("type");
  19. self.return = "../list.html?lastReturnPageno=" + self.get_lastReturnPageno + "&type=" + self.get_type
  20. var postCfg = {
  21. headers: {
  22. 'Content-Type': 'application/json',
  23. 'Authorization': "Bearer " + self.get_AccessToken
  24. }
  25. };
  26. self.active = 1;
  27. self.getSwenList = function () {
  28. self.SwenList = [];
  29. var data = {
  30. directionid: self.directionid,
  31. userid: self.userId,
  32. routeinfoid: self.routeinfoid,
  33. routeid: self.routeid,
  34. formeditid: ""
  35. }
  36. $http.post(apiurljs.login + "g2app/abase/queryDataLink", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  37. .success(function (obj) {
  38. var res = strToJson(s4.decryptData_CBC(obj.data));
  39. $.each(res.data.LINKS, function (index, item) {
  40. if (item.TEMPFORM.indexOf("?docmode") > 0) {
  41. if (item.TEMPFORM.indexOf("attachlist") > -1) {
  42. item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  43. } else {
  44. item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  45. }
  46. } else {
  47. item.TEMPFORM = "#";
  48. }
  49. self.SwenList.push(item)
  50. })
  51. self.Title = "流程图";
  52. self.SwenList.push({
  53. VNAME: "流程图",
  54. DIRECTIONID: self.SwenList[0].DIRECTIONID,
  55. TEMPFORM: "modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  56. })
  57. self.getCopyrightid()
  58. self.getRoutelist()
  59. })
  60. }
  61. self.getSwenList()
  62. self.getCopyrightid = function () {
  63. self.copyrightid = sp.getUrlName("copyrightid")
  64. self.url = "../../../bpmn/modeler_read.html?copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&userid=" + self.userId + "&routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid
  65. }
  66. self.getRoutelist = function () {
  67. self.routelist = "../../RouteList.html?directionid=" + self.directionid + "&userid=" + self.userId + "&routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid
  68. }
  69. //头部下滚冻结
  70. $(function () {
  71. setTimeout(function () {
  72. if ($(".ibox-content").height() < $(window).height() - 31) {
  73. $(".ibox-content").css("height", $(window).height() - 31)
  74. }
  75. $("iframe").css("height", $(".ibox-content").height() - 48)
  76. }, 1)
  77. })
  78. }])