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

<script>
import table from "@/assets/mixins/table";

export default {
  mixins: [table],
  created() {
    const { matterId } = this.$route.query;
    this.config.addQuery = { matterId: this.$route.query["query.matterId"] };
  },
  data() {
    return {
      config: {
        columns: [
          { label: "事项名称", prop: "matterName", tooltip: true },
          { label: "办理流程", prop: "flowName" },
          { label: "办理时长", prop: "flowTime" },
          { label: "转外时限", prop: "flowTurnOut" },
          { label: "办理说明", prop: "flowDesc" },
          { label: "受理条件来源", prop: "source", formatter: this.formatter },

          {
            label: "操作",
            width: 180,
            formatter: (row) => {
              return (
                <div>
                  <el-button
                    type="primary"
                    icon="el-icon-edit"
                    round
                    size="mini"
                    onClick={() => {
                      this.toEdit(row);
                    }}
                  >
                    编辑
                  </el-button>

                  {row.source == 1 ? (
                    <Confirm
                      onConfirm={() => {
                        this.toDel(row.id, 0);
                      }}
                      message="是否删除当前办理流程？"
                    >
                      <span>&nbsp;&nbsp;</span>
                      <el-button
                        size="mini"
                        type="warning"
                        icon="el-icon-delete"
                       round
                        title="删除"
                      >删除</el-button>{" "}
                    </Confirm>
                  ) : (
                    ""
                  )}
                </div>
              );
            },
          },
        ],
      },
    };
  },
};
</script>