Skip to content

Commit

Permalink
V3.31线上测试问题修复 (#7184)
Browse files Browse the repository at this point in the history
* optimization: 公共流程创建弹框统一title&&任务下公共流程创建任务不需要弹框

* optimization: 任务详情小画布分支标签支持选中

* bugfix: 节点树-节点未携带对应的任务id导致查看详情报错问题修复
  • Loading branch information
ywywZhou authored Nov 23, 2023
1 parent e88ec66 commit ac000a4
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/desktop/src/pages/commonManage/CommonTplList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
:type="exportType">
</ExportTemplateDialog>
<SelectProjectModal
:title="$t('创建任务')"
:title="$t('新建任务')"
:show="isSelectProjectShow"
:confirm-loading="permissionLoading"
:confirm-cursor="!hasCreateTaskPerm"
Expand Down
2 changes: 1 addition & 1 deletion frontend/desktop/src/pages/home/SelectCreateTaskDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
width="600"
:render-directive="'if'"
:ext-cls="'common-dialog'"
:title="$t('创建任务')"
:title="$t('新建任务')"
:mask-close="false"
:value="isCreateTaskDialogShow"
:header-position="'left'"
Expand Down
10 changes: 9 additions & 1 deletion frontend/desktop/src/pages/task/TaskExecute/ExecuteInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
:show-tool="false"
:editable="false"
:canvas-data="canvasData"
@onConditionClick="onOpenConditionEdit"
@onNodeClick="onNodeClick">
</TemplateCanvas>
<div class="flow-option">
Expand Down Expand Up @@ -986,9 +987,16 @@
if (nodeInfo) {
nodeInfo && this.onSelectNode(nodeInfo)
const parentInstance = this.$parent.$parent
parentInstance.defaultActiveId = node + '-' + nodeInfo.parentId
if (nodeInfo.conditionType) {
parentInstance.defaultActiveId = node + '-' + nodeInfo.parentId + '-condition'
} else {
parentInstance.defaultActiveId = node + '-' + nodeInfo.parentId
}
}
},
onOpenConditionEdit (data) {
this.onNodeClick(`${data.nodeId}-${data.id}`)
},
onZoomOut () {
const jsFlowInstance = this.$refs.subProcessCanvas
jsFlowInstance.onZoomOut()
Expand Down
17 changes: 12 additions & 5 deletions frontend/desktop/src/pages/task/TaskExecute/NodeTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,18 @@
handler (val) {
this.activeId = val
let nodeId = val.split('-')[0]
let parentId = []
// 分支条件默认选中特殊处理
if (val.split('-').pop() === 'condition') {
nodeId = val.split('-').slice(0, -1).join('-')
this.activeId = nodeId
if (val.match('condition')) {
// 小画布默认id会携带parentId
const nodes = val.split('-').slice(0, -1)
nodeId = nodes.slice(0, 2).join('-')
this.activeId = nodes.join('-')
parentId = nodes.slice(2)
}
// 根据父节点过滤节点树
let nodes = this.treeData
const parentId = val.split('-').slice(1)
parentId = parentId.length ? parentId : val.split('-').slice(1)
if (parentId.length) {
parentId.forEach(id => {
nodes.some(item => {
Expand All @@ -82,9 +86,12 @@
setDefaultActiveId (treeData = [], id) {
return treeData.some(item => {
if (item.id === id) {
item.expanded = !!item.isSubProcess
item.expanded = !!item.isSubProcess || !!item.conditionType
return true
} else if (item.children?.length) {
if (item.expanded) {
return this.setDefaultActiveId(item.children, id)
}
item.expanded = this.setDefaultActiveId(item.children, id)
return item.expanded
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,8 @@
parentId,
independentId,
gatewayId: id,
lastId: item.id
lastId: item.id,
taskId
},
ordered,
item.children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</div>
</div>
<SelectProjectModal
:title="$t('创建任务')"
:title="$t('新建任务')"
:show="isSelectProjectShow"
:confirm-loading="commonTplCreateTaskPermLoading || templateSaving"
:confirm-cursor="['new', 'clone'].includes(type) ? false : !hasCommonTplCreateTaskPerm"
Expand Down Expand Up @@ -255,6 +255,13 @@
if (saveAndCreate) {
if (this.createTaskBtnActive) {
// 通过项目下公共流程创建任务时,不需要弹出选择项目弹框
const { project_id } = this.$route.params
if (project_id) {
this.selectedProject = {
id: project_id
}
}
// 普通任务直接走模板校验、保存逻辑,公共流程先走模板校验、保存逻辑,然后显示项目选择弹窗
this.saveTemplate(saveAndCreate)
} else {
Expand Down

0 comments on commit ac000a4

Please sign in to comment.