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) => {