
<template>
  <div class="page">
    <LayoutTable :data="tableData" :config="tableConfig" notAdd notDel />
  </div>
</template>

<script>
import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished";

import table from "@/assets/mixins/table";

export default {
  mixins: [table],
  methods: {

    /** 流程流转记录 */
    handleFlowRecord(row){
      this.$router.push({ path: '/flowable/task/record/index',
        query: {
          procInsId: row.procInsId,
          deployId: row.deployId,
          taskId: row.taskId,
          finished: false
      }})
    },
  
  },
  data() {
    return {
      config: {
        search: [
          {
            name: "name",
            type: "text",
            label: "名称",
          },
        ],
        columns: [
          {
            type: "selection",
            width: 60,
          },

          {
            prop: "taskId",
            label: "任务编号",
          },

          {
            prop: "procDefName",
            label: "流程名称",
          },

          {
            prop: "taskName",
            label: "任务节点",
          },

          {
            prop: "procDefVersion",
            label: "流程版本",
            formatter: (row) => {
              return <el-tag size="medium">v{row.procDefVersion}</el-tag>;
            },
          },

          {
            prop: "createTime",
            label: "接收时间",
            width: 140,
            formatter: this.formatterDate,
          },

          {
            prop: "finishTime",
            label: "审批时间",
            width: 140,
            formatter: this.formatterDate,
          },

          {
            prop: "duration",
            label: "耗时",
          },

          {
            label: "操作",
            width: 180,
            formatter: (row) => {
              return (
                <el-row>
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-tickets"
                    onClick={() => {
                      this.handleFlowRecord(row);
                    }}
                  >
                    流转记录
                  </el-button>

                </el-row>
              );
            },
          },
        ],
      },
    };
  },
};
</script>
