feat: 原route页面添加dag图

This commit is contained in:
caoqianming 2025-12-12 13:59:08 +08:00
parent fcc36bf29b
commit d1cf6b2afb
2 changed files with 30 additions and 16 deletions

View File

@ -404,6 +404,12 @@ export default {
); );
}, },
}, },
dag: {
name: "dag图",
req: async function (data) {
return await http.post(`${config.API_URL}/mtm/route/dag/`, data);
},
},
}, },
routemat: { routemat: {
list: { list: {

View File

@ -10,18 +10,21 @@
</el-aside> </el-aside>
<el-main class="nopadding"> <el-main class="nopadding">
<el-container> <el-container>
<el-aside width="200px"> <el-aside width="400px">
<el-container> <el-container>
<el-header> <el-header>
<div style="font-size: 20px; padding: 8px;" v-if="selectedProduct">{{ selectedProduct.name }} <div style="font-size: 20px; padding: 8px;" v-if="selectedProduct">{{ selectedProduct.full_name }}
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div style="height: 90%; padding: 8px"> <scDegra
<el-steps direction="vertical" active="20" id="elSteps"> style="margin-top: 50px;"
<el-step v-for="item in currentRoute" v-bind:key="item.id" :title="item.process_name" /> ref="degraDialogs"
</el-steps> :nodes="nodes"
</div> :edges="edges"
:rankdir="'DL'"
>
</scDegra>
</el-main> </el-main>
</el-container> </el-container>
</el-aside> </el-aside>
@ -31,12 +34,12 @@
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="table_add" <el-button type="primary" icon="el-icon-plus" @click="table_add"
v-auth="'route.create'">新增</el-button> v-auth="'route.create'">新增</el-button>
<div style="font-size: 16px">当前选择: {{ selectedProduct.name }}</div> <div style="font-size: 16px">当前选择: {{ selectedProduct.full_name }}</div>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :data="currentRoute" row-key="id" hidePagination> <scTable ref="table" :data="currentRoute" row-key="id" hidePagination>
<el-table-column label="排序" prop="sort" min-width="80"></el-table-column> <el-table-column label="排序" prop="sort" width="80"></el-table-column>
<el-table-column label="工序" min-width="120"> <el-table-column label="工序" min-width="120">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.process_cate }} - {{ scope.row.process_name }}</span> <span>{{ scope.row.process_cate }} - {{ scope.row.process_name }}</span>
@ -57,9 +60,9 @@
<el-table-column label="出材率" prop="out_rate" min-width="80"></el-table-column> <el-table-column label="出材率" prop="out_rate" min-width="80"></el-table-column>
<el-table-column label="统计工序" min-width="80"> <el-table-column label="统计工序" min-width="80">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.is_count_utask" color="green"> <span v-if="scope.row.is_count_utask" style="color:green">
<CircleCheckFilled />
</el-icon> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-table-column label="操作" fixed="right" align="center" width="140">
@ -155,6 +158,8 @@ export default {
dialogTitle: '新增', dialogTitle: '新增',
updateDisable: false, updateDisable: false,
currentRoute: [], currentRoute: [],
nodes: [],
edges: []
} }
}, },
mounted() { mounted() {
@ -163,9 +168,11 @@ export default {
this.getMaterial() this.getMaterial()
}, },
methods: { methods: {
getRoute() { getDEGdatas(){
this.$API.mtm.route.list({ material: this.selectedProduct.id, page: 0 }).then(res => { let that = this;
this.currentRoute = res that.$API.mtm.route.dag.req({product: that.selectedProduct.id}).then(res=>{
that.nodes = res.nodes
that.edges = res.edges
}) })
}, },
// //
@ -232,6 +239,7 @@ export default {
this.$API.mtm.route.list.req({ page: 0, material: materialId }).then(res => { this.$API.mtm.route.list.req({ page: 0, material: materialId }).then(res => {
this.currentRoute = res this.currentRoute = res
}) })
this.getDEGdatas()
} }
} }
} }