|
|
<template> <div> <!--工具栏--> <div class="head-container"> <div class="head-search"> <el-input v-model="query.promoter" clearable size="small" placeholder="输入发起人名" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> <el-select v-model="query.modelKeys" multiple collapse-tags placeholder="请选择" > <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> </el-select> <date-range-picker v-model="query.createTime" class="date-item" /> <rrOperation /> </div> </div> <!--表格渲染--> <el-table ref="table" v-loading="crud.loading" :data="crud.data" row-key="id" @select="crud.selectChange" @select-all="crud.selectAllChange" @cell-dblclick="tableDoubleClick" @selection-change="crud.selectionChangeHandler" > <el-table-column label="发起时间" prop="startTime" align="center" width="160"> <template slot-scope="scope"> <div>{{ scope.row.startTime | parseTime }}</div> </template> </el-table-column> <el-table-column label="发起人" prop="promoter" align="center" width="140" /> <el-table-column label="流程名称" prop="flowableName" align="center" /> <el-table-column label="当前节点" prop="currentNode" align="center" /> <el-table-column label="下一节点" prop="nextNode" align="center" /> <el-table-column label="结束时间" prop="endTime" align="center" width="160"> <template slot-scope="scope"> <div v-if="scope.row.endTime">{{ scope.row.endTime | parseTime }}</div> <div v-else>-</div> </template> </el-table-column> <el-table-column label="流程状态" prop="status" align="center" width="140"> <template> <div class="row-state active-state">进行中</div> </template> </el-table-column> </el-table> <!--分页组件--> <pagination v-if="crud.data.length!==0" /> <Detail ref="processDetail" /> </div> </template>
<script> import { FetchGenProcessDiagram } from '@/api/system/flowable' import CRUD, { presenter, header, crud } from '@crud/crud' import rrOperation from '@crud/RR.operation' import DateRangePicker from '@/components/DateRangePicker' import pagination from '@crud/Pagination' import Detail from './module/detail'
export default { name: 'RunningProcess', components: { rrOperation, DateRangePicker, pagination, Detail }, cruds() { return CRUD({ title: '运行中流程', url: 'api/flowable/getFlowList', crudMethod: {}}) }, mixins: [presenter(), header(), crud()], data() { return { options: [{ value: '选项1', label: '流程A' }, { value: '选项2', label: '流程B' }, { value: '选项3', label: '流程C' }, { value: '选项4', label: '流程D' }], permission: { add: ['admin', 'dept:add'], edit: ['admin', 'dept:edit'], del: ['admin', 'dept:del'] } } }, methods: { [CRUD.HOOK.beforeRefresh]() { this.crud.query.isEnd = false }, // table - 双击查看详情
tableDoubleClick(row) { this.$refs.processDetail.detailVisible = true FetchGenProcessDiagram({ 'processId': row.procinstId }).then((res) => { console.log(res) }).catch(err => { console.log(err) }) } } } </script>
<style lang="scss" scoped> @mixin table-fixed-status-style{ [data-theme="dark"] & { &.active-state{ color: #0348F3; border: 1px solid #0348F3 ; } } [data-theme="light"] & { &.active-state{ color: #0348F3; background-color: #EEF5FE; border: 1px solid #0348F3; } } } .row-state{ display: inline-block; padding: 0 4px; height: 20px; line-height: 20px; text-align: center; font-size: 12px; border-radius: 3px; @include table-fixed-status-style; } </style>
|