taskCopyList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div class="p-2">
  3. <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
  4. <div v-show="showSearch" class="mb-[10px]">
  5. <el-card shadow="hover">
  6. <el-form v-show="showSearch" ref="queryFormRef" :model="queryParams" :inline="true">
  7. <el-form-item label="任务名称" prop="nodeName">
  8. <el-input v-model="queryParams.nodeName" placeholder="请输入任务名称" @keyup.enter="handleQuery" />
  9. </el-form-item>
  10. <el-form-item label="流程定义名称" label-width="100" prop="flowName">
  11. <el-input v-model="queryParams.flowName" placeholder="请输入流程定义名称" @keyup.enter="handleQuery" />
  12. </el-form-item>
  13. <el-form-item label="流程定义编码" label-width="100" prop="flowCode">
  14. <el-input v-model="queryParams.flowCode" placeholder="请输入流程定义编码" @keyup.enter="handleQuery" />
  15. </el-form-item>
  16. <el-form-item>
  17. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  18. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </el-card>
  22. </div>
  23. </transition>
  24. <el-card shadow="hover">
  25. <template #header>
  26. <el-row :gutter="10" class="mb8">
  27. <right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
  28. </el-row>
  29. </template>
  30. <el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange">
  31. <el-table-column type="selection" width="55" align="center" />
  32. <el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
  33. <el-table-column :show-overflow-tooltip="true" prop="flowName" align="center" label="流程定义名称"></el-table-column>
  34. <el-table-column align="center" prop="flowCode" label="流程定义编码"></el-table-column>
  35. <el-table-column align="center" prop="categoryName" label="流程分类"></el-table-column>
  36. <el-table-column align="center" prop="version" label="版本号" width="90">
  37. <template #default="scope"> v{{ scope.row.version }}.0</template>
  38. </el-table-column>
  39. <el-table-column align="center" prop="nodeName" label="任务名称"></el-table-column>
  40. <el-table-column align="center" label="流程状态" min-width="70">
  41. <template #default="scope">
  42. <dict-tag :options="wf_business_status" :value="scope.row.flowStatus"></dict-tag>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="操作" align="center" width="200">
  46. <template #default="scope">
  47. <el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">查看</el-button>
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. <pagination
  52. v-show="total > 0"
  53. v-model:page="queryParams.pageNum"
  54. v-model:limit="queryParams.pageSize"
  55. :total="total"
  56. @pagination="handleQuery"
  57. />
  58. </el-card>
  59. </div>
  60. </template>
  61. <script setup lang="ts">
  62. import { pageByTaskCopy } from '@/api/workflow/task';
  63. import { TaskQuery } from '@/api/workflow/task/types';
  64. import workflowCommon from '@/api/workflow/workflowCommon';
  65. import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
  66. //审批记录组件
  67. const queryFormRef = ref<ElFormInstance>();
  68. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  69. const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
  70. // 遮罩层
  71. const loading = ref(true);
  72. // 选中数组
  73. const ids = ref<Array<any>>([]);
  74. // 非单个禁用
  75. const single = ref(true);
  76. // 非多个禁用
  77. const multiple = ref(true);
  78. // 显示搜索条件
  79. const showSearch = ref(true);
  80. // 总条数
  81. const total = ref(0);
  82. // 模型定义表格数据
  83. const taskList = ref([]);
  84. // 查询参数
  85. const queryParams = ref<TaskQuery>({
  86. pageNum: 1,
  87. pageSize: 10,
  88. nodeName: undefined,
  89. flowName: undefined,
  90. flowCode: undefined
  91. });
  92. /** 搜索按钮操作 */
  93. const handleQuery = () => {
  94. getTaskCopyList();
  95. };
  96. /** 重置按钮操作 */
  97. const resetQuery = () => {
  98. queryFormRef.value?.resetFields();
  99. queryParams.value.pageNum = 1;
  100. queryParams.value.pageSize = 10;
  101. handleQuery();
  102. };
  103. // 多选框选中数据
  104. const handleSelectionChange = (selection: any) => {
  105. ids.value = selection.map((item: any) => item.id);
  106. single.value = selection.length !== 1;
  107. multiple.value = !selection.length;
  108. };
  109. //分页
  110. const getTaskCopyList = () => {
  111. loading.value = true;
  112. pageByTaskCopy(queryParams.value).then((resp) => {
  113. taskList.value = resp.rows;
  114. total.value = resp.total;
  115. loading.value = false;
  116. });
  117. };
  118. /** 查看按钮操作 */
  119. const handleView = (row) => {
  120. const routerJumpVo = reactive<RouterJumpVo>({
  121. businessId: row.businessId,
  122. taskId: row.id,
  123. type: 'view',
  124. formCustom: row.formCustom,
  125. formPath: row.formPath,
  126. instanceId: row.instanceId
  127. });
  128. workflowCommon.routerJump(routerJumpVo, proxy);
  129. };
  130. onMounted(() => {
  131. getTaskCopyList();
  132. });
  133. </script>