wangfei 6 years ago
parent
commit
601ff47fb5
1 changed files with 13 additions and 3 deletions
  1. 13
    3
      src/pages/system/cmsManager/majorProjects/edit.vue

+ 13
- 3
src/pages/system/cmsManager/majorProjects/edit.vue View File

151
       <div>
151
       <div>
152
         <el-table
152
         <el-table
153
           ref="courseTable"
153
           ref="courseTable"
154
-          :data="courses.list"
154
+          :data="coursesList"
155
           tooltip-effect="dark"
155
           tooltip-effect="dark"
156
           stripe
156
           stripe
157
           @selection-change="handleSelectionChange"
157
           @selection-change="handleSelectionChange"
260
         this.detailimgs = val
260
         this.detailimgs = val
261
       }
261
       }
262
     },
262
     },
263
+    coursesList () {
264
+      return (this.courses.list || []).map(x => {
265
+        return {
266
+          CourseId: x.CourseId,
267
+          CourseName: x.CourseName,
268
+          BeginDate: x.BeginDate,
269
+          EndDate: x.BeginDate
270
+        }
271
+      })
272
+    },
263
   },
273
   },
264
   methods: {
274
   methods: {
265
     ...mapCaseActions([
275
     ...mapCaseActions([
316
     },
326
     },
317
     toggleSelection (rows) {
327
     toggleSelection (rows) {
318
       if (rows) {
328
       if (rows) {
319
-        rows.map(row => {
329
+        rows.forEach(row => {
320
           this.$refs.courseTable.toggleRowSelection(row)
330
           this.$refs.courseTable.toggleRowSelection(row)
321
         })
331
         })
322
       } else {
332
       } else {
336
     coursesShow () {
346
     coursesShow () {
337
       this.selCourseVisible = true
347
       this.selCourseVisible = true
338
       setTimeout(() => {
348
       setTimeout(() => {
339
-        this.toggleSelection(this.detail.Courses)
349
+        this.toggleSelection(this.coursesList.filter(x => (this.detail.Courses || []).filter(y => y.CourseId === x.CourseId).length > 0))
340
       }, 30)
350
       }, 30)
341
     },
351
     },
342
     handleSelectionChange (val) {
352
     handleSelectionChange (val) {