提交 feb169e8 编写于 作者: B break60

Add tips for download workflow

上级 a405bbec
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import Vue from 'vue'
let v = new Vue()
import _ from 'lodash' import _ from 'lodash'
import { jsPlumb } from 'jsplumb' import { jsPlumb } from 'jsplumb'
import JSP from './plugIn/jsPlumbHandle' import JSP from './plugIn/jsPlumbHandle'
...@@ -73,6 +74,7 @@ Dag.prototype.create = function () { ...@@ -73,6 +74,7 @@ Dag.prototype.create = function () {
* Action event on the right side of the toolbar * Action event on the right side of the toolbar
*/ */
Dag.prototype.toolbarEvent = function ({ item, code, is }) { Dag.prototype.toolbarEvent = function ({ item, code, is }) {
let self = this
switch (code) { switch (code) {
case 'pointer': case 'pointer':
JSP.handleEventPointer(is) JSP.handleEventPointer(is)
...@@ -87,8 +89,21 @@ Dag.prototype.toolbarEvent = function ({ item, code, is }) { ...@@ -87,8 +89,21 @@ Dag.prototype.toolbarEvent = function ({ item, code, is }) {
JSP.handleEventScreen({ item, is }) JSP.handleEventScreen({ item, is })
break break
case 'download': case 'download':
v.$modal.dialog({
width: 350,
closable: false,
showMask: true,
maskClosable: true,
title: $t('Download'),
content: $t('Please confirm whether the workflow has been saved before downloading'),
ok: {
handle (e) {
DownChart.download({ DownChart.download({
dagThis: this.dag dagThis: self.dag
})
}
},
cancel: {}
}) })
break break
} }
......
...@@ -19,7 +19,7 @@ import _ from 'lodash' ...@@ -19,7 +19,7 @@ import _ from 'lodash'
import canvg from 'canvg' import canvg from 'canvg'
import { tasksAll } from './util' import { tasksAll } from './util'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
// import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'
const DownChart = function () { const DownChart = function () {
this.dag = {} this.dag = {}
...@@ -111,10 +111,10 @@ DownChart.prototype.download = function ({ dagThis }) { ...@@ -111,10 +111,10 @@ DownChart.prototype.download = function ({ dagThis }) {
}, 100) }, 100)
// To refresh the dag instance, otherwise you can't re-plot // To refresh the dag instance, otherwise you can't re-plot
// setTimeout(() => { setTimeout(() => {
// // Refresh current dag // Refresh current dag
// findComponentDownward(this.dag.$root, `${this.dag.type}-details`).init() findComponentDownward(this.dag.$root, `${this.dag.type}-details`).init()
// }, 500) }, 500)
}) })
}) })
} }
......
...@@ -593,5 +593,6 @@ export default { ...@@ -593,5 +593,6 @@ export default {
'Successful branch flow and failed branch flow are required': 'conditions node Successful and failed branch flow are required', 'Successful branch flow and failed branch flow are required': 'conditions node Successful and failed branch flow are required',
'Unauthorized or deleted resources': 'Unauthorized or deleted resources', 'Unauthorized or deleted resources': 'Unauthorized or deleted resources',
'Please delete all non-existent resources': 'Please delete all non-existent resources', 'Please delete all non-existent resources': 'Please delete all non-existent resources',
'The Worker group no longer exists, please select the correct Worker group!': 'The Worker group no longer exists, please select the correct Worker group!' 'The Worker group no longer exists, please select the correct Worker group!': 'The Worker group no longer exists, please select the correct Worker group!',
'Please confirm whether the workflow has been saved before downloading': 'Please confirm whether the workflow has been saved before downloading'
} }
...@@ -593,5 +593,6 @@ export default { ...@@ -593,5 +593,6 @@ export default {
'Successful branch flow and failed branch flow are required': 'conditions节点成功和失败分支流转必填', 'Successful branch flow and failed branch flow are required': 'conditions节点成功和失败分支流转必填',
'Unauthorized or deleted resources': '未授权或已删除资源', 'Unauthorized or deleted resources': '未授权或已删除资源',
'Please delete all non-existent resources': '请删除所有未授权或已删除资源', 'Please delete all non-existent resources': '请删除所有未授权或已删除资源',
'The Worker group no longer exists, please select the correct Worker group!': '该Worker分组已经不存在,请选择正确的Worker分组!' 'The Worker group no longer exists, please select the correct Worker group!': '该Worker分组已经不存在,请选择正确的Worker分组!',
'Please confirm whether the workflow has been saved before downloading': '下载前请确定工作流是否已保存'
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册