浏览代码

Merge branch 'd_ls' into dev

xiejiebiao 2 年之前
父节点
当前提交
d43d809ff3
共有 46 个文件被更改,包括 1577 次插入1945 次删除
  1. 18 0
      src/api/education/classManageMent.js
  2. 18 0
      src/api/resource/good.js
  3. 39 0
      src/api/resource/videoManagement.js
  4. 38 0
      src/api/resource/volumeManagement.js
  5. 265 0
      src/components/Comon/batchImportDialog.vue
  6. 27 19
      src/components/Study/StudentInfo.vue
  7. 1 1
      src/components/searchBoxNew.vue
  8. 12 12
      src/components/testPaperPreview/index.vue
  9. 58 2
      src/views/Marketing/goods/commodityManageMent/index.vue
  10. 23 12
      src/views/Marketing/order/offlineOrder/batchRecord/firstStep/uploadStudent.vue
  11. 9 1
      src/views/education/classManageMent/classHoursReview/component/LessonTable.vue
  12. 10 0
      src/views/education/classManageMent/classHoursReview/component/StudyTables.vue
  13. 1 1
      src/views/education/classManageMent/classList/addClass/index.vue
  14. 1 1
      src/views/education/classManageMent/classList/manageClass/baseInfo.vue
  15. 24 0
      src/views/education/classManageMent/listOfhoursToBeReviewed/index.vue
  16. 55 29
      src/views/education/classManageMent/studentMenu/index.vue
  17. 184 0
      src/views/education/classManageMent/studentMenu/tabClassDialog.vue
  18. 29 3
      src/views/education/examManagement/examArrangement/applicableProducts/checkGoodsList.vue
  19. 27 23
      src/views/education/mockTestManagement/mockExamArrangement/addMockExam/infoPage.vue
  20. 31 35
      src/views/education/mockTestManagement/mockExamArrangement/editMockExam/infoPage.vue
  21. 1 1
      src/views/education/questionBankLearning/questionRecordPage/listOfQuestions/studentData/index.vue
  22. 8 0
      src/views/education/studentManageMent/studentList/index.vue
  23. 13 1
      src/views/education/studentManageMent/studentXQ/BankQuestionPassRecord.vue
  24. 11 1
      src/views/education/studentManageMent/studentXQ/liveList.vue
  25. 9 0
      src/views/education/studentManageMent/studentXQ/studyRecord.vue
  26. 38 0
      src/views/resource/bankManagement/chapterVolumeManagement/index.vue
  27. 39 0
      src/views/resource/bankManagement/knowledgeManagement/index.vue
  28. 161 0
      src/views/resource/bankManagement/testPaperManagement/BatchImportPop.vue
  29. 6 21
      src/views/resource/bankManagement/testPaperManagement/addPaper/topicAddPaper/index.vue
  30. 12 25
      src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/index.vue
  31. 0 280
      src/views/resource/bankManagement/testPaperManagement/excelPop.vue
  32. 38 0
      src/views/resource/bankManagement/testPaperManagement/index.vue
  33. 0 290
      src/views/resource/bankManagement/testPaperManagement/wordPop.vue
  34. 0 99
      src/views/resource/bankManagement/topicManagement/excelPop.vue
  35. 51 46
      src/views/resource/bankManagement/topicManagement/index.vue
  36. 22 12
      src/views/resource/bankManagement/topicManagement/wordPop.vue
  37. 61 20
      src/views/resource/bankManagement/volumeManagement/index.vue
  38. 1 1
      src/views/resource/baseManageInfos/resource/businessLevel/index.vue
  39. 24 202
      src/views/resource/videoManagement/chapter/add/index.vue
  40. 21 190
      src/views/resource/videoManagement/chapter/edit/index.vue
  41. 38 0
      src/views/resource/videoManagement/chapter/index.vue
  42. 39 0
      src/views/resource/videoManagement/courseManagement/index.vue
  43. 42 134
      src/views/resource/videoManagement/festival/index.vue
  44. 18 216
      src/views/resource/videoManagement/moduleManagement/add/index.vue
  45. 15 267
      src/views/resource/videoManagement/moduleManagement/edit/index.vue
  46. 39 0
      src/views/resource/videoManagement/moduleManagement/index.vue

+ 18 - 0
src/api/education/classManageMent.js

@@ -7,4 +7,22 @@ export function rollBackPeriod(data) {
         method: 'post',
         data
     })
+}
+
+// 商品关联的班级
+export function getListGoods(query) {
+    return request({
+        url: `/grade/grade/listGoods`,
+        method: 'GET',
+        params: query
+    })
+}
+
+// 更换班级
+export function changeGradeFree(data) {
+    return request({
+        url: `/grade/grade/changeGradeFree`,
+        method: 'post',
+        data
+    })
 }

+ 18 - 0
src/api/resource/good.js

@@ -60,4 +60,22 @@ export function goodsUpdateSpec(data) {
         method: 'post',
         data
     })
+}
+
+// 商品批量上下架
+export function goodsUpdateStatus(data) {
+    return request({
+        url: `/goods/batch/updateStatus`,
+        method: 'post',
+        data
+    })
+}
+
+// 商品批量删除
+export function goodsDel(data) {
+    return request({
+        url: `/goods/batch/del`,
+        method: 'post',
+        data
+    })
 }

+ 39 - 0
src/api/resource/videoManagement.js

