|
@@ -1,8 +1,6 @@
|
|
{{ src/components/Gantt.vue }}
|
|
{{ src/components/Gantt.vue }}
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <div ref="gantt" style="height:600px;"></div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div ref="gantt"></div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import {gantt} from 'dhtmlx-gantt';
|
|
import {gantt} from 'dhtmlx-gantt';
|
|
@@ -52,7 +50,7 @@ export default {
|
|
label: response.deviceName
|
|
label: response.deviceName
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- gantt.init(this.$refs.gantt);
|
|
|
|
|
|
+ this.initData()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取项目经理下拉列表
|
|
// 获取项目经理下拉列表
|
|
@@ -68,7 +66,7 @@ export default {
|
|
label: response.name
|
|
label: response.name
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- gantt.init(this.$refs.gantt);
|
|
|
|
|
|
+ this.initData()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取传感器下拉列表
|
|
// 获取传感器下拉列表
|
|
@@ -103,7 +101,7 @@ export default {
|
|
shebeiId:res.shebeiId,
|
|
shebeiId:res.shebeiId,
|
|
pm: res.pm,
|
|
pm: res.pm,
|
|
reportNo: res.reportNo,
|
|
reportNo: res.reportNo,
|
|
- chuanganqi:res.chuanganqi,
|
|
|
|
|
|
+ chuanganqi:res.chuanganqiArray,
|
|
testPlanId:res.testPlanId,
|
|
testPlanId:res.testPlanId,
|
|
status:res.status,
|
|
status:res.status,
|
|
|
|
|
|
@@ -114,7 +112,6 @@ export default {
|
|
sampleName: res.sampleName,
|
|
sampleName: res.sampleName,
|
|
testItems: res.testItems,
|
|
testItems: res.testItems,
|
|
deviceName: res.deviceName,
|
|
deviceName: res.deviceName,
|
|
- status: res.status,
|
|
|
|
statusC: res.statusC
|
|
statusC: res.statusC
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -148,7 +145,7 @@ export default {
|
|
lastTime: res.duration,
|
|
lastTime: res.duration,
|
|
// jihuaEndDate: res.jihuaEndDate,
|
|
// jihuaEndDate: res.jihuaEndDate,
|
|
reportNo: res.reportNo,
|
|
reportNo: res.reportNo,
|
|
- chuanganqi:res.chuanganqi,
|
|
|
|
|
|
+ chuanganqiArray:res.chuanganqi,
|
|
testPlanId:res.testPlanId,
|
|
testPlanId:res.testPlanId,
|
|
status:res.status,
|
|
status:res.status,
|
|
testItems: res.testItems,
|
|
testItems: res.testItems,
|
|
@@ -407,12 +404,57 @@ export default {
|
|
}
|
|
}
|
|
// 右侧项目展示
|
|
// 右侧项目展示
|
|
gantt.templates.task_text = function (start, end, task) {
|
|
gantt.templates.task_text = function (start, end, task) {
|
|
- console.log(task)
|
|
|
|
|
|
+ // console.log(task)
|
|
// return "<b>设备:</b> " + task.shebeiId + ",<b> 项目经理:</b> " + task.pm;
|
|
// return "<b>设备:</b> " + task.shebeiId + ",<b> 项目经理:</b> " + task.pm;
|
|
- // return "<b> 项目经理:</b> " + task.pm;
|
|
|
|
- // return "<b>项目经理:</b> "+ task.pm + ", <b>设备:</b> " + task.deviceName;
|
|
|
|
return task.pm + ", " + task.deviceName;
|
|
return task.pm + ", " + task.deviceName;
|
|
};
|
|
};
|
|
|
|
+ // 灯箱多选框
|
|
|
|
+ gantt.form_blocks["multiselect"] = {
|
|
|
|
+ render: function (sns) {
|
|
|
|
+ var height = (sns.height || "23") + "px";
|
|
|
|
+ var html = "<div class='gantt_cal_ltext gantt_cal_chosen gantt_cal_multiselect'"+
|
|
|
|
+ "style='height:"+ height + ";'><select data-placeholder='...'"+
|
|
|
|
+ "class='chosen-select' multiple>";
|
|
|
|
+ if (sns.options) {
|
|
|
|
+ for (var i = 0; i < sns.options.length; i++) {
|
|
|
|
+ if(sns.unassigned_value !== undefined && sns.options[i].key==sns.unassigned_value){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ html+="<option value='" +sns.options[i].key+ "'>"+sns.options[i].label+"</option>";
|
|
|
|
+ }}
|
|
|
|
+ html += "</select></div>";
|
|
|
|
+ return html;},
|
|
|
|
+
|
|
|
|
+ set_value: function (node, value, ev, sns) {
|
|
|
|
+ node.style.overflow = "visible";
|
|
|
|
+ node.parentNode.style.overflow = "visible";
|
|
|
|
+ node.style.display = "inline-block";
|
|
|
|
+ var select = $(node.firstChild);
|
|
|
|
+
|
|
|
|
+ if (value) {
|
|
|
|
+ value = (value + "").split(",");
|
|
|
|
+ select.val(value);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ select.val([]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ select.chosen();
|
|
|
|
+ if(sns.onchange){
|
|
|
|
+ select.change(function(){
|
|
|
|
+ sns.onchange.call(this);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ select.trigger('chosen:updated');
|
|
|
|
+ select.trigger("change");},
|
|
|
|
+
|
|
|
|
+ get_value: function (node, ev) {
|
|
|
|
+ var value = $(node.firstChild).val();
|
|
|
|
+ //value = value ? value.join(",") : null
|
|
|
|
+ return value;},
|
|
|
|
+ focus: function (node) {
|
|
|
|
+ $(node.firstChild).focus();
|
|
|
|
+ }};
|
|
//弹出层(灯箱)
|
|
//弹出层(灯箱)
|
|
gantt.config.lightbox.sections = [
|
|
gantt.config.lightbox.sections = [
|
|
// { name: "text", height: 30, map_to: "text", type: "textarea", focus: true, width: "*" },
|
|
// { name: "text", height: 30, map_to: "text", type: "textarea", focus: true, width: "*" },
|
|
@@ -429,7 +471,7 @@ export default {
|
|
name: "device", height: 30, map_to: "shebeiId", type: "select", options: gantt.serverList('staff',[]),
|
|
name: "device", height: 30, map_to: "shebeiId", type: "select", options: gantt.serverList('staff',[]),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: "sensor", height: 30, map_to: "chuanganqi", type: "checkbox", options: gantt.serverList('chuanganqi',[]),
|
|
|
|
|
|
+ name: "sensor", height: 30, map_to: "chuanganqi", type: "multiselect", options: gantt.serverList('chuanganqi',[]),
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// name: "sensor", height: 30, map_to: "chuanganqi", type: "multiselect", options: gantt.serverList('chuanganqi'), unassigned_value:5 ,
|
|
// name: "sensor", height: 30, map_to: "chuanganqi", type: "multiselect", options: gantt.serverList('chuanganqi'), unassigned_value:5 ,
|
|
@@ -442,6 +484,19 @@ export default {
|
|
];
|
|
];
|
|
// 删除灯箱中的删除按钮
|
|
// 删除灯箱中的删除按钮
|
|
gantt.config.buttons_right = [];
|
|
gantt.config.buttons_right = [];
|
|
|
|
+ // 自定义弹框
|
|
|
|
+ // let that = this
|
|
|
|
+ // gantt.config.details_on_dblclick = false;
|
|
|
|
+ // gantt.attachEvent("onTaskDblClick", function (id, e){
|
|
|
|
+ // console.log(111,id, e);
|
|
|
|
+ // that.id = id
|
|
|
|
+ // // gantt.getTask(id);
|
|
|
|
+ // // console.log(gantt.getTask(id));
|
|
|
|
+ // // gantt.getTask(that.id);
|
|
|
|
+ // // console.log(gantt.getTask(that.id));
|
|
|
|
+ // // that.visible = true;
|
|
|
|
+ // return true;
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -455,44 +510,13 @@ export default {
|
|
|
|
|
|
<style>
|
|
<style>
|
|
@import "~dhtmlx-gantt/codebase/dhtmlxgantt.css";
|
|
@import "~dhtmlx-gantt/codebase/dhtmlxgantt.css";
|
|
- html, body {
|
|
|
|
- padding: 0px;
|
|
|
|
- margin: 0px;
|
|
|
|
- height: 100%;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- #gantt_here {
|
|
|
|
- width:100%;
|
|
|
|
- height:100%;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .gantt_grid_scale .gantt_grid_head_cell,
|
|
|
|
- .gantt_task .gantt_task_scale .gantt_scale_cell {
|
|
|
|
- /* font-weight: bold; */
|
|
|
|
- font-size: 14px;
|
|
|
|
- color: rgba(0, 0, 0, 0.7);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .owner-label{
|
|
|
|
- width: 20px;
|
|
|
|
- height: 20px;
|
|
|
|
- line-height: 20px;
|
|
|
|
- font-size: 12px;
|
|
|
|
- display: inline-block;
|
|
|
|
- border: 1px solid #cccccc;
|
|
|
|
- border-radius: 25px;
|
|
|
|
- background: #e6e6e6;
|
|
|
|
- color: #6f6f6f;
|
|
|
|
- margin: 0 3px;
|
|
|
|
- font-weight: bold;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .gantt_cal_larea{
|
|
|
|
|
|
+ .gantt_cal_larea{
|
|
overflow:visible;
|
|
overflow:visible;
|
|
}
|
|
}
|
|
- .gantt_cal_chosen,
|
|
|
|
|
|
+ .gantt_cal_chosen,
|
|
.gantt_cal_chosen select{
|
|
.gantt_cal_chosen select{
|
|
width: 400px;
|
|
width: 400px;
|
|
|
|
+ margin-bottom: 20px;
|
|
}
|
|
}
|
|
.status{
|
|
.status{
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|