WANG пре 6 година
родитељ
комит
b6aa5ea5f4

+ 2 - 0
src/modules/examwork/view/offlineExamOrgSettings.vue

@@ -420,6 +420,8 @@ export default {
         row.properties.CAN_UPLOAD_ATTACHMENT;
       if (row.beginTime && row.endTime) {
         this.orgSettingDatetimeRange = [row.beginTime, row.endTime];
+      } else {
+        this.orgSettingDatetimeRange = [];
       }
       this.updateOrgSettingDialog = true;
     },

+ 25 - 1
src/modules/examwork/view/onlineExamOrgSettings.vue

@@ -46,6 +46,14 @@
               @click="showAddOrgSetting"
               >新增</el-button
             >
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-download"
+              @click="exportOrgSettings"
+            >
+              导出
+            </el-button>
             <el-button size="small" type="primary" @click="back"
               >返 回</el-button
             >
@@ -303,6 +311,7 @@
 <script>
 import { CORE_API, EXAM_WORK_API } from "@/constants/constants.js";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
+import { mapState } from "vuex";
 
 export default {
   components: { LinkTitlesCustom },
@@ -344,6 +353,9 @@ export default {
       }
     };
   },
+  computed: {
+    ...mapState({ user: state => state.user })
+  },
   methods: {
     getOrgList4Search(name) {
       this.loadingOrg4Search = true;
@@ -466,6 +478,8 @@ export default {
         row.properties.CAN_UPLOAD_ATTACHMENT;
       if (row.beginTime && row.endTime) {
         this.orgSettingDatetimeRange = [row.beginTime, row.endTime];
+      } else {
+        this.orgSettingDatetimeRange = [];
       }
       this.updateOrgSettingDialog = true;
     },
@@ -479,7 +493,17 @@ export default {
       this.orgSettingDatetimeRange = [];
       this.addOrgSettingDialog = true;
     },
-
+    exportOrgSettings() {
+      window.open(
+        EXAM_WORK_API +
+          "/exam/exportExamOrgSettings/ONLINE/" +
+          this.examId +
+          "?$key=" +
+          this.user.key +
+          "&$token=" +
+          this.user.token
+      );
+    },
     resetPageAndSearch() {
       this.currentPage = 1;
       this.search();