ToB企服应用市场:ToB评测及商务社交产业平台

标题: boot-admin整合flowable官方editor-app进行BPMN2.0建模 [打印本页]

作者: 郭卫东    时间: 2023-4-20 21:22
标题: boot-admin整合flowable官方editor-app进行BPMN2.0建模
正所谓百家争鸣、见仁见智、众说纷纭、各有千秋!在工作流bpmn2.0可视化建模工具实现的细分领域,网上扑面而来的是 bpmn.js 这个渲染工具包和web建模器,而笔者却认为使用flowable官方开源 editor-app 才是王道。
Flowable 开源版本中的 web 版流程设计器editor-app,展示风格和功能基本跟 activiti-modeler 一样,集成简单,开发工作量小,界面美观大方,功能强大,用户体验友好。
通过以下两张Gif动图来个PK,您的直观感受如何呢?
bpmn.js运行效果图(gif动图取自互联网)

Flowable editor-app运行效果:

boot-admin 是一款采用前后端分离模式、基于SpringCloud微服务架构的SaaS后台管理框架。系统内置基础管理、权限管理、运行管理、定义管理、代码生成器和办公管理6个功能模块,集成分布式事务Seata、工作流引擎Flowable、业务规则引擎Drools、后台作业调度框架Quartz等,技术栈包括Mybatis-plus、Redis、Nacos、Seata、Flowable、Drools、Quartz、SpringCloud、Springboot Admin Gateway、Liquibase、jwt、Openfeign、I18n等。
gitee源码地址
github源码地址
下面介绍 boot-admin 对flowable官方bpmn2.0可视化建模工具 editor-app 的集成改造步骤:
获取前端源码

modeler.html内容:
  1. <!doctype html>
  2. <html >
  3. <head>
  4.     <meta charset="utf-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <title>Activiti Editor</title>
  7.     <meta name="description" content="">
  8.     <meta name="viewport"
  9.           content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width">
  10.    
  11.     <link rel="Stylesheet" media="screen" href="/editor-app/libs/ng-grid-2.0.7.min.css" type="text/css"/>
  12.     <link rel="stylesheet" href="/editor-app/libs/bootstrap_3.1.1/css/bootstrap.min.css"/>
  13.     <link rel="Stylesheet" media="screen" href="/editor-app/editor/css/editor.css" type="text/css"/>
  14.     <link rel="stylesheet" href="/editor-app/css/style.css" type="text/css"/>
  15.     <link rel="stylesheet" href="/editor-app/css/style-common.css">
  16.     <link rel="stylesheet" href="/editor-app/css/style-editor.css">
  17. </head>
  18. <body>
  19.        
  20.        
  21.             
  22.                 <i
  23.                    ng-></i>
  24.                 {{alerts.current.message}}
  25.                  0">
  26.                     {{alerts.queue.length + 1}}
  27.                 
  28.             
  29.        
  30.        
  31.        
  32.        
  33.        
  34.        
  35.        
  36.        
  37.        
  38.        
  39.        
  40.        
  41.        
  42.        
  43.        
  44.        
  45.        
  46.        
  47.        
  48.        
  49.        
  50.        
  51.        
  52.        
  53.        
  54.        
  55.        
  56.        
  57.        
  58.        
  59.        
  60.        
  61.        
  62.        
  63.        
  64.        
  65.        
  66.        
  67.        
  68.        
  69.        
  70.        
  71.        
  72.        
  73.        
  74.        
  75.        
  76.        
  77.        
  78.        
  79.        
  80.        
  81.        
  82.        
  83.        
  84.        
  85.        
  86.        
  87.        
  88.        
  89.        
  90.        
  91.        
  92. </body>
  93. </html>
复制代码
整合改造前端源码

  1. var ACTIVITI = ACTIVITI || {};
  2. ACTIVITI.CONFIG = {
  3.         'contextRoot' : 'http://网关IP:网关端口号/api/workflow/auth/activiti',
  4. };
