完善在线流程绘制
This commit is contained in:
parent
d6d5507c85
commit
1d585f0ead
@ -3,13 +3,11 @@ package com.cm.inspection.controller.apis.activiti;
|
||||
import com.cm.common.annotation.CheckRequestBodyAnnotation;
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.exception.SearchException;
|
||||
import com.cm.common.pojo.ListPage;
|
||||
import com.cm.common.result.ErrorResult;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import com.cm.common.result.SuccessResultData;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.inspection.pojo.dtos.check.CheckDTO;
|
||||
import com.cm.inspection.pojo.vos.activiti.ActivitiVO;
|
||||
import com.cm.inspection.service.activiti.IActivitiService;
|
||||
import io.swagger.annotations.*;
|
||||
@ -17,12 +15,9 @@ import org.activiti.engine.repository.Model;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.management.ObjectName;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.cm.inspection.controller.apis.activiti;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import com.cm.inspection.service.activiti.IActivitiModelService;
|
||||
import com.cm.inspection.service.activiti.IActivitiService;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.activiti.engine.ActivitiException;
|
||||
import org.activiti.engine.repository.Model;
|
||||
import org.apache.batik.transcoder.TranscoderException;
|
||||
import org.apache.batik.transcoder.TranscoderInput;
|
||||
import org.apache.batik.transcoder.TranscoderOutput;
|
||||
import org.apache.batik.transcoder.image.PNGTranscoder;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: ActivitiModelController
|
||||
* @Description: 流程模型
|
||||
* @Author: WangGeng
|
||||
* @Date: 2021/7/12 21:56
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "流程模型接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.API_PREFIX + "/activiti/model")
|
||||
public class ActivitiModelController extends AbstractController {
|
||||
|
||||
@Autowired
|
||||
private IActivitiModelService activitiModelService;
|
||||
|
||||
@PutMapping("save/{modelId}")
|
||||
public SuccessResult saveModel(@PathVariable String modelId, String name, String description, String json_xml, String svg_xml) throws Exception {
|
||||
activitiModelService.saveModel(modelId, name, description, json_xml, svg_xml);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@GetMapping("json/{modelId}")
|
||||
public JSONObject getEditorJson(@PathVariable String modelId) throws UnsupportedEncodingException {
|
||||
return activitiModelService.getEditorJson(modelId);
|
||||
}
|
||||
|
||||
@GetMapping("editor/stencilset")
|
||||
public JSONObject getStencilset() throws IOException {
|
||||
return activitiModelService.getStencilset();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.cm.inspection.service.activiti;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import org.apache.batik.transcoder.TranscoderException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: IActivitiModelService
|
||||
* @Description: 流程模型
|
||||
* @Author: WangGeng
|
||||
* @Date: 2021/7/12 22:01
|
||||
* @Version: 1.0
|
||||
**/
|
||||
public interface IActivitiModelService {
|
||||
|
||||
void saveModel(String modelId, String name, String description, String json_xml, String svg_xml) throws Exception;
|
||||
|
||||
JSONObject getEditorJson(String modelId) throws UnsupportedEncodingException;
|
||||
|
||||
JSONObject getStencilset() throws IOException;
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.cm.inspection.service.activiti.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cm.common.base.AbstractService;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.exception.SearchException;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import com.cm.inspection.service.activiti.IActivitiModelService;
|
||||
import com.cm.inspection.service.activiti.IActivitiService;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import org.activiti.editor.constants.ModelDataJsonConstants;
|
||||
import org.activiti.engine.ActivitiException;
|
||||
import org.activiti.engine.RepositoryService;
|
||||
import org.activiti.engine.repository.Model;
|
||||
import org.apache.batik.transcoder.TranscoderException;
|
||||
import org.apache.batik.transcoder.TranscoderInput;
|
||||
import org.apache.batik.transcoder.TranscoderOutput;
|
||||
import org.apache.batik.transcoder.image.PNGTranscoder;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* When you feel like quitting. Think about why you started
|
||||
* 当你想要放弃的时候,想想当初你为何开始
|
||||
*
|
||||
* @ClassName: ActivitiModelServiceImpl
|
||||
* @Description: 流程模型
|
||||
* @Author: WangGeng
|
||||
* @Date: 2021/7/12 22:01
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Service
|
||||
public class ActivitiModelServiceImpl extends AbstractService implements IActivitiModelService, ModelDataJsonConstants {
|
||||
|
||||
@Autowired
|
||||
private RepositoryService repositoryService;
|
||||
|
||||
@Override
|
||||
public void saveModel(String modelId, String name, String description, String json_xml, String svg_xml) throws Exception {
|
||||
Model model = repositoryService.getModel(modelId);
|
||||
if (model == null) {
|
||||
throw new SearchException("模型不存在");
|
||||
}
|
||||
JSONObject modelObject = JSONObject.parseObject(model.getMetaInfo());
|
||||
|
||||
modelObject.put(MODEL_NAME, name);
|
||||
modelObject.put(MODEL_DESCRIPTION, description);
|
||||
model.setMetaInfo(modelObject.toString());
|
||||
model.setName(name);
|
||||
repositoryService.saveModel(model);
|
||||
repositoryService.addModelEditorSource(model.getId(), json_xml.getBytes(ISystemConstant.CHARSET_UTF8));
|
||||
|
||||
InputStream svgStream = new ByteArrayInputStream(svg_xml.getBytes(ISystemConstant.CHARSET_UTF8));
|
||||
TranscoderInput input = new TranscoderInput(svgStream);
|
||||
|
||||
PNGTranscoder transcoder = new PNGTranscoder();
|
||||
// Setup output
|
||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||
TranscoderOutput output = new TranscoderOutput(outStream);
|
||||
|
||||
// Do the transformation
|
||||
transcoder.transcode(input, output);
|
||||
final byte[] result = outStream.toByteArray();
|
||||
repositoryService.addModelEditorSourceExtra(model.getId(), result);
|
||||
outStream.close();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getEditorJson(String modelId) throws UnsupportedEncodingException {
|
||||
Model model = repositoryService.getModel(modelId);
|
||||
if (model == null) {
|
||||
throw new SearchException("模型不存在");
|
||||
}
|
||||
JSONObject result;
|
||||
if (StringUtils.isNotEmpty(model.getMetaInfo())) {
|
||||
result = JSONObject.parseObject(model.getMetaInfo());
|
||||
} else {
|
||||
result = new JSONObject();
|
||||
result.put(MODEL_NAME, model.getName());
|
||||
}
|
||||
result.put(MODEL_ID, model.getId());
|
||||
String readTree = new String(repositoryService.getModelEditorSource(model.getId()), ISystemConstant.CHARSET_UTF8);
|
||||
JSONObject editorJson = JSONObject.parseObject(readTree);
|
||||
result.put("model", editorJson);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getStencilset() throws IOException {
|
||||
InputStream stencilsetStream = this.getClass().getClassLoader().getResourceAsStream("stencilset.json");
|
||||
String result = IOUtils.toString(stencilsetStream, ISystemConstant.CHARSET_UTF8);
|
||||
return JSONObject.parseObject(result);
|
||||
}
|
||||
}
|
@ -22,5 +22,5 @@
|
||||
var ACTIVITI = ACTIVITI || {};
|
||||
|
||||
ACTIVITI.CONFIG = {
|
||||
'contextRoot' : 'service',
|
||||
'contextRoot' : 'api/activiti',
|
||||
};
|
||||
|
@ -261,7 +261,8 @@ KISBPM.TOOLBAR = {
|
||||
},
|
||||
|
||||
closeEditor: function(services) {
|
||||
window.location.href = "./";
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
// window.location.href = "./";
|
||||
},
|
||||
|
||||
/**
|
||||
@ -326,7 +327,8 @@ var SaveModelCtrl = [ '$rootScope', '$scope', '$http', '$route', '$location',
|
||||
|
||||
$scope.saveAndClose = function () {
|
||||
$scope.save(function() {
|
||||
window.location.href = "./";
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
// window.location.href = "./";
|
||||
});
|
||||
};
|
||||
$scope.save = function (successCallback) {
|
||||
|
@ -162,14 +162,14 @@ KISBPM.TOOLBAR_CONFIG = {
|
||||
"action" : "KISBPM.TOOLBAR.ACTIONS.removeBendPoint",
|
||||
"id" : "remove-bendpoint-button"
|
||||
}
|
||||
],
|
||||
|
||||
"secondaryItems" : [
|
||||
{
|
||||
"type" : "button",
|
||||
"title" : "Close",
|
||||
"cssClass" : "editor-icon editor-icon-close",
|
||||
"action" : "KISBPM.TOOLBAR.ACTIONS.closeEditor"
|
||||
}
|
||||
]
|
||||
|
||||
// "secondaryItems" : [
|
||||
// {
|
||||
// "type" : "button",
|
||||
// "title" : "Close",
|
||||
// "cssClass" : "editor-icon editor-icon-close",
|
||||
// "action" : "KISBPM.TOOLBAR.ACTIONS.closeEditor"
|
||||
// }
|
||||
// ]
|
||||
};
|
@ -21,14 +21,14 @@ var KISBPM = KISBPM || {};
|
||||
KISBPM.URL = {
|
||||
|
||||
getModel: function(modelId) {
|
||||
return ACTIVITI.CONFIG.contextRoot + '/model/' + modelId + '/json';
|
||||
return ACTIVITI.CONFIG.contextRoot + '/model/json/' + modelId;
|
||||
},
|
||||
|
||||
getStencilSet: function() {
|
||||
return ACTIVITI.CONFIG.contextRoot + '/editor/stencilset?version=' + Date.now();
|
||||
return ACTIVITI.CONFIG.contextRoot + '/model/editor/stencilset?version=' + Date.now();
|
||||
},
|
||||
|
||||
putModel: function(modelId) {
|
||||
return ACTIVITI.CONFIG.contextRoot + '/model/' + modelId + '/save';
|
||||
return ACTIVITI.CONFIG.contextRoot + '/model/save/' + modelId;
|
||||
}
|
||||
};
|
@ -936,7 +936,7 @@ a.dropdown-toggle {
|
||||
}
|
||||
|
||||
.wrapper.full {
|
||||
padding: 40px 0px 0px 0px;
|
||||
padding: 0px 0px 0px 0px;
|
||||
overflow: hidden;
|
||||
max-width: 100%;
|
||||
min-width: 100%;
|
||||
|
@ -8187,7 +8187,7 @@ ORYX.Core.StencilSet.StencilSet = Clazz.extend({
|
||||
this._baseUrl = "editor/stencilsets/bpmn2.0/";
|
||||
this._source = "stencilsets/bpmn2.0/bpmn2.0.json";
|
||||
|
||||
new Ajax.Request(ACTIVITI.CONFIG.contextRoot + '/editor/stencilset?version=' + Date.now(), {
|
||||
new Ajax.Request(ACTIVITI.CONFIG.contextRoot + '/model/editor/stencilset?version=' + Date.now(), {
|
||||
asynchronous: false,
|
||||
method: 'get',
|
||||
onSuccess: this._init.bind(this),
|
||||
|
@ -4,10 +4,10 @@
|
||||
"PAGE.HEADER" : "Orchestration Details",
|
||||
|
||||
"ACTION.OK" : "Ok",
|
||||
"ACTION.SAVE" : "Save",
|
||||
"ACTION.SAVE-AND-CLOSE" : "Save and close editor",
|
||||
"ACTION.SAVE" : "保存",
|
||||
"ACTION.SAVE-AND-CLOSE" : "保存并关闭",
|
||||
"ACTION.SEND" : "Send",
|
||||
"ACTION.CANCEL" : "Cancel",
|
||||
"ACTION.CANCEL" : "取消",
|
||||
"ACTION.SELECT" : "Select",
|
||||
"ACTION.ADD" : "Add",
|
||||
"ACTION.REMOVE" : "Remove",
|
||||
@ -20,25 +20,25 @@
|
||||
"MAIN_NAVIGATION_SOLUTIONS" : "Solutions",
|
||||
|
||||
"TOOLBAR.ACTION.CLOSE" : "Close the editor and go back to the overview page",
|
||||
"TOOLBAR.ACTION.SAVE" : "Save the model",
|
||||
"TOOLBAR.ACTION.SAVE" : "保存模型",
|
||||
"TOOLBAR.ACTION.VALIDATE": "Validate the model",
|
||||
"TOOLBAR.ACTION.CUT" : "Cut (select one or more elements in your business process)",
|
||||
"TOOLBAR.ACTION.COPY" : "Copy (select one or more elements in your business process)",
|
||||
"TOOLBAR.ACTION.PASTE" : "Paste",
|
||||
"TOOLBAR.ACTION.DELETE" : "Delete the selected element",
|
||||
"TOOLBAR.ACTION.UNDO" : "Undo",
|
||||
"TOOLBAR.ACTION.REDO" : "Redo",
|
||||
"TOOLBAR.ACTION.ZOOMIN" : "Zoom in",
|
||||
"TOOLBAR.ACTION.ZOOMOUT" : "Zoom out",
|
||||
"TOOLBAR.ACTION.ZOOMACTUAL" : "Zoom to actual size",
|
||||
"TOOLBAR.ACTION.ZOOMFIT" : "Zoom to fit",
|
||||
"TOOLBAR.ACTION.CUT" : "剪切 (在流程中选择一个或多个节点)",
|
||||
"TOOLBAR.ACTION.COPY" : "复制 (在流程中选择一个或多个节点)",
|
||||
"TOOLBAR.ACTION.PASTE" : "粘贴",
|
||||
"TOOLBAR.ACTION.DELETE" : "删除选择的元素",
|
||||
"TOOLBAR.ACTION.UNDO" : "下一步",
|
||||
"TOOLBAR.ACTION.REDO" : "上一步",
|
||||
"TOOLBAR.ACTION.ZOOMIN" : "放大",
|
||||
"TOOLBAR.ACTION.ZOOMOUT" : "缩小",
|
||||
"TOOLBAR.ACTION.ZOOMACTUAL" : "复原",
|
||||
"TOOLBAR.ACTION.ZOOMFIT" : "填充",
|
||||
"TOOLBAR.ACTION.MOVE" : "Move",
|
||||
"TOOLBAR.ACTION.IMPORT" : "Import",
|
||||
"TOOLBAR.ACTION.EXPORT" : "Export",
|
||||
"TOOLBAR.ACTION.BENDPOINT.ADD" : "Add bend-point to the selected sequence flow",
|
||||
"TOOLBAR.ACTION.BENDPOINT.REMOVE" : "Remove bend-point from the selected sequence flow",
|
||||
"TOOLBAR.ACTION.ALIGNHORIZONTAL" : "Align model horizontal",
|
||||
"TOOLBAR.ACTION.ALIGNVERTICAL" : "Align model vertical",
|
||||
"TOOLBAR.ACTION.BENDPOINT.ADD" : "增加流程连线节点",
|
||||
"TOOLBAR.ACTION.BENDPOINT.REMOVE" : "删除流程连线节点",
|
||||
"TOOLBAR.ACTION.ALIGNHORIZONTAL" : "水平对齐",
|
||||
"TOOLBAR.ACTION.ALIGNVERTICAL" : "垂直对齐",
|
||||
"TOOLBAR.ACTION.SAMESIZE" : "Same size",
|
||||
"TOOLBAR.ACTION.HELP": "Start the guided tour",
|
||||
"TOOLBAR.ACTION.FEEDBACK": "Provide feedback",
|
||||
@ -267,9 +267,9 @@
|
||||
"PROPERTY.SEQUENCEFLOW.CONDITION.VARIABLE.NO-OUTCOMES-AVAILABLE" : "No outcomes available",
|
||||
"PROPERTY.SEQUENCEFLOW.CONDITION.NO-CONDITION-DISPLAY" : "No condition",
|
||||
|
||||
"MODEL.SAVE.TITLE" : "Save model",
|
||||
"MODEL.NAME" : "Name",
|
||||
"MODEL.DESCRIPTION" : "Description",
|
||||
"MODEL.SAVE.TITLE" : "保存模型",
|
||||
"MODEL.NAME" : "名称",
|
||||
"MODEL.DESCRIPTION" : "描述",
|
||||
"MODEL.SAVE.NEWVERSION" : "Save this as a new version? This means you can always go back to a previous version",
|
||||
"MODEL.SAVE.COMMENT" : "Comment",
|
||||
"MODEL.SAVE.SAVING" : "Saving model",
|
||||
|
@ -167,15 +167,12 @@
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
var checkDatas = checkStatus.data;
|
||||
if(layEvent === 'saveEvent') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/activiti/create.html', []),
|
||||
end: function() {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/activiti/save.html', []),
|
||||
title: '新增流程图',
|
||||
width: '400px',
|
||||
height: '300px',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
@ -185,15 +182,12 @@
|
||||
} else if(checkDatas.length > 1) {
|
||||
top.dialog.msg(top.dataMessage.table.selectOneEdit);
|
||||
} else {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
area: ['100%', '100%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/activiti/update.html?modelId={modelId}', [checkDatas[0].id]),
|
||||
end: function() {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/activiti/update.html?modelId={modelId}', [checkDatas[0].id]),
|
||||
title: '编辑流程图',
|
||||
width: '90%',
|
||||
height: '90%',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
|
101
src/main/resources/static/route/activiti/save.html
Normal file
101
src/main/resources/static/route/activiti/save.html
Normal file
@ -0,0 +1,101 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/inspection/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模型名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="modelName" name="modelName" class="layui-input" value="" placeholder="请输入模型名称" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">模型Key</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="modelKey" name="modelKey" class="layui-input" value="" placeholder="请输入模型Key" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模型描述</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="modelDescription" name="modelDescription" class="layui-input" value="" placeholder="请输入模型描述" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">模型版本</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="modelVersion" name="modelVersion" class="layui-input" value="" placeholder="请输入模型版本" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-footer" style="left: 0;">
|
||||
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||
var $ = layui.$;
|
||||
var form = layui.form;
|
||||
|
||||
function closeBox() {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
form.on('submit(submitForm)', function(formData) {
|
||||
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.post(top.restAjax.path('api/activiti/create', []), formData.field, null, function(code, data) {
|
||||
top.dialog.msg(top.dataMessage.commitSuccess);
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/activiti/update.html?modelId={modelId}', [data.data]),
|
||||
title: '编辑流程图',
|
||||
width: '90%',
|
||||
height: '90%',
|
||||
onClose: function() {
|
||||
closeBox();
|
||||
}
|
||||
});
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
top.dialog.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// 校验
|
||||
form.verify({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
127
src/main/resources/static/route/activiti/update.html
Normal file
127
src/main/resources/static/route/activiti/update.html
Normal file
@ -0,0 +1,127 @@
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]>
|
||||
<html class="no-js lt-ie9 lt-ie8 lt-ie7" xmlns:th="http://www.thymeleaf.org"> <![endif]-->
|
||||
<!--[if IE 7]>
|
||||
<html class="no-js lt-ie9 lt-ie8" xmlns:th="http://www.thymeleaf.org"> <![endif]-->
|
||||
<!--[if IE 8]>
|
||||
<html class="no-js lt-ie9" xmlns:th="http://www.thymeleaf.org"> <![endif]-->
|
||||
<!--[if gt IE 8]><!-->
|
||||
<html class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
<base href="/inspection/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Activiti Editor</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, width=device-width">
|
||||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
|
||||
|
||||
<link rel="Stylesheet" media="screen" href="editor-app/libs/ng-grid-2.0.7.min.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="editor-app/libs/bootstrap_3.1.1/css/bootstrap.min.css"/>
|
||||
|
||||
<link rel="Stylesheet" media="screen" href="editor-app/editor/css/editor.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="editor-app/css/style.css" type="text/css"/>
|
||||
|
||||
<link rel="stylesheet" href="editor-app/css/style-common.css">
|
||||
<link rel="stylesheet" href="editor-app/css/style-editor.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--[if lt IE 9]>
|
||||
<div class="unsupported-browser">
|
||||
<p class="alert error">You are using an unsupported browser. Please upgrade your browser in order to use the editor.</p>
|
||||
</div>
|
||||
<![endif]-->
|
||||
|
||||
<div class="alert-wrapper" ng-cloak>
|
||||
<div class="alert fadein {{alerts.current.type}}" ng-show="alerts.current" ng-click="dismissAlert()">
|
||||
<i class="glyphicon" ng-class="{'glyphicon-ok': alerts.current.type == 'info', 'glyphicon-remove': alerts.current.type == 'error'}"></i>
|
||||
<span>{{alerts.current.message}}</span>
|
||||
|
||||
<div class="pull-right" ng-show="alerts.queue.length > 0">
|
||||
<span class="badge">{{alerts.queue.length + 1}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="main" class="wrapper full clearfix" ng-style="{height: window.height + 'px'}" ng-app="activitiModeler" ng-include="'editor-app/editor.html'"></div>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="editor-app/libs/es5-shim-15.3.4.5/es5-shim.js"></script>
|
||||
<script src="editor-app/libs/json3_3.2.6/lib/json3.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<script src="editor-app/libs/jquery_1.11.0/jquery.min.js"></script>
|
||||
<script src="editor-app/libs/jquery-ui-1.10.3.custom.min.js"></script>
|
||||
|
||||
<script src="editor-app/libs/angular_1.2.13/angular.min.js"></script>
|
||||
<script src="editor-app/libs/angular_1.2.13/angular-animate.min.js"></script>
|
||||
<script src="editor-app/libs/bootstrap_3.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="editor-app/libs/angular-resource_1.2.13/angular-resource.min.js"></script>
|
||||
<script src="editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js"></script>
|
||||
<script src="editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js"></script>
|
||||
<script src="editor-app/libs/angular-route_1.2.13/angular-route.min.js"></script>
|
||||
<script src="editor-app/libs/angular-translate_2.4.2/angular-translate.min.js"></script>
|
||||
<script src="editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.js"></script>
|
||||
<script src="editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js"></script>
|
||||
<script src="editor-app/libs/angular-strap_2.0.5/angular-strap.min.js"></script>
|
||||
<script src="editor-app/libs/angular-strap_2.0.5/angular-strap.tpl.min.js"></script>
|
||||
<script src="editor-app/libs/momentjs_2.5.1/momentjs.min.js"></script>
|
||||
|
||||
<script src="editor-app/libs/ui-utils.min-0.0.4.js" type="text/javascript"></script>
|
||||
<script src="editor-app/libs/ng-grid-2.0.7-min.js" type="text/javascript"></script>
|
||||
<script src="editor-app/libs/angular-dragdrop.min-1.0.3.js" type="text/javascript"></script>
|
||||
<script src="editor-app/libs/mousetrap-1.4.5.min.js" type="text/javascript"></script>
|
||||
<script src="editor-app/libs/jquery.autogrow-textarea.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/libs/prototype-1.5.1.js" type="text/javascript"></script>
|
||||
<script src="editor-app/libs/path_parser.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/libs/angular-scroll_0.5.7/angular-scroll.min.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Configuration -->
|
||||
<script src="editor-app/app-cfg.js?v=1"></script>
|
||||
<script src="editor-app/editor-config.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/url-config.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/editor/i18n/translation_en_us.js" type="text/javascript"></script>
|
||||
<script src="editor-app/editor/i18n/translation_signavio_en_us.js" type="text/javascript"></script>
|
||||
<script src="editor-app/editor/oryx.debug.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/app.js"></script>
|
||||
|
||||
<script src="editor-app/eventbus.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/editor-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/stencil-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/toolbar-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/header-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/select-shape-controller.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/editor-utils.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/toolbar-default-actions.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/configuration/properties-default-controllers.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-execution-listeners-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-event-listeners-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-assignment-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-fields-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-form-properties-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-in-parameters-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-multiinstance-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-out-parameters-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-task-listeners-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-sequenceflow-order-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-condition-expression-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-signal-definitions-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-signal-scope-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-message-definitions-controller.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-message-scope-controller.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/configuration/toolbar.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/toolbar-custom-actions.js" type="text/javascript"></script>
|
||||
|
||||
<script src="editor-app/configuration/properties.js" type="text/javascript"></script>
|
||||
<script src="editor-app/configuration/properties-custom-controllers.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user