<template>
|
<div class="nodeManageWarp">
|
<flex-layout class="list-contain">
|
<div class="scroll">
|
<el-table :data="tableData" stripe border style="width: 100%">
|
<el-table-column prop="linkName" label="节点名称">
|
</el-table-column>
|
<el-table-column prop="linkLevel" label="节点层级">
|
</el-table-column>
|
<el-table-column prop="roleListName" label="节点所含角色">
|
</el-table-column>
|
<el-table-column prop="typeName" label="所属工单类型">
|
</el-table-column>
|
<el-table-column fixed="right" label="操作">
|
<template slot-scope="scope">
|
<el-button type="text" style="margin-right:8px;" @click="toAddPage(scope.row)">编辑</el-button>
|
<el-popconfirm title="确定删除该节点吗?" @confirm="remove(scope.row)">
|
<el-button slot="reference" type="text">删除</el-button>
|
</el-popconfirm>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<!-- 分页 -->
|
<div class="pagination" slot="footer">
|
<!-- <el-button type="primary" size="mini" icon="el-icon-arrow-left">上一页</el-button>
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.currentPage" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="page.total">
|
</el-pagination>
|
<el-button type="primary" size="mini" icon="el-icon-arrow-right">下一页</el-button> -->
|
<el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="toAddPage">新增节点</el-button>
|
</div>
|
</flex-layout>
|
</div>
|
</template>
|
|
<script>
|
import {
|
getPropertyList,
|
delWorkflowProperty
|
} from '../js/api';
|
import {
|
workType,
|
linkLevel
|
} from '@/assets/js/constants';
|
export default {
|
data() {
|
return {
|
tableData: [],
|
page: {
|
currentPage: 1,
|
pageSizes: [1, 5, 10, 20],
|
pageSize: 5,
|
total: 0
|
}
|
}
|
},
|
mounted() {
|
this.loadList()
|
},
|
methods: {
|
loadList() {
|
getPropertyList().then((res) => {
|
if (res.data.code == 1) {
|
let resData = res.data.data;
|
let arr = [];
|
resData.map(item => {
|
let roleListName = '';
|
item.roleList.map(jtem => {
|
roleListName += jtem.name + ','
|
})
|
let obj = {
|
linkName: item.linkName,
|
linkType: item.linkType,
|
linkLevel: linkLevel[item.linkType],
|
roleList: item.roleList,
|
roleListName: roleListName,
|
typeName: workType[item.type],
|
type: item.type,
|
}
|
arr.push(obj)
|
})
|
this.tableData = arr
|
}
|
}).catch((err) => {
|
console.log(err)
|
});
|
},
|
remove(rowData) {
|
let postData = {
|
linkType: rowData.linkType,
|
type: rowData.type,
|
}
|
delWorkflowProperty(postData).then((res) => {
|
if (res.data.code == 1) {
|
this.loadList()
|
this.$message({
|
message: '删除成功!',
|
type: 'success'
|
});
|
}
|
}).catch((err) => {
|
console.log(err)
|
});
|
},
|
toAddPage(data) {
|
if (data) {
|
this.$router.push({
|
path: '/manage/addNode',
|
query: { data: JSON.stringify(data) }
|
})
|
} else {
|
this.$router.push({
|
path: '/manage/addNode',
|
})
|
}
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.nodeManageWarp {
|
padding: 16px 0 0 16px;
|
width: 100%;
|
height: 100%;
|
}
|
.list-contain {
|
background: #fff;
|
border: 1px #c4c4c4 solid;
|
padding: 30px 0 10px 30px;
|
}
|
.scroll {
|
overflow-y: auto;
|
padding-right: 30px;
|
}
|
|
.pagination {
|
display: flex;
|
padding-top: 10px;
|
justify-content: center;
|
}
|
>>> .el-pagination {
|
display: flex;
|
padding: 0 1em;
|
}
|
>>> .el-pagination .el-input__inner {
|
background: #343345;
|
color: #fff;
|
}
|
>>> .el-input {
|
width: 30em;
|
}
|
>>> .el-textarea {
|
width: 40em;
|
}
|
>>> .el-select .el-input {
|
width: 16em;
|
}
|
>>> .el-pagination .el-input {
|
width: auto;
|
}
|
</style>
|