123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- var copyrightid = sp.getUrlName("copyrightid");
- var directionid = sp.getUrlName("directionid");
- var userid = sp.getUrlName("userid");
- var routeid = sp.getUrlName("routeid");
- var routeinfoid = sp.getUrlName("routeinfoid");
- var get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- var bpmnModeler = new BpmnJS({
- container: '#canvas',
- //additionalModules: [customTranslateModule],
- keyboard: {
- bindTo: window
- },
- additionalModules: [{
- // 禁用左侧默认工具栏
- paletteProvider: ['value', ''], // 去不干净,还是默认生成空白 dom
- // // 禁用滚轮滚动
- // // 禁止拖动线
- bendpoints: ['value', ''],
- // // 禁止点击节点出现contextPad
- contextPadProvider: ['value', ''],
- // // 禁止双击节点出现label编辑框
- labelEditingProvider: ['value', '']
- }]
- });
- var diagramXML = "";
- var doneArray = [];
- var processArray = [];
- var waitArray = [];
- var doneLineArray = [];
- function importXML(xml) {
- // import diagram
- bpmnModeler.importXML(xml, function(err) {
- if (err) {
- return console.error('could not import BPMN 2.0 diagram', err);
- }
- var canvas = bpmnModeler.get('canvas');
- // zoom to fit full viewport
- canvas.zoom('fit-viewport');
- // canvas.addMarker('fifthTask_ANONYMOUS', 'highlight');
- //const successIds = highLightData.highLine.concat(highLightData.highPoint)
- //const procesingIds = highLightData.waitingToDo;
- setNodeColor(doneArray, bpmnModeler, 'nodeSuccess');
- setNodeColor(processArray, bpmnModeler, 'nodeProcing');
- setNodeColor(waitArray, bpmnModeler, 'nodeWaiting');
- setNodeColor(doneLineArray, bpmnModeler, 'nodeLineSuccess');
- });
- }
- function getXML() {
- $.ajax({
- type: "post",
- url: apiurljs.login + "workflow/getWorkFlowData",
- data: {
- "copyrightid": s4.encryptData_CBC(copyrightid)
- },
- dataType: "text",
- success: function(obj) {
- var response = strToJson(s4.decryptData_CBC(JSON.parse(obj).data))
- let domParser = new DOMParser();
- let xmlDom = domParser.parseFromString(response, 'text/xml')
- let xmlTaskDom = xmlDom.getElementsByTagName('task')
- let infoArray_ = angular.element(document.body).scope().ctl.infoArray
- for (let i = 0; i < xmlTaskDom.length; i++) {
- let task = xmlTaskDom[i]
- let names = []
- infoArray_.forEach((item => {
- let ENDNODEID = item.ENDNODEID
- let USERNAMEFROM = item.USERNAMEFROM
- if (ENDNODEID == task.id) {
- if(names.indexOf(item.USERNAME) == -1){
- names.push(item.USERNAME)
- }
- // names.push(USERNAMEFROM)
- }
- }))
- if (names.length > 0) {
- let name = task.getAttribute('name')
- task.setAttribute("name", name + `\n(${names.join(',')})`)
- }
- }
- var sXML = new XMLSerializer()
- diagramXML = sXML.serializeToString(xmlDom);
- if (diagramXML == "") {
- //美观版,带边框的
- //diagramXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:omgdc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:omgdi=\"http://www.omg.org/spec/DD/20100524/DI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" targetNamespace=\"\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd\"> <collaboration id=\"sid-c0e745ff-361e-4afb-8c8d-2a1fc32b1424\"> <participant id=\"sid-87F4C1D6-25E1-4A45-9DA7-AD945993D06F\" name=\"工作流程\" processRef=\"sid-C3803939-0872-457F-8336-EAE484DC4A04\" /> </collaboration> <process id=\"sid-C3803939-0872-457F-8336-EAE484DC4A04\" name=\"Customer\" processType=\"None\" isClosed=\"false\" isExecutable=\"false\"> <extensionElements /> <laneSet id=\"sid-b167d0d7-e761-4636-9200-76b7f0e8e83a\"> <lane id=\"sid-57E4FE0D-18E4-478D-BC5D-B15164E93254\"> <flowNodeRef>sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138</flowNodeRef> <flowNodeRef>sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26</flowNodeRef> <flowNodeRef>sid-E433566C-2289-4BEB-A19C-1697048900D2</flowNodeRef> </lane> </laneSet> <startEvent id=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138\" name=\"开始\"> <outgoing>sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD</outgoing> </startEvent> <task id=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\" name=\"开始工作\"> <incoming>sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD</incoming> <outgoing>sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A</outgoing> </task> <sequenceFlow id=\"sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD\" name=\"填报表单\" sourceRef=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138\" targetRef=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\" /> <sequenceFlow id=\"sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A\" name=\"转结束\" sourceRef=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\" targetRef=\"sid-E433566C-2289-4BEB-A19C-1697048900D2\" /> <endEvent id=\"sid-E433566C-2289-4BEB-A19C-1697048900D2\" name=\"结束\"> <incoming>sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A</incoming> </endEvent> </process> <bpmndi:BPMNDiagram id=\"sid-74620812-92c4-44e5-949c-aa47393d3830\"> <bpmndi:BPMNPlane id=\"sid-cdcae759-2af7-4a6d-bd02-53f3352a731d\" bpmnElement=\"sid-c0e745ff-361e-4afb-8c8d-2a1fc32b1424\"> <bpmndi:BPMNShape id=\"sid-87F4C1D6-25E1-4A45-9DA7-AD945993D06F_gui\" bpmnElement=\"sid-87F4C1D6-25E1-4A45-9DA7-AD945993D06F\" isHorizontal=\"true\"> <omgdc:Bounds x=\"42.5\" y=\"75\" width=\"933\" height=\"250\" /> <bpmndi:BPMNLabel labelStyle=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\"> <omgdc:Bounds x=\"47.49999999999999\" y=\"170.42857360839844\" width=\"12.000000000000014\" height=\"59.142852783203125\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id=\"sid-57E4FE0D-18E4-478D-BC5D-B15164E93254_gui\" bpmnElement=\"sid-57E4FE0D-18E4-478D-BC5D-B15164E93254\" isHorizontal=\"true\"> <omgdc:Bounds x=\"72.5\" y=\"75\" width=\"903\" height=\"250\" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138_gui\" bpmnElement=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138\"> <omgdc:Bounds x=\"150\" y=\"165\" width=\"30\" height=\"30\" /> <bpmndi:BPMNLabel labelStyle=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\"> <omgdc:Bounds x=\"152\" y=\"197\" width=\"26\" height=\"14\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26_gui\" bpmnElement=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\"> <omgdc:Bounds x=\"352.5\" y=\"140\" width=\"100\" height=\"80\" /> <bpmndi:BPMNLabel labelStyle=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\"> <omgdc:Bounds x=\"360.5\" y=\"172\" width=\"84\" height=\"12\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id=\"sid-E433566C-2289-4BEB-A19C-1697048900D2_gui\" bpmnElement=\"sid-E433566C-2289-4BEB-A19C-1697048900D2\"> <omgdc:Bounds x=\"634\" y=\"166\" width=\"28\" height=\"28\" /> <bpmndi:BPMNLabel labelStyle=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\"> <omgdc:Bounds x=\"635\" y=\"196\" width=\"26\" height=\"14\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id=\"sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A_gui\" bpmnElement=\"sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A\"> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"453\" y=\"180\" /> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"635\" y=\"180\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"525\" y=\"155\" width=\"38\" height=\"14\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id=\"sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD_gui\" bpmnElement=\"sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD\"> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"179\" y=\"180\" /> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"353\" y=\"180\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"241\" y=\"155\" width=\"50\" height=\"14\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> <bpmndi:BPMNLabelStyle id=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\"> <omgdc:Font name=\"Arial\" size=\"11\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" /> </bpmndi:BPMNLabelStyle> <bpmndi:BPMNLabelStyle id=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\"> <omgdc:Font name=\"Arial\" size=\"12\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" /> </bpmndi:BPMNLabelStyle> </bpmndi:BPMNDiagram> </definitions>\r\n\r\n";
- //最简版,不带边框
- diagramXML =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:omgdc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:omgdi=\"http://www.omg.org/spec/DD/20100524/DI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" targetNamespace=\"\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd\"> <process id=\"Process_0ou37ig\"> <startEvent id=\"StartEvent_142ym73\" name=\"开始\"> <outgoing>SequenceFlow_0gqlk33</outgoing> </startEvent> <task id=\"Task_020vyoo\" name=\"开始工作\"> <incoming>SequenceFlow_0gqlk33</incoming> <outgoing>SequenceFlow_02bni32</outgoing> </task> <sequenceFlow id=\"SequenceFlow_0gqlk33\" name=\"填报表单\" sourceRef=\"StartEvent_142ym73\" targetRef=\"Task_020vyoo\" /> <endEvent id=\"EndEvent_1wus1l9\" name=\"结束\"> <incoming>SequenceFlow_02bni32</incoming> </endEvent> <sequenceFlow id=\"SequenceFlow_02bni32\" name=\"转结束\" sourceRef=\"Task_020vyoo\" targetRef=\"EndEvent_1wus1l9\" /> </process> <bpmndi:BPMNDiagram id=\"sid-74620812-92c4-44e5-949c-aa47393d3830\"> <bpmndi:BPMNPlane id=\"sid-cdcae759-2af7-4a6d-bd02-53f3352a731d\" bpmnElement=\"Process_0ou37ig\"> <bpmndi:BPMNShape id=\"StartEvent_142ym73_di\" bpmnElement=\"StartEvent_142ym73\"> <omgdc:Bounds x=\"115.14214214214215\" y=\"96.31831831831832\" width=\"36\" height=\"36\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"122\" y=\"135\" width=\"22\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id=\"Task_020vyoo_di\" bpmnElement=\"Task_020vyoo\"> <omgdc:Bounds x=\"281.17217217217216\" y=\"74\" width=\"100\" height=\"80\" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id=\"SequenceFlow_0gqlk33_di\" bpmnElement=\"SequenceFlow_0gqlk33\"> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"151\" y=\"114\" /> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"281\" y=\"114\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"194.74712643678163\" y=\"92\" width=\"44\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id=\"EndEvent_1wus1l9_di\" bpmnElement=\"EndEvent_1wus1l9\"> <omgdc:Bounds x=\"544.1721721721722\" y=\"96\" width=\"36\" height=\"36\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"551\" y=\"135\" width=\"22\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id=\"SequenceFlow_02bni32_di\" bpmnElement=\"SequenceFlow_02bni32\"> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"381\" y=\"114\" /> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"544\" y=\"114\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"446\" y=\"92\" width=\"33\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> <bpmndi:BPMNLabelStyle id=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\"> <omgdc:Font name=\"Arial\" size=\"11\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" /> </bpmndi:BPMNLabelStyle> <bpmndi:BPMNLabelStyle id=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\"> <omgdc:Font name=\"Arial\" size=\"12\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" /> </bpmndi:BPMNLabelStyle> </bpmndi:BPMNDiagram> </definitions> ";
- }
- importXML(diagramXML);
- },
- error: function(response) {
- diagramXML =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:omgdc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:omgdi=\"http://www.omg.org/spec/DD/20100524/DI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" targetNamespace=\"\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd\"> <process id=\"Process_0ou37ig\"> <startEvent id=\"StartEvent_142ym73\" name=\"开始\"> <outgoing>SequenceFlow_0gqlk33</outgoing> </startEvent> <task id=\"Task_020vyoo\" name=\"开始工作\"> <incoming>SequenceFlow_0gqlk33</incoming> <outgoing>SequenceFlow_02bni32</outgoing> </task> <sequenceFlow id=\"SequenceFlow_0gqlk33\" name=\"填报表单\" sourceRef=\"StartEvent_142ym73\" targetRef=\"Task_020vyoo\" /> <endEvent id=\"EndEvent_1wus1l9\" name=\"结束\"> <incoming>SequenceFlow_02bni32</incoming> </endEvent> <sequenceFlow id=\"SequenceFlow_02bni32\" name=\"转结束\" sourceRef=\"Task_020vyoo\" targetRef=\"EndEvent_1wus1l9\" /> </process> <bpmndi:BPMNDiagram id=\"sid-74620812-92c4-44e5-949c-aa47393d3830\"> <bpmndi:BPMNPlane id=\"sid-cdcae759-2af7-4a6d-bd02-53f3352a731d\" bpmnElement=\"Process_0ou37ig\"> <bpmndi:BPMNShape id=\"StartEvent_142ym73_di\" bpmnElement=\"StartEvent_142ym73\"> <omgdc:Bounds x=\"115.14214214214215\" y=\"96.31831831831832\" width=\"36\" height=\"36\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"122\" y=\"135\" width=\"22\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id=\"Task_020vyoo_di\" bpmnElement=\"Task_020vyoo\"> <omgdc:Bounds x=\"281.17217217217216\" y=\"74\" width=\"100\" height=\"80\" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id=\"SequenceFlow_0gqlk33_di\" bpmnElement=\"SequenceFlow_0gqlk33\"> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"151\" y=\"114\" /> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"281\" y=\"114\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"194.74712643678163\" y=\"92\" width=\"44\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id=\"EndEvent_1wus1l9_di\" bpmnElement=\"EndEvent_1wus1l9\"> <omgdc:Bounds x=\"544.1721721721722\" y=\"96\" width=\"36\" height=\"36\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"551\" y=\"135\" width=\"22\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id=\"SequenceFlow_02bni32_di\" bpmnElement=\"SequenceFlow_02bni32\"> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"381\" y=\"114\" /> <omgdi:waypoint xsi:type=\"omgdc:Point\" x=\"544\" y=\"114\" /> <bpmndi:BPMNLabel> <omgdc:Bounds x=\"446\" y=\"92\" width=\"33\" height=\"17\" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> <bpmndi:BPMNLabelStyle id=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\"> <omgdc:Font name=\"Arial\" size=\"11\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" /> </bpmndi:BPMNLabelStyle> <bpmndi:BPMNLabelStyle id=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\"> <omgdc:Font name=\"Arial\" size=\"12\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" /> </bpmndi:BPMNLabelStyle> </bpmndi:BPMNDiagram> </definitions> ";
- }
- });
- }
- function getRouteList() {
- var postData = {
- directionid: directionid,
- userid: userid,
- routeid: routeid,
- routeinfoid: routeinfoid,
- }
- $.ajax({
- type: "post",
- url: apiurljs.login + "g2app/abase/queryDataRouteList",
- headers: {
- Authorization: "Bearer " + get_AccessToken,
- },
- data: JSON.stringify({
- data: s4.encryptData_CBC(JSON.stringify(postData))
- }),
- dataType: "json",
- contentType: "application/json",
- success: function(obj) {
- var response = strToJson(s4.decryptData_CBC(obj.data));
- angular.element(document.body).scope().ctl.infoArray = response.data;
- response.data.forEach(function(item, index) {
- if (item.DIRECTIONID) {
- item.DIRECTIONID = item.DIRECTIONID.replace("_" + copyrightid, "");
- }
- if (item.STARTNODEID) {
- item.STARTNODEID = item.STARTNODEID.replace("_" + copyrightid, "");
- }
- if (item.ENDNODEID) {
- item.ENDNODEID = item.ENDNODEID.replace("_" + copyrightid, "");
- }
- })
- //流转记录长读等于1 表示
- if (response.data.length == 1) {
- doneArray.push(response.data[0].STARTNODEID);
- doneLineArray.push(response.data[0].DIRECTIONID);
- if (response.data[0].STATUS == "1") {
- waitArray.push(item.ENDNODEID);
- } else if (response.data[0].STATUS == "2" || response.data[0].STATUS ==
- "0") {
- processArray.push(response.data[0].ENDNODEID);
- }
- } else {
- response.data.forEach(function(item, index) {
- doneLineArray.push(item.DIRECTIONID);
- if (index != response.data.length - 1) {
- doneArray.push(item.STARTNODEID);
- doneArray.push(item.ENDNODEID);
- } else {
- var myDeal = false;
- var myInfo = "";
- var isEnd = false;
- if (item.USERID == "STOP") {
- isEnd = true;
- }
- if (item.USERID == userid) {
- myDeal = true;
- myInfo = item;
- }
- if (isEnd) {
- doneArray.push(item.ENDNODEID);
- } else {
- if (myDeal) {
- if (myInfo.STATUS == "1") {
- waitArray.push(item.ENDNODEID);
- } else if (myInfo.STATUS == "2") {
- processArray.push(item.ENDNODEID);
- }
- } else {
- if (item.STATUS == "1") {
- waitArray.push(item.ENDNODEID);
- } else if (item.STATUS == "2") {
- processArray.push(item.ENDNODEID);
- }
- }
- }
- }
- })
- }
- getXML()
- },
- error: function(response) {
- console.log(response);
- }
- });
- }
- function setNodeColor(ids, newBpmn, colorClass) {
- var elementRegistry = newBpmn.get('elementRegistry');
- //流程图过长解析需要时间
- setTimeout(function () {
- ids.forEach(function (item) {
- if (elementRegistry._elements[item]) {
- var element = elementRegistry._elements[item].gfx
- element.classList.add(colorClass)
- }
- })
- }, 100)
- }
- var app = angular.module('app', []);
- //定义一个全局的截图插件变量
- var cropper;
- app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$sce", function($scope, $http, $timeout, $sce) {
- var self = this;
- var s4 = new SM4Util();
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.userName = $.cookie("GlWorkPlatform-chineseName");
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- self.tabOpen = false; //右侧是否打开
- self.infoArray = [];
- self.loadXML1 = function() {
- getRouteList();
- }
- self.loadXML2 = function() {
- getXML();
- }
- self.changeInfoTab = function() {
- self.tabOpen = !self.tabOpen;
- self.loadXML2();
- }
- self.loadXML1();
- self.getItemNode = function(obj) {
- self.tabOpen = true; //右侧是否打开
- self.loadXML2();
- $scope.$apply();
- var indexNum = -1;
- self.infoArray.forEach(function(item, index) {
- if (obj.id == item.ENDNODEID) {
- indexNum = index;
- }
- })
- if (indexNum > -1) {
- setTimeout(function() {
- $(".right-show-content").scrollTop($(".item-flow-info").eq(indexNum).offset()
- .top);
- }, 100)
- } else {
- setTimeout(function() {
- $(".right-show-content").scrollTop(0);
- }, 100)
- }
- }
- }])
|