Commit 77b1cf7c authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 440e1f1f 1b066382
...@@ -85,8 +85,6 @@ export default { ...@@ -85,8 +85,6 @@ export default {
// const openNames = getSiderSubmenu(path, menuSider); // const openNames = getSiderSubmenu(path, menuSider);
// this.$store.commit("admin/menu/setOpenNames", openNames); // this.$store.commit("admin/menu/setOpenNames", openNames);
} else {
this.$Message.error("加载产品树失败!");
} }
}); });
}, },
......
<template> <template>
<div style="padding: 0;" class="excute"> <div style="padding: 0;" class="excute">
<DataGrid <DataGrid style="margin-top:2px; margin-bottom: -5px;" :columns="columns" ref="grid" :easy="false" :high="false" :set="false" :border="false" :data="data1" :height="gridHeight" :page="false" :size="size"></DataGrid>
style="margin-top:2px; margin-bottom: -5px;" <Modal v-model="editModal" title="编辑" footer-hide width="1000">
:columns="columns"
ref="grid"
:easy="false"
:high="false"
:set="false"
:border="false"
:data="data1"
:height="gridHeight"
:page="false"
:size="size"
></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" /> <Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" />
</Modal> </Modal>
<Modal v-model="insertlModal" :title="insertTItle" @on-ok="insertOk" @on-cancel="cancel"> <Modal v-model="insertlModal" :title="insertTItle" @on-ok="insertOk" @on-cancel="cancel">
<p>确定进行 {{ insertTItle }} 操作?</p> <p>确定进行 {{ insertTItle }} 操作?</p>
</Modal> </Modal>
<Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000">
<Add <Add @on-parameter-ok="addOk" @on-close="cancel" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" :row="rowData" />
@on-parameter-ok="addOk"
@on-close="cancel"
:opTaskPk="setParams.opTaskPk"
:partTaskPk="setParams.partTaskPk"
:taskSeq="setParams.taskSeq"
:count="setParams.count"
:row="rowData"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "../api"; import Api from "../api";
import Edit from "./edit"; import Edit from "./edit";
...@@ -43,7 +24,9 @@ export default { ...@@ -43,7 +24,9 @@ export default {
Add Add
}, },
props: { props: {
rowId: { type: Number } rowId: {
type: Number
}
}, },
data() { data() {
return { return {
...@@ -62,8 +45,10 @@ export default { ...@@ -62,8 +45,10 @@ export default {
curId: 0, curId: 0,
gridHeight: 150, gridHeight: 150,
size: "small", size: "small",
columns: [ columns: [{
{ title: " ", width: 130 }, title: " ",
width: 130
},
{ {
key: "insert_flag", key: "insert_flag",
title: this.l("insert_flag"), title: this.l("insert_flag"),
...@@ -72,11 +57,9 @@ export default { ...@@ -72,11 +57,9 @@ export default {
width: 60, width: 60,
render: (h, params) => { render: (h, params) => {
return h( return h(
"Tooltip", "Tooltip", {
{
props: { props: {
content: content: params.row.insert_flag == 1 ? "取消插单" : "进行插单",
params.row.insert_flag == 1 ? "取消插单" : "进行插单",
placement: "top" placement: "top"
}, },
class: "ico" class: "ico"
...@@ -84,10 +67,8 @@ export default { ...@@ -84,10 +67,8 @@ export default {
[ [
h("Icon", { h("Icon", {
attrs: { attrs: {
type: type: params.row.insert_flag == 1 ?
params.row.insert_flag == 1 "ios-flag" : "ios-flag-outline",
? "ios-flag"
: "ios-flag-outline",
size: 20, size: 20,
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa" color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
}, },
...@@ -333,7 +314,9 @@ export default { ...@@ -333,7 +314,9 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h("op", { h("op", {
attrs: { attrs: {
icon: "md-options", icon: "md-options",
...@@ -341,7 +324,9 @@ export default { ...@@ -341,7 +324,9 @@ export default {
oprate: "detail", oprate: "detail",
title: "工序参数设置" title: "工序参数设置"
}, },
on: { click: () => this.openParms(params.row) } on: {
click: () => this.openParms(params.row)
}
}), }),
h("op", { h("op", {
attrs: { attrs: {
...@@ -350,7 +335,9 @@ export default { ...@@ -350,7 +335,9 @@ export default {
title: "編輯工序", title: "編輯工序",
oprate: "edit" oprate: "edit"
}, },
on: { click: () => this.edit(params.row) } on: {
click: () => this.edit(params.row)
}
}), }),
h("op", { h("op", {
attrs: { attrs: {
...@@ -360,7 +347,9 @@ export default { ...@@ -360,7 +347,9 @@ export default {
oprate: "delete", oprate: "delete",
msg: "确认要刪除工序吗?" msg: "确认要刪除工序吗?"
}, },
on: { click: () => this.remove(params.row, params.index) } on: {
click: () => this.remove(params.row, params.index)
}
}) })
]); ]);
} }
...@@ -383,7 +372,10 @@ export default { ...@@ -383,7 +372,10 @@ export default {
mounted() { mounted() {
this.loadData(this.rowId); this.loadData(this.rowId);
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -514,6 +506,7 @@ export default { ...@@ -514,6 +506,7 @@ export default {
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
.excute table tr th span, .excute table tr th span,
.excute table tr td { .excute table tr td {
......
<template> <template>
<div class="h100"> <div class="h100">
<DataGrid <DataGrid :columns="columns" ref="grid" :action="action" @on-selection-change="selectInfo" :batch="false">
:columns="columns"
ref="grid"
:action="action"
@on-selection-change="selectInfo"
:batch="false"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input <Input search enter-button placeholder="请输入关键字订单编号/项目名称" v-model="easySearch.keys.value" v-width="300" @on-search="search" />
search
enter-button
placeholder="请输入关键字订单编号/项目名称"
v-model="easySearch.keys.value"
v-width="300"
@on-search="search"
/>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="searchBack"> <template slot="searchBack">
<Badge <Badge :count="this.$store.state.countAps" overflow-count="99" style="margin-right:15px;" type="info" v-if="showAps">
:count="this.$store.state.countAps"
overflow-count="99"
style="margin-right:15px;"
type="info"
v-if="showAps"
>
<a href="javascript:;" @click="goAps">APS排产&nbsp;&nbsp;&nbsp;</a> <a href="javascript:;" @click="goAps">APS排产&nbsp;&nbsp;&nbsp;</a>
</Badge> </Badge>
<Badge <Badge :count="this.$store.state.countAi" overflow-count="99" style="margin-right:15px;" type="info" v-if="showAi">
:count="this.$store.state.countAi"
overflow-count="99"
style="margin-right:15px;"
type="info"
v-if="showAi"
>
<a href="javascript:;" @click="goAi">智能排产&nbsp;&nbsp;&nbsp;</a> <a href="javascript:;" @click="goAi">智能排产&nbsp;&nbsp;&nbsp;</a>
</Badge> </Badge>
<Badge <Badge :count="this.$store.state.countAll" overflow-count="99" style="margin-right:15px;" type="info" v-if="showAll">
:count="this.$store.state.countAll"
overflow-count="99"
style="margin-right:15px;"
type="info"
v-if="showAll"
>
<a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a> <a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a>
</Badge> </Badge>
<Badge :count="this.$store.state.countRun" overflow-count="99" type="info" v-if="showRun"> <Badge :count="this.$store.state.countRun" overflow-count="99" type="info" v-if="showRun">
...@@ -126,19 +95,11 @@ ...@@ -126,19 +95,11 @@
<orderSupport ref="orderSupport"></orderSupport> <orderSupport ref="orderSupport"></orderSupport>
</Modal> </Modal>
<Modal v-model="modalAccessory" :title="title" fullscreen footer-hide> <Modal v-model="modalAccessory" :title="title" fullscreen footer-hide>
<component <component :is="details" :eid="orderId" :mesCode="mesCode" :productName="productName" :drawnNumber="drawnNumber" :count="count" @on-close="cancel" @on-ok="addOk" />
:is="details"
:eid="orderId"
:mesCode="mesCode"
:productName="productName"
:drawnNumber="drawnNumber"
:count="count"
@on-close="cancel"
@on-ok="addOk"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Add from "./add"; import Add from "./add";
...@@ -174,8 +135,7 @@ export default { ...@@ -174,8 +135,7 @@ export default {
scheduleModal: false, scheduleModal: false,
orderSupportModal: false, orderSupportModal: false,
curId: 0, curId: 0,
statuList: statuList: this.$store.getters.dictionaryByKey("aps.plan.supportingStatus") || [],
this.$store.getters.dictionaryByKey("aps.plan.supportingStatus") || [],
name: "", name: "",
items: null, items: null,
title: "", title: "",
...@@ -188,8 +148,7 @@ export default { ...@@ -188,8 +148,7 @@ export default {
drawnNumber: "", drawnNumber: "",
count: 0, count: 0,
modalAccessory: false, modalAccessory: false,
columns: [ columns: [{
{
key: "selection", key: "selection",
title: "#", title: "#",
type: "selection", type: "selection",
...@@ -231,8 +190,7 @@ export default { ...@@ -231,8 +190,7 @@ export default {
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h( return h(
"op", "op", {
{
attrs: { attrs: {
oprate: "detail", oprate: "detail",
}, },
...@@ -376,16 +334,15 @@ export default { ...@@ -376,16 +334,15 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", {
class: "action"
}, [
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "detail", oprate: "detail",
title: title: params.row.mainRoutingSetStatus == 0 ?
params.row.mainRoutingSetStatus == 0 "工艺派发" : "移入排产",
? "工艺派发"
: "移入排产",
}, },
style: { style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "", color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
...@@ -393,27 +350,23 @@ export default { ...@@ -393,27 +350,23 @@ export default {
on: { on: {
click: () => click: () =>
params.row.mainRoutingSetStatus == 0 || params.row.mainRoutingSetStatus == 0 ||
params.row.mainRoutingSetStatus == 1 params.row.mainRoutingSetStatus == 1 ?
? this.goMethod(params.row) this.goMethod(params.row) : null,
: null,
}, },
}, },
params.row.mainRoutingSetStatus == 0 params.row.mainRoutingSetStatus == 0 ?
? "工艺派发" "工艺派发" :
: params.row.mainRoutingSetStatus == 1 params.row.mainRoutingSetStatus == 1 ?
? "移入排产" "移入排产" :
: "" ""
), ),
h( h(
"op", "op", {
{
attrs: { attrs: {
oprate: "detail", oprate: "detail",
title: title: params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 2 || params.row.isSupportingFinish == 3 ?
params.row.isSupportingFinish == 3 "配套派发" : "",
? "配套派发"
: "",
}, },
style: { style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "", color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
...@@ -421,15 +374,14 @@ export default { ...@@ -421,15 +374,14 @@ export default {
on: { on: {
click: () => click: () =>
params.row.isSupportingFinish == 2 || params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 params.row.isSupportingFinish == 3 ?
? this.supportDis(params.row) this.supportDis(params.row) : null,
: null,
}, },
}, },
params.row.isSupportingFinish == 2 || params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 params.row.isSupportingFinish == 3 ?
? "配套派发" "配套派发" :
: "" ""
), ),
]); ]);
}, },
...@@ -458,7 +410,10 @@ export default { ...@@ -458,7 +410,10 @@ export default {
mounted() { mounted() {
this.loadInitCount(); this.loadInitCount();
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
...@@ -670,7 +625,9 @@ export default { ...@@ -670,7 +625,9 @@ export default {
this.curId = id; this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({
id: this.curId
}).then((r) => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.deletelModal = false; this.deletelModal = false;
...@@ -747,7 +704,9 @@ export default { ...@@ -747,7 +704,9 @@ export default {
//进入页面加载排产count----- //进入页面加载排产count-----
loadInitCount() { loadInitCount() {
let currentUserId = this.$store.state.userInfo.userId; let currentUserId = this.$store.state.userInfo.userId;
let para = { id: currentUserId }; let para = {
id: currentUserId
};
Api.listbyuser(para).then((datas) => { Api.listbyuser(para).then((datas) => {
if (datas.success && datas.result && datas.result.length > 0) { if (datas.success && datas.result && datas.result.length > 0) {
datas.result.forEach((dateScheduleId) => { datas.result.forEach((dateScheduleId) => {
...@@ -774,14 +733,14 @@ export default { ...@@ -774,14 +733,14 @@ export default {
this.$store.commit("setCountRun", 0); this.$store.commit("setCountRun", 0);
Api.getpoolordercount() Api.getpoolordercount()
.then((res) => { .then((res) => {
if (res.success && res.result.length > 1) { if (res.success && res.result && res.result.length > 0) {
res.result.forEach((data) => { res.result.forEach((data) => {
this.changeCountOut(data.poolType, data.count); this.changeCountOut(data.poolType, data.count);
}); });
} }
}) })
.catch((err) => { .catch((err) => {
this.$Message.error("获取排产模型数量失败"); this.$Message.error("获取排产池排产数量失败");
}); });
}, },
//配套申请 //配套申请
...@@ -835,16 +794,20 @@ export default { ...@@ -835,16 +794,20 @@ export default {
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
.footerSpan { .footerSpan {
width: 120px; width: 120px;
} }
.demo-badge-alone { .demo-badge-alone {
background: #5cb85c !important; background: #5cb85c !important;
} }
.radioList { .radioList {
margin: 10px 30px; margin: 10px 30px;
} }
.radioList label { .radioList label {
margin-top: 5px; margin-top: 5px;
} }
......
...@@ -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",
......
...@@ -366,10 +366,10 @@ export default { ...@@ -366,10 +366,10 @@ export default {
overflow: hidden; overflow: hidden;
border: #cacbd0 dashed 1px; border: #cacbd0 dashed 1px;
img { //img {
// width: 90px; // width: 90px;
// height: 90px; // height: 90px;
} //}
} }
.row { .row {
......
<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;
......
<template> <template>
<div class="Design"> <div class="Design">
<Timeline> <Timeline>
<TimelineItem v-for="(node,i) in nodes" :key="node.id"> <TimelineItem v-for="(node,i) in nodes" :key="node.id">
<Badge :count="i+1" type="primary" slot="dot"></Badge> <Badge :count="i+1" type="primary" slot="dot"></Badge>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
&nbsp;( &nbsp;(
<state code="workflow.form.audit.type" :value="node.operation" />) <state code="workflow.form.audit.type" :value="node.operation" />)
<Icon type="md-build" /> <Icon type="md-build" />
<Icon v-if="node.isFixed" type="ios-lock" color="orange" title="人员固定"/> <Icon v-if="node.isFixed" type="ios-lock" color="orange" title="人员固定" />
</a> </a>
</div> </div>
<div v-if="node.userIds&&node.userIds.length>0"> <div v-if="node.userIds&&node.userIds.length>0">
...@@ -19,10 +19,7 @@ ...@@ -19,10 +19,7 @@
</div> </div>
<div v-if="node.roleList&&node.roleList.length>0"> <div v-if="node.roleList&&node.roleList.length>0">
审批角色: 审批角色:
<span <span v-for="(role,k) in node.roleList" class="mr10">{{role.name}}({{role.userIdList.length}})</span>
v-for="(role,k) in node.roleList"
class="mr10"
>{{role.name}}({{role.userIdList.length}})</span>
</div> </div>
</div> </div>
</TimelineItem> </TimelineItem>
...@@ -33,8 +30,9 @@ ...@@ -33,8 +30,9 @@
<Modal v-model="startModal" title="开始节点编辑" footer-hide width="800"> <Modal v-model="startModal" title="开始节点编辑" footer-hide width="800">
<StartEdit :eid="startId" @on-close="cancel" @on-ok="addOk" /> <StartEdit :eid="startId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
import Edit from './node' import Edit from './node'
...@@ -58,24 +56,29 @@ export default { ...@@ -58,24 +56,29 @@ export default {
props: { props: {
eid: String eid: String
}, },
async fetch({ store, params }) { async fetch({
store,
params
}) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch('loadDictionary') // 加载数据字典
}, },
mounted(){ mounted() {
this.load(this.eid) this.load(this.eid)
}, },
methods: { methods: {
load(v) { load(v) {
alert(v) //alert(v)
Api.detail({ id: v }).then((r) => { Api.detail({
id: v
}).then((r) => {
this.nodes = r.result.nodes this.nodes = r.result.nodes
// this.$emit('on-load') // this.$emit('on-load')
}) })
}, },
edit(id, i) { edit(id, i) {
if (i== 0) { if (i == 0) {
this.startModal=true this.startModal = true
this.startId=id; this.startId = id;
} else { } else {
this.editModal = true this.editModal = true
this.curId = id this.curId = id
...@@ -109,14 +112,17 @@ export default { ...@@ -109,14 +112,17 @@ export default {
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
.Design { .Design {
background: white; background: white;
padding: 20px 50px; padding: 20px 50px;
.node { .node {
.title { .title {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
.auditedTime { .auditedTime {
font-size: 12px; font-size: 12px;
color: #ddd; color: #ddd;
......
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