<script setup>
import {reactive, ref, toRefs} from "vue";
import {technologyDemandList} from "@/api/dataList/technology-demand";
import {useRoute} from "vue-router";

const route = useRoute()
const total = ref(0)
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    brokerId: undefined
  }
})
const {queryParams} = toRefs(data)

if (route.query.id) {
  queryParams.value.brokerId = route.query.id
}

const dataList = ref([])

const getList = () => {
  technologyDemandList(queryParams.value).then(resp => {
    dataList.value = resp.rows
    total.value = resp.total
  })
}

getList()
</script>

<template>
  <div class="app-container">
    <el-table :data="dataList">
      <el-table-column align="center" label="编号" prop="id" width="80"></el-table-column>
      <el-table-column
          align="center"
          label="需求名称"
          prop="title"
      ></el-table-column>
      <el-table-column
          align="center"
          label="所属领域"
          prop="industryStr"
      ></el-table-column>
      <el-table-column
          align="center"
          label="联系人"
          prop="name"
      ></el-table-column>
      <el-table-column
          align="center"
          label="经纪人"
          prop="brokerName"
      ></el-table-column>
      <el-table-column
          align="center"
          label="手机"
          prop="mobile"
      ></el-table-column>
      <el-table-column
          align="center"
          label="发布时间"
          prop="createTime"
      ></el-table-column>
      <el-table-column
          align="center"
          label="截止日期"
          prop="deadline"
      ></el-table-column>
    </el-table>
    <pagination
        v-show="total > 0"
        v-model:limit="queryParams.pageSize"
        v-model:page="queryParams.pageNum"
        :total="total"
        @pagination="getList"
    />
  </div>
</template>

<style scoped lang="scss">

</style>