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

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

export default {
  mixins: [table],
  methods: {
    delete(row) {},
  },
  data() {
    return {
      config: {
        name: "yitihua",
        downloadUrl: "",
        columns: [
          { type: "selection", reserveSelection: true },
          { type: "index", label: "序号", align: "center", width: 50 },
          {
            prop: "eventObjectType",
            label: "申报类型",
            align: "center",
            formatter: (row) => {
              if (row.eventObjectType.indexOf("/") == -1) {
                return this.tableData.dict.eventObjectType[row.eventObjectType];
              } else {
                let str = row.eventObjectType.split("/");
                let arr = str
                  .map((v) => {
                    return (v = this.tableData.dict.eventObjectType[v]);
                  })
                  .join("/");
                return arr;
              }
            },
          },
          {
            prop: "implementName",
            label: "事项名称",
            align: "center",
          },
          {
            label: "操作",
            align: "center",
            formatter: (row) => {
              return (
                <div>
                  <el-button
                    size="mini"
                    type="danger"
                    onClick={() => this.delete(row)}
                  >
                    移除
                  </el-button>
                </div>
              );
            },
          },
        ],
        search: [
          {
            name: "eventObjectType",
            type: "select",
            label: "申报类型",
          },
          {
            name: "implementName",
            type: "text",
            label: "事项名称搜索",
          },
        ],
      },
    };
  },
};
</script>
<style lang="less" scoped>
.page {
  display: flex;
  .left_box {
    width: 50%;
    height: 100%;
    border-right: 1px solid #ededed;
    padding: 20px;
  }
  .right_box {
    flex: 1;
    height: 100%;
    padding: 20px;
  }
}
</style>
