mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-09 08:52:41 +08:00
!694 fix: 修复bpm相关bug
Merge pull request !694 from SamllNorth_Lee/fix/bpm
This commit is contained in:
commit
ead7fa26ab
12874
pnpm-lock.yaml
generated
12874
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -75,7 +75,7 @@ watch(
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ElIcon :class="prefixCls" :color="color" :size="size">
|
<ElIcon :class="prefixCls" :color="color" :size="size">
|
||||||
<svg v-if="isLocal" :class="getSvgClass" aria-hidden="true">
|
<svg v-if="isLocal" :class="getSvgClass">
|
||||||
<use :xlink:href="symbolId" />
|
<use :xlink:href="symbolId" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SimpleProcessModel from './SimpleProcessModel.vue'
|
import SimpleProcessModel from './SimpleProcessModel.vue'
|
||||||
import { updateBpmSimpleModel, getBpmSimpleModel } from '@/api/bpm/simple'
|
|
||||||
import { SimpleFlowNode, NodeType, NodeId, NODE_DEFAULT_TEXT } from './consts'
|
import { SimpleFlowNode, NodeType, NodeId, NODE_DEFAULT_TEXT } from './consts'
|
||||||
import { getModel } from '@/api/bpm/model'
|
import { getModel } from '@/api/bpm/model'
|
||||||
import { getForm, FormVO } from '@/api/bpm/form'
|
import { getForm, FormVO } from '@/api/bpm/form'
|
||||||
@ -35,6 +34,7 @@ import * as DeptApi from '@/api/system/dept'
|
|||||||
import * as PostApi from '@/api/system/post'
|
import * as PostApi from '@/api/system/post'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import * as UserGroupApi from '@/api/bpm/userGroup'
|
import * as UserGroupApi from '@/api/bpm/userGroup'
|
||||||
|
import { BpmModelFormType } from '@/utils/constants'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'SimpleProcessDesigner'
|
name: 'SimpleProcessDesigner'
|
||||||
@ -168,7 +168,7 @@ onMounted(async () => {
|
|||||||
const bpmnModel = await getModel(props.modelId)
|
const bpmnModel = await getModel(props.modelId)
|
||||||
if (bpmnModel) {
|
if (bpmnModel) {
|
||||||
formType.value = bpmnModel.formType
|
formType.value = bpmnModel.formType
|
||||||
if (formType.value === 10) {
|
if (formType.value === BpmModelFormType.NORMAL && bpmnModel.formId) {
|
||||||
const bpmnForm = (await getForm(bpmnModel.formId)) as unknown as FormVO
|
const bpmnForm = (await getForm(bpmnModel.formId)) as unknown as FormVO
|
||||||
formFields.value = bpmnForm?.fields
|
formFields.value = bpmnForm?.fields
|
||||||
}
|
}
|
||||||
|
@ -449,3 +449,18 @@ export function jsonParse(str: string) {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截取字符串
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* @param start
|
||||||
|
* @param end
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const sliceName = (name: string,start: number, end : number) => {
|
||||||
|
if (name.length > end) {
|
||||||
|
return name.slice(start, end)
|
||||||
|
}
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
@ -88,6 +88,9 @@
|
|||||||
/>
|
/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-image v-if="row.icon" :src="row.icon" class="h-38px w-38px mr-10px rounded" />
|
<el-image v-if="row.icon" :src="row.icon" class="h-38px w-38px mr-10px rounded" />
|
||||||
|
<div v-else class="flow-icon">
|
||||||
|
<span style="font-size: 12px; color: #fff">{{ sliceName(row.name,0,2) }}</span>
|
||||||
|
</div>
|
||||||
{{ row.name }}
|
{{ row.name }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -249,6 +252,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
|
<!-- 弹窗:表单详情 -->
|
||||||
|
<Dialog title="表单详情" :fullscreen="true" v-model="formDetailVisible">
|
||||||
|
<form-create :rule="formDetailPreview.rule" :option="formDetailPreview.option" />
|
||||||
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -265,6 +273,7 @@ import { useAppStore } from '@/store/modules/app'
|
|||||||
import { cloneDeep, isEqual } from 'lodash-es'
|
import { cloneDeep, isEqual } from 'lodash-es'
|
||||||
import { useTagsView } from '@/hooks/web/useTagsView'
|
import { useTagsView } from '@/hooks/web/useTagsView'
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
|
import { sliceName } from '@/utils/index'
|
||||||
|
|
||||||
defineOptions({ name: 'BpmModel' })
|
defineOptions({ name: 'BpmModel' })
|
||||||
|
|
||||||
@ -437,11 +446,10 @@ const handleChangeState = async (row: any) => {
|
|||||||
/** 发布流程 */
|
/** 发布流程 */
|
||||||
const handleDeploy = async (row: any) => {
|
const handleDeploy = async (row: any) => {
|
||||||
try {
|
try {
|
||||||
// 删除的二次确认
|
await message.confirm('是否确认发布该流程?')
|
||||||
await message.confirm('是否部署该流程!!')
|
|
||||||
// 发起部署
|
// 发起部署
|
||||||
await ModelApi.deployModel(row.id)
|
await ModelApi.deployModel(row.id)
|
||||||
message.success(t('部署成功'))
|
message.success(t('发布成功'))
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
emit('success')
|
emit('success')
|
||||||
} catch {}
|
} catch {}
|
||||||
@ -464,7 +472,7 @@ const formDetailPreview = ref({
|
|||||||
option: {}
|
option: {}
|
||||||
})
|
})
|
||||||
const handleFormDetail = async (row: any) => {
|
const handleFormDetail = async (row: any) => {
|
||||||
if (row.formType == 10) {
|
if (row.formType == BpmModelFormType.NORMAL) {
|
||||||
// 设置表单
|
// 设置表单
|
||||||
const data = await FormApi.getForm(row.formId)
|
const data = await FormApi.getForm(row.formId)
|
||||||
setConfAndFields2(formDetailPreview, data.conf, data.fields)
|
setConfAndFields2(formDetailPreview, data.conf, data.fields)
|
||||||
@ -617,6 +625,17 @@ watchEffect(() => {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.flow-icon {
|
||||||
|
display: flex;
|
||||||
|
width: 38px;
|
||||||
|
height: 38px;
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.category-draggable-model {
|
.category-draggable-model {
|
||||||
:deep(.el-table__cell) {
|
:deep(.el-table__cell) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
class="!w-440px"
|
class="!w-440px"
|
||||||
v-model="modelData.key"
|
v-model="modelData.key"
|
||||||
:disabled="!!modelData.id"
|
:disabled="!!modelData.id"
|
||||||
placeholder="请输入流标标识"
|
placeholder="请输入流程标识,以字母或下划线开头"
|
||||||
/>
|
/>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
class="item"
|
class="item"
|
||||||
@ -41,7 +41,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="流程图标" prop="icon" class="mb-20px">
|
<el-form-item label="流程图标" class="mb-20px">
|
||||||
<UploadImg v-model="modelData.icon" :limit="1" height="64px" width="64px" />
|
<UploadImg v-model="modelData.icon" :limit="1" height="64px" width="64px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="流程描述" prop="description" class="mb-20px">
|
<el-form-item label="流程描述" prop="description" class="mb-20px">
|
||||||
@ -155,7 +155,6 @@ const rules = {
|
|||||||
name: [{ required: true, message: '流程名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '流程名称不能为空', trigger: 'blur' }],
|
||||||
key: [{ required: true, message: '流程标识不能为空', trigger: 'blur' }],
|
key: [{ required: true, message: '流程标识不能为空', trigger: 'blur' }],
|
||||||
category: [{ required: true, message: '流程分类不能为空', trigger: 'blur' }],
|
category: [{ required: true, message: '流程分类不能为空', trigger: 'blur' }],
|
||||||
icon: [{ required: true, message: '流程图标不能为空', trigger: 'blur' }],
|
|
||||||
type: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }],
|
type: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }],
|
||||||
visible: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }],
|
visible: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }],
|
||||||
managerUserIds: [{ required: true, message: '流程管理员不能为空', trigger: 'blur' }]
|
managerUserIds: [{ required: true, message: '流程管理员不能为空', trigger: 'blur' }]
|
||||||
|
@ -285,9 +285,8 @@ const handleSave = async () => {
|
|||||||
} else {
|
} else {
|
||||||
// 新增场景
|
// 新增场景
|
||||||
formData.value.id = await ModelApi.createModel(modelData)
|
formData.value.id = await ModelApi.createModel(modelData)
|
||||||
message.success('新增成功')
|
|
||||||
try {
|
try {
|
||||||
await message.confirm('创建流程成功,是否继续编辑?')
|
await message.confirm('流程创建成功,是否继续编辑?')
|
||||||
// 用户点击继续编辑,跳转到编辑页面
|
// 用户点击继续编辑,跳转到编辑页面
|
||||||
await nextTick()
|
await nextTick()
|
||||||
// 先删除当前页签
|
// 先删除当前页签
|
||||||
@ -317,7 +316,6 @@ const handleDeploy = async () => {
|
|||||||
if (!formData.value.id) {
|
if (!formData.value.id) {
|
||||||
await message.confirm('是否确认发布该流程?')
|
await message.confirm('是否确认发布该流程?')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校验所有步骤
|
// 校验所有步骤
|
||||||
await validateAllSteps()
|
await validateAllSteps()
|
||||||
|
|
||||||
|
@ -58,7 +58,16 @@
|
|||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-image :src="definition.icon" class="w-32px h-32px" />
|
<el-image
|
||||||
|
v-if="definition.icon"
|
||||||
|
:src="definition.icon"
|
||||||
|
class="w-32px h-32px"
|
||||||
|
/>
|
||||||
|
<div v-else class="flow-icon">
|
||||||
|
<span style="font-size: 12px; color: #fff">{{
|
||||||
|
sliceName(definition.name,0,2)
|
||||||
|
}}</span>
|
||||||
|
</div>
|
||||||
<el-text class="!ml-10px" size="large">{{ definition.name }}</el-text>
|
<el-text class="!ml-10px" size="large">{{ definition.name }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -88,6 +97,7 @@ import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
|||||||
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
|
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
|
||||||
import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
|
import ProcessDefinitionDetail from './ProcessDefinitionDetail.vue'
|
||||||
import { groupBy } from 'lodash-es'
|
import { groupBy } from 'lodash-es'
|
||||||
|
import { sliceName } from '@/utils/index'
|
||||||
|
|
||||||
defineOptions({ name: 'BpmProcessInstanceCreate' })
|
defineOptions({ name: 'BpmProcessInstanceCreate' })
|
||||||
|
|
||||||
@ -282,13 +292,25 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.flow-icon {
|
||||||
|
display: flex;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.process-definition-container::before {
|
.process-definition-container::before {
|
||||||
content: '';
|
|
||||||
border-left: 1px solid #e6e6e6;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20.8%;
|
left: 20.8%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border-left: 1px solid #e6e6e6;
|
||||||
|
content: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep() {
|
:deep() {
|
||||||
.definition-item-card {
|
.definition-item-card {
|
||||||
.el-card__body {
|
.el-card__body {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user