【代码评审】工作流:我发起的审批列表

pull/586/head
YunaiV 2024-11-09 21:36:43 +08:00
parent 91b1ecd3bb
commit 4ba5dad22e
1 changed files with 105 additions and 103 deletions

View File

@ -22,23 +22,16 @@
<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
type="primary"
plain
v-hasPermi="['bpm:process-instance:query']"
@click="handleCreate(undefined)"
>
<Icon icon="ep:plus" class="mr-5px" /> 发起流程
</el-button>
</el-form-item> </el-form-item>
<!-- TODO @ tuitujistyle 可以使用 unocss -->
<el-form-item label="" prop="category" :style="{ position: 'absolute', right: '130px' }"> <el-form-item label="" prop="category" :style="{ position: 'absolute', right: '130px' }">
<!-- TODO @tuituji应该选择好分类就触发搜索啦 -->
<el-select <el-select
v-model="queryParams.category" v-model="queryParams.category"
placeholder="请选择流程分类" placeholder="请选择流程分类"
clearable clearable
class="!w-240px" class="!w-155px"
> >
<el-option <el-option
v-for="category in categoryList" v-for="category in categoryList"
@ -49,11 +42,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 高级筛选 -->
<!-- TODO @ tuitujistyle 可以使用 unocss -->
<el-form-item :style="{ position: 'absolute', right: '0px' }"> <el-form-item :style="{ position: 'absolute', right: '0px' }">
<el-button v-popover="popoverRef" v-click-outside="onClickOutside" :icon="List"> <el-button v-popover="popoverRef" v-click-outside="onClickOutside" :icon="List">
高级筛选 高级筛选
</el-button> </el-button>
<el-popover <el-popover
ref="popoverRef" ref="popoverRef"
trigger="click" trigger="click"
@ -78,7 +72,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属流程" class="bold-label" label-position="top" prop="processDefinitionKey"> <el-form-item
label="所属流程"
class="bold-label"
label-position="top"
prop="processDefinitionKey"
>
<el-input <el-input
v-model="queryParams.processDefinitionKey" v-model="queryParams.processDefinitionKey"
placeholder="请输入流程定义的标识" placeholder="请输入流程定义的标识"
@ -87,7 +86,6 @@
class="!w-390px" class="!w-390px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="流程状态" class="bold-label" label-position="top" prop="status"> <el-form-item label="流程状态" class="bold-label" label-position="top" prop="status">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
@ -115,8 +113,8 @@
/> />
</el-form-item> </el-form-item>
</el-popover> </el-popover>
<!-- TODO @tuituji这里应该有确认和取消清空搜索条件三个按钮 -->
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -131,6 +129,8 @@
min-width="100" min-width="100"
fixed="left" fixed="left"
/> />
<!-- TODO @芋艿摘要 -->
<!-- TODO @tuituji流程状态可见需求文档里 -->
<el-table-column label="流程状态" prop="status" width="120"> <el-table-column label="流程状态" prop="status" width="120">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
@ -162,7 +162,7 @@
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程编号" align="center" prop="id" min-width="320px" />--> -->
<el-table-column label="操作" align="center" fixed="right" width="180"> <el-table-column label="操作" align="center" fixed="right" width="180">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -198,12 +198,13 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Delete, Edit, Search, Share, Upload, List } from '@element-plus/icons-vue' // TODO @tuitujiList <Icon icon="ep:plus" class="mr-5px" />
import { List } from '@element-plus/icons-vue'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter, formatPast2 } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
import * as ProcessInstanceApi from '@/api/bpm/processInstance' import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { CategoryApi } from '@/api/bpm/category' import { CategoryApi, CategoryVO } from '@/api/bpm/category'
import { ProcessInstanceVO } from '@/api/bpm/processInstance' import { ProcessInstanceVO } from '@/api/bpm/processInstance'
import * as DefinitionApi from '@/api/bpm/definition' import * as DefinitionApi from '@/api/bpm/definition'
@ -226,7 +227,7 @@ const queryParams = reactive({
createTime: [] createTime: []
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const categoryList = ref([]) // const categoryList = ref<CategoryVO[]>([]) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -297,6 +298,15 @@ const handleCancel = async (row) => {
await getList() await getList()
} }
// TODO @tuituji import
import { ClickOutside as vClickOutside } from 'element-plus'
// TODO @tuitujionClickAdvancedSearch
const popoverRef = ref()
const onClickOutside = () => {
unref(popoverRef).popperRef?.delayHide?.()
}
/** 激活时 **/ /** 激活时 **/
onActivated(() => { onActivated(() => {
getList() getList()
@ -307,14 +317,6 @@ onMounted(async () => {
await getList() await getList()
categoryList.value = await CategoryApi.getCategorySimpleList() categoryList.value = await CategoryApi.getCategorySimpleList()
}) })
import { ref, unref } from 'vue'
import { ClickOutside as vClickOutside } from 'element-plus'
const popoverRef = ref()
const onClickOutside = () => {
unref(popoverRef).popperRef?.delayHide?.()
}
</script> </script>
<style> <style>
.bold-label .el-form-item__label { .bold-label .el-form-item__label {