<template>
  <div class="screeningSearch">
    <div class="top">
      <form-components :forms="formList"></form-components>
      <!-- <div class="keyword">
        <div class="label">关键词：</div>
        <Input
          v-model="keyword"
          placeholder="请输入医联体/姓名/身份证"
          clearable
          style="width: 224px"
        />
        <Button class="btn">搜索</Button>
      </div> -->
      <!-- <div
        class="tobeModified"
        :style="{ backgroundColor: modifiedFlag ? '#4E68FF' : '#fff' }"
        @click="changeModified"
      >
        <Icon
          :style="{ color: modifiedFlag ? '#fff' : '#d9d9d9' }"
          type="md-checkmark"
          class="check"
        />
        <span :style="{ color: modifiedFlag ? '#fff' : '#000' }"
          >待修改（{{ tobeModified }}）</span
        >
      </div> -->
    </div>
    <div class="bot">
      <custom-table
        ref="customTable"
        :table-header="tableHeader"
        :table-data="tableData"
        :page="page"
        @changePage="changePage"
      ></custom-table>
    </div>
  </div>
</template>
<script>
import CustomTable from "@/components/CustomTable"
import FormComponents from "@/components/FormComponents"
export default {
  components: {
    CustomTable,
    FormComponents,
  },
  data() {
    return {
      keyword: "",
      modifiedFlag: false,
      tableHeader: [
        {
          title: "医联体",
          key: "name",
          align: "center",
          width: 100,
        },
        {
          title: "姓名",
          width: 100,
          key: "1",
          align: "center",
        },
        {
          title: "性别",
          minWidth: 60,
          key: "2",
          align: "center",
        },
        {
          title: "身份证",
          width: 160,
          key: "3",
          align: "center",
        },
        {
          title: "年龄",
          minWidth: 60,
          align: "center",
        },
        {
          title: "筛查时间",
          width: 100,
          key: "5",
          align: "center",
        },
        {
          title: "风险评估结果",
          width: 180,
          key: "6",
          align: "center",
        },
        {
          title: "上次随访时间",
          width: 180,
          key: "7",
          align: "center",
        },
        {
          title: "筛查审核状态",
          key: "8",
          minWidth: 140,
          align: "center",
        },
        {
          title: "操作",
          width: 140,
          key: "action",
          fixed: "right",
          align: "center",
          render: (h, params) => {
            return h(
              "a",
              {
                on: {
                  click: () => {
                    console.log(params.row)
                  },
                },
              },
              "修改"
            )
          },
        },
      ],
      tableData: [
        {
          name: "1",
          1: 2,
        },
      ],
      formList: [
        {
          type: "select",
          label: "筛查时间",
          prop: "screeningTime",
          placeholder: "请选择时间",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          type: "select",
          label: "随访审核状态",
          prop: "screeningStatus",
          placeholder: "请选择随访状态",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          type: "select",
          label: "随访进度",
          prop: "screeningProgress",
          placeholder: "请选择随访进度",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          type: "select",
          label: "计划随访时间",
          prop: "planScreeningTime",
          placeholder: "请选择计划随访时间",
          rules: [],
          opts: [{ label: "123", value: "1" }],
        },
        {
          type: "input",
          label: "关键词",
          prop: "keyWord",
          placeholder: "请输入医联体/姓名/身份证",
          rules: [],
        },
        {
          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,
            },
          ],
        },
      ],
      page: {
        current: 1,
        size: 10,
        total: 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)
    },
  },
}
</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>
