Przeglądaj źródła

批量新增增加处理中

谢杰标 2 lat temu
rodzic
commit
9f5d7da13e
22 zmienionych plików z 394 dodań i 1258 usunięć
  1. 118 88
      src/components/Comon/batchImportDialog.vue
  2. 2 2
      src/views/Marketing/goods/commodityManageMent/index.vue
  3. 23 12
      src/views/Marketing/order/offlineOrder/batchRecord/firstStep/uploadStudent.vue
  4. 2 2
      src/views/resource/bankManagement/chapterVolumeManagement/index.vue
  5. 161 0
      src/views/resource/bankManagement/testPaperManagement/BatchImportPop.vue
  6. 6 21
      src/views/resource/bankManagement/testPaperManagement/addPaper/topicAddPaper/index.vue
  7. 12 25
      src/views/resource/bankManagement/testPaperManagement/editPaper/topicEditPaper/index.vue
  8. 0 280
      src/views/resource/bankManagement/testPaperManagement/excelPop.vue
  9. 2 2
      src/views/resource/bankManagement/testPaperManagement/index.vue
  10. 0 290
      src/views/resource/bankManagement/testPaperManagement/wordPop.vue
  11. 0 99
      src/views/resource/bankManagement/topicManagement/excelPop.vue
  12. 29 26
      src/views/resource/bankManagement/topicManagement/index.vue
  13. 22 12
      src/views/resource/bankManagement/topicManagement/wordPop.vue
  14. 2 2
      src/views/resource/bankManagement/volumeManagement/index.vue
  15. 2 115
      src/views/resource/videoManagement/chapter/add/index.vue
  16. 2 107
      src/views/resource/videoManagement/chapter/edit/index.vue
  17. 2 2
      src/views/resource/videoManagement/chapter/index.vue
  18. 2 2
      src/views/resource/videoManagement/courseManagement/index.vue
  19. 3 61
      src/views/resource/videoManagement/festival/index.vue
  20. 1 58
      src/views/resource/videoManagement/moduleManagement/add/index.vue
  21. 1 50
      src/views/resource/videoManagement/moduleManagement/edit/index.vue
  22. 2 2
      src/views/resource/videoManagement/moduleManagement/index.vue

+ 118 - 88
src/components/Comon/batchImportDialog.vue

@@ -1,74 +1,75 @@
 <template>
-  <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>第二步:(批量新增):点击“上传Excel”完成导入</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"
-            >上传Excel</label
-          ><input
-            style="display: none"
-            type="file"
-            id="mobles"
-            ref="input1"
-            @change="importMobleadd"
+  <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>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="isShow = false">取消</el-button>
-      </span>
-      <Base-dialog
-        title="提示"
-        width="660px"
-        :isShow.sync="isShowErr"
-        :appendToBody="true"
-        :isShowFooter="false"
-      >
+    </Base-dialog>
+    <Base-dialog
+      title="提示"
+      width="660px"
+      :isShow.sync="isShowErr"
+      :isShowFooter="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="isShowErr = false">确定</el-button>
-          </span>
+          <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>
-      </Base-dialog>
-    </div>
-  </Base-dialog>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="isShowErr = false">确定</el-button>
+        </span>
+      </div>
+    </Base-dialog>
+  </div>
 </template>
 
 <script>
