Browse Source

reset last version

pull/3/MERGE
BoYiZhang 4 years ago
parent
commit
50f33a1bf1
  1. 170
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue

170
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue

@ -1,19 +1,19 @@
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* 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.
*/ */
<template> <template>
<div class="clearfix dag-model" > <div class="clearfix dag-model" >
<div class="toolbar"> <div class="toolbar">
@ -35,15 +35,15 @@
<div class="dag-toolbar"> <div class="dag-toolbar">
<div class="assist-btn"> <div class="assist-btn">
<x-button <x-button
style="vertical-align: middle;" style="vertical-align: middle;"
data-toggle="tooltip" data-toggle="tooltip"
:title="$t('View variables')" :title="$t('View variables')"
data-container="body" data-container="body"
type="primary" type="primary"
size="xsmall" size="xsmall"
:disabled="$route.name !== 'projects-instance-details'" :disabled="$route.name !== 'projects-instance-details'"
@click="_toggleView" @click="_toggleView"
icon="ans-icon-code"> icon="ans-icon-code">
</x-button> </x-button>
<x-button <x-button
style="vertical-align: middle;" style="vertical-align: middle;"
@ -72,54 +72,43 @@
</a> </a>
</div> </div>
<x-button <x-button
type="primary" type="primary"
v-tooltip.light="$t('Format DAG')" v-tooltip.light="$t('Format DAG')"
icon="ans-icon-triangle-solid-right" icon="ans-icon-triangle-solid-right"
size="xsmall" size="xsmall"
data-container="body" data-container="body"
v-if="(type === 'instance' || 'definition') && urlParam.id !=undefined" v-if="(type === 'instance' || 'definition') && urlParam.id !=undefined"
style="vertical-align: middle;" style="vertical-align: middle;"
@click="dagAutomaticLayout"> @click="dagAutomaticLayout">
</x-button> </x-button>
<x-button <x-button
v-tooltip.light="$t('Refresh DAG status')" v-tooltip.light="$t('Refresh DAG status')"
data-container="body" data-container="body"
style="vertical-align: middle;" style="vertical-align: middle;"
icon="ans-icon-refresh" icon="ans-icon-refresh"
type="primary" type="primary"
:loading="isRefresh" :loading="isRefresh"
v-if="type === 'instance'" v-if="type === 'instance'"
@click="!isRefresh && _refresh()" @click="!isRefresh && _refresh()"
size="xsmall" > size="xsmall" >
</x-button> </x-button>
<x-button <x-button
v-if="isRtTasks" v-if="isRtTasks"
style="vertical-align: middle;" style="vertical-align: middle;"
type="primary" type="primary"
size="xsmall" size="xsmall"
icon="ans-icon-play" icon="ans-icon-play"
@click="_rtNodesDag" > @click="_rtNodesDag" >
{{$t('Return_1')}} {{$t('Return_1')}}
</x-button> </x-button>
<x-button <x-button
style="vertical-align: middle;"
type="primary" type="primary"
v-tooltip.light="$t('Close')"
icon="ans-icon-off"
size="xsmall" size="xsmall"
data-container="body" :loading="spinnerLoading"
v-if="(type === 'instance' || 'definition') " @click="_saveChart"
style="vertical-align: middle;" icon="ans-icon-save"
@click="_closeDAG"> >
{{$t('Close')}}
</x-button>
<x-button
style="vertical-align: middle;"
type="primary"
size="xsmall"
:loading="spinnerLoading"
@click="_saveChart"
icon="ans-icon-save"
>
{{spinnerLoading ? 'Loading...' : $t('Save')}} {{spinnerLoading ? 'Loading...' : $t('Save')}}
</x-button> </x-button>
</div> </div>
@ -182,30 +171,30 @@
dagAutomaticLayout() { dagAutomaticLayout() {
$('#canvas').html('') $('#canvas').html('')
// Destroy round robin // Destroy round robin
Dag.init({ Dag.init({
dag: this, dag: this,
instance: jsPlumb.getInstance({ instance: jsPlumb.getInstance({
Endpoint: [ Endpoint: [
'Dot', { radius: 1, cssClass: 'dot-style' } 'Dot', { radius: 1, cssClass: 'dot-style' }
], ],
Connector: 'Bezier', Connector: 'Bezier',
PaintStyle: { lineWidth: 2, stroke: '#456' }, // Connection style PaintStyle: { lineWidth: 2, stroke: '#456' }, // Connection style
HoverPaintStyle: {stroke: '#ccc', strokeWidth: 3}, HoverPaintStyle: {stroke: '#ccc', strokeWidth: 3},
ConnectionOverlays: [ ConnectionOverlays: [
[ [
'Arrow', 'Arrow',
{ {
location: 1, location: 1,
id: 'arrow', id: 'arrow',
length: 12, length: 12,
foldback: 0.8 foldback: 0.8
} }
] ]
], ],
Container: 'canvas' Container: 'canvas'
})
}) })
})
if (this.tasks.length) { if (this.tasks.length) {
Dag.backfill(true) Dag.backfill(true)
if (this.type === 'instance') { if (this.type === 'instance') {
@ -273,7 +262,7 @@
let dom = $(`#${v2.id}`) let dom = $(`#${v2.id}`)
let state = dom.find('.state-p') let state = dom.find('.state-p')
let depState = '' let depState = ''
taskList.forEach(item=>{ taskList.forEach(item=>{
if(item.name==v1.name) { if(item.name==v1.name) {
depState = item.state depState = item.state
} }
@ -388,15 +377,6 @@
}) })
}) })
}, },
_closeDAG(){
let $name = this.$route.name
if($name && $name.indexOf("definition") != -1){
this.$router.push({ name: 'projects-definition-list'})
}else{
this.$router.push({ name: 'projects-instance-list'})
}
},
_verifConditions (value) { _verifConditions (value) {
let tasks = value let tasks = value
let bool = true let bool = true

Loading…
Cancel
Save