复制代码
  1. var KISBPM = KISBPM || {};
  2. KISBPM.URL = {
  3.   //通过modelId,获取已保存模型的json数据
  4.   getModel: function(modelId) {
  5.     return ACTIVITI.CONFIG.contextRoot + '/model/json?modelId=' + modelId;
  6.   },
  7.   //获取汉化资源json数据
  8.   getStencilSet: function() {
  9.     return ACTIVITI.CONFIG.contextRoot + '/editor/stencilset?version=' + Date.now();
  10.   },
  11.   //保存模型数据
  12.   putModel: function(modelId) {
  13.     return ACTIVITI.CONFIG.contextRoot + '/model/save?modelId=' + modelId;
  14.   },
  15.   //从cookie中读取令牌
  16.   getToken: function() {
  17.     var cookies = document.cookie;
  18.     var list = cookies.split("; "); // 解析出名/值对列表
  19.     for (var i = 0; i < list.length; i++) {
  20.       var arr = list[i].split("="); // 解析出名和值
  21.       if (arr[0] == "Admin-Token") {
  22.         var cookieVal = decodeURIComponent(arr[1]); // 对cookie值解码
  23.         break;
  24.       }
  25.     }
  26.     return 'Bearer' + cookieVal;
  27.   }
  28. };
复制代码
  1.             $http({method: 'GET',
  2.             headers: {
  3.                   'X-Token': KISBPM.URL.getToken()
  4.               },
  5.             url: KISBPM.URL.getStencilSet()})
  6.             .success(function (data, status, headers, config) {
  7.                     var quickMenuDefinition = ['UserTask', 'EndNoneEvent', 'ExclusiveGateway',
  8.                                                'CatchTimerEvent', 'ThrowNoneEvent', 'TextAnnotation',
  9.                                                'SequenceFlow', 'Association'];
  10.                     var ignoreForPaletteDefinition = ['SequenceFlow', 'MessageFlow', 'Association', 'DataAssociation', 'DataStore', 'SendTask'];
  11.                     var quickMenuItems = [];
  12.                     var morphRoles = [];
  13.                 for (var i = 0; i < data.rules.morphingRules.length; i++)
  14.                 {
  15.                     var role = data.rules.morphingRules[i].role;
  16.                     var roleItem = {'role': role, 'morphOptions': []};
  17.                     morphRoles.push(roleItem);
  18.                 }
  19.                 // Check all received items
  20.                 for (var stencilIndex = 0; stencilIndex < data.stencils.length; stencilIndex++)
  21.                 {
  22.                         // Check if the root group is the 'diagram' group. If so, this item should not be shown.
  23.                     var currentGroupName = data.stencils[stencilIndex].groups[0];
  24.                     if (currentGroupName === 'Diagram' || currentGroupName === 'Form') {
  25.                         continue;  // go to next item
  26.                     }
  27.                     var removed = false;
  28.                     if (data.stencils[stencilIndex].removed) {
  29.                         removed = true;
  30.                     }
  31.                     var currentGroup = undefined;
  32.                     if (!removed) {
  33.                         // Check if this group already exists. If not, we create a new one
  34.                         if (currentGroupName !== null && currentGroupName !== undefined && currentGroupName.length > 0) {
  35.                             currentGroup = findGroup(currentGroupName, stencilItemGroups); // Find group in root groups array
  36.                             if (currentGroup === null) {
  37. <template>
  38.   
  39.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  40.       
  41.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  42.           frameborder="0" ></iframe>
  43.       
  44.     </el-dialog>
  45.   
  46. </template>currentGroup = addGroup(currentGroupName, stencilItemGroups);
  47.                             }
  48.                             // Add all child groups (if any)
  49.                             for (var groupIndex = 1; groupIndex < data.stencils[stencilIndex].groups.length; groupIndex++) {
  50. <template>
  51.   
  52.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  53.       
  54.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  55.           frameborder="0" ></iframe>
  56.       
  57.     </el-dialog>
  58.   
  59. </template>var childGroupName = data.stencils[stencilIndex].groups[groupIndex];
  60. <template>
  61.   
  62.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  63.       
  64.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  65.           frameborder="0" ></iframe>
  66.       
  67.     </el-dialog>
  68.   
  69. </template>var childGroup = findGroup(childGroupName, currentGroup.groups);
  70. <template>
  71.   
  72.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  73.       
  74.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  75.           frameborder="0" ></iframe>
  76.       
  77.     </el-dialog>
  78.   
  79. </template>if (childGroup === null) {
  80. <template>
  81.   
  82.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  83.       
  84.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  85.           frameborder="0" ></iframe>
  86.       
  87.     </el-dialog>
  88.   
  89. </template>    childGroup = addGroup(childGroupName, currentGroup.groups);
  90. <template>
  91.   
  92.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  93.       
  94.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  95.           frameborder="0" ></iframe>
  96.       
  97.     </el-dialog>
  98.   
  99. </template>}
  100. <template>
  101.   
  102.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  103.       
  104.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  105.           frameborder="0" ></iframe>
  106.       
  107.     </el-dialog>
  108.   
  109. </template>// The current group variable holds the parent of the next group (if any),
  110. <template>
  111.   
  112.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  113.       
  114.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  115.           frameborder="0" ></iframe>
  116.       
  117.     </el-dialog>
  118.   
  119. </template>// and is basically the last element in the array of groups defined in the stencil item
  120. <template>
  121.   
  122.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  123.       
  124.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  125.           frameborder="0" ></iframe>
  126.       
  127.     </el-dialog>
  128.   
  129. </template>currentGroup = childGroup;
  130.                             }
  131.                         }
  132.                     }
  133.                     // Construct the stencil item
  134.                     var stencilItem = {'id': data.stencils[stencilIndex].id,
  135.                         'name': data.stencils[stencilIndex].title,
  136.                         'description': data.stencils[stencilIndex].description,
  137.                         'icon': data.stencils[stencilIndex].icon,
  138.                         'type': data.stencils[stencilIndex].type,
  139.                         'roles': data.stencils[stencilIndex].roles,
  140.                         'removed': removed,
  141.                         'customIcon': false,
  142.                         'canConnect': false,
  143.                         'canConnectTo': false,
  144.                         'canConnectAssociation': false};
  145.                     if (data.stencils[stencilIndex].customIconId && data.stencils[stencilIndex].customIconId > 0) {
  146.                         stencilItem.customIcon = true;
  147.                         stencilItem.icon = data.stencils[stencilIndex].customIconId;
  148.                     }
  149.                     if (!removed) {
  150.                         if (quickMenuDefinition.indexOf(stencilItem.id) >= 0) {
  151.                                 quickMenuItems[quickMenuDefinition.indexOf(stencilItem.id)] = stencilItem;
  152.                         }
  153.                     }
  154.                     if (stencilItem.id === 'TextAnnotation' || stencilItem.id === 'BoundaryCompensationEvent') {
  155.                             stencilItem.canConnectAssociation = true;
  156.                     }
  157.                     for (var i = 0; i < data.stencils[stencilIndex].roles.length; i++) {
  158.                             var stencilRole = data.stencils[stencilIndex].roles[i];
  159.                             if (stencilRole === 'sequence_start') {
  160.                                     stencilItem.canConnect = true;
  161.                             } else if (stencilRole === 'sequence_end') {
  162.                                     stencilItem.canConnectTo = true;
  163.                             }
  164.                             for (var j = 0; j < morphRoles.length; j++) {
  165.                                     if (stencilRole === morphRoles[j].role) {
  166.                                         if (!removed) {
  167.                                                  morphRoles[j].morphOptions.push(stencilItem);
  168.                                             }
  169.                                             stencilItem.morphRole = morphRoles[j].role;
  170.                                             break;
  171.                                     }
  172.                             }
  173.                     }
  174.                     if (currentGroup) {
  175.                             // Add the stencil item to the correct group
  176.                             currentGroup.items.push(stencilItem);
  177.                             if (ignoreForPaletteDefinition.indexOf(stencilItem.id) < 0) {
  178.                                     currentGroup.paletteItems.push(stencilItem);
  179.                             }
  180.                     } else {
  181.                         // It's a root stencil element
  182.                         if (!removed) {
  183.                             stencilItemGroups.push(stencilItem);
  184.                         }
  185.                     }
  186.                 }
  187.                 for (var i = 0; i < stencilItemGroups.length; i++)
  188.                 {
  189.                         if (stencilItemGroups[i].paletteItems && stencilItemGroups[i].paletteItems.length == 0)
  190.                         {
  191.                                 stencilItemGroups[i].visible = false;
  192.                         }
  193.                 }
  194.                 $scope.stencilItemGroups = stencilItemGroups;
  195.                 var containmentRules = [];
  196.                 for (var i = 0; i < data.rules.containmentRules.length; i++)
  197.                 {
  198.                     var rule = data.rules.containmentRules[i];
  199.                     containmentRules.push(rule);
  200.                 }
  201.                 $scope.containmentRules = containmentRules;
  202.                 // remove quick menu items which are not available anymore due to custom pallette
  203.                 var availableQuickMenuItems = [];
  204.                 for (var i = 0; i < quickMenuItems.length; i++)
  205.                 {
  206.                     if (quickMenuItems[i]) {
  207.                         availableQuickMenuItems[availableQuickMenuItems.length] = quickMenuItems[i];
  208.                     }
  209.                 }
  210.                 $scope.quickMenuItems = availableQuickMenuItems;
  211.                 $scope.morphRoles = morphRoles;
  212.             }).
  213.             error(function (data, status, headers, config) {
  214.                 console.log('Something went wrong when fetching stencil items:' + JSON.stringify(data));
  215.             });
