Commit 22885b15 authored by renjintao's avatar renjintao

mesplan/creator workflow/close

parent e7c7f72e
...@@ -297,11 +297,11 @@ export default { ...@@ -297,11 +297,11 @@ export default {
type: "date" type: "date"
}, },
{ {
key: "creatorUserId", key: "creator",
title: this.$t("creatorUserId"), title: this.$t("creatorUserId"),
align: "left", align: "left",
high: true, high: true,
type: "user" // type: "user"
}, },
{ {
key: "creationTime", key: "creationTime",
...@@ -310,22 +310,22 @@ export default { ...@@ -310,22 +310,22 @@ export default {
high: true, high: true,
width: 180 width: 180
}, },
{ // {
key: "lastModifierUserId", // key: "lastModifierUserId",
title: this.$t("lastModifierUserId"), // title: this.$t("lastModifierUserId"),
hide: true, // hide: true,
align: "left", // align: "left",
high: true, // high: true,
type: "user" // type: "user"
}, // },
{ // {
key: "lastModificationTime", // key: "lastModificationTime",
title: this.$t("lastModificationTime"), // title: this.$t("lastModificationTime"),
hide: true, // hide: true,
align: "center", // align: "center",
high: true, // high: true,
width: 180 // width: 180
}, // },
{ {
title: "操作", title: "操作",
key: "action", key: "action",
......
<template> <template>
<div id="flow"> <div id="flow">
<div id="myDiagramDiv" class="flex fd"> <div id="myDiagramDiv" class="flex fd">
<div v-height="100" class="flex"> <div v-height="100" class="flex">
<div id="palette" class="fg"></div> <div id="palette" class="fg"></div>
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<div id="draw" class="fg"></div> <div id="draw" class="fg"></div>
</div> </div>
<Modal v-model="detailModal" title="节点属性设置" :width="800" footer-hide> <Modal v-model="detailModal" title="节点属性设置" :width="800" footer-hide>
<component :is="detail" :eid="curId" :data="node" @on-ok="ok" /> <component :is="detail" :eid="curId" :data="node" @on-ok="ok" @on-close="close" />
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -107,20 +107,19 @@ export default { ...@@ -107,20 +107,19 @@ export default {
width: horizontal ? NaN : 8, // if not stretching horizontally, just 8 wide width: horizontal ? NaN : 8, // if not stretching horizontally, just 8 wide
height: !horizontal ? NaN : 8, // if not stretching vertically, just 8 tall height: !horizontal ? NaN : 8, // if not stretching vertically, just 8 tall
alignment: align, // align the port on the main Shape alignment: align, // align the port on the main Shape
stretch: horizontal stretch: horizontal ?
? go.GraphObject.Horizontal go.GraphObject.Horizontal : go.GraphObject.Vertical,
: go.GraphObject.Vertical,
portId: name, // declare this object to be a "port" portId: name, // declare this object to be a "port"
fromSpot: spot, // declare where links may connect at this port fromSpot: spot, // declare where links may connect at this port
fromLinkable: output, // declare whether the user may draw links from here fromLinkable: output, // declare whether the user may draw links from here
toSpot: spot, // declare where links may connect at this port toSpot: spot, // declare where links may connect at this port
toLinkable: input, // declare whether the user may draw links to here toLinkable: input, // declare whether the user may draw links to here
cursor: "pointer", // show a different cursor to indicate potential link point cursor: "pointer", // show a different cursor to indicate potential link point
mouseEnter: function(e, port) { mouseEnter: function (e, port) {
// the PORT argument will be this Shape // the PORT argument will be this Shape
if (!e.diagram.isReadOnly) port.fill = "rgba(15,0,25,0.5)"; if (!e.diagram.isReadOnly) port.fill = "rgba(15,0,25,0.5)";
}, },
mouseLeave: function(e, port) { mouseLeave: function (e, port) {
port.fill = "transparent"; port.fill = "transparent";
// port.fill = "white"; // port.fill = "white";
} }
...@@ -145,8 +144,7 @@ export default { ...@@ -145,8 +144,7 @@ export default {
// the main object is a Panel that surrounds a TextBlock with a rectangular Shape // the main object is a Panel that surrounds a TextBlock with a rectangular Shape
$( $(
go.Panel, go.Panel,
"Auto", "Auto", {
{
// resizable: true, // resizable: true,
doubleClick: (e, obj) => { doubleClick: (e, obj) => {
this.show(obj.part.data); this.show(obj.part.data);
...@@ -154,8 +152,7 @@ export default { ...@@ -154,8 +152,7 @@ export default {
}, },
$( $(
go.Shape, go.Shape,
"Rectangle", "Rectangle", {
{
fill: "white", fill: "white",
stroke: theme, stroke: theme,
strokeWidth: 2, strokeWidth: 2,
...@@ -166,8 +163,7 @@ export default { ...@@ -166,8 +163,7 @@ export default {
), ),
$( $(
go.TextBlock, go.TextBlock,
textStyle(theme), textStyle(theme), {
{
margin: 8, margin: 8,
maxSize: new go.Size(300, NaN), maxSize: new go.Size(300, NaN),
wrap: go.TextBlock.WrapFit, wrap: go.TextBlock.WrapFit,
...@@ -196,14 +192,16 @@ export default { ...@@ -196,14 +192,16 @@ export default {
"Auto", "Auto",
$( $(
go.Shape, go.Shape,
"Diamond", "Diamond", {
{ fill: "#fff", stroke: theme, strokeWidth: 2 }, fill: "#fff",
stroke: theme,
strokeWidth: 2
},
new go.Binding("figure", "figure") new go.Binding("figure", "figure")
), ),
$( $(
go.TextBlock, go.TextBlock,
textStyle(theme), textStyle(theme), {
{
margin: 8, margin: 8,
maxSize: new go.Size(60, NaN), maxSize: new go.Size(60, NaN),
wrap: go.TextBlock.WrapFit, wrap: go.TextBlock.WrapFit,
...@@ -267,7 +265,7 @@ export default { ...@@ -267,7 +265,7 @@ export default {
makePort("R", go.Spot.Right, go.Spot.Right, false, true) makePort("R", go.Spot.Right, go.Spot.Right, false, true)
) )
); );
go.Shape.defineFigureGenerator("File", function(shape, w, h) { go.Shape.defineFigureGenerator("File", function (shape, w, h) {
var geo = new go.Geometry(); var geo = new go.Geometry();
var fig = new go.PathFigure(0, 0, true); // starting point var fig = new go.PathFigure(0, 0, true); // starting point
geo.add(fig); geo.add(fig);
...@@ -297,8 +295,7 @@ export default { ...@@ -297,8 +295,7 @@ export default {
}), }),
$( $(
go.TextBlock, go.TextBlock,
textStyle(theme), textStyle(theme), {
{
margin: 8, margin: 8,
maxSize: new go.Size(200, NaN), maxSize: new go.Size(200, NaN),
wrap: go.TextBlock.WrapFit, wrap: go.TextBlock.WrapFit,
...@@ -325,10 +322,10 @@ export default { ...@@ -325,10 +322,10 @@ export default {
resegmentable: true, resegmentable: true,
// mouse-overs subtly highlight links: // mouse-overs subtly highlight links:
mouseEnter: function(e, link) { mouseEnter: function (e, link) {
link.findObject("HIGHLIGHT").stroke = "rgba(30,144,255,0.2)"; link.findObject("HIGHLIGHT").stroke = "rgba(30,144,255,0.2)";
}, },
mouseLeave: function(e, link) { mouseLeave: function (e, link) {
link.findObject("HIGHLIGHT").stroke = "transparent"; link.findObject("HIGHLIGHT").stroke = "transparent";
}, },
selectionAdorned: false selectionAdorned: false
...@@ -346,18 +343,32 @@ export default { ...@@ -346,18 +343,32 @@ export default {
), ),
$( $(
go.Shape, // the link path shape go.Shape, // the link path shape
{ isPanelMain: true, stroke: theme, strokeWidth: 2 }, {
new go.Binding("stroke", "isSelected", function(sel) { isPanelMain: true,
stroke: theme,
strokeWidth: 2
},
new go.Binding("stroke", "isSelected", function (sel) {
return sel ? "dodgerblue" : theme; return sel ? "dodgerblue" : theme;
}).ofObject() }).ofObject()
), ),
$( $(
go.Shape, // the "from" end arrowhead go.Shape, // the "from" end arrowhead
{ fromArrow: "Circle", fill: "#fff", strokeWidth: 2, stroke: theme } {
fromArrow: "Circle",
fill: "#fff",
strokeWidth: 2,
stroke: theme
}
), ),
$( $(
go.Shape, // the arrowhead go.Shape, // the arrowhead
{ toArrow: "standard", strokeWidth: 2, fill: theme, stroke: theme } {
toArrow: "standard",
strokeWidth: 2,
fill: theme,
stroke: theme
}
), ),
$( $(
go.Panel, go.Panel,
...@@ -372,7 +383,10 @@ export default { ...@@ -372,7 +383,10 @@ export default {
$( $(
go.Shape, go.Shape,
"RoundedRectangle", // the label shape "RoundedRectangle", // the label shape
{ fill: "#F8F8F8", strokeWidth: 0 } {
fill: "#F8F8F8",
strokeWidth: 0
}
), ),
$( $(
go.TextBlock, go.TextBlock,
...@@ -387,6 +401,7 @@ export default { ...@@ -387,6 +401,7 @@ export default {
) )
) )
); );
function showLinkLabel(e) { function showLinkLabel(e) {
var label = e.subject.findObject("LABEL"); var label = e.subject.findObject("LABEL");
if (label !== null) if (label !== null)
...@@ -408,11 +423,25 @@ export default { ...@@ -408,11 +423,25 @@ export default {
nodeSelectionAdornmentTemplate: select, nodeSelectionAdornmentTemplate: select,
model: new go.GraphLinksModel([ model: new go.GraphLinksModel([
// specify the contents of the Palette // specify the contents of the Palette
{ category: "Start", text: "开始" }, {
{ text: "节点" }, category: "Start",
{ category: "Conditional", text: "条件" }, text: "开始"
{ category: "End", text: "结束" }, },
{ category: "Comment", text: "备注" } {
text: "节点"
},
{
category: "Conditional",
text: "条件"
},
{
category: "End",
text: "结束"
},
{
category: "Comment",
text: "备注"
}
]) ])
} }
); );
...@@ -422,7 +451,7 @@ export default { ...@@ -422,7 +451,7 @@ export default {
var txn = evt.object; // a Transaction var txn = evt.object; // a Transaction
if (txn === null) return; if (txn === null) return;
// iterate over all of the actual ChangedEvents of the Transaction // iterate over all of the actual ChangedEvents of the Transaction
txn.changes.each(function(e) { txn.changes.each(function (e) {
// ignore any kind of change other than adding/removing a node // ignore any kind of change other than adding/removing a node
if (e.modelChange !== "nodeDataArray") return; if (e.modelChange !== "nodeDataArray") return;
// record node insertions and removals // record node insertions and removals
...@@ -437,6 +466,7 @@ export default { ...@@ -437,6 +466,7 @@ export default {
} }
}); });
}); });
function animateFadeDown(e) { function animateFadeDown(e) {
var diagram = e.diagram; var diagram = e.diagram;
var animation = new go.Animation(); var animation = new go.Animation();
...@@ -456,7 +486,9 @@ export default { ...@@ -456,7 +486,9 @@ export default {
// this.load(); // this.load();
}, },
load() { load() {
Api.get(`${workflowUrl}/schema/get`, { id: this.eid }).then(r => { Api.get(`${workflowUrl}/schema/get`, {
id: this.eid
}).then(r => {
console.warn(r); console.warn(r);
// this.myDiagram.model=go.Model.fromJson(r.content); // this.myDiagram.model=go.Model.fromJson(r.content);
var data = r.result.content || `{}`; var data = r.result.content || `{}`;
...@@ -498,6 +530,11 @@ export default { ...@@ -498,6 +530,11 @@ export default {
this.detailModal = false; this.detailModal = false;
this.detail = null; this.detail = null;
this.curId = -1; this.curId = -1;
},
close() {
this.detailModal = false;
this.detail = null;
this.curId = -1;
} }
} }
}; };
...@@ -508,9 +545,11 @@ export default { ...@@ -508,9 +545,11 @@ export default {
// background:#a7a7a7; // background:#a7a7a7;
margin: -16px; margin: -16px;
padding: 0 10px; padding: 0 10px;
canvas:focus { canvas:focus {
outline: 0; outline: 0;
} }
#myDiagramDiv { #myDiagramDiv {
height: calc(100vh - 51px); height: calc(100vh - 51px);
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment