Browse Source

命题任务编辑题卡查看方式调整

zhangjie 1 year ago
parent
commit
2eb96a1b19

+ 1 - 2
src/modules/card/router.js

@@ -6,8 +6,7 @@ export default [
       import(/* webpackChunkName: "card" */ "./views/CardEdit.vue"),
   },
   {
-    // viewType::: view:预览,print:打印,frame:iframe嵌套
-    path: "/card/preview/:cardId/:viewType",
+    path: "/card/preview/:cardId",
     name: "CardPreview",
     component: () =>
       import(/* webpackChunkName: "card" */ "./views/CardPreview.vue"),

+ 0 - 14
src/modules/customer/api.js

@@ -1,14 +0,0 @@
-import { $postParam, $post } from "@/plugins/axios";
-
-// 试卷编号模糊查询
-export const customerCardTaskList = (datas) => {
-  return $postParam("/api/admin/exam/card/cust_list", datas);
-};
-export const applyCustomerCard = (datas) => {
-  return $post("/api/admin/exam/card/cust_save", datas);
-};
-export const customerPaperExport = (datas) => {
-  return $post("/api/admin/exam/card/download_files", datas, {
-    responseType: "blob",
-  });
-};

+ 0 - 9
src/modules/customer/router.js

@@ -1,9 +0,0 @@
-import CustomerCard from "./views/CustomerCard";
-
-export default [
-  {
-    path: "customer/card",
-    name: "CustomerCard",
-    component: CustomerCard,
-  },
-];

+ 0 - 346
src/modules/customer/views/CustomerCard.vue

@@ -1,346 +0,0 @@
-<template>
-  <div class="customer-card">
-    <div class="mb-4 tab-btns">
-      <el-button
-        v-for="(val, key) in AUDITING_TYPE"
-        :key="key"
-        size="medium"
-        :type="filter.status == key ? 'primary' : 'default'"
-        @click="selectMenu(key)"
-        >{{ val }}</el-button
-      >
-    </div>
-    <div class="part-box part-box-filter part-box-flex">
-      <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
-        <template
-          v-if="
-            (AUDITED && checkPrivilege('condition', 'reviewCondition')) ||
-            (!AUDITED && checkPrivilege('condition', 'notReviewCondition'))
-          "
-        >
-          <el-form-item label="学校:">
-            <school-select
-              v-model="filter.schoolId"
-              placeholder="学校"
-            ></school-select>
-          </el-form-item>
-          <!-- <el-form-item label="试卷编号:">
-          <paper-number-select
-            ref="PaperNumberSelect"
-            v-model="filter.paperNumber"
-            placeholder="请选择"
-            clearable
-          ></paper-number-select>
-        </el-form-item>
-        <el-form-item label="申请人:">
-          <question-teacher-select
-            ref="QuestionTeacherSelect"
-            v-model="filter.userId"
-            :school-id="filter.schoolId"
-            placeholder="请选择"
-          ></question-teacher-select>
-        </el-form-item> -->
-          <el-form-item label="申请时间:">
-            <el-date-picker
-              v-model="createTime"
-              type="datetimerange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="申请开始时间"
-              end-placeholder="申请结束时间"
-              value-format="timestamp"
-              align="right"
-              unlink-panels
-            >
-            </el-date-picker>
-          </el-form-item>
-          <el-form-item label="完成时间:" v-if="AUDITED">
-            <el-date-picker
-              v-model="finishTime"
-              type="datetimerange"
-              :picker-options="pickerOptions"
-              range-separator="至"
-              start-placeholder="完成开始时间"
-              end-placeholder="完成结束时间"
-              value-format="timestamp"
-              align="right"
-              unlink-panels
-            >
-            </el-date-picker>
-          </el-form-item>
-        </template>
-
-        <el-form-item label-width="0px">
-          <el-button
-            v-if="
-              (AUDITED && checkPrivilege('button', 'reviewSelect')) ||
-              (!AUDITED && checkPrivilege('button', 'notReviewSelect'))
-            "
-            type="primary"
-            @click="toPage(1)"
-            >查询</el-button
-          >
-        </el-form-item>
-      </el-form>
-      <div class="part-box-action" v-if="!AUDITED">
-        <el-button
-          v-if="checkPrivilege('button', 'notReviewBatchDownload')"
-          icon="el-icon-download"
-          type="primary"
-          :disabled="loading"
-          @click="toExport"
-        >
-          批量下载试卷文件
-        </el-button>
-      </div>
-    </div>
-
-    <div class="part-box part-box-pad">
-      <el-table
-        ref="TableList"
-        :data="taskList"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column
-          type="selection"
-          width="55"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          type="index"
-          label="序号"
-          width="70"
-          :index="indexMethod"
-        ></el-table-column>
-        <el-table-column prop="paperNumber" label="试卷编号"></el-table-column>
-        <el-table-column prop="schoolName" label="学校名称"></el-table-column>
-        <el-table-column prop="orgName" label="所属部门"> </el-table-column>
-        <el-table-column
-          prop="createName"
-          label="申请人"
-          width="100"
-        ></el-table-column>
-        <el-table-column prop="createTime" label="申请时间">
-          <span slot-scope="scope">{{
-            scope.row.createTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column prop="updateTime" label="完成时间" v-if="AUDITED">
-          <span slot-scope="scope">{{
-            scope.row.updateTime | timestampFilter
-          }}</span>
-        </el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="140">
-          <template slot-scope="scope">
-            <el-button
-              v-if="AUDITED && checkPrivilege('link', 'reviewPreview')"
-              class="btn-primary"
-              type="text"
-              @click="toPreview(scope.row)"
-              >查看详情</el-button
-            >
-            <el-button
-              v-if="!AUDITED && checkPrivilege('link', 'notReviewDesign')"
-              class="btn-primary"
-              type="text"
-              @click="toEdit(scope.row)"
-              >设计题卡</el-button
-            >
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="part-page">
-        <el-pagination
-          v-if="taskList.length"
-          background
-          layout="total, sizes, prev, pager, next, jumper"
-          :pager-count="5"
-          :current-page="current"
-          :total="total"
-          :page-size="size"
-          @current-change="toPage"
-          @size-change="pageSizeChange"
-        >
-        </el-pagination>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import pickerOptions from "@/constants/datePickerOptions";
-import { customerCardTaskList, customerPaperExport } from "../api";
-import { randomCode } from "@/plugins/utils";
-import { downloadByApi } from "@/plugins/download";
-
-export default {
-  name: "customer-card",
-  data() {
-    return {
-      filter: {
-        schoolId: "",
-        status: "STAGE",
-        paperNumber: "",
-        userId: "",
-        applyStartTime: null,
-        applyEndTime: null,
-        finishStartTime: null,
-        finishEndTime: null,
-      },
-      current: 1,
-      size: this.GLOBAL.pageSize,
-      total: 0,
-      multipleSelection: [],
-      AUDITING_TYPE: {
-        STAGE: "待审核",
-        SUBMIT: "已审核",
-      },
-      caches: {},
-      taskList: [],
-      loading: false,
-      // date-picker
-      createTime: [],
-      finishTime: [],
-      pickerOptions,
-    };
-  },
-  computed: {
-    AUDITED() {
-      return this.filter.status === "SUBMIT";
-    },
-  },
-  mounted() {
-    this.initData();
-  },
-  methods: {
-    initData() {
-      const cachePageInfo = this.$ls.get("cachePageInfo");
-      if (cachePageInfo) {
-        this.filter = this.$objAssign(this.filter, cachePageInfo.filter);
-        if (this.filter.applyStartTime && this.filter.applyEndTime)
-          this.createTime = [
-            this.filter.applyStartTime,
-            this.filter.applyEndTime,
-          ];
-        if (this.filter.finishStartTime && this.filter.finishEndTime)
-          this.finishTime = [
-            this.filter.finishStartTime,
-            this.filter.finishEndTime,
-          ];
-        this.toPage(cachePageInfo.page);
-      } else {
-        this.toPage(1);
-      }
-      this.$ls.remove("cachePageInfo");
-    },
-    async getList() {
-      const valid =
-        (this.AUDITED && this.checkPrivilege("list", "reviewList")) ||
-        (!this.AUDITED && this.checkPrivilege("list", "notReviewList"));
-      if (!valid) return;
-
-      const datas = {
-        ...this.filter,
-        pageNumber: this.current,
-        pageSize: this.size,
-      };
-      if (this.createTime) {
-        datas.applyStartTime = this.createTime[0];
-        datas.applyEndTime = this.createTime[1];
-      }
-      if (this.finishTime) {
-        datas.finishStartTime = this.finishTime[0];
-        datas.finishEndTime = this.finishTime[1];
-      }
-      const data = await customerCardTaskList(datas);
-      this.taskList = data.records;
-      this.total = data.total;
-    },
-    toPage(page) {
-      this.current = page;
-      this.getList();
-    },
-    handleSelectionChange(val) {
-      this.multipleSelection = val.map((item) => item.cardId);
-    },
-    selectMenu(val) {
-      if (this.filter.status === val) return;
-      this.multipleSelection = [];
-      this.caches[this.filter.status] = {
-        current: this.current,
-        taskList: this.taskList,
-        total: this.total,
-      };
-      this.filter.status = val;
-      if (this.caches[val] && this.caches[val].taskList) {
-        this.current = this.caches[val].current;
-        this.total = this.caches[val].total;
-        this.taskList = this.caches[val].taskList;
-      } else {
-        this.toPage(1);
-      }
-    },
-    async toExport() {
-      if (this.loading) return;
-
-      if (!this.multipleSelection.length) {
-        this.$message.error("请选择要下载的记录!");
-        return;
-      }
-
-      this.loading = true;
-      const res = await downloadByApi(() => {
-        return customerPaperExport({ ids: this.multipleSelection });
-      }, `${randomCode()}.zip`).catch((e) => {
-        this.$message.error(e || "下载失败,请重新尝试!");
-      });
-      this.downloading = false;
-
-      if (!res) return;
-      this.$message.success("下载成功!");
-    },
-    toEdit(row) {
-      this.$ls.set("prepareTcPCard", {
-        examTaskId: row.examTaskId,
-        courseCode: row.courseCode,
-        courseName: row.courseName,
-        schoolName: row.schoolName,
-        makeMethod: "CUST",
-        type: "CUSTOM",
-        createMethod: "STANDARD",
-        cardRuleId: row.cardRuleId,
-        schoolId: row.schoolId,
-      });
-      // 打开题卡编辑页,创建题卡,并预设需要绑定的任务
-      this.$router.push({
-        name: "CardEdit",
-        params: {
-          cardId: row.cardId,
-        },
-      });
-    },
-    toPreview(row) {
-      window.open(
-        this.getRouterPath({
-          name: "CardPreview",
-          params: {
-            cardId: row.cardId,
-            viewType: "view",
-          },
-        })
-      );
-    },
-  },
-  beforeRouteLeave(to, from, next) {
-    if (to.name === "CardEdit") {
-      this.$ls.set("cachePageInfo", {
-        page: this.current,
-        filter: this.filter,
-      });
-    } else {
-      this.$ls.remove("cachePageInfo");
-    }
-    next();
-  },
-};
-</script>

+ 8 - 9
src/modules/exam/components/ApplyContent.vue

@@ -530,11 +530,6 @@
     ></select-user-dialog>
     <!-- ModifyCard -->
     <modify-card ref="ModifyCard" @modified="cardModified"></modify-card>
-    <!-- card-preview-dialog -->
-    <card-preview-dialog
-      ref="CardPreviewDialog"
-      :card-id="curAttachment.cardId"
-    ></card-preview-dialog>
   </div>
 </template>
 
@@ -551,7 +546,6 @@ import { attachmentPreview } from "../../login/api";
 import SimpleImagePreview from "@/components/SimpleImagePreview";
 import SelectUserDialog from "../../base/components/SelectUserDialog";
 import ModifyCard from "../../card/components/ModifyCard";
-import CardPreviewDialog from "../../card/components/CardPreviewDialog.vue";
 import { TASK_AUDIT_RESULT, COMMON_CARD_RULE_ID } from "@/constants/enumerate";
 import {
   taskFlowDetail,
@@ -601,7 +595,6 @@ export default {
     SimpleImagePreview,
     SelectUserDialog,
     ModifyCard,
-    CardPreviewDialog,
   },
   props: {
     examTask: {
@@ -963,8 +956,14 @@ export default {
     },
     toViewCard(attachment) {
       this.addPreviewLog(attachment, "card");
-      this.curAttachment = { ...attachment };
-      this.$refs.CardPreviewDialog.open();
+      window.open(
+        this.getRouterPath({
+          name: "CardPreview",
+          params: {
+            cardId: attachment.cardId,
+          },
+        })
+      );
     },
     async toCopyCard(attachment) {
       this.curAttachment = { ...attachment };

+ 0 - 339
src/modules/exam/components/CardOptionDialog.vue

@@ -1,339 +0,0 @@
-<template>
-  <div class="card-option-dialog">
-    <el-dialog
-      class="card-option-dialog"
-      :visible.sync="modalIsShow"
-      title="选择制卡方式"
-      top="10vh"
-      width="600px"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      append-to-body
-      @open="visibleChange"
-    >
-      <div class="card-option-body">
-        <p>请您选择创建题卡方式:</p>
-        <p>1.自助创建:使用题卡工具自助设计题卡,操作简单,即刻生成;</p>
-        <p>2.申请客服制卡:由客服后台统一处理,处理完毕后您可查看或微调。</p>
-        <div class="card-type">
-          <el-radio-group v-model="modalForm.makeMethod">
-            <el-radio
-              v-for="item in cardSourceTypes"
-              :key="item.type"
-              :label="item.type"
-              :disabled="item.disabled"
-              >{{ item.name }}</el-radio
-            >
-          </el-radio-group>
-        </div>
-        <!-- card-select -->
-        <div class="card-select" v-if="modalForm.makeMethod === 'SELECT'">
-          <el-form
-            ref="ModalForm"
-            :model="modalForm"
-            :rules="rules"
-            label-width="90px"
-          >
-            <el-form-item prop="cardId" label="已选题卡:">
-              <el-select
-                v-model="modalForm.cardId"
-                style="width: 300px"
-                placeholder="请选择"
-                clearable
-                filterable
-              >
-                <el-option
-                  v-for="item in cards"
-                  :key="item.id"
-                  :value="item.id"
-                  :label="item.title"
-                >
-                </el-option>
-              </el-select>
-              <span class="card-view" @click="toPreview">预览</span>
-            </el-form-item>
-          </el-form>
-        </div>
-        <!-- apply-customer -->
-        <div class="card-apply" v-if="modalForm.makeMethod === 'CUST'">
-          <el-form
-            ref="ApplyModalForm"
-            :model="applyModalForm"
-            :rules="applyRules"
-            label-width="90px"
-          >
-            <el-form-item prop="title" label="题卡标题:">
-              <el-input
-                style="width: 300px"
-                v-model.trim="applyModalForm.title"
-                placeholder="请输入题卡标题"
-              ></el-input>
-            </el-form-item>
-            <el-form-item prop="custAttachmentId" label="上传文件:">
-              <upload-file-view
-                input-width="300px"
-                :upload-url="uploadUrl"
-                :upload-data="uploadData"
-                :format="format"
-                @valid-error="validError"
-                @upload-success="uploadSuccess"
-                ref="UploadFileView"
-              ></upload-file-view>
-              <p class="tips-info">
-                上传的文件只支持{{ format.join(",") }},大小不超过20M
-              </p>
-            </el-form-item>
-          </el-form>
-        </div>
-      </div>
-      <div slot="footer">
-        <el-button type="primary" :disabled="isSubmit" @click="confirm"
-          >确定</el-button
-        >
-        <el-button @click="cancel">返回</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { cardForSelectList } from "../api";
-import { applyCustomerCard } from "../../customer/api";
-import { CARD_SOURCE_TYPE, COMMON_CARD_RULE_ID } from "@/constants/enumerate";
-import UploadFileView from "@/components/UploadFileView";
-
-const initModalForm = {
-  examId: "",
-  examTaskId: "",
-  paperType: "",
-  courseCode: "",
-  courseName: "",
-  cardRuleId: "",
-  cardId: "",
-  makeMethod: "",
-  // 考务规则
-  customCard: false,
-};
-
-export default {
-  name: "card-option-dialog-view",
-  props: {
-    data: {
-      type: Object,
-      default() {
-        return {};
-      },
-    },
-  },
-  components: { UploadFileView },
-  data() {
-    return {
-      modalIsShow: false,
-      isSubmit: false,
-      modalForm: { ...initModalForm },
-      rules: {
-        cardId: [
-          {
-            required: true,
-            message: "请选择已选题卡",
-            trigger: "change",
-          },
-        ],
-      },
-      onlySelect: false,
-      cards: [],
-      cardSourceTypes: [],
-      CARD_SOURCE_TYPE,
-      // apply-customer
-      applyModalForm: {
-        title: "",
-        custAttachmentId: "",
-      },
-      applyRules: {
-        title: [
-          {
-            required: true,
-            message: "请输入文件标题",
-            trigger: "change",
-          },
-          {
-            message: "文件标题不能超过100个字",
-            max: 100,
-            trigger: "change",
-          },
-        ],
-        custAttachmentId: [
-          {
-            required: true,
-            message: "请上传样卷或试卷结构文件",
-            trigger: "change",
-          },
-        ],
-      },
-      // upload
-      format: ["pdf"],
-      maxSize: 20 * 1024 * 1024,
-      uploadUrl: "/api/admin/common/file/upload",
-      uploadData: {
-        type: "PAPER",
-      },
-    };
-  },
-  methods: {
-    visibleChange() {
-      this.getCardSourceTypes();
-      this.modalForm = this.$objAssign(initModalForm, this.data);
-      this.modalForm.makeMethod =
-        this.data.makeMethod || this.cardSourceTypes[0].type;
-
-      this.getCardList();
-    },
-    getCardSourceTypes() {
-      let cardSourceTypes = [];
-      Object.keys(CARD_SOURCE_TYPE).forEach((key) => {
-        // 自助创建 =>
-        // 若题卡规则为专卡,命题人可即时创建专卡;
-        // 若题卡规则为全部通卡,则不显示该制卡方式;
-        // 申请客服制卡 =>
-        // 若题卡规则为专卡,命题人可即时创建专卡;
-        // 若题卡规则为全部通卡,则不显示该制卡方式;
-        if (this.data.cardRuleId === COMMON_CARD_RULE_ID && key !== "SELECT")
-          return;
-
-        // 考务规则中未开启客服制卡时,不显示客服制卡选项
-        if (!this.data.customCard && key === "CUST") return;
-
-        cardSourceTypes.push({
-          type: key,
-          name: CARD_SOURCE_TYPE[key],
-        });
-      });
-      this.cardSourceTypes = cardSourceTypes;
-    },
-    async getCardList() {
-      // 选择已有题卡 =>
-      // 若题卡规则为专卡,选择已有题卡时,下拉列表将显示适用的专卡和通卡;
-      // 若题卡规则为“全部通卡”,则下拉列表中只显示适用的通卡模板;
-      const data = await cardForSelectList({
-        courseCode: this.modalForm.courseCode,
-        paperType: this.modalForm.paperType,
-        cardRuleId: this.modalForm.cardRuleId,
-        examId: this.modalForm.examId,
-      });
-      this.cards = data || [];
-    },
-    cancel() {
-      this.modalIsShow = false;
-    },
-    open() {
-      this.modalIsShow = true;
-    },
-    validError(errorData) {
-      this.$message.error(errorData.message);
-    },
-    uploadSuccess(data) {
-      this.$message.success("上传成功!");
-      this.applyModalForm.custAttachmentId = data.id;
-      this.$refs.ApplyModalForm.validateField("custAttachmentId");
-    },
-    async confirm() {
-      // 客服制卡
-      if (this.modalForm.makeMethod === "CUST") {
-        const valid = await this.$refs.ApplyModalForm.validate().catch(
-          () => {}
-        );
-        if (!valid) return;
-
-        if (this.isSubmit) return;
-        this.isSubmit = true;
-        // 创建题卡
-        const result = await applyCustomerCard({
-          status: "STAGE",
-          examTaskId: this.modalForm.examTaskId,
-          courseCode: this.modalForm.courseCode,
-          courseName: this.modalForm.courseName,
-          makeMethod: "CUST",
-          type: "CUSTOM",
-          ...this.applyModalForm,
-        }).catch(() => {});
-        this.isSubmit = false;
-        if (!result) return;
-        this.$message.success("申请成功!");
-        this.$emit("confirm", {
-          cardId: result,
-          makeMethod: this.modalForm.makeMethod,
-        });
-        this.cancel();
-        return;
-      }
-
-      // 自主创建
-      if (this.modalForm.makeMethod === "SELF") {
-        this.$emit("confirm", {
-          examTaskId: this.modalForm.examTaskId,
-          courseCode: this.modalForm.courseCode,
-          courseName: this.modalForm.courseName,
-          schoolName: this.$ls.get("schoolName"),
-          makeMethod: this.modalForm.makeMethod,
-          cardRuleId: this.modalForm.cardRuleId,
-          paperType: this.modalForm.paperType,
-          type: "CUSTOM",
-          createMethod: "STANDARD",
-        });
-        this.cancel();
-        return;
-      }
-
-      // 选择已有题卡
-      if (this.modalForm.makeMethod === "SELECT") {
-        if (!this.modalForm.cardId) {
-          this.$message.error("请选择已有的题卡!");
-          return;
-        }
-
-        this.$emit("confirm", {
-          cardId: this.modalForm.cardId,
-          makeMethod: this.modalForm.makeMethod,
-        });
-        this.cancel();
-      }
-    },
-    toPreview() {
-      if (!this.modalForm.cardId) {
-        this.$message.error("请先选择题卡!");
-        return;
-      }
-      window.open(
-        this.getRouterPath({
-          name: "CardPreview",
-          params: {
-            cardId: this.modalForm.cardId,
-            viewType: "view",
-          },
-        })
-      );
-    },
-  },
-};
-</script>
-
-<style scoped>
-.card-option-body {
-  color: #878787;
-}
-.card-type {
-  margin: 32px 0;
-}
-.card-select {
-  margin-bottom: 10px;
-}
-.card-view {
-  display: inline-block;
-  margin-left: 10px;
-  color: rgba(35, 196, 185, 1);
-  cursor: pointer;
-}
-.card-view:hover {
-  color: rgba(28, 208, 161, 1);
-}
-</style>

+ 0 - 744
src/modules/exam/components/CreateTaskApply.vue

@@ -1,744 +0,0 @@
-<template>
-  <el-dialog
-    class="create-task-apply"
-    :visible.sync="modalIsShow"
-    title="新增命题申请"
-    top="10px"
-    width="1000px"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    destroy-on-close
-    @open="visibleChange"
-  >
-    <div class="part-box part-box-pad part-box-border">
-      <el-form
-        ref="examTaskComp"
-        :model="examTask"
-        :rules="rules"
-        label-width="120px"
-      >
-        <el-row>
-          <el-col :span="12">
-            <el-form-item prop="semesterId" label="学期:">
-              <semester-select
-                v-model="examTask.semesterId"
-                class="width-full"
-              ></semester-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item prop="examId" label="考试:">
-              <exam-select
-                v-model="examTask.examId"
-                :semester-id="examTask.semesterId"
-                class="width-full"
-              ></exam-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item prop="teachingRoomId" label="机构:">
-              <org-select
-                v-model="examTask.teachingRoomId"
-                class="width-full"
-                placeholder="机构"
-                @change="teachingRoomChange"
-              ></org-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item prop="courseCode" label="课程(代码):">
-              <course-select
-                v-model="examTask.courseCode"
-                class="width-full"
-                :teaching-room-id="examTask.teachingRoomId"
-                @change="courseChange"
-              ></course-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="试卷编号:">
-              <el-input
-                v-model.trim="examTask.paperNumber"
-                placeholder="请输入试卷编号"
-                :maxlength="50"
-                clearable
-              ></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="拟卷教师:">
-              <el-input
-                v-model.trim="examTask.teacherName"
-                placeholder="请输入拟卷教师"
-                :maxlength="50"
-                clearable
-              ></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="主讲教师:">
-              <el-input
-                v-model.trim="examTask.lecturerName"
-                placeholder="请输入主讲教师"
-                :maxlength="50"
-                clearable
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-    </div>
-
-    <div class="apply-content task-detail" v-if="modalIsShow">
-      <div class="task-body">
-        <div class="mb-2 text-right">
-          <el-button
-            type="info"
-            icon="el-icon-circle-plus-outline"
-            @click="addAtachment"
-            >增加卷型</el-button
-          >
-        </div>
-        <table class="table mb-2">
-          <tr>
-            <th>试卷类型</th>
-            <th>试卷文件</th>
-            <th>答题卡创建方式</th>
-            <th>答题卡</th>
-            <th>操作</th>
-          </tr>
-          <tr v-for="(attachment, index) in paperAttachments" :key="index">
-            <td>{{ attachment.name }}卷</td>
-            <td>
-              <el-button
-                type="text"
-                class="btn-primary"
-                @click="toUpload(attachment)"
-              >
-                <i
-                  :class="[
-                    'icon',
-                    attachment.attachmentId ? 'icon-files-act' : 'icon-files',
-                  ]"
-                ></i
-                >{{
-                  attachment.attachmentId
-                    ? attachment.filename
-                    : "点击上传试卷文件"
-                }}
-              </el-button>
-            </td>
-            <td :rowspan="paperAttachments.length" v-if="index === 0">
-              {{ createCardTypeName }}
-            </td>
-            <td :rowspan="paperAttachments.length" v-if="index === 0">
-              <el-button
-                type="text"
-                class="btn-primary"
-                @click="toCreateOrViewCard"
-                >{{ cardTodoName }}</el-button
-              >
-              <el-button
-                v-if="examTaskDetail.makeMethod"
-                size="mini"
-                type="primary"
-                @click="changeCreateCardType"
-                >切换题卡创建方式</el-button
-              >
-            </td>
-            <td>
-              <el-button
-                class="btn-danger"
-                type="text"
-                @click="deleteAttachment(index)"
-                >删除</el-button
-              >
-            </td>
-          </tr>
-          <tr v-if="!paperAttachments.length">
-            <td colspan="5">
-              <p class="tips-info text-center">暂无数据</p>
-            </td>
-          </tr>
-        </table>
-
-        <p class="tips-info tips-dark mb-2">
-          提示:多卷型试卷由于会绑定一个答题卡模板,因此试卷结构必须相同。多卷型试卷之间客观题要求试题内容相同,可允许大题内的小题题序不同。
-        </p>
-
-        <el-form>
-          <el-form-item label="单次抽卷卷型数量:" label-width="150">
-            <el-input-number
-              v-model="examTaskDetail.drawCount"
-              :min="1"
-              :max="maxFetchCount"
-              :step="1"
-              step-strictly
-              :controls="false"
-            ></el-input-number>
-          </el-form-item>
-        </el-form>
-
-        <h4 class="mb-2">附件:<span>(最多4张)</span></h4>
-        <div class="image-list">
-          <div
-            class="image-item"
-            v-for="(img, index) in paperConfirmAttachments"
-            :key="index"
-          >
-            <img
-              :src="img.url"
-              :alt="img.filename"
-              title="点击查看大图"
-              @click="toPreview(index)"
-            />
-            <div class="image-delete">
-              <i
-                class="el-icon-delete-solid"
-                @click="deletePaperConfirmAttachment(index)"
-              ></i>
-            </div>
-          </div>
-          <div
-            v-if="paperConfirmAttachments.length < 4"
-            class="image-item image-add"
-            title="上传附件"
-            @click="toUploadPaperConfirm"
-          >
-            <i class="el-icon-plus"></i>
-          </div>
-        </div>
-
-        <h4 class="mb-2">附件说明:</h4>
-        <el-input
-          class="mb-2"
-          v-model="examTaskDetail.remark"
-          type="textarea"
-          resize="none"
-          :rows="2"
-          :maxlength="100"
-          clearable
-          show-word-limit
-          placeholder="建议不超过100个字"
-        ></el-input>
-
-        <div class="part-box part-box-pad part-box-border">
-          <el-timeline>
-            <el-timeline-item
-              v-for="flow in flowList"
-              :key="flow.taskKey"
-              :type="flow.type"
-            >
-              <div class="flow-item">
-                <div class="flow-item-content">
-                  <h4 class="flow-item-title">{{ flow.taskName }}</h4>
-                  <p class="flow-item-desc">{{ flow.approveUserNames }}</p>
-                </div>
-              </div>
-            </el-timeline-item>
-          </el-timeline>
-        </div>
-      </div>
-
-      <div class="task-action">
-        <el-button type="primary" :disabled="isSubmit" @click="submit"
-          >确认提交</el-button
-        >
-        <el-button type="primary" :disabled="isSubmit" @click="toSave(0)"
-          >暂存</el-button
-        >
-        <el-button @click="cancel">取消</el-button>
-      </div>
-    </div>
-
-    <div slot="footer"></div>
-
-    <!-- upload-paper-dialog -->
-    <upload-paper-dialog
-      :paper-attachment="curAttachment"
-      :upload-type="curUploadType"
-      @confirm="uploadConfirm"
-      ref="UploadPaperDialog"
-    ></upload-paper-dialog>
-    <!-- card-option-dialog -->
-    <card-option-dialog
-      ref="CardOptionDialog"
-      :data="task"
-      @upload-sample-over="initData"
-      @confirm="cardConfirm"
-    ></card-option-dialog>
-    <!-- image-preview -->
-    <simple-image-preview
-      :cur-image="curImage"
-      @on-prev="toPrevImage"
-      @on-next="toNextImage"
-      ref="SimpleImagePreview"
-    ></simple-image-preview>
-  </el-dialog>
-</template>
-
-<script>
-import { examRuleDetail, flowDetailByType } from "../../base/api";
-import {
-  teacherCreateTaskApply,
-  teacherCancelTaskApply,
-  switchCardCreateMethod,
-} from "../api";
-import UploadPaperDialog from "./UploadPaperDialog";
-import CardOptionDialog from "./CardOptionDialog";
-import SimpleImagePreview from "@/components/SimpleImagePreview";
-import { CARD_SOURCE_TYPE } from "@/constants/enumerate";
-
-const initExamTask = {
-  id: null,
-  semesterId: "",
-  examId: "",
-  courseCode: "",
-  courseName: "",
-  paperNumber: "",
-  cardRuleId: "", // TODO:
-  teachingRoomId: "",
-  teacherName: "",
-  lecturerName: "",
-};
-
-const initExamTaskDetail = {
-  operateType: "STAGE",
-  paperType: "A",
-  cardId: "",
-  paperAttachmentIds: [],
-  paperConfirmAttachmentIds: [],
-  drawCount: 2,
-  remark: "",
-  makeMethod: "",
-  // 题卡状态
-  status: "",
-  // 考务规则
-  review: false,
-  includePaper: false,
-  customCard: false,
-};
-
-export default {
-  name: "create-task-apply",
-  components: { UploadPaperDialog, CardOptionDialog, SimpleImagePreview },
-  data() {
-    return {
-      modalIsShow: false,
-      isSubmit: false,
-      flowList: [],
-      flowInfo: {},
-      examTask: {},
-      needReview: false,
-      task: {},
-      examRule: {},
-      rules: {
-        semesterId: [
-          {
-            required: true,
-            message: "请选择学期",
-            trigger: "change",
-          },
-        ],
-        examId: [
-          {
-            required: true,
-            message: "请选择考试",
-            trigger: "change",
-          },
-        ],
-        teachingRoomId: [
-          {
-            required: true,
-            message: "请选择机构",
-            trigger: "change",
-          },
-        ],
-        courseCode: [
-          {
-            required: true,
-            message: "请选择课程",
-            trigger: "change",
-          },
-        ],
-        cardRuleId: [
-          {
-            required: true,
-            message: "请选择题卡规则",
-            trigger: "change",
-          },
-        ],
-      },
-      // exam-task-detail
-      examTaskDetail: {},
-      paperConfirmAttachmentId: { attachmentId: "", filename: "", url: "" },
-      paperAttachments: [],
-      paperConfirmAttachments: [],
-      curAttachment: {},
-      curUploadType: "paper",
-      attachmentLimitCount: 26,
-      abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
-      // image-preview
-      curImage: {},
-      curImageIndex: 0,
-    };
-  },
-  computed: {
-    cardTodoName() {
-      let name = "创建答题卡";
-      if (this.examTaskDetail.cardId) {
-        if (this.examTaskDetail.makeMethod === "SELECT") {
-          name = "选择题卡";
-        } else if (this.examTaskDetail.makeMethod === "SELF") {
-          name = "编辑题卡";
-        } else {
-          // 已经审核的题卡可以自行编辑,未审核的题卡只能查看
-          name =
-            this.examTaskDetail.status === "SUBMIT" ? "编辑题卡" : "查看题卡";
-        }
-      }
-      return name;
-    },
-    createCardTypeName() {
-      return CARD_SOURCE_TYPE[this.examTaskDetail.makeMethod] || "";
-    },
-    maxFetchCount() {
-      return this.paperAttachments.length < 1
-        ? 1
-        : this.paperAttachments.length;
-    },
-  },
-  created() {
-    this.getExamRule();
-  },
-  methods: {
-    async getExamRule() {
-      const examRule = await examRuleDetail();
-      this.examRule = examRule || {};
-      this.needReview = examRule && examRule.review;
-    },
-    async getFlowList() {
-      const data = await flowDetailByType();
-      if (!data) return;
-      this.flowInfo = {
-        customFlowId: data.id,
-        version: data.version,
-      };
-      this.flowList = data.flowTaskResultList || [];
-      if (this.flowList.length) {
-        this.flowList[0].type = "success";
-      }
-    },
-    initData() {
-      this.examTask = { ...initExamTask };
-      this.examTaskDetail = { ...initExamTaskDetail };
-      this.examTaskDetail.includePaper = this.examRule.includePaper;
-      this.examTaskDetail.review = this.examRule.review;
-      this.examTaskDetail.customCard = this.examRule.customCard;
-      this.paperAttachments = [];
-    },
-    visibleChange() {
-      if (!this.flowList.length) this.getFlowList();
-      this.initData();
-    },
-    checkData() {
-      return this.$refs.examTaskComp.validate().catch(() => {});
-    },
-    async cancel() {
-      if (this.examTask.id) {
-        await teacherCancelTaskApply(this.examTask.id);
-        this.$message.success("取消命题申请成功!");
-      }
-      this.close();
-    },
-    close() {
-      this.modalIsShow = false;
-    },
-    open() {
-      this.modalIsShow = true;
-    },
-    // exam-task-detail edit
-    addAtachment() {
-      if (this.paperAttachments.length >= this.attachmentLimitCount) return;
-
-      const newAttachment = {
-        name: this.abc[this.paperAttachments.length],
-        attachmentId: "",
-        filename: "",
-        pages: 0,
-      };
-      this.paperAttachments.push(newAttachment);
-    },
-    deleteAttachment(index) {
-      if (this.paperAttachments.length <= 1) {
-        this.$message.error("试卷类型数量不得少于1");
-        return;
-      }
-      this.paperAttachments.splice(index, 1);
-      this.paperAttachments.forEach((item, itemIndex) => {
-        item.name = this.abc[itemIndex];
-      });
-      if (
-        this.examTaskDetail.drawCount &&
-        this.examTaskDetail.drawCount > this.paperAttachments.length
-      ) {
-        this.examTaskDetail.drawCount = this.paperAttachments.length;
-      }
-    },
-    toUpload(attachment) {
-      this.curUploadType = "paper";
-      this.curAttachment = {
-        ...attachment,
-      };
-      this.$refs.UploadPaperDialog.open();
-    },
-    toUploadPaperConfirm() {
-      if (this.paperConfirmAttachments.length >= 4) return;
-      this.curUploadType = "paperConfirm";
-      this.curAttachment = {
-        ...this.paperConfirmAttachmentId,
-      };
-      this.$refs.UploadPaperDialog.open();
-    },
-    uploadConfirm(attachment, uploadType) {
-      if (uploadType === "paper") {
-        const index = this.paperAttachments.findIndex(
-          (item) => item.name === attachment.name
-        );
-        this.paperAttachments.splice(index, 1, { ...attachment });
-      } else {
-        this.paperConfirmAttachments.push(attachment);
-      }
-    },
-    deletePaperConfirmAttachment(index) {
-      this.paperConfirmAttachments.splice(index, 1);
-    },
-    toViewCard() {
-      window.open(
-        this.getRouterPath({
-          name: "CardPreview",
-          params: {
-            cardId: this.examTaskDetail.cardId,
-            viewType: "view",
-          },
-        })
-      );
-    },
-    toEditCard() {
-      this.cachePrepareTcpCard();
-      this.$router.push({
-        name: "CardEdit",
-        params: {
-          cardId: this.examTaskDetail.cardId,
-        },
-      });
-    },
-    cachePrepareTcpCard() {
-      this.$ls.set("prepareTcPCard", {
-        examTaskId: this.examTask.id,
-        courseCode: this.examTask.courseCode,
-        courseName: this.examTask.courseName,
-        makeMethod: this.examTaskDetail.makeMethod,
-        cardRuleId: this.examTask.cardRuleId,
-        type: "CUSTOM",
-        createMethod: "STANDARD",
-      });
-    },
-    async toCreateOrViewCard() {
-      const result = await this.toSave(1);
-      if (!result) return;
-      this.task = {
-        ...this.examTask,
-        ...this.examTaskDetail,
-        examTaskId: this.examTask.id,
-      };
-      if (!this.examTaskDetail.cardId) {
-        this.$refs.CardOptionDialog.open();
-        return;
-      }
-
-      if (this.examTaskDetail.makeMethod === "SELECT") {
-        this.$refs.CardOptionDialog.open();
-      } else if (this.examTaskDetail.makeMethod === "SELF") {
-        this.toEditCard();
-      } else {
-        // 客服制卡:制作完毕则可以编辑,未制作完毕则可以查看
-        if (this.examTaskDetail.status === "SUBMIT") {
-          this.toEditCard();
-        } else {
-          this.toViewCard();
-        }
-      }
-    },
-    cardConfirm(data) {
-      this.examTaskDetail = this.$objAssign(this.examTaskDetail, data);
-    },
-    async changeCreateCardType() {
-      const h = this.$createElement;
-      const result = await this.$msgbox({
-        title: "切换题卡操作说明",
-        message: h("div", null, [
-          h("p", null, "1、切换题卡会将之前选择题卡数据删除。"),
-          h(
-            "p",
-            null,
-            "2、之前选择专卡进行绘制,切换题卡后再次选择专卡,需要重新开始绘制。"
-          ),
-        ]),
-        showCancelButton: true,
-
-        type: "warning",
-      }).catch(() => {});
-      if (result !== "confirm") return;
-
-      await this.clearMakeMethod();
-      this.toCreateOrViewCard();
-    },
-    async clearMakeMethod() {
-      // 清除后台记录的题卡
-      if (this.examTask.id && this.examTaskDetail.cardId)
-        await switchCardCreateMethod(this.examTask.id);
-
-      this.examTaskDetail.makeMethod = "";
-      this.examTaskDetail.cardId = "";
-    },
-    teachingRoomChange() {
-      this.examTask.courseCode = "";
-      this.examTask.courseName = "";
-      this.clearCard();
-    },
-    courseChange(val) {
-      if (!val || !val.code) {
-        this.examTask.courseCode = "";
-        this.examTask.courseName = "";
-        return;
-      }
-      this.examTask.courseName = val.name;
-      this.clearCard();
-    },
-    clearCard() {
-      this.clearMakeMethod();
-    },
-    getTaskDetailData() {
-      let data = { ...this.examTaskDetail };
-      data.paperType = this.paperAttachments.map((item) => item.name).join(",");
-      data.paperAttachmentIds = JSON.stringify(this.paperAttachments, (k, v) =>
-        k === "url" ? undefined : v
-      );
-      data.paperConfirmAttachmentIds = JSON.stringify(
-        this.paperConfirmAttachments
-      );
-      this.examTaskDetail = data;
-    },
-    checkDataValid() {
-      const attachmentValid = !this.paperAttachments.some(
-        (item) => !item.attachmentId
-      );
-      // 设置了入库强制包含试卷时,校验试卷是否上传。
-      if (this.examTaskDetail.includePaper && !attachmentValid) {
-        this.$message.error("请完成试卷文件上传!");
-        return;
-      }
-      // if (!this.paperConfirmAttachments.length) {
-      //   this.$message.error("请上传附件!");
-      //   return;
-      // }
-
-      if (!this.examTaskDetail.cardId) {
-        this.$message.error("请选择题卡创建方式!");
-        return;
-      }
-
-      if (
-        this.examTaskDetail.makeMethod !== "SELECT" &&
-        this.examTaskDetail.status !== "SUBMIT"
-      ) {
-        this.$message.error("请先提交题卡!");
-        return;
-      }
-
-      return true;
-    },
-    async toSave(silent) {
-      const valid = await this.$refs.examTaskComp.validate().catch(() => {});
-      if (!valid) return;
-
-      if (this.isSubmit) return;
-      this.isSubmit = true;
-      this.getTaskDetailData();
-      let datas = {
-        examTaskDetail: this.examTaskDetail,
-        examTask: this.examTask,
-        ...this.flowInfo,
-      };
-      const data = await teacherCreateTaskApply(datas).catch(() => {});
-      this.isSubmit = false;
-      if (!data) return;
-
-      this.examTask = this.$objAssign(this.examTask, data);
-
-      if (!silent) this.$message.success("保存成功!");
-      return true;
-    },
-    async submit() {
-      const valid = await this.$refs.examTaskComp.validate().catch(() => {});
-      if (!valid) return;
-
-      if (!this.checkDataValid()) return;
-
-      this.$confirm(
-        "任务确定提交后,则不可更改试卷及答题卡内容,确定提交该任务?",
-        "提示",
-        {
-          type: "warning",
-        }
-      )
-        .then(async () => {
-          this.getTaskDetailData();
-          this.examTaskDetail.operateType = "SUBMIT";
-          let datas = {
-            examTaskDetail: this.examTaskDetail,
-            examTask: this.examTask,
-          };
-          const data = await teacherCreateTaskApply(datas).catch(() => {});
-
-          if (!data) return;
-          this.$message.success("提交成功!");
-          this.close();
-          this.$emit("modified");
-        })
-        .catch(() => {});
-    },
-    // image-preview
-    toPreview(index) {
-      this.curImageIndex = index;
-      this.selectImage(index);
-      this.$refs.SimpleImagePreview.open();
-    },
-    selectImage(index) {
-      this.curImage = this.paperConfirmAttachments[index];
-    },
-    toPrevImage() {
-      if (this.curImageIndex === 0) {
-        this.curImageIndex = this.paperConfirmAttachments.length - 1;
-      } else {
-        this.curImageIndex--;
-      }
-
-      this.selectImage(this.curImageIndex);
-    },
-    toNextImage() {
-      if (this.curImageIndex === this.paperConfirmAttachments.length - 1) {
-        this.curImageIndex = 0;
-      } else {
-        this.curImageIndex++;
-      }
-
-      this.selectImage(this.curImageIndex);
-    },
-  },
-};
-</script>

+ 2 - 2
src/modules/exam/views/ExamTaskManage.vue

@@ -105,7 +105,7 @@
         <el-table-column
           prop="semesterName"
           label="学期"
-          min-width="160"
+          min-width="200"
         ></el-table-column>
         <el-table-column
           prop="examName"
@@ -156,7 +156,7 @@
         <el-table-column
           class-name="action-column"
           label="操作"
-          width="120px"
+          width="140px"
           fixed="right"
         >
           <template slot-scope="scope">

+ 0 - 19
src/modules/exam/views/TaskApplyManage.vue

@@ -54,14 +54,6 @@
         </el-form-item>
       </el-form>
       <div class="part-box-action">
-        <el-button
-          v-if="checkPrivilege('button', 'addTask')"
-          icon="el-icon-circle-plus-outline"
-          type="primary"
-          @click="toAddApply"
-        >
-          新建命题申请
-        </el-button>
         <el-button
           v-if="checkPrivilege('button', 'ExamTaskApplyManage')"
           icon="el-icon-circle-plus-outline"
@@ -202,12 +194,6 @@
       :instance="curExamTask"
       @modified="taskModified"
     ></modify-task-apply>
-    <!-- CreateTaskApply -->
-    <create-task-apply
-      v-if="checkPrivilege('button', 'addTask')"
-      ref="CreateTaskApply"
-      @modified="taskModified"
-    ></create-task-apply>
     <!-- CreateExamAndPrintTask -->
     <create-exam-and-print-task
       v-if="checkPrivilege('button', 'ExamTaskApplyManage')"
@@ -225,7 +211,6 @@
 <script>
 import ModifyTaskApply from "../components/ModifyTaskApply";
 import CreateExamAndPrintTask from "../components/createExamAndPrintTask/CreateExamAndPrintTask";
-import CreateTaskApply from "../components/CreateTaskApply";
 import PaperApproveTable from "../components/PaperApproveTable";
 import { AUDITING_STATUS } from "@/constants/enumerate";
 import pickerOptions from "@/constants/datePickerOptions";
@@ -241,7 +226,6 @@ export default {
   components: {
     ModifyTaskApply,
     CreateExamAndPrintTask,
-    CreateTaskApply,
     PaperApproveTable,
   },
   data() {
@@ -346,9 +330,6 @@ export default {
       this.getList();
       this.updateWaitTaskCount(this.userRoles);
     },
-    toAddApply() {
-      this.$refs.CreateTaskApply.open();
-    },
     toAddExamAndPrintTask() {
       this.$refs.CreateExamAndPrintTask.open();
     },

+ 1 - 1
src/modules/exam/views/TaskPaperManage.vue

@@ -115,7 +115,7 @@
         <el-table-column
           class-name="action-column"
           label="操作"
-          width="210px"
+          width="140px"
           fixed="right"
         >
           <template slot-scope="scope">

+ 0 - 2
src/router.js

@@ -10,7 +10,6 @@ import login from "./modules/login/router";
 import base from "./modules/base/router";
 import exam from "./modules/exam/router";
 import print from "./modules/print/router";
-import customer from "./modules/customer/router";
 import stmms from "./modules/stmms/router";
 import analysis from "./modules/analysis/router";
 // card part
@@ -61,7 +60,6 @@ let router = new Router({
         ...base,
         ...exam,
         ...print,
-        ...customer,
         ...stmms,
         ...analysis,
       ],