<template>
  <div class="screeningSearch">
    <div class="top">
      <form-components :forms="formList"></form-components>
    </div>
    <div class="bot">
      <customs-table
        ref="table"
        :table-data="tableData"
        :columns="columns"
        :header-class="'newHeader'"
        :list-loading="listLoading"
        :current-page="pageIndex"
        :total-count="total"
        :page-sizes="pageSizes"
        :page-size="pageSize"
        @pageSizeChange="handleSizeChange"
        @currentPageChange="handleCurrentChange"
      />
    </div>
  </div>
</template>
<script>
import FormComponents from "@/components/FormComponents"
import CustomsTable from "@/components/CustomsTable"
import paginationMixin from "@/components/TabComponents/mixin"
export default {
  components: {
    CustomsTable,
    FormComponents,
  },
  mixins: [paginationMixin],
  data() {
    return {
      listLoading: false,
      keyword: "",
      modifiedFlag: false,
      columns: [
        {
          label: "医联体",
          value: "name",
          minWidth: 120,
        },
        {
          label: "姓名",
          value: "1",
          minWidth: 120,
        },
        {
          label: "性别",
          value: "2",
          minWidth: 120,
        },
        {
          label: "身份证",
          value: "3",
          minWidth: 120,
        },
        {
          label: "年龄",
          minWidth: 120,
        },
        {
          label: "筛查时间",
          value: "5",
          minWidth: 120,
        },
        {
          label: "风险评估结果",
          value: "6",
          minWidth: 120,
        },
        {
          label: "上次随访时间",
          value: "7",
          minWidth: 120,
        },
        {
          label: "随访进度",
          value: "8",
          minWidth: 120,
        },
        {
          label: "计划随访时间",
          value: "9",
          minWidth: 120,
        },
        {
          label: "操作",
          width: 220,
          fixed: "right",
          operType: "button",
          operations: [
            {
              func: this.rowOpration,
              formatter(row) {
                return {
                  label: " 录入",
                  type: "text",
                }
              },
            },
          ],
        },
      ],
      tableData: [
        {
          name: "1",
          1: 2,
        },
      ],
      formList: [
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "select",
          label: "计划随访时间",
          prop: "planScreeningTime",
          placeholder: "请选择计划随访时间",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "input",
          label: "关键词",
          prop: "keyWord",
          placeholder: "请输入医联体/姓名/身份证",
          rules: [],
        },
        {
          xs: 24,
          sm: 12,
          md: 12,
          lg: 7,
          xl: 7,
          type: "select",
          label: "随访进度",
          prop: "screeningProgress",
          placeholder: "请选择随访进度",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          xs: 1,
          sm: 2,
          md: 2,
          lg: 2,
          xl: 2,
          type: "btn",
          list: [
            {
              btnType: "button",
              type: "",
              style: {
                width: "80px",
                height: "32px",
                borderRadius: "4px",
                fontSize: "14px",
                marginLeft: "40px",
              },
              btnText: "查询",
              func: () => {
                this.onSearch()
              },
            },
            // {
            //   btnType: "tobeModified",
            //   tobeModified: 20,
            // },
          ],
        },
      ],
    }
  },
  watch: {},
  mounted() {},
  methods: {
    changeModified() {
      this.modifiedFlag = !this.modifiedFlag
    },
    setSelectedIndex(i) {
      console.log(this.selectedIndex)
      this.selectedIndex = i
      sessionStorage.setItem("homeSelectedIndex", this.selectedIndex)
    },
    changePage(v) {
      this.page[v.type] = v.value
      console.log(this.page)
      this.$refs.customTable.loading = false
    },
    onSearch() {
      console.log(123456)
    },
    rowOpration(data, i) {
      console.log(data, i)
      this.$router.push("/followupentry")
    },
  },
}
</script>
<style lang="scss" scoped>
.screeningSearch {
  .top {
    width: 100%;
    // height: 72px;
    padding: 0 116px 0 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .bot {
    padding: 0 24px;
  }
}
</style>
