index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <ContentWrap>
  3. <!-- 搜索工作栏 -->
  4. <el-form
  5. class="-mb-15px"
  6. :model="queryParams"
  7. ref="queryFormRef"
  8. :inline="true"
  9. label-width="68px"
  10. >
  11. <el-form-item label="姓名" prop="name">
  12. <el-input
  13. v-model="queryParams.name"
  14. placeholder="请输入姓名"
  15. clearable
  16. @keyup.enter="handleQuery"
  17. class="!w-240px"
  18. />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
  22. <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
  23. <el-button
  24. type="primary"
  25. plain
  26. @click="openForm"
  27. >
  28. <Icon icon="ep:plus" class="mr-5px" /> 新增
  29. </el-button>
  30. <el-button
  31. type="warning"
  32. plain
  33. @click="handleExport"
  34. :loading="exportLoading"
  35. >
  36. 简历解析
  37. </el-button>
  38. <el-button
  39. type="success"
  40. plain
  41. @click="handleExport"
  42. :loading="exportLoading"
  43. >
  44. <Icon icon="ep:download" class="mr-5px" /> 导出
  45. </el-button>
  46. </el-form-item>
  47. </el-form>
  48. <div>
  49. </div>
  50. </ContentWrap>
  51. <!-- 列表 -->
  52. <ContentWrap>
  53. <el-table v-loading="loading" :data="list" :stripe="true">
  54. <!-- <el-table-column label="id" align="center" prop="id" :show-overflow-tooltip="true" /> -->
  55. <el-table-column label="姓名" align="center" prop="name" />
  56. <el-table-column label="标签个数" align="center" prop="num" />
  57. <el-table-column label="操作" align="center">
  58. <template #default="scope">
  59. <el-button
  60. link
  61. type="primary"
  62. @click="openDetail(scope.row)"
  63. >
  64. 查看
  65. </el-button>
  66. <el-button
  67. link
  68. type="danger"
  69. @click="handleDelete(scope.row.id)"
  70. >
  71. 删除
  72. </el-button>
  73. </template>
  74. </el-table-column>
  75. </el-table>
  76. <!-- 分页 -->
  77. <Pagination
  78. :total="total"
  79. v-model:page="queryParams.pageNo"
  80. v-model:limit="queryParams.pageSize"
  81. @pagination="getList"
  82. />
  83. </ContentWrap>
  84. <!-- 表单弹窗:添加/修改 -->
  85. <!-- <TalentForm ref="formRef" @success="getList" /> -->
  86. </template>
  87. <script setup>
  88. // import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
  89. import download from '@/utils/download'
  90. // import { HuntApi, HuntVO } from '@/api/menduner/system/hunt'
  91. // import TalentForm from './talentForm.vue'
  92. /** 猎寻服务 列表 */
  93. defineOptions({ name: 'TalentMap' })
  94. const message = useMessage() // 消息弹窗
  95. const { t } = useI18n() // 国际化
  96. const loading = ref(true) // 列表的加载中
  97. const list = ref([]) // 列表的数据
  98. const total = ref(0) // 列表的总页数
  99. const queryParams = reactive({
  100. pageNo: 1,
  101. pageSize: 10,
  102. name: undefined,
  103. })
  104. const queryFormRef = ref() // 搜索的表单
  105. const exportLoading = ref(false) // 导出的加载中
  106. /** 查询列表 */
  107. const getList = async () => {
  108. list.value = [{id: '1843909421273563137', userId: '800018973600124928', name: '测试', num: '23'}]
  109. loading.value = false
  110. // loading.value = true
  111. // try {
  112. // const data = await HuntApi.getHuntPage(queryParams)
  113. // // list.value = data.list
  114. // list.value = [{name: '测试'}]
  115. // total.value = data.total
  116. // } finally {
  117. // loading.value = false
  118. // }
  119. }
  120. /** 添加操作 */
  121. // const formRef = ref()
  122. // const openForm = () => {
  123. // formRef.value.open()
  124. // }
  125. /** 搜索按钮操作 */
  126. const handleQuery = () => {
  127. queryParams.pageNo = 1
  128. getList()
  129. }
  130. /** 重置按钮操作 */
  131. const resetQuery = () => {
  132. queryFormRef.value.resetFields()
  133. handleQuery()
  134. }
  135. /** 打开用户详情 */
  136. const { push } = useRouter()
  137. const openDetail = ({ id, userId }) => {
  138. push({ name: 'TalentMapDetail', query: { id, userId } })
  139. }
  140. /** 删除按钮操作 */
  141. const handleDelete = async (id) => {
  142. try {
  143. // 删除的二次确认
  144. await message.delConfirm()
  145. // 发起删除
  146. // await HuntApi.deleteHunt(id)
  147. // message.success(t('common.delSuccess'))
  148. // 刷新列表
  149. await getList()
  150. } catch {}
  151. }
  152. /** 导出按钮操作 */
  153. const handleExport = async () => {
  154. try {
  155. // 导出的二次确认
  156. await message.exportConfirm()
  157. // 发起导出
  158. exportLoading.value = true
  159. // const data = await HuntApi.exportHunt(queryParams)
  160. // download.excel(data, '猎寻服务.xls')
  161. } catch {
  162. } finally {
  163. exportLoading.value = false
  164. }
  165. }
  166. /** 初始化 **/
  167. onMounted(() => {
  168. getList()
  169. })
  170. </script>