@@ -98,6 +99,24 @@ export default {
       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 {
@@ -108,7 +127,10 @@ export default {
   },
   methods: {
     getDowm() {
-      let url = baseUrls.BASE_IMG_URL + this.temUrl;
+      let url =
+        baseUrls.BASE_IMG_URL +
+        this.temUrl +
+        `?time=${this.$methodsTools.getNewTime()}`;
       let link = document.createElement("a");
       let fileName = "导入模板" + ".xlsx";
       document.body.appendChild(link);
@@ -118,27 +140,36 @@ export default {
       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;
+      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();
-      this.isCheck &&
-        formData.append("businessJson", JSON.stringify(this.newSujectApis));
       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.errorLog);
+            this.getErrorData(res.data || res);
           }
         })
         .finally(() => {
@@ -153,10 +184,10 @@ export default {
      * @remards 失败时也需查询是否有成功的数据导入数据库,如存在 则加列队列同时提示
      */
     getFestivalList({ importNo, errorLog }) {
-      this.$api[checkKey]({ importNo })
+      this.$api[this.checkKey]({ importNo })
         .then((res) => {
           if (res.rows.length) {
-            !errorLog &&
+            errorLog &&
               this.$message({
                 type: "success",
                 message: `成功导入${res.rows.length}条数据,`,
@@ -167,7 +198,9 @@ export default {
         })
         .catch(() => {});
     },
-    getErrorData(errorLog) {
+    getErrorData(data) {
+      this.isShow = false;
+      let { errorLog } = data;
       if (errorLog) {
         let ary = errorLog.split("\r\n");
         ary = ary
@@ -183,13 +216,15 @@ export default {
         this.errorData = ary;
         this.isShowErr = true;
       } else {
-        this.$message({
-          type: "success",
-          message: `添加成功`,
-          customClass: "myMessageClass",
-        });
-        this.$emit("success", []);
-        this.isShow = false;
+        this.isShowTip &&
+          this.$message({
+            type: "success",
+            message: `添加成功`,
+            customClass: "myMessageClass",
+          });
+      }
+      if (!errorLog || this.isSuccessBack) {
+        this.$emit("success", data);
       }
     },
   },
@@ -203,11 +238,6 @@ export default {
       },
     },
   },
-  watch: {
-    dialogVisible(val) {
-      this.isShowErr = false;
-    },
-  },
 };
 </script>
 

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

@@ -19,7 +19,7 @@
       @openClassNum="openClassNum"
       rowKey="goodsId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="handelBatch(1)" type="success"
           >批量上架</el-button
         ><el-button size="medium" @click="handelBatch(0)" type="success"
@@ -27,7 +27,7 @@
         ><el-button size="medium" @click="handelBatch(2)" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button
           v-if="

+ 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 = "";
         });
     },

+ 2 - 2
src/views/resource/bankManagement/chapterVolumeManagement/index.vue

@@ -17,11 +17,11 @@
       ref="tableList"
       rowKey="chapterExamId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button

+ 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>

+ 2 - 2
src/views/resource/bankManagement/testPaperManagement/index.vue

@@ -17,11 +17,11 @@
       ref="tableList"
       rowKey="examId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 1)"
           >基本信息</el-button

+ 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>

+ 29 - 26
src/views/resource/bankManagement/topicManagement/index.vue

@@ -23,9 +23,9 @@
         ><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>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
@@ -65,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"
@@ -255,8 +242,8 @@ 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: {
@@ -266,7 +253,7 @@ export default {
     pagination,
     searchBoxNew,
     wordPop,
-    excelPop,
+    batchImportDialoga,
   },
   name: "TopicManagement",
   data() {
@@ -557,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;
         });
     },
   },

+ 2 - 2
src/views/resource/bankManagement/volumeManagement/index.vue

@@ -17,11 +17,11 @@
       ref="tableList"
       rowKey="moduleExamId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button

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

@@ -420,7 +420,7 @@
       temUrl="/oss/images/file/20220518/1652842582633.xlsx"
       apiKey="drCourseSectionimportDataBusiness"
       checkKey="inquireCourseSection"
-      :newSujectApis="newSujectApis"
+      :param="{ businessJson: newSujectApis }"
       @success="success"
     ></batch-import-dialoga>
     <video-preview ref="preview" />
@@ -447,8 +447,6 @@ export default {
   data() {
     return {
       dialogDR: false,
-      errorData: "", //导入错误原因
-      dialogERROR: false,
       disabledBtn: false,
       isIndeterminate: false,
       checkAll: false,
@@ -654,17 +652,6 @@ 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("请添加科目");
@@ -672,91 +659,6 @@ export default {
       }
       this.dialogDR = true;
     },
-    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 = "";
-        });
-    },
-    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();
@@ -1143,7 +1045,7 @@ export default {
     getRowKeys(row) {
       return row.sectionId;
     },
-    submitForm(int) {
+    submitForm() {
       if (this.activeLists.length === 0) {
         this.dialogVisible = false;
         return;
@@ -1166,13 +1068,6 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.dialogVisible = false;
       this.activeLists = [];
-      if (!int) {
-        this.$message({
-          type: "success",
-          message: `添加成功`,
-          customClass: "myMessageClass",
-        });
-      }
     },
     delList(item) {
       this.tableData.map((items, indexs) => {
@@ -1190,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;
 }

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

@@ -393,7 +393,7 @@
       temUrl="/oss/images/file/20220518/1652842582633.xlsx"
       apiKey="drCourseSectionimportDataBusiness"
       checkKey="inquireCourseSection"
-      :newSujectApis="newSujectApis"
+      :param="{ businessJson: newSujectApis }"
       @success="success"
     ></batch-import-dialoga>
     <video-preview ref="preview" />
@@ -420,8 +420,6 @@ export default {
   data() {
     return {
       dialogDR: false,
-      errorData: "", //导入错误原因
-      dialogERROR: false,
       disabledBtn: false,
       isIndeterminate: false,
       checkAll: false,
@@ -653,102 +651,6 @@ 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();
@@ -1235,7 +1137,7 @@ export default {
      * @param {Number} int 导入失败标识
      * @remards 合并且排列节列表数据
      */
-    submitForm(int) {
+    submitForm() {
       if (this.activeLists.length === 0) {
         this.dialogVisible = false;
         return;
@@ -1258,13 +1160,6 @@ export default {
       this.tableData = this.tableData.concat(this.activeLists);
       this.activeLists = [];
       this.dialogVisible = false;
-      if (!int) {
-        this.$message({
-          type: "success",
-          message: `添加成功`,
-          customClass: "myMessageClass",
-        });
-      }
     },
     /**
      *

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

@@ -17,11 +17,11 @@
       ref="tableList"
       rowKey="chapterId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button

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

@@ -17,11 +17,11 @@
       ref="tableList"
       rowKey="courseId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="edit(props.scope.row, 1)"
           >基本信息</el-button

+ 3 - 61
src/views/resource/videoManagement/festival/index.vue

@@ -17,11 +17,11 @@
       :loading="loading"
       @editInfo="editInfo"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="customize">
         <el-button size="medium" type="success" @click="moreActive"
           >批量导入</el-button
@@ -46,13 +46,12 @@
       temUrl="/oss/images/file/20220304/1646382321115.xlsx"
       apiKey="drCourseSectionimportData"
       :isCheck="false"
-      @success="success"
+      @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";
@@ -287,63 +286,6 @@ export default {
         })
         .catch(() => {});
     },
-    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");
-        return;
-      }
-      this.loading = true;
-      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;
-            }
-          }
-        })
-        .finally(() => {
-          self.search();
-          e.target.value = "";
-          this.loading = false;
-        });
-    },
-    success() {
-      this.search();
-    },
     moreActive() {
       this.dialogDR = true;
     },

+ 1 - 58
src/views/resource/videoManagement/moduleManagement/add/index.vue

@@ -399,7 +399,7 @@
       temUrl="/oss/images/file/20220617/1655453121157.xlsx"
       apiKey="CoursemoduleimportData"
       checkKey="inquireCourseListchapter"
-      :newSujectApis="newSujectApis"
+      :param="{ businessJson: newSujectApis }"
       @success="success"
     ></batch-import-dialoga>
     <addChapter ref="addChapter" @backData="backData" />
@@ -521,8 +521,6 @@ export default {
       disCheckList: [], //已选转禁用复选列表
       activeLists: [],
       localData: [],
-      errorData: "",
-      dialogERROR: false,
       dialogDR: false,
       loading: false,
     };
@@ -557,20 +555,6 @@ 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("请添加科目");
@@ -578,39 +562,6 @@ export default {
       }
       this.dialogDR = true;
     },
-    /**
-     *
-     * @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();
@@ -1092,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;
 }

+ 1 - 50
src/views/resource/videoManagement/moduleManagement/edit/index.vue

@@ -374,7 +374,7 @@
       temUrl="/oss/images/file/20220617/1655453121157.xlsx"
       checkKey="inquireCourseListchapter"
       apiKey="CoursemoduleimportData"
-      :newSujectApis="newSujectApis"
+      :param="{ businessJson: newSujectApis }"
       @success="success"
     ></batch-import-dialoga>
     <addChapter ref="addChapter" @backData="backData" />
@@ -497,8 +497,6 @@ export default {
       activeLists: [],
       noStudent: true,
       pageId: this.$route.query.id,
-      errorData: "",
-      dialogERROR: false,
       dialogDR: false,
       loading: false,
     };
@@ -538,20 +536,6 @@ 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("请添加科目");
@@ -559,39 +543,6 @@ export default {
       }
       this.dialogDR = true;
     },
-    /**
-     *
-     * @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();

+ 2 - 2
src/views/resource/videoManagement/moduleManagement/index.vue

@@ -17,11 +17,11 @@
       ref="tableList"
       rowKey="moduleId"
     >
-      <!-- <template slot="customize">
+      <template slot="customize">
         <el-button size="medium" @click="batchDel" type="warning"
           >批量删除</el-button
         >
-      </template> -->
+      </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="gift(props.scope.row)"
           >赠送题卷</el-button