@@ -0,0 +1,39 @@
+import request from '@/utils/request'
+
+// 课程批量删除
+export function courseBatchDel(data) {
+    return request({
+        url: `/course/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+
+// 模块批量删除
+export function moduleBatchDel(data) {
+    return request({
+        url: `/course/module/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+// 章批量删除
+export function chapterBatchDel(data) {
+    return request({
+        url: `/course/chapter/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+
+// 节批量删除
+export function sectionBatchDel(data) {
+    return request({
+        url: `/course/section/batch/del`,
+        method: 'post',
+        data
+    })
+}

+ 38 - 0
src/api/resource/volumeManagement.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+
+// 模块卷批量删除
+export function moduleVolumeBatchDel(data) {
+    return request({
+        url: `/bank/module/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+// 章批量删除
+export function chapterVolumeBatchDel(data) {
+    return request({
+        url: `/bank/chapter/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+
+// 试卷批量删除
+export function paperBatchDel(data) {
+    return request({
+        url: `/bank/exam/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+// 题目批量删除
+export function questionBatchDel(data) {
+    return request({
+        url: `/bank/question/batch/del`,
+        method: 'post',
+        data
+    })
+}

+ 265 - 0
src/components/Comon/batchImportDialog.vue

@@ -0,0 +1,265 @@
+<template>
+  <div>
+    <Base-dialog
+      title="导入"
+      width="660px"
+      :isShow.sync="isShow"
+      :isShowFooter="false"
+    >
+      <div>
+        <div class="swq">
+          <img
+            style="width: 182px; height: 168px"
+            src="@/assets/images/dr.png"
+            alt=""
+          />
+        </div>
+        <div style="padding-left: 100px">
+          <p>第一步:下载导入模板</p>
+          <p style="padding-left: 50px">
+            <i class="el-icon-upload"></i
+            ><span class="dowmStys" @click="getDowm">下载模板</span>
+          </p>
+          <p>第二步:(批量新增):点击“上传{{ type }}”完成导入</p>
+          <div
+            v-loading="loading"
+            element-loading-text="正在处理中"
+            style="margin: 0 0 20px 50px; width: 130px; height: 60px"
+          >
+            <label
+              v-show="!loading"
+              for="mobles"
+              class="el-button el-button--primary"
+              >上传 {{ type }}</label
+            ><input
+              style="display: none"
+              type="file"
+              id="mobles"
+              ref="input1"
+              @change="importMobleadd"
+            />
+          </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="isShow = false">取消</el-button>
+        </span>
+      </div>
+    </Base-dialog>
+    <Base-dialog
+      title="提示"
+      width="660px"
+      :isShow.sync="isShowErr"
+      :isShowFooter="false"
+    >
+      <div>
+        <div>
+          <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
+            导入失败原因
+          </h4>
+          <el-input
+            readonly
+            type="textarea"
+            :autosize="{ minRows: 6, maxRows: 24 }"
+            v-model="errorData"
+          >
+          </el-input>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="isShowErr = false">确定</el-button>
+        </span>
+      </div>
+    </Base-dialog>
+  </div>
+</template>
+
+<script>
+import * as baseUrls from "@/utils/request.js";
+export default {
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false,
+    },
+    temUrl: {
+      type: String,
+    },
+    apiKey: {
+      type: String,
+    },
+    checkKey: {
+      type: String,
+    },
+    newSujectApis: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    isCheck: {
+      type: Boolean,
+      default: true,
+    },
+    isShowTip: {
+      type: Boolean,
+      default: true,
+    },
+    param: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+    type: {
+      type: String,
+      default: "Excel",
+    },
+    isSuccessBack: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      errorData: [],
+      isShowErr: false,
+    };
+  },
+  methods: {
+    getDowm() {
+      let url =
+        baseUrls.BASE_IMG_URL +
+        this.temUrl +
+        `?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 file = e.target.files[0];
+      if (file === undefined) {
+        e.target.value = "";
+        return;
+      }
+      var type = e.target.value.toLowerCase().split(".").splice(-1);
+      if (this.type == "Excel") {
+        if (type[0] != "xlsx" && type[0] != "xls") {
+          e.target.value = "";
+          this.$message.error("请上传excel文件,且上传格式需为:.xlsx、.xls");
+          return;
+        }
+      } else {
+        if (type[0] != "docx") {
+          e.target.value = "";
+          this.$message.error("请上传word文件,且上传格式需为:.docx");
+          return;
+        }
+      }
+      this.loading = true;
+      let formData = new FormData();
+      formData.append("file", file);
+      for (const key in this.param) {
+        formData.append(key, this.param[key]);
+      }
+      this.$api[this.apiKey](formData)
+        .then((res) => {
+          if (res.code === 200) {
+            this.isCheck && this.getFestivalList(res.data);
+            this.getErrorData(res.data || res);
+          }
+        })
+        .finally(() => {
+          e.target.value = "";
+          this.loading = false;
+        });
+    },
+    /**
+     *
+     * @param {Strings} ids 查询编码
+     * @param {Number} type 1为成功2为失败
+     * @remards 失败时也需查询是否有成功的数据导入数据库,如存在 则加列队列同时提示
+     */
+    getFestivalList({ importNo, errorLog }) {
+      this.$api[this.checkKey]({ importNo })
+        .then((res) => {
+          if (res.rows.length) {
+            errorLog &&
+              this.$message({
+                type: "success",
+                message: `成功导入${res.rows.length}条数据,`,
+                customClass: "myMessageClass",
+              });
+            this.$emit("success", res.rows);
+          }
+        })
+        .catch(() => {});
+    },
+    getErrorData(data) {
+      this.isShow = false;
+      let { errorLog } = data;
+      if (errorLog) {
+        let ary = errorLog.split("\r\n");
+        ary = ary
+          .filter((item) => {
+            return item.length > 0;
+          })
+          .reverse();
+        this.$message({
+          message: `${ary.length}条数据导入失败,请查看失败原因`,
+          customClass: "myMessageClass",
+        });
+        ary = ary.join("\r\n");
+        this.errorData = ary;
+        this.isShowErr = true;
+      } else {
+        this.isShowTip &&
+          this.$message({
+            type: "success",
+            message: `添加成功`,
+            customClass: "myMessageClass",
+          });
+      }
+      if (!errorLog || this.isSuccessBack) {
+        this.$emit("success", data);
+      }
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        return this.dialogVisible;
+      },
+      set(val) {
+        this.$emit("update:dialogVisible", false);
+      },
+    },
+  },
+};
+</script>
+
+<style  lang="less" scoped>
+.swq {
+  text-align: center;
+  border-bottom: 1px solid #eee;
+}
+.dowmStys {
+  color: blue;
+  cursor: pointer;
+}
+/deep/.el-dialog {
+  .el-dialog__body {
+    padding: 30px 20px 0;
+  }
+  .dialog-footer {
+    height: 80px;
+    border-top: 1px solid #e2e2e2;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+}
+</style>

+ 27 - 19
src/components/Study/StudentInfo.vue

@@ -2,20 +2,23 @@
   <div class="studyInfo">
     <header>
       <div class="left"><i></i><span>学员信息</span></div>
-      <span v-for="(item, i) in headList" :key="i">
-        <strong style="color: red">「{{ i + 1 }}」</strong>
-        {{ item.lebel }}
-        <span v-if="item.key != 'num' && item.key != 'time'">{{
-          userData[item.key]
-        }}</span>
-        <span v-else-if="item.key == 'num'"
-          >完成{{ userData.stuAllNum + userData.recordNum }}节的内容学习</span
-        >
-        <span v-else-if="item.key == 'time'"
-          >{{ $methodsTools.onlyForma(userData.studyStartTime, false) }} -
-          {{ $methodsTools.onlyForma(userData.studyEndTime, false) }}</span
-        >
-      </span>
+      <div class="goods_info">
+        <span v-for="(item, i) in headList" :key="i">
+          <strong style="color: red">「{{ i + 1 }}」</strong>
+          {{ item.lebel }}
+          <span v-if="item.key != 'num' && item.key != 'time'">{{
+            userData[item.key]
+          }}</span>
+          <span v-else-if="item.key == 'num'"
+            >完成{{ userData.stuAllNum + userData.recordNum }}节的内容学习</span
+          >
+          <span v-else-if="item.key == 'time'"
+            >{{ $methodsTools.onlyForma(userData.studyStartTime, false) }} -
+            {{ $methodsTools.onlyForma(userData.studyEndTime, false) }}</span
+          >
+        </span>
+      </div>
+
       <el-button class="btn" type="primary" size="mini" @click="packUp">{{
         showBox ? "收起" : "展开"
       }}</el-button>
@@ -137,7 +140,8 @@ export default {
   & > header {
     display: flex;
     position: relative;
-    height: 48px;
+    flex-wrap: wrap;
+    // height: 48px;
     line-height: 48px;
     & > .left {
       display: flex;
@@ -156,10 +160,14 @@ export default {
         font-weight: bold;
       }
     }
-    & > span {
-      font-size: 14px;
-      padding-left: 20px;
-      white-space: nowrap;
+    & > .goods_info {
+      display: flex;
+      flex-wrap: wrap;
+      span {
+        font-size: 14px;
+        padding-left: 20px;
+        white-space: nowrap;
+      }
     }
     .btn {
       position: absolute;

+ 1 - 1
src/components/searchBoxNew.vue

@@ -436,7 +436,7 @@
             v-model="formData[item.prop]"
             type="datetime"
             :size="size"
-            placeholder="选择日期时间"
+            :placeholder="item.placeholder"
             value-format="timestamp"
           >
           </el-date-picker>

+ 12 - 12
src/components/testPaperPreview/index.vue

@@ -260,25 +260,25 @@ export default {
       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.$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;
           });
-          this.topData.getAllpocis = num;
-          this.diavos = true;
         });
       }
       if (type === 2) {

+ 58 - 2
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -9,6 +9,7 @@
       :topType="topType"
     />
     <table-list
+      ref="tableList"
       :tableSets="tableSet"
       :tableData="tableData"
       :navText="navText"
@@ -16,13 +17,24 @@
       :loading="loading"
       @editInfo="editInfo"
       @openClassNum="openClassNum"
+      rowKey="goodsId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="handelBatch(1)" type="success"
+          >批量上架</el-button
+        ><el-button size="medium" @click="handelBatch(0)" type="success"
+          >批量下架</el-button
+        ><el-button size="medium" @click="handelBatch(2)" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button
           v-if="
             props.scope.row.goodsType == 1 &&
             props.scope.row.courseNum &&
-            props.scope.row.courseNum > 0
+            props.scope.row.courseNum > 0 &&
+            props.scope.row.goodsLearningOrder == 0
           "
           type="text"
           @click="setTeacher(props.scope.row)"
@@ -79,7 +91,12 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
-import { getGoodsSpecList, goodsUpdateSpec } from "@/api/resource/good";
+import {
+  getGoodsSpecList,
+  goodsUpdateSpec,
+  goodsUpdateStatus,
+  goodsDel,
+} from "@/api/resource/good";
 export default {
   name: "CommodityManageMent",
   components: { searchBoxNew, tableList, pagination },
@@ -95,6 +112,7 @@ export default {
         choice: true,
         addHide: false,
         changeWidth: "180px",
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -375,6 +393,44 @@ export default {
     this.search();
   },
   methods: {
+    // 批量上下架
+    handelBatch(type) {
+      let len = this.$refs.tableList.allCheckData.length;
+      if (!len) {
+        return this.$message.warning("请先勾选商品");
+      }
+      let name = ["上架", "下架", "删除"][type];
+      this.$confirm(`此操作将所勾选的${len}条商品${name}, 是否继续?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          const goodsIds = this.$refs.tableList.allCheckData.map(
+            (item) => item.goodsId
+          );
+          if (type == 2) {
+            goodsDel({
+              status: -1,
+              ids: goodsIds,
+            }).then((res) => {
+              this.$message.success("批量删除成功");
+              this.$refs.tableList.clearMoreActive();
+              this.search(1);
+            });
+          } else {
+            goodsUpdateStatus({
+              goodsStatus: type,
+              goodsIds,
+            }).then((res) => {
+              this.$message.success(`批量${name}成功`);
+              this.$refs.tableList.clearMoreActive();
+              this.search(1);
+            });
+          }
+        })
+        .catch(() => {});
+    },
     openClassNum(id) {
       this.activeGoodsId = id;
       let { specTemplateId } = this.tableData.find((e) => e.goodsId == id);

+ 23 - 12
src/views/Marketing/order/offlineOrder/batchRecord/firstStep/uploadStudent.vue

@@ -32,18 +32,26 @@
             <div style="margin: 0px 0px 12px 14px">
               <el-link type="primary" @click="getDowm">下载模板</el-link>
             </div>
-            <label
-              for="mobles"
-              class="el-button el-button--primary"
-              style="margin-left: 14px; padding: 10px 20px"
-              >上传学员名单</label
-            ><input
-              style="display: none"
-              type="file"
-              id="mobles"
-              ref="input1"
-              @change="importMobleadd"
-            />
+            <div
+              v-loading="loading"
+              element-loading-text="正在处理中"
+              style="margin: 0 0 20px 50px; width: 130px; height: 60px"
+            >
+              <label
+                v-show="!loading"
+                for="mobles"
+                class="el-button el-button--primary"
+                style="margin-left: 14px; padding: 10px 20px"
+                >上传学员名单</label
+              ><input
+                style="display: none"
+                type="file"
+                id="mobles"
+                ref="input1"
+                @change="importMobleadd"
+              />
+            </div>
+
             <div style="padding: 20px" v-if="importNo">
               <div>
                 成功:<span style="color: green; font-weight: bold">{{
@@ -187,6 +195,7 @@ export default {
           type: "error",
         },
       ],
+      loading: false,
     };
   },
   computed: {
@@ -258,6 +267,7 @@ export default {
       let formData = new FormData();
       formData.append("file", file);
       formData.append("importNo", this.importNo);
+      this.loading = true;
       this.$api
         .appuserimportData(formData)
         .then((res) => {
@@ -270,6 +280,7 @@ export default {
           }
         })
         .finally(() => {
+          this.loading = false;
           e.target.value = "";
         });
     },

+ 9 - 1
src/views/education/classManageMent/classHoursReview/component/LessonTable.vue

@@ -175,7 +175,7 @@ export default {
       },
     },
   },
-  inject: ["getPeriodStatus", "getUserInfo"],
+  inject: ["getPeriodStatus", "getUserInfo", "getAllIds"],
   data() {
     return {
       tableSet: [
@@ -280,6 +280,11 @@ export default {
         .then((res) => {
           this.$message.success("修改成功");
           this.vidBoxHours = false;
+          if (this.allIds.length == 1) {
+            this.$router.push({
+              name: "ListOfhoursToBeReviewed",
+            });
+          }
           this.getUserInfo(true);
         })
         .finally(() => {
@@ -334,6 +339,9 @@ export default {
     periodStatus() {
       return this.getPeriodStatus();
     },
+    allIds() {
+      return this.getAllIds();
+    },
   },
   components: {
     CheatDialog,

+ 10 - 0
src/views/education/classManageMent/classHoursReview/component/StudyTables.vue

@@ -209,6 +209,7 @@ export default {
     return {
       getPeriodStatus: () => this.periodStatus,
       getUserInfo: this.getUserInfo,
+      getAllIds: () => this.allIds,
     };
   },
   data() {
@@ -336,6 +337,7 @@ export default {
           if (int === 1) {
             this.$message.success("状态全部通过修改成功");
             this.through = false;
+            this.checkAll && this.goReview();
           }
           if (int === 2) {
             this.$message.success("状态全部作弊修改成功");
@@ -385,6 +387,7 @@ export default {
           this.getUserInfo(true);
           this.$message.success("已打回待审核状态");
           this.popback = false;
+          this.goReview();
         })
         .catch(() => {
           this.disabledBtn = false;
@@ -404,6 +407,7 @@ export default {
           this.getUserInfo(true);
           this.$message.success("审核通过");
           this.approvedOK = false;
+          this.goReview();
         })
         .catch(() => {
           this.disabledBtn = false;
@@ -430,6 +434,11 @@ export default {
           });
         });
     },
+    goReview() {
+      this.$router.push({
+        name: "ListOfhoursToBeReviewed",
+      });
+    },
   },
 
   created() {
@@ -444,6 +453,7 @@ export default {
   watch: {
     tablesData: {
       handler() {
+        this.allIds = [];
         for (const key in this.tablesData) {
           this.getAllId(this.tablesData[key]);
         }

+ 1 - 1
src/views/education/classManageMent/classList/addClass/index.vue

@@ -70,7 +70,7 @@
               <el-radio :label="0">无效</el-radio>
             </el-radio-group>
           </el-form-item>
-          <el-form-item label="班级号">
+          <el-form-item label="官方班级号">
             <el-button
               style="margin-right: 14px"
               size="mini"

+ 1 - 1
src/views/education/classManageMent/classList/manageClass/baseInfo.vue

@@ -99,7 +99,7 @@
                 <el-radio :label="0">无效</el-radio>
               </el-radio-group>
             </el-form-item>
-            <el-form-item label="班级号">
+            <el-form-item label="官方班级号">
               <el-button
                 style="margin-right: 14px"
                 size="mini"

+ 24 - 0
src/views/education/classManageMent/listOfhoursToBeReviewed/index.vue

@@ -167,6 +167,18 @@ export default {
           prop: "searchKey",
           placeholder: "请输入姓名/身份证",
         },
+        {
+          prop1: "periodStartTime",
+          prop2: "periodEndTime",
+          placeholder1: "审核通过开始时间",
+          placeholder2: "审核通过结束时间",
+          scope: "moreDataPicker",
+          Diszing: true,
+        },
+        {
+          prop: "className",
+          placeholder: "所在班级",
+        },
       ],
       formData: {
         profileStatus: "",
@@ -279,6 +291,12 @@ export default {
           hidden: true,
           scope: "statusPeriod",
         },
+        {
+          label: "审核通过时间",
+          prop: "periodTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
         {
           label: "待重修(视频节和题卷)",
           prop: "waitRebuildNum",
@@ -474,6 +492,12 @@ export default {
       if (this.formData.classEndTime) {
         data.classEndTime = parseInt(data.classEndTime / 1000);
       }
+      if (this.formData.periodStartTime) {
+        data.periodStartTime = parseInt(data.periodStartTime / 1000);
+      }
+      if (this.formData.periodEndTime) {
+        data.periodEndTime = parseInt(data.periodEndTime / 1000);
+      }
       this.$api
         .inquireGradegradelistUserPeriods(data)
         .then((res) => {

+ 55 - 29
src/views/education/classManageMent/studentMenu/index.vue

@@ -90,7 +90,12 @@
           v-model="formData.companyName"
           placeholder="所在公司"
           @clear="search(3)"
-        ><el-button @click="search(3)" slot="append" icon="el-icon-search"></el-button></el-input>
+          ><el-button
+            @click="search(3)"
+            slot="append"
+            icon="el-icon-search"
+          ></el-button
+        ></el-input>
         <el-select
           clearable
           @change="search(3)"
@@ -113,16 +118,23 @@
           <el-option label="是" :value="1"> </el-option>
           <el-option label="否" :value="0"> </el-option>
         </el-select>
-         <el-button
-          size="medium"
-          @click="exportGrade"
-          :loading="exportLoading"
-          >导出学员数据</el-button>
+        <el-button size="medium" @click="exportGrade" :loading="exportLoading"
+          >导出学员数据</el-button
+        >
       </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 2)"
           >学员详情</el-button
         >
+        <el-button
+          v-if="
+            props.scope.row.stuAllNum == 0 && props.scope.row.recordNum == 0
+          "
+          type="text"
+          style="color: red"
+          @click="changeClass(props.scope.row)"
+          >更换班级</el-button
+        >
         <!-- <el-button type="text" @click="del(props.scope.row)">移除</el-button> -->
       </template>
     </table-list>
@@ -581,6 +593,11 @@
     </el-dialog>
     <account-tag ref="accountTag" @successFuncBack="successFuncBack" />
     <quick-login ref="quickLogin" @backData="backData" />
+    <tab-class-dialog
+      :visible.sync="dialogVisibleClass"
+      :studentInfo="tabClassStudentInfo"
+      @search="search"
+    ></tab-class-dialog>
   </div>
 </template>
 
@@ -589,10 +606,11 @@ import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import accountTag from "@/components/AccountTag";
 import quickLogin from "@/components/quickLogin";
+import tabClassDialog from "./tabClassDialog.vue";
 import * as baseUrls from "@/utils/request.js";
 
 export default {
-  components: { tableList, pagination, accountTag, quickLogin },
+  components: { tableList, pagination, accountTag, quickLogin, tabClassDialog },
   data() {
     return {
       options: [
@@ -617,7 +635,7 @@ export default {
       size: "medium",
       active: 1,
       loading: false, //当前表单加载是否加载动画
-      exportLoading: false,//导出按钮
+      exportLoading: false, //导出按钮
       navText: {
         title: "班级人数:",
         index: 0,
@@ -626,7 +644,7 @@ export default {
         choice: true,
         border: true,
         addHide: true,
-        rowKey:"id",
+        rowKey: "id",
         gftsStatus: false,
         gfUserStatus: false,
         backFatherBtn: {
@@ -773,21 +791,21 @@ export default {
           prop1: "useStudyCount",
           prop2: "studyCount",
           hidden: true,
-          scope:"studyCount"
+          scope: "studyCount",
         },
         {
           label: "考试机会",
           prop1: "examNumber",
           prop2: "expendNumber",
           hidden: true,
-          scope:"chance"
+          scope: "chance",
         },
         {
           label: "前培机会",
           prop1: "doNumber",
           prop2: "expendBefore",
           hidden: true,
-          scope:"chance"
+          scope: "chance",
         },
         {
           label: "复购-学时冲突",
@@ -806,6 +824,8 @@ export default {
       dialogVisible: false,
       dialogVisibleTable: false,
       dialogVisibleStudent: false,
+      dialogVisibleClass: false,
+      tabClassStudentInfo: {},
       allCheckList: [], //多选数组
       stice: 0,
       obtainGoods: {}, //选择班级头部商品数据
@@ -855,6 +875,10 @@ export default {
     this.search();
   },
   methods: {
+    changeClass(row) {
+      this.dialogVisibleClass = true;
+      this.tabClassStudentInfo = row;
+    },
     /**
      * 组件成功回调
      */
@@ -1172,22 +1196,23 @@ export default {
       }
     },
     //导出学员数据
-    exportGrade(){
-      this.exportLoading = true
-      let data = this.$refs.tableList.allCheckData
-      if(data && data.length > 0){
-       let idCards = data.map(x => x.idCard)
-       this.formData.idCards = idCards
-       console.log(idCards,'idCards');
-       console.log(this.formData,'this.formData');
+    exportGrade() {
+      this.exportLoading = true;
+      let data = this.$refs.tableList.allCheckData;
+      if (data && data.length > 0) {
+        let idCards = data.map((x) => x.idCard);
+        this.formData.idCards = idCards;
+        console.log(idCards, "idCards");
+        console.log(this.formData, "this.formData");
       }
-      this.formData.gradeId = this.$route.query.id,
-      this.formData.status = '0,1',
-      this.$api
-        .inquireGradegradeexportGrade(this.formData)
-        .then((res) => {
+      (this.formData.gradeId = this.$route.query.id),
+        (this.formData.status = "0,1"),
+        this.$api
+          .inquireGradegradeexportGrade(this.formData)
+          .then((res) => {
             if (res.msg) {
-              let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
+              let url =
+                baseUrls.baseURL + "common/download?fileName=" + res.msg;
               let link = document.createElement("a");
               let fileName = "班级学员数据" + ".xlsx";
               document.body.appendChild(link);
@@ -1199,9 +1224,10 @@ export default {
             } else {
               this.$message.error("导出失败");
             }
-        }).finally(() => {
-          this.exportLoading = false
-        })
+          })
+          .finally(() => {
+            this.exportLoading = false;
+          });
     },
     search(int) {
       this.loading = true;

+ 184 - 0
src/views/education/classManageMent/studentMenu/tabClassDialog.vue

@@ -0,0 +1,184 @@
+<template>
+  <Base-dialog
+    title="更换班级"
+    width="1000px"
+    :isShow.sync="isShow"
+    @submit="submit"
+  >
+    <div>
+      <table-list
+        :tableSets="tableSet"
+        :tableData="tableData"
+        :navText="navText"
+        :loading="loading"
+        :radio.sync="tableRadio"
+      >
+      </table-list>
+      <pagination
+        :total="total"
+        :pageSize="formData.pageSize"
+        :currentPage="formData.pageNum"
+        @handleSizeChange="handleSizeChange"
+        @handleCurrentChange="handleCurrentChange"
+      />
+    </div>
+  </Base-dialog>
+</template>
+
+<script>
+import tableList from "@/components/tableList";
+import { getListGoods, changeGradeFree } from "@/api/education/classManageMent";
+export default {
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    studentInfo: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      navText: {
+        title: "营销活动",
+        index: 0,
+        ch: "条",
+        num: false,
+        border: true,
+        dontNum: true,
+        choice: false,
+        choiceRadio: true,
+        radioKey: "gradeId",
+        tableHide: true,
+        addHide: true,
+        headShow: false,
+        backFatherBtn: {
+          status: false,
+          title: "未定义",
+        },
+      },
+      tableSet: [
+        {
+          label: "班级名称",
+          prop: "className",
+          hidden: true,
+          scope: "editInfo",
+        },
+        {
+          label: "班级人数",
+          prop1: "studentNum",
+          prop2: "studentUpper",
+          hidden: true,
+          scope: "peopleNums",
+          width: "150px",
+        },
+        {
+          label: "开放学习时间",
+          prop: "learningStatus",
+          prop1: "learningTimeStart",
+          hidden: true,
+          scope: "classTimeTypes",
+          width: "150px",
+        },
+        {
+          label: "班级有效期",
+          prop1: "classStartTime",
+          prop2: "classEndTime",
+          hidden: true,
+          Diszing: false,
+          scope: "TimeLists",
+          width: "200px",
+        },
+      ],
+      tableData: [],
+      loading: false,
+      total: 0,
+      tableRadio: "",
+      formData: {},
+    };
+  },
+  methods: {
+    init() {
+      this.tableRadio = "";
+      this.formData = {
+        pageSize: 10,
+        pageNum: 1,
+        goodsId: this.studentInfo.goodsId,
+      };
+    },
+    search() {
+      this.loading = true;
+      getListGoods(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    submit() {
+      if (!this.tableRadio) {
+        return this.$message.error("请选择班级");
+      }
+      
+      let { goodsId, gradeId, orderGoodsId, userId } = this.studentInfo;
+      if(this.tableRadio == gradeId){
+        return this.$message.error("不可更换相同班级");
+      }
+      changeGradeFree({
+        goodsId,
+        oldGradeId: gradeId,
+        gradeId: this.tableRadio,
+        orderGoodsId,
+        userId,
+      }).then((res) => {
+        this.$message.success("更换成功");
+        this.$emit("search", 2);
+        this.isShow = false;
+      });
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.search();
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        return this.visible;
+      },
+      set(val) {
+        this.$emit("update:visible", false);
+      },
+    },
+  },
+  components: {
+    tableList,
+  },
+  watch: {
+    isShow: {
+      handler(newVal) {
+        if (newVal) {
+          this.init();
+          this.search();
+        }
+      },
+      immediate: true,
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 29 - 3
src/views/education/examManagement/examArrangement/applicableProducts/checkGoodsList.vue

@@ -53,7 +53,17 @@
           <el-button :size="size" @click="init">重置</el-button>
         </div>
         <div>
-          <el-checkbox-group v-model="goodsActiveList">
+          <el-checkbox
+            style="margin: 20px 0 10px"
+            :indeterminate="isIndeterminate"
+            v-model="checkAll"
+            @change="handleCheckAllChange"
+            >全选</el-checkbox
+          >
+          <el-checkbox-group
+            v-model="goodsActiveList"
+            @change="handleCheckedChange"
+          >
             <ul class="ul_style">
               <li
                 style="margin-bottom: 6px"
@@ -90,12 +100,29 @@ export default {
       formData: {},
       goodsList: [],
       goodsActiveList: [],
+      checkAll: false,
+      isIndeterminate: true,
     };
   },
   methods: {
+    handleCheckAllChange(val) {
+      this.goodsActiveList = val ? this.getAllIdArr() : this.getData.goodsId;
+      this.isIndeterminate = false;
+    },
+    getAllIdArr() {
+      return this.goodsList.map((e) => e.goodsId);
+    },
+    handleCheckedChange(value) {
+      let checkedCount = value.length;
+      this.checkAll =
+        this.goodsList.length && checkedCount === this.goodsList.length;
+      this.isIndeterminate =
+        checkedCount > 0 && checkedCount < this.goodsList.length;
+    },
     openBoxGoods(getData) {
-      this.goodsActiveList = [];
       this.getData = JSON.parse(JSON.stringify(getData));
+      this.goodsActiveList = this.getData.goodsId;
+      this.handleCheckedChange(this.goodsActiveList);
       this.getSujects();
       this.init();
       this.dialogGoods = true;
@@ -144,7 +171,6 @@ export default {
   align-items: center;
 }
 .ul_style {
-  margin-top: 20px;
   max-height: 500px;
   overflow: auto;
 }

+ 27 - 23
src/views/education/mockTestManagement/mockExamArrangement/addMockExam/infoPage.vue

@@ -163,30 +163,34 @@
                   >删除</i
                 >
               </div>
-              <div style="margin-bottom: 10px">
-                指定开放学员,有购买一下商品:<el-button
-                  type="info"
-                  :size="size"
-                  @click="activeGoods(index, indexs)"
-                  >选择商品</el-button
-                >
-              </div>
-              <ul class="goodslist_style">
-                <li
-                  v-for="(ititem, itindex) in items.mockMajorSubjectGoodsList"
-                  :key="itindex"
-                >
-                  {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
-                    style="color: red"
-                    >¥{{ ititem.price }}</span
-                  ><i
-                    class="deleteStyle"
-                    style="margin-left: 10px"
-                    @click="items.mockMajorSubjectGoodsList.splice(itindex, 1)"
-                    >删除</i
+              <template v-if="!listData.mockActivity">
+                <div style="margin-bottom: 10px">
+                  指定开放学员,有购买一下商品:<el-button
+                    type="info"
+                    :size="size"
+                    @click="activeGoods(index, indexs)"
+                    >选择商品</el-button
+                  >
+                </div>
+                <ul class="goodslist_style">
+                  <li
+                    v-for="(ititem, itindex) in items.mockMajorSubjectGoodsList"
+                    :key="itindex"
                   >
-                </li>
-              </ul>
+                    {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
+                      style="color: red"
+                      >¥{{ ititem.price }}</span
+                    ><i
+                      class="deleteStyle"
+                      style="margin-left: 10px"
+                      @click="
+                        items.mockMajorSubjectGoodsList.splice(itindex, 1)
+                      "
+                      >删除</i
+                    >
+                  </li>
+                </ul>
+              </template>
             </div>
           </li>
         </ul>

+ 31 - 35
src/views/education/mockTestManagement/mockExamArrangement/editMockExam/infoPage.vue

@@ -163,34 +163,34 @@
                   >删除</i
                 >
               </div>
-              <div style="margin-bottom: 10px">
-                指定开放学员,有购买一下商品:<el-button
-                  type="info"
-                  :size="size"
-                  @click="activeGoods(index, indexs)"
-                  >选择商品</el-button
-                >
-              </div>
-              <ul class="goodslist_style">
-                <li
-                  v-for="(
-                    ititem, itindex
-                  ) in items.mockMajorSubjectGoodsList"
-                  :key="itindex"
-                >
-                  {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
-                    style="color: red"
-                    >¥{{ ititem.price }}</span
-                  ><i
-                    class="deleteStyle"
-                    style="margin-left: 10px"
-                    @click="
-                      items.mockMajorSubjectGoodsList.splice(itindex, 1)
-                    "
-                    >删除</i
+              <template v-if="!listData.mockActivity">
+                <div style="margin-bottom: 10px">
+                  指定开放学员,有购买一下商品:<el-button
+                    type="info"
+                    :size="size"
+                    @click="activeGoods(index, indexs)"
+                    >选择商品</el-button
+                  >
+                </div>
+                <ul class="goodslist_style">
+                  <li
+                    v-for="(ititem, itindex) in items.mockMajorSubjectGoodsList"
+                    :key="itindex"
                   >
-                </li>
-              </ul>
+                    {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
+                      style="color: red"
+                      >¥{{ ititem.price }}</span
+                    ><i
+                      class="deleteStyle"
+                      style="margin-left: 10px"
+                      @click="
+                        items.mockMajorSubjectGoodsList.splice(itindex, 1)
+                      "
+                      >删除</i
+                    >
+                  </li>
+                </ul>
+              </template>
             </div>
           </li>
         </ul>
@@ -239,9 +239,7 @@ export default {
             i < this.infoData[index].mockMajorSubjectList.length;
             i++
           ) {
-            if (
-              this.infoData[index].mockMajorSubjectList[i].subjectId === id
-            ) {
+            if (this.infoData[index].mockMajorSubjectList[i].subjectId === id) {
               status = true;
               break;
             }
@@ -282,7 +280,7 @@ export default {
      * 获取初始模考专业列表
      */
     getBybusinfoPage(data) {
-      console.log(data)
+      console.log(data);
       this.infoData = data;
     },
     /**
@@ -420,8 +418,7 @@ export default {
         educationTypeId: this.listData.educationTypeId,
         businessId: this.listData.businessId,
         examId: this.infoData[index].mockMajorSubjectList[indexs].examId,
-        examName:
-          this.infoData[index].mockMajorSubjectList[indexs].examName,
+        examName: this.infoData[index].mockMajorSubjectList[indexs].examName,
       });
     },
     /**
@@ -446,8 +443,7 @@ export default {
       this.$refs.activeSection.openBoxGoods(index, indexs, {
         educationTypeId: this.listData.educationTypeId,
         businessId: this.listData.businessId,
-        sectionId:
-          this.infoData[index].mockMajorSubjectList[indexs].sectionId,
+        sectionId: this.infoData[index].mockMajorSubjectList[indexs].sectionId,
         sectionName:
           this.infoData[index].mockMajorSubjectList[indexs].sectionName,
       });

+ 1 - 1
src/views/education/questionBankLearning/questionRecordPage/listOfQuestions/studentData/index.vue

@@ -386,7 +386,7 @@ export default {
             data.historyExamJson[i].type === 5) &&
           data.historyExamJson[i].scoreResult
         ) {
-          data.score += data.historyExamJson[i].scoreResult;
+          data.score += data.historyExamJson[i].scoreResult*1;
         }
       }
       data.historyExamJson = JSON.stringify(data.historyExamJson);

+ 8 - 0
src/views/education/studentManageMent/studentList/index.vue

@@ -191,6 +191,14 @@ export default {
           scope: "moreDataPicker",
           Diszing: true,
         },
+        {
+          prop: "idCard",
+          placeholder: "学员身份证",
+        },
+        {
+          prop: "telphone",
+          placeholder: "学员手机号码",
+        },
       ],
       formData: {
         status: "0,1",

+ 13 - 1
src/views/education/studentManageMent/studentXQ/BankQuestionPassRecord.vue

@@ -102,6 +102,9 @@
               )
             }}%
           </span>
+          <span v-else-if="item.scope === 'mix'">
+            {{ scope.row[item.prop1] }}/{{ scope.row[item.prop2] }}
+          </span>
           <span v-else>
             {{ scope.row[item.prop] }}{{ item.ch ? item.ch : "" }}
           </span>
@@ -555,6 +558,12 @@ export default {
           label: "学时",
           prop: "classHours",
         },
+        {
+          label: "学习进度(节)",
+          prop1: "stuAllNum",
+          prop2: "examNum",
+          scope: "mix",
+        },
         {
           label: "做题进度(试卷)",
           prop1: "stuAllNum",
@@ -820,7 +829,10 @@ export default {
       if (!row.loadDetails) {
         //根据loadDetails判定是否已经加载了数据
         this.$api
-          .inquireselectExamList({ userId: row.userId, orderGoodsId: row.orderGoodsId })
+          .inquireselectExamList({
+            userId: row.userId,
+            orderGoodsId: row.orderGoodsId,
+          })
           .then((res) => {
             row.details = res.data;
             row.loadDetails = true; //加载成功之后更新标识

+ 11 - 1
src/views/education/studentManageMent/studentXQ/liveList.vue

@@ -97,6 +97,9 @@
             {{ $methodsTools.onlyForma(scope.row[item.prop1]) }} -
             {{ $methodsTools.onlyForma(scope.row[item.prop2]) }}
           </span>
+          <span v-else-if="item.scope === 'mix'">
+            {{ scope.row[item.prop1] }}/{{ scope.row[item.prop2] }}
+          </span>
           <span v-else>
             {{ scope.row[item.prop] }}{{ item.ch ? item.ch : "" }}
           </span>
@@ -252,6 +255,12 @@ export default {
           label: "学时",
           prop: "classHours",
         },
+        {
+          label: "学习进度(节)",
+          prop1: "stuAllNum",
+          prop2: "secAllNum",
+          scope: "mix",
+        },
         {
           label: "视频学习进度(节)",
           prop: "studyNum",
@@ -311,7 +320,8 @@ export default {
           prop2: "endTime",
           width: "100px",
           scope: "computerTimes",
-        }], //学习记录表格对应column
+        },
+      ], //学习记录表格对应column
       RemardList: [], //学习记录列表
       loading: false,
     };

+ 9 - 0
src/views/education/studentManageMent/studentXQ/studyRecord.vue

@@ -97,6 +97,9 @@
             {{ $methodsTools.onlyForma(scope.row[item.prop1]) }} -
             {{ $methodsTools.onlyForma(scope.row[item.prop2]) }}
           </span>
+          <span v-else-if="item.scope === 'mix'">
+            {{ scope.row[item.prop1] }}/{{ scope.row[item.prop2] }}
+          </span>
           <span v-else>
             {{ scope.row[item.prop] }}{{ item.ch ? item.ch : "" }}
           </span>
@@ -252,6 +255,12 @@ export default {
           label: "学时",
           prop: "classHours",
         },
+        {
+          label: "学习进度(节)",
+          prop1: "stuAllNum",
+          prop2: "secAllNum",
+          scope: "mix",
+        },
         {
           label: "视频学习进度(节)",
           prop: "studyNum",

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

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="chapterExamId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button
@@ -36,6 +43,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { chapterVolumeBatchDel } from "@/api/resource/volumeManagement";
 export default {
   components: { searchBoxNew, tableList, pagination },
   name: "ChapterVolumeManagement",
@@ -50,6 +58,7 @@ export default {
         border: true,
         choice: true,
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -173,6 +182,35 @@ 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 ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.chapterExamId
+          );
+          chapterVolumeBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
+        })
+        .catch(() => {});
+    },
     editInfo(v) {
       this.addClick(v, 0);
     },

+ 39 - 0
src/views/resource/bankManagement/knowledgeManagement/index.vue

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="knowledgeId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button
@@ -253,6 +260,7 @@ export default {
         border: true,
         choice: true,
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -377,6 +385,37 @@ 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) => item.knowledgeId
+          );
+          this.$api
+            .editbankquestion({
+              status: -1,
+              questionIds: questionIdsList,
+            })
+            .then((res) => {
+              this.$message.success("批量删除成功");
+              this.$refs.tableList.clearMoreActive();
+              this.search(1);
+            });
+        })
+        .catch(() => {});
+    },
     loadingClose() {
       this.disabledBtn = false;
     },

+ 161 - 0
src/views/resource/bankManagement/testPaperManagement/BatchImportPop.vue

@@ -0,0 +1,161 @@
+<template>
+  <batch-import-dialoga
+    v-if="type == 1"
+    :dialogVisible.sync="dialogVisible"
+    temUrl="/oss/images/file/20220518/1652865393160.xlsx"
+    apiKey="importDatabankimportDataBackList"
+    :isCheck="false"
+    :isShowTip="false"
+    @success="ExcelSuccess"
+  ></batch-import-dialoga>
+  <batch-import-dialoga
+    v-else
+    :dialogVisible.sync="dialogVisible"
+    temUrl="/oss/images/file/20220324/1648102107588.docx"
+    apiKey="bankquestionimportWordQuestionList"
+    :isCheck="false"
+    :isShowTip="false"
+    :isSuccessBack="true"
+    @success="wordSuccess"
+    type="Word"
+    :param="formData"
+  ></batch-import-dialoga>
+</template>
+
+<script>
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
+export default {
+  data() {
+    return {
+      dialogVisible: false,
+      tableData: [],
+      businObj: {},
+      formData: {
+        eduId: "",
+        businessId: "",
+        subjectId: "",
+        projectId: "",
+      },
+      type: 1, //1是execl 2 word
+    };
+  },
+  methods: {
+    openBoxs(data, obj, type) {
+      this.type = type;
+      this.tableData = JSON.parse(JSON.stringify(data));
+      if (type == 1) {
+        this.businObj = JSON.parse(JSON.stringify(obj));
+      } else {
+        Object.keys(this.formData).map(
+          (e) =>
+            (this.formData[e] = e == "eduId" ? obj["educationTypeId"] : obj[e])
+        );
+      }
+      this.dialogVisible = true;
+    },
+    wordSuccess({ list }) {
+      if (list.length == 0) return;
+      let numList = this.tableData;
+      if (numList.length) {
+        let numIndex = 0;
+        let childrenIndex = 0;
+        numList.forEach((items) => {
+          if (items.sort > numIndex) {
+            numIndex = items.sort;
+          }
+          if (items.index > childrenIndex) {
+            childrenIndex = items.index;
+          }
+        });
+        list.forEach((items, indexs) => {
+          numIndex++;
+          childrenIndex++;
+          items.sort = numIndex;
+          items.index = childrenIndex;
+          items.jsonStr = JSON.stringify(items.optionsList);
+        });
+      } else {
+        list.forEach((items, indexs) => {
+          items.sort = 1 + indexs;
+          items.index = indexs;
+          items.jsonStr = JSON.stringify(items.optionsList);
+        });
+      }
+      this.$emit("backData", list);
+    },
+    ExcelSuccess(data) {
+      if (data.fullStatus == "全部成功") {
+        this.backDataX(data.questionList);
+        this.$message.success("全部导入成功");
+      } else {
+        let url =
+          baseUrls.baseURL + "common/download?fileName=" + 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 (data.fullStatus == "部分成功") {
+          this.backDataX(data.questionList);
+          this.$message.warning("部分导入成功,请打开文档查看错误原因");
+        } else {
+          this.$message.error("导入失败,请打开文档查看错误原因");
+        }
+      }
+    },
+    backDataX(arry) {
+      let arr = JSON.parse(JSON.stringify(arry));
+      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.forEach((item, index) => {
+          item.sort = maxIndex + 1;
+          item.index = childrenIndex + 1;
+          maxIndex++;
+          childrenIndex++;
+        });
+      } else {
+        arr.forEach((item, index) => {
+          item.sort = index + 1;
+          item.index = index;
+        });
+      }
+      this.$emit("backData", arr);
+    },
+  },
+  components: {
+    batchImportDialoga,
+  },
+};
+</script>
+

+ 6 - 21
src/views/resource/bankManagement/testPaperManagement/addPaper/topicAddPaper/index.vue

@@ -23,10 +23,10 @@
           ></el-input>
           <el-button
             size="medium"
-            @click="$refs.wordpop.dialogDRword = true"
+            @click="$refs.batchPop.openBoxs(tableData, businObj, 2)"
             type="success"
             >Word批量导入</el-button
-          ><el-button size="medium" @click="openExcel" type="success"
+          ><el-button size="medium" @click="$refs.batchPop.openBoxs(tableData, businObj, 1)" type="success"
             >Excel批量导入</el-button
           ><el-button size="medium" @click="delAll" type="danger"
             >批量删除</el-button
@@ -662,8 +662,7 @@
           >
         </span>
       </el-dialog>
-      <word-pop ref="wordpop" @backwordData="backwordData" />
-      <excel-pop ref="excelpop" @backExcelData="backExcelData" />
+      <Batch-import-pop ref="batchPop" @backData="backData" />
     </div>
   </div>
 </template>
@@ -674,8 +673,7 @@ 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 excelPop from "../../excelPop.vue";
+import BatchImportPop from "../../BatchImportPop.vue";
 export default {
   name: "TopicAddPaper",
   components: {
@@ -684,8 +682,7 @@ export default {
     tableList,
     busIns,
     questionBank,
-    wordPop,
-    excelPop,
+    BatchImportPop,
   },
   data() {
     return {
@@ -1041,21 +1038,9 @@ export default {
     this.localStart = false;
   },
   methods: {
-    openExcel() {
-      this.$refs.excelpop.openBoxs(this.tableData, this.businObj);
-    },
-    /**
-     * 返回word数据
-     */
-    backwordData(data) {
+    backData(data) {
       this.tableData = this.tableData.concat(data);
     },
-    /**
-     * 返回数据
-     */
-    backExcelData(arr) {
-      this.tableData = this.tableData.concat(arr);
-    },
     setInterFunc() {
       var arr = setInterval(() => {
         if (!this.localStart) {

+ 12 - 25
src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/index.vue

@@ -18,10 +18,13 @@
           ></el-input>
           <el-button
             size="medium"
-            @click="$refs.wordpop.dialogDRword = true"
+            @click="$refs.batchPop.openBoxs(tableData, businObj, 2)"
             type="success"
             >Word批量导入</el-button
-          ><el-button size="medium" @click="openExcel" type="success"
+          ><el-button
+            size="medium"
+            @click="$refs.batchPop.openBoxs(tableData, businObj, 1)"
+            type="success"
             >Excel批量导入</el-button
           ><el-button size="medium" @click="delAll" type="danger"
             >批量删除</el-button
@@ -666,8 +669,7 @@
           >
         </span>
       </el-dialog>
-      <excel-pop ref="excelpop" @backExcelData="backExcelData" />
-      <word-pop ref="wordpop" @backwordData="backwordData" />
+      <Batch-import-pop ref="batchPop" @backData="backData" />
     </div>
   </div>
 </template>
@@ -678,8 +680,7 @@ 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 excelPop from "../../excelPop.vue";
+import BatchImportPop from "../../BatchImportPop.vue";
 export default {
   components: {
     searchBoxNew,
@@ -687,8 +688,7 @@ export default {
     tableList,
     busIns,
     questionBank,
-    wordPop,
-    excelPop,
+    BatchImportPop,
   },
   data() {
     return {
@@ -1064,24 +1064,11 @@ export default {
     this.localStart = false;
   },
   methods: {
-    openExcel() {
-      this.$refs.excelpop.openBoxs(this.tableData, this.businObj);
-    },
-    /**
-     * 返回word数据
-     */
-    backwordData(data) {
-      this.tableData = this.tableData.concat(data);
-    },
-    /**
-     * 返回数据
-     */
-    backExcelData(arr) {
+
+    backData(arr) {
       this.tableData = this.tableData.concat(arr);
     },
-    /**
-     *
-     */
+
     returnDatas() {
       this.$confirm(
         "点击【恢复】后,当前页面的数据,恢复为【上一次的操作行为数据】,请慎重使用。 ",
@@ -1293,7 +1280,7 @@ export default {
         this.tableData.forEach((item) => {
           if (item.sort > maxIndex) {
             maxIndex = item.sort;
-            childrenIndex = item.index
+            childrenIndex = item.index;
           }
           if (item.index > childrenIndex) {
             childrenIndex = item.index;

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

@@ -1,280 +0,0 @@
-<template>
-  <div>
-    <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>
-      <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>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDRexcel = false">取 消</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import * as baseUrls from "@/utils/request.js";
-export default {
-  data() {
-    return {
-      dialogDRexcel: false,
-      tableData: [],
-      businObj: {},
-    };
-  },
-  methods: {
-    openBoxs(arr, obj) {
-      if (arr.length) {
-        this.tableData = JSON.parse(JSON.stringify(arr));
-      }
-      this.businObj = JSON.parse(JSON.stringify(obj));
-      this.dialogDRexcel = true;
-    },
-    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];
-      if (file === undefined) {
-        e.target.value = "";
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx" && type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx、.xls");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("file", file);
-      this.$api
-        .importDatabankimportDataBackList(formData)
-        .then((res) => {
-          console.log(res);
-          if (res.data.fullStatus == "全部成功") {
-            self.backDataX(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.backDataX(res.data.questionList);
-              self.$message.warning("部分导入成功,请打开文档查看错误原因");
-            } else {
-              self.$message.error("导入失败,请打开文档查看错误原因");
-            }
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-        });
-    },
-    backDataX(arry) {
-      let arr = JSON.parse(JSON.stringify(arry));
-      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.forEach((item, index) => {
-          item.sort = maxIndex + 1;
-          item.index = childrenIndex + 1;
-          maxIndex++;
-          childrenIndex++;
-        });
-      } else {
-        arr.forEach((item, index) => {
-          item.sort = index + 1;
-          item.index = index;
-        });
-      }
-      this.$emit("backExcelData", arr);
-      this.dialogDRexcel = false;
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-/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;
-    }
-  }
-}
-
-.swq {
-  text-align: center;
-  border-bottom: 1px solid #eee;
-}
-.dowmStys {
-  color: blue;
-  cursor: pointer;
-}
-.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>

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

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="examId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 1)"
           >基本信息</el-button
@@ -44,6 +51,7 @@ import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import testPaperPreview from "@/components/testPaperPreview";
+import { paperBatchDel } from "@/api/resource/volumeManagement";
 export default {
   name: "TestPaperManagement",
   components: { tableList, pagination, searchBoxNew, testPaperPreview },
@@ -59,6 +67,7 @@ export default {
         choice: true,
         changeWidth: "240px",
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -177,6 +186,35 @@ 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 ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.examId
+          );
+          paperBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
+        })
+        .catch(() => {});
+    },
     preview(id) {
       this.$refs.testPaperPreview.openBox(1, id);
     },

+ 0 - 290
src/views/resource/bankManagement/testPaperManagement/wordPop.vue

@@ -1,290 +0,0 @@
-<template>
-  <div id="wordPop">
-    <el-dialog
-      destroy-on-close
-      :visible.sync="dialogDRword"
-      :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="dialogDRword = false"
-          />
-        </div>
-      </div>
-      <div>
-        <div class="swq">
-          <img
-            style="width: 182px; height: 168px"
-            src="@/assets/images/dr.png"
-            alt=""
-          />
-        </div>
-        <div style="padding-left: 100px">
-          <p>第一步:下载word导入模板</p>
-          <p style="padding-left: 50px">
-            <i class="el-icon-upload"></i
-            ><span class="dowmStys" @click="getDowm">下载模板</span>
-          </p>
-          <p>第二步:点击“上传Word”完成导入</p>
-          <label
-            for="mobles"
-            style="margin-left: 50px"
-            class="el-button el-button--primary el-button--mini"
-            >上传Word</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDRword = false">取 消</el-button>
-      </span>
-    </el-dialog>
-
-    <el-dialog
-      append-to-body
-      destroy-on-close
-      :visible.sync="dialogERROR"
-      width="660px"
-      :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="dialogERROR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
-          导入失败原因
-        </h4>
-        <el-input
-          readonly
-          type="textarea"
-          :autosize="{ minRows: 6, maxRows: 24 }"
-          v-model="errorData"
-        >
-        </el-input>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogERROR = false">确定</el-button>
-      </span>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import * as baseUrls from "@/utils/request.js";
-export default {
-  data() {
-    return {
-      errorData: "",
-      formData: {
-        eduId: "",
-        businessId: "",
-        subjectId: "",
-        projectId: "",
-      },
-      dialogERROR: false,
-      dialogDRword: false,
-    };
-  },
-  methods: {
-    getDowm() {
-      let url =
-        baseUrls.BASE_IMG_URL +
-        "/oss/images/file/20220324/1648102107588.docx" +
-        `?time=${this.$methodsTools.getNewTime()}`;
-      let link = document.createElement("a");
-      let fileName = "导入模板" + ".docx";
-      document.body.appendChild(link);
-      link.href = url;
-      link.dowmload = fileName;
-      link.click();
-      link.remove();
-    },
-    importMobleadd(e) {
-      var self = this;
-      let arr = this.$parent.businObj;
-      var file = e.target.files[0];
-      if (file === undefined) {
-        e.target.value = "";
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "docx") {
-        self.$message.error("请上传word文件,且上传格式需为:.docx");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("file", file);
-      formData.append("eduId", arr.educationTypeId);
-      formData.append("projectId", arr.projectId);
-      formData.append("businessId", arr.businessId);
-      formData.append("subjectId", arr.subjectId);
-      this.$api
-        .bankquestionimportWordQuestionList(formData)
-        .then((res) => {
-          if (res.code === 200) {
-            let { errorLog, list } = res.data;
-            if (errorLog) {
-              this.errorData = errorLog;
-              this.dialogERROR = true;
-            } else {
-              self.$message.success("导入成功");
-            }
-            if (list.length == 0) return;
-            let numList = self.$parent.tableData;
-            if (numList.length) {
-              let numIndex = 0;
-              let childrenIndex = 0;
-              numList.forEach((items) => {
-                if (items.sort > numIndex) {
-                  numIndex = items.sort;
-                }
-                if (items.index > childrenIndex) {
-                  childrenIndex = items.index;
-                }
-              });
-              list.forEach((items, indexs) => {
-                numIndex++;
-                childrenIndex++;
-                items.sort = numIndex;
-                items.index = childrenIndex;
-                items.jsonStr = JSON.stringify(items.optionsList);
-              });
-            } else {
-              list.forEach((items, indexs) => {
-                items.sort = 1 + indexs;
-                items.index = indexs;
-                items.jsonStr = JSON.stringify(items.optionsList);
-              });
-            }
-            self.$emit("backwordData", list);
-            self.dialogDRword = false;
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-        });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-/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;
-    }
-  }
-}
-
-.swq {
-  text-align: center;
-  border-bottom: 1px solid #eee;
-}
-.dowmStys {
-  color: blue;
-  cursor: pointer;
-}
-.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>

+ 0 - 99
src/views/resource/bankManagement/topicManagement/excelPop.vue

@@ -1,99 +0,0 @@
-<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/20220307/1646623385198.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];
-      if (file === undefined) {
-        e.target.value = ""
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx"&& type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("file", file);
-      this.$api
-        .importDatabankquestion(formData)
-        .then((res) => {
-          if (res.msg == "操作成功") {
-            self.$message.success("导入成功");
-          } else {
-            let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
-            let link = document.createElement("a");
-            let fileName = "导入模板" + ".xlsx";
-            document.body.appendChild(link);
-            link.href = url;
-            link.dowmload = fileName;
-            link.click();
-            link.remove();
-            self.$message.warning("导入有误,请打开文档查看错误原因");
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-          self.$emit("search", 2);
-        });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.swq {
-  text-align: center;
-  border-bottom: 1px solid #eee;
-}
-.dowmStys {
-  color: blue;
-  cursor: pointer;
-}
-</style>

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

@@ -22,7 +22,8 @@
           >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 size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
       </template>
@@ -64,28 +65,15 @@
         <el-button @click="dialogDRword = false">取 消</el-button>
       </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 @search="search" />
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDRexcel = false">取 消</el-button>
-      </span>
-    </el-dialog>
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogDRexcel"
+      temUrl="/oss/images/file/20220307/1646623385198.xlsx"
+      apiKey="importDatabankquestion"
+      :isCheck="false"
+      :isShowTip="false"
+      :isSuccessBack="true"
+      @success="success"
+    ></batch-import-dialoga>
     <el-dialog
       @closed="loadingClose"
       width="1180px"
@@ -254,8 +242,9 @@ import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import busIns from "@/components/busIns";
 import questionBank from "@/components/questionBank";
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
 import wordPop from "./wordPop.vue";
-import excelPop from "./excelPop.vue";
+import { questionBatchDel } from "@/api/resource/volumeManagement";
 export default {
   components: {
     questionBank,
@@ -264,7 +253,7 @@ export default {
     pagination,
     searchBoxNew,
     wordPop,
-    excelPop,
+    batchImportDialoga,
   },
   name: "TopicManagement",
   data() {
@@ -353,7 +342,7 @@ export default {
           prop: "type",
           hidden: true,
           scope: "topic",
-          width:"140px"
+          width: "140px",
         },
         {
           label: "标题前缀",
@@ -479,27 +468,27 @@ export default {
         this.$message.warning("请勾选需要删除的题目");
         return;
       }
-      this.$confirm(`此操作将永久删除所勾选的${this.$refs.tableList.allCheckData.length}条题目, 是否继续?`, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
+      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);
-            });
+          const ids = this.$refs.tableList.allCheckData.map((item) => {
+            return item.questionId;
+          });
+          questionBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
       // console.log(this.$refs.tableList.)
@@ -555,6 +544,22 @@ export default {
           this.loading = false;
         });
     },
+    success({ msg }) {
+      if (msg == "操作成功") {
+        this.$message.success("导入成功");
+      } else {
+        let url = baseUrls.baseURL + "common/download?fileName=" + msg;
+        let link = document.createElement("a");
+        let fileName = "导入模板" + ".xlsx";
+        document.body.appendChild(link);
+        link.href = url;
+        link.dowmload = fileName;
+        link.click();
+        link.remove();
+        this.$message.warning("导入有误,请打开文档查看错误原因");
+      }
+      this.search(2);
+    },
     init() {
       this.search(2);
     },

+ 22 - 12
src/views/resource/bankManagement/topicManagement/wordPop.vue

@@ -66,18 +66,25 @@
           >请完成第二步选择必填项</span
         >
       </p>
-      <label
+      <div
         v-if="formData.eduId && formData.businessId && formData.subjectId"
-        for="mobles"
-        class="el-button el-button--primary el-button--mini"
-        >上传Word</label
-      ><input
-        style="display: none"
-        type="file"
-        id="mobles"
-        ref="input1"
-        @change="importMobleadd"
-      />
+        v-loading="loading"
+        element-loading-text="正在处理中"
+        style="margin: 0 0 0 50px; width: 130px; height: 40px"
+      >
+        <label
+          v-show="!loading"
+          for="mobles"
+          class="el-button el-button--primary el-button--mini"
+          >上传Word</label
+        ><input
+          style="display: none"
+          type="file"
+          id="mobles"
+          ref="input1"
+          @change="importMobleadd"
+        />
+      </div>
     </div>
     <el-dialog
       append-to-body
@@ -131,6 +138,7 @@ export default {
         projectId: "",
       },
       dialogERROR: false,
+      loading: false,
     };
   },
   computed: {
@@ -185,7 +193,7 @@ export default {
       var self = this;
       var file = e.target.files[0];
       if (file === undefined) {
-        e.target.value = ""
+        e.target.value = "";
         return;
       }
       var type = e.target.value.toLowerCase().split(".").splice(-1);
@@ -193,6 +201,7 @@ export default {
         self.$message.error("请上传word文件,且上传格式需为:.docx");
         return;
       }
+      this.loading = true;
       let formData = new FormData();
       formData.append("file", file);
       formData.append("eduId", this.formData.eduId);
@@ -215,6 +224,7 @@ export default {
         .finally(() => {
           e.target.value = "";
           self.$emit("search", 2);
+          this.loading = false;
         });
     },
   },

+ 61 - 20
src/views/resource/bankManagement/volumeManagement/index.vue

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="moduleExamId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button
@@ -36,20 +43,22 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { moduleVolumeBatchDel } from "@/api/resource/volumeManagement";
 export default {
   components: { searchBoxNew, tableList, pagination },
-  name:"VolumeManagement",
+  name: "VolumeManagement",
   data() {
     return {
       loading: false, //当前表单加载是否加载动画
       navText: {
-        title: "模块管理",
+        title: "模块管理",
         index: 0,
         ch: "条",
-        border:true,
+        border: true,
         num: false,
         choice: true,
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -66,13 +75,13 @@ export default {
           prop: "businessId",
           placeholder: "业务层次",
           scope: "businessLevel",
-          edu:"educationId"
+          edu: "educationId",
         },
         {
           prop: "subjectId",
           placeholder: "科目",
           scope: "sujectType",
-          edu:"educationId"
+          edu: "educationId",
         },
         {
           prop: "publishStatus",
@@ -128,7 +137,7 @@ export default {
           prop3: "businessName",
           prop4: "subjectName",
           hidden: false,
-          scope:"eduTypes",
+          scope: "eduTypes",
         },
         {
           label: "关联商品",
@@ -136,7 +145,7 @@ export default {
           prop1: "goodsName",
           hidden: false,
           scope: "aboutChapter",
-          int:8
+          int: 8,
         },
         {
           label: "章卷总数",
@@ -176,10 +185,39 @@ export default {
   mounted() {
     this.search();
   },
-  activated(){
+  activated() {
     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 ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.moduleExamId
+          );
+          moduleVolumeBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
+        })
+        .catch(() => {});
+    },
     editInfo(v) {
       this.addClick(v, 0);
     },
@@ -195,13 +233,16 @@ export default {
           pageNum: 1,
         };
       }
-      this.$api.inquireBankModule(this.formData).then((res) => {
-        this.tableData = res.rows;
-        this.total = res.total;
-        this.navText.index = res.total;
-      }).finally(()=>{
-        this.loading = false;
-      })
+      this.$api
+        .inquireBankModule(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
     },
     init() {
       this.search(2);
@@ -239,11 +280,11 @@ export default {
       } else {
         const jump = () => {
           this.$router.push({
-          path: "volumeManagementEdit",
-          query: {
-            id: v.moduleExamId,
-          },
-        });
+            path: "volumeManagementEdit",
+            query: {
+              id: v.moduleExamId,
+            },
+          });
         };
         const statusPage = this.$store.state.tagsView.visitedViews.some(
           (item) => {

+ 1 - 1
src/views/resource/baseManageInfos/resource/businessLevel/index.vue

@@ -218,7 +218,7 @@
         <p>注:该配置只适用于视频商品</p>
         <el-radio-group v-model="learningOrder">
           <el-radio :label="0">不限制顺序</el-radio>
-          <el-radio :label="1">限制顺序1</el-radio>
+          <!-- <el-radio :label="1">限制顺序1</el-radio> -->
           <el-radio :label="2">限制顺序2</el-radio>
         </el-radio-group>
         <p v-if="learningOrder === 1 || learningOrder === 2" style="color: red">

+ 24 - 202
src/views/resource/videoManagement/chapter/add/index.vue

@@ -415,90 +415,14 @@
         >
       </span>
     </el-dialog>
-    <el-dialog
-      @closed="closedFunc"
-      :visible.sync="dialogDR"
-      width="660px"
-      :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="dialogDR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <div class="swq">
-          <img
-            style="width: 182px; height: 168px"
-            src="@/assets/images/dr.png"
-            alt=""
-          />
-        </div>
-        <div style="padding-left: 100px">
-          <p>第一步:下载导入模板</p>
-          <p style="padding-left: 50px">
-            <i class="el-icon-upload"></i
-            ><span class="dowmStys" @click="getDowm">下载模板</span>
-          </p>
-          <p>第二步:(批量新增):点击“上传Excel”完成导入</p>
-          <label
-            for="mobles"
-            class="el-button el-button--primary"
-            style="margin-left: 50px; padding: 10px 20px"
-            >上传Excel</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDR = false">取消</el-button>
-        <!-- <el-button type="primary" @click="submitChecksDR">确定</el-button> -->
-      </span>
-    </el-dialog>
-    <el-dialog
-      append-to-body
-      :visible.sync="dialogERROR"
-      width="660px"
-      :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="dialogERROR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
-          导入失败原因
-        </h4>
-        <el-input
-          readonly
-          type="textarea"
-          :autosize="{ minRows: 6, maxRows: 24 }"
-          v-model="errorData"
-        >
-        </el-input>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogERROR = false">确定</el-button>
-      </span>
-    </el-dialog>
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogDR"
+      temUrl="/oss/images/file/20220518/1652842582633.xlsx"
+      apiKey="drCourseSectionimportDataBusiness"
+      checkKey="inquireCourseSection"
+      :param="{ businessJson: newSujectApis }"
+      @success="success"
+    ></batch-import-dialoga>
     <video-preview ref="preview" />
     <add-section ref="addSection" @backData="backData" />
   </div>
@@ -508,16 +432,21 @@
 import * as baseUrls from "@/utils/request.js";
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
 import videoPreview from "@/components/videoPreview";
 import addSection from "../addSection.vue";
 export default {
-  components: { searchBoxNew, pagination, videoPreview,addSection },
+  components: {
+    searchBoxNew,
+    pagination,
+    videoPreview,
+    addSection,
+    batchImportDialoga,
+  },
   name: "ChapterAdd",
   data() {
     return {
       dialogDR: false,
-      errorData: "", //导入错误原因
-      dialogERROR: false,
       disabledBtn: false,
       isIndeterminate: false,
       checkAll: false,
@@ -684,7 +613,7 @@ export default {
      * 添加节-返回数据
      */
     backData(v) {
-      console.log(v)
+      console.log(v);
       this.$api.inquireCourseSection({ sectionIds: v }).then((res) => {
         this.activeLists = res.rows;
         this.submitForm();
@@ -723,108 +652,16 @@ export default {
     seeTheVideo(item) {
       this.$refs.preview.diavosFun(item);
     },
-    getDowm() {
-      let url =
-        baseUrls.BASE_IMG_URL + "/oss/images/file/20220518/1652842582633.xlsx";
-      let link = document.createElement("a");
-      let fileName = "导入模板" + ".xlsx";
-      document.body.appendChild(link);
-      link.href = url;
-      link.dowmload = fileName;
-      link.click();
-      link.remove();
-    },
-    dialogDRFunc(){
-      if (!this.newSujectApis.length) {
-        this.$message.error("请添加科目");
-        return;
-      }
-      this.dialogDR = true
-    },
-    importMobleadd(e) {
+    dialogDRFunc() {
       if (!this.newSujectApis.length) {
         this.$message.error("请添加科目");
         return;
       }
-      var self = this;
-      var file = e.target.files[0];
-      if (file === undefined) {
-        e.target.value = ""
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx"&& type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("businessJson", JSON.stringify(this.newSujectApis));
-      formData.append("file", file);
-      this.$api
-        .drCourseSectionimportDataBusiness(formData)
-        .then(async (res) => {
-          if (res.code === 200) {
-            if (!res.data.errorLog) {
-              await this.awaitGetFestivalList(res.data.importNo, 1)
-                .then((result) => {
-                  self.dialogDR = false;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            } else {
-              await this.awaitGetFestivalList(res.data.importNo, 2)
-                .then((result) => {
-                  let ary = res.data.errorLog.split("\r\n");
-                  ary = ary
-                    .filter((item) => {
-                      return item.length > 0;
-                    })
-                    .reverse();
-                  self.$message({
-                    message: `${ary.length}条数据导入失败,请查看失败原因`,
-                    customClass: "myMessageClass",
-                  });
-                  ary = ary.join("\r\n");
-                  self.errorData = ary;
-                  self.dialogERROR = true;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            }
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-        });
+      this.dialogDR = true;
     },
-    awaitGetFestivalList(ids, type) {
-      return new Promise((resolve, reject) => {
-        this.$api
-          .inquireCourseSection({ importNo: ids })
-          .then((res) => {
-            if (type === 2 && res.rows.length) {
-              this.$message({
-                type: "success",
-                message: `成功导入${res.rows.length}条数据,`,
-                customClass: "myMessageClass",
-              });
-            }
-            if (res.rows.length) {
-              this.activeLists = res.rows;
-              if (type === 1) {
-                this.submitForm();
-              } else {
-                this.submitForm(1);
-              }
-            }
-            resolve();
-          })
-          .catch(() => {
-            reject();
-          });
-      });
+    success(data) {
+      this.activeLists = data;
+      this.submitForm();
     },
     unTime(val) {
       let a = `${val.businessId}-${val.subjectId}`;
@@ -1208,7 +1045,7 @@ export default {
     getRowKeys(row) {
       return row.sectionId;
     },
-    submitForm(int) {
+    submitForm() {
       if (this.activeLists.length === 0) {
         this.dialogVisible = false;
         return;
@@ -1230,14 +1067,7 @@ export default {
       }
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
-      this.activeLists = []
-      if (!int) {
-        this.$message({
-          type: "success",
-          message: `添加成功`,
-          customClass: "myMessageClass",
-        });
-      }
+      this.activeLists = [];
     },
     delList(item) {
       this.tableData.map((items, indexs) => {
@@ -1255,14 +1085,6 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.swq {
-  text-align: center;
-  border-bottom: 1px solid #eee;
-}
-.dowmStys {
-  color: blue;
-  cursor: pointer;
-}
 .boxWidth {
   width: 800px;
 }

+ 21 - 190
src/views/resource/videoManagement/chapter/edit/index.vue

@@ -388,89 +388,14 @@
         >
       </span>
     </el-dialog>
-    <el-dialog
-      :visible.sync="dialogDR"
-      width="660px"
-      :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="dialogDR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <div class="swq">
-          <img
-            style="width: 182px; height: 168px"
-            src="@/assets/images/dr.png"
-            alt=""
-          />
-        </div>
-        <div style="padding-left: 100px">
-          <p>第一步:下载导入模板</p>
-          <p style="padding-left: 50px">
-            <i class="el-icon-upload"></i
-            ><span class="dowmStys" @click="getDowm">下载模板</span>
-          </p>
-          <p>第二步:(批量新增):点击“上传Excel”完成导入</p>
-          <label
-            for="mobles"
-            class="el-button el-button--primary"
-            style="margin-left: 50px; padding: 10px 20px"
-            >上传Excel</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDR = false">取消</el-button>
-        <!-- <el-button type="primary" @click="submitChecksDR">确定</el-button> -->
-      </span>
-    </el-dialog>
-    <el-dialog
-      append-to-body
-      :visible.sync="dialogERROR"
-      width="660px"
-      :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="dialogERROR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
-          导入失败原因
-        </h4>
-        <el-input
-          readonly
-          type="textarea"
-          :autosize="{ minRows: 6, maxRows: 24 }"
-          v-model="errorData"
-        >
-        </el-input>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogERROR = false">确定</el-button>
-      </span>
-    </el-dialog>
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogDR"
+      temUrl="/oss/images/file/20220518/1652842582633.xlsx"
+      apiKey="drCourseSectionimportDataBusiness"
+      checkKey="inquireCourseSection"
+      :param="{ businessJson: newSujectApis }"
+      @success="success"
+    ></batch-import-dialoga>
     <video-preview ref="preview" />
     <add-section ref="addSection" @backData="backData" />
   </div>
@@ -480,16 +405,21 @@
 import * as baseUrls from "@/utils/request.js";
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
 import videoPreview from "@/components/videoPreview";
 import addSection from "../addSection.vue";
 export default {
-  components: { searchBoxNew, pagination, videoPreview,addSection },
+  components: {
+    searchBoxNew,
+    pagination,
+    videoPreview,
+    addSection,
+    batchImportDialoga,
+  },
   name: "ChapterEdit",
   data() {
     return {
       dialogDR: false,
-      errorData: "", //导入错误原因
-      dialogERROR: false,
       disabledBtn: false,
       isIndeterminate: false,
       checkAll: false,
@@ -721,101 +651,9 @@ export default {
       }
       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];
-      if (file === undefined) {
-        e.target.value = ""
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx"&& type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("businessJson", JSON.stringify(this.newSujectApis));
-      formData.append("file", file);
-      this.$api
-        .drCourseSectionimportDataBusiness(formData)
-        .then(async (res) => {
-          if (res.code === 200) {
-            if (!res.data.errorLog) {
-              await this.awaitGetFestivalList(res.data.importNo, 1)
-                .then((result) => {
-                  self.dialogDR = false;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            } else {
-              await this.awaitGetFestivalList(res.data.importNo, 2)
-                .then((result) => {
-                  let ary = res.data.errorLog.split("\r\n");
-                  ary = ary
-                    .filter((item) => {
-                      return item.length > 0;
-                    })
-                    .reverse();
-                  self.$message({
-                    message: `${ary.length}条数据导入失败,请查看失败原因`,
-                    customClass: "myMessageClass",
-                  });
-                  ary = ary.join("\r\n");
-                  self.errorData = ary;
-                  self.dialogERROR = true;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            }
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-        });
-    },
-    /**
-     *
-     * @param {Strings} ids 查询编码
-     * @param {Number} type 1为成功2为失败
-     * @remards 失败时也需查询是否有成功的数据导入数据库,如存在 则加列队列同时提示
-     */
-    awaitGetFestivalList(ids, type) {
-      return new Promise((resolve, reject) => {
-        this.$api
-          .inquireCourseSection({ importNo: ids })
-          .then((res) => {
-            if (type === 2 && res.rows.length) {
-              this.$message({
-                type: "success",
-                message: `成功导入${res.rows.length}条数据,`,
-                customClass: "myMessageClass",
-              });
-            }
-            if (res.rows.length) {
-              this.activeLists = res.rows;
-              if (type === 1) {
-                this.submitForm();
-              } else {
-                this.submitForm(1);
-              }
-            }
-            resolve();
-          })
-          .catch(() => {
-            reject();
-          });
-      });
+    success(data) {
+      this.activeLists = data;
+      this.submitForm();
     },
     /**
      * 科目复选框发生变化时触发
@@ -1299,7 +1137,7 @@ export default {
      * @param {Number} int 导入失败标识
      * @remards 合并且排列节列表数据
      */
-    submitForm(int) {
+    submitForm() {
       if (this.activeLists.length === 0) {
         this.dialogVisible = false;
         return;
@@ -1320,15 +1158,8 @@ export default {
         });
       }
       this.tableData = this.tableData.concat(this.activeLists);
-      this.activeLists = []
+      this.activeLists = [];
       this.dialogVisible = false;
-      if (!int) {
-        this.$message({
-          type: "success",
-          message: `添加成功`,
-          customClass: "myMessageClass",
-        });
-      }
     },
     /**
      *

+ 38 - 0
src/views/resource/videoManagement/chapter/index.vue

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="chapterId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button
@@ -36,6 +43,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { chapterBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "Chapter",
   components: { searchBoxNew, tableList, pagination },
@@ -50,6 +58,7 @@ export default {
         border: true,
         choice: true,
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -184,6 +193,35 @@ 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 ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.chapterId
+          );
+          chapterBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
+        })
+        .catch(() => {});
+    },
     editInfo(v) {
       this.addClick(v, 0);
     },

+ 39 - 0
src/views/resource/videoManagement/courseManagement/index.vue

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="courseId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="edit(props.scope.row, 1)"
           >基本信息</el-button
@@ -40,6 +47,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { courseBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "CourseManagement",
   components: { searchBoxNew, tableList, pagination },
@@ -55,6 +63,7 @@ export default {
         choice: true,
         addHide: false,
         changeWidth: "220px",
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -212,6 +221,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(() => {
+          console.log(5646)
+          const ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.courseId
+          );
+          courseBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
+        })
+        .catch(() => {});
+    },
     edit(v, int) {
       const jump = () => {
         this.$router.push({

+ 42 - 134
src/views/resource/videoManagement/festival/index.vue

@@ -17,6 +17,11 @@
       :loading="loading"
       @editInfo="editInfo"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="customize">
         <el-button size="medium" type="success" @click="moreActive"
           >批量导入</el-button
@@ -36,100 +41,25 @@
       @handleSizeChange="handleSizeChange"
       @handleCurrentChange="handleCurrentChange"
     />
-    <el-dialog
-      :visible.sync="dialogDR"
-      width="660px"
-      :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="dialogDR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <div class="swq">
-          <img
-            style="width: 182px; height: 168px"
-            src="@/assets/images/dr.png"
-            alt=""
-          />
-        </div>
-        <div style="padding-left: 100px">
-          <p>第一步:下载导入模板</p>
-          <p style="padding-left: 50px">
-            <i class="el-icon-upload"></i
-            ><span class="dowmStys" @click="getDowm">下载模板</span>
-          </p>
-          <p>第二步:(批量新增):点击“上传Excel”完成导入</p>
-          <label
-            for="mobles"
-            class="el-button el-button--primary"
-            style="margin-left: 50px; padding: 10px 20px"
-            >上传Excel</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDR = false">取消</el-button>
-        <!-- <el-button type="primary" @click="submitChecksDR">确定</el-button> -->
-      </span>
-    </el-dialog>
-    <el-dialog
-      append-to-body
-      :visible.sync="dialogERROR"
-      width="660px"
-      :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="dialogERROR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
-          导入失败原因
-        </h4>
-        <el-input
-          readonly
-          type="textarea"
-          :autosize="{ minRows: 6, maxRows: 24 }"
-          v-model="errorData"
-        >
-        </el-input>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogERROR = false">确定</el-button>
-      </span>
-    </el-dialog>
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogDR"
+      temUrl="/oss/images/file/20220304/1646382321115.xlsx"
+      apiKey="drCourseSectionimportData"
+      :isCheck="false"
+      @success="search"
+    ></batch-import-dialoga>
   </div>
 </template>
 
 <script>
-import * as baseUrls from "@/utils/request.js";
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
 import pagination from "@/components/pagination";
+import { sectionBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "Festival",
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination,batchImportDialoga },
   data() {
     return {
       dialogDR: false, //导入窗口
@@ -262,7 +192,7 @@ export default {
           prop: "sectionType",
           hidden: true,
           scope: "sectionTypesTTT",
-          width:"120px"
+          width: "120px",
         },
         {
           label: "节时长",
@@ -317,6 +247,7 @@ export default {
       currentPage: 1, //当前页码
       errorData: "", //导入错误原因
       dialogERROR: false,
+      loading: false,
     };
   },
   mounted() {
@@ -326,57 +257,34 @@ export default {
     this.search();
   },
   methods: {
-    getDowm() {
-      let url =
-        baseUrls.BASE_IMG_URL +
-        "/oss/images/file/20220304/1646382321115.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];
-      if (file === undefined) {
-        e.target.value = ""
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx"&& type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx");
+    batchDel() {
+      if (!this.$refs.tableList.allCheckData.length) {
+        this.$message.warning("请勾选需要删除的节");
         return;
       }
-      let formData = new FormData();
-      formData.append("file", file);
-      this.$api
-        .drCourseSectionimportData(formData)
-        .then((res) => {
-          if (res.code === 200) {
-            if (!res.data.errorLog) {
-              self.$message.success("导入成功");
-              self.dialogDR = false;
-            } else {
-              let ary = res.data.errorLog.split("\r\n");
-              ary = ary
-                .filter((item) => {
-                  return item.length > 0;
-                })
-                .reverse()
-                .join("\r\n");
-              self.errorData = ary;
-              self.dialogERROR = true;
-            }
-          }
+      this.$confirm(
+        `此操作将永久删除所勾选的${this.$refs.tableList.allCheckData.length}条节, 是否继续?`,
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(() => {
+          const ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.sectionId
+          );
+          sectionBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
-        .finally(() => {
-          self.search();
-          e.target.value = "";
-        });
+        .catch(() => {});
     },
     moreActive() {
       this.dialogDR = true;

+ 18 - 216
src/views/resource/videoManagement/moduleManagement/add/index.vue

@@ -394,89 +394,14 @@
         >
       </span>
     </el-dialog>
-    <el-dialog
-      :visible.sync="dialogDR"
-      width="660px"
-      :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="dialogDR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <div class="swq">
-          <img
-            style="width: 182px; height: 168px"
-            src="@/assets/images/dr.png"
-            alt=""
-          />
-        </div>
-        <div style="padding-left: 100px">
-          <p>第一步:下载导入模板</p>
-          <p style="padding-left: 50px">
-            <i class="el-icon-upload"></i
-            ><span class="dowmStys" @click="getDowm">下载模板</span>
-          </p>
-          <p>第二步:(批量新增):点击“上传Excel”完成导入</p>
-          <label
-            for="mobles"
-            class="el-button el-button--primary"
-            style="margin-left: 50px; padding: 10px 20px"
-            >上传Excel</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDR = false">取消</el-button>
-        <!-- <el-button type="primary" @click="submitChecksDR">确定</el-button> -->
-      </span>
-    </el-dialog>
-    <el-dialog
-      append-to-body
-      :visible.sync="dialogERROR"
-      width="660px"
-      :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="dialogERROR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
-          导入失败原因
-        </h4>
-        <el-input
-          readonly
-          type="textarea"
-          :autosize="{ minRows: 6, maxRows: 24 }"
-          v-model="errorData"
-        >
-        </el-input>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogERROR = false">确定</el-button>
-      </span>
-    </el-dialog>
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogDR"
+      temUrl="/oss/images/file/20220617/1655453121157.xlsx"
+      apiKey="CoursemoduleimportData"
+      checkKey="inquireCourseListchapter"
+      :param="{ businessJson: newSujectApis }"
+      @success="success"
+    ></batch-import-dialoga>
     <addChapter ref="addChapter" @backData="backData" />
   </div>
 </template>
@@ -484,10 +409,11 @@
 <script>
 import * as baseUrls from "@/utils/request.js";
 import addChapter from "../addChapter.vue";
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 export default {
-  components: { searchBoxNew, pagination, addChapter },
+  components: { searchBoxNew, pagination, addChapter, batchImportDialoga },
   name: "ModuleManagementAdd",
   data() {
     return {
@@ -537,7 +463,7 @@ export default {
         { label: "章编码", prop: "code", width: "120" },
         { label: "标题前缀", prop: "prefixName", width: "180" },
         { label: "章标题", prop: "name" },
-        { label: "节数量", prop: "sectionNum" , width: "120"  },
+        { label: "节数量", prop: "sectionNum", width: "120" },
         {
           label: "发布状态",
           prop: "publishStatus",
@@ -595,9 +521,8 @@ export default {
       disCheckList: [], //已选转禁用复选列表
       activeLists: [],
       localData: [],
-      errorData: "",
-      dialogERROR: false,
       dialogDR: false,
+      loading: false,
     };
   },
   watch: {
@@ -630,123 +555,16 @@ export default {
     }
   },
   methods: {
-    
-    /**
-     * 下载Excel模板
-     */
-    getDowm() {
-      let url =
-        baseUrls.BASE_IMG_URL + "/oss/images/file/20220617/1655453121157.xlsx";
-      let link = document.createElement("a");
-      let fileName = "导入模板" + ".xlsx";
-      document.body.appendChild(link);
-      link.href = url;
-      link.dowmload = fileName;
-      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];
-      if (file === undefined) {
-        e.target.value = ""
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx"&& type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("businessJson", JSON.stringify(this.newSujectApis));
-      formData.append("file", file);
-      this.$api
-        .CoursemoduleimportData(formData)
-        .then(async (res) => {
-          if (res.code === 200) {
-            if (!res.data.errorLog) {
-              await this.awaitGetFestivalList(res.data.importNo, 1)
-                .then((result) => {
-                  self.dialogDR = false;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            } else {
-              await this.awaitGetFestivalList(res.data.importNo, 2)
-                .then((result) => {
-                  let ary = res.data.errorLog.split("\r\n");
-                  ary = ary
-                    .filter((item) => {
-                      return item.length > 0;
-                    })
-                    .reverse();
-                  self.$message({
-                    message: `${ary.length}条数据导入失败,请查看失败原因`,
-                    customClass: "myMessageClass",
-                  });
-                  ary = ary.join("\r\n");
-                  self.errorData = ary;
-                  self.dialogERROR = true;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            }
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-        });
     },
-    /**
-     *
-     * @param {Strings} ids 查询编码
-     * @param {Number} type 1为成功2为失败
-     * @remards 失败时也需查询是否有成功的数据导入数据库,如存在 则加列队列同时提示
-     */
-    awaitGetFestivalList(ids, type) {
-      return new Promise((resolve, reject) => {
-        this.$api
-          .inquireCourseListchapter({ importNo: ids })
-          .then((res) => {
-            if (type === 2 && res.rows.length) {
-              this.$message({
-                type: "success",
-                message: `成功导入${res.rows.length}条数据,`,
-                customClass: "myMessageClass",
-              });
-            }
-            if (res.rows.length) {
-              this.activeLists = res.rows;
-              if (type === 1) {
-                this.submitForm();
-              } else {
-                this.submitForm(1);
-              }
-            }
-            resolve();
-          })
-          .catch(() => {
-            reject();
-          });
-      });
+    success(data) {
+      this.activeLists = data;
+      this.submitForm();
     },
     jumpChapter(v) {
       const jump = () => {
@@ -1183,10 +1001,9 @@ export default {
     },
     /**
      *
-     * @param {Number} int 导入失败标识
      * @remards 合并且排列节列表数据
      */
-    submitForm(int) {
+    submitForm() {
       if (this.activeLists.length === 0) {
         this.dialogVisible = false;
         return;
@@ -1208,14 +1025,7 @@ export default {
       }
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
-      this.activeLists = []
-      if (!int) {
-        this.$message({
-          type: "success",
-          message: `添加成功`,
-          customClass: "myMessageClass",
-        });
-      }
+      this.activeLists = [];
     },
     delList(item) {
       this.tableData.map((items, indexs) => {
@@ -1225,7 +1035,7 @@ export default {
         }
       });
     },
-    closedFunc(){
+    closedFunc() {
       this.activeLists = [];
     },
   },
@@ -1233,14 +1043,6 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.swq {
-  text-align: center;
-  border-bottom: 1px solid #eee;
-}
-.dowmStys {
-  color: blue;
-  cursor: pointer;
-}
 .boxWidth {
   width: 800px;
 }

+ 15 - 267
src/views/resource/videoManagement/moduleManagement/edit/index.vue

@@ -369,89 +369,14 @@
         >
       </span>
     </el-dialog>
-    <el-dialog
-      :visible.sync="dialogDR"
-      width="660px"
-      :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="dialogDR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <div class="swq">
-          <img
-            style="width: 182px; height: 168px"
-            src="@/assets/images/dr.png"
-            alt=""
-          />
-        </div>
-        <div style="padding-left: 100px">
-          <p>第一步:下载导入模板</p>
-          <p style="padding-left: 50px">
-            <i class="el-icon-upload"></i
-            ><span class="dowmStys" @click="getDowm">下载模板</span>
-          </p>
-          <p>第二步:(批量新增):点击“上传Excel”完成导入</p>
-          <label
-            for="mobles"
-            class="el-button el-button--primary"
-            style="margin-left: 50px; padding: 10px 20px"
-            >上传Excel</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
-          />
-        </div>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogDR = false">取消</el-button>
-        <!-- <el-button type="primary" @click="submitChecksDR">确定</el-button> -->
-      </span>
-    </el-dialog>
-    <el-dialog
-      append-to-body
-      :visible.sync="dialogERROR"
-      width="660px"
-      :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="dialogERROR = false"
-          />
-        </div>
-      </div>
-      <div>
-        <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
-          导入失败原因
-        </h4>
-        <el-input
-          readonly
-          type="textarea"
-          :autosize="{ minRows: 6, maxRows: 24 }"
-          v-model="errorData"
-        >
-        </el-input>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogERROR = false">确定</el-button>
-      </span>
-    </el-dialog>
+    <batch-import-dialoga
+      :dialogVisible.sync="dialogDR"
+      temUrl="/oss/images/file/20220617/1655453121157.xlsx"
+      checkKey="inquireCourseListchapter"
+      apiKey="CoursemoduleimportData"
+      :param="{ businessJson: newSujectApis }"
+      @success="success"
+    ></batch-import-dialoga>
     <addChapter ref="addChapter" @backData="backData" />
   </div>
 </template>
@@ -461,9 +386,10 @@ import * as baseUrls from "@/utils/request.js";
 import searchBoxNew from "@/components/searchBoxNew";
 import pagination from "@/components/pagination";
 import addChapter from "../addChapter.vue";
+import batchImportDialoga from "@/components/Comon/batchImportDialog.vue";
 export default {
   name: "ModuleManagementEdit",
-  components: { searchBoxNew, pagination, addChapter },
+  components: { searchBoxNew, pagination, addChapter, batchImportDialoga },
   data() {
     return {
       disabledBtn: false,
@@ -571,9 +497,8 @@ export default {
       activeLists: [],
       noStudent: true,
       pageId: this.$route.query.id,
-      errorData: "",
-      dialogERROR: false,
       dialogDR: false,
+      loading: false,
     };
   },
   watch: {
@@ -611,122 +536,16 @@ export default {
     }
   },
   methods: {
-    /**
-     * 下载Excel模板
-     */
-    getDowm() {
-      let url =
-        baseUrls.BASE_IMG_URL + "/oss/images/file/20220617/1655453121157.xlsx";
-      let link = document.createElement("a");
-      let fileName = "导入模板" + ".xlsx";
-      document.body.appendChild(link);
-      link.href = url;
-      link.dowmload = fileName;
-      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];
-      if (file === undefined) {
-        e.target.value = ""
-        return;
-      }
-      var type = e.target.value.toLowerCase().split(".").splice(-1);
-      if (type[0] != "xlsx"&& type[0] != "xls") {
-        self.$message.error("请上传excel文件,且上传格式需为:.xlsx");
-        return;
-      }
-      let formData = new FormData();
-      formData.append("businessJson", JSON.stringify(this.newSujectApis));
-      formData.append("file", file);
-      this.$api
-        .CoursemoduleimportData(formData)
-        .then(async (res) => {
-          if (res.code === 200) {
-            if (!res.data.errorLog) {
-              await this.awaitGetFestivalList(res.data.importNo, 1)
-                .then((result) => {
-                  self.dialogDR = false;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            } else {
-              await this.awaitGetFestivalList(res.data.importNo, 2)
-                .then((result) => {
-                  let ary = res.data.errorLog.split("\r\n");
-                  ary = ary
-                    .filter((item) => {
-                      return item.length > 0;
-                    })
-                    .reverse();
-                  self.$message({
-                    message: `${ary.length}条数据导入失败,请查看失败原因`,
-                    customClass: "myMessageClass",
-                  });
-                  ary = ary.join("\r\n");
-                  self.errorData = ary;
-                  self.dialogERROR = true;
-                })
-                .catch(() => {
-                  e.target.value = "";
-                });
-            }
-          }
-        })
-        .finally(() => {
-          e.target.value = "";
-        });
     },
-    /**
-     *
-     * @param {Strings} ids 查询编码
-     * @param {Number} type 1为成功2为失败
-     * @remards 失败时也需查询是否有成功的数据导入数据库,如存在 则加列队列同时提示
-     */
-    awaitGetFestivalList(ids, type) {
-      return new Promise((resolve, reject) => {
-        this.$api
-          .inquireCourseListchapter({ importNo: ids })
-          .then((res) => {
-            if (type === 2 && res.rows.length) {
-              this.$message({
-                type: "success",
-                message: `成功导入${res.rows.length}条数据,`,
-                customClass: "myMessageClass",
-              });
-            }
-            if (res.rows.length) {
-              this.activeLists = res.rows;
-              if (type === 1) {
-                this.submitForm();
-              } else {
-                this.submitForm(1);
-              }
-            }
-            resolve();
-          })
-          .catch(() => {
-            reject();
-          });
-      });
+    success(data) {
+      this.activeLists = data;
+      this.submitForm();
     },
     jumpChapter(v) {
       const jump = () => {
@@ -1177,7 +996,7 @@ export default {
       }
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
-      this.activeLists = []
+      this.activeLists = [];
       if (!int) {
         this.$message({
           type: "success",
@@ -1202,20 +1021,9 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.swq {
-  text-align: center;
-  border-bottom: 1px solid #eee;
-}
-.dowmStys {
-  color: blue;
-  cursor: pointer;
-}
 .boxWidth {
   width: 800px;
 }
-.numInputs {
-  width: 150px;
-}
 .checkboxSty {
   max-height: 210px;
   overflow: auto;
@@ -1245,14 +1053,6 @@ export default {
   align-items: center;
   flex-wrap: wrap;
 }
-.imgBoxins {
-  width: 375px;
-  height: 220px;
-  text-align: center;
-  img {
-    height: 100%;
-  }
-}
 .iconStsz {
   font-size: 40px;
   color: #67c23a;
@@ -1264,12 +1064,6 @@ export default {
   justify-content: space-between;
   margin-bottom: 10px;
 }
-.comInputsty {
-  width: 50px;
-  height: 24px;
-  text-align: center;
-  border: none;
-}
 /deep/.el-button {
   border-radius: 8px;
 }
@@ -1313,50 +1107,4 @@ export default {
     }
   }
 }
-.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>

+ 39 - 0
src/views/resource/videoManagement/moduleManagement/index.vue

@@ -14,7 +14,14 @@
       @addClick="addClick"
       :loading="loading"
       @editInfo="editInfo"
+      ref="tableList"
+      rowKey="moduleId"
     >
+      <template slot="customize">
+        <el-button size="medium" @click="batchDel" type="warning"
+          >批量删除</el-button
+        >
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="gift(props.scope.row)"
           >赠送题卷</el-button
@@ -41,6 +48,7 @@ import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import giftQuestionPaper from "./giftQuestionPaper.vue";
+import { moduleBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "ModuleManagement",
   components: { searchBoxNew, tableList, pagination, giftQuestionPaper },
@@ -55,6 +63,7 @@ export default {
         choice: true,
         border: true,
         addHide: false,
+        openCheckMore: true,
         backFatherBtn: {
           status: false,
           title: "未定义",
@@ -191,6 +200,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 ids = this.$refs.tableList.allCheckData.map(
+            (item) => item.moduleId
+          );
+          moduleBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
+        })
+        .catch(() => {});
+      // console.log(this.$refs.tableList.)
+    },
     editInfo(v) {
       this.addClick(v, 0);
     },