modeler_read.js 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. item.TEMPFORM = item.TEMPFORM + "&flowid=" + sp.getUrlName("flowid")
  41. if (item.TEMPFORM.indexOf("?docmode") > 0) {
  42. if (item.TEMPFORM.indexOf("attachlist") > -1 || item.TEMPFORM.indexOf("fawenfile") > -1) {
  43. item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  44. } else {
  45. item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  46. }
  47. } else {
  48. item.TEMPFORM = "#";
  49. }
  50. self.SwenList.push(item)
  51. })
  52. self.Title = "流程图";
  53. self.SwenList.push({
  54. VNAME: "流程图",
  55. DIRECTIONID: self.SwenList[0].DIRECTIONID,
  56. TEMPFORM: "modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  57. })
  58. self.getCopyrightid()
  59. self.getRoutelist()
  60. })
  61. }
  62. self.getSwenList()
  63. self.getCopyrightid = function () {
  64. self.copyrightid = sp.getUrlName("copyrightid")
  65. self.url = "../../../bpmn/modeler_read.html?copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&userid=" + self.userId + "&routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid
  66. }
  67. self.getRoutelist = function () {
  68. self.routelist = "../../RouteList.html?directionid=" + self.directionid + "&userid=" + self.userId + "&routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid
  69. }
  70. //头部下滚冻结
  71. $(function () {
  72. setTimeout(function () {
  73. if ($(".ibox-content").height() < $(window).height() - 31) {
  74. $(".ibox-content").css("height", $(window).height() - 31)
  75. }
  76. $("iframe").css("height", $(".ibox-content").height() - 48)
  77. }, 1)
  78. })
  79. }])