Explorar el Código

甘特图框架新增新增功能

yuhan hace 1 año
padre
commit
67442c7728
Se han modificado 1 ficheros con 10 adiciones y 6 borrados
  1. 10 6
      itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

+ 10 - 6
itdmWeb/src/views/module-iTDM/itdmGongdanMaster/uGantt.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <uGantt :configColumns="configColumns" :taskLists="taskLists" ref="uGantt" @dbclick="rowDblclick">
+    <uGantt :configColumns="configColumns" :taskLists="taskLists" ref="uGantt" @dbclick="rowDblclick" @addRow="addRow">
       <!-- 其他需要自定义的弹窗数据 -->
       <!-- 双击事件弹窗 -->
       <el-dialog title="修改" :visible.sync="dialogVisible" width="40%">
@@ -41,10 +41,10 @@ export default {
         { name: "start_date", label: "开始时间", width: 100, fixed: true, resize: true, align: "center" },
         { name: "end_date", label: "结束时间", width: 100, fixed: true, resize: true, align: "center" },
         // { name: "statusC", label: "状态", width: 60, fixed: true, resize: true, align: "center" },
-        // { name: "add", label:"", width: 30 }
+        { name: "add", label:"", width: 30 }
       ],
       // 注意:start_date(开始日期)和end_date(结束日期)和add(添加按钮)是固定死的参数名,不能更改
-      // 注意:id和parentId也是固定死的参数名,如果需要可以改组件
+      // 注意:id和pid也是固定死的参数名,如果需要可以改组件
       // id、content: 也是固定死的,如果需要可以改组件
       taskLists: [{
           id: 0,
@@ -122,7 +122,7 @@ export default {
           start_date: '2023-07-05',
           end_date: '2023-07-08',
           statusC: '1',
-          parentId: 2
+          pid: 2
         }, {
           id: 23,
           testItems: 'ceshi3',
@@ -130,7 +130,7 @@ export default {
           start_date: '2023-07-02',
           end_date: '2023-07-04',
           statusC: '1',
-          parentId: 2
+          pid: 2
         },
         {
           id: 22,
@@ -139,7 +139,7 @@ export default {
           start_date: '2023-07-06',
           end_date: '2023-07-10',
           statusC: '1',
-          parentId: 2
+          pid: 2
         }
       ],
       // 弹窗
@@ -162,6 +162,10 @@ export default {
       this.currentDbEdit = this.taskLists[this.currentIndex]
       this.dialogVisible = true
     },
+    // 新增事件
+    addRow(row, index){
+      console.log(row, index)
+    },
     cancel(){
       this.currentDbEdit = {}
       this.dialogVisible = false