Browse Source

Merge pull request '文件引用调整' (#106) from liwei into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_WEBFRONT/pulls/106
Reviewed-by: wangxy <xinyao.wang@le-it.com.cn>
pull/108/head
wangxy 3 years ago
parent
commit
33820d2238
2 changed files with 120 additions and 117 deletions
  1. +1
    -0
      src/main.js
  2. +119
    -117
      src/views/productplan/workbench/schedule.vue

+ 1
- 0
src/main.js View File

@ -17,6 +17,7 @@ import { getStanderOne } from '@/api/system/snrtab'
import { getColumnName } from '@/common/allField'
import { parseTime, resetForm, addDateRange, selectDictLabel, download } from '@/utils/costum'
import './utils/dhtmlxgantt'
import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log


+ 119
- 117
src/views/productplan/workbench/schedule.vue View File

@ -283,9 +283,6 @@
</div>
</template>
<script>
import {
gantt
} from '@/utils/dhtmlxgantt'
import moment from 'moment'
import {
getWorklineTree,
@ -308,7 +305,7 @@
interrupt,
} from '@/styles/variables.scss'
var that
var that, gantt;
export default {
data() {
return {
@ -394,129 +391,134 @@
}
},
mounted() {
var hourToStr = gantt.date.date_to_str('%H:%i')
var hourRangeFormat = function (step) {
return function (date) {
var intervalEnd = new Date(gantt.date.add(date, step, 'hour') - 1)
return hourToStr(date) + ' - ' + hourToStr(intervalEnd)
}
}
//
getWorklineTree().then(({
code,
data
}) => {
if (code === 200 && Object.keys(data).length) {
this.data = [data] || []
} else {
this.data = []
}
})
that = this
this.zoomConfig = {
minColumnWidth: 40,
maxColumnWidth: 40,
levels: [
[{
unit: 'month',
format: '%Y %M',
step: 1
},
{
unit: 'day',
step: 1,
format: function (date) {
const day = moment(date).date()
return `${day}日-${that.getWeek(date)}`
},
},
{
unit: 'hour',
step: 1,
format: '%H:%i'
},
],
[{
unit: 'day',
format: '%d %M',
step: 1
},
{
unit: 'hour',
format: hourRangeFormat(12),
step: 12
},
],
[{
unit: 'day',
format: '%d %M',
step: 1
},
{
unit: 'hour',
format: hourRangeFormat(6),
step: 6
},
],
[{
unit: 'day',
format: '%d %M',
step: 1
},
{
unit: 'hour',
format: '%H:%i',
step: 1
},
{
unit: 'minute',
step: 1,
format: '%H:%i'
let setGannt = setInterval(()=>{
if(window.gantt){
gantt=window.gantt;
clearInterval(setGannt);
var hourToStr = gantt.date.date_to_str('%H:%i')
var hourRangeFormat = function (step) {
return function (date) {
var intervalEnd = new Date(gantt.date.add(date, step, 'hour') - 1)
return hourToStr(date) + ' - ' + hourToStr(intervalEnd)
}
}
//
getWorklineTree().then(({
code,
data
}) => {
if (code === 200 && Object.keys(data).length) {
this.data = [data] || []
} else {
this.data = []
}
})
that = this
this.zoomConfig = {
minColumnWidth: 40,
maxColumnWidth: 40,
levels: [
[{
unit: 'month',
format: '%Y %M',
step: 1
},
{
unit: 'day',
step: 1,
format: function (date) {
const day = moment(date).date()
return `${day}日-${that.getWeek(date)}`
},
},
{
unit: 'hour',
step: 1,
format: '%H:%i'
},
],
[{
unit: 'day',
format: '%d %M',
step: 1
},
{
unit: 'hour',
format: hourRangeFormat(12),
step: 12
},
],
[{
unit: 'day',
format: '%d %M',
step: 1
},
{
unit: 'hour',
format: hourRangeFormat(6),
step: 6
},
],
[{
unit: 'day',
format: '%d %M',
step: 1
},
{
unit: 'hour',
format: '%H:%i',
step: 1
},
{
unit: 'minute',
step: 1,
format: '%H:%i'
},
],
],
useKey: 'ctrlKey',
trigger: 'wheel',
element: function () {
return gantt.$root.querySelector('.gantt_task')
},
],
],
useKey: 'ctrlKey',
trigger: 'wheel',
element: function () {
return gantt.$root.querySelector('.gantt_task')
},
}
gantt.config.work_time = true
gantt.config.task_height = 30
gantt.config.row_height = 50
gantt.config.scale_height = 60
gantt.config.min_column_width = 40
gantt.config.show_progress = false //
gantt.config.date_format = '%Y-%m-%d %H:%i:%s'
gantt.config.duration_unit = 'minute'; //
gantt.config.drag_resize = false //
gantt.config.show_links = false // link线
gantt.i18n.setLocale('cn'); //
gantt.config.readonly = true //
}
gantt.config.work_time = true
gantt.config.task_height = 30
gantt.config.row_height = 50
gantt.config.scale_height = 60
gantt.config.min_column_width = 40
gantt.config.show_progress = false //
gantt.config.date_format = '%Y-%m-%d %H:%i:%s'
gantt.config.duration_unit = 'minute'; //
gantt.config.drag_resize = false //
gantt.config.show_links = false // link线
gantt.i18n.setLocale('cn'); //
gantt.config.readonly = true //
// default columns definition
gantt.config.columns = [{
name: 'text',
label: '流水线名称',
tree: true,
width: '200'
}, ]
// default columns definition
gantt.config.columns = [{
name: 'text',
label: '流水线名称',
tree: true,
width: '200'
}, ]
//
gantt.attachEvent("onGanttScroll", function (left, top) {
that.taskEventFn();
});
//
gantt.attachEvent("onGanttScroll", function (left, top) {
that.taskEventFn();
});
gantt.ext.zoom.init(this.zoomConfig);
gantt.clearAll();
gantt.init('gantt-chart')
gantt.ext.zoom.init(this.zoomConfig);
gantt.clearAll();
gantt.init('gantt-chart')
}
},500)
},
methods: {
// .
// blockPool:
buildBlockManager(blockPool) {
const _this = this;
function addBlock() {
const div = document.createElement('div')
div.classList.add('block')


Loading…
Cancel
Save