From c039696288a61b84d252bfb6733dd38b1ea07ade Mon Sep 17 00:00:00 2001 From: smallNorthLee <18210040298@163.com> Date: Tue, 11 Feb 2025 23:59:45 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=8F=91=E5=B8=83=E5=89=8D?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=BD=93=E5=89=8D=E6=B5=81=E7=A8=8B=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E4=B8=8B=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E5=AE=A1=E6=89=B9=E4=B8=AD=E7=9A=84=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/model/CategoryDraggableModel.vue | 10 +++--- src/views/bpm/model/form/index.vue | 13 ++++--- .../bpm/processInstance/create/index.vue | 35 +++++++++++++++++-- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue index 1ca472a6..cf1988a3 100644 --- a/src/views/bpm/model/CategoryDraggableModel.vue +++ b/src/views/bpm/model/CategoryDraggableModel.vue @@ -159,7 +159,7 @@ @@ -448,7 +448,7 @@ const handleDeploy = async (row: any) => { // 发布的二次确认 await message.confirm('是否发布该流程!!') //校验当前版本的流程下是否存在正在进行中的单据 - const res = await ModelApi.getProcessInstance(row.processDefinition.id) + const res = await ModelApi.getProcessInstance(row.id) if (res) { message.error('当前版本下存在正在进行中的单据,请先结束单据后再发布') return @@ -593,14 +593,14 @@ const handleDeleteCategory = async () => { /** 添加流程模型弹窗 */ const tagsView = useTagsView() -const openModelForm = async (type: string, id?: number, processDefinitionId?: string) => { - alert(processDefinitionId) +const openModelForm = async (type: string, id?: number, processDefinitionId?: any) => { if (type === 'create') { await push({ name: 'BpmModelCreate' }) } else { + const params = processDefinitionId ? { id, type, processDefinitionId } : { id, type } await push({ name: 'BpmModelUpdate', - params: { id, type } + params: params }) // 设置标题 if (type === 'copy') { diff --git a/src/views/bpm/model/form/index.vue b/src/views/bpm/model/form/index.vue index 5d04636f..b997baec 100644 --- a/src/views/bpm/model/form/index.vue +++ b/src/views/bpm/model/form/index.vue @@ -179,6 +179,8 @@ const userList = ref([]) /** 初始化数据 */ const initData = async () => { + console.log(route.params); + const modelId = route.params.id as string if (modelId) { // 修改场景 @@ -295,7 +297,7 @@ const handleSave = async () => { // 跳转到编辑页面 await router.push({ name: 'BpmModelUpdate', - params: { id: formData.value.id, processDefinitionId: formData.value.processDefinitionId } + params: { id: formData.value.id} }) } catch { // 先删除当前页签 @@ -312,6 +314,8 @@ const handleSave = async () => { /** 发布操作 */ const handleDeploy = async () => { + console.log(route.params); + try { // 修改场景下直接发布,新增场景下需要先确认 if (!formData.value.id) { @@ -319,7 +323,7 @@ const handleDeploy = async () => { } //校验当前版本的流程下是否存在正在进行中的单据 - const res = await ModelApi.getProcessInstance(row.processDefinition.id) + const res = await ModelApi.getProcessInstance(formData.value.id) if (res) { message.error('当前版本下存在正在进行中的单据,请先结束单据后再发布') return @@ -352,11 +356,6 @@ const handleDeploy = async () => { } } -const validateProcessInstance = async (processDefinitionId) => { - const valid = await ModelApi.getProcessInstance(processDefinitionId) - console.log(valid) -} - /** 步骤切换处理 */ const handleStepClick = async (index: number) => { try { diff --git a/src/views/bpm/processInstance/create/index.vue b/src/views/bpm/processInstance/create/index.vue index 284cbdb7..cbbb9623 100644 --- a/src/views/bpm/processInstance/create/index.vue +++ b/src/views/bpm/processInstance/create/index.vue @@ -58,7 +58,16 @@ > @@ -275,6 +284,14 @@ const availableCategories = computed(() => { ) }) +// 处理显示的名称 +const sliceName = (name: string) => { + if (name.length > 2) { + return name.slice(0, 2) + } + return name +} + /** 初始化 */ onMounted(() => { getList() @@ -282,13 +299,25 @@ onMounted(() => {