REVIEW 已完成的任务列表

pull/91/head
YunaiV 2023-04-05 00:12:12 +08:00
parent 68564b77e9
commit bb88e3d77c
5 changed files with 49 additions and 77 deletions

View File

@ -98,7 +98,7 @@ export function createVitePlugins() {
deleteOriginFile: false //压缩后是否删除源文件 deleteOriginFile: false //压缩后是否删除源文件
}), }),
ViteEjsPlugin(), ViteEjsPlugin(),
topLevelAwait({ topLevelAwait({ // https://juejin.cn/post/7152191742513512485
// The export name of top-level await promise for each chunk module // The export name of top-level await promise for each chunk module
promiseExportName: '__tla', promiseExportName: '__tla',
// The function to generate import names of top-level await promise in each chunk module // The function to generate import names of top-level await promise in each chunk module

View File

@ -13,6 +13,7 @@
"build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev", "build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev",
"build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test", "build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test",
"build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static", "build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static",
"build:front": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode front",
"serve:pro": "vite preview --mode pro", "serve:pro": "vite preview --mode pro",
"serve:dev": "vite preview --mode dev", "serve:dev": "vite preview --mode dev",
"serve:test": "vite preview --mode test", "serve:test": "vite preview --mode test",

View File

@ -317,18 +317,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
title: '查看 OA 请假', title: '查看 OA 请假',
activeMenu: 'bpm/oa/leave/detail' activeMenu: 'bpm/oa/leave/detail'
} }
},
{
path: '/bpm/task/done',
component: () => import('@/views/bpm/task/done/index.vue'),
name: 'TaskDone',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '已办任务',
activeMenu: 'bpm/task/done/index'
}
} }
] ]
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500" width="800"> <Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500">
<el-descriptions border :column="1"> <el-descriptions border :column="1">
<el-descriptions-item label="任务编号" min-width="120"> <el-descriptions-item label="任务编号" min-width="120">
{{ detailData.id }} {{ detailData.id }}
@ -14,7 +14,7 @@
{{ detailData.processInstance.startUserNickname }} {{ detailData.processInstance.startUserNickname }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="状态"> <el-descriptions-item label="状态">
{{ detailData.result }} <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="detailData.result" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="原因"> <el-descriptions-item label="原因">
{{ detailData.reason }} {{ detailData.reason }}
@ -26,14 +26,16 @@
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as TaskApi from '@/api/bpm/task' import * as TaskApi from '@/api/bpm/task'
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const detailLoading = ref(false) // const detailLoading = ref(false) //
const detailData = ref() // const detailData = ref() //
/** 打开弹窗 */ /** 打开弹窗 */
const openModal = async (data: TaskApi.TaskVO) => { const open = async (data: TaskApi.TaskVO) => {
dialogVisible.value = true dialogVisible.value = true
// //
detailLoading.value = true detailLoading.value = true
@ -43,5 +45,5 @@ const openModal = async (data: TaskApi.TaskVO) => {
detailLoading.value = false detailLoading.value = false
} }
} }
defineExpose({ openModal }) // openModal defineExpose({ open }) // open
</script> </script>

View File

@ -14,36 +14,30 @@
placeholder="请输入任务名称" placeholder="请输入任务名称"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="创建时间" prop="createTime">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-date-picker
<el-option v-model="queryParams.createTime"
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)" value-format="YYYY-MM-DD HH:mm:ss"
:key="dict.value" type="daterange"
:label="dict.label" start-placeholder="开始日期"
:value="dict.value" end-placeholder="结束日期"
/> :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
</el-select> class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['bpm:task:done:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" align="center"> <el-table v-loading="loading" :data="list">
<el-table-column label="任务编号" align="center" prop="id" width="300px" /> <el-table-column label="任务编号" align="center" prop="id" width="300px" />
<el-table-column label="任务名称" align="center" prop="name" /> <el-table-column label="任务名称" align="center" prop="name" />
<el-table-column label="所属流程" align="center" prop="processInstance.name" /> <el-table-column label="所属流程" align="center" prop="processInstance.name" />
@ -63,8 +57,8 @@
/> />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="openModal(scope.row)"> </el-button> <el-button link type="primary" @click="openDetail(scope.row)"></el-button>
<el-button link type="primary" @click="handleAudit(scope.row)"> </el-button> <el-button link type="primary" @click="handleAudit(scope.row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -76,46 +70,28 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
<!-- 表单弹窗详情 --> <!-- 表单弹窗详情 -->
<TaskDoneDetail ref="modalRef" @success="getList" /> <TaskDetail ref="detailRef" @success="getList" />
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import * as TaskApi from '@/api/bpm/task' import * as TaskApi from '@/api/bpm/task'
import download from '@/utils/download' import TaskDetail from './TaskDetail.vue'
import TaskDoneDetail from './Taskdetail.vue' const { push } = useRouter() //
const loading = ref(true) // const loading = ref(true) //
const total = ref(0) // const total = ref(0) //
const list = ref([]) // const list = ref([]) //
const message = useMessage() //
const exportLoading = ref(false) //
const queryFormRef = ref() //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
name: '', name: '',
status: undefined,
createTime: [] createTime: []
}) })
const queryFormRef = ref() //
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 详情操作 */
const modalRef = ref()
const openModal = (data: TaskApi.TaskVO) => {
modalRef.value.openModal(data)
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 查询任务列表 */ /** 查询任务列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -127,22 +103,26 @@ const getList = async () => {
loading.value = false loading.value = false
} }
} }
/** 导出按钮操作 */
const handleExport = async () => { /** 搜索按钮操作 */
try { const handleQuery = () => {
// queryParams.pageNo = 1
await message.exportConfirm() getList()
//
exportLoading.value = true
const data = await TaskApi.exportTask(queryParams)
download.excel(data, '任务列表.xls')
} catch {
} finally {
exportLoading.value = false
}
} }
const { push } = useRouter() //
// /** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: TaskApi.TaskVO) => {
detailRef.value.open(row)
}
/** 处理审批按钮 */
const handleAudit = (row) => { const handleAudit = (row) => {
push({ push({
name: 'BpmProcessInstanceDetail', name: 'BpmProcessInstanceDetail',
@ -151,6 +131,7 @@ const handleAudit = (row) => {
} }
}) })
} }
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()