Bläddra i källkod

add:新增紧急需求

Tang 3 år sedan
förälder
incheckning
daae1fad10
42 ändrade filer med 3074 tillägg och 785 borttagningar
  1. 246 0
      src/components/bankMsg/index.vue
  2. 2 2
      src/components/questionBank.vue
  3. 18 4
      src/components/tableList.vue
  4. 466 0
      src/components/testPaperPreview/index.vue
  5. 8 0
      src/newApi/bankChapter.js
  6. 8 0
      src/newApi/festival.js
  7. 8 0
      src/newApi/gigChapter.js
  8. 8 0
      src/newApi/paper.js
  9. 8 0
      src/newApi/paperquestion.js
  10. 4 0
      src/store/getters.js
  11. 3 1
      src/store/index.js
  12. 47 0
      src/store/modules/dataCache.js
  13. 1 5
      src/views/2Cport/adSlotManagement/tab2.vue
  14. 5 0
      src/views/Marketing/goods/commodityManageMent/add/index.vue
  15. 175 96
      src/views/resource/bankManagement/chapterVolumeManagement/add/index.vue
  16. 128 0
      src/views/resource/bankManagement/chapterVolumeManagement/addChapterjs.vue
  17. 197 104
      src/views/resource/bankManagement/chapterVolumeManagement/edit/index.vue
  18. 1 0
      src/views/resource/bankManagement/chapterVolumeManagement/index.vue
  19. 98 14
      src/views/resource/bankManagement/testPaperManagement/addPaper/topicAddPaper/index.vue
  20. 18 6
      src/views/resource/bankManagement/testPaperManagement/editPaper/baseEditPaper/index.vue
  21. 10 0
      src/views/resource/bankManagement/testPaperManagement/editPaper/index.vue
  22. 111 24
      src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/index.vue
  23. 95 0
      src/views/resource/bankManagement/testPaperManagement/excelPop.vue
  24. 21 25
      src/views/resource/bankManagement/testPaperManagement/index.vue
  25. 0 0
      src/views/resource/bankManagement/testPaperManagement/wordPop.vue
  26. 51 14
      src/views/resource/bankManagement/topicManagement/index.vue
  27. 175 97
      src/views/resource/bankManagement/volumeManagement/add/index.vue
  28. 128 0
      src/views/resource/bankManagement/volumeManagement/addChapterjs.vue
  29. 180 100
      src/views/resource/bankManagement/volumeManagement/edit/index.vue
  30. 69 5
      src/views/resource/videoManagement/chapter/add/index.vue
  31. 105 34
      src/views/resource/videoManagement/chapter/edit/index.vue
  32. 2 1
      src/views/resource/videoManagement/chapter/index.vue
  33. 5 6
      src/views/resource/videoManagement/courseManagement/basicInfoAdd/index.vue
  34. 5 5
      src/views/resource/videoManagement/courseManagement/basicInfoEdit/index.vue
  35. 120 2
      src/views/resource/videoManagement/courseManagement/chapterContent/index.vue
  36. 23 9
      src/views/resource/videoManagement/courseManagement/editCourse/index.vue
  37. 19 19
      src/views/resource/videoManagement/courseManagement/index.vue
  38. 23 10
      src/views/resource/videoManagement/festival/edit/index.vue
  39. 1 0
      src/views/resource/videoManagement/festival/index.vue
  40. 173 98
      src/views/resource/videoManagement/moduleManagement/add/index.vue
  41. 129 0
      src/views/resource/videoManagement/moduleManagement/addChapter.vue
  42. 180 104
      src/views/resource/videoManagement/moduleManagement/edit/index.vue

+ 246 - 0
src/components/bankMsg/index.vue

@@ -0,0 +1,246 @@
+<template>
+  <div id="bankMsg">
+    <div class="dis_flex">
+      <span class="span_sty">题目内容:</span>
+      <div>
+        <div class="divPy" v-html="imgExiz(bankMsg.content)"></div>
+        <div v-if="bankMsg.type === 4">
+          <div
+            style="
+              background: #eee;
+              padding: 10px;
+              border-bottom: 1px solid #a4a4a4;
+            "
+            v-for="(its, inds) in JSON.parse(bankMsg.jsonStr)"
+            :key="inds"
+          >
+            <div class="dis_flex">
+              <span class="span_sty">题目类型:</span>
+              <div>
+                <span>{{ getTypeName(its.type) }}</span>
+              </div>
+            </div>
+            <div class="dis_flex">
+              <span class="span_sty">题目内容:</span>
+              <div>
+                <div class="divPy" v-html="imgExiz(its.content)"></div>
+              </div>
+            </div>
+            <div class="dis_flex" v-if="its.type !== 4 && its.type !== 5 && its.type !== 3">
+              <span class="span_sty">选项内容:</span>
+              <div>
+                <ul>
+                  <li
+                    v-for="(itemsxs, indexsxs) in its.optionsList"
+                    :key="indexsxs"
+                    style="margin-bottom: 10px"
+                  >
+                    {{ Gest(indexsxs + 1) }}:{{ itemsxs.content }}
+
+                    <el-image
+                      v-if="itemsxs.imgUrl"
+                      style="width: 24px; height: 24px; vertical-align: middle"
+                      :src="$methodsTools.splitImgHost(itemsxs.imgUrl)"
+                      :preview-src-list="[
+                        $methodsTools.splitImgHost(itemsxs.imgUrl),
+                      ]"
+                    >
+                    </el-image>
+                  </li>
+                </ul>
+              </div>
+            </div>
+            <div class="dis_flex" v-if="its.type !== 5">
+              <span class="span_sty">正确答案:</span>
+              <div>
+                <span v-if="its.type === 3">
+                  {{ its.answerQuestion == 1 ? "正确" : "错误" }}
+                </span>
+                <span v-else>
+                  {{ getDictChanges(its.answerQuestion) }}
+                </span>
+              </div>
+            </div>
+            <div class="dis_flex">
+              <span class="span_sty">答案解析:</span>
+              <div>
+                <div v-html="imgExiz(its.analysisContent)"></div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="dis_flex" v-if="bankMsg.type !== 4 && bankMsg.type !== 5 && bankMsg.type !== 3">
+      <span class="span_sty">选项内容:</span>
+      <div>
+        <ul>
+          <li
+            v-for="(items, indexs) in JSON.parse(bankMsg.jsonStr)"
+            :key="indexs"
+            style="margin-bottom: 10px"
+          >
+            {{ Gest(indexs + 1) }}:{{ items.content }}
+
+            <div style="margin:10px 0px;">
+              <el-image
+                v-if="items.imgUrl"
+                style="max-width: 100%; max-height: 200px; vertical-align: middle"
+                :src="$methodsTools.splitImgHost(items.imgUrl)"
+                :preview-src-list="[$methodsTools.splitImgHost(items.imgUrl)]"
+              >
+              </el-image>
+            </div>
+          </li>
+        </ul>
+      </div>
+    </div>
+    <div class="dis_flex" v-if="bankMsg.type !== 5 && bankMsg.type !== 4">
+      <span class="span_sty">正确答案:</span>
+      <div>
+        <span v-if="bankMsg.type === 3">
+          {{ bankMsg.answerQuestion == 1 ? "正确" : "错误" }}
+        </span>
+        <span v-else>
+          {{ getDictChanges(bankMsg.answerQuestion) }}
+        </span>
+      </div>
+    </div>
+    <div class="dis_flex" v-if="bankMsg.type !== 4">
+      <span class="span_sty">答案解析:</span>
+      <div><div v-html="imgExiz(bankMsg.analysisContent)"></div></div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["bankMsg"],
+  data() {
+    return {};
+  },
+  computed: {
+    /**
+     * 题目类型转换名称
+     */
+    getTypeName: function () {
+      return function (type) {
+        let typeName = "";
+        switch (type) {
+          case 1:
+            typeName = "单选题";
+            break;
+          case 2:
+            typeName = "多选题";
+            break;
+          case 3:
+            typeName = "判断题";
+            break;
+          case 4:
+            typeName = "案例题";
+            break;
+          case 5:
+            typeName = "简答题";
+            break;
+
+          default:
+            break;
+        }
+        return typeName;
+      };
+    },
+
+    imgExiz: function () {
+      return function (vms) {
+        if (!vms) {
+          return vms;
+        } else {
+          var ast1 = vms.replace(/<p/gi, '<p style="margin:0px;"');
+          var ast = ast1.replace(/<img/gi, '<img style="max-width:100%;"');
+          return ast;
+        }
+      };
+    },
+  },
+  methods: {
+    /**
+     * 选项转换
+     */
+    Gest(ints) {
+      var int = parseInt(ints);
+      var ast = "";
+      switch (int) {
+        case 1:
+          ast = "A";
+          break;
+        case 2:
+          ast = "B";
+          break;
+        case 3:
+          ast = "C";
+          break;
+        case 4:
+          ast = "D";
+          break;
+        case 5:
+          ast = "E";
+          break;
+        case 6:
+          ast = "F";
+          break;
+        case 7:
+          ast = "G";
+          break;
+        case 8:
+          ast = "H";
+          break;
+        default:
+          ast = "X";
+          break;
+      }
+      return ast;
+    },
+    getDictChanges(dan) {
+      var arst = [];
+      var arrays;
+      if (dan instanceof Object) {
+        arrays = dan;
+      } else {
+        if (dan) {
+          arrays = dan.toString().split(",");
+        } else {
+          return "";
+        }
+      }
+      for (let i = 0; i < arrays.length; i++) {
+        arst.push(this.Gest(arrays[i]));
+      }
+      return arst.join(",");
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+#bankMsg {
+  width: 100%;
+}
+.dis_flex {
+  display: flex;
+  margin-bottom: 6px;
+  & > span {
+    width: 90px;
+    flex-shrink: 0;
+  }
+  & > div {
+    flex: 1;
+    white-space: initial;
+    ul {
+      margin: 0;
+    }
+  }
+}
+.span_sty {
+  font-weight: bold;
+}
+</style>

+ 2 - 2
src/components/questionBank.vue

@@ -76,7 +76,7 @@
         <div
           class="marg_play"
           v-if="
-            dingForm.type === 1 || dingForm.type === 2 || dingForm.type === 5
+            dingForm.type === 1 || dingForm.type === 2
           "
         >
           <span class="spans"
@@ -247,7 +247,7 @@
               </div> -->
               <div
                 class="marg_play"
-                v-if="ans.type === 1 || ans.type === 2 || ans.type === 5"
+                v-if="ans.type === 1 || ans.type === 2"
               >
                 <span class="spans"
                   ><span style="color: red" v-if="ans.type !== 5">* </span

+ 18 - 4
src/components/tableList.vue

@@ -103,6 +103,7 @@
       </el-table-column>
       <!-- v-if="navText.num" ↓ -->
       <el-table-column
+        v-if="navText.dontNum ? false : true"
         type="index"
         label="序号"
         width="70"
@@ -114,7 +115,7 @@
         v-for="(item, index) in compTableSet(tableSet)"
         :width="item.width"
         :label="item.label"
-        align="center"
+        :align="item.dontCenter ? 'left' : 'center'"
         :sortable="item.prop === 'sort' || item.sort"
         :sort-method="sortMethods"
         :show-overflow-tooltip="item.showTooltip ? false : true"
@@ -574,6 +575,9 @@
               ? "已到期"
               : "未知"
           }}</span>
+          <div v-else-if="item.scope === 'htmlInfo'">
+            <bankMsg ref="bankMsg" :bankMsg="scope.row" />
+          </div>
           <span v-else-if="item.scope === 'TimeVoBtn'">
             <el-popover :key="Math.random()" placement="left" trigger="click">
               <div
@@ -705,7 +709,8 @@
           }}</span>
           <span v-else-if="item.scope === 'refundPrice'">
             {{
-              scope.row["goodsRealPrice"] >= 0 && scope.row["goodsReceived"] >= 0
+              scope.row["goodsRealPrice"] >= 0 &&
+              scope.row["goodsReceived"] >= 0
                 ? Number(scope.row["goodsRealPrice"]) -
                   Number(scope.row["goodsReceived"]) +
                   "元"
@@ -713,7 +718,13 @@
             }}
           </span>
           <div v-else-if="item.scope === 'periodStatusShow'">
