From ed8c5f14ca3bc17dce63242d584ba37e140be0e5 Mon Sep 17 00:00:00 2001
From: jxj_yjl <1490736767@qq.com>
Date: Thu, 29 Jun 2023 18:37:42 +0800
Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E7=94=98=E7=89=B9=E5=9B=BE?=
=?UTF-8?q?=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 4 +-
.../progressManagement/ganttChart/index.vue | 896 ++++++++++++++++++
2 files changed, 898 insertions(+), 2 deletions(-)
create mode 100644 src/views/hz-project/progressManagement/ganttChart/index.vue
diff --git a/.env.development b/.env.development
index 8b7619c..6db3b59 100644
--- a/.env.development
+++ b/.env.development
@@ -2,9 +2,9 @@
NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用)
-# VITE_API_URL = 'http://192.168.34.155:6688'
+VITE_API_URL = 'http://192.168.34.155:6688'
VITE_WPAPI_URL = "http://182.90.224.147:8081"
-VITE_API_URL = "http://182.90.224.147:9013"
+# VITE_API_URL = "http://182.90.224.147:9013"
# 上传
# VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
diff --git a/src/views/hz-project/progressManagement/ganttChart/index.vue b/src/views/hz-project/progressManagement/ganttChart/index.vue
new file mode 100644
index 0000000..aa46c2f
--- /dev/null
+++ b/src/views/hz-project/progressManagement/ganttChart/index.vue
@@ -0,0 +1,896 @@
+
+
+
+
+
+
+
+
分部分项工程名称
+
开始日期
+
完成日期
+
+
+
+
+
+
+
{{ p.pName }}
+
{{ p.startTime }}
+
{{ p.endTime }}
+
+
+
+
+
+
{{ child.pName }}
+
{{ child.startTime }}
+
{{ child.endTime }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From b76d7b030093416fa10e30945122445f5aace36f Mon Sep 17 00:00:00 2001
From: jxj_yjl <1490736767@qq.com>
Date: Fri, 30 Jun 2023 09:11:15 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E7=94=98=E7=89=B9=E5=9B=BE?=
=?UTF-8?q?=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=802?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../progressManagement/ganttChart/index.vue | 454 ++++--------------
1 file changed, 90 insertions(+), 364 deletions(-)
diff --git a/src/views/hz-project/progressManagement/ganttChart/index.vue b/src/views/hz-project/progressManagement/ganttChart/index.vue
index aa46c2f..2c41d8a 100644
--- a/src/views/hz-project/progressManagement/ganttChart/index.vue
+++ b/src/views/hz-project/progressManagement/ganttChart/index.vue
@@ -22,7 +22,7 @@
{{ date }}
@@ -62,7 +62,12 @@
{{ child.endTime }}
{
+ if (el) {
+ const b = va.split("@|@");
+
+ const dataItem = {
+ refData: va,
+ item: el
+ };
+
+ if (itemRefs.length == 0) {
+ const itemList = [];
+ itemList.push(dataItem);
+ const data = {
+ name: b[0],
+ itemS: itemList
+ };
+ itemRefs.push(data);
+ } else {
+ const isCheck = true;
+ for (let index = 0; index < itemRefs.length; index++) {
+ const element = itemRefs[index];
+ if (element.name === b) {
+ isCheck = false;
+ element.itemS.push(dataItem);
+ break;
+ }
+ }
+ if (isCheck) {
+ const itemList = [];
+ itemList.push(dataItem);
+ const data = {
+ name: b[0],
+ itemS: itemList
+ };
+ itemRefs.push(data);
+ }
+ }
+ }
+};
const scrollLeft = ref(0);
const scrollTimer = ref(0);
const openedIndex = ref(9999);
-const refList = ref(""); // 存放dom节点的数组的 获取到的dom节点都在这里
let tooltipsStyle = reactive({
display: "none",
left: 0,
@@ -497,7 +209,6 @@ let tooltipsStyle = reactive({
onMounted(() => {
setGantts();
console.log(getDays("2022/09"), "月日期分布");
- console.log("refList:", refList.value);
});
const getGanttStyle = (project: any) => {
console.log("进入 getGanttStyle --- ", project);
@@ -507,34 +218,49 @@ const getGanttStyle = (project: any) => {
const endArr = endTime.split("/");
let startRef = null;
let endRef = null;
+ // 抹灰工程1-1-2022/09/03
- if (!(startArr[2] % 2)) {
+ const a = !(startArr[2] % 2);
+ console.log(a, ":!(startArr[2] % 2:");
+ if (a) {
const day = startArr[2] - 1;
startArr[2] = day < 10 ? "0" + day : day;
startTime = startArr.join("/");
- console.log(startTime, "startTime----------");
}
+ const b = !(endArr[2] % 2);
+ console.log(a, ":!(endArr[2] % 2):");
if (!(endArr[2] % 2)) {
const day = endArr[2] - 1;
endArr[2] = day < 10 ? "0" + day : day;
endTime = endArr.join("/");
- console.log(endTime, "endTime ------------", pName);
}
- startRef = [`${pName}-${startTime}`][0]; //此项需看下是否生效
+
+ console.log(dateList, "endTime ------------", itemRefs.length);
+ for (let index = 0; index < itemRefs.length; index++) {
+ const data = itemRefs[index];
+
+ if (data.name === pName) {
+ for (let index = 0; index < data.itemS.length; index++) {
+ const element = data.itemS[index];
+ if (element.refData === pName + "@|@" + startTime) {
+ startRef = data.itemS[index].item;
+ }
+
+ if (element.refData === pName + "@|@" + endTime) {
+ endRef = data.itemS[index].item;
+ }
+ }
+ }
+ }
const startLeft = startRef.offsetLeft;
- endRef = [`${pName}-${endTime}`][0]; //此项需看下是否生效
+ const endWidth = endRef.offsetWidth;
- const endWidth = endRef.offsetWidth; //此项需看下是否生效
- console.log("endWidth--------", endWidth);
+ const endLeft = endRef.offsetLeft;
+ const ganttWidth = endLeft - startLeft + endWidth;
- const endLeft = endRef.offsetLeft; //此项需看下是否生效
- console.log("endLeft--------", endLeft);
- const ganttWidth = endLeft - startLeft + endWidth; //此项需看下是否生效
- console.log("ganttWidth--------", ganttWidth);
-
- return { left: startLeft + "px", width: ganttWidth + "px" }; //此项需看下是否生效
+ return { left: startLeft + "px", width: ganttWidth + "px" };
};
const setGantts = () => {
const configGantts = (projects: any) => {