detail4.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 = "list1.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.getSwenList = function () {
  27. self.SwenList = [];
  28. var data = {
  29. directionid: self.directionid,
  30. userid: self.userId,
  31. routeinfoid: self.routeinfoid,
  32. routeid: self.routeid,
  33. formeditid: ""
  34. }
  35. $http.post(apiurljs.login + "g2app/abase/queryDataLink", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  36. .success(function (obj) {
  37. var res = strToJson(s4.decryptData_CBC(obj.data));
  38. $.each(res.data.LINKS, function (index, item) {
  39. if (item.TEMPFORM.indexOf("?docmode") > 0) {
  40. if (item.TEMPFORM.indexOf("attachlist") > -1 || item.TEMPFORM.indexOf("fawenfile") > -1) {
  41. item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  42. } else {
  43. item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  44. }
  45. } else {
  46. item.TEMPFORM = "#";
  47. }
  48. self.SwenList.push(item)
  49. })
  50. self.Title = "流程图";
  51. self.SwenList.push({
  52. VNAME: "流程图",
  53. DIRECTIONID: self.SwenList[0].DIRECTIONID,
  54. TEMPFORM: "detail4.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  55. })
  56. self.getCopyrightid()
  57. })
  58. }
  59. self.getSwenList()
  60. self.getCopyrightid = function () {
  61. self.copyrightid = sp.getUrlName("copyrightid")
  62. self.url = "../../../bpmn/modeler_read.html?copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&userid=" + self.userId + "&routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid
  63. }
  64. //头部下滚冻结
  65. $(function () {
  66. setTimeout(function () {
  67. if ($(".ibox-content").height() < $(window).height() - 31) {
  68. $(".ibox-content").css("height", $(window).height() - 31)
  69. }
  70. $("iframe").css("height", $(".ibox-content").height() - 48)
  71. }, 1)
  72. })
  73. }])