186 lines
8.3 KiB
HTML
186 lines
8.3 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>流程设计</title>
|
|
<link rel="stylesheet" href="/assets/platform/plugins/snaker/snaker.css" type="text/css" media="all" />
|
|
</head>
|
|
<body class="pear-container">
|
|
<div id="toolbox">
|
|
<div id="toolbox_handle">工具集</div>
|
|
<div class="node" id="save">
|
|
<img src="/assets/platform/plugins/snaker/images/save.gif" />
|
|
保存
|
|
</div>
|
|
<div>
|
|
<hr />
|
|
</div>
|
|
<div class="node selectable" id="pointer">
|
|
<img src="/assets/platform/plugins/snaker/images/select16.gif" />
|
|
Select
|
|
</div>
|
|
<div class="node selectable" id="path">
|
|
<img src="/assets/platform/plugins/snaker/images/16/flow_sequence.png" />
|
|
transition
|
|
</div>
|
|
<div>
|
|
<hr />
|
|
</div>
|
|
<div class="node state" id="start" type="start">
|
|
<img src="/assets/platform/plugins/snaker/images/16/start_event_empty.png" />
|
|
start
|
|
</div>
|
|
<div class="node state" id="end" type="end">
|
|
<img src="/assets/platform/plugins/snaker/images/16/end_event_terminate.png" />
|
|
end
|
|
</div>
|
|
<div class="node state" id="task" type="task">
|
|
<img src="/assets/platform/plugins/snaker/images/16/task_empty.png" />
|
|
task
|
|
</div>
|
|
<div class="node state" id="task" type="custom">
|
|
<img src="/assets/platform/plugins/snaker/images/16/task_empty.png" />
|
|
custom
|
|
</div>
|
|
<div class="node state" id="task" type="subprocess">
|
|
<img src="/assets/platform/plugins/snaker/images/16/task_empty.png" />
|
|
subprocess
|
|
</div>
|
|
<div class="node state" id="fork" type="decision">
|
|
<img src="/assets/platform/plugins/snaker/images/16/gateway_exclusive.png" />
|
|
decision
|
|
</div>
|
|
<div class="node state" id="fork" type="fork">
|
|
<img src="/assets/platform/plugins/snaker/images/16/gateway_parallel.png" />
|
|
fork
|
|
</div>
|
|
<div class="node state" id="join" type="join">
|
|
<img src="/assets/platform/plugins/snaker/images/16/gateway_parallel.png" />
|
|
join
|
|
</div>
|
|
</div>
|
|
|
|
<div id="properties">
|
|
<div id="properties_handle">属性</div>
|
|
<table class="properties_all" cellpadding="0" cellspacing="0"></table>
|
|
<div> </div>
|
|
</div>
|
|
|
|
<div id="snakerflow"></div>
|
|
|
|
<script src="/assets/platform/plugins/jquery/jquery.js"></script>
|
|
<script src="/assets/platform/plugins/snaker/raphael-min.js" type="text/javascript"></script>
|
|
<script src="/assets/platform/plugins/snaker/jquery-ui-1.8.4.custom/js/jquery.min.js" type="text/javascript"></script>
|
|
<script src="/assets/platform/plugins/snaker/jquery-ui-1.8.4.custom/js/jquery-ui.min.js" type="text/javascript"></script>
|
|
<script src="/assets/platform/plugins/snaker/dialog.js" type="text/javascript"></script>
|
|
<script src="/assets/platform/plugins/snaker/snaker.designer.js" type="text/javascript"></script>
|
|
<script src="/assets/platform/plugins/snaker/snaker.model.js" charset="utf-8" type="text/javascript"></script>
|
|
<script src="/assets/platform/plugins/snaker/snaker.editors.js" type="text/javascript"></script>
|
|
<script nonce="${cspNonce!}">
|
|
const processId = "${processId!}"
|
|
console.log(processId)
|
|
|
|
console.log(new URLSearchParams(window.location.search).get("processId"))
|
|
|
|
$.post("/snakerflow/define//process/modelJson", { processId }).then((res) => {
|
|
console.log(res)
|
|
if (res.code === 0) {
|
|
let model = res.data
|
|
if (model) {
|
|
model = eval("(" + model + ")")
|
|
}
|
|
$("#snakerflow").snakerflow({
|
|
basePath: "/assets/platform/plugins/snaker/",
|
|
ctxPath: "/",
|
|
restore: model,
|
|
userJson: {},
|
|
formPath: "forms/",
|
|
tools: {
|
|
save: {
|
|
onclick: function (data) {
|
|
saveModel(data)
|
|
}
|
|
}
|
|
}
|
|
})
|
|
}
|
|
})
|
|
|
|
function saveModel(data) {
|
|
$.post("/snakerflow/define/saveProcessXml", { model: data, id: processId }).then((res) => {
|
|
if (res.code === 0) {
|
|
// alert("保存成功")
|
|
window.parent.postMessage("success")
|
|
} else {
|
|
window.parent.postMessage("error")
|
|
}
|
|
})
|
|
}
|
|
|
|
// layui.use(['table', 'form', 'jquery', 'common', 'easyAdmin'], function () {
|
|
// let easyAdmin = layui.easyAdmin;
|
|
// id = getQueryString("processId");
|
|
// easyAdmin.httpGet("/flow/process/modelJson?processId=" + id, function (data) {
|
|
// var model = "";
|
|
// if (data) {
|
|
// model = eval("(" + data + ")");
|
|
// }
|
|
// var userJson = {};
|
|
// easyAdmin.httpGet("/sys/user/getAll", function (result) {
|
|
// if (result.success) {
|
|
// userJson = result.data;
|
|
// }
|
|
// }, true, false);
|
|
//
|
|
// var isSubmitting = false; // 添加一个变量用于标记是否正在提交中
|
|
//
|
|
// $('#snakerflow').snakerflow({
|
|
// basePath: "/assets/platform/plugins/snaker/",
|
|
// ctxPath: "/",
|
|
// restore: model,
|
|
// userJson: userJson,
|
|
// formPath: "forms/",
|
|
// tools: {
|
|
// save: {
|
|
// onclick: function (data) {
|
|
// if (isSubmitting) {
|
|
// return false; // 如果正在提交中,则不执行后续代码
|
|
// }
|
|
// isSubmitting = true; // 设置为正在提交中状态
|
|
// saveModel(data);
|
|
// isSubmitting = false; // 处理完成后重置提交状态
|
|
// }
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
//
|
|
//
|
|
// function getQueryString(name) {
|
|
// var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
// var r = window.location.search.substr(1).match(reg);
|
|
// if (r !== null)
|
|
// return unescape(r[2]);
|
|
// return "";
|
|
// }
|
|
//
|
|
//
|
|
// // window.saveModel = function (data) {
|
|
// // easyAdmin.http({
|
|
// // type: 'POST',
|
|
// // url: "/flow/process/deployXml",
|
|
// // data: "model=" + data + "&id=" + id,
|
|
// // async: false,
|
|
// // globle: false,
|
|
// // success: function (data) {
|
|
// // parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
|
|
// // parent.layui.table.reload("user-table");
|
|
// // }
|
|
// // });
|
|
// //
|
|
// // }
|
|
// })
|
|
</script>
|
|
</body>
|
|
</html>
|