diff --git a/src/api/TaskManagement/index.ts b/src/api/TaskManagement/index.ts
index 862a606..7701389 100644
--- a/src/api/TaskManagement/index.ts
+++ b/src/api/TaskManagement/index.ts
@@ -5,9 +5,9 @@ import request from '@/utils/request'
* */
// 查询任务列表
-export const ApiTasks = (boss_id: string) => {
+export const ApiTasks = (boss_id: string, page: number, page_size: number) => {
return request({
- url: `/api/tasks/${boss_id}`,
+ url: `/api/tasks/${boss_id}?page=${page}&page_size=${page_size}`,
method: 'get'
})
}
diff --git a/src/views/BoosAccountManagement/components/ViewTheTaskListDetails.vue b/src/views/BoosAccountManagement/components/ViewTheTaskListDetails.vue
index 59c8ff9..063ccb0 100644
--- a/src/views/BoosAccountManagement/components/ViewTheTaskListDetails.vue
+++ b/src/views/BoosAccountManagement/components/ViewTheTaskListDetails.vue
@@ -43,6 +43,13 @@
+
@@ -59,14 +66,20 @@ const props = defineProps({
})
const roleList = ref()
-
+const total = ref(0)
+const queryParams = reactive({
+ pageNum: 1,
+ pageSize: 10
+})
// 获取数据
function fetchData() {
- ApiTasks(props.bossId).then((res: any) => {
+ ApiTasks(props.bossId, queryParams.pageNum, queryParams.pageSize).then((res: any) => {
roleList.value = res.data
})
}
-
+defineExpose({
+ fetchData
+})
onMounted(() => {
fetchData()
})
diff --git a/src/views/BoosAccountManagement/index.vue b/src/views/BoosAccountManagement/index.vue
index 160ff40..d20078b 100644
--- a/src/views/BoosAccountManagement/index.vue
+++ b/src/views/BoosAccountManagement/index.vue
@@ -57,6 +57,7 @@
@@ -81,7 +82,7 @@
header-align="center"
>
-
+
{{ '在线' }}
@@ -170,14 +171,23 @@
>
招聘
+
+
+
+
+
+
+
+
+
- 查看任务
+ 展开任务
{
)
}
-const onDetails = (id: string) => {
- functionDialogBox(
- ViewTheTaskListDetails,
- {
- bossId: id
- },
- {
- title: '任务列表',
- width: '1200',
- footerVisible: false
- }
- )
-}
+// const onDetails = (id: string) => {
+// functionDialogBox(
+// ViewTheTaskListDetails,
+// {
+// bossId: id
+// },
+// {
+// title: '任务列表',
+// width: '1200',
+// footerVisible: false
+// }
+// )
+// }
const onApiTasksAdd = (id: string, task_type: string, params: string) => {
// functionDialogBox(
@@ -378,8 +390,9 @@ const onApiTasksAdd = (id: string, task_type: string, params: string) => {
ApiTasksAdd({ params, task_type, boss_id: id })
.then(() => {
- ElMessage.success('提交成功')
+ ElMessage.success('操作成功')
handleResetQuery()
+ refreshTaskList()
})
.finally(() => (loading.value = false))
}
@@ -387,11 +400,18 @@ function handleExpandChange(row: any, expandedRows: any[]) {
expandedRowKeys.value = expandedRows.map((item) => item.id)
}
-// const onApiTasksTaskId = (task_id: string) => {
-// ApiTasksTaskId(task_id).then((res: any) => {
-// console.log(res, 'res')
-// })
-// }
+const handleExpandTask = (rowId: string) => {
+ // 找到对应的行数据
+ const targetRow = roleList.value?.find((item) => item.id === rowId)
+ if (targetRow && dataTableRef.value) {
+ dataTableRef.value.toggleRowExpansion(targetRow)
+ }
+}
+
+const refreshTaskList = () => {
+ // 调用子组件的 fetchData 方法
+ taskListRef.value?.fetchData()
+}
onMounted(() => {
// handleQuery()