Commit 753a32ae by GoldenZqqq

feat: 流程模型页面布局重构

parent 4b2785bd
<template> <template>
<doc-alert title="流程设计器(BPMN)" url="https://doc.iocoder.cn/bpm/model-designer-dingding/" />
<doc-alert
title="流程设计器(钉钉、飞书)"
url="https://doc.iocoder.cn/bpm/model-designer-bpmn/"
/>
<doc-alert title="选择审批人、发起人自选" url="https://doc.iocoder.cn/bpm/assignee/" />
<doc-alert title="会签、或签、依次审批" url="https://doc.iocoder.cn/bpm/multi-instance/" />
<ContentWrap> <ContentWrap>
<div class="flex justify-between pl-20px items-center">
<h3>表单管理</h3>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
class="-mb-15px" class="-mb-15px flex"
:model="queryParams" :model="queryParams"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
label-width="68px" label-width="68px"
> >
<el-form-item label="流程标识" prop="key"> <el-form-item align="right" prop="key" class="ml-auto">
<el-input <el-input
v-model="queryParams.key" v-model="queryParams.key"
placeholder="请输入流程标识" placeholder="搜索流程"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="流程名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入流程名称"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/>
</el-form-item>
<el-form-item label="流程分类" prop="category">
<el-select
v-model="queryParams.category"
placeholder="请选择流程分类"
clearable
class="!w-240px"
> >
<el-option <template #prefix>
v-for="category in categoryList" <Icon icon="ep:search" class="mx-10px" />
:key="category.code" </template>
:label="category.name" </el-input>
:value="category.code"
/>
</el-select>
</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 type="primary" @click="openForm('create')" v-hasPermi="['bpm:model:create']">
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <Icon icon="ep:plus" class="mr-5px" /> 新建流程
<el-button </el-button>
type="primary" </el-form-item>
plain
@click="openForm('create')" <el-form-item>
v-hasPermi="['bpm:model:create']" <el-button type="info" plain>
> <Icon icon="ep:setting" />
<Icon icon="ep:plus" class="mr-5px" /> 新建
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </div>
<!-- 列表 --> <el-divider />
<ContentWrap>
<!-- 分类卡片组 -->
<div class="px-30px">
<ContentWrap v-for="(list, title) in categoryGroup" :key="title">
<h3 class="ml-20px">{{ title }}</h3>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="流程名称" align="center" prop="name" min-width="200" /> <el-table-column label="流程名" align="center" prop="name" min-width="200">
<el-table-column label="流程图标" align="center" prop="icon" min-width="100">
<template #default="scope"> <template #default="scope">
<el-image :src="scope.row.icon" class="h-32px w-32px" /> <div class="flex items-center justify-center">
<el-image :src="scope.row.icon" class="h-32px w-32px mr-10px rounded" />
{{ scope.row.name }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="可见范围" align="center" prop="startUserIds" min-width="100"> <el-table-column label="可见范围" align="center" prop="startUserIds" min-width="100">
...@@ -167,7 +146,11 @@ ...@@ -167,7 +146,11 @@
<el-dropdown <el-dropdown
class="!align-middle ml-5px" class="!align-middle ml-5px"
@command="(command) => handleCommand(command, scope.row)" @command="(command) => handleCommand(command, scope.row)"
v-hasPermi="['bpm:process-definition:query', 'bpm:model:update', 'bpm:model:delete']" v-hasPermi="[
'bpm:process-definition:query',
'bpm:model:update',
'bpm:model:delete'
]"
> >
<el-button type="primary" link>更多</el-button> <el-button type="primary" link>更多</el-button>
<template #dropdown> <template #dropdown>
...@@ -199,13 +182,8 @@ ...@@ -199,13 +182,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> </ContentWrap>
<Pagination </div>
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗:添加/修改流程 --> <!-- 表单弹窗:添加/修改流程 -->
...@@ -227,6 +205,7 @@ import { CategoryApi } from '@/api/bpm/category' ...@@ -227,6 +205,7 @@ import { CategoryApi } from '@/api/bpm/category'
import { BpmModelType } from '@/utils/constants' import { BpmModelType } from '@/utils/constants'
import { checkPermi } from '@/utils/permission' import { checkPermi } from '@/utils/permission'
import { useUserStoreWithOut } from '@/store/modules/user' import { useUserStoreWithOut } from '@/store/modules/user'
import { groupBy } from 'lodash-es'
defineOptions({ name: 'BpmModel' }) defineOptions({ name: 'BpmModel' })
...@@ -236,8 +215,6 @@ const { push } = useRouter() // 路由 ...@@ -236,8 +215,6 @@ const { push } = useRouter() // 路由
const userStore = useUserStoreWithOut() // 用户信息缓存 const userStore = useUserStoreWithOut() // 用户信息缓存
const loading = ref(true) // 列表的加载中 const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数据
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
...@@ -247,14 +224,15 @@ const queryParams = reactive({ ...@@ -247,14 +224,15 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // 搜索的表单 const queryFormRef = ref() // 搜索的表单
const categoryList = ref([]) // 流程分类列表 const categoryList = ref([]) // 流程分类列表
const categoryGroup = ref({}) // 按照category分组的数据
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
// TODO 芋艿:这里需要一个不分页查全部的流程模型接口
const data = await ModelApi.getModelPage(queryParams) const data = await ModelApi.getModelPage(queryParams)
list.value = data.list categoryGroup.value = groupBy(data.list, 'categoryName')
total.value = data.total
} finally { } finally {
loading.value = false loading.value = false
} }
...@@ -402,3 +380,12 @@ onMounted(async () => { ...@@ -402,3 +380,12 @@ onMounted(async () => {
categoryList.value = await CategoryApi.getCategorySimpleList() categoryList.value = await CategoryApi.getCategorySimpleList()
}) })
</script> </script>
<style lang="scss" scoped>
:deep(.el-form--inline .el-form-item) {
margin-right: 10px;
}
:deep(.el-divider--horizontal) {
margin-top: 10px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment