瀏覽代碼

fiex:修复BUG

Tang 3 年之前
父節點
當前提交
3b51e852f0
共有 3 個文件被更改,包括 201 次插入27 次删除
  1. 二進制
      src/assets/404_images/wuyuxaog.png
  2. 49 9
      src/components/tableList.vue
  3. 152 18
      src/views/Marketing/goods/courseInquiryList/index.vue

二進制
src/assets/404_images/wuyuxaog.png


+ 49 - 9
src/components/tableList.vue

@@ -65,11 +65,7 @@
               </div>
             </el-checkbox-group>
           </div>
-          <el-button
-            style="margin-left: 10px"
-            size="medium"
-            slot="reference"
-            v-if="false"
+          <el-button style="margin-left: 10px" size="medium" slot="reference"
             >自定义列</el-button
           >
         </el-popover>
@@ -129,7 +125,9 @@
       >
         <template slot-scope="scope">
           <div class="imgboxsq" v-if="item.scope === 'img'">
+            <img style="height: 60px; width: 60px" v-if="!scope.row[item.prop]" src="@/assets/404_images/wuyuxaog.png" alt="">
             <el-image
+            v-else
               class="el_images"
               lazy
               :src="$methodsTools.splitImgHost(scope.row[item.prop])"
@@ -248,6 +246,11 @@
               ? "回放"
               : ""
           }}</span>
