<template>
  <div>
    <el-form :model="searchForm" inline>
      <el-form-item>
        <el-input v-model="searchForm.name" placeholder="请输入员工姓名" />
      </el-form-item>
      <el-form-item>
        <el-radio-group v-model="searchForm.status">
          <el-radio :label="0"> 在职 </el-radio>
          <el-radio :label="1"> 离职 </el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item>
        <el-button @click="handleQuery">搜索</el-button>
        <el-button type="primary" plain @click="handleQuery">新增</el-button>
      </el-form-item>
    </el-form>

    <el-table v-loading="loading" :data="tableList" border stripe>
      <el-table-column type="index" width="50" />
      <el-table-column label="用户姓名" prop="nickname" />
      <el-table-column label="部门" key="deptName" prop="deptName" />
      <el-table-column label="手机号码" prop="mobile" width="120" />
      <el-table-column label="考勤方案" />
      <el-table-column label="在职状态" prop="status" width="150" />
    </el-table>
    <Pagination
      :total="total"
      v-model:page="searchForm.pageNo"
      v-model:limit="searchForm.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script name="OAEmployee" setup>
const searchForm = ref({
  name: undefined,
  status: 0,
  pageNo: 1,
  pageSize: 20
})

/** 搜索按钮操作 */
const handleQuery = () => {
  searchForm.value.pageNo = 1
  getList()
}

const loading = ref(false)
const tableList = ref([])
const total = ref(0)
/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    tableList.value = [1, 2]
    // const data = await UserApi.getUserPage(queryParams)
    // tableList.value = data.list
    // total.value = data.total
  } finally {
    loading.value = false
  }
}
</script>

<style lang="scss" scoped></style>