-            {{ scope.row[item.prop] === 2 ? "同意,待退款" : scope.row[item.prop] === 3 ?'同意,已退款' :"待审核" }}
+            {{
+              scope.row[item.prop] === 2
+                ? "同意,待退款"
+                : scope.row[item.prop] === 3
+                ? "同意,已退款"
+                : "待审核"
+            }}
           </div>
           <span v-else-if="item.scope === 'peopleNum'">{{
             scope.row[item.prop] === 0 ? "不限制" : scope.row[item.prop]
@@ -1464,6 +1475,7 @@
       </div>
       <div>
         <el-tree
+          default-expand-all
           :key="Math.random()"
           :props="props1"
           :load="loadNode1"
@@ -1567,6 +1579,7 @@
       </div>
       <div>
         <el-tree
+          default-expand-all
           :key="Math.random()"
           :props="props2"
           :load="loadNode2"
@@ -1632,7 +1645,9 @@
 </template>
 
 <script>
+import bankMsg from "./bankMsg";
 export default {
+  components: { bankMsg },
   props: ["tableSets", "tableData", "navText", "rowKey", "loading"],
   data: function () {
     return {
@@ -1720,7 +1735,6 @@ export default {
     this.inittableSet = JSON.stringify(this.tableSet);
     this.initTR();
   },
-  mounted() {},
   methods: {
     backFunc(row) {
       this.$emit("backFunc", row);

+ 466 - 0
src/components/testPaperPreview/index.vue

@@ -0,0 +1,466 @@
+<template>
+  <div id="testPaperPreview">
+    <el-dialog
+      :visible.sync="diavos"
+      width="940px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">试卷预览</div>
+        <div class="rightBoxs">
+          <img src="@/assets/images/Close@2x.png" alt="" @click="clears" />
+        </div>
+      </div>
+      <div>
+        <table class="table_style" border>
+          <tr>
+            <td>当前总分</td>
+            <td>及格分数</td>
+            <td>答卷时长</td>
+            <td>答卷次数</td>
+            <td>做题类型</td>
+          </tr>
+          <tr>
+            <td>{{ topData.getAllpocis }}</td>
+            <td>{{ topData.passScore }}</td>
+            <td>
+              {{ topData.answerTime === 0 ? "无限时长" : topData.answerTime }}
+            </td>
+            <td>
+              {{ topData.answerNum === 0 ? "无限次" : topData.answerNum }}
+            </td>
+            <td>
+              {{
+                topData.doType === 1
+                  ? "练习"
+                  : topData.doType === 2
+                  ? "考试"
+                  : ""
+              }}
+            </td>
+          </tr>
+        </table>
+        <div class="bank_style">
+          <div v-for="(item, index) in tableData" :key="index">
+            <div class="header_style">
+              <span>题目{{ index + 1 }}</span>
+              <span>{{ getTypeName(item.type) }}</span>
+              <span>分值:{{ item.score }}</span>
+              <el-button
+                size="mini"
+                style="float: right"
+                @click="changeDatas(item)"
+                v-if="type === 2"
+                >修改</el-button
+              >
+              <div style="clear: both"></div>
+            </div>
+            <div class="dis_flex">
+              <span>题目内容:</span>
+              <div>
+                <div class="divPy" v-html="imgExiz(item.content)"></div>
+                <ul v-if="item.type !== 4">
+                  <li
+                    v-for="(items, indexs) in item.optionsList"
+                    :key="indexs"
+                    style="margin-bottom: 10px"
+                  >
+                    {{ Gest(indexs + 1) }}:{{ items.content }}
+
+                    <el-image
+                      v-if="items.imgUrl"
+                      style="width: 80px; height: 80px; vertical-align: middle"
+                      :src="$methodsTools.splitImgHost(items.imgUrl)"
+                      :preview-src-list="[
+                        $methodsTools.splitImgHost(items.imgUrl),
+                      ]"
+                    >
+                    </el-image>
+                  </li>
+                </ul>
+                <div v-else>
+                  <div
+                    style="background: #e0e0e0; padding: 10px"
+                    v-for="(its, inds) in JSON.parse(item.jsonStr)"
+                    :key="inds"
+                  >
+                    <div class="header_style">
+                      <span>题目{{ inds + 1 }}</span>
+                      <span>{{ getTypeName(its.type) }}</span>
+                      <span>分值:{{ its.score }}</span>
+                    </div>
+                    <div class="dis_flex">
+                      <span>题目内容:</span>
+                      <div>
+                        <div class="divPy" v-html="imgExiz(its.content)"></div>
+                        <ul>
+                          <li
+                            v-for="(itemsxs, indexsxs) in its.optionsList"
+                            :key="indexsxs"
+                            style="margin-bottom: 10px"
+                          >
+                            {{ Gest(indexsxs + 1) }}:{{ itemsxs.content }}
+
+                            <el-image
+                              v-if="itemsxs.imgUrl"
+                              style="
+                                width: 80px;
+                                height: 80px;
+                                vertical-align: middle;
+                              "
+                              :src="$methodsTools.splitImgHost(itemsxs.imgUrl)"
+                              :preview-src-list="[
+                                $methodsTools.splitImgHost(itemsxs.imgUrl),
+                              ]"
+                            >
+                            </el-image>
+                          </li>
+                        </ul>
+                      </div>
+                    </div>
+                    <div class="dis_flex" v-if="its.type !== 5">
+                      <span>正确答案:</span>
+                      <div>
+                        <span v-if="its.type === 3">
+                          {{ its.answerQuestion == 1 ? "正确" : "错误" }}
+                        </span>
+                        <span v-else>
+                          {{ getDictChanges(its.answerQuestion) }}
+                        </span>
+                      </div>
+                    </div>
+                    <div class="dis_flex">
+                      <span>答案解析:</span>
+                      <div>
+                        <div v-html="imgExiz(its.analysisContent)"></div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+            <div class="dis_flex" v-if="item.type !== 5">
+              <span>正确答案:</span>
+              <div>
+                <span v-if="item.type === 3">
+                  {{ item.answerQuestion == 1 ? "正确" : "错误" }}
+                </span>
+                <span v-else>
+                  {{ getDictChanges(item.answerQuestion) }}
+                </span>
+              </div>
+            </div>
+            <div class="dis_flex">
+              <span>答案解析:</span>
+              <div><div v-html="imgExiz(item.analysisContent)"></div></div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="clears">确 认</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      diavos: false,
+      tableData: [], //题目内容
+      topData: {}, //顶部表格数据
+      type: "",
+    };
+  },
+  computed: {
+    /**
+     * 题目类型转换名称
+     */
+    getTypeName: function () {
+      return function (type) {
+        let typeName = "";
+        switch (type) {
+          case 1:
+            typeName = "单选题";
+            break;
+          case 2:
+            typeName = "多选题";
+            break;
+          case 3:
+            typeName = "判断题";
+            break;
+          case 4:
+            typeName = "案例题";
+            break;
+          case 5:
+            typeName = "简答题";
+            break;
+
+          default:
+            break;
+        }
+        return typeName;
+      };
+    },
+
+    imgExiz: function () {
+      return function (vms) {
+        if (!vms) {
+          return vms;
+        } else {
+          var ast1 = vms.replace(/<p/gi, '<p style="margin:0px;"');
+          var ast = ast1.replace(/<img/gi, '<img style="max-width:100%;"');
+          return ast;
+        }
+      };
+    },
+  },
+  methods: {
+    /**
+     * type = 1时Id获取数据row = ID, 2时直接获取数据row = 数据
+     */
+    openBox(type, row) {
+      const ROWS = JSON.parse(JSON.stringify(row));
+      this.type = type;
+      if (type === 1) {
+        //搜索Id处理数据
+        this.$api.obtainbankexam(row).then((res) => {
+          console.log(111);
+          this.topData = {
+            answerTime: res.data.answerTime,
+            answerNum: res.data.answerNum,
+            doType: res.data.doType,
+            passScore: res.data.passScore,
+          };
+        });
+        this.$api.inquirebankexamquestionList({ examId: row }).then((res) => {
+          res.data.map((item) => {
+            item.optionsList = JSON.parse(item.jsonStr);
+          });
+          this.tableData = res.data;
+          var num = 0;
+          res.data.forEach((item) => {
+            num += item.score;
+          });
+          this.topData.getAllpocis = num;
+          this.diavos = true;
+        });
+      }
+      if (type === 2) {
+        this.topData = ROWS.topData;
+        this.tableData = ROWS.tableData;
+        this.diavos = true;
+      }
+    },
+    changeDatas(row) {
+      this.$parent.addClick(row,0,row.index,true)
+    },
+    clears() {
+      this.diavos = false;
+    },
+    changeUploadStatus(data){
+      let index = this.tableData.findIndex(item => {
+        return item.index === data.index
+      })
+      this.$set(this.tableData,index,data)
+      console.log(data)
+    },
+    /**
+     * 选项转换
+     */
+    Gest(ints) {
+      var int = parseInt(ints);
+      var ast = "";
+      switch (int) {
+        case 1:
+          ast = "A";
+          break;
+        case 2:
+          ast = "B";
+          break;
+        case 3:
+          ast = "C";
+          break;
+        case 4:
+          ast = "D";
+          break;
+        case 5:
+          ast = "E";
+          break;
+        case 6:
+          ast = "F";
+          break;
+        case 7:
+          ast = "G";
+          break;
+        case 8:
+          ast = "H";
+          break;
+        default:
+          ast = "X";
+          break;
+      }
+      return ast;
+    },
+    getDictChanges(dan) {
+      var arst = [];
+      var arrays;
+      if (dan instanceof Object) {
+        arrays = dan;
+      } else {
+        if (dan) {
+          arrays = dan.toString().split(",");
+        } else {
+          return "";
+        }
+      }
+      for (let i = 0; i < arrays.length; i++) {
+        arst.push(this.Gest(arrays[i]));
+      }
+      return arst.join(",");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.divPy {
+}
+.table_style {
+  width: 100%;
+  border-collapse: collapse;
+  text-align: center;
+  margin-bottom: 14px;
+  tr {
+    &:first-of-type {
+      background-color: rgb(255, 255, 204);
+      font-weight: bold;
+    }
+    td {
+      padding: 6px;
+    }
+  }
+}
+.bank_style {
+  max-height: 600px;
+  overflow: auto;
+  & > div {
+    padding: 10px;
+    background-color: #eee;
+    margin-bottom: 11px;
+  }
+  & .header_style {
+    border-bottom: 1px dotted #999;
+    padding-bottom: 6px;
+    & > span {
+      margin-right: 10px;
+    }
+  }
+  & .dis_flex {
+    display: flex;
+    margin-bottom: 6px;
+    & > span {
+      width: 90px;
+      flex-shrink: 0;
+    }
+    & > div {
+      flex: 1;
+      ul {
+        margin: 0;
+      }
+    }
+  }
+}
+/deep/.el-button {
+  border-radius: 8px;
+}
+/deep/.el-dialog {
+  border-radius: 8px;
+  .el-dialog__header {
+    padding: 0;
+    .hearders {
+      height: 40px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0px 18px 0px 20px;
+      border-bottom: 1px solid #e2e2e2;
+      .leftTitle {
+        font-size: 14px;
+        font-weight: bold;
+        color: #2f4378;
+      }
+      .rightBoxs {
+        display: flex;
+        align-items: center;
+        img {
+          width: 14px;
+          height: 14px;
+          margin-left: 13px;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+  .el-dialog__footer {
+    padding: 0;
+    .dialog-footer {
+      padding: 0px 40px;
+      height: 70px;
+      border-top: 1px solid #e2e2e2;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+}
+.imgBox {
+  width: 100%;
+  // height: 210px;
+  border: 1px solid #e2e2e2;
+  border-radius: 8px;
+  padding: 8px 8px 3px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .imgLabel {
+    flex: 1;
+    width: 100%;
+    border: 1px dotted #e2e2e2;
+    color: #999;
+    font-size: 14px;
+    cursor: pointer;
+    border-radius: 8px;
+    .msPhoto {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      max-width: 100%;
+      max-height: 270px;
+      img {
+        max-width: 100%;
+        max-height: 270px;
+      }
+    }
+    .imgbbx {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      i {
+        font-weight: bold;
+        margin: 14px 0;
+        font-size: 24px;
+      }
+    }
+  }
+  p {
+    margin: 5px 0px;
+  }
+}
+</style>

+ 8 - 0
src/newApi/bankChapter.js

@@ -47,5 +47,13 @@ export default {
             params: data
         })
     },
+    //批量新增章卷
+    addMorebankchapter(data) {
+        return request({
+            url: '/bank/chapter/addMore',
+            method: 'post',
+            data
+        })
+    },
     
 }

+ 8 - 0
src/newApi/festival.js

@@ -24,6 +24,14 @@ export default {
             data
         })
     },
+    //导入节模板-带业务层次
+    drCourseSectionimportDataBusiness(data) {
+        return request({
+            url: '/course/section/importDataBusiness',
+            method: 'post',
+            data
+        })
+    },
     //查询课程小节列表
     inquireCourseSection(data) {
         return request({

+ 8 - 0
src/newApi/gigChapter.js

@@ -45,4 +45,12 @@ export default {
             method: 'get',
         })
     },
+    //批量新增课程大章
+    addMoreCoursechapter(data) {
+        return request({
+            url: '/course/chapter/addMore',
+            method: 'post',
+            data
+        })
+    },
 }

+ 8 - 0
src/newApi/paper.js

@@ -80,4 +80,12 @@ export default {
             method: 'get',
         })
     },
+    //批量新增试卷
+    addMorebankexam(data) {
+        return request({
+            url: '/bank/exam/addMore',
+            method: 'post',
+            data
+        })
+    },
 }

+ 8 - 0
src/newApi/paperquestion.js

@@ -63,4 +63,12 @@ export default {
             data
         })
     },
+    //导入题目模板EXCEL
+    importDatabankimportDataBackList(data) {
+        return request({
+            url: '/bank/question/importDataBackList',
+            method: 'post',
+            data
+        })
+    },
 }

+ 4 - 0
src/store/getters.js

@@ -1,6 +1,10 @@
 import api from '@/api/api'
 
 const getters = {
+  modulePage: state => state.dataCache.modulePage,//模块变化
+  festivalPage: state => state.dataCache.festivalPage,//章变化
+  chapterExamPage: state => state.dataCache.chapterExamPage,//章卷变化
+  testPaperPage: state => state.dataCache.testPaperPage,//试卷变化
   sidebar: state => state.app.sidebar,
   size: state => state.app.size,
   device: state => state.app.device,

+ 3 - 1
src/store/index.js

@@ -1,6 +1,7 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 import app from './modules/app'
+import dataCache from './modules/dataCache'
 import user from './modules/user'
 import tagsView from './modules/tagsView'
 import permission from './modules/permission'
@@ -17,7 +18,8 @@ const store = new Vuex.Store({
     tagsView,
     permission,
     settings,
-    dict
+    dict,
+    dataCache
   },
   getters
 })

+ 47 - 0
src/store/modules/dataCache.js

@@ -0,0 +1,47 @@
+
+const state = {
+  modulePage: null,//模块-章变化
+  festivalPage: null,//章-节变化
+  chapterExamPage: null,//章卷-节变化
+  testPaperPage:null,//试卷变化
+}
+const mutations = {
+  //更新模块变化记录
+  MODULEPAGE(state, data) {
+    state.modulePage = data
+  },
+  //更新模块变化记录
+  FESTIVALPAGE(state, data) {
+    state.festivalPage = data
+  },
+  //更新章卷变化记录
+  CHAPTEREXAMPAGE(state, data) {
+    state.chapterExamPage = data
+  },
+  //更新试卷变化记录
+  TESTPAPERPAGE(state, data) {
+    state.testPaperPage = data
+  },
+}
+
+const actions = {
+  changemodulePage({ commit }, data) {
+    commit('MODULEPAGE', data)
+  },
+  changefestivalPage({ commit }, data) {
+    commit('FESTIVALPAGE', data)
+  },
+  changechapterExamPage({ commit }, data) {
+    commit('CHAPTEREXAMPAGE', data)
+  },
+  changetestPaperPage({ commit }, data) {
+    commit('TESTPAPERPAGE', data)
+  },
+}
+
+export default {
+  state,
+  mutations,
+  actions
+}
+

+ 1 - 5
src/views/2Cport/adSlotManagement/tab2.vue

@@ -347,11 +347,7 @@ export default {
         {
           label: "内部接口地址",
           value: 3,
-        },
-        {
-          label: "外部接口地址",
-          value: 4,
-        },
+        }
       ],
     };
   },

+ 5 - 0
src/views/Marketing/goods/commodityManageMent/add/index.vue

@@ -2129,6 +2129,11 @@ export default {
       ];
       this.listData.serviceTimeType = "";
       this.initServiceFun();
+      if(this.listData.goodsType == 2){
+        this.listData.coverUrl = "oss/images/file/20220518/1652864709142.png"
+      }else{
+        this.listData.coverUrl = this.bfImg
+      }
     },
     zhText(param) {
       const { columns, data } = param;

+ 175 - 96
src/views/resource/bankManagement/chapterVolumeManagement/add/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="chapterVolumeManagementAdd">
-    <div class="boxWidth">
-      <el-form
-        label-position="right"
-        label-width="120px"
-        :model="listData"
-        :rules="rules"
-        ref="listData"
-      >
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <div class="boxWidth">
         <el-form-item label="适用业务层级" :required="true">
           <el-select
             v-model="eduType"
@@ -125,98 +125,105 @@
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="管理试卷">
-          <div class="dis_plays">
-            <div>
-              <el-button size="small" @click="openBoxs">添加试卷</el-button>
-            </div>
-            <div style="color: #f56c6c">
-              <span style="margin-right: 10px"
-                >试卷总数:{{ tableData.length }}</span
-              >
-              <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
-            </div>
+      </div>
+      <el-form-item label="管理试卷">
+        <div class="dis_plays">
+          <div>
+            <el-button size="small" @click="openBoxs">调用已有数据</el-button>
+            <el-button size="small" @click="addChapter"
+              >自定义添加试卷</el-button
+            >
           </div>
-          <el-table
-            :data="tableData"
-            border
-            :header-cell-style="{
-              'background-color': '#eee',
-              padding: '8px',
-              color: '#333',
-            }"
-            :default-sort="{ prop: 'sort', order: 'ascending' }"
-          >
-            <el-table-column
-              v-for="(item, index) in tableSet"
-              :width="item.width"
-              :key="index"
-              :label="item.label"
-              align="center"
-              :show-overflow-tooltip="true"
-              header-align="center"
-              :sortable="item.prop === 'sort'"
-              sort-by="sort"
-              :prop="item.prop"
+          <div style="color: #f56c6c">
+            <span style="margin-right: 10px"
+              >试卷总数:{{ tableData.length }}</span
             >
-              <template slot-scope="scope">
-                <span v-if="item.scope === 'types'">{{
+            <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
+          </div>
+        </div>
+        <el-table
+          :data="tableData"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+          :default-sort="{ prop: 'sort', order: 'ascending' }"
+        >
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :sortable="item.prop === 'sort'"
+            sort-by="sort"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'types'">{{
+                scope.row[item.prop] === 1
+                  ? "录播"
+                  : scope.row[item.prop] === 2
+                  ? "直播"
+                  : scope.row[item.prop] === 3
+                  ? "回放"
+                  : "未知"
+              }}</span>
+              <span v-else-if="item.scope === 'Status'">
+                {{
                   scope.row[item.prop] === 1
-                    ? "录播"
-                    : scope.row[item.prop] === 2
-                    ? "直播"
-                    : scope.row[item.prop] === 3
-                    ? "回放"
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
                     : "未知"
-                }}</span>
-                <span v-else-if="item.scope === 'Status'">
-                  {{
-                    scope.row[item.prop] === 1
-                      ? "发布"
-                      : scope.row[item.prop] === 0
-                      ? "未发布"
-                      : "未知"
-                  }}
-                </span>
-                <div v-else-if="item.scope === 'inputs'">
-                  <el-input-number
-                    style="width: 50px"
-                    size="small"
-                    :controls="false"
-                    v-model="scope.row[item.prop]"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </div>
-                <span v-else>{{ scope.row[item.prop] }}</span></template
-              >
-            </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              fixed="right"
-              width="100px"
+                }}
+              </span>
+              <div v-else-if="item.scope === 'inputs'">
+                <el-input-number
+                  style="width: 50px"
+                  size="small"
+                  :controls="false"
+                  v-model="scope.row[item.prop]"
+                  controls-position="right"
+                  :min="0"
+                ></el-input-number>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
             >
-              <template slot-scope="scope">
-                <el-button type="text" @click="delList(scope.row, scope.$index)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="backPage">取消</el-button>
-          <el-button
-            type="primary"
-            @click="submitIns('listData')"
-            :loading="disabledBtn"
-            >确定</el-button
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="180px"
           >
-        </el-form-item>
-      </el-form>
-    </div>
+            <template slot-scope="scope">
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >试卷内容</el-button
+              >
+              <el-button type="text" @click="delList(scope.row, scope.$index)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="backPage">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submitIns('listData')"
+          :loading="disabledBtn"
+          >确定</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
       width="800px"
       :show-close="false"
@@ -312,6 +319,7 @@
         >
       </span>
     </el-dialog>
+    <addChapterjs ref="addChapterjs" @backData="backData" />
   </div>
 </template>
 
@@ -319,9 +327,10 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 import tableList from "@/components/tableList";
+import addChapterjs from "../addChapterjs.vue";
 export default {
   name: "ChapterVolumeManagementAdd",
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination, addChapterjs },
   data() {
     return {
       disabledBtn: false,
@@ -353,7 +362,8 @@ export default {
         { label: "排序", prop: "sort", scope: "inputs", width: "100" },
         { label: "试卷编码", prop: "code", width: "140" },
         { label: "标题前缀", prop: "prefixName", width: "170" },
-        { label: "试卷标题", prop: "examName", width: "300" },
+        { label: "试卷标题", prop: "examName" },
+        { label: "题数量", prop: "questionNum", width: "120" },
         {
           label: "发布状态",
           prop: "publishStatus",
@@ -410,7 +420,74 @@ export default {
     this.getDict();
     // this.search();
   },
+  activated() {
+    if (this.$store.getters.testPaperPage) {
+      this.$api
+        .obtainbankexam(this.$store.getters.testPaperPage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.examId == this.$store.getters.testPaperPage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changetestPaperPage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changetestPaperPage", {
+          name: "chapterVolumeManagementAdd",
+          id: v.examId,
+        });
+        this.$router.push({
+          path: "editPaper",
+          query: {
+            id: v.examId,
+            code: v.code,
+            name: 1,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "EditPaper";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "EditPaper",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
+    /**
+     * 打开添加章组件
+     */
+    addChapter() {
+      if (!this.newSujectApis.subjectId) {
+        this.$message.warning("请先选择科目");
+        return;
+      }
+      this.$refs.addChapterjs.openBoxs([this.newSujectApis]);
+    },
+    /**
+     * 添加章-返回数据
+     */
+    backData(v) {
+      this.$api.inquirebankexamList({ examIds: v }).then((res) => {
+        this.activeLists = res.rows;
+        this.submitForm();
+      });
+    },
     unTime(val) {
       let a = `${val.businessId}-${val.subjectId}`;
       if (this.sujectApis == a) {
@@ -722,12 +799,14 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
       this.$message.success("添加成功");
-      this.activeLists = [];
     },
     delList(item, index) {
       this.tableData.splice(index, 1);
       this.$message.success("删除成功");
     },
+    closedFunc() {
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 128 - 0
src/views/resource/bankManagement/chapterVolumeManagement/addChapterjs.vue

@@ -0,0 +1,128 @@
+<template>
+  <div id="addChapter">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="700px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">添加试卷</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <div>
+        <p>
+          <el-button :size="size" type="primary" @click="addChapterList"
+            >添加</el-button
+          >
+        </p>
+        <el-form label-width="100px" class="elform_style">
+          <div v-for="(item, index) in list" :key="index" class="dis_box">
+            <div class="left_box">
+              <el-form-item label="标题前缀">
+                <el-input v-model="item.prefixName"></el-input>
+                <p class="p_style">注:便于检索、归类,以及区分一样的标题</p>
+              </el-form-item>
+              <el-form-item label="试卷标题" required>
+                <el-input v-model="item.examName"></el-input>
+                <p class="p_style">
+                  注:请尽量规范易懂,方便在题卷目录表呈现给学员
+                </p>
+              </el-form-item>
+            </div>
+            <div class="clear_style">
+              <el-button :size="size" @click="list.splice(index, 1)"
+                >删除</el-button
+              >
+            </div>
+          </div></el-form
+        >
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="!list.length"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      size: "small",
+      dialogVisible: false,
+      list: [],
+    };
+  },
+  methods: {
+    addChapterList() {
+      this.list.push({});
+    },
+    openBoxs(arr) {
+      this.businList = JSON.parse(JSON.stringify(arr));
+      this.list = [{}]
+      this.dialogVisible = true;
+    },
+    submitForm() {
+      const arr = [];
+      this.list.forEach((item, index) => {
+        if (!item.examName && item.examName !== 0) {
+          arr.push(index + 1);
+        }
+      });
+      if (arr.length) {
+        this.$message.error(
+          `第${arr.join(",")}条数据没有填写试卷标题,请填写完整后提交`
+        );
+        return;
+      }
+      let data = this.list.map((item) => {
+        item.businessList = this.businList;
+        item.status = 1;
+        item.publishStatus = 1;
+        return item;
+      });
+      this.$api.addMorebankexam(data).then((res) => {
+        this.dialogVisible = false;
+        this.$emit("backData", res.data);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dis_box {
+  background-color: #eee;
+  padding: 10px 10px 0px;
+  display: flex;
+  margin-bottom: 16px;
+  .left_box {
+    flex: 1;
+  }
+  .clear_style {
+    flex-shrink: 0;
+    width: 80px;
+    vertical-align: top;
+    text-align: center;
+  }
+}
+.elform_style{
+    max-height: 620px;
+    overflow: auto;
+}
+.p_style {
+  font-size: 12px;
+  color: #a4a4a4;
+  margin: 0;
+}
+</style>

+ 197 - 104
src/views/resource/bankManagement/chapterVolumeManagement/edit/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="chapterVolumeManagementEdit">
-    <div class="boxWidth">
-      <el-form
-        label-position="right"
-        label-width="120px"
-        :model="listData"
-        :rules="rules"
-        ref="listData"
-      >
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <div class="boxWidth">
         <el-form-item label="适用业务层级" :required="true">
           <el-select
             disabled
@@ -110,98 +110,105 @@
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="管理试卷">
-          <div class="dis_plays">
-            <div>
-              <el-button size="small" @click="openBoxs">添加试卷</el-button>
-            </div>
-            <div style="color: #f56c6c">
-              <span style="margin-right: 10px"
-                >试卷总数:{{ tableData.length }}</span
-              >
-              <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
-            </div>
+      </div>
+      <el-form-item label="管理试卷">
+        <div class="dis_plays">
+          <div>
+            <el-button size="small" @click="openBoxs">调用已有数据</el-button>
+            <el-button size="small" @click="addChapter"
+              >自定义添加试卷</el-button
+            >
           </div>
-          <el-table
-            :data="tableData"
-            border
-            :header-cell-style="{
-              'background-color': '#eee',
-              padding: '8px',
-              color: '#333',
-            }"
-            :default-sort="{ prop: 'sort', order: 'ascending' }"
-          >
-            <el-table-column
-              v-for="(item, index) in tableSet"
-              :width="item.width"
-              :key="index"
-              :label="item.label"
-              align="center"
-              :show-overflow-tooltip="true"
-              header-align="center"
-              :sortable="item.prop === 'sort'"
-              sort-by="sort"
-              :prop="item.prop"
+          <div style="color: #f56c6c">
+            <span style="margin-right: 10px"
+              >试卷总数:{{ tableData.length }}</span
             >
-              <template slot-scope="scope">
-                <span v-if="item.scope === 'types'">{{
+            <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
+          </div>
+        </div>
+        <el-table
+          :data="tableData"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+          :default-sort="{ prop: 'sort', order: 'ascending' }"
+        >
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :sortable="item.prop === 'sort'"
+            sort-by="sort"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'types'">{{
+                scope.row[item.prop] === 1
+                  ? "录播"
+                  : scope.row[item.prop] === 2
+                  ? "直播"
+                  : scope.row[item.prop] === 3
+                  ? "回放"
+                  : "未知"
+              }}</span>
+              <span v-else-if="item.scope === 'Status'">
+                {{
                   scope.row[item.prop] === 1
-                    ? "录播"
-                    : scope.row[item.prop] === 2
-                    ? "直播"
-                    : scope.row[item.prop] === 3
-                    ? "回放"
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
                     : "未知"
-                }}</span>
-                <span v-else-if="item.scope === 'Status'">
-                  {{
-                    scope.row[item.prop] === 1
-                      ? "发布"
-                      : scope.row[item.prop] === 0
-                      ? "未发布"
-                      : "未知"
-                  }}
-                </span>
-                <div v-else-if="item.scope === 'inputs'">
-                  <el-input-number
-                    style="width: 50px"
-                    size="small"
-                    :controls="false"
-                    v-model="scope.row[item.prop]"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </div>
-                <span v-else>{{ scope.row[item.prop] }}</span></template
-              >
-            </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              fixed="right"
-              width="100px"
+                }}
+              </span>
+              <div v-else-if="item.scope === 'inputs'">
+                <el-input-number
+                  style="width: 50px"
+                  size="small"
+                  :controls="false"
+                  v-model="scope.row[item.prop]"
+                  controls-position="right"
+                  :min="0"
+                ></el-input-number>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
             >
-              <template slot-scope="scope">
-                <el-button type="text" @click="delList(scope.row, scope.$index)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="backPage">取消</el-button>
-          <el-button
-            type="primary"
-            @click="submitIns('listData')"
-            :loading="disabledBtn"
-            >确定</el-button
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="180px"
           >
-        </el-form-item>
-      </el-form>
-    </div>
+            <template slot-scope="scope">
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >试卷内容</el-button
+              >
+              <el-button type="text" @click="delList(scope.row, scope.$index)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="backPage">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submitIns('listData')"
+          :loading="disabledBtn"
+          >确定</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
       width="800px"
       :show-close="false"
@@ -297,6 +304,7 @@
         >
       </span>
     </el-dialog>
+    <addChapterjs ref="addChapterjs" @backData="backData" />
   </div>
 </template>
 
@@ -304,9 +312,10 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 import tableList from "@/components/tableList";
+import addChapterjs from "../addChapterjs.vue";
 export default {
   name: "ChapterVolumeManagementEdit",
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination, addChapterjs },
   data() {
     return {
       disabledBtn: false,
@@ -338,7 +347,8 @@ export default {
         { label: "排序", prop: "sort", scope: "inputs", width: "100" },
         { label: "试卷编码", prop: "code", width: "140" },
         { label: "标题前缀", prop: "prefixName", width: "170" },
-        { label: "试卷标题", prop: "examName", width: "300" },
+        { label: "试卷标题", prop: "examName" },
+        { label: "题数量", prop: "questionNum", width: "120" },
         {
           label: "发布状态",
           prop: "publishStatus",
@@ -376,13 +386,81 @@ export default {
       ],
       disCheckList: [], //已选转禁用复选列表
       activeLists: [],
+      pageId: this.$route.query.id,
     };
   },
   mounted() {
     this.$modal.loading("正在导入数据,请稍后...");
     this.getDict();
   },
+  activated() {
+    if (this.$store.getters.testPaperPage) {
+      this.$api
+        .obtainbankexam(this.$store.getters.testPaperPage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.examId == this.$store.getters.testPaperPage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changetestPaperPage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changetestPaperPage", {
+          name: "chapterVolumeManagementEdit",
+          id: v.examId,
+        });
+        this.$router.push({
+          path: "editPaper",
+          query: {
+            id: v.examId,
+            code: v.code,
+            name: 1,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "EditPaper";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "EditPaper",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
+    /**
+     * 打开添加章组件
+     */
+    addChapter() {
+      if (!this.newSujectApis.subjectId) {
+        this.$message.warning("请先选择科目");
+        return;
+      }
+      this.$refs.addChapterjs.openBoxs([this.newSujectApis]);
+    },
+    /**
+     * 添加章-返回数据
+     */
+    backData(v) {
+      this.$api.inquirebankexamList({ examIds: v }).then((res) => {
+        this.activeLists = res.rows;
+        this.submitForm();
+      });
+    },
     getMessage() {
       if (!this.courType) {
         this.$message.warning("请先选择业务层级");
@@ -413,7 +491,7 @@ export default {
     },
     getInfosList() {
       this.$api
-        .inquirebankchapterexamList({ chapterExamId: this.$route.query.id })
+        .inquirebankchapterexamList({ chapterExamId: this.pageId })
         .then((result) => {
           // this.numberAll = result.total;
           // this.minTimeAll = result.timeTotal;
@@ -444,13 +522,13 @@ export default {
       this.getInfos(2);
     },
     search() {
-      this.$api.obtainbankchapter(this.$route.query.id).then((res) => {
+      this.$api.obtainbankchapter(this.pageId).then((res) => {
         this.listData = res.data;
       });
       this.$api
         .inquirebankchapterListbusiness({
           type: 3,
-          majorId: this.$route.query.id,
+          majorId: this.pageId,
         })
         .then((res) => {
           this.eduType = res.rows[0].educationTypeId;
@@ -623,9 +701,15 @@ export default {
             this.$store
               .dispatch("tagsView/exitView", this.$route)
               .then((res) => {
-                this.$router.push({
-                  path: "chapterVolumeManagement",
-                });
+                if (this.$store.getters.chapterExamPage) {
+                  this.$router.push({
+                    path: this.$store.getters.chapterExamPage.name,
+                  });
+                } else {
+                  this.$router.push({
+                    path: "chapterVolumeManagement",
+                  });
+                }
               });
           }, 500);
         })
@@ -635,9 +719,15 @@ export default {
     },
     backPage() {
       this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
-        this.$router.push({
-          path: "chapterVolumeManagement",
-        });
+        if (this.$store.getters.chapterExamPage) {
+          this.$router.push({
+            path: this.$store.getters.chapterExamPage.name,
+          });
+        } else {
+          this.$router.push({
+            path: "chapterVolumeManagement",
+          });
+        }
       });
     },
     closeType() {
@@ -698,6 +788,9 @@ export default {
       this.tableData.splice(index, 1);
       this.$message.success("删除成功");
     },
+    closedFunc() {
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 1 - 0
src/views/resource/bankManagement/chapterVolumeManagement/index.vue

@@ -234,6 +234,7 @@ export default {
         });
       } else {
         const jump = () => {
+          this.$store.dispatch("changechapterExamPage", null);
           this.$router.push({
             path: "chapterVolumeManagementEdit",
             query: {

+ 98 - 14
src/views/resource/bankManagement/testPaperManagement/addPaper/topicAddPaper/index.vue

@@ -237,7 +237,7 @@
       </el-dialog>
       <el-dialog
         :visible.sync="dialogVisibleTable"
-        width="960px"
+        width="1300px"
         :show-close="false"
         :close-on-click-modal="false"
       >
@@ -671,6 +671,28 @@
           >
         </span>
       </el-dialog>
+      <el-dialog
+      :visible.sync="dialogDRexcel"
+      :append-to-body="true"
+      width="780px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">批量导入</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogDRexcel = false"
+          />
+        </div>
+      </div>
+      <excel-pop @backData="backData" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogDRexcel = false">取 消</el-button>
+      </span>
+    </el-dialog>
     </div>
   </div>
 </template>
@@ -681,7 +703,8 @@ import pagination from "@/components/pagination";
 import tableList from "@/components/tableList";
 import busIns from "@/components/busIns";
 import questionBank from "@/components/questionBank";
-import wordPop from "../../editPaper/topicEditPaper/wordPop.vue";
+import wordPop from "../../wordPop.vue";
+import excelPop from "../../excelPop.vue";
 export default {
   name: "TopicAddPaper",
   components: {
@@ -691,11 +714,13 @@ export default {
     busIns,
     questionBank,
     wordPop,
+    excelPop
   },
   data() {
     return {
       dialogDRword: false,
       disabledBtn: false,
+      dialogDRexcel:false,
       showHide: false,
       activeName: "second",
       formList: [
@@ -744,7 +769,7 @@ export default {
         {
           label: "题目编码",
           prop: "code",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "题型",
@@ -757,6 +782,14 @@ export default {
           prop: "prefixName",
           hidden: true,
         },
+        {
+          label: "题目详细",
+          prop: "content",
+          hidden: true,
+          scope: "htmlInfo",
+          width: "600px",
+          dontCenter: true,
+        },
         {
           label: "知识点",
           prop: "knowledgeList",
@@ -765,12 +798,6 @@ export default {
           width: "200px",
           showTooltip: true,
         },
-        {
-          label: "题目内容",
-          prop: "content",
-          hidden: true,
-          scope: "editInfoHTMLs",
-        },
 
         {
           label: "发布状态",
@@ -789,6 +816,7 @@ export default {
         border: true,
         choice: false,
         addHide: false,
+        dontNum:true,
         backFatherBtn: {
           status: true,
           title: "分值设置",
@@ -874,6 +902,7 @@ export default {
           prop: "publishStatus",
           hidden: true,
           scope: "Status",
+          width: "120px",
         },
       ],
       activeLists: [],
@@ -1023,6 +1052,57 @@ export default {
     this.localStart = false;
   },
   methods: {
+    /**
+     * 返回数据
+     */
+    backData(arr) {
+      for (let i = 0; i < arr.length; i++) {
+        arr[i].partScore = 0;
+        arr[i].score = "";
+        arr[i].status = 1;
+        arr[i].businessList = [this.businObj];
+        if (arr[i].type === 4) {
+          arr[i].optionsList = JSON.parse(arr[i].jsonStr);
+          arr[i].optionsList.forEach(item => {
+            if(item.type === 3 || item.type === 5){
+              item.optionsList = []
+              item.jsonStr = ""
+            }
+          })
+        }else if(arr[i].type === 5){
+          arr[i].jsonStr = ""
+          arr[i].optionsList = []
+        } else {
+          arr[i].jsonStr = JSON.stringify(arr[i].optionsList);
+        }
+        if (this.tableData.length) {
+          let maxIndex = 0;
+          let childrenIndex = 0;
+          this.tableData.forEach((item) => {
+            if (item.sort > maxIndex) {
+              maxIndex = item.sort;
+            }
+            if (item.index > childrenIndex) {
+              childrenIndex = item.index;
+            }
+          });
+          arr[i].sort = maxIndex + 1;
+          arr[i].index = childrenIndex + 1;
+        } else {
+          arr[i].sort = 1;
+          arr[i].index = 0;
+        }
+        this.tableData.push(arr[i]);
+        this.dialogDRexcel = false
+      }
+    },
+    /**
+     * 返回数据
+     */
+    backData(data){
+      console.log(data)
+      this.dialogDRexcel = false
+    },
     setInterFunc() {
       var arr = setInterval(() => {
         if (!this.localStart) {
@@ -1065,9 +1145,9 @@ export default {
       this.$api
         .inquirebankexamquestionList({ examId: this.$route.query.id })
         .then((res) => {
-          res.data.map((item,index) => {
+          res.data.map((item, index) => {
             item.optionsList = JSON.parse(item.jsonStr);
-            item.index = index
+            item.index = index;
           });
           this.copytableData = JSON.parse(JSON.stringify(res.data));
           this.tableData = res.data;
@@ -1180,8 +1260,8 @@ export default {
           }
         });
         this.activeLists.forEach((item, index) => {
-          childrenIndex++
-          item.index = childrenIndex
+          childrenIndex++;
+          item.index = childrenIndex;
           item.sort = maxIndex + index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;
@@ -1189,7 +1269,7 @@ export default {
         });
       } else {
         this.activeLists.forEach((item, index) => {
-          item.index = index
+          item.index = index;
           item.sort = index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;
@@ -1572,6 +1652,10 @@ export default {
             self.showHide = false;
             // self.search();
             // });
+            /**
+             * 核心语句👇表格定制化需要使用jsonStr字段,与题目管理同步字段,所以需要实时更新jsonStr
+             */
+            data.jsonStr = JSON.stringify(data.optionsList);
           }
         } else {
           console.log("error submit!!");

+ 18 - 6
src/views/resource/bankManagement/testPaperManagement/editPaper/baseEditPaper/index.vue

@@ -430,9 +430,15 @@ export default {
             this.$store
               .dispatch("tagsView/exitView", this.$route)
               .then((res) => {
-                this.$router.push({
-                  path: "testPaperManagement",
-                });
+                if (this.$store.getters.testPaperPage) {
+                  this.$router.push({
+                    path: this.$store.getters.testPaperPage.name,
+                  });
+                } else {
+                  this.$router.push({
+                    path: "testPaperManagement",
+                  });
+                }
               });
           }, 500);
         })
@@ -442,9 +448,15 @@ export default {
     },
     backPage() {
       this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
-        this.$router.push({
-          path: "testPaperManagement",
-        });
+        if (this.$store.getters.testPaperPage) {
+          this.$router.push({
+            path: this.$store.getters.testPaperPage.name,
+          });
+        } else {
+          this.$router.push({
+            path: "testPaperManagement",
+          });
+        }
       });
     },
     closeType() {

+ 10 - 0
src/views/resource/bankManagement/testPaperManagement/editPaper/index.vue

@@ -19,6 +19,16 @@ export default {
     };
   },
   methods: {},
+  mounted() {
+    if (this.$route.query.name) {
+      if (this.$route.query.name == 1) {
+        this.activeName = "first";
+      }
+      if (this.$route.query.name == 2) {
+        this.activeName = "second";
+      }
+    }
+  },
 };
 </script>
 

+ 111 - 24
src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/index.vue

@@ -13,6 +13,8 @@
         <template slot="customize">
           <el-button size="medium" @click="dialogDRword = true" type="success"
             >Word批量导入</el-button
+          ><el-button size="medium" @click="dialogDRexcel = true" type="success"
+            >Excel批量导入</el-button
           >
         </template>
         <template slot="btn" slot-scope="props">
@@ -65,7 +67,7 @@
         </span>
       </el-dialog>
       <el-dialog
-        width="1080px"
+        width="1180px"
         :visible.sync="innerVisiblePaperTopic"
         append-to-body
         :show-close="false"
@@ -241,7 +243,7 @@
       </el-dialog>
       <el-dialog
         :visible.sync="dialogVisibleTable"
-        width="960px"
+        width="1300px"
         :show-close="false"
         :close-on-click-modal="false"
       >
@@ -675,6 +677,28 @@
           >
         </span>
       </el-dialog>
+      <el-dialog
+        :visible.sync="dialogDRexcel"
+        :append-to-body="true"
+        width="780px"
+        :show-close="false"
+        :close-on-click-modal="false"
+      >
+        <div slot="title" class="hearders">
+          <div class="leftTitle">批量导入</div>
+          <div class="rightBoxs">
+            <img
+              src="@/assets/images/Close@2x.png"
+              alt=""
+              @click="dialogDRexcel = false"
+            />
+          </div>
+        </div>
+        <excel-pop @backData="backData" />
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogDRexcel = false">取 消</el-button>
+        </span>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -685,7 +709,8 @@ import pagination from "@/components/pagination";
 import tableList from "@/components/tableList";
 import busIns from "@/components/busIns";
 import questionBank from "@/components/questionBank";
-import wordPop from "./wordPop.vue";
+import wordPop from "../../wordPop.vue";
+import excelPop from "../../excelPop.vue";
 export default {
   components: {
     searchBoxNew,
@@ -694,11 +719,13 @@ export default {
     busIns,
     questionBank,
     wordPop,
+    excelPop,
   },
   data() {
     return {
       dialogDRword: false,
       disabledBtn: false,
+      dialogDRexcel: false,
       showHide: false,
       formList: [
         // {
@@ -746,7 +773,7 @@ export default {
         {
           label: "题目编码",
           prop: "code",
-          hidden: true,
+          hidden: false,
           width: "120px",
         },
         {
@@ -761,6 +788,14 @@ export default {
           hidden: true,
           width: "160px",
         },
+        {
+          label: "题目详细",
+          prop: "content",
+          hidden: true,
+          scope: "htmlInfo",
+          width: "600px",
+          dontCenter: true,
+        },
         {
           label: "知识点",
           prop: "knowledgeList",
@@ -769,14 +804,6 @@ export default {
           width: "200px",
           showTooltip: true,
         },
-        {
-          label: "题目内容",
-          prop: "content",
-          hidden: true,
-          scope: "editInfoHTMLs",
-          width: "320px",
-        },
-
         {
           label: "发布状态",
           prop: "publishStatus",
@@ -794,6 +821,7 @@ export default {
         border: true,
         choice: false,
         addHide: false,
+        dontNum: true,
         backFatherBtn: {
           status: true,
           title: "分值设置",
@@ -876,13 +904,13 @@ export default {
           prop: "content",
           hidden: true,
           scope: "editInfoHTMLs",
-          width: "320px",
         },
         {
           label: "发布状态",
           prop: "publishStatus",
           hidden: true,
           scope: "Status",
+          width: "120px",
         },
       ],
       activeLists: [],
@@ -1051,6 +1079,50 @@ export default {
     this.localStart = false;
   },
   methods: {
+    /**
+     * 返回数据
+     */
+    backData(arr) {
+      for (let i = 0; i < arr.length; i++) {
+        arr[i].partScore = 0;
+        arr[i].score = "";
+        arr[i].status = 1;
+        arr[i].businessList = [this.businObj];
+        if (arr[i].type === 4) {
+          arr[i].optionsList = JSON.parse(arr[i].jsonStr);
+          arr[i].optionsList.forEach(item => {
+            if(item.type === 3 || item.type === 5){
+              item.optionsList = []
+              item.jsonStr = ""
+            }
+          })
+        }else if(arr[i].type === 5){
+          arr[i].jsonStr = ""
+          arr[i].optionsList = []
+        } else {
+          arr[i].jsonStr = JSON.stringify(arr[i].optionsList);
+        }
+        if (this.tableData.length) {
+          let maxIndex = 0;
+          let childrenIndex = 0;
+          this.tableData.forEach((item) => {
+            if (item.sort > maxIndex) {
+              maxIndex = item.sort;
+            }
+            if (item.index > childrenIndex) {
+              childrenIndex = item.index;
+            }
+          });
+          arr[i].sort = maxIndex + 1;
+          arr[i].index = childrenIndex + 1;
+        } else {
+          arr[i].sort = 1;
+          arr[i].index = 0;
+        }
+        this.tableData.push(arr[i]);
+        this.dialogDRexcel = false
+      }
+    },
     /**
      *
      */
@@ -1220,7 +1292,6 @@ export default {
         this.dialogVisibleTable = false;
         return;
       }
-
       if (this.tableData.length) {
         let maxIndex = 0;
         let childrenIndex = 0;
@@ -1229,12 +1300,12 @@ export default {
             maxIndex = item.sort;
           }
           if (item.index > childrenIndex) {
-            childrenIndex = item.index
+            childrenIndex = item.index;
           }
         });
         this.activeLists.forEach((item, index) => {
-          childrenIndex++
-          item.index = childrenIndex
+          childrenIndex++;
+          item.index = childrenIndex;
           item.sort = maxIndex + index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;
@@ -1243,7 +1314,7 @@ export default {
         });
       } else {
         this.activeLists.forEach((item, index) => {
-          item.index = index
+          item.index = index;
           item.sort = index + 1;
           item.optionsList = JSON.parse(item.jsonStr);
           item.partScore = 0;
@@ -1629,6 +1700,10 @@ export default {
             // self.search();
             // });
           }
+          /**
+           * 核心语句👇表格定制化需要使用jsonStr字段,与题目管理同步字段,所以需要实时更新jsonStr
+           */
+          data.jsonStr = JSON.stringify(data.optionsList);
         } else {
           console.log("error submit!!");
           return false;
@@ -1714,9 +1789,15 @@ export default {
             this.$store
               .dispatch("tagsView/exitView", this.$route)
               .then((res) => {
-                this.$router.push({
-                  path: "testPaperManagement",
-                });
+                if (this.$store.getters.testPaperPage) {
+                  this.$router.push({
+                    path: this.$store.getters.testPaperPage.name,
+                  });
+                } else {
+                  this.$router.push({
+                    path: "testPaperManagement",
+                  });
+                }
               });
           }, 500);
         })
@@ -1737,9 +1818,15 @@ export default {
     },
     backPage() {
       this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
-        this.$router.push({
-          path: "testPaperManagement",
-        });
+        if (this.$store.getters.testPaperPage) {
+          this.$router.push({
+            path: this.$store.getters.testPaperPage.name,
+          });
+        } else {
+          this.$router.push({
+            path: "testPaperManagement",
+          });
+        }
       });
     },
     emitData() {

+ 95 - 0
src/views/resource/bankManagement/testPaperManagement/excelPop.vue

@@ -0,0 +1,95 @@
+<template>
+  <div>
+    <div class="swq">
+      <img
+        style="width: 182px; height: 168px"
+        src="@/assets/images/dr.png"
+        alt=""
+      />
+    </div>
+    <div style="padding-left: 100px">
+      <p>第一步:下载excel导入模板</p>
+      <p style="padding-left: 50px">
+        <i class="el-icon-upload"></i
+        ><span class="dowmStys" @click="getDowm">下载模板</span>
+      </p>
+      <p>第二步:点击“上传Excel”</p>
+      <label for="mobles2" class="el-button el-button--primary el-button--mini"
+        >上传Excel</label
+      ><input
+        style="display: none"
+        type="file"
+        id="mobles2"
+        ref="input2"
+        @change="importMobleadd"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+import * as baseUrls from "@/utils/request.js";
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    getDowm() {
+      let url =
+        baseUrls.BASE_IMG_URL + "oss/images/file/20220518/1652865393160.xlsx" +
+        `?time=${this.$methodsTools.getNewTime()}`;;
+      let link = document.createElement("a");
+      let fileName = "导入模板" + ".xlsx";
+      document.body.appendChild(link);
+      link.href = url;
+      link.dowmload = fileName;
+      link.click();
+      link.remove();
+    },
+    importMobleadd(e) {
+      var self = this;
+      var file = e.target.files[0];
+      let formData = new FormData();
+      formData.append("file", file);
+      this.$api
+        .importDatabankimportDataBackList(formData)
+        .then((res) => {
+          console.log(res)
+          if (res.data.fullStatus == "全部成功") {
+            self.$emit("backData",res.data.questionList)
+            self.$message.success("全部导入成功");
+          } else {
+            let url = baseUrls.baseURL + "common/download?fileName=" + res.data.errorExcel.msg;
+            let link = document.createElement("a");
+            let fileName = "导入模板" + ".xlsx";
+            document.body.appendChild(link);
+            link.href = url;
+            link.dowmload = fileName;
+            link.click();
+            link.remove();
+            if(res.data.fullStatus == '部分成功'){
+              self.$emit("backData",res.data.questionList)
+              self.$message.warning("部分导入成功,请打开文档查看错误原因");
+            }else{
+              self.$message.error("导入失败,请打开文档查看错误原因");
+            }
+          }
+        })
+        .finally(() => {
+          e.target.value = "";
+        });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.swq {
+  text-align: center;
+  border-bottom: 1px solid #eee;
+}
+.dowmStys {
+  color: blue;
+  cursor: pointer;
+}
+</style>

+ 21 - 25
src/views/resource/bankManagement/testPaperManagement/index.vue

@@ -16,14 +16,14 @@
       @editInfo="editInfo"
     >
       <template slot="btn" slot-scope="props">
-        <!-- <el-button type="text" @click="addClick(props.scope.row, 1)"
-          >修改基本信息</el-button
+        <el-button type="text" @click="addClick(props.scope.row, 1)"
+          >基本信息</el-button
         >
         <el-button type="text" @click="addClick(props.scope.row, 2)"
-          >修改试卷题库</el-button
-        > -->
-        <el-button type="text" @click="addClick(props.scope.row, 1)"
-          >编辑</el-button
+          >题目内容</el-button
+        >
+        <el-button type="text" @click="preview(props.scope.row.examId)"
+          >预览</el-button
         >
         <el-button type="text" @click="del(props.scope.row)">删除</el-button>
       </template>
@@ -35,6 +35,7 @@
       @handleSizeChange="handleSizeChange"
       @handleCurrentChange="handleCurrentChange"
     />
+    <test-paper-preview ref="testPaperPreview" />
   </div>
 </template>
 
@@ -42,9 +43,10 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import testPaperPreview from "@/components/testPaperPreview";
 export default {
   name: "TestPaperManagement",
-  components: { tableList, pagination, searchBoxNew },
+  components: { tableList, pagination, searchBoxNew, testPaperPreview },
   data() {
     return {
       loading: false, //当前表单加载是否加载动画
@@ -55,7 +57,7 @@ export default {
         num: true,
         border: true,
         choice: true,
-        changeWidth: "140px",
+        changeWidth: "240px",
         addHide: false,
         backFatherBtn: {
           status: false,
@@ -115,12 +117,12 @@ export default {
         {
           label: "试卷编码",
           prop: "code",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "名称前缀",
           prop: "prefixName",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "试卷名称",
@@ -134,7 +136,7 @@ export default {
           prop2: "projectName",
           prop3: "businessName",
           prop4: "subjectName",
-          hidden: true,
+          hidden: false,
           scope: "eduTypes",
         },
         {
@@ -159,7 +161,7 @@ export default {
           label: "关联商品",
           prop: "goodsList",
           prop1: "goodsName",
-          hidden: true,
+          hidden: false,
           scope: "aboutChapter",
           int: 6,
         },
@@ -175,6 +177,9 @@ export default {
     this.search();
   },
   methods: {
+    preview(id) {
+      this.$refs.testPaperPreview.openBox(1, id);
+    },
     editInfo(v) {
       this.addClick(v, 1);
     },
@@ -243,13 +248,15 @@ export default {
         });
         return;
       }
-      if (int === 1) {
+      if (int === 1 ||int === 2) {
         const jump = () => {
+          this.$store.dispatch("changetestPaperPage", null);
           this.$router.push({
             path: "editPaper",
             query: {
               id: v.examId,
               code: v.code,
+              name:int
             },
           });
         };
@@ -271,16 +278,6 @@ export default {
         }
         return;
       }
-      if (int === 2) {
-        this.$router.push({
-          path: "editPaperTopicEditPaper",
-          query: {
-            id: v.examId,
-            code: v.code,
-          },
-        });
-        return;
-      }
     },
     handleSizeChange(v) {
       this.formData.pageSize = v;
@@ -385,5 +382,4 @@ export default {
     margin: 5px 0px;
   }
 }
-</style>
-
+</style>

+ 0 - 0
src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/wordPop.vue → src/views/resource/bankManagement/testPaperManagement/wordPop.vue


+ 51 - 14
src/views/resource/bankManagement/topicManagement/index.vue

@@ -14,12 +14,16 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="questionId"
     >
       <template slot="customize">
         <el-button size="medium" @click="dialogDRword = true" type="success"
           >Word批量导入</el-button
         ><el-button size="medium" @click="dialogDRexcel = true" type="success"
           >Excel批量导入</el-button
+        ><el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
         >
       </template>
       <template slot="btn" slot-scope="props">
@@ -84,7 +88,7 @@
     </el-dialog>
     <el-dialog
       @closed="loadingClose"
-      width="1080px"
+      width="1180px"
       :visible.sync="innerVisiblePaperTopic"
       append-to-body
       :show-close="false"
@@ -278,6 +282,7 @@ export default {
         border: true,
         choice: true,
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -341,7 +346,13 @@ export default {
         {
           label: "题目编码",
           prop: "code",
+          hidden: false,
+        },
+        {
+          label: "题目类型",
+          prop: "type",
           hidden: true,
+          scope: "topic",
         },
         {
           label: "标题前缀",
@@ -349,17 +360,12 @@ export default {
           hidden: true,
         },
         {
-          label: "题目标题",
+          label: "题目详细",
           prop: "content",
           hidden: true,
-          scope: "editInfoHTML",
-          width: "280px",
-        },
-        {
-          label: "题目类型",
-          prop: "type",
-          hidden: true,
-          scope: "topic",
+          scope: "htmlInfo",
+          width: "600px",
+          dontCenter: true,
         },
         {
           label: "知识点",
@@ -371,20 +377,20 @@ export default {
         {
           label: "适用业务层级",
           prop: "businessList",
-          hidden: true,
+          hidden: false,
           scope: "mapTypesMores",
         },
         {
           label: "最后编辑时间",
           prop: "updateTime",
           scope: "aTimeList",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "创建时间",
           prop: "createTime",
           scope: "aTimeList",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "发布状态",
@@ -406,7 +412,7 @@ export default {
           label: "关联试卷",
           prop: "examList",
           prop1: "examName",
-          hidden: true,
+          hidden: false,
           scope: "aboutChapter",
           int: 5,
         },
@@ -467,6 +473,36 @@ export default {
     this.search();
   },
   methods: {
+    batchDel() {
+      if (!this.$refs.tableList.allCheckData.length) {
+        this.$message.warning("请勾选需要删除的题目");
+        return;
+      }
+      this.$confirm(`此操作将永久删除所勾选的${this.$refs.tableList.allCheckData.length}条题目, 是否继续?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          const questionIdsList = this.$refs.tableList.allCheckData.map(
+            (item) => {
+              return item.questionId;
+            }
+          );
+          this.$api
+            .editbankquestion({
+              status: -1,
+              questionIds: questionIdsList,
+            })
+            .then((res) => {
+              this.$message.success("批量删除成功");
+              this.$refs.tableList.clearMoreActive();
+              this.search(1);
+            });
+        })
+        .catch(() => {});
+      // console.log(this.$refs.tableList.)
+    },
     clearData() {
       this.$refs.wordpop.formData = {
         eduId: "",
@@ -492,6 +528,7 @@ export default {
           pageSize: 10,
           pageNum: 1,
         };
+        this.$refs.tableList.clearMoreActive();
       }
       this.$api
         .inquirebankquestionList(this.formData)

+ 175 - 97
src/views/resource/bankManagement/volumeManagement/add/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="volumeManagementAdd">
-    <div class="boxWidth">
-      <el-form
-        label-position="right"
-        label-width="120px"
-        :model="listData"
-        :rules="rules"
-        ref="listData"
-      >
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <div class="boxWidth">
         <el-form-item label="适用业务层级" :required="true">
           <el-select
             v-model="eduType"
@@ -125,100 +125,107 @@
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="管理章卷">
-          <div class="dis_plays">
-            <div>
-              <el-button size="small" @click="openBoxs">添加章卷</el-button>
-            </div>
-            <div style="color: #f56c6c">
-              <span style="margin-right: 10px"
-                >章卷总数:{{ tableData.length }}</span
-              >
-              <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
-            </div>
+      </div>
+      <el-form-item label="管理章卷">
+        <div class="dis_plays">
+          <div>
+            <el-button size="small" @click="openBoxs">调用已有数据</el-button>
+            <el-button size="small" @click="addChapter"
+              >自定义添加章卷</el-button
+            >
           </div>
-          <el-table
-            :data="tableData"
-            border
-            :header-cell-style="{
-              'background-color': '#eee',
-              padding: '8px',
-              color: '#333',
-            }"
-            :default-sort="{ prop: 'sort', order: 'ascending' }"
-          >
-            <el-table-column
-              v-for="(item, index) in tableSet"
-              :width="item.width"
-              :key="index"
-              :label="item.label"
-              align="center"
-              :show-overflow-tooltip="true"
-              header-align="center"
-              :sortable="item.prop === 'sort'"
-              sort-by="sort"
-              :prop="item.prop"
+          <div style="color: #f56c6c">
+            <span style="margin-right: 10px"
+              >章卷总数:{{ tableData.length }}</span
             >
-              <template slot-scope="scope">
-                <span v-if="item.scope === 'types'">{{
+            <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
+          </div>
+        </div>
+        <el-table
+          :data="tableData"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+          :default-sort="{ prop: 'sort', order: 'ascending' }"
+        >
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :sortable="item.prop === 'sort'"
+            sort-by="sort"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'types'">{{
+                scope.row[item.prop] === 1
+                  ? "录播"
+                  : scope.row[item.prop] === 2
+                  ? "直播"
+                  : scope.row[item.prop] === 3
+                  ? "回放"
+                  : "未知"
+              }}</span>
+              <span v-else-if="item.scope === 'Status'">
+                {{
                   scope.row[item.prop] === 1
-                    ? "录播"
-                    : scope.row[item.prop] === 2
-                    ? "直播"
-                    : scope.row[item.prop] === 3
-                    ? "回放"
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
                     : "未知"
-                }}</span>
-                <span v-else-if="item.scope === 'Status'">
-                  {{
-                    scope.row[item.prop] === 1
-                      ? "发布"
-                      : scope.row[item.prop] === 0
-                      ? "未发布"
-                      : "未知"
-                  }}
-                </span>
-                <div v-else-if="item.scope === 'inputs'">
-                  <el-input-number
-                    style="width: 50px"
-                    size="small"
-                    :controls="false"
-                    v-model="scope.row[item.prop]"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </div>
-                <span v-else>{{ scope.row[item.prop] }}</span></template
-              >
-            </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              fixed="right"
-              width="100px"
+                }}
+              </span>
+              <div v-else-if="item.scope === 'inputs'">
+                <el-input-number
+                  style="width: 50px"
+                  size="small"
+                  :controls="false"
+                  v-model="scope.row[item.prop]"
+                  controls-position="right"
+                  :min="0"
+                ></el-input-number>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
             >
-              <template slot-scope="scope">
-                <el-button type="text" @click="delList(scope.row, scope.$index)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="backPage">取消</el-button>
-          <el-button
-            type="primary"
-            @click="submitIns('listData')"
-            :loading="disabledBtn"
-            >确定</el-button
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="180px"
           >
-        </el-form-item>
-      </el-form>
-    </div>
+            <template slot-scope="scope">
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >章卷内容</el-button
+              >
+              <el-button type="text" @click="delList(scope.row, scope.$index)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="backPage">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submitIns('listData')"
+          :loading="disabledBtn"
+          >确定</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
-      width="800px"
+      width="1100px"
       :show-close="false"
       :close-on-click-modal="false"
     >
@@ -312,15 +319,17 @@
         >
       </span>
     </el-dialog>
+    <addChapterjs ref="addChapterjs" @backData="backData" />
   </div>
 </template>
 
 <script>
+import addChapterjs from "../addChapterjs.vue";
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 import tableList from "@/components/tableList";
 export default {
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination, addChapterjs },
   name: "VolumeManagementAdd",
   data() {
     return {
@@ -355,7 +364,9 @@ export default {
         { label: "排序", prop: "sort", scope: "inputs", width: "100" },
         { label: "章卷编码", prop: "code", width: "120" },
         { label: "标题前缀", prop: "prefixName", width: "180" },
-        { label: "章卷标题", prop: "name", width: "320" },
+        { label: "章卷标题", prop: "name" },
+        { label: "试卷数量", prop: "examNum", width: "120" },
+        { label: "题数量", prop: "questionNum", width: "120" },
         {
           label: "发布状态",
           prop: "publishStatus",
@@ -399,7 +410,72 @@ export default {
     this.localData = this.$methodsTools.getBusinessList();
     this.getDict();
   },
+  activated() {
+    if (this.$store.getters.chapterExamPage) {
+      this.$api
+        .obtainbankchapter(this.$store.getters.chapterExamPage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.chapterExamId == this.$store.getters.chapterExamPage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changechapterExamPage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changechapterExamPage", {
+          name: "volumeManagementAdd",
+          id: v.chapterExamId,
+        });
+        this.$router.push({
+          path: "chapterVolumeManagementEdit",
+          query: {
+            id: v.chapterExamId,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "ChapterVolumeManagementEdit";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "ChapterVolumeManagementEdit",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
+    /**
+     * 打开添加章组件
+     */
+    addChapter() {
+      if (!this.newSujectApis.subjectId) {
+        this.$message.warning("请先选择科目");
+        return;
+      }
+      this.$refs.addChapterjs.openBoxs([this.newSujectApis]);
+    },
+    /**
+     * 添加章-返回数据
+     */
+    backData(v) {
+      this.$api.inquirebankchapterList({ chapterExamIds: v }).then((res) => {
+        this.activeLists = res.rows;
+        this.submitForm();
+      });
+    },
     unTime(val) {
       let a = `${val.businessId}-${val.subjectId}`;
       if (this.sujectApis == a) {
@@ -690,12 +766,14 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
       this.$message.success("添加成功");
-      this.activeLists = [];
     },
     delList(item, index) {
       this.tableData.splice(index, 1);
       this.$message.success("删除成功");
     },
+    closedFunc(){
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 128 - 0
src/views/resource/bankManagement/volumeManagement/addChapterjs.vue

@@ -0,0 +1,128 @@
+<template>
+  <div id="addChapter">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="700px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">添加章卷</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <div>
+        <p>
+          <el-button :size="size" type="primary" @click="addChapterList"
+            >添加</el-button
+          >
+        </p>
+        <el-form label-width="100px" class="elform_style">
+          <div v-for="(item, index) in list" :key="index" class="dis_box">
+            <div class="left_box">
+              <el-form-item label="标题前缀">
+                <el-input v-model="item.prefixName"></el-input>
+                <p class="p_style">注:便于检索、归类,以及区分一样的标题</p>
+              </el-form-item>
+              <el-form-item label="章卷标题" required>
+                <el-input v-model="item.name"></el-input>
+                <p class="p_style">
+                  注:请尽量规范易懂,方便在课程目录表呈现给学员
+                </p>
+              </el-form-item>
+            </div>
+            <div class="clear_style">
+              <el-button :size="size" @click="list.splice(index, 1)"
+                >删除</el-button
+              >
+            </div>
+          </div></el-form
+        >
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="!list.length"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      size: "small",
+      dialogVisible: false,
+      list: [],
+    };
+  },
+  methods: {
+    addChapterList() {
+      this.list.push({});
+    },
+    openBoxs(arr) {
+      this.businList = JSON.parse(JSON.stringify(arr));
+      this.list = [{}]
+      this.dialogVisible = true;
+    },
+    submitForm() {
+      const arr = [];
+      this.list.forEach((item, index) => {
+        if (!item.name && item.name !== 0) {
+          arr.push(index + 1);
+        }
+      });
+      if (arr.length) {
+        this.$message.error(
+          `第${arr.join(",")}条数据没有填写章卷标题,请填写完整后提交`
+        );
+        return;
+      }
+      let data = this.list.map((item) => {
+        item.businessList = this.businList;
+        item.status = 1;
+        item.publishStatus = 1;
+        return item;
+      });
+      this.$api.addMorebankchapter(data).then((res) => {
+        this.dialogVisible = false;
+        this.$emit("backData", res.data);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dis_box {
+  background-color: #eee;
+  padding: 10px 10px 0px;
+  display: flex;
+  margin-bottom: 16px;
+  .left_box {
+    flex: 1;
+  }
+  .clear_style {
+    flex-shrink: 0;
+    width: 80px;
+    vertical-align: top;
+    text-align: center;
+  }
+}
+.elform_style{
+    max-height: 620px;
+    overflow: auto;
+}
+.p_style {
+  font-size: 12px;
+  color: #a4a4a4;
+  margin: 0;
+}
+</style>

+ 180 - 100
src/views/resource/bankManagement/volumeManagement/edit/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="volumeManagementEdit">
-    <div class="boxWidth">
-      <el-form
-        label-position="right"
-        label-width="120px"
-        :model="listData"
-        :rules="rules"
-        ref="listData"
-      >
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <div class="boxWidth">
         <el-form-item label="适用业务层级" :required="true">
           <el-select
             v-model="eduType"
@@ -110,100 +110,107 @@
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="管理章卷">
-          <div class="dis_plays">
-            <div>
-              <el-button size="small" @click="openBoxs">添加章卷</el-button>
-            </div>
-            <div style="color: #f56c6c">
-              <span style="margin-right: 10px"
-                >章卷总数:{{ tableData.length }}</span
-              >
-              <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
-            </div>
+      </div>
+      <el-form-item label="管理章卷">
+        <div class="dis_plays">
+          <div>
+            <el-button size="small" @click="openBoxs">调用已有数据</el-button>
+            <el-button size="small" @click="addChapter"
+              >自定义添加章卷</el-button
+            >
           </div>
-          <el-table
-            :data="tableData"
-            border
-            :header-cell-style="{
-              'background-color': '#eee',
-              padding: '8px',
-              color: '#333',
-            }"
-            :default-sort="{ prop: 'sort', order: 'ascending' }"
-          >
-            <el-table-column
-              v-for="(item, index) in tableSet"
-              :width="item.width"
-              :key="index"
-              :label="item.label"
-              align="center"
-              :show-overflow-tooltip="true"
-              header-align="center"
-              :sortable="item.prop === 'sort'"
-              sort-by="sort"
-              :prop="item.prop"
+          <div style="color: #f56c6c">
+            <span style="margin-right: 10px"
+              >章卷总数:{{ tableData.length }}</span
             >
-              <template slot-scope="scope">
-                <span v-if="item.scope === 'types'">{{
+            <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
+          </div>
+        </div>
+        <el-table
+          :data="tableData"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+          :default-sort="{ prop: 'sort', order: 'ascending' }"
+        >
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :sortable="item.prop === 'sort'"
+            sort-by="sort"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'types'">{{
+                scope.row[item.prop] === 1
+                  ? "录播"
+                  : scope.row[item.prop] === 2
+                  ? "直播"
+                  : scope.row[item.prop] === 3
+                  ? "回放"
+                  : "未知"
+              }}</span>
+              <span v-else-if="item.scope === 'Status'">
+                {{
                   scope.row[item.prop] === 1
-                    ? "录播"
-                    : scope.row[item.prop] === 2
-                    ? "直播"
-                    : scope.row[item.prop] === 3
-                    ? "回放"
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
                     : "未知"
-                }}</span>
-                <span v-else-if="item.scope === 'Status'">
-                  {{
-                    scope.row[item.prop] === 1
-                      ? "发布"
-                      : scope.row[item.prop] === 0
-                      ? "未发布"
-                      : "未知"
-                  }}
-                </span>
-                <div v-else-if="item.scope === 'inputs'">
-                  <el-input-number
-                    style="width: 50px"
-                    size="small"
-                    :controls="false"
-                    v-model="scope.row[item.prop]"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </div>
-                <span v-else>{{ scope.row[item.prop] }}</span></template
-              >
-            </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              fixed="right"
-              width="100px"
+                }}
+              </span>
+              <div v-else-if="item.scope === 'inputs'">
+                <el-input-number
+                  style="width: 50px"
+                  size="small"
+                  :controls="false"
+                  v-model="scope.row[item.prop]"
+                  controls-position="right"
+                  :min="0"
+                ></el-input-number>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
             >
-              <template slot-scope="scope">
-                <el-button type="text" @click="delList(scope.row, scope.$index)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="backPage">取消</el-button>
-          <el-button
-            type="primary"
-            @click="submitIns('listData')"
-            :loading="disabledBtn"
-            >确定</el-button
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="180px"
           >
-        </el-form-item>
-      </el-form>
-    </div>
+            <template slot-scope="scope">
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >章卷内容</el-button
+              >
+              <el-button type="text" @click="delList(scope.row, scope.$index)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="backPage">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submitIns('listData')"
+          :loading="disabledBtn"
+          >确定</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
-      width="800px"
+      width="1100px"
       :show-close="false"
       :close-on-click-modal="false"
     >
@@ -297,6 +304,7 @@
         >
       </span>
     </el-dialog>
+    <addChapterjs ref="addChapterjs" @backData="backData" />
   </div>
 </template>
 
@@ -304,9 +312,10 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 import tableList from "@/components/tableList";
+import addChapterjs from "../addChapterjs.vue";
 export default {
   name: "VolumeManagementEdit",
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination, addChapterjs },
   data() {
     return {
       disabledBtn: false,
@@ -340,7 +349,10 @@ export default {
         { label: "排序", prop: "sort", scope: "inputs", width: "100" },
         { label: "章卷编码", prop: "code", width: "120" },
         { label: "标题前缀", prop: "prefixName", width: "180" },
-        { label: "章卷标题", prop: "name", width: "320" },
+        { label: "章卷标题", prop: "name" },
+        { label: "试卷数量", prop: "examNum", width: "120" },
+        { label: "题数量", prop: "questionNum", width: "120" },
+
         {
           label: "发布状态",
           prop: "publishStatus",
@@ -366,13 +378,79 @@ export default {
       },
       disCheckList: [], //已选转禁用复选列表
       activeLists: [],
+      pageId: this.$route.query.id,
     };
   },
   mounted() {
     this.$modal.loading("正在导入数据,请稍后...");
     this.getDict();
   },
+  activated() {
+    if (this.$store.getters.chapterExamPage) {
+      this.$api
+        .obtainbankchapter(this.$store.getters.chapterExamPage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.chapterExamId == this.$store.getters.chapterExamPage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changechapterExamPage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changechapterExamPage", {
+          name: "volumeManagementEdit",
+          id: v.chapterExamId,
+        });
+        this.$router.push({
+          path: "chapterVolumeManagementEdit",
+          query: {
+            id: v.chapterExamId,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "ChapterVolumeManagementEdit";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "ChapterVolumeManagementEdit",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
+    /**
+     * 打开添加章组件
+     */
+    addChapter() {
+      if (!this.newSujectApis.subjectId) {
+        this.$message.warning("请先选择科目");
+        return;
+      }
+      this.$refs.addChapterjs.openBoxs([this.newSujectApis]);
+    },
+    /**
+     * 添加章-返回数据
+     */
+    backData(v) {
+      this.$api.inquirebankchapterList({ chapterExamIds: v }).then((res) => {
+        this.activeLists = res.rows;
+        this.submitForm();
+      });
+    },
     openBoxs() {
       if (!this.newSujectApis.subjectId) {
         this.$message.warning("请先选择科目");
@@ -398,7 +476,7 @@ export default {
     },
     getInfosList() {
       this.$api
-        .inquireBankchapterModule({ moduleExamId: this.$route.query.id })
+        .inquireBankchapterModule({ moduleExamId: this.pageId })
         .then((result) => {
           this.tableData = result.data;
         });
@@ -425,11 +503,11 @@ export default {
     },
 
     search() {
-      this.$api.obtainBankModule(this.$route.query.id).then((res) => {
+      this.$api.obtainBankModule(this.pageId).then((res) => {
         this.listData = res.data;
       });
       this.$api
-        .inquireBankModulebusiness({ type: 4, majorId: this.$route.query.id })
+        .inquireBankModulebusiness({ type: 4, majorId: this.pageId })
         .then((res) => {
           this.eduType = res.rows[0].educationTypeId;
           this.changeEduType();
@@ -681,12 +759,14 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
       this.$message.success("添加成功");
-      this.activeLists = [];
     },
     delList(item, index) {
       this.tableData.splice(index, 1);
       this.$message.success("删除成功");
     },
+    closedFunc(){
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 69 - 5
src/views/resource/videoManagement/chapter/add/index.vue

@@ -206,7 +206,7 @@
         <div class="dis_plays">
           <div>
             <el-button size="small" @click="openBoxs">调用已有数据</el-button>
-            <el-button size="small" type="success" @click="dialogDR = true"
+            <el-button size="small" type="success" @click="dialogDRFunc"
               >Excel批量新增</el-button
             >
           </div>
@@ -283,12 +283,15 @@
             label="操作"
             align="center"
             fixed="right"
-            width="100px"
+            width="180px"
           >
             <template slot-scope="scope">
               <el-button type="text" @click="seeTheVideo(scope.row)"
                 >预览</el-button
               >
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >编辑</el-button
+              >
               <el-button type="text" @click="delList(scope.row)"
                 >删除</el-button
               >
@@ -412,6 +415,7 @@
       </span>
     </el-dialog>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogDR"
       width="660px"
       :show-close="false"
@@ -646,13 +650,59 @@ export default {
     this.localData = this.$methodsTools.getBusinessList();
     this.getDict();
   },
+  activated() {
+    if (this.$store.getters.festivalPage) {
+      this.$api
+        .obtainCourseSection(this.$store.getters.festivalPage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.sectionId == this.$store.getters.festivalPage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changefestivalPage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changefestivalPage", {
+          name: "chapterAdd",
+          id: v.sectionId,
+        });
+        this.$router.push({
+          path: "festivalEdit",
+          query: {
+            id: v.sectionId,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "FestivalEdit";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "FestivalEdit",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
     seeTheVideo(item) {
       this.$refs.preview.diavosFun(item);
     },
     getDowm() {
       let url =
-        baseUrls.BASE_IMG_URL + "/oss/images/file/20220304/1646382321115.xlsx";
+        baseUrls.BASE_IMG_URL + "oss/images/file/20220518/1652842582633.xlsx";
       let link = document.createElement("a");
       let fileName = "导入模板" + ".xlsx";
       document.body.appendChild(link);
@@ -661,13 +711,25 @@ export default {
       link.click();
       link.remove();
     },
+    dialogDRFunc(){
+      if (!this.newSujectApis.length) {
+        this.$message.error("请添加科目");
+        return;
+      }
+      this.dialogDR = true
+    },
     importMobleadd(e) {
+      if (!this.newSujectApis.length) {
+        this.$message.error("请添加科目");
+        return;
+      }
       var self = this;
       var file = e.target.files[0];
       let formData = new FormData();
+      formData.append("businessJson", JSON.stringify(this.newSujectApis));
       formData.append("file", file);
       this.$api
-        .drCourseSectionimportData(formData)
+        .drCourseSectionimportDataBusiness(formData)
         .then(async (res) => {
           if (res.code === 200) {
             if (!res.data.errorLog) {
@@ -1143,7 +1205,6 @@ export default {
           customClass: "myMessageClass",
         });
       }
-      this.activeLists = [];
     },
     delList(item) {
       this.tableData.map((items, indexs) => {
@@ -1153,6 +1214,9 @@ export default {
         }
       });
     },
+    closedFunc() {
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 105 - 34
src/views/resource/videoManagement/chapter/edit/index.vue

@@ -178,7 +178,7 @@
         <div class="dis_plays">
           <div>
             <el-button size="small" @click="openBoxs">调用已有数据</el-button>
-            <el-button size="small" type="success" @click="dialogDR = true"
+            <el-button size="small" type="success" @click="dialogDRFunc"
               >Excel批量新增</el-button
             >
           </div>
@@ -255,12 +255,15 @@
             label="操作"
             align="center"
             fixed="right"
-            width="100px"
+            width="180px"
           >
             <template slot-scope="scope"
               ><el-button type="text" @click="seeTheVideo(scope.row)"
                 >预览</el-button
               >
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >编辑</el-button
+              >
               <el-button type="text" @click="delList(scope.row)"
                 >删除</el-button
               >
@@ -280,6 +283,7 @@
       </el-form-item>
     </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
       width="1000px"
       :show-close="false"
@@ -603,6 +607,7 @@ export default {
       disCheckList: [], //已选转禁用复选列表
       activeLists: [],
       noStudent: true,
+      pageId: this.$route.query.id,
     };
   },
   watch: {
@@ -615,17 +620,61 @@ export default {
   },
   async mounted() {
     this.$modal.loading("正在导入数据,请稍后...");
-    this.$api
-      .gradecheckGoodsChange({ chapterId: this.$route.query.id })
-      .then((res) => {
-        if (res.data > 0) {
-          this.noStudent = false;
-        }
-      });
+    this.$api.gradecheckGoodsChange({ chapterId: this.pageId }).then((res) => {
+      if (res.data > 0) {
+        this.noStudent = false;
+      }
+    });
     await this.getDict();
     this.search();
   },
+  activated() {
+    if (this.$store.getters.festivalPage) {
+      this.$api
+        .obtainCourseSection(this.$store.getters.festivalPage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.sectionId == this.$store.getters.festivalPage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changefestivalPage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changefestivalPage", {
+          name: "chapterEdit",
+          id: v.sectionId,
+        });
+        this.$router.push({
+          path: "festivalEdit",
+          query: {
+            id: v.sectionId,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "FestivalEdit";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "FestivalEdit",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
     seeTheVideo(item) {
       this.$refs.preview.diavosFun(item);
     },
@@ -634,7 +683,7 @@ export default {
      */
     getDowm() {
       let url =
-        baseUrls.BASE_IMG_URL + "/oss/images/file/20220304/1646382321115.xlsx";
+        baseUrls.BASE_IMG_URL + "oss/images/file/20220518/1652842582633.xlsx";
       let link = document.createElement("a");
       let fileName = "导入模板" + ".xlsx";
       document.body.appendChild(link);
@@ -643,18 +692,30 @@ export default {
       link.click();
       link.remove();
     },
+    dialogDRFunc() {
+      if (!this.newSujectApis.length) {
+        this.$message.error("请添加科目");
+        return;
+      }
+      this.dialogDR = true;
+    },
     /**
      *
      * @param {Object} e
      * @remards 导入逻辑
      */
     importMobleadd(e) {
+      if (!this.newSujectApis.length) {
+        this.$message.error("请添加科目");
+        return;
+      }
       var self = this;
       var file = e.target.files[0];
       let formData = new FormData();
+      formData.append("businessJson", JSON.stringify(this.newSujectApis));
       formData.append("file", file);
       this.$api
-        .drCourseSectionimportData(formData)
+        .drCourseSectionimportDataBusiness(formData)
         .then(async (res) => {
           if (res.code === 200) {
             if (!res.data.errorLog) {
@@ -808,11 +869,9 @@ export default {
      * 初始化获取该章管理节数据
      */
     getInfosList() {
-      this.$api
-        .inquireCoursechaptersectionlist(this.$route.query.id)
-        .then((result) => {
-          this.tableData = result.data;
-        });
+      this.$api.inquireCoursechaptersectionlist(this.pageId).then((result) => {
+        this.tableData = result.data;
+      });
     },
     /**
      *
@@ -852,20 +911,18 @@ export default {
      */
     search() {
       this.$api
-        .obtainCoursechapter(this.$route.query.id)
+        .obtainCoursechapter(this.pageId)
         .then((res) => {
           this.bfImg = res.data.coverUrl;
           this.listData = res.data;
-          this.$api
-            .obtainCoursechapterbusiness(this.$route.query.id)
-            .then((result) => {
-              var arrays = [];
-              result.data.map((item) => {
-                arrays.push(item.businessId + "-" + item.subjectId);
-              });
-              this.sujectApis = arrays;
-              this.getInfosList();
+          this.$api.obtainCoursechapterbusiness(this.pageId).then((result) => {
+            var arrays = [];
+            result.data.map((item) => {
+              arrays.push(item.businessId + "-" + item.subjectId);
             });
+            this.sujectApis = arrays;
+            this.getInfosList();
+          });
         })
         .finally(() => {
           this.$modal.closeLoading();
@@ -1076,7 +1133,7 @@ export default {
       });
       var dataInfos = {
         status: 1,
-        chapterId: this.$route.query.id,
+        chapterId: this.pageId,
         businessList: this.newSujectApis,
         sectionIdList: sectionIdList,
         coverUrl: this.listData.coverUrl,
@@ -1092,9 +1149,15 @@ export default {
             this.$store
               .dispatch("tagsView/exitView", this.$route)
               .then((res) => {
-                this.$router.push({
-                  path: "chapter",
-                });
+                if (this.$store.getters.modulePage) {
+                  this.$router.push({
+                    path: this.$store.getters.modulePage.name,
+                  });
+                } else {
+                  this.$router.push({
+                    path: "chapter",
+                  });
+                }
               });
           }, 500);
         })
@@ -1107,9 +1170,15 @@ export default {
      */
     backPage() {
       this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
-        this.$router.push({
-          path: "chapter",
-        });
+        if (this.$store.getters.modulePage) {
+          this.$router.push({
+            path: this.$store.getters.modulePage.name,
+          });
+        } else {
+          this.$router.push({
+            path: "chapter",
+          });
+        }
       });
     },
     /**
@@ -1228,7 +1297,6 @@ export default {
           customClass: "myMessageClass",
         });
       }
-      this.activeLists = [];
     },
     /**
      *
@@ -1243,6 +1311,9 @@ export default {
         }
       });
     },
+    closedFunc() {
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 2 - 1
src/views/resource/videoManagement/chapter/index.vue

@@ -150,7 +150,7 @@ export default {
           label: "学习时长",
           prop: "durationTime",
           hidden: true,
-          scope:"convert",
+          scope: "convert",
         },
         {
           label: "最后编辑时间",
@@ -254,6 +254,7 @@ export default {
         });
       } else {
         const jump = () => {
+          this.$store.dispatch("changemodulePage", null);
           this.$router.push({
             path: "chapterEdit",
             query: {

+ 5 - 6
src/views/resource/videoManagement/courseManagement/basicInfoAdd/index.vue

@@ -394,7 +394,6 @@ export default {
           } else {
             this.newSchoolOption = newSchoolOption;
           }
-
           for (let i = 0; i < this.majorOption.length; i++) {
             if (
               this.majorOption[i].courseArrays.indexOf(item.projectId) !== -1
@@ -402,11 +401,11 @@ export default {
               newMajorOption.push(this.majorOption[i]);
             }
           }
-          if (!newMajorOption.length) {
-            this.newMajorOption = this.majorOption;
-          } else {
+          // if (!newMajorOption.length) {
+          //   this.newMajorOption = this.majorOption;
+          // } else {
             this.newMajorOption = newMajorOption;
-          }
+          // }
           for (let i = 0; i < this.sujectOption.length; i++) {
             if (
               this.sujectOption[i].courseArrays.indexOf(item.projectId) !== -1
@@ -594,4 +593,4 @@ export default {
   text-align: center;
   border: none;
 }
-</style>
+</style>

+ 5 - 5
src/views/resource/videoManagement/courseManagement/basicInfoEdit/index.vue

@@ -480,11 +480,11 @@ export default {
               newMajorOption.push(this.majorOption[i]);
             }
           }
-          if (!newMajorOption.length) {
-            this.newMajorOption = this.majorOption;
-          } else {
+          // if (!newMajorOption.length) {
+          //   this.newMajorOption = this.majorOption;
+          // } else {
             this.newMajorOption = newMajorOption;
-          }
+          // }
 
           for (let i = 0; i < this.sujectOption.length; i++) {
             if (
@@ -716,4 +716,4 @@ export default {
   text-align: center;
   border: none;
 }
-</style>
+</style>

+ 120 - 2
src/views/resource/videoManagement/courseManagement/chapterContent/index.vue

@@ -26,6 +26,7 @@
       lazy
       :load="load"
       :props="layoutTreeProps"
+      default-expand-all
       @node-click="handleNodeClick"
     >
       <span class="custom-tree-node" slot-scope="{ node, data }">
@@ -48,6 +49,24 @@
           >
             关联试卷
           </el-button>
+          <el-button
+            v-if="data.type === 2 && getShowStatus(data)"
+            type="text"
+            size="mini"
+            style="color: orange"
+            @click.stop="preview(node, data)"
+          >
+            预览
+          </el-button>
+          <el-button
+            v-if="data.type === 3"
+            type="text"
+            size="mini"
+            style="color: orange"
+            @click.stop="preview(node, data)"
+          >
+            预览
+          </el-button>
         </span>
       </span>
     </el-tree>
@@ -338,15 +357,19 @@
         <el-button type="primary" @click="submitPZ">确 定</el-button>
       </span>
     </el-dialog>
+    <test-paper-preview ref="testPaperPreview" />
+    <video-preview ref="preview" />
   </div>
 </template>
 
 <script>
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
+import testPaperPreview from "@/components/testPaperPreview";
+import videoPreview from "@/components/videoPreview";
 export default {
   name: "ChapterContent",
-  components: { searchBoxNew, pagination },
+  components: { searchBoxNew, pagination, testPaperPreview, videoPreview },
   data() {
     return {
       disabledBtn: false,
@@ -481,6 +504,49 @@ export default {
       },
     };
   },
+  computed: {
+    /**
+     * 查询是否关联试卷
+     */
+    getShowStatus: function () {
+      return function (item) {
+        var ints = item.id.split("-").map(Number);
+        var arr = [];
+        if (ints[0] === 1) {
+          arr.push(ints[1]);
+          if (ints[2]) {
+            arr.push(ints[2]);
+          } else {
+            arr.push(0);
+          }
+          if (ints[3]) {
+            arr.push(ints[3]);
+          } else {
+            arr.push(0);
+          }
+        }
+        if (ints[0] === 2) {
+          arr.push(0);
+          arr.push(ints[1]);
+          if (ints[2]) {
+            arr.push(ints[2]);
+          } else {
+            arr.push(0);
+          }
+        }
+        if (ints[0] === 3) {
+          arr.push(0);
+          arr.push(0);
+          arr.push(ints[1]);
+        }
+        var atys = arr.join("-");
+        var setTs = this.menuExamList.some((items) => {
+          return items.onlyId == atys;
+        });
+        return setTs;
+      };
+    },
+  },
   mounted() {
     this.$api
       .gradecheckGoodsChange({ courseId: this.$route.query.id })
@@ -493,6 +559,55 @@ export default {
     this.search();
   },
   methods: {
+    preview(node, data) {
+      if (data.type === 2) {
+        var ints = data.id.split("-").map(Number);
+        var arr = [];
+        if (ints[0] === 1) {
+          arr.push(ints[1]);
+          if (ints[2]) {
+            arr.push(ints[2]);
+          } else {
+            arr.push(0);
+          }
+          if (ints[3]) {
+            arr.push(ints[3]);
+          } else {
+            arr.push(0);
+          }
+        }
+        if (ints[0] === 2) {
+          arr.push(0);
+          arr.push(ints[1]);
+          if (ints[2]) {
+            arr.push(ints[2]);
+          } else {
+            arr.push(0);
+          }
+        }
+        if (ints[0] === 3) {
+          arr.push(0);
+          arr.push(0);
+          arr.push(ints[1]);
+        }
+        var atys = arr.join("-");
+        var setTs = this.menuExamList.some((items) => {
+          return items.onlyId == atys;
+        });
+        if (setTs) {
+          this.menuExamList.map((items) => {
+            if (items.onlyId == atys) {
+              this.$refs.testPaperPreview.openBox(1, items.examId);
+            }
+          });
+        }
+      }
+      if (data.type === 3) {
+        this.$api.obtainCourseSection(data.CodeId).then((res) => {
+          this.$refs.preview.diavosFun(res.data);
+        });
+      }
+    },
     initSort() {
       this.sortList = JSON.parse(JSON.stringify(this.tableDataInfos));
     },
@@ -1077,6 +1192,9 @@ export default {
           resolve(arrays);
         });
       }
+      if (tree.type === 3) {
+        resolve([]);
+      }
       return;
     },
     handleSizeChange(v) {
@@ -1229,4 +1347,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 23 - 9
src/views/resource/videoManagement/courseManagement/editCourse/index.vue

@@ -1,26 +1,40 @@
 <template>
   <div id="editCourse">
     <el-tabs v-model="activeName" type="card">
-    <el-tab-pane label="课程基本信息" name="first"><basic-info-edit /></el-tab-pane>
-    <el-tab-pane label="课程章节内容" name="second"><chapter-content /></el-tab-pane>
-  </el-tabs>
+      <el-tab-pane label="课程基本信息" name="first"
+        ><basic-info-edit
+      /></el-tab-pane>
+      <el-tab-pane label="课程章节内容" name="second"
+        ><chapter-content
+      /></el-tab-pane>
+    </el-tabs>
   </div>
 </template>
 
 <script>
-import basicInfoEdit from "../basicInfoEdit/index.vue"
-import chapterContent from "../chapterContent/index.vue"
+import basicInfoEdit from "../basicInfoEdit/index.vue";
+import chapterContent from "../chapterContent/index.vue";
 export default {
-  components:{basicInfoEdit,chapterContent},
-  name:"EditCourse",
+  components: { basicInfoEdit, chapterContent },
+  name: "EditCourse",
   data() {
     return {
-      activeName:"first"
+      activeName: "first",
     };
   },
+  mounted() {
+    if (this.$route.query.name) {
+      if (this.$route.query.name == 1) {
+        this.activeName = "first";
+      }
+      if (this.$route.query.name == 2) {
+        this.activeName = "second";
+      }
+    }
+  },
   methods: {},
 };
 </script>
 
 <style lang="less" scoped>
-</style>
+</style>

+ 19 - 19
src/views/resource/videoManagement/courseManagement/index.vue

@@ -16,13 +16,13 @@
       @editInfo="editInfo"
     >
       <template slot="btn" slot-scope="props">
-        <!-- <el-button type="text" @click="addClick(props.scope.row, 0)"
+        <el-button type="text" @click="edit(props.scope.row, 1)"
           >基本信息</el-button
         >
-        <el-button type="text" @click="addClick(props.scope.row, 1)"
+        <el-button type="text" @click="edit(props.scope.row, 2)"
           >章节内容</el-button
-        > -->
-        <el-button type="text" @click="edit(props.scope.row)">修改</el-button>
+        >
+        <!-- <el-button type="text" @click="edit(props.scope.row)">修改</el-button> -->
         <el-button type="text" @click="del(props.scope.row)">删除</el-button>
       </template>
     </table-list>
@@ -54,7 +54,7 @@ export default {
         border: true,
         choice: true,
         addHide: false,
-        changeWidth: "160px",
+        changeWidth: "220px",
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -126,12 +126,12 @@ export default {
         {
           label: "课程编码",
           prop: "code",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "名称前缀",
           prop: "prefixName",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "课程名称",
@@ -147,12 +147,12 @@ export default {
         {
           label: "专业",
           prop: "categoryName",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "院校",
           prop: "schoolName",
-          hidden: true,
+          hidden: false,
         },
         {
           label: "业务层次",
@@ -184,12 +184,12 @@ export default {
           scope: "aTimeList",
           hidden: true,
         },
-        {
-          label: "课程章节",
-          prop: "courseId",
-          hidden: true,
-          scope: "aboutTrees",
-        },
+        // {
+        //   label: "课程章节",
+        //   prop: "courseId",
+        //   hidden: true,
+        //   scope: "aboutTrees",
+        // },
         {
           label: "关联商品",
           hidden: true,
@@ -212,12 +212,13 @@ export default {
     this.search();
   },
   methods: {
-    edit(v) {
+    edit(v, int) {
       const jump = () => {
         this.$router.push({
           path: "editCourse",
           query: {
             id: v.courseId,
+            name: int,
           },
         });
       };
@@ -239,7 +240,7 @@ export default {
       }
     },
     editInfo(v) {
-      this.edit(v);
+      this.edit(v, 1);
     },
     search(int) {
       this.loading = true;
@@ -425,5 +426,4 @@ export default {
     margin: 5px 0px;
   }
 }
-</style>
-
+</style>

+ 23 - 10
src/views/resource/videoManagement/festival/edit/index.vue

@@ -454,6 +454,7 @@ export default {
           { required: true, message: "请选择是否发布", trigger: "change" },
         ],
       },
+      pageId:this.$route.query.id
     };
   },
   watch: {
@@ -467,7 +468,7 @@ export default {
   mounted() {
     this.$modal.loading("正在导入数据,请稍后...");
     this.$api
-      .gradecheckGoodsChange({ sectionId: this.$route.query.id })
+      .gradecheckGoodsChange({ sectionId: this.pageId })
       .then((res) => {
         if (res.data > 0) {
           this.noStudent = false;
@@ -673,7 +674,7 @@ export default {
     },
     search() {
       this.$api
-        .obtainCourseSection(this.$route.query.id)
+        .obtainCourseSection(this.pageId)
         .then((res) => {
           this.bfImg = res.data.coverUrl;
           if (res.data.sectionType === 2) {
@@ -695,7 +696,7 @@ export default {
           }
           this.listData = res.data;
           this.$api
-            .obtaincourseSectionbusiness(this.$route.query.id)
+            .obtaincourseSectionbusiness(this.pageId)
             .then((result) => {
               var arrays = [];
               result.data.map((item) => {
@@ -968,7 +969,7 @@ export default {
       this.disabledBtn = true;
       var dataInfos = {
         status: 1,
-        sectionId: this.$route.query.id,
+        sectionId: this.pageId,
         businessList: this.newSujectApis,
         coverUrl: this.listData.coverUrl,
         name: this.listData.name,
@@ -1021,9 +1022,15 @@ export default {
             this.$store
               .dispatch("tagsView/exitView", this.$route)
               .then((res) => {
-                this.$router.push({
-                  path: "festival",
-                });
+                if (this.$store.getters.festivalPage) {
+                  this.$router.push({
+                    path: this.$store.getters.festivalPage.name,
+                  });
+                } else {
+                  this.$router.push({
+                    path: "festival",
+                  });
+                }
               });
           }, 500);
         })
@@ -1033,9 +1040,15 @@ export default {
     },
     backPage() {
       this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
-        this.$router.push({
-          path: "festival",
-        });
+        if (this.$store.getters.festivalPage) {
+          this.$router.push({
+            path: this.$store.getters.festivalPage.name,
+          });
+        } else {
+          this.$router.push({
+            path: "festival",
+          });
+        }
       });
     },
     closeType(index) {

+ 1 - 0
src/views/resource/videoManagement/festival/index.vue

@@ -442,6 +442,7 @@ export default {
         });
       } else {
         const jump = () => {
+          this.$store.dispatch("changefestivalPage", null);
           this.$router.push({
             path: "festivalEdit",
             query: {

+ 173 - 98
src/views/resource/videoManagement/moduleManagement/add/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="moduleManagementAdd">
-    <div class="boxWidth">
-      <el-form
-        label-position="right"
-        label-width="120px"
-        :model="listData"
-        :rules="rules"
-        ref="listData"
-      >
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <div class="boxWidth">
         <el-form-item label="适用业务层级" required>
           <el-select
             v-model="eduType"
@@ -199,98 +199,103 @@
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="管理章">
-          <div class="dis_plays">
-            <div>
-              <el-button size="small" @click="openBoxs">添加章</el-button>
-            </div>
-            <div style="color: #f56c6c">
-              <span style="margin-right: 10px"
-                >章总数:{{ tableData.length }}</span
-              >
-              <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
-            </div>
+      </div>
+      <el-form-item label="管理章">
+        <div class="dis_plays">
+          <div>
+            <el-button size="small" @click="openBoxs">调用已有数据</el-button>
+            <el-button size="small" @click="addChapter">自定义添加章</el-button>
           </div>
-          <el-table
-            :data="tableData"
-            border
-            :header-cell-style="{
-              'background-color': '#eee',
-              padding: '8px',
-              color: '#333',
-            }"
-            :default-sort="{ prop: 'sort', order: 'ascending' }"
-          >
-            <el-table-column
-              v-for="(item, index) in tableSet"
-              :width="item.width"
-              :key="index"
-              :label="item.label"
-              align="center"
-              :show-overflow-tooltip="true"
-              header-align="center"
-              :sortable="item.prop === 'sort'"
-              sort-by="sort"
-              :prop="item.prop"
+          <div style="color: #f56c6c">
+            <span style="margin-right: 10px"
+              >章总数:{{ tableData.length }}</span
             >
-              <template slot-scope="scope">
-                <span v-if="item.scope === 'types'">{{
+            <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
+          </div>
+        </div>
+        <el-table
+          :data="tableData"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+          :default-sort="{ prop: 'sort', order: 'ascending' }"
+        >
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :sortable="item.prop === 'sort'"
+            sort-by="sort"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'types'">{{
+                scope.row[item.prop] === 1
+                  ? "录播"
+                  : scope.row[item.prop] === 2
+                  ? "直播"
+                  : scope.row[item.prop] === 3
+                  ? "回放"
+                  : "未知"
+              }}</span>
+              <span v-else-if="item.scope === 'Status'">
+                {{
                   scope.row[item.prop] === 1
-                    ? "录播"
-                    : scope.row[item.prop] === 2
-                    ? "直播"
-                    : scope.row[item.prop] === 3
-                    ? "回放"
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
                     : "未知"
-                }}</span>
-                <span v-else-if="item.scope === 'Status'">
-                  {{
-                    scope.row[item.prop] === 1
-                      ? "发布"
-                      : scope.row[item.prop] === 0
-                      ? "未发布"
-                      : "未知"
-                  }}
-                </span>
-                <div v-else-if="item.scope === 'inputs'">
-                  <el-input-number
-                    style="width: 50px"
-                    size="small"
-                    :controls="false"
-                    v-model="scope.row[item.prop]"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </div>
-                <span v-else>{{ scope.row[item.prop] }}</span></template
-              >
-            </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              fixed="right"
-              width="100px"
+                }}
+              </span>
+              <div v-else-if="item.scope === 'inputs'">
+                <el-input-number
+                  style="width: 50px"
+                  size="small"
+                  :controls="false"
+                  v-model="scope.row[item.prop]"
+                  controls-position="right"
+                  :min="0"
+                ></el-input-number>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
             >
-              <template slot-scope="scope">
-                <el-button type="text" @click="delList(scope.row)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="backPage">取消</el-button>
-          <el-button
-            type="primary"
-            @click="submit('listData')"
-            :loading="disabledBtn"
-            >确定</el-button
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="180px"
           >
-        </el-form-item>
-      </el-form>
-    </div>
+            <template slot-scope="scope">
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >章节内容</el-button
+              >
+              <el-button type="text" @click="delList(scope.row)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="backPage">取消</el-button>
+        <el-button
+          type="primary"
+          @click="submit('listData')"
+          :loading="disabledBtn"
+          >确定</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
       width="800px"
       :show-close="false"
@@ -386,14 +391,16 @@
         >
       </span>
     </el-dialog>
+    <addChapter ref="addChapter" @backData="backData" />
   </div>
 </template>
 
 <script>
+import addChapter from "../addChapter.vue";
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 export default {
-  components: { searchBoxNew, pagination },
+  components: { searchBoxNew, pagination, addChapter },
   name: "ModuleManagementAdd",
   data() {
     return {
@@ -442,11 +449,12 @@ export default {
         { label: "排序", prop: "sort", scope: "inputs", width: "100" },
         { label: "章编码", prop: "code", width: "120" },
         { label: "标题前缀", prop: "prefixName", width: "180" },
-        { label: "章标题", prop: "name", width: "310" },
+        { label: "章标题", prop: "name" },
         {
           label: "发布状态",
           prop: "publishStatus",
           scope: "Status",
+          width: "120",
         },
       ],
       tableData: [],
@@ -514,7 +522,72 @@ export default {
     this.getDict();
     // this.search();
   },
+  activated() {
+    if (this.$store.getters.modulePage) {
+      this.$api
+        .obtainCoursechapter(this.$store.getters.modulePage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.chapterId == this.$store.getters.modulePage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changemodulePage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changemodulePage", {
+          name: "moduleManagementAdd",
+          id: v.chapterId,
+        });
+        this.$router.push({
+          path: "chapterEdit",
+          query: {
+            id: v.chapterId,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "ChapterEdit";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "ChapterEdit",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
+    /**
+     * 打开添加章组件
+     */
+    addChapter() {
+      if (!this.newSujectApis.length) {
+        this.$message.warning("请选择科目");
+        return;
+      }
+      this.$refs.addChapter.openBoxs(this.newSujectApis);
+    },
+    /**
+     * 添加章-返回数据
+     */
+    backData(v) {
+      this.$api.inquireCourseListchapter({ chapterIds: v }).then((res) => {
+        this.activeLists = res.rows;
+        this.submitForm();
+      });
+    },
     unTime(val) {
       let a = `${val.businessId}-${val.subjectId}`;
       if (this.sujectApis.includes(a)) {
@@ -771,8 +844,8 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           if (!this.newSujectApis.length) {
-            this.$message.error("请选择适用业务层级")
-            return
+            this.$message.error("请选择适用业务层级");
+            return;
           }
           // if (
           //   this.listData.coverUrl === "" ||
@@ -922,7 +995,6 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
       this.$message.success("添加成功");
-      this.activeLists = [];
     },
     delList(item) {
       this.tableData.map((items, indexs) => {
@@ -932,6 +1004,9 @@ export default {
         }
       });
     },
+    closedFunc(){
+      this.activeLists = [];
+    },
   },
 };
 </script>

+ 129 - 0
src/views/resource/videoManagement/moduleManagement/addChapter.vue

@@ -0,0 +1,129 @@
+<template>
+  <div id="addChapter">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      width="700px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+        <div class="leftTitle">添加章</div>
+        <div class="rightBoxs">
+          <img
+            src="@/assets/images/Close@2x.png"
+            alt=""
+            @click="dialogVisible = false"
+          />
+        </div>
+      </div>
+      <div>
+        <p>
+          <el-button :size="size" type="primary" @click="addChapterList"
+            >添加</el-button
+          >
+        </p>
+        <el-form label-width="100px" class="elform_style">
+          <div v-for="(item, index) in list" :key="index" class="dis_box">
+            <div class="left_box">
+              <el-form-item label="标题前缀">
+                <el-input v-model="item.prefixName"></el-input>
+                <p class="p_style">注:便于检索、归类,以及区分一样的标题</p>
+              </el-form-item>
+              <el-form-item label="章标题" required>
+                <el-input v-model="item.name"></el-input>
+                <p class="p_style">
+                  注:请尽量规范易懂,方便在课程目录表呈现给学员
+                </p>
+              </el-form-item>
+            </div>
+            <div class="clear_style">
+              <el-button :size="size" @click="list.splice(index, 1)"
+                >删除</el-button
+              >
+            </div>
+          </div></el-form
+        >
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitForm" :disabled="!list.length"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      size: "small",
+      dialogVisible: false,
+      list: [],
+    };
+  },
+  methods: {
+    addChapterList() {
+      this.list.push({});
+    },
+    openBoxs(arr) {
+      this.businList = JSON.parse(JSON.stringify(arr));
+      this.list = [{}]
+      this.dialogVisible = true;
+    },
+    submitForm() {
+      const arr = [];
+      this.list.forEach((item, index) => {
+        if (!item.name && item.name !== 0) {
+          arr.push(index + 1);
+        }
+      });
+      if (arr.length) {
+        this.$message.error(
+          `第${arr.join(",")}条数据没有填写章标题,请填写完整后提交`
+        );
+        return;
+      }
+      let data = this.list.map((item) => {
+        item.businessList = this.businList;
+        item.status = 1;
+        item.publishStatus = 1;
+        item.coverUrl = "oss/images/avatar/20211013/1634097664410_1397766697";
+        return item;
+      });
+      this.$api.addMoreCoursechapter(data).then((res) => {
+        this.dialogVisible = false;
+        this.$emit("backData", res.data);
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.dis_box {
+  background-color: #eee;
+  padding: 10px 10px 0px;
+  display: flex;
+  margin-bottom: 16px;
+  .left_box {
+    flex: 1;
+  }
+  .clear_style {
+    flex-shrink: 0;
+    width: 80px;
+    vertical-align: top;
+    text-align: center;
+  }
+}
+.elform_style{
+    max-height: 620px;
+    overflow: auto;
+}
+.p_style {
+  font-size: 12px;
+  color: #a4a4a4;
+  margin: 0;
+}
+</style>

+ 180 - 104
src/views/resource/videoManagement/moduleManagement/edit/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div id="moduleManagementEdit">
-    <div class="boxWidth">
-      <el-form
-        label-position="right"
-        label-width="120px"
-        :model="listData"
-        :rules="rules"
-        ref="listData"
-      >
+    <el-form
+      label-position="right"
+      label-width="120px"
+      :model="listData"
+      :rules="rules"
+      ref="listData"
+    >
+      <div class="boxWidth">
         <el-form-item label="适用业务层级" required>
           <el-select
             v-model="eduType"
@@ -173,99 +173,104 @@
             <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="管理章">
-          <div class="dis_plays">
-            <div>
-              <el-button size="small" @click="openBoxs">添加章</el-button>
-            </div>
-            <div style="color: #f56c6c">
-              <span style="margin-right: 10px"
-                >章总数:{{ tableData.length }}</span
-              >
-              <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
-            </div>
+      </div>
+      <el-form-item label="管理章">
+        <div class="dis_plays">
+          <div>
+            <el-button size="small" @click="openBoxs">调用已有数据</el-button>
+            <el-button size="small" @click="addChapter">自定义添加章</el-button>
           </div>
-          <el-table
-            :data="tableData"
-            border
-            :header-cell-style="{
-              'background-color': '#eee',
-              padding: '8px',
-              color: '#333',
-            }"
-            :default-sort="{ prop: 'sort', order: 'ascending' }"
-          >
-            <el-table-column
-              v-for="(item, index) in tableSet"
-              :width="item.width"
-              :key="index"
-              :label="item.label"
-              align="center"
-              :show-overflow-tooltip="true"
-              header-align="center"
-              :sortable="item.prop === 'sort'"
-              sort-by="sort"
-              :prop="item.prop"
+          <div style="color: #f56c6c">
+            <span style="margin-right: 10px"
+              >章总数:{{ tableData.length }}</span
             >
-              <template slot-scope="scope">
-                <span v-if="item.scope === 'types'">{{
+            <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
+          </div>
+        </div>
+        <el-table
+          :data="tableData"
+          border
+          :header-cell-style="{
+            'background-color': '#eee',
+            padding: '8px',
+            color: '#333',
+          }"
+          :default-sort="{ prop: 'sort', order: 'ascending' }"
+        >
+          <el-table-column
+            v-for="(item, index) in tableSet"
+            :width="item.width"
+            :key="index"
+            :label="item.label"
+            align="center"
+            :show-overflow-tooltip="true"
+            header-align="center"
+            :sortable="item.prop === 'sort'"
+            sort-by="sort"
+            :prop="item.prop"
+          >
+            <template slot-scope="scope">
+              <span v-if="item.scope === 'types'">{{
+                scope.row[item.prop] === 1
+                  ? "录播"
+                  : scope.row[item.prop] === 2
+                  ? "直播"
+                  : scope.row[item.prop] === 3
+                  ? "回放"
+                  : "未知"
+              }}</span>
+              <span v-else-if="item.scope === 'Status'">
+                {{
                   scope.row[item.prop] === 1
-                    ? "录播"
-                    : scope.row[item.prop] === 2
-                    ? "直播"
-                    : scope.row[item.prop] === 3
-                    ? "回放"
+                    ? "发布"
+                    : scope.row[item.prop] === 0
+                    ? "未发布"
                     : "未知"
-                }}</span>
-                <span v-else-if="item.scope === 'Status'">
-                  {{
-                    scope.row[item.prop] === 1
-                      ? "发布"
-                      : scope.row[item.prop] === 0
-                      ? "未发布"
-                      : "未知"
-                  }}
-                </span>
-                <div v-else-if="item.scope === 'inputs'">
-                  <el-input-number
-                    style="width: 50px"
-                    size="small"
-                    :controls="false"
-                    v-model="scope.row[item.prop]"
-                    controls-position="right"
-                    :min="0"
-                  ></el-input-number>
-                </div>
-                <span v-else>{{ scope.row[item.prop] }}</span></template
-              >
-            </el-table-column>
-            <el-table-column
-              label="操作"
-              align="center"
-              fixed="right"
-              width="100px"
+                }}
+              </span>
+              <div v-else-if="item.scope === 'inputs'">
+                <el-input-number
+                  style="width: 50px"
+                  size="small"
+                  :controls="false"
+                  v-model="scope.row[item.prop]"
+                  controls-position="right"
+                  :min="0"
+                ></el-input-number>
+              </div>
+              <span v-else>{{ scope.row[item.prop] }}</span></template
             >
-              <template slot-scope="scope">
-                <el-button type="text" @click="delList(scope.row)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form-item>
-        <el-form-item>
-          <el-button @click="backPage">取消</el-button>
-          <el-button
-            :loading="disabledBtn"
-            type="primary"
-            @click="submit('listData')"
-            :disabled="!noStudent"
-            >确定</el-button
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            fixed="right"
+            width="180px"
           >
-        </el-form-item>
-      </el-form>
-    </div>
+            <template slot-scope="scope">
+              <el-button type="text" @click="jumpChapter(scope.row)"
+                >章节内容</el-button
+              >
+              <el-button type="text" @click="delList(scope.row)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="backPage">取消</el-button>
+        <el-button
+          :loading="disabledBtn"
+          type="primary"
+          @click="submit('listData')"
+          :disabled="!noStudent"
+          >确定</el-button
+        >
+      </el-form-item>
+    </el-form>
     <el-dialog
+      @closed="closedFunc"
       :visible.sync="dialogVisible"
       width="800px"
       :show-close="false"
@@ -361,15 +366,17 @@
         >
       </span>
     </el-dialog>
+    <addChapter ref="addChapter" @backData="backData" />
   </div>
 </template>
 
 <script>
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
+import addChapter from "../addChapter.vue";
 export default {
   name: "ModuleManagementEdit",
-  components: { searchBoxNew, pagination },
+  components: { searchBoxNew, pagination, addChapter },
   data() {
     return {
       disabledBtn: false,
@@ -416,11 +423,12 @@ export default {
         { label: "排序", prop: "sort", scope: "inputs", width: "100" },
         { label: "章编码", prop: "code", width: "120" },
         { label: "标题前缀", prop: "prefixName", width: "180" },
-        { label: "章标题", prop: "name", width: "310" },
+        { label: "章标题", prop: "name" },
         {
           label: "发布状态",
           prop: "publishStatus",
           scope: "Status",
+          width: "120",
         },
       ],
       tableData: [],
@@ -474,6 +482,7 @@ export default {
       disCheckList: [], //已选转禁用复选列表
       activeLists: [],
       noStudent: true,
+      pageId:this.$route.query.id
     };
   },
   watch: {
@@ -487,7 +496,7 @@ export default {
   async mounted() {
     this.$modal.loading("正在导入数据,请稍后...");
     this.$api
-      .gradecheckGoodsChange({ moduleId: this.$route.query.id })
+      .gradecheckGoodsChange({ moduleId: this.pageId })
       .then((res) => {
         if (res.data > 0) {
           this.noStudent = false;
@@ -496,7 +505,72 @@ export default {
     await this.getDict();
     this.search();
   },
+  activated() {
+    if (this.$store.getters.modulePage) {
+      this.$api
+        .obtainCoursechapter(this.$store.getters.modulePage.id)
+        .then((res) => {
+          const FIND = this.tableData.findIndex((item) => {
+            return item.chapterId == this.$store.getters.modulePage.id;
+          });
+          if (FIND !== -1) {
+            res.data.sort = this.tableData[FIND].sort;
+            this.tableData.splice(FIND, 1, res.data);
+          }
+          this.$store.dispatch("changemodulePage", null);
+        });
+    }
+  },
   methods: {
+    jumpChapter(v) {
+      const jump = () => {
+        this.$store.dispatch("changemodulePage", {
+          name: "moduleManagementEdit",
+          id: v.chapterId,
+        });
+        this.$router.push({
+          path: "chapterEdit",
+          query: {
+            id: v.chapterId,
+          },
+        });
+      };
+      const statusPage = this.$store.state.tagsView.visitedViews.some(
+        (item) => {
+          return item.name == "ChapterEdit";
+        }
+      );
+      if (statusPage) {
+        this.$store
+          .dispatch("tagsView/delCachedView", {
+            name: "ChapterEdit",
+          })
+          .then((res) => {
+            jump();
+          });
+      } else {
+        jump();
+      }
+    },
+    /**
+     * 打开添加章组件
+     */
+    addChapter() {
+      if (!this.newSujectApis.length) {
+        this.$message.warning("请选择科目");
+        return;
+      }
+      this.$refs.addChapter.openBoxs(this.newSujectApis);
+    },
+    /**
+     * 添加章-返回数据
+     */
+    backData(v) {
+      this.$api.inquireCourseListchapter({ chapterIds: v }).then((res) => {
+        this.activeLists = res.rows;
+        this.submitForm();
+      });
+    },
     handleCheckedCitiesChange() {
       let nid = this.newSujectOption.map((item) => {
         return item.newId;
@@ -566,7 +640,7 @@ export default {
     },
     getInfosList() {
       this.$api
-        .inquireCourseListmodulechapter(this.$route.query.id)
+        .inquireCourseListmodulechapter(this.pageId)
         .then((result) => {
           // this.numberAll = result.total;
           // this.minTimeAll = result.timeTotal;
@@ -595,12 +669,12 @@ export default {
     },
     search() {
       this.$api
-        .obtainCoursemodule(this.$route.query.id)
+        .obtainCoursemodule(this.pageId)
         .then((res) => {
           this.bfImg = res.data.coverUrl;
           this.listData = res.data;
           this.$api
-            .inquireCourseListmodulebusiness(this.$route.query.id)
+            .inquireCourseListmodulebusiness(this.pageId)
             .then((result) => {
               var arrays = [];
               result.data.map((item) => {
@@ -743,8 +817,8 @@ export default {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           if (!this.newSujectApis.length) {
-            this.$message.error("请选择适用业务层级")
-            return
+            this.$message.error("请选择适用业务层级");
+            return;
           }
           // if (
           //   this.listData.coverUrl === "" ||
@@ -784,7 +858,7 @@ export default {
       });
       var dataInfos = {
         status: 1,
-        moduleId: this.$route.query.id,
+        moduleId: this.pageId,
         businessList: this.newSujectApis,
         chapterIdList: chapterIdList,
         coverUrl: this.listData.coverUrl,
@@ -895,7 +969,6 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
       this.$message.success("添加成功");
-      this.activeLists = [];
     },
     delList(item) {
       this.tableData.map((items, indexs) => {
@@ -905,6 +978,9 @@ export default {
         }
       });
     },
+    closedFunc(){
+      this.activeLists = [];
+    },
   },
 };
 </script>