Browse Source

fix bug where task name display in gantt (#10900)

3.1.0-release
Devosend 2 years ago committed by GitHub
parent
commit
0ea5809ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      dolphinscheduler-ui/src/views/projects/workflow/instance/gantt/components/gantt-chart.tsx

32
dolphinscheduler-ui/src/views/projects/workflow/instance/gantt/components/gantt-chart.tsx

@ -15,6 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import _ from 'lodash'
import { defineComponent, ref, PropType } from 'vue' import { defineComponent, ref, PropType } from 'vue'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import type { Ref } from 'vue' import type { Ref } from 'vue'
@ -101,7 +102,7 @@ const GanttChart = defineComponent({
{ {
x: start[0], x: start[0],
y: start[1] - height / 2, y: start[1] - height / 2,
width: end[0] - start[0], width: _.max([end[0] - start[0], 1]) || 1,
height: height height: height
}, },
{ {
@ -153,13 +154,15 @@ const GanttChart = defineComponent({
dataZoom: [ dataZoom: [
{ {
type: 'slider', type: 'slider',
xAxisIndex: 0,
filterMode: 'weakFilter', filterMode: 'weakFilter',
showDataShadow: false, height: 20,
top: bottom: 0,
props.taskList.length * 100 > 200 start: 0,
? props.taskList.length * 100 end: 100,
: 200, handleSize: '80%',
labelFormatter: '' showDetail: false,
top: '85%'
}, },
{ {
type: 'inside', type: 'inside',
@ -167,12 +170,12 @@ const GanttChart = defineComponent({
} }
], ],
grid: { grid: {
height: props.taskList.length * 50, height: '70%',
top: 80 top: 80
}, },
xAxis: { xAxis: {
type: 'time',
min: minTime, min: minTime,
scale: true,
position: 'top', position: 'top',
axisTick: { show: true }, axisTick: { show: true },
splitLine: { show: false }, splitLine: { show: false },
@ -186,8 +189,15 @@ const GanttChart = defineComponent({
axisTick: { show: false }, axisTick: { show: false },
splitLine: { show: false }, splitLine: { show: false },
axisLine: { show: false }, axisLine: { show: false },
max: props.taskList.length, data: props.taskList.map((item: string) => {
data: props.taskList return {
value: item,
textStyle: {
width: 130,
overflow: 'truncate'
}
}
})
}, },
series: series series: series
} }

Loading…
Cancel
Save