171 lines
6.9 KiB
HTML
171 lines
6.9 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<style>
|
|
.design-dialog .el-dialog__body {
|
|
padding: 0;
|
|
}
|
|
.el-table__row--level-1 {
|
|
background-color: #FDF5E6 !important;
|
|
}
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
<guava>
|
|
<el-card shadow="never">
|
|
<search @search="doSearch">
|
|
<search-item label="流程名称">
|
|
<el-input v-model="pageForm.displayName" placeholder="请输入流程名称" clearable></el-input>
|
|
</search-item>
|
|
<search-item label="流程编码">
|
|
<el-input v-model="pageForm.name" placeholder="请输入流程编码" clearable></el-input>
|
|
</search-item>
|
|
<search-item label="流程分类">
|
|
<el-select v-model="pageForm.category" placeholder="请选择流程分类" style="width: 100%"
|
|
@change="doSearch" clearable>
|
|
<el-option v-for="item in categoryOptions" :label="item.name" :value="item.id" :key="item.id"></el-option>
|
|
</el-select>
|
|
</search-item>
|
|
</search>
|
|
</el-card>
|
|
|
|
<el-card shadow="never">
|
|
<table-tool></table-tool>
|
|
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%"
|
|
row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
|
<el-table-column label="序号" type="index" width="60">
|
|
<template v-slot="{ row }">
|
|
{{ row.rowNum }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
:label="column.label"
|
|
:prop="column.prop"
|
|
:key="column.prop"
|
|
:width="column.width"
|
|
:sortable="column.sortable"
|
|
align="center"
|
|
header-align="center"
|
|
show-overflow-tooltip
|
|
v-for="column in tableColumns"
|
|
>
|
|
<template v-slot="{ row }" v-if="column.prop === 'categoryName'">
|
|
{{ categoryOptions.find(item => item.id === row.category)?.name }}
|
|
</template>
|
|
<template v-slot="{ row }" v-else-if="column.prop === 'state'">
|
|
<el-tag size="mini" v-if="row.state===1" type="success">启用</el-tag>
|
|
<el-tag size="mini" v-else-if="row.state===0" type="info">停用</el-tag>
|
|
</template>
|
|
<template v-slot="{ row }" v-else-if="column.prop === 'createTime'">
|
|
{{ $moment(row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" fixed="right" width="350px">
|
|
<template slot-scope="{row}">
|
|
<el-button type="primary" size="mini" @click="onView(row)">查看</el-button>
|
|
<el-button v-if="row.state===1" type="danger" size="mini" @click="onDisable(row)">停用</el-button>
|
|
<el-button v-if="row.state===0" type="primary" size="mini" @click="onEnable(row)">启用</el-button>
|
|
<el-button v-if="row.state===0" type="danger" size="mini" @click="onDelete(row)">删除</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-card>
|
|
</guava>
|
|
|
|
<el-dialog title="查看流程图" :visible.sync="designVisible" class="design-dialog" width="80%">
|
|
<div style="height: calc(100vh - 150px); width: 100%">
|
|
<iframe v-if="designVisible" :src="designUrl" frameborder="0" height="100%" style="height: 100%; width: inherit"></iframe>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
|
|
<script nonce="${cspNonce!}">
|
|
new Vue({
|
|
el: "#app",
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
categoryOptions: [],
|
|
designVisible: false,
|
|
designUrl: null,
|
|
tableColumns: [
|
|
{prop: 'displayName', label: '流程定义名称'},
|
|
{prop: 'name', label: '流程定义编码'},
|
|
{prop: 'categoryName', label: '流程分类'},
|
|
{prop: 'version', label: '版本号'},
|
|
{prop: 'state', label: '状态'},
|
|
{prop: 'createTime', label: '创建时间'},
|
|
],
|
|
}
|
|
},
|
|
methods: {
|
|
onView(row) {
|
|
this.designVisible = true
|
|
this.designUrl = "/flow/define/preview?defineId=" + row.id
|
|
},
|
|
|
|
onDisable(row) {
|
|
this.$confirm("确定要停用该流程吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
}).then(() => {
|
|
this.$axios.post("/flow/define/disable", { id: row.id }).then((res) => {
|
|
if (res.code === 0) {
|
|
this.$message.success("停用成功")
|
|
this.pageData()
|
|
}
|
|
})
|
|
})
|
|
},
|
|
onEnable(row) {
|
|
this.$confirm("确定要启用该流程吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
}).then(() => {
|
|
this.$axios.post("/flow/define/enable", { id: row.id }).then((res) => {
|
|
if (res.code === 0) {
|
|
this.$message.success("启用成功")
|
|
this.pageData()
|
|
}
|
|
})
|
|
})
|
|
},
|
|
|
|
onDelete(row) {
|
|
this.$confirm("您确定要删除吗", "提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
}).then(() => {
|
|
this.$axios.post("/flow/define/delete", { id: row.id }).then((res) => {
|
|
if (res.code === 0) {
|
|
this.$message.success(res.msg)
|
|
this.pageData()
|
|
}
|
|
})
|
|
})
|
|
},
|
|
|
|
listCategory() {
|
|
this.$axios.post("/flow/category/list").then((res) => {
|
|
if (res.code === 0) {
|
|
this.categoryOptions = res.data
|
|
}
|
|
})
|
|
}
|
|
},
|
|
created() {
|
|
this.pageData()
|
|
this.listCategory()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|