+          <span v-else-if="item.scope === 'liveAndUrl'">{{
+            scope.row[item.prop] == 2
+              ? scope.row[item.prop2]
+              : scope.row[item.prop1]
+          }}</span>
           <span v-else-if="item.scope === 'ggType'">{{
             Number(scope.row[item.prop]) === 1
               ? "学习中心"
@@ -1042,6 +1045,11 @@
           >
             {{ getSimpleText(scope.row[item.prop]) }}
           </div>
+          <div
+            v-else-if="item.scope === 'editInfoHTMLs'"
+          >
+            {{ getSimpleText(scope.row[item.prop]) }}
+          </div>
           <span v-else-if="item.scope === 'minute'">{{
             numTimeminute(scope.row[item.prop])
           }}</span>
@@ -1592,6 +1600,13 @@ export default {
   },
   mounted() {},
   methods: {
+    /**
+     * 清除多选框
+     */
+    clearMoreActive() {
+      this.allCheckData = [];
+      this.$refs.pagerset.clearSelection();
+    },
     /**
      * @param {Array} 学员数据— 学员管理-所购商品
      */
@@ -2069,6 +2084,10 @@ export default {
           this.checkedCities.push(item.label);
         }
       });
+      this.tableSet = [];
+      this.$nextTick(() => {
+        this.tableSet = JSON.parse(this.inittableSet);
+      });
       if (this.checkedCities.length === 0) {
         this.isIndeterminate = false;
       } else if (this.checkedCities.length === this.cities.length) {
@@ -2081,12 +2100,12 @@ export default {
     },
     //自定义列全选按钮触发
     handleCheckAllChange(val) {
-      console.log(val, 123);
       this.checkedCities = val ? this.cities : [];
       this.isIndeterminate = false;
       if (val) {
-        this.tableSet.forEach((item, index) => {
-          item.hidden = true;
+        this.tableSet = [];
+        this.$nextTick(() => {
+          this.tableSet = JSON.parse(this.inittableSet);
         });
       } else {
         this.tableSet.forEach((item, index) => {
@@ -2096,17 +2115,28 @@ export default {
     },
     // 勾选自定义列子选项
     handleCheckedCitiesChange(value) {
+      var copyTable = JSON.parse(JSON.stringify(this.tableSet));
       let checkedCount = value.length;
       this.checkAll = checkedCount === this.cities.length;
       this.isIndeterminate =
         checkedCount > 0 && checkedCount < this.cities.length;
+      this.tableSet = [];
+      this.$nextTick(() => {
+        this.tableSet = copyTable;
+      });
     },
     checkboxChange(v, e) {
-      this.tableSet.forEach((item) => {
+      var copyTable = JSON.parse(JSON.stringify(this.tableSet));
+      copyTable.forEach((item) => {
         if (item.label === v) {
           item.hidden = e;
         }
       });
+
+      this.tableSet = [];
+      this.$nextTick(() => {
+        this.tableSet = copyTable;
+      });
     },
     //自定义列重置
     initVue() {
@@ -2131,6 +2161,11 @@ export default {
         this.tableSet.unshift(this.tableSet.splice(index, 1)[0]);
         this.cities.unshift(this.cities.splice(index, 1)[0]);
       }
+      var copyTable = JSON.parse(JSON.stringify(this.tableSet));
+      this.tableSet = [];
+      this.$nextTick(() => {
+        this.tableSet = copyTable;
+      });
     },
     // 上移
     upMove(option, index) {
@@ -2149,6 +2184,11 @@ export default {
         this.tableSet.push(this.tableSet.shift());
         this.cities.push(this.cities.shift());
       }
+      var copyTable = JSON.parse(JSON.stringify(this.tableSet));
+      this.tableSet = [];
+      this.$nextTick(() => {
+        this.tableSet = copyTable;
+      });
     },
     //跳转页面
     jumpPage(options) {

+ 152 - 18
src/views/Marketing/goods/courseInquiryList/index.vue

@@ -82,9 +82,9 @@
                   <span :style="activeId === items.onlyId ? 'color:red;' : ''">
                     {{ items.menuName }}
                   </span>
-                  <span v-if="items.type === 3" class="itemsty"
-                    >{{ $methodsTools.secondToDate(items.durationTime,false)}}</span
-                  >
+                  <span v-if="items.type === 3" class="itemsty">{{
+                    $methodsTools.secondToDate(items.durationTime, false)
+                  }}</span>
                 </div>
                 <template v-if="items.checked">
                   <div
@@ -112,9 +112,9 @@
                       >
                         {{ its.menuName }}
                       </span>
-                      <span v-if="its.type === 3" class="itemsty"
-                        >{{ $methodsTools.secondToDate(its.durationTime,false)}}</span
-                      >
+                      <span v-if="its.type === 3" class="itemsty">{{
+                        $methodsTools.secondToDate(its.durationTime, false)
+                      }}</span>
                     </div>
                     <template v-if="its.checked">
                       <div
@@ -134,9 +134,12 @@
                           >
                             {{ itschild.menuName }}
                           </span>
-                          <span class="itemsty"
-                            >{{ $methodsTools.secondToDate(itschild.durationTime,false)}}</span
-                          >
+                          <span class="itemsty">{{
+                            $methodsTools.secondToDate(
+                              itschild.durationTime,
+                              false
+                            )
+                          }}</span>
                         </div>
                       </div>
                     </template>
@@ -158,6 +161,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { login } from "../../../../api/login";
 export default {
   name: "CourseInquiryList",
   components: { searchBoxNew, tableList, pagination },
@@ -193,8 +197,8 @@ export default {
           edu: "educationTypeId",
         },
         {
-          prop: "goodsName",
-          placeholder: "请输入商品名称",
+          prop: "searchKey",
+          placeholder: "请输入商品编码/商品名称",
         },
       ],
       formData: {
@@ -249,7 +253,7 @@ export default {
           label: "视频节数量",
           prop: "sectionNum",
           hidden: true,
-          width:'100px'
+          width: "100px",
         },
         {
           label: "学习有效期",
@@ -341,12 +345,142 @@ export default {
      * 点击详情
      */
     msgInfo(option) {
-      this.$api.obtainCourseSgoodsId(option.goodsId).then((res) => {
-        res.rows.forEach((item) => {
-          item.checked = false;
-        });
-        this.courseList = res.rows;
-        this.dialogVisible = true;
+      this.$api.obtainCourseSgoodsId(option.goodsId).then(async (res) => {
+        if (res.rows.length) {
+          res.rows.forEach((item, index) => {
+            item.checked = false;
+          });
+          this.courseList = res.rows;
+          await this.autoGetCourseInfos(res.rows[0], 0);
+          this.dialogVisible = true;
+        } else {
+          this.$message.warning("该商品暂无课程");
+          return;
+        }
+      });
+    },
+    /**
+     * 自动播放第一个视频
+     */
+    autoGetCourseInfos(option, int) {
+      return new Promise((resolve, reject) => {
+        this.$api
+          .inquireCoursemenuListS({ courseId: option.courseId })
+          .then((res) => {
+            res.rows.forEach((item) => {
+              if (item.type !== 3) {
+                item.checked = false;
+              }
+              if (item.type === 3) {
+                item.onlyId = `${option.courseId}-0-0-${item.menuId}`;
+              }
+            });
+            this.$set(this.courseList[int], "children", res.rows);
+            this.$set(this.courseList[int], "checked", true);
+            if (this.courseList[0].children.length) {
+              switch (this.courseList[0].children[0].type) {
+                case 1:
+                  this.$api
+                    .inquireCourseListmodulechapter(
+                      this.courseList[0].children[0].menuId
+                    )
+                    .then((resz) => {
+                      resz.data.forEach((item) => {
+                        if (item.type !== 3) {
+                          item.checked = false;
+                          item.type = 2;
+                          item.courseId =
+                            this.courseList[0].children[0].courseId;
+                          item.menuName = item.name;
+                        }
+                      });
+                      this.$set(
+                        this.courseList[int].children[0],
+                        "children",
+                        resz.data
+                      );
+                      this.$set(
+                        this.courseList[int].children[0],
+                        "checked",
+                        true
+                      );
+                      if (this.courseList[int].children[0].children.length) {
+                        this.$api
+                          .inquireCoursechaptersectionlist(
+                            this.courseList[0].children[0].children[0].chapterId
+                          )
+                          .then((result) => {
+                            result.data.forEach((item) => {
+                              item.type = 3;
+                              item.menuName = item.name;
+                              item.onlyId = `${this.courseList[0].children[0].children[0].courseId}-${this.courseList[0].children[0].children[0].moduleId}-${this.courseList[0].children[0].children[0].chapterId}-${item.sectionId}`;
+                            });
+                            this.$set(
+                              this.courseList[int].children[0].children[0],
+                              "children",
+                              result.data
+                            );
+                            this.$set(
+                              this.courseList[int].children[0].children[0],
+                              "checked",
+                              true
+                            );
+                            if (
+                              this.courseList[int].children[0].children[0]
+                                .children.length
+                            ) {
+                              this.activeId =
+                                this.courseList[0].children[0].children[0].children[0].onlyId;
+                              this.initVideo(
+                                this.courseList[0].children[0].children[0]
+                                  .children[0]
+                              );
+                            }
+                          });
+                      }
+                    });
+                  break;
+                case 2:
+                  this.$api
+                    .inquireCoursechaptersectionlist(
+                      this.courseList[0].children[0].menuId
+                    )
+                    .then((result) => {
+                      result.data.forEach((item) => {
+                        item.type = 3;
+                        item.menuName = item.name;
+                        item.onlyId = `${this.courseList[0].children[0].courseId}-0-${this.courseList[0].children[0].menuId}-${item.sectionId}`;
+                      });
+                      this.$set(
+                        this.courseList[int].children[0],
+                        "children",
+                        result.data
+                      );
+                      this.$set(
+                        this.courseList[int].children[0],
+                        "checked",
+                        true
+                      );
+                      if (this.courseList[0].children[0].children.length) {
+                        this.activeId =
+                          this.courseList[0].children[0].children[0].onlyId;
+                        this.initVideo(
+                          this.courseList[0].children[0].children[0]
+                        );
+                      }
+                    });
+                  break;
+                case 3:
+                  this.activeId = this.courseList[0].children[0].onlyId;
+                  this.initVideo(this.courseList[0].children[0]);
+                  break;
+
+                default:
+                  break;
+              }
+            }
+            resolve();
+          });
       });
     },
     /**