复制代码
  1.             function fetchModel(modelId) {
  2.                 var modelUrl = KISBPM.URL.getModel(modelId);
  3.                 $http({method: 'GET',
  4.                 headers: {'X-Token': KISBPM.URL.getToken()},
  5.                 url: modelUrl}).
  6.                     success(function (data, status, headers, config) {
  7.                         $rootScope.editor = new ORYX.Editor(data);
  8.                         $rootScope.modelData = angular.fromJson(data);
  9.                         $rootScope.editorFactory.resolve();
  10.                     }).
  11.                     error(function (data, status, headers, config) {
  12.                       console.log('Error loading model with id ' + modelId + ' ' + data);
  13.                     });
  14.             }
复制代码
  1.         $http({    method: 'PUT',
  2.             data: params,
  3.             ignoreErrors: true,
  4.             headers: {'Accept': 'application/json',
  5.                       'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  6.                       'X-Token': KISBPM.URL.getToken()},
  7.             transformRequest: function (obj) {
  8.                 var str = [];
  9.                 for (var p in obj) {
  10.                     str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  11.                 }
  12.                 return str.join("&");
  13.             },
  14.             url: KISBPM.URL.putModel(modelMetaData.modelId)})
  15.             .success(function (data, status, headers, config) {
  16.                 $scope.editor.handleEvents({
  17.                     type: ORYX.CONFIG.EVENT_SAVED
  18.                 });
  19.                 $scope.modelData.name = $scope.saveDialog.name;
  20.                 $scope.modelData.lastUpdated = data.lastUpdated;
  21.                 $scope.status.loading = false;
  22.                 $scope.$hide();
  23.                 // Fire event to all who is listening
  24.                 var saveEvent = {
  25.                     type: KISBPM.eventBus.EVENT_TYPE_MODEL_SAVED,
  26.                     model: params,
  27.                     modelId: modelMetaData.modelId,
  28.                             eventType: 'update-model'
  29.                 };
  30.                 KISBPM.eventBus.dispatch(KISBPM.eventBus.EVENT_TYPE_MODEL_SAVED, saveEvent);
  31.                 // Reset state
  32.                 $scope.error = undefined;
  33.                 $scope.status.loading = false;
  34.                 // Execute any callback
  35.                 if (successCallback) {
  36.                     successCallback();
  37.                 }
  38.             })
  39.             .error(function (data, status, headers, config) {
  40.                 $scope.error = {};
  41.                 console.log('Something went wrong when updating the process model:' + JSON.stringify(data));
  42.                 $scope.status.loading = false;
  43.             });
复制代码
  1. <template>
  2.   
  3.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  4.       
  5.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  6.           frameborder="0" ></iframe>
  7.       
  8.     </el-dialog>
  9.   
  10. </template>
复制代码
  1. <template>
  2.   
  3.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  4.       
  5.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  6.           frameborder="0" ></iframe>
  7.       
  8.     </el-dialog>
  9.   
  10. </template><template>
  11.   
  12.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  13.       
  14.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  15.           frameborder="0" ></iframe>
  16.       
  17.     </el-dialog>
  18.   
  19. </template><template>
  20.   
  21.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  22.       
  23.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  24.           frameborder="0" ></iframe>
  25.       
  26.     </el-dialog>
  27.   
  28. </template><template>
  29.   
  30.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  31.       
  32.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  33.           frameborder="0" ></iframe>
  34.       
  35.     </el-dialog>
  36.   
  37. </template><template>
  38.   
  39.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  40.       
  41.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  42.           frameborder="0" ></iframe>
  43.       
  44.     </el-dialog>
  45.   
  46. </template><template>
  47.   
  48.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  49.       
  50.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  51.           frameborder="0" ></iframe>
  52.       
  53.     </el-dialog>
  54.   
  55. </template><template>
  56.   
  57.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  58.       
  59.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  60.           frameborder="0" ></iframe>
  61.       
  62.     </el-dialog>
  63.   
  64. </template><template>
  65.   
  66.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  67.       
  68.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  69.           frameborder="0" ></iframe>
  70.       
  71.     </el-dialog>
  72.   
  73. </template><template>
  74.   
  75.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  76.       
  77.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  78.           frameborder="0" ></iframe>
  79.       
  80.     </el-dialog>
  81.   
  82. </template>                      查询            重置                        关闭<template>
  83.   
  84.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  85.       
  86.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  87.           frameborder="0" ></iframe>
  88.       
  89.     </el-dialog>
  90.   
  91. </template><template>
  92.   
  93.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  94.       
  95.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  96.           frameborder="0" ></iframe>
  97.       
  98.     </el-dialog>
  99.   
  100. </template>刷新                          新建                          查询<template>
  101.   
  102.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  103.       
  104.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  105.           frameborder="0" ></iframe>
  106.       
  107.     </el-dialog>
  108.   
  109. </template><template>
  110.   
  111.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  112.       
  113.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  114.           frameborder="0" ></iframe>
  115.       
  116.     </el-dialog>
  117.   
  118. </template><template>
  119.   
  120.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  121.       
  122.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  123.           frameborder="0" ></iframe>
  124.       
  125.     </el-dialog>
  126.   
  127. </template>{{ props.row.id }}<template>
  128.   
  129.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  130.       
  131.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  132.           frameborder="0" ></iframe>
  133.       
  134.     </el-dialog>
  135.   
  136. </template>            {{ props.row.key }}<template>
  137.   
  138.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  139.       
  140.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  141.           frameborder="0" ></iframe>
  142.       
  143.     </el-dialog>
  144.   
  145. </template>            {{ props.row.name }}<template>
  146.   
  147.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  148.       
  149.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  150.           frameborder="0" ></iframe>
  151.       
  152.     </el-dialog>
  153.   
  154. </template>            {{ props.row.version }}<template>
  155.   
  156.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  157.       
  158.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  159.           frameborder="0" ></iframe>
  160.       
  161.     </el-dialog>
  162.   
  163. </template>            {{ $commonUtils.dateTimeFormat(props.row.createTime) }}<template>
  164.   
  165.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  166.       
  167.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  168.           frameborder="0" ></iframe>
  169.       
  170.     </el-dialog>
  171.   
  172. </template>            {{ $commonUtils.dateTimeFormat(props.row.lastUpdateTime) }}<template>
  173.   
  174.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  175.       
  176.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  177.           frameborder="0" ></iframe>
  178.       
  179.     </el-dialog>
  180.   
  181. </template><template>
  182.   
  183.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  184.       
  185.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  186.           frameborder="0" ></iframe>
  187.       
  188.     </el-dialog>
  189.   
  190. </template><template>
  191.   
  192.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  193.       
  194.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  195.           frameborder="0" ></iframe>
  196.       
  197.     </el-dialog>
  198.   
  199. </template><template>
  200.   
  201.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  202.       
  203.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  204.           frameborder="0" ></iframe>
  205.       
  206.     </el-dialog>
  207.   
  208. </template>                  修改            删除            部署            XML<template>
  209.   
  210.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  211.       
  212.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  213.           frameborder="0" ></iframe>
  214.       
  215.     </el-dialog>
  216.   
  217. </template><template>
  218.   
  219.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  220.       
  221.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  222.           frameborder="0" ></iframe>
  223.       
  224.     </el-dialog>
  225.   
  226. </template><template>
  227.   
  228.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  229.       
  230.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  231.           frameborder="0" ></iframe>
  232.       
  233.     </el-dialog>
  234.   
  235. </template><template>
  236.   
  237.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  238.       
  239.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  240.           frameborder="0" ></iframe>
  241.       
  242.     </el-dialog>
  243.   
  244. </template><template>
  245.   
  246.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  247.       
  248.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  249.           frameborder="0" ></iframe>
  250.       
  251.     </el-dialog>
  252.   
  253. </template>                      关闭                          创建                          重置<template>
  254.   
  255.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  256.       
  257.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  258.           frameborder="0" ></iframe>
  259.       
  260.     </el-dialog>
  261.   
  262. </template>                    关闭                          生成文件<template>
  263.   
  264.     <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="80%" height="100%" title="模型编辑器" @close="closeDialog">
  265.       
  266.         <iframe ref="Modeler" id="map" scrolling="auto" v-bind:src="contents"
  267.           frameborder="0" ></iframe>
  268.       
  269.     </el-dialog>
  270.   
  271. </template>
复制代码
workflow-model.js
  1. import request from '@/utils/request'
  2. //分页获取模型数据
  3. export function fetchModelPage(data) {
  4.   return request({
  5.     url: '/api/workflow/auth/activiti/model/page',
  6.     method: 'post',
  7.     data
  8.   })
  9. }
  10. //保存模型
  11. export function saveNewModel(data) {
  12.   return request({
  13.     url: '/api/workflow/auth/activiti/model/add',
  14.     method: 'post',
  15.     data
  16.   })
  17. }
  18. //删除模型数据
  19. export function delModel(data) {
  20.   return request({
  21.     url: '/api/workflow/auth/activiti/model/del',
  22.     method: 'post',
  23.     data
  24.   })
  25. }
  26. //部署模型
  27. export function deployModel(data) {
  28.   return request({
  29.     url: '/api/workflow/auth/activiti/model/deploy',
  30.     method: 'post',
  31.     data
  32.   })
  33. }
  34. //获取模型XML
  35. export function fetchXml(data) {
  36.   return request({
  37.     url: '/api/workflow/auth/activiti/model/xml',
  38.     method: 'post',
  39.     data
  40.   })
  41. }
复制代码
后端功能实现

对应前端需求,后端主要实现使用flowable引擎,获取汉化资源、读取模型数据、保存模型数据三个功能。
具体内容参见下一篇博文
项目源码仓库github
项目源码仓库gitee

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4