Unverified Commit d50ed498 authored by Irving ZHAO(赵俭)'s avatar Irving ZHAO(赵俭) Committed by GitHub
Browse files

Merge pull request #1729 from WeBankPartners/1678_enhance_for_plugin

enhance for workflow exec, change hover to single click
parents c3d8529d f54d6752
Showing with 48 additions and 30 deletions
+48 -30
...@@ -416,5 +416,6 @@ ...@@ -416,5 +416,6 @@
"please_paste_here": "Please Paste Here", "please_paste_here": "Please Paste Here",
"delete_node": "Delete Node", "delete_node": "Delete Node",
"remove": "Remove", "remove": "Remove",
"completely_deleted": "It Will Be Completely Deleted After Clicking Save" "completely_deleted": "It Will Be Completely Deleted After Clicking Save",
"show_log": "Show Log"
} }
...@@ -415,5 +415,6 @@ ...@@ -415,5 +415,6 @@
"please_choose": "请选择", "please_choose": "请选择",
"please_paste_here": "请在这粘贴", "please_paste_here": "请在这粘贴",
"delete_node": "删除此节点", "delete_node": "删除此节点",
"completely_deleted": "点击保存后将完全删除" "completely_deleted": "点击保存后将完全删除",
"show_log": "查看日志"
} }
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
</Col> </Col>
<Col span="4" style="text-align: right;margin-bottom:8px;padding-right:40px;float:right;"> <Col span="4" style="text-align: right;margin-bottom:8px;padding-right:40px;float:right;">
<Button type="info" v-if="!isEnqueryPage" @click="queryHistory">{{ $t('enquery_new_workflow_job') }}</Button> <Button type="info" v-if="!isEnqueryPage" @click="queryHistory">{{ $t('enquery_new_workflow_job') }}</Button>
<Button type="success" v-if="isEnqueryPage" @click="createHandler">{{ <Button type="success" v-if="isEnqueryPage" @click="createHandler">
$t('create_new_workflow_job') {{ $t('create_new_workflow_job') }}
}}</Button> </Button>
</Col> </Col>
</Row> </Row>
<Row> <Row>
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
@on-open-change="getAllFlow" @on-open-change="getAllFlow"
filterable filterable
> >
<Option v-for="item in allFlows" :value="item.procDefId" :key="item.procDefId"> <Option v-for="item in allFlows" :value="item.procDefId" :key="item.procDefId">{{
{{ item.procDefName + ' ' + item.createdTime }} item.procDefName + ' ' + item.createdTime
</Option> }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</Form> </Form>
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
</Row> </Row>
</Row> </Row>
<div style="text-align: right;margin-top: 6px;margin-right:40px"> <div style="text-align: right;margin-top: 6px;margin-right:40px">
<Button v-if="showExcution" :disabled="isExecuteActive" style="width:120px" type="info" @click="excutionFlow"> <Button v-if="showExcution" :disabled="isExecuteActive" style="width:120px" type="info" @click="excutionFlow">{{
{{ $t('execute') }} $t('execute')
</Button> }}</Button>
</div> </div>
</Card> </Card>
<Modal <Modal
...@@ -105,6 +105,9 @@ ...@@ -105,6 +105,9 @@
<div class="workflowActionModal-container" style="text-align: center;margin-top: 20px;"> <div class="workflowActionModal-container" style="text-align: center;margin-top: 20px;">
<Button type="info" @click="workFlowActionHandler('retry')">{{ $t('retry') }}</Button> <Button type="info" @click="workFlowActionHandler('retry')">{{ $t('retry') }}</Button>
<Button type="info" @click="workFlowActionHandler('skip')" style="margin-left: 20px">{{ $t('skip') }}</Button> <Button type="info" @click="workFlowActionHandler('skip')" style="margin-left: 20px">{{ $t('skip') }}</Button>
<Button type="info" @click="workFlowActionHandler('showlog')" style="margin-left: 20px">{{
$t('show_log')
}}</Button>
</div> </div>
</Modal> </Modal>
<Modal <Modal
...@@ -472,6 +475,8 @@ export default { ...@@ -472,6 +475,8 @@ export default {
this.initFlowGraph(true) this.initFlowGraph(true)
removeEvent('.retry', 'click', this.retryHandler) removeEvent('.retry', 'click', this.retryHandler)
addEvent('.retry', 'click', this.retryHandler) addEvent('.retry', 'click', this.retryHandler)
removeEvent('.normal', 'click', this.normalHandler)
addEvent('.normal', 'click', this.normalHandler)
d3.selectAll('.retry').attr('cursor', 'pointer') d3.selectAll('.retry').attr('cursor', 'pointer')
this.showExcution = false this.showExcution = false
...@@ -665,7 +670,7 @@ export default { ...@@ -665,7 +670,7 @@ export default {
excution ? 'filled' : 'none' excution ? 'filled' : 'none'
}" color="${excution ? statusColor[_.status] : '#7F8A96'}" shape="circle", id="${_.nodeId}"]` }" color="${excution ? statusColor[_.status] : '#7F8A96'}" shape="circle", id="${_.nodeId}"]`
} else { } else {
const className = _.status === 'Faulted' || _.status === 'Timeouted' ? 'retry' : '' const className = _.status === 'Faulted' || _.status === 'Timeouted' ? 'retry' : 'normal'
return `${_.nodeId} [fixedsize=false label="${(_.orderedNo ? _.orderedNo + ' ' : '') + return `${_.nodeId} [fixedsize=false label="${(_.orderedNo ? _.orderedNo + ' ' : '') +
_.nodeName}" class="flow ${className}" style="${excution ? 'filled' : 'none'}" color="${ _.nodeName}" class="flow ${className}" style="${excution ? 'filled' : 'none'}" color="${
excution ? statusColor[_.status] : _.nodeId === this.currentFlowNodeId ? '#5DB400' : '#7F8A96' excution ? statusColor[_.status] : _.nodeId === this.currentFlowNodeId ? '#5DB400' : '#7F8A96'
...@@ -774,6 +779,8 @@ export default { ...@@ -774,6 +779,8 @@ export default {
this.initFlowGraph(true) this.initFlowGraph(true)
removeEvent('.retry', 'click', this.retryHandler) removeEvent('.retry', 'click', this.retryHandler)
addEvent('.retry', 'click', this.retryHandler) addEvent('.retry', 'click', this.retryHandler)
removeEvent('.normal', 'click', this.normalHandler)
addEvent('.normal', 'click', this.normalHandler)
d3.selectAll('.retry').attr('cursor', 'pointer') d3.selectAll('.retry').attr('cursor', 'pointer')
if (data.status === 'Completed') { if (data.status === 'Completed') {
this.stop() this.stop()
...@@ -789,24 +796,31 @@ export default { ...@@ -789,24 +796,31 @@ export default {
this.targetModalVisible = false this.targetModalVisible = false
this.showNodeDetail = false this.showNodeDetail = false
}, },
normalHandler (e) {
this.flowGraphMouseenterHandler(e.target.parentNode.getAttribute('id'))
},
async workFlowActionHandler (type) { async workFlowActionHandler (type) {
const found = this.flowData.flowNodes.find(_ => _.nodeId === this.currentFailedNodeID) const found = this.flowData.flowNodes.find(_ => _.nodeId === this.currentFailedNodeID)
if (!found) { if (!found) {
return return
} }
const payload = { if (type === 'showlog') {
act: type, this.flowGraphMouseenterHandler(this.currentFailedNodeID)
nodeInstId: found.id, } else {
procInstId: found.procInstId const payload = {
} act: type,
const { status } = await retryProcessInstance(payload) nodeInstId: found.id,
if (status === 'OK') { procInstId: found.procInstId
this.$Notice.success({ }
title: 'Success', const { status } = await retryProcessInstance(payload)
desc: (type === 'retry' ? 'Retry' : 'Skip') + ' action is proceed successfully' if (status === 'OK') {
}) this.$Notice.success({
this.workflowActionModalVisible = false title: 'Success',
this.processInstance() desc: (type === 'retry' ? 'Retry' : 'Skip') + ' action is proceed successfully'
})
this.workflowActionModalVisible = false
this.processInstance()
}
} }
}, },
bindFlowEvent () { bindFlowEvent () {
...@@ -820,9 +834,9 @@ export default { ...@@ -820,9 +834,9 @@ export default {
addEvent('.flow', 'click', this.flowNodesClickHandler) addEvent('.flow', 'click', this.flowNodesClickHandler)
} else { } else {
removeEvent('.flow', 'click', this.flowNodesClickHandler) removeEvent('.flow', 'click', this.flowNodesClickHandler)
removeEvent('.flow text', 'mouseenter', this.flowGraphMouseenterHandler) // removeEvent('.flow text', 'mouseenter', this.flowGraphMouseenterHandler)
removeEvent('.flow text', 'mouseleave', this.flowGraphLeaveHandler) removeEvent('.flow text', 'mouseleave', this.flowGraphLeaveHandler)
addEvent('.flow text', 'mouseenter', this.flowGraphMouseenterHandler) // addEvent('.flow text', 'mouseenter', this.flowGraphMouseenterHandler)
addEvent('.flow text', 'mouseleave', this.flowGraphLeaveHandler) addEvent('.flow text', 'mouseleave', this.flowGraphLeaveHandler)
} }
}, },
...@@ -830,13 +844,15 @@ export default { ...@@ -830,13 +844,15 @@ export default {
clearTimeout(this.flowDetailTimer) clearTimeout(this.flowDetailTimer)
this.flowDetailLeaveHandler() this.flowDetailLeaveHandler()
}, },
flowGraphMouseenterHandler (e) { flowGraphMouseenterHandler (id) {
// Task_0f9a25l
clearTimeout(this.flowDetailTimer) clearTimeout(this.flowDetailTimer)
this.flowDetailTimer = setTimeout(async () => { this.flowDetailTimer = setTimeout(async () => {
const found = this.flowData.flowNodes.find(_ => _.nodeId === e.target.parentNode.id) const found = this.flowData.flowNodes.find(_ => _.nodeId === id)
this.nodeTitle = (found.orderedNo ? found.orderedNo + '' : '') + found.nodeName this.nodeTitle = (found.orderedNo ? found.orderedNo + '' : '') + found.nodeName
const { status, data } = await getNodeContext(found.procInstId, found.id) const { status, data } = await getNodeContext(found.procInstId, found.id)
if (status === 'OK') { if (status === 'OK') {
this.workflowActionModalVisible = false
this.nodeDetailResponseHeader = JSON.parse(JSON.stringify(data)) this.nodeDetailResponseHeader = JSON.parse(JSON.stringify(data))
delete this.nodeDetailResponseHeader.requestObjects delete this.nodeDetailResponseHeader.requestObjects
this.nodeDetailResponseHeader = JSON.stringify(this.replaceParams(this.nodeDetailResponseHeader)) this.nodeDetailResponseHeader = JSON.stringify(this.replaceParams(this.nodeDetailResponseHeader))
...@@ -883,9 +899,9 @@ export default { ...@@ -883,9 +899,9 @@ export default {
this.currentNodeTitle = `${currentNode.orderedNo}${currentNode.nodeName}` this.currentNodeTitle = `${currentNode.orderedNo}${currentNode.nodeName}`
this.highlightModel(g.id, currentNode.nodeDefId) this.highlightModel(g.id, currentNode.nodeDefId)
this.renderFlowGraph() this.renderFlowGraph()
this.renderModelGraph()
}, },
async highlightModel (nodeId, nodeDefId) { async highlightModel (nodeId, nodeDefId) {
console.log(this.processSessionId)
if (nodeDefId && this.processSessionId) { if (nodeDefId && this.processSessionId) {
let { status, data } = await getDataByNodeDefIdAndProcessSessionId(nodeDefId, this.processSessionId) let { status, data } = await getDataByNodeDefIdAndProcessSessionId(nodeDefId, this.processSessionId)
if (status === 'OK') { if (status === 'OK') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment