zhangjie 2 rokov pred
rodič
commit
11995a12eb

+ 16 - 0
src/modules/base/api.js

@@ -48,6 +48,9 @@ export const syncUserToEcs = () => {
 export const roleUserTree = () => {
   return $postParam("/api/admin/sys/user/org-tree", {});
 };
+export const exportUser = datas => {
+  return $post("/api/admin/sys/user/export", datas, { responseType: "blob" });
+};
 
 // role-manage
 export const roleListPage = datas => {
@@ -103,6 +106,9 @@ export const teachCollegeList = examId => {
     examId
   });
 };
+export const exportOrganization = () => {
+  return $post("/api/admin/sys/org/export", {}, { responseType: "blob" });
+};
 // setting --------------------------------->
 // common-rule
 export const examRuleDetail = schoolId => {
@@ -184,6 +190,11 @@ export const ableCourse = ({ idList, enable }) => {
 export const batchEnableCourse = datas => {
   return $postParam("/api/admin/basic/course/enable_by_query", datas);
 };
+export const exportCourse = datas => {
+  return $post("/api/admin/basic/course/export", datas, {
+    responseType: "blob"
+  });
+};
 // course-simple-manage
 export const courseSimpleListPage = datas => {
   return $postParam("/api/admin/teach/course/page", datas);
@@ -275,6 +286,11 @@ export const updateStudentSimple = datas => {
 export const batchAddStudentSimple = datas => {
   return $post("/api/admin/teach/student/create_batch", datas);
 };
+export const exportStudent = datas => {
+  return $post("/api/admin/basic/student/export", datas, {
+    responseType: "blob"
+  });
+};
 
 // clazz-manage
 export const clazzListQuery = datas => {

+ 19 - 2
src/modules/base/views/CourseManage.vue

@@ -186,11 +186,17 @@
 </template>
 
 <script>
-import { courseListPage, deleteCourse, batchDeleteCourse } from "../api";
+import {
+  courseListPage,
+  deleteCourse,
+  batchDeleteCourse,
+  exportCourse
+} from "../api";
 import pickerOptions from "@/constants/datePickerOptions";
 import ModifyCourse from "../components/ModifyCourse";
 import ImportFile from "../../../components/ImportFile.vue";
 import { ABLE_TYPE } from "@/constants/enumerate";
+import { downloadByApi } from "@/plugins/download";
 
 export default {
   name: "course-manage",
@@ -290,7 +296,18 @@ export default {
         .catch(() => {});
     },
     async toExportCourse() {
-      // TODO:
+      if (this.loading) return;
+
+      this.loading = true;
+      const res = await downloadByApi(() => {
+        return exportCourse(this.filter);
+      }, "").catch(e => {
+        this.$message.error(e || "下载失败,请重新尝试!");
+      });
+      this.loading = false;
+
+      if (!res) return;
+      this.$message.success("下载成功!");
     },
     // import
     toImport() {

+ 13 - 4
src/modules/base/views/OrganizationManage.vue

@@ -102,9 +102,14 @@
 </template>
 
 <script>
-import { organizationList, deleteOrganization } from "../api";
+import {
+  organizationList,
+  deleteOrganization,
+  exportOrganization
+} from "../api";
 import ModifyOrganization from "../components/ModifyOrganization";
 import ImportFile from "../../../components/ImportFile.vue";
+import { downloadByApi } from "@/plugins/download";
 
 export default {
   name: "organization-manage",
@@ -195,14 +200,18 @@ export default {
         .catch(() => {});
     },
     async toExportOrg() {
-      // TODO:
       if (this.loading) return;
+
       this.loading = true;
-      const res = await syncUserToEcs().catch(() => {});
+      const res = await downloadByApi(() => {
+        return exportOrganization();
+      }, "").catch(e => {
+        this.$message.error(e || "下载失败,请重新尝试!");
+      });
       this.loading = false;
 
       if (!res) return;
-      this.$message.success("导出任务已经提交!");
+      this.$message.success("下载成功!");
     },
     // import
     toImport() {

+ 19 - 2
src/modules/base/views/StudentManage.vue

@@ -172,9 +172,15 @@
 </template>
 
 <script>
-import { studentListQuery, deleteStudent, deleteFilterStudent } from "../api";
+import {
+  studentListQuery,
+  deleteStudent,
+  deleteFilterStudent,
+  exportStudent
+} from "../api";
 import ModifyStudent from "../components/ModifyStudent";
 import ImportFile from "../../../components/ImportFile.vue";
+import { downloadByApi } from "@/plugins/download";
 
 export default {
   name: "student-manage",
@@ -259,7 +265,18 @@ export default {
         .catch(() => {});
     },
     async toExportStudent() {
-      // TODO:
+      if (this.loading) return;
+
+      this.loading = true;
+      const res = await downloadByApi(() => {
+        return exportStudent(this.filter);
+      }, "").catch(e => {
+        this.$message.error(e || "下载失败,请重新尝试!");
+      });
+      this.loading = false;
+
+      if (!res) return;
+      this.$message.success("下载成功!");
     },
     // import
     toImport() {

+ 11 - 4
src/modules/base/views/UserManage.vue

@@ -224,8 +224,11 @@ import {
   deleteUser,
   resetPwd,
   userRoleListPage,
-  syncUserToEcs
+  syncUserToEcs,
+  exportUser
 } from "../api";
+import { downloadByApi } from "@/plugins/download";
+
 // import { logout } from "@/modules/login/api";
 
 export default {
@@ -355,14 +358,18 @@ export default {
       this.$message.success("同步任务已经提交!");
     },
     async toExportUser() {
-      // TODO:
       if (this.loading) return;
+
       this.loading = true;
-      const res = await syncUserToEcs().catch(() => {});
+      const res = await downloadByApi(() => {
+        return exportUser(this.filter);
+      }, "").catch(e => {
+        this.$message.error(e || "下载失败,请重新尝试!");
+      });
       this.loading = false;
 
       if (!res) return;
-      this.$message.success("导出任务已经提交!");
+      this.$message.success("下载成功!");
     },
     // async toLogout() {
     //   await logout();

+ 6 - 0
src/modules/exam/api.js

@@ -68,6 +68,9 @@ export const updatExamTaskTeacher = ({ id, userId }) => {
 export const ableExamTask = ({ id, enable }) => {
   return $post("/api/admin/exam/task/enable", { id, enable });
 };
+export const deleteExamTask = id => {
+  return $postParam("/api/admin/exam/task/delete", { id });
+};
 export const batchAddExamTask = datas => {
   return $post("/api/admin/exam/task/save_batch", datas);
 };
@@ -119,6 +122,9 @@ export const updateTaskApply = datas => {
 export const cancelOrRestartTaskApply = ({ id, status }) => {
   return $post("/api/admin/exam/task/apply_status", { id, status });
 };
+export const deleteTaskApply = id => {
+  return $postParam("/api/admin/exam/task/apply_delete", { id });
+};
 // exam-flow
 export const taskAllFlowSetups = flowId => {
   return $postParam("/api/admin/flow/task/all", { flowId });

+ 1 - 1
src/modules/exam/components/PaperApproveTable.vue

@@ -328,7 +328,7 @@ export default {
       }, `${this.instance.courseName}-试卷审批表.pdf`).catch(e => {
         this.$message.error(e || "下载失败,请重新尝试!");
       });
-      this.downloading = false;
+      this.loading = false;
 
       if (!res) return;
       this.$message.success("下载成功!");

+ 18 - 1
src/modules/exam/views/ExamTaskManage.vue

@@ -217,6 +217,13 @@
               @click="toEnable(scope.row)"
               >{{ scope.row.enable ? "禁用" : "启用" }}</el-button
             >
+            <el-button
+              v-if="checkPrivilege('link', 'delete')"
+              class="btn-danger"
+              type="text"
+              @click="toDelete(scope.row)"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -259,7 +266,7 @@ import ModifyExamTask from "../components/ModifyExamTask";
 import BatchAddExamTask from "../components/BatchAddExamTask";
 import { ABLE_TYPE, EXAM_TASK_STATUS } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
-import { examTaskListPage, ableExamTask } from "../api";
+import { examTaskListPage, ableExamTask, deleteExamTask } from "../api";
 import { mapActions } from "vuex";
 
 export default {
@@ -387,6 +394,16 @@ export default {
     },
     toDataTask() {
       this.$refs.DataTaskDialog.open();
+    },
+    async toDelete(row) {
+      const result = await this.$confirm(`确定要删除命题任务吗?`, "提示", {
+        type: "warning"
+      }).catch(() => {});
+      if (result !== "confirm") return;
+
+      await deleteExamTask(row.id);
+      this.$message.success("操作成功!");
+      this.deletePageLastItem();
     }
   }
 };

+ 22 - 1
src/modules/exam/views/TaskApplyManage.vue

@@ -189,6 +189,13 @@
               @click="toDownloadForm(scope.row)"
               >下载审批表</el-button
             >
+            <el-button
+              v-if="checkPrivilege('link', 'delete')"
+              class="btn-danger"
+              type="text"
+              @click="toDelete(scope.row)"
+              >删除申请</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -241,7 +248,11 @@ import CreateTaskApply from "../components/CreateTaskApply";
 import PaperApproveTable from "../components/PaperApproveTable";
 import { AUDITING_STATUS } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
-import { taskApplyListPage, cancelOrRestartTaskApply } from "../api";
+import {
+  taskApplyListPage,
+  cancelOrRestartTaskApply,
+  deleteTaskApply
+} from "../api";
 import { mapActions } from "vuex";
 
 export default {
@@ -363,6 +374,16 @@ export default {
     toDownloadForm(row) {
       this.curExamTask = row;
       this.$refs.PaperApproveTable.open();
+    },
+    async toDelete(row) {
+      const result = await this.$confirm(`确定要删除入库申请吗?`, "提示", {
+        type: "warning"
+      }).catch(() => {});
+      if (result !== "confirm") return;
+
+      await deleteTaskApply(row.id);
+      this.$message.success("操作成功!");
+      this.deletePageLastItem();
     }
   },
   beforeRouteLeave(to, from, next) {

+ 3 - 0
src/modules/print/api.js

@@ -37,6 +37,9 @@ export const businessTotalData = datas => {
 export const businessDataExport = datas => {
   return $postParam("/api/admin/exam/print/data_export", datas);
 };
+export const deleteBusinessData = id => {
+  return $postParam("/api/admin/exam/print/data_delete", { id });
+};
 export const businessTemplateDownload = () => {
   return $postParam(
     "/api/admin/exam/print/template_download",

+ 19 - 1
src/modules/print/views/BusinessDataExport.vue

@@ -195,6 +195,13 @@
               @click="toPreview(scope.row)"
               >查看详情</el-button
             >
+            <el-button
+              v-if="checkPrivilege('link', 'delete')"
+              class="btn-danger"
+              type="text"
+              @click="toDelete(scope.row)"
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -292,7 +299,8 @@ import {
   businessTotalData,
   businessTemplateDownload,
   businessDataExport,
-  printPlanQuery
+  printPlanQuery,
+  deleteBusinessData
 } from "../api";
 import PreviewBusinessDetail from "../components/PreviewBusinessDetail";
 import ImportFile from "../../../components/ImportFile.vue";
@@ -439,6 +447,16 @@ export default {
       this.curRow = { ...row };
       this.$refs.PreviewBusinessDetail.open();
     },
+    async toDelete(row) {
+      const result = await this.$confirm(`确定要删除吗?`, "提示", {
+        type: "warning"
+      }).catch(() => {});
+      if (result !== "confirm") return;
+
+      await deleteBusinessData(row.id);
+      this.$message.success("操作成功!");
+      this.deletePageLastItem();
+    },
     // import
     async getPlans() {
       const res = await printPlanQuery();