¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form v-show="showSearch" ref="queryFormRef" :model="queryParams" :inline="true"> |
| | | <el-form-item label="ä»»å¡åç§°" prop="name"> |
| | | <el-input v-model="queryParams.name" placeholder="请è¾å
¥ä»»å¡åç§°" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨å®ä¹åç§°" label-width="100" prop="processDefinitionName"> |
| | | <el-input v-model="queryParams.processDefinitionName" placeholder="请è¾å
¥æµç¨å®ä¹åç§°" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æµç¨å®ä¹KEY" label-width="100" prop="processDefinitionKey"> |
| | | <el-input v-model="queryParams.processDefinitionKey" placeholder="请è¾å
¥æµç¨å®ä¹KEY" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | </div> |
| | | </transition> |
| | | <el-card shadow="hover"> |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column align="center" type="index" label="åºå·" width="60"></el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" align="center" label="æµç¨å®ä¹åç§°"> |
| | | <template #default="scope"> |
| | | <span>{{ scope.row.processDefinitionName }}v{{ scope.row.processDefinitionVersion }}.0</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="processDefinitionKey" label="æµç¨å®ä¹KEY"></el-table-column> |
| | | <el-table-column align="center" prop="name" label="ä»»å¡åç§°"></el-table-column> |
| | | <el-table-column align="center" prop="assigneeName" label="åç人"> |
| | | <template #default="scope"> |
| | | <template v-if="scope.row.participantVo && scope.row.assignee === null"> |
| | | <el-tag v-for="(item, index) in scope.row.participantVo.candidateName" :key="index" type="success"> |
| | | {{ item }} |
| | | </el-tag> |
| | | </template> |
| | | <template v-else> |
| | | <el-tag type="success"> |
| | | {{ scope.row.assigneeName || 'æ ' }} |
| | | </el-tag> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="æµç¨ç¶æ" min-width="70"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="wf_business_status" :value="scope.row.businessStatus"></dict-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">æ¥ç</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total > 0" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | :total="total" |
| | | @pagination="handleQuery" |
| | | /> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { getPageByTaskCopy } from '@/api/workflow/task'; |
| | | import { TaskQuery } from '@/api/workflow/task/types'; |
| | | import workflowCommon from '@/api/workflow/workflowCommon'; |
| | | import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; |
| | | //审æ¹è®°å½ç»ä»¶ |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status')); |
| | | // é®ç½©å± |
| | | const loading = ref(true); |
| | | // é䏿°ç» |
| | | const ids = ref<Array<any>>([]); |
| | | // éå个ç¦ç¨ |
| | | const single = ref(true); |
| | | // éå¤ä¸ªç¦ç¨ |
| | | const multiple = ref(true); |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | const showSearch = ref(true); |
| | | // æ»æ¡æ° |
| | | const total = ref(0); |
| | | // 模åå®ä¹è¡¨æ ¼æ°æ® |
| | | const taskList = ref([]); |
| | | // æ¥è¯¢åæ° |
| | | const queryParams = ref<TaskQuery>({ |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: undefined, |
| | | processDefinitionName: undefined, |
| | | processDefinitionKey: undefined |
| | | }); |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | getTaskCopyList(); |
| | | }; |
| | | /** éç½®æé®æä½ */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value?.resetFields(); |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = 10; |
| | | handleQuery(); |
| | | }; |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleSelectionChange = (selection: any) => { |
| | | ids.value = selection.map((item: any) => item.id); |
| | | single.value = selection.length !== 1; |
| | | multiple.value = !selection.length; |
| | | }; |
| | | //å页 |
| | | const getTaskCopyList = () => { |
| | | loading.value = true; |
| | | getPageByTaskCopy(queryParams.value).then((resp) => { |
| | | taskList.value = resp.rows; |
| | | total.value = resp.total; |
| | | loading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | /** æ¥çæé®æä½ */ |
| | | const handleView = (row) => { |
| | | const routerJumpVo = reactive<RouterJumpVo>({ |
| | | wfDefinitionConfigVo: row.wfDefinitionConfigVo, |
| | | wfNodeConfigVo: row.wfNodeConfigVo, |
| | | businessKey: row.businessKey, |
| | | taskId: row.id, |
| | | type: 'view' |
| | | }); |
| | | workflowCommon.routerJump(routerJumpVo, proxy); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getTaskCopyList(); |
| | | }); |
| | | </script> |