修改进度管理(甘特图)
This commit is contained in:
parent
72685cde60
commit
58ed28cbb1
42
package-lock.json
generated
42
package-lock.json
generated
@ -12,7 +12,7 @@
|
||||
"better-scroll": "^2.4.1",
|
||||
"core-js": "^3.6.5",
|
||||
"css-declaration-sorter": "^6.3.1",
|
||||
"dhtmlx-gantt": "^7.1.12",
|
||||
"dhtmlx-gantt": "^7.1.13",
|
||||
"dom-to-image": "^2.6.0",
|
||||
"echarts": "^5.1.0",
|
||||
"echarts4": "npm:echarts@^4.8.0",
|
||||
@ -21,6 +21,8 @@
|
||||
"flv.js": "^1.6.2",
|
||||
"gantt-elastic": "^1.0.12",
|
||||
"html2canvas": "^1.0.0-rc.7",
|
||||
"jquery": "^3.6.3",
|
||||
"jquery-ui-dist": "^1.13.2",
|
||||
"js-base64": "^3.7.2",
|
||||
"js-md5": "^0.7.3",
|
||||
"lrz": "^4.9.41",
|
||||
@ -6812,9 +6814,9 @@
|
||||
"integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw=="
|
||||
},
|
||||
"node_modules/dhtmlx-gantt": {
|
||||
"version": "7.1.12",
|
||||
"resolved": "https://registry.npmmirror.com/dhtmlx-gantt/-/dhtmlx-gantt-7.1.12.tgz",
|
||||
"integrity": "sha512-8xC/DbBR/jqy6bnTT+qc6uKZPdQwYqpw6U8LJRb2A9Uz0BdYvKCptVfXIQOERFOLEqjymSzbCu4z/OwmabuCrg=="
|
||||
"version": "7.1.13",
|
||||
"resolved": "https://registry.npmmirror.com/dhtmlx-gantt/-/dhtmlx-gantt-7.1.13.tgz",
|
||||
"integrity": "sha512-PnVk6HI8LcOu1E6o9sJ5UpeWRiaXLnNa5t3i0oFPXPVkDrDyZdNr0KduryF45R7DWMSyMkxJ9RGJ+iUiqQCDhg=="
|
||||
},
|
||||
"node_modules/diffie-hellman": {
|
||||
"version": "5.0.3",
|
||||
@ -9680,6 +9682,19 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/jquery": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.6.3.tgz",
|
||||
"integrity": "sha512-bZ5Sy3YzKo9Fyc8wH2iIQK4JImJ6R0GWI9kL1/k7Z91ZBNgkRXE6U0JfHIizZbort8ZunhSI3jw9I6253ahKfg=="
|
||||
},
|
||||
"node_modules/jquery-ui-dist": {
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmmirror.com/jquery-ui-dist/-/jquery-ui-dist-1.13.2.tgz",
|
||||
"integrity": "sha512-oVDRd1NLtTbBwpRKAYdIRgpWVDzeBhfy7Gu0RmY6JEaZtmBq6kDn1pm5SgDiAotrnDS+RoTRXO6xvcNTxA9tOA==",
|
||||
"dependencies": {
|
||||
"jquery": ">=1.8.0 <4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/js-base64": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.2.tgz",
|
||||
@ -26787,9 +26802,9 @@
|
||||
"integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw=="
|
||||
},
|
||||
"dhtmlx-gantt": {
|
||||
"version": "7.1.12",
|
||||
"resolved": "https://registry.npmmirror.com/dhtmlx-gantt/-/dhtmlx-gantt-7.1.12.tgz",
|
||||
"integrity": "sha512-8xC/DbBR/jqy6bnTT+qc6uKZPdQwYqpw6U8LJRb2A9Uz0BdYvKCptVfXIQOERFOLEqjymSzbCu4z/OwmabuCrg=="
|
||||
"version": "7.1.13",
|
||||
"resolved": "https://registry.npmmirror.com/dhtmlx-gantt/-/dhtmlx-gantt-7.1.13.tgz",
|
||||
"integrity": "sha512-PnVk6HI8LcOu1E6o9sJ5UpeWRiaXLnNa5t3i0oFPXPVkDrDyZdNr0KduryF45R7DWMSyMkxJ9RGJ+iUiqQCDhg=="
|
||||
},
|
||||
"diffie-hellman": {
|
||||
"version": "5.0.3",
|
||||
@ -29114,6 +29129,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"jquery": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmmirror.com/jquery/-/jquery-3.6.3.tgz",
|
||||
"integrity": "sha512-bZ5Sy3YzKo9Fyc8wH2iIQK4JImJ6R0GWI9kL1/k7Z91ZBNgkRXE6U0JfHIizZbort8ZunhSI3jw9I6253ahKfg=="
|
||||
},
|
||||
"jquery-ui-dist": {
|
||||
"version": "1.13.2",
|
||||
"resolved": "https://registry.npmmirror.com/jquery-ui-dist/-/jquery-ui-dist-1.13.2.tgz",
|
||||
"integrity": "sha512-oVDRd1NLtTbBwpRKAYdIRgpWVDzeBhfy7Gu0RmY6JEaZtmBq6kDn1pm5SgDiAotrnDS+RoTRXO6xvcNTxA9tOA==",
|
||||
"requires": {
|
||||
"jquery": ">=1.8.0 <4.0.0"
|
||||
}
|
||||
},
|
||||
"js-base64": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.2.tgz",
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"better-scroll": "^2.4.1",
|
||||
"core-js": "^3.6.5",
|
||||
"css-declaration-sorter": "^6.3.1",
|
||||
"dhtmlx-gantt": "^7.1.12",
|
||||
"dhtmlx-gantt": "^7.1.13",
|
||||
"dom-to-image": "^2.6.0",
|
||||
"echarts": "^5.1.0",
|
||||
"echarts4": "npm:echarts@^4.8.0",
|
||||
@ -21,6 +21,8 @@
|
||||
"flv.js": "^1.6.2",
|
||||
"gantt-elastic": "^1.0.12",
|
||||
"html2canvas": "^1.0.0-rc.7",
|
||||
"jquery": "^3.6.3",
|
||||
"jquery-ui-dist": "^1.13.2",
|
||||
"js-base64": "^3.7.2",
|
||||
"js-md5": "^0.7.3",
|
||||
"lrz": "^4.9.41",
|
||||
|
||||
@ -78,7 +78,8 @@ if (process.env.NODE_ENV == 'development') {
|
||||
// axios.defaults.baseURL = 'http://218.92.215.138:9090/' //盐城 新佳城小区 123456
|
||||
// axios.defaults.baseURL = 'http://36.137.53.203:9090/' //盐城 gdjt 123456789
|
||||
// axios.defaults.baseURL = 'http://183.234.150.152:9090/' //华发 huaxin 123456789
|
||||
// axios.defaults.baseURL = 'http://139.9.66.234:7072/' //三江集团
|
||||
// axios.defaults.baseURL = 'http://139.9.66.234:7072/' //三江集团测试环境
|
||||
// axios.defaults.baseURL = 'http://116.169.63.183:7070' //三江集团正式环境
|
||||
|
||||
} else if (process.env.NODE_ENV == 'debug') {
|
||||
axios.defaults.baseURL = 'https://www.ceshi.com'
|
||||
|
||||
@ -63,8 +63,8 @@ export default new Vuex.Store({
|
||||
// BASEURL:'http://192.168.34.116:6023/',
|
||||
// UPLOADURL: 'http://192.168.34.116:6023/upload/image',
|
||||
// FILEURL: 'http://192.168.34.116:6023/image/',
|
||||
// UPLOADURL: 'http://124.71.67.160:8088/upload/image',
|
||||
// FILEURL: 'http://124.71.67.160:8088/image/',
|
||||
UPLOADURL: 'http://124.71.67.160:8088/upload/image',
|
||||
FILEURL: 'http://124.71.67.160:8088/image/',
|
||||
//---
|
||||
// UPLOADURL: 'http://192.168.34.125:6023/upload/image',
|
||||
// FILEURL: 'http://192.168.34.125:6023/image/',
|
||||
@ -72,8 +72,10 @@ export default new Vuex.Store({
|
||||
// UPLOADURL:'http://'+"61.190.32.219:9050"+'/upload/image',//正式
|
||||
// FILEURL:'http://'+"61.190.32.219:9050"+'/image/',//正式
|
||||
// FILEURL:'http://'+"47.97.202.104:6023"+'/image/',//正式
|
||||
UPLOADURL: 'http://182.90.224.147:100/upload/image',//演示平台
|
||||
FILEURL: 'http://182.90.224.147:100/image/',//演示平台
|
||||
// UPLOADURL: 'http://182.90.224.147:100/upload/image',//演示平台
|
||||
// FILEURL: 'http://182.90.224.147:100/image/',//演示平台
|
||||
// UPLOADURL: 'http://139.9.66.234:7072/upload/image',//三江集团
|
||||
// FILEURL: 'http://139.9.66.234:7072/image/',//三江集团
|
||||
|
||||
ACCOUNTTYPE: [
|
||||
"系统管理员",
|
||||
|
||||
@ -2571,7 +2571,8 @@ export default {
|
||||
if (type == 1) {
|
||||
if (
|
||||
file.type != "image/jpeg" &&
|
||||
file.type != "image/jpg"
|
||||
file.type != "image/jpg"&&
|
||||
file.type != "image/png"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("message.laborMange.hint8"));
|
||||
@ -2584,7 +2585,7 @@ export default {
|
||||
// type==1 现场采集照 2 身份证反面 3 身份证正面 4 合同 5 资格证书 6 身份证头像
|
||||
if (type == 1) {
|
||||
let imgStatus = file2.size / 1024 < 500;
|
||||
if (!imgStatus) {
|
||||
if (imgStatus) {
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + file.data[0].imageUrl;
|
||||
this.cropperDialog = true;
|
||||
@ -2629,7 +2630,6 @@ export default {
|
||||
},
|
||||
// 人员照片库比对
|
||||
checkImgLibrary(url) {
|
||||
console.log(url);
|
||||
checkImgLibraryApi({ fileUrl: url, projectSn: this.projectSn }).then(
|
||||
(res) => {
|
||||
if (res.result && res.result.length > 0) {
|
||||
@ -2649,8 +2649,12 @@ export default {
|
||||
},
|
||||
//人脸监测、
|
||||
checkFace(url) {
|
||||
console.log('url',url);
|
||||
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
console.log('res数据',res);
|
||||
|
||||
if (res.result.checkType ==1) {
|
||||
this.workerInfo.fieldAcquisitionUrl = url;
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
@ -2682,7 +2686,8 @@ export default {
|
||||
// this.checkFace(res.data.data[0].imageUrl)
|
||||
if (this.isSzProject == 1) {
|
||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.checkFace(res.data.data[0].imageUrl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,13 +189,13 @@
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:picker-options="pickerOptions"
|
||||
clearable
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
@input="getContractTime"
|
||||
>
|
||||
</el-date-picker>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('message.extendInfo.actualConstructionTime')"
|
||||
@ -209,7 +209,6 @@
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:picker-options="pickerOptions"
|
||||
clearable
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
@ -320,7 +319,7 @@ export default {
|
||||
projectDialogTitle: this.$t("message.extendInfo.editProjectInfo"),
|
||||
editProjectDialog: false,
|
||||
editProjectForm: {
|
||||
contractTime: ['',''],
|
||||
contractTime: ["", ""],
|
||||
realTime: [],
|
||||
contractSignTime: "",
|
||||
contractPeriodEndTime: "",
|
||||
@ -349,38 +348,6 @@ export default {
|
||||
value: "code",
|
||||
},
|
||||
showMap: false,
|
||||
//快捷日期选中
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
@ -389,6 +356,7 @@ export default {
|
||||
this.getProjectExtendInfo();
|
||||
},
|
||||
methods: {
|
||||
|
||||
//获取列表信息
|
||||
getProjectExtendInfo() {
|
||||
let data = {
|
||||
|
||||
@ -27,9 +27,11 @@ import {
|
||||
editProgressTaskApi, //编辑
|
||||
getParentChildListApi, //查询
|
||||
} from "@/assets/js/api/scheduleInfo";
|
||||
import $ from 'jquery'
|
||||
import 'jquery-ui-dist/jquery-ui'
|
||||
import 'jquery-ui-dist/jquery-ui.min.css'
|
||||
import { gantt } from "dhtmlx-gantt";
|
||||
import moment from "moment";
|
||||
import { Model } from "echarts";
|
||||
export default {
|
||||
name: "gantt",
|
||||
props: {
|
||||
@ -45,6 +47,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
events:[],
|
||||
dataLinks: [],
|
||||
title: "",
|
||||
width: 800,
|
||||
@ -128,8 +131,8 @@ export default {
|
||||
confirm_deleting: "是否删除计划?",
|
||||
section_description: "备注:",
|
||||
section_time: "计划时间:",
|
||||
section_actual: "开始时间:",
|
||||
section_time2: "开始时间:",
|
||||
section_deadline: "实际时间:",
|
||||
section_type: "类型",
|
||||
section_text: "任务名称:",
|
||||
section_color: "颜色:",
|
||||
@ -147,8 +150,6 @@ export default {
|
||||
column_add: "",
|
||||
column_id: "",
|
||||
column_predecessors: "",
|
||||
column_actual_start_date: "",
|
||||
column_actual_end_date: "",
|
||||
column_duration: "",
|
||||
|
||||
/* link confirmation */
|
||||
@ -170,7 +171,6 @@ export default {
|
||||
years: "年",
|
||||
},
|
||||
};
|
||||
|
||||
gantt.plugins({ marker: true, tooltip: true }); // 开启marker插件
|
||||
// 提示框内容
|
||||
gantt.templates.tooltip_text = function (start, end, task) {
|
||||
@ -219,14 +219,14 @@ export default {
|
||||
resize: true,
|
||||
},
|
||||
{
|
||||
name: "actual_start_date",
|
||||
name: "planned_start",
|
||||
label: "实际开始日期",
|
||||
align: "center",
|
||||
width: "100",
|
||||
resize: true,
|
||||
},
|
||||
{
|
||||
name: "actual_end_date",
|
||||
name: "planned_end",
|
||||
label: "实际完成日期",
|
||||
align: "center",
|
||||
width: "100",
|
||||
@ -244,7 +244,55 @@ export default {
|
||||
},
|
||||
{ name: "add", label: "" },
|
||||
];
|
||||
function startDatepicker(node){
|
||||
return $(node).find("input[name='start']");
|
||||
}
|
||||
function endDateInput(node){
|
||||
return $(node).find("input[name='end']");
|
||||
}
|
||||
|
||||
gantt.form_blocks["datepicker"] = {
|
||||
render(sns) { //sns - the section's configuration object
|
||||
return "<div class='gantt-lb-datepicker'>"+
|
||||
"<input type='text' name='start' placeholder='请选择实际开始时间' style='height:20px;margin:0 0px 0 10px'>"+'-'+
|
||||
"<input type='text' name='end' placeholder='请选择实际结束时间' style='height:20px'>"+
|
||||
"</div>";;
|
||||
},
|
||||
set_value(node, value, task, section) {
|
||||
startDatepicker(node).datepicker({
|
||||
dateFormat: "yy-mm-dd",
|
||||
onSelect: () => {
|
||||
}
|
||||
});
|
||||
|
||||
startDatepicker(node).datepicker("setDate", task.planned_start);
|
||||
|
||||
endDateInput(node).datepicker({
|
||||
dateFormat: "yy-mm-dd",
|
||||
onSelect: function (dateStr) {
|
||||
// gantt.ext.inlineEditors.save()
|
||||
}
|
||||
});
|
||||
endDateInput(node).datepicker("setDate", task.planned_end);
|
||||
},
|
||||
get_value(node, task, section) {
|
||||
|
||||
if(task.planned_start && task.planned_end) {
|
||||
var start = startDatepicker(node).datepicker('getDate');
|
||||
var end = endDateInput(node).datepicker('getDate');
|
||||
|
||||
task.planned_start = start;
|
||||
task.planned_end = end;
|
||||
}
|
||||
|
||||
// task.duration = gantt.calculateDuration(task);
|
||||
},
|
||||
focus(node) {
|
||||
|
||||
}
|
||||
}
|
||||
//弹出层
|
||||
|
||||
gantt.config.lightbox.sections = [
|
||||
//工程名称
|
||||
{
|
||||
@ -263,8 +311,13 @@ export default {
|
||||
type: "time",
|
||||
time_format: ["%Y", "%m", "%d"],
|
||||
},
|
||||
// //实际开始/结束时间
|
||||
// { name: "actualTime", height: 72, map_to: "auto", type: "date" },
|
||||
//实际开始/结束时间
|
||||
{
|
||||
name: "deadline",
|
||||
height: 30,
|
||||
type: "datepicker",
|
||||
map_to:"auto",
|
||||
},
|
||||
|
||||
// 完成状态
|
||||
{
|
||||
@ -330,9 +383,9 @@ export default {
|
||||
//弹窗标题 日期范围
|
||||
gantt.templates.task_time = function (start, end, task) {
|
||||
return (
|
||||
moment(task.startDate).format("YYYY-MM-DD") +
|
||||
moment(task.start_date).format("YYYY-MM-DD") +
|
||||
" - " +
|
||||
moment(task.finishDate).format("YYYY-MM-DD")
|
||||
moment(task.end_date).format("YYYY-MM-DD")
|
||||
);
|
||||
};
|
||||
//弹窗标题 计划名称
|
||||
@ -340,7 +393,6 @@ export default {
|
||||
return task.text;
|
||||
};
|
||||
gantt.init(this.$refs.gantt);
|
||||
gantt.parse(this.$props.tasks);
|
||||
let this_ = this;
|
||||
//添加后触发
|
||||
gantt.attachEvent("onAfterTaskAdd", function (id, item) {
|
||||
@ -372,8 +424,8 @@ export default {
|
||||
taskName: item.text,
|
||||
taskTypeId: Number(item.taskTypeId) - 1,
|
||||
finishDate: moment(item.end_date).format("YYYY-MM-DD"),//计划结束
|
||||
actualStartDate: moment(item.actual_start_date).format("YYYY-MM-DD"),//实际开始
|
||||
actualFinishDate: moment(item.actual_end_date).format("YYYY-MM-DD"),//实际结束
|
||||
actualStartDate: moment(item.planned_start).format("YYYY-MM-DD"),//实际开始
|
||||
actualFinishDate: moment(item.planned_end).format("YYYY-MM-DD"),//实际结束
|
||||
};
|
||||
addProgressTaskApi(data).then((res) => {
|
||||
console.log("添加的数据", res);
|
||||
@ -400,7 +452,7 @@ export default {
|
||||
});
|
||||
});
|
||||
//修改任务后触发
|
||||
gantt.attachEvent("onAfterTaskUpdate", function (id, item) {
|
||||
const onAfterTaskDrag =gantt.attachEvent("onAfterTaskUpdate", function (id, item) {
|
||||
console.log("修改任务后触发", item);
|
||||
let data = {
|
||||
duration: Number(item.ck),
|
||||
@ -414,14 +466,15 @@ export default {
|
||||
taskName: item.text,
|
||||
taskTypeId: Number(item.taskTypeId) - 1,
|
||||
finishDate: moment(item.end_date).format("YYYY-MM-DD"),//计划结束
|
||||
actualStartDate: moment(item.actual_start_date).format("YYYY-MM-DD"),//实际开始
|
||||
actualFinishDate: moment(item.actual_end_date).format("YYYY-MM-DD"),//实际结束
|
||||
actualStartDate: moment(item.planned_start).format("YYYY-MM-DD"),//实际开始
|
||||
actualFinishDate: moment(item.planned_end).format("YYYY-MM-DD"),//实际结束
|
||||
};
|
||||
editProgressTaskApi(data).then((res) => {
|
||||
console.log("修改的数据", res);
|
||||
this_.getParentChildList();
|
||||
});
|
||||
});
|
||||
this_.events.push(onAfterTaskDrag)
|
||||
|
||||
//拖拽任务后触发
|
||||
gantt.attachEvent("onTaskDrag", function (id, mode, task, original) {
|
||||
@ -446,19 +499,21 @@ export default {
|
||||
this.projectSn = this.$store.state.projectSn;
|
||||
this.getParentChildList();
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.events.forEach(ele => {
|
||||
gantt.detachEvent(ele)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//数据格式整理
|
||||
changeTask() {
|
||||
changeTask(ganttValue) {
|
||||
// return
|
||||
console.log("开始数据整理");
|
||||
const taskCount = gantt.getTaskCount();
|
||||
const taskCount = ganttValue.length;
|
||||
let taskData = [];
|
||||
let openTask = [];
|
||||
for (let i = 0; i < taskCount; i++) {
|
||||
let taskOne = {};
|
||||
const obj = gantt.getTaskByIndex(i);
|
||||
console.log("整理数据的 ", obj);
|
||||
console.log("整理数据的 大小", typeof obj.id);
|
||||
const obj = ganttValue[i];
|
||||
if (obj == null || typeof obj.id === "number") {
|
||||
continue;
|
||||
}
|
||||
@ -470,12 +525,9 @@ export default {
|
||||
//整理数据格式
|
||||
taskOne.id = obj.id;
|
||||
taskOne.text = obj.taskName || obj.text;
|
||||
// if (obj.start_date != null) {
|
||||
// taskOne.start_date = moment(obj.start_date).format("YYYY-MM-DD");
|
||||
// }
|
||||
// if (obj.end_date != null) {
|
||||
// taskOne.end_date = moment(obj.end_date).format("YYYY-MM-DD");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
if (obj.startDate != null) {
|
||||
taskOne.start_date = moment(obj.startDate).format("YYYY-MM-DD");
|
||||
@ -484,14 +536,12 @@ export default {
|
||||
taskOne.end_date = moment(obj.finishDate).format("YYYY-MM-DD");
|
||||
}
|
||||
if (obj.actualStartDate != null) {
|
||||
taskOne.actual_start_date = moment(obj.actualStartDate).format(
|
||||
taskOne.planned_start = moment(obj.actualStartDate).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
}
|
||||
if (obj.actualFinishDate != null) {
|
||||
taskOne.actual_end_date = moment(obj.actualFinishDate).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
taskOne.planned_end = moment(obj.actualFinishDate).format("YYYY-MM-DD");
|
||||
}
|
||||
|
||||
taskOne.duration = obj.duration;
|
||||
@ -509,6 +559,9 @@ export default {
|
||||
if (obj.parentId) {
|
||||
taskOne.parent = obj.parentId;
|
||||
}
|
||||
if(i == 0) {
|
||||
console.log("第一条数据结构 :", JSON.stringify(taskOne));
|
||||
}
|
||||
taskData.push(taskOne);
|
||||
}
|
||||
this.$props.tasks.data = taskData;
|
||||
@ -527,15 +580,11 @@ export default {
|
||||
getParentChildListApi({ projectSn: this.projectSn }).then((res) => {
|
||||
this.check(res.result);
|
||||
this.dataList = res.result;
|
||||
console.log("甘特图列表数据", this.tasks.data);
|
||||
console.log(" this.$props.tasks", this.$props.tasks);
|
||||
|
||||
this.$props.tasks.data = this.tasks.data;
|
||||
|
||||
console.log(" this.$props.tasks 赋值后", this.$props.tasks);
|
||||
|
||||
gantt.parse(this.$props.tasks);
|
||||
this.changeTask();
|
||||
// gantt.parse(this.$props.tasks);
|
||||
this.changeTask(this.tasks.data);
|
||||
});
|
||||
},
|
||||
check(val) {
|
||||
@ -543,7 +592,6 @@ export default {
|
||||
val.forEach((res) => {
|
||||
this.tasks.data.push(res);
|
||||
if (res.predecessorIds != "" && res.predecessorIds != null) {
|
||||
console.log("res.predecessorIds---", res.predecessorIds);
|
||||
let dataLinks = res.predecessorIds.split(",");
|
||||
let dataLink = {
|
||||
source: dataLinks[dataLinks.length - 1],
|
||||
@ -594,17 +642,6 @@ export default {
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import "~dhtmlx-gantt/codebase/dhtmlxgantt.css";
|
||||
|
||||
// ::v-deep .gantt_cell{
|
||||
// width: 200px;
|
||||
// // border: 1px solid red;
|
||||
// /* 强制不换行 */
|
||||
// white-space: nowrap;
|
||||
// /* 文字用省略号代替超出的部分 */
|
||||
// text-overflow: ellipsis;
|
||||
// /* 匀速溢出内容,隐藏 */
|
||||
// overflow: hidden;
|
||||
// }
|
||||
::v-deep .gantt_tree_content {
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
@ -613,4 +650,5 @@ export default {
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
20
yarn.lock
20
yarn.lock
@ -4143,10 +4143,10 @@
|
||||
"integrity" "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw=="
|
||||
"version" "2.0.4"
|
||||
|
||||
"dhtmlx-gantt@^7.1.12":
|
||||
"integrity" "sha512-8xC/DbBR/jqy6bnTT+qc6uKZPdQwYqpw6U8LJRb2A9Uz0BdYvKCptVfXIQOERFOLEqjymSzbCu4z/OwmabuCrg=="
|
||||
"resolved" "https://registry.npmmirror.com/dhtmlx-gantt/-/dhtmlx-gantt-7.1.12.tgz"
|
||||
"version" "7.1.12"
|
||||
"dhtmlx-gantt@^7.1.13":
|
||||
"integrity" "sha512-PnVk6HI8LcOu1E6o9sJ5UpeWRiaXLnNa5t3i0oFPXPVkDrDyZdNr0KduryF45R7DWMSyMkxJ9RGJ+iUiqQCDhg=="
|
||||
"resolved" "https://registry.npmmirror.com/dhtmlx-gantt/-/dhtmlx-gantt-7.1.13.tgz"
|
||||
"version" "7.1.13"
|
||||
|
||||
"diffie-hellman@^5.0.0":
|
||||
"integrity" "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg=="
|
||||
@ -6267,6 +6267,18 @@
|
||||
"merge-stream" "^2.0.0"
|
||||
"supports-color" "^7.0.0"
|
||||
|
||||
"jquery-ui-dist@^1.13.2":
|
||||
"integrity" "sha512-oVDRd1NLtTbBwpRKAYdIRgpWVDzeBhfy7Gu0RmY6JEaZtmBq6kDn1pm5SgDiAotrnDS+RoTRXO6xvcNTxA9tOA=="
|
||||
"resolved" "https://registry.npmmirror.com/jquery-ui-dist/-/jquery-ui-dist-1.13.2.tgz"
|
||||
"version" "1.13.2"
|
||||
dependencies:
|
||||
"jquery" ">=1.8.0 <4.0.0"
|
||||
|
||||
"jquery@^3.6.3", "jquery@>=1.8.0 <4.0.0":
|
||||
"integrity" "sha512-bZ5Sy3YzKo9Fyc8wH2iIQK4JImJ6R0GWI9kL1/k7Z91ZBNgkRXE6U0JfHIizZbort8ZunhSI3jw9I6253ahKfg=="
|
||||
"resolved" "https://registry.npmmirror.com/jquery/-/jquery-3.6.3.tgz"
|
||||
"version" "3.6.3"
|
||||
|
||||
"js-base64@^2.1.9":
|
||||
"integrity" "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
|
||||
"resolved" "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user