From 5c133dd7c3b9e1787dcd3be4f0f578a9d8bef540 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 15 三月 2023 15:53:27 +0800
Subject: [PATCH] 1.甘特图时间分割线改动

---
 src/lib/v-gantt-chart/lib/components/time-line/index.vue |   17 ++++++++++++++---
 src/lib/v-gantt-chart/lib/gantt.scss                     |    3 +++
 src/lib/v-gantt-chart/lib/components/blocks/index.vue    |   12 ++++++++++--
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/lib/v-gantt-chart/lib/components/blocks/index.vue b/src/lib/v-gantt-chart/lib/components/blocks/index.vue
index 0cc6c00..41ec69a 100644
--- a/src/lib/v-gantt-chart/lib/components/blocks/index.vue
+++ b/src/lib/v-gantt-chart/lib/components/blocks/index.vue
@@ -1,6 +1,8 @@
 <template>
   <div class="gantt-blocks"
-       :style="{height:blockHeight+'px'}">
+       :style="blocksStyle">
+<!--    {{blocksStyle}}-->
+<!--       :style="{height:blockHeight+'px'}">-->
     <div class="gantt-block gantt-block-top-space"
          :style="{height:calTopSpace()+'px'}">
     </div>
@@ -72,6 +74,12 @@
         return arrayKeys;
       }
       return ["gtArray"];
+    },
+    blocksStyle() {
+      return {
+        backgroundSize: `${this.cellWidth}px ${this.cellHeight}px`,
+        height: `${this.blockHeight}px`
+      };
     },
     blockStyle() {
       return {
@@ -153,4 +161,4 @@
     }
   }
 };
-</script>
\ No newline at end of file
+</script>
diff --git a/src/lib/v-gantt-chart/lib/components/time-line/index.vue b/src/lib/v-gantt-chart/lib/components/time-line/index.vue
index 5e43426..4998893 100644
--- a/src/lib/v-gantt-chart/lib/components/time-line/index.vue
+++ b/src/lib/v-gantt-chart/lib/components/time-line/index.vue
@@ -12,6 +12,7 @@
       <div
         class="gantt-timeline-day "
         :style="heightStyle"
+
       >
         {{ day.format('YYYY-MM-DD') }}
         {{ getDayMy(day.format('YYYY-MM-DD')) }}
@@ -19,13 +20,18 @@
       <div
         class="gantt-timeline-scale"
         :style="heightStyle"
-        style="border-right: 1px solid #eee"
+
+
       >
+<!--        style="border-right: 1px solid #eee"-->
         <div
           v-for="(hour,ind) in getTimeScales(day)"
           :key="ind"
           :style="cellWidthStyle"
+
+
         >
+<!--          style="border-right: 1px solid #eee;"-->
           {{ hour }}
           <!-- <span v-if="hour !='01' ">{{hour}}</span> -->
         </div>
@@ -85,7 +91,12 @@
     },
     cellWidthStyle() {
       return {
-        width: `${this.cellWidth}px`
+        width: `${this.cellWidth}px`,
+
+        // width: `${this.cellWidth/2}px`,
+
+
+        // marginLeft:`${this.cellWidth/2}px`
       }
     },
     heightStyle() {
@@ -165,7 +176,7 @@
 </script>
 <style lang="scss" scoped>
 .gantt-timeline-day {
-  border-right: 1px solid #ebeef5;
+  //border-right: 1px solid #ebeef5;
   border-bottom: 1px solid #ebeef5;
   //background: rgb(245, 245, 245);
   background: #fff;
diff --git a/src/lib/v-gantt-chart/lib/gantt.scss b/src/lib/v-gantt-chart/lib/gantt.scss
index 1723feb..3e5fd86 100644
--- a/src/lib/v-gantt-chart/lib/gantt.scss
+++ b/src/lib/v-gantt-chart/lib/gantt.scss
@@ -121,6 +121,9 @@
   }
 
   &-blocks {
+    border: 1px solid #eee;
+    background-image: linear-gradient(rgba(236, 236, 236) 1px, transparent 0),
+    linear-gradient(90deg, rgba(236, 236, 236) 1px, transparent 0);
     &-wrapper {
       overflow: hidden;
     }

--
Gitblit v1.9.3