3 changed files with 143 additions and 1 deletions
@ -0,0 +1,122 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<!-- 查询条件 --> |
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-form :inline="true" :model="queryForm"> |
|||
<el-form-item label="任务名称"> |
|||
<el-input v-model="queryForm.taskName" placeholder="请输入任务名称" clearable /> |
|||
</el-form-item> |
|||
<el-form-item label="任务类型"> |
|||
<el-input v-model="queryForm.taskType" placeholder="请输入任务类型" clearable /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="Search" @click="handleSearch">搜索</el-button> |
|||
<el-button icon="Refresh" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-row> |
|||
|
|||
<!-- 表格 --> |
|||
<el-table |
|||
v-loading="loading" |
|||
:data="taskList" |
|||
style="width: 100%" |
|||
border |
|||
stripe |
|||
> |
|||
<el-table-column prop="taskCode" label="任务编号" width="180" /> |
|||
<el-table-column prop="taskType" label="任务类型" width="180" /> |
|||
<el-table-column prop="taskName" label="任务名称" width="220" /> |
|||
<el-table-column prop="processReleaseState" label="状态" width="100"> |
|||
<template #default="{ row }"> |
|||
<el-tag :type="row.processReleaseState === 'ONLINE' ? 'success' : 'info'"> |
|||
{{ row.processReleaseState === 'ONLINE' ? '上线' : '下线' }} |
|||
</el-tag> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="processDefinitionName" label="工作流名称" /> |
|||
<el-table-column prop="taskVersion" label="版本" width="120"> |
|||
<template #default="{ row }"> |
|||
V{{ row.taskVersion }} |
|||
</template> |
|||
</el-table-column> |
|||
|
|||
<el-table-column prop="taskCreateTime" label="创建时间" width="180" /> |
|||
<el-table-column prop="taskUpdateTime" label="更新时间" width="180" /> |
|||
</el-table> |
|||
|
|||
<!-- 分页 --> |
|||
<pagination |
|||
v-show="total > 0" |
|||
:total="total" |
|||
v-model:page="queryForm.pageNum" |
|||
v-model:limit="queryForm.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import { ref, reactive, onMounted } from 'vue' |
|||
import { ElMessage } from 'element-plus' |
|||
import { listTaskDefinitions } from '@/api/metadataConfig/metadataConfig' |
|||
import cache from "@/plugins/cache"; |
|||
|
|||
// 查询条件 |
|||
const queryForm = reactive({ |
|||
taskName: '', |
|||
taskType: '', |
|||
workflowName: '', |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
userName:cache.local.get("username"), |
|||
password:cache.local.get("password") |
|||
}) |
|||
|
|||
// 数据 |
|||
const taskList = ref([]) |
|||
const total = ref(0) |
|||
const loading = ref(false) |
|||
|
|||
// 获取列表 |
|||
async function getList() { |
|||
loading.value = true |
|||
try { |
|||
const res = await listTaskDefinitions(queryForm) |
|||
// 假设后端返回 { total, totalList } |
|||
taskList.value = res.data.totalList || res.data.rows || [] |
|||
total.value = res.data.total || 0 |
|||
} catch (error) { |
|||
ElMessage.error('获取任务定义失败,请重试') |
|||
} finally { |
|||
loading.value = false |
|||
} |
|||
} |
|||
|
|||
// 搜索 |
|||
function handleSearch() { |
|||
queryForm.pageNum = 1 |
|||
getList() |
|||
} |
|||
|
|||
// 重置 |
|||
function resetQuery() { |
|||
queryForm.taskName = '' |
|||
queryForm.taskType = '' |
|||
queryForm.pageNum = 1 |
|||
getList() |
|||
} |
|||
|
|||
onMounted(() => { |
|||
getList() |
|||
}) |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.app-container { |
|||
padding: 20px; |
|||
} |
|||
.mb8 { |
|||
margin-bottom: 8px; |
|||
} |
|||
</style> |
Loading…
Reference in new issue