qinzhipeng_v 5 år sedan
förälder
incheckning
d11c066bba

+ 26 - 26
src/views/projectManage/iteration/components/iterationTable.vue

@@ -10,7 +10,7 @@
       show-overflow-tooltip="true"
       row-key="id"
     >
-      <el-table-column
+      <!-- <el-table-column
         width="80"
         align="center"
       >
@@ -21,7 +21,7 @@
             </div>
           </el-tooltip>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         prop="type"
         label="类型"
@@ -87,7 +87,7 @@
   </div>
 </template>
 <script>
-import Sortable from 'sortablejs'
+// import Sortable from 'sortablejs'
 import moment from 'moment'
 import 'moment/locale/zh-cn'
 import imgUrl from '@/assets/麻将@2x.png'
@@ -143,20 +143,20 @@ export default {
     }
   },
   mounted() {
-    this.rowDrop()
+    // this.rowDrop()
   },
   methods: {
-    rowDrop() {
-      const tbody = document.querySelector(`#schedule-${this.id} tbody`)
-      const _this = this
-      Sortable.create(tbody, {
-        onEnd({ newIndex, oldIndex }) {
-          const currRow = _this.scheduleList.splice(oldIndex, 1)[0]
-          _this.scheduleList.splice(newIndex, 0, currRow)
-          _this.sortForTask(_this.scheduleList.map(item => item.id))
-        }
-      })
-    },
+    // rowDrop() {
+    //   const tbody = document.querySelector(`#schedule-${this.id} tbody`)
+    //   const _this = this
+    //   Sortable.create(tbody, {
+    //     onEnd({ newIndex, oldIndex }) {
+    //       const currRow = _this.scheduleList.splice(oldIndex, 1)[0]
+    //       _this.scheduleList.splice(newIndex, 0, currRow)
+    //       _this.sortForTask(_this.scheduleList.map(item => item.id))
+    //     }
+    //   })
+    // },
     async sortForTask(arr) {
       const res = await sortForTask(this.id, arr)
       if (res.code === 200) {
@@ -230,17 +230,17 @@ export default {
     margin-bottom: 10px;
   }
 }
-.sortable-tip {
-  height: 26px;
-  width: 15px;
-  border-radius:2px;
-  margin: auto;
-  justify-content: center;
-  align-items: center;
-  img {
-    width: 8px;
-  }
-}
+// .sortable-tip {
+//   height: 26px;
+//   width: 15px;
+//   border-radius:2px;
+//   margin: auto;
+//   justify-content: center;
+//   align-items: center;
+//   img {
+//     width: 8px;
+//   }
+// }
 </style>
 <style>
 .el-tooltip__popper.is-dark {

+ 31 - 33
src/views/projectManage/iteration/components/requiredTable.vue

@@ -67,9 +67,9 @@
       show-overflow-tooltip="true"
       @selection-change="handleSelectionChange"
     >
-      <!-- <el-table-column width="35">
+      <el-table-column width="35">
         <img style="display: inline-block; width: 8px; vertical-align: middle;" :src="image_role">
-      </el-table-column> -->
+      </el-table-column>
       <el-table-column type="selection" min-width="40" align="center" />
       <el-table-column type="expand" width="40">
         <template slot="header">
@@ -155,11 +155,10 @@
 import '@/styles/PublicStyle/index.scss'
 import iterationDelete from '@/views/projectManage/iteration/components/delete.vue'
 import iterationTable from '@/views/projectManage/iteration/components/iterationTable.vue'
-// import Sortable from 'sortablejs'
+import Sortable from 'sortablejs'
 import { configShowTaskEnum } from '@/api/taskIndex'
-// import image_role from '@/assets/麻将@2x.png' // 排期表格移动
-import { iterationList, iterationRequire, iterationUpdateReqStatus, iterationChangeIteration } from '@/api/iteration.js'
-// import { iterationList, iterationRequire, iterationUpdateReqStatus, iterationOrder, iterationChangeIteration } from '@/api/iteration.js'
+import image_role from '@/assets/麻将@2x.png' // 表格移动
+import { iterationList, iterationRequire, iterationUpdateReqStatus, iterationOrder, iterationChangeIteration } from '@/api/iteration.js'
 import { showRequirementEnum, updateRequirementStatus } from '@/api/requirement.js'
 export default {
   components: {
@@ -180,7 +179,7 @@ export default {
       allChange: false, // 是否全展开
       expandArr: [], // 展开行数组
       taskScheduleEvent: [], // 排期类型
-      // image_role: image_role, // 排期表格移动
+      image_role: image_role, // 表格移动
       dialogVisibleDelete: false, // 移除迭代
       requiredArray: [], // 需求状态
       showHeader: true, // 是否显示表头
@@ -202,7 +201,7 @@ export default {
   mounted() {
     this.iteratioFilter()
     this.SearchIteration()
-    // this.rowDrop()
+    this.rowDrop()
   },
   methods: {
     async iteratioFilter() {
@@ -304,32 +303,31 @@ export default {
       val.length === 0 ? this.showHeader = true : this.showHeader = false
       this.selectedData = val
       val.length === this.RequirementSet.length ? this.checkAlls = true : this.checkAlls = false
-    }
-
+    },
     // 行拖拽
-    // rowDrop() {
-    //   const tbody = document.querySelector('.el-table__body-wrapper tbody')
-    //   const _this = this
-    //   Sortable.create(tbody, {
-    //     onEnd({ newIndex, oldIndex }) {
-    //       const currRow = _this.RequirementSet.splice(oldIndex, 1)[0]
-    //       _this.RequirementSet.splice(newIndex, 0, currRow)
-    //       const obj = {
-    //         id: []
-    //       }
-    //       _this.RequirementSet.map(item => {
-    //         obj.id.push(item.id)
-    //       })
-    //       console.log(_this.iterationId, 'cdcscdsc')
-    //       iterationOrder(obj.id, _this.iterationId).then(res => {
-    //         if (res.code === 200) {
-    //           _this.$message.success(res.msg)
-    //           _this.iteratioFilter()
-    //         }
-    //       })
-    //     }
-    //   })
-    // }
+    rowDrop() {
+      const tbody = document.querySelector('.el-table__body-wrapper tbody')
+      const _this = this
+      Sortable.create(tbody, {
+        onEnd({ newIndex, oldIndex }) {
+          const currRow = _this.RequirementSet.splice(oldIndex, 1)[0]
+          _this.RequirementSet.splice(newIndex, 0, currRow)
+          const obj = {
+            id: []
+          }
+          _this.RequirementSet.map(item => {
+            obj.id.push(item.id)
+          })
+          console.log(_this.iterationId, 'cdcscdsc')
+          iterationOrder(obj.id, _this.iterationId).then(res => {
+            if (res.code === 200) {
+              _this.$message.success(res.msg)
+              _this.iteratioFilter()
+            }
+          })
+        }
+      })
+    }
   }
 }
 </script>