xiatian 4 years ago
parent
commit
e45ad836ed

+ 5 - 1
src/modules/questions/constants/constants.js

@@ -4,6 +4,10 @@ export const LEVEL_TYPE = [
   { label: "高起本", value: "GQB" },
   { label: "不限", value: "ALL" },
 ];
+export const ENABLE_TYPE = [
+  { label: "启用", value: true },
+  { label: "禁用", value: false },
+];
 export const QUESTION_TYPES = [
   { value: "SINGLE_ANSWER_QUESTION", label: "单选" },
   { value: "MULTIPLE_ANSWER_QUESTION", label: "多选" },
@@ -26,7 +30,7 @@ export const EXPORT_TYPES = [
   { value: "ONLINE", label: "机考" },
   { value: "NORMAL", label: "普通" },
 ];
-
+export const PERMISSION_TYPE = { MENU: "MENU", PAGE: "PAGE" };
 /* 是否为空字符串(包含数字0时则返回true) */
 export function isEmptyStr(str) {
   if (str == undefined || String(str).length < 1) {

+ 6 - 21
src/modules/questions/routes/routes.js

@@ -11,9 +11,6 @@ import ImportPaper from "../views/ImportPaper.vue";
 import GenPaper from "../views/GenPaper.vue";
 import ImportPaperInfo from "../views/ImportPaperInfo.vue";
 import GenPaperDetail from "../views/GenPaperDetail.vue";
-import ExtractPaperRule from "../views/ExtractPaperRule.vue";
-import ExtractPaperInfo from "../views/ExtractPaperInfo.vue";
-import ExportStructure from "../views/ExportStructure.vue";
 import Question from "../views/Question.vue";
 import EditSelectQuestion from "../views/EditSelectQuestion.vue";
 import EditOtherQuestion from "../views/EditOtherQuestion.vue";
@@ -24,6 +21,7 @@ import SelectQuestion from "../views/SelectQuestion.vue";
 import Tips from "../../portal/views/tips/Tips.vue";
 import ExportTemplate from "../views/ExportTemplate.vue";
 import School from "../views/School.vue";
+import Course from "../views/Course.vue";
 
 export default [
   {
@@ -40,6 +38,11 @@ export default [
         meta: { privilegeCodes: "index_school" },
         component: School,
       },
+      {
+        path: "course", //课程管理
+        meta: { privilegeCodes: "index_course" },
+        component: Course,
+      },
       {
         path: "paper_structure/:isClear", //精确试卷结构列表
         component: PaperStructure,
@@ -89,24 +92,6 @@ export default [
         path: "gen_paper_detail/:courseNo", //组卷页面
         component: GenPaperDetail,
       },
-      {
-        path: "extract_paper_rule/:isClear", //调卷规则列表
-        component: ExtractPaperRule,
-      },
-      {
-        path: "extract_paper_info_add", //调卷规则——新增
-        name: "extract_paper_info_add",
-        component: ExtractPaperInfo,
-      },
-      {
-        path: "extract_paper_info_edit/:extractConfigId", //调卷规则——修改
-        name: "extract_paper_info_edit",
-        component: ExtractPaperInfo,
-      },
-      {
-        path: "export_structure", //导出结构列表
-        component: ExportStructure,
-      },
       {
         path: "export_template", //导出模板设定
         component: ExportTemplate,

+ 2 - 2
src/modules/questions/views/BluePaperStructure.vue

@@ -147,7 +147,7 @@
   </section>
 </template>
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
   components: { LinkTitlesCustom },
@@ -347,7 +347,7 @@ export default {
       query = query.trim();
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;

+ 1187 - 0
src/modules/questions/views/Course.vue

@@ -0,0 +1,1187 @@
+<template>
+  <section class="content">
+    <div class="box box-info">
+      <div
+        v-loading.body="fileLoading"
+        v-loading.fullscreen="loading"
+        element-loading-text="请稍后..."
+      >
+        <el-form
+          ref="primaryForm"
+          inline
+          :model="formSearch"
+          label-width="70px"
+        >
+          <el-form-item label="课程名称">
+            <el-input
+              v-model="formSearch.name"
+              class="input_width_lg"
+              placeholder="请输入课程名称"
+            />
+          </el-form-item>
+          <el-form-item label="课程代码">
+            <el-input
+              v-model="formSearch.code"
+              class="input_width_lg"
+              placeholder="请输入课程代码"
+            />
+          </el-form-item>
+          <el-form-item label="课程状态">
+            <el-select
+              v-model="formSearch.enable"
+              class="input_width_lg"
+              placeholder="请选择"
+              clearable
+            >
+              <el-option
+                v-for="item in statusList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="层次">
+            <el-select
+              v-model="formSearch.level"
+              class="input_width_lg"
+              placeholder="请选择"
+              clearable
+            >
+              <el-option
+                v-for="item in levelList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="专业" prop="specialtyId">
+            <el-select
+              v-model="formSearch.specialtyId"
+              class="input_width_lg"
+              remote
+              :remote-method="getSpecialtyList4Search"
+              :loading="specialtyLoading4Search"
+              filterable
+              clearable
+              placeholder="请选择"
+              @focus="(e) => getSpecialtyList4Search(e.target.value)"
+            >
+              <el-option
+                v-for="item in specialtyList4SearchWrapper"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item class="d-block">
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-search"
+              @click="handleSearchBtn"
+              >查询</el-button
+            >
+            <el-button
+              size="small"
+              icon="el-icon-refresh"
+              @click="resetPrimaryForm"
+            >
+              重置
+            </el-button>
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              @click="insertCourse"
+              >新增</el-button
+            >
+          </el-form-item>
+        </el-form>
+
+        <div class="block-seperator"></div>
+
+        <span>操作:</span>
+        <el-button
+          size="small"
+          type="success"
+          :disabled="noBatchSelected"
+          icon="el-icon-check"
+          @click="enableByIds"
+        >
+          启用
+        </el-button>
+        <el-button
+          size="small"
+          type="danger"
+          :disabled="noBatchSelected"
+          icon="el-icon-close"
+          @click="disableByIds"
+        >
+          禁用
+        </el-button>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-upload2"
+          @click="impCourse"
+        >
+          导入
+        </el-button>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          @click="exportCourse"
+        >
+          导出
+        </el-button>
+
+        <div style="width: 100%; margin-bottom: 10px"></div>
+
+        <!-- 添加或新增课程弹出框 -->
+        <el-dialog
+          title="课程"
+          width="420px"
+          :visible.sync="courseDialog"
+          @close="dialogBeforeClose"
+        >
+          <el-form
+            ref="courseForm"
+            :inline="true"
+            inline-message
+            :model="courseForm"
+            :rules="rules"
+            label-width="90px"
+          >
+            <el-row>
+              <el-form-item label="课程代码" prop="code">
+                <el-input
+                  v-model="courseForm.code"
+                  :disabled="null != courseForm.id"
+                  class="pull_length"
+                  auto-complete="off"
+                  placeholder="请输入课程代码"
+                />
+              </el-form-item>
+            </el-row>
+            <el-row>
+              <el-form-item label="课程名称" prop="name">
+                <el-input
+                  v-model="courseForm.name"
+                  class="pull_length"
+                  auto-complete="off"
+                  placeholder="请输入课程名称"
+                />
+              </el-form-item>
+            </el-row>
+            <el-row>
+              <el-form-item label="层次" prop="level">
+                <el-select
+                  v-model="courseForm.level"
+                  class="pull_length"
+                  placeholder="请选择"
+                >
+                  <el-option
+                    v-for="item in levelList"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-row>
+            <el-row>
+              <el-form-item label="课程状态" prop="enable">
+                <el-radio-group v-model="courseForm.enable" class="pull_length">
+                  <el-radio label="true">启用</el-radio>
+                  <el-radio label="false">禁用</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-row>
+            <el-row class="pull-center">
+              <el-button type="primary" @click="submitForm">保 存</el-button>
+              <el-button @click="courseDialog = false">取 消</el-button>
+            </el-row>
+          </el-form>
+        </el-dialog>
+
+        <!-- 导入弹窗 -->
+        <el-dialog title="导入窗口" width="520px" :visible.sync="impDialog">
+          <el-form>
+            <el-row>
+              <el-form-item style="margin-left: 20px">
+                <el-upload
+                  ref="upload"
+                  class="form_left"
+                  accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+                  :action="uploadAction"
+                  :headers="uploadHeaders"
+                  :data="uploadData"
+                  :before-upload="beforeUpload"
+                  :on-progress="uploadProgress"
+                  :on-success="uploadSuccess"
+                  :on-error="uploadError"
+                  :file-list="fileList"
+                  :auto-upload="false"
+                  :multiple="false"
+                >
+                  <el-button
+                    slot="trigger"
+                    size="small"
+                    type="primary"
+                    icon="el-icon-search"
+                  >
+                    选择文件
+                  </el-button>
+                  &nbsp;
+                  <el-button
+                    size="small"
+                    type="primary"
+                    icon="el-icon-check"
+                    @click="submitUpload"
+                  >
+                    确认上传
+                  </el-button>
+                  <el-button
+                    size="small"
+                    type="primary"
+                    icon="el-icon-refresh"
+                    @click="removeFile"
+                  >
+                    清空文件
+                  </el-button>
+                  <el-button
+                    size="small"
+                    type="primary"
+                    icon="el-icon-download"
+                    @click="exportFile"
+                  >
+                    下载模板
+                  </el-button>
+                  <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
+                </el-upload>
+              </el-form-item>
+            </el-row>
+          </el-form>
+        </el-dialog>
+
+        <!-- 导入错误信息列表 -->
+        <el-dialog title="错误提示" :visible.sync="errDialog">
+          <div
+            v-for="errMessage in errMessages"
+            :key="errMessage.lineNum"
+            class="text-danger"
+          >
+            第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="errDialog = false">确定</el-button>
+          </span>
+        </el-dialog>
+
+        <!-- 关联专业弹出框 -->
+        <el-dialog
+          :title="specialtyDialogTitle"
+          :visible.sync="specialtyDialog"
+          width="800px"
+        >
+          <!-- 表单 -->
+          <el-form :inline="true" :model="specialtySearchForm">
+            <el-form-item label="专业名称">
+              <el-input
+                v-model="specialtySearchForm.name"
+                class="input_width_lg"
+                placeholder="请输入专业名称"
+              />
+            </el-form-item>
+            <el-form-item label="专业代码">
+              <el-input
+                v-model="specialtySearchForm.code"
+                class="input_width_lg"
+                placeholder="请输入专业代码"
+              />
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                size="small"
+                type="primary"
+                icon="el-icon-search"
+                @click="searchSpecialtyPage"
+              >
+                查询
+              </el-button>
+              <el-button
+                size="small"
+                type="primary"
+                icon="el-icon-plus"
+                @click="addRelation"
+              >
+                新增
+              </el-button>
+            </el-form-item>
+          </el-form>
+
+          <!-- 专业列表 -->
+          <el-table :data="specialtyTableData" border>
+            <el-table-column prop="id" label="ID" width="100" />
+            <el-table-column prop="name" label="专业名称" width="250" />
+            <el-table-column prop="code" label="专业代码" />
+            <el-table-column
+              sortable
+              prop="updateTime"
+              label="更新时间"
+              width="170"
+            />
+            <el-table-column label="操作">
+              <div slot-scope="scope">
+                <span>
+                  <el-button
+                    size="mini"
+                    type="primary"
+                    icon="el-icon-edit"
+                    plain
+                    @click="deleteRelation(scope.row)"
+                  >
+                    取消关联
+                  </el-button>
+                </span>
+              </div>
+            </el-table-column>
+          </el-table>
+          <div class="page pull-right">
+            <el-pagination
+              :current-page="currentSpecialtyPage"
+              :page-size="10"
+              :total="specialtyTotal"
+              @current-change="handleSpecialtyCurrentChange"
+            />
+          </div>
+          <div style="margin-bottom: 20px"></div>
+        </el-dialog>
+
+        <!-- 添加关联 -->
+        <el-dialog
+          title="添加关联专业"
+          :visible.sync="addRelationDialog"
+          width="400px"
+          @close="() => $refs.addRelationForm.clearValidate()"
+        >
+          <el-form
+            ref="addRelationForm"
+            :inline="true"
+            inline-message
+            :model="addRelationForm"
+            :rules="addRelationRules"
+          >
+            <el-row>
+              <el-form-item label="专业" prop="specialtyId">
+                <el-select
+                  v-model="addRelationForm.specialtyId"
+                  class="input"
+                  style="width: 200px"
+                  remote
+                  :remote-method="getSpecialtyList4AddRelation"
+                  :loading="specialtyLoading4AddRelation"
+                  filterable
+                  clearable
+                  placeholder="请选择"
+                  @focus="(e) => getSpecialtyList4AddRelation(e.target.value)"
+                >
+                  <el-option
+                    v-for="item in specialtyList4AddRelationWrapper"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-form-item>
+            </el-row>
+            <el-row class="d-flex justify-content-center">
+              <el-button type="primary" @click="submitAddRelationForm">
+                保 存
+              </el-button>
+              <el-button @click="addRelationDialog = false">取 消</el-button>
+            </el-row>
+          </el-form>
+        </el-dialog>
+
+        <!-- 页面列表 -->
+        <!-- FIXME: element-ui style bug https://github.com/ElemeFE/element/issues/16167 -->
+        <el-table
+          :data="tableData"
+          border
+          resizable
+          stripe
+          style="width: 99.99% !important"
+          @selection-change="selectChange"
+        >
+          <el-table-column type="selection" width="40" />
+          <el-table-column prop="id" label="课程ID" width="80" />
+          <el-table-column prop="name" label="课程名称" width="180" />
+          <el-table-column prop="code" label="课程代码" />
+          <el-table-column label="层次">
+            <span slot-scope="scope">{{ getLevel(scope.row.level) }}</span>
+          </el-table-column>
+          <el-table-column width="50" label="状态">
+            <span slot-scope="scope">
+              <span v-if="scope.row.enable">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  content="启用"
+                  placement="left"
+                >
+                  <i class="el-icon-success" style="color: green"></i>
+                </el-tooltip>
+              </span>
+              <span v-else>
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  content="禁用"
+                  placement="left"
+                >
+                  <i class="el-icon-error" style="color: red"></i>
+                </el-tooltip>
+              </span>
+            </span>
+          </el-table-column>
+          <el-table-column
+            sortable
+            prop="updateTime"
+            label="更新时间"
+            width="170"
+          />
+          <el-table-column label="操作" width="290">
+            <div slot-scope="scope">
+              <el-button
+                size="mini"
+                type="primary"
+                plain
+                icon="el-icon-share"
+                @click="relation(scope.row)"
+              >
+                关联专业
+              </el-button>
+              <el-button
+                size="mini"
+                type="primary"
+                plain
+                @click="editCourse(scope.row)"
+              >
+                <i class="el-icon-edit"></i> 编辑
+              </el-button>
+              <el-button
+                v-if="!scope.row.enable"
+                size="mini"
+                plain
+                type="primary"
+                icon="el-icon-check"
+                @click="enableById(scope.row)"
+              >
+                启用
+              </el-button>
+              <el-button
+                v-if="scope.row.enable"
+                size="mini"
+                type="danger"
+                icon="el-icon-close"
+                @click="disableById(scope.row)"
+              >
+                禁用
+              </el-button>
+            </div>
+          </el-table-column>
+        </el-table>
+        <div class="page pull-right">
+          <el-pagination
+            :current-page="currentPage"
+            :page-size="10"
+            :page-sizes="[10, 20, 50, 100, 200, 300]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+
+<script>
+import { QUESTION_API } from "@/constants/constants.js";
+import { ENABLE_TYPE, LEVEL_TYPE } from "../constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  name: "Course",
+  data() {
+    return {
+      specialtyLoading4Search: false,
+      specialtyList4Search: [],
+      formSearch: {
+        name: "",
+        code: "",
+        enable: "",
+        level: "",
+        specialtyId: "",
+      },
+      courseForm: {
+        id: null,
+        name: "",
+        code: "",
+        level: "ALL",
+        enable: "true",
+      },
+      statusList: ENABLE_TYPE,
+      levelList: LEVEL_TYPE,
+      selectedCourseIds: [],
+      tableData: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 10,
+      specialtyAllList: [],
+      specialtyList: [],
+      selectedSpecialtyList: [],
+      specialtys: [],
+      specialtyAll: [],
+
+      impDialog: false,
+      uploadAction: QUESTION_API + "/course/import",
+      uploadHeaders: {},
+      uploadData: {},
+      errMessages: [],
+      errDialog: false,
+      fileLoading: false,
+      loading: false,
+      fileList: [],
+
+      courseDialog: false,
+      relationDialog: false,
+
+      rules: {
+        name: [
+          {
+            required: true,
+            message: "请输入课程名称",
+            trigger: "blur",
+          },
+        ],
+        code: [
+          {
+            required: true,
+            message: "请输入课程代码",
+            trigger: "blur",
+          },
+        ],
+        level: [
+          {
+            required: true,
+            message: "请选择层次",
+            trigger: "change",
+          },
+        ],
+        status: [
+          {
+            required: true,
+            message: "请选择状态",
+            trigger: "change",
+          },
+        ],
+      },
+      specialtyDialog: false,
+      specialtyDialogTitle: null,
+      specialtySearchForm: {
+        courseId: null,
+        code: "",
+        name: "",
+      },
+      specialtyTableData: [],
+      currentSpecialtyPage: 1,
+      specialtyPageSize: 10,
+      specialtyTotal: 10,
+
+      addRelationDialog: false,
+      addRelationForm: {
+        specialtyId: null,
+        courseId: null,
+      },
+      specialtyLoading4AddRelation: false,
+      specialtyList4AddRelation: [],
+      addRelationRules: {
+        specialtyId: [
+          {
+            required: true,
+            type: "number",
+            message: "请选择专业",
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  computed: {
+    ...mapState({
+      user: (state) => state.user,
+    }),
+    noBatchSelected() {
+      return this.selectedCourseIds.length === 0;
+    },
+    courseIds() {
+      var courseIds = "";
+      for (let courseId of this.selectedCourseIds) {
+        if (!courseIds) {
+          courseIds += courseId;
+        } else {
+          courseIds += "," + courseId;
+        }
+      }
+      return courseIds;
+    },
+    specialtyAllListSelect() {
+      let specialtyList = [];
+      for (let specialty of this.specialtyAllList) {
+        let specialtyInfo = specialty.name + "(" + specialty.code + ")";
+        specialtyList.push({ id: specialty.id, specialtyInfo: specialtyInfo });
+      }
+      return specialtyList;
+    },
+    getSpecialtyAllSelect4Search() {
+      let specialtyList4Search = [];
+      for (let specialty of this.specialtys) {
+        let specialtyInfo = specialty.name + "(" + specialty.code + ")";
+        specialtyList4Search.push({
+          id: specialty.id,
+          specialtyInfo: specialtyInfo,
+        });
+      }
+      return specialtyList4Search;
+    },
+    specialtyList4SearchWrapper() {
+      var specialtyList = [];
+      for (let course of this.specialtyList4Search) {
+        var name = course.name + " - " + course.code;
+        var id = course.id;
+        specialtyList.push({ id: id, name: name });
+      }
+      return specialtyList;
+    },
+    specialtyList4AddRelationWrapper() {
+      var specialtyList = [];
+      for (let course of this.specialtyList4AddRelation) {
+        var name = course.name + " - " + course.code;
+        var id = course.id;
+        specialtyList.push({ id: id, name: name });
+      }
+      return specialtyList;
+    },
+  },
+  //初始化查询
+  created() {
+    this.searchForm();
+    this.uploadHeaders = {
+      key: this.user.key,
+      token: this.user.token,
+    };
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.searchForm();
+    },
+    dialogBeforeClose() {
+      this.$refs.courseForm.clearValidate();
+    },
+    deleteRelation(row) {
+      var specialtyId = row.id;
+      var courseId = this.specialtySearchForm.courseId;
+      var param = new URLSearchParams({
+        courseId: courseId,
+        specialtyId: specialtyId,
+      });
+      var url = QUESTION_API + "/courseSpeciatlyRelation/delete?" + param;
+      this.$httpWithMsg.delete(url).then(() => {
+        this.$notify({
+          type: "success",
+          message: "取消关联成功!",
+        });
+        this.searchSpecialtyPage();
+      });
+    },
+    submitAddRelationForm() {
+      this.$refs.addRelationForm.validate((valid) => {
+        if (valid) {
+          var param = new URLSearchParams(this.addRelationForm);
+          var url = QUESTION_API + "/courseSpeciatlyRelation/add?" + param;
+          this.$httpWithMsg.post(url, this.speciallyForm).then(() => {
+            this.$notify({
+              type: "success",
+              message: "添加成功!",
+            });
+            this.searchSpecialtyPage();
+            this.addRelationDialog = false;
+          });
+        } else {
+          console.log("error submit!");
+          return false;
+        }
+      });
+    },
+    getSpecialtyList4AddRelation(query) {
+      this.specialtyLoading4AddRelation = true;
+      this.$httpWithMsg
+        .get(QUESTION_API + "/specialty/query?name=" + query)
+        .then((response) => {
+          this.specialtyList4AddRelation = response.data;
+          this.specialtyLoading4AddRelation = false;
+        });
+    },
+    addRelation() {
+      this.addRelationForm.specialtyId = null;
+      this.addRelationForm.courseId = this.specialtySearchForm.courseId;
+      this.addRelationDialog = true;
+      if (this.$refs.addRelationForm) {
+        this.$refs.addRelationForm.resetFields();
+      }
+    },
+    handleSpecialtyCurrentChange(val) {
+      this.currentSpecialtyPage = val;
+      this.searchSpecialtyPage();
+    },
+    searchSpecialtyPage() {
+      var param = new URLSearchParams(this.specialtySearchForm);
+      var url =
+        QUESTION_API +
+        "/specialty/specialtyPage/" +
+        (this.currentSpecialtyPage - 1) +
+        "/" +
+        this.pageSize +
+        "?" +
+        param;
+      this.$httpWithMsg
+        .get(url)
+        .then((response) => {
+          this.specialtyTableData = response.data.content;
+          this.specialtyTotal = response.data.totalElements;
+        })
+        .then(() => {
+          if (this.specialtyTableData.length === 0 && this.specialtyTotal > 0) {
+            this.currentSpecialtyPage = this.currentSpecialtyPage - 1;
+            this.searchSpecialtyPage();
+          }
+        });
+    },
+    getTag(status) {
+      if (status == true) {
+        return "success";
+      } else if (status == false) {
+        return "danger";
+      }
+      return status;
+    },
+    getLevel(level) {
+      if (level == "ZSB") {
+        return "专升本";
+      } else if (level == "GQZ") {
+        return "高起专";
+      } else if (level == "GQB") {
+        return "高起本";
+      } else {
+        return "不限";
+      }
+    },
+    getSpecialtyList4Search(query) {
+      this.specialtyLoading4Search = true;
+      this.$httpWithMsg
+        .get(QUESTION_API + "/specialty/query?name=" + query)
+        .then((response) => {
+          this.specialtyList4Search = response.data;
+          this.specialtyLoading4Search = false;
+        });
+    },
+    handleSearchBtn() {
+      this.currentPage = 1;
+      this.searchForm();
+    },
+    searchForm() {
+      let searchLock = true;
+      setTimeout(() => {
+        if (searchLock) {
+          this.loading = true;
+        }
+      }, 500);
+      var param = new URLSearchParams(this.formSearch);
+      var url =
+        QUESTION_API +
+        "/course/coursePage/" +
+        (this.currentPage - 1) +
+        "/" +
+        this.pageSize +
+        "?" +
+        param;
+      this.$httpWithMsg
+        .get(url)
+        .then((response) => {
+          this.tableData = response.data.content;
+          this.total = response.data.totalElements;
+        })
+        .finally(() => {
+          searchLock = false;
+          this.loading = false;
+        });
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.searchForm();
+    },
+    selectChange(row) {
+      this.selectedCourseIds = [];
+      row.forEach((element) => {
+        this.selectedCourseIds.push(element.id);
+      });
+      console.log(this.selectedCourseIds);
+    },
+    //新增
+    insertCourse() {
+      this.courseForm.id = null;
+      this.courseForm.name = null;
+      this.courseForm.code = null;
+      this.courseForm.level = "ALL";
+      this.courseForm.enable = "true";
+
+      this.courseDialog = true;
+    },
+    //修改
+    editCourse(row) {
+      this.courseForm = Object.assign({}, row);
+      this.courseForm.enable = row.enable ? "true" : "false";
+      this.courseId = row.id;
+
+      this.courseDialog = true;
+    },
+    exportCourse() {
+      var param = new URLSearchParams(this.formSearch);
+      window.open(
+        QUESTION_API +
+          "/course/export?$key=" +
+          this.user.key +
+          "&$token=" +
+          this.user.token +
+          "&" +
+          param
+      );
+    },
+
+    //关联课程
+    relation(row) {
+      this.specialtyDialogTitle =
+        "关联专业列表 【课程名称:" +
+        row.name +
+        "】【       课程代码:" +
+        row.code +
+        "】";
+      this.specialtySearchForm.courseId = row.id;
+      this.specialtySearchForm.name = "";
+      this.specialtySearchForm.code = "";
+
+      this.searchSpecialtyPage();
+      this.specialtyDialog = true;
+    },
+    closeCourse() {
+      this.courseDialog = false;
+    },
+    saveRelation() {},
+    //保存(新增/修改)
+    submitForm() {
+      var url = QUESTION_API + "/course";
+      if (null != this.courseForm.id) {
+        //修改
+        this.$refs.courseForm.validate((valid) => {
+          if (valid) {
+            this.$httpWithMsg.put(url, this.courseForm).then(() => {
+              this.$notify({
+                type: "success",
+                message: "修改成功!",
+              });
+              this.searchForm();
+              this.resetForm();
+              this.courseDialog = false;
+            });
+          } else {
+            console.log("error submit!");
+            return false;
+          }
+        });
+      } else {
+        this.$refs.courseForm.validate((valid) => {
+          if (valid) {
+            this.$httpWithMsg.post(url, this.courseForm).then(() => {
+              this.$notify({
+                type: "success",
+                message: "添加成功",
+              });
+              this.searchForm();
+              this.resetForm();
+              this.courseDialog = false;
+            });
+          } else {
+            console.log("error submit!");
+            return false;
+          }
+        });
+      }
+    },
+    //重置
+    resetForm() {
+      this.$refs.courseForm.resetFields();
+    },
+    resetPrimaryForm() {
+      this.formSearch = {
+        name: "",
+        code: "",
+        enable: "",
+        level: "",
+        specialtyId: "",
+      };
+      this.$refs.primaryForm.resetFields();
+    },
+    //删除单个数据
+    deleteById(row) {
+      this.$confirm("是否删除该课程?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        var url = QUESTION_API + "/course/" + row.id;
+        this.$httpWithMsg.delete(url).then(() => {
+          this.$notify({
+            type: "success",
+            message: "删除成功!",
+          });
+          this.searchForm();
+        });
+      });
+    },
+    //删除多条数据
+    deleteByIds() {
+      if (this.selectedCourseIds.length === 0) {
+        this.$notify({
+          type: "warning",
+          message: "请选择要删除的课程",
+        });
+      } else {
+        this.$confirm("是否删除这些课程?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "error",
+        }).then(() => {
+          var url = QUESTION_API + "/course/" + this.courseIds;
+          this.$httpWithMsg.delete(url).then(() => {
+            this.$notify({
+              type: "success",
+              message: "删除成功!",
+            });
+            this.searchForm();
+          });
+        });
+      }
+    },
+    //启用
+    enableByIds() {
+      if (this.selectedCourseIds.length === 0) {
+        this.$notify({
+          type: "warning",
+          message: "请选择要启用的课程",
+        });
+      } else {
+        this.$confirm("是否启用这些课程?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(() => {
+          var url = QUESTION_API + "/course/enable/" + this.courseIds;
+          this.$httpWithMsg.put(url, {}).then(() => {
+            this.$notify({
+              type: "success",
+              message: "启用成功!",
+            });
+            this.searchForm();
+          });
+        });
+      }
+    },
+    enableById(row) {
+      this.$confirm("是否启用该课程?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        var url = QUESTION_API + "/course/enable/" + row.id;
+        this.$httpWithMsg.put(url, {}).then(() => {
+          this.$notify({
+            type: "success",
+            message: "启用成功!",
+          });
+          this.searchForm();
+        });
+      });
+    },
+    //禁用
+    disableByIds() {
+      if (this.selectedCourseIds.length === 0) {
+        this.$notify({
+          type: "warning",
+          message: "请选择要禁用的课程",
+        });
+      } else {
+        this.$confirm("是否禁用这些课程?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "error",
+        }).then(() => {
+          var url = QUESTION_API + "/course/disable/" + this.courseIds;
+          this.$httpWithMsg.put(url, {}).then(() => {
+            this.$notify({
+              type: "success",
+              message: "禁用成功!",
+            });
+            this.searchForm();
+          });
+        });
+      }
+    },
+    //禁用
+    disableById(row) {
+      this.$confirm("是否禁用该课程?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "error",
+      }).then(() => {
+        var url = QUESTION_API + "/course/disable/" + row.id;
+        return this.$httpWithMsg.put(url, {}).then(() => {
+          this.$notify({
+            type: "success",
+            message: "禁用成功!",
+          });
+          return this.searchForm();
+        });
+      });
+    },
+    //导入
+    impCourse() {
+      this.impDialog = true;
+      this.initUpload();
+    },
+    initUpload() {
+      this.fileList = [];
+    },
+    beforeUpload(file) {
+      console.log(file);
+    },
+    uploadProgress() {
+      console.log("uploadProgress");
+    },
+    uploadSuccess(response) {
+      if (!response.hasError) {
+        this.$notify({
+          message: "上传成功",
+          type: "success",
+        });
+        this.fileLoading = false;
+        this.impDialog = false;
+        this.searchForm();
+      } else {
+        this.fileLoading = false;
+        this.impDialog = false;
+        this.errMessages = response.failRecords;
+        this.errDialog = true;
+      }
+    },
+    uploadError(response) {
+      var json = JSON.parse(response.message);
+      if (response.status == 500) {
+        this.$notify({
+          message: json.desc,
+          type: "error",
+        });
+      }
+      this.fileLoading = false;
+    },
+    //确定上传
+    submitUpload() {
+      if (!this.checkUpload()) {
+        return false;
+      }
+      this.$refs.upload.submit();
+      this.fileLoading = true;
+    },
+    checkUpload() {
+      var fileList = this.$refs.upload.uploadFiles;
+      if (fileList.length == 0) {
+        this.$notify({
+          message: "上传文件不能为空",
+          type: "error",
+        });
+        return false;
+      }
+      if (fileList.length > 1) {
+        this.$notify({
+          message: "每次只能上传一个文件",
+          type: "error",
+        });
+        return false;
+      }
+      for (let file of fileList) {
+        if (!file.name.endsWith(".xlsx")) {
+          this.$notify({
+            message: "上传文件必须为xlsx格式",
+            type: "error",
+          });
+          this.initUpload();
+          return false;
+        }
+      }
+      return true;
+    },
+    //清空文件
+    removeFile() {
+      // this.fileList = [];
+      this.$refs.upload.clearFiles();
+    },
+    //下载模板
+    exportFile() {
+      window.location.href =
+        QUESTION_API +
+        "/course/importTemplate?$key=" +
+        this.user.key +
+        "&$token=" +
+        this.user.token;
+    },
+  },
+};
+</script>
+
+<style scoped>
+.page {
+  margin-top: 10px;
+}
+
+.input_width_lg {
+  width: 180px;
+}
+
+.pull_length {
+  width: 180px;
+}
+
+.pull-center {
+  margin-left: 30%;
+}
+</style>

+ 7 - 5
src/modules/questions/views/CourseProperty.vue

@@ -228,7 +228,7 @@
 </template>
 
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
   components: { LinkTitlesCustom },
@@ -498,7 +498,7 @@ export default {
       query = query.trim();
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;
@@ -538,9 +538,11 @@ export default {
     //查询单个课程
     getOneCourse(courseId) {
       if (courseId) {
-        this.$http.get(CORE_API + "/course/" + courseId).then((response) => {
-          this.courseList.push(response.data);
-        });
+        this.$http
+          .get(QUESTION_API + "/course/" + courseId)
+          .then((response) => {
+            this.courseList.push(response.data);
+          });
       } else {
         this.courseList = [];
       }

+ 0 - 809
src/modules/questions/views/ExportStructure.vue

@@ -1,809 +0,0 @@
-<template>
-  <section class="content">
-    <!-- 正文信息 -->
-    <div class="box-body">
-      <el-form
-        :inline="true"
-        :model="formSearch"
-        label-position="right"
-        label-width="70px"
-      >
-        <el-row>
-          <el-col :span="6">
-            <el-form-item label="考试类型">
-              <el-select
-                v-model="formSearch.examType"
-                class="search_width"
-                filterable
-                clearable
-                placeholder="请选择"
-                size="small"
-                @change="searchExams"
-              >
-                <el-option
-                  v-for="item in EXAM_TYPES"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="考试名称">
-              <el-select
-                v-model="formSearch.examId"
-                class="search_width"
-                filterable
-                :remote-method="getExams"
-                remote
-                clearable
-                placeholder="请选择"
-                size="small"
-              >
-                <el-option
-                  v-for="item in examList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="导出类型">
-              <el-select
-                v-model="formSearch.exportType"
-                class="search_width"
-                filterable
-                clearable
-                placeholder="请选择"
-                size="small"
-              >
-                <el-option
-                  v-for="item in EXPORT_TYPES"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <div class="search_down">
-              <el-button size="small" type="primary" @click="searchFrom"
-                ><i class="el-icon-search"></i> 查询</el-button
-              >
-              <el-button size="small" @click="resetForm"
-                ><i class="el-icon-refresh"></i> 重 置</el-button
-              >
-              <el-button size="small" type="primary" @click="add"
-                ><i class="el-icon-plus"></i> 新增</el-button
-              >
-            </div>
-          </el-col>
-        </el-row>
-      </el-form>
-      <div
-        style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0"
-      ></div>
-      <!-- 页面列表 -->
-      <el-table border :data="tableData">
-        <el-table-column label="考试类型">
-          <template slot-scope="scope">
-            <span>{{ scope.row.examType | examTypesFilter }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="考试名称">
-          <template slot-scope="scope">
-            <span>{{ scope.row.examName }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="导出类型">
-          <template slot-scope="scope">
-            <span>{{ scope.row.exportType | exportTypesFilter }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="题数">
-          <template slot-scope="scope">
-            <div
-              v-for="(item, index) in scope.row.questionTypeNums"
-              v-show="scope.row.exportType == 'NORMAL'"
-              :key="index"
-            >
-              <span>{{ item.questionType | questionType }}</span>
-              <span>{{ item.quantity }}</span>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="175">
-          <template slot-scope="scope">
-            <div class="operate_left">
-              <el-button
-                size="mini"
-                type="primary"
-                plain
-                @click="copy(scope.row)"
-                ><i class="el-icon-edit"></i>复用</el-button
-              >
-              <el-button size="mini" type="danger" @click="del(scope.row)"
-                ><i class="el-icon-delete"></i> 删除</el-button
-              >
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="page pull-right">
-        <el-pagination
-          :current-page="currentPage"
-          :page-size="pageSize"
-          :page-sizes="[10, 20, 50, 100, 200, 300]"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          @current-change="handleCurrentChange"
-          @size-change="handleSizeChange"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <!-- 复用窗口 -->
-    <el-dialog
-      title="试卷结构复用"
-      :visible.sync="dialogCopyModel"
-      width="500px"
-    >
-      <el-form
-        :model="exportStructureCopy"
-        label-position="right"
-        label-width="120px"
-      >
-        <el-tabs> <el-tab-pane label="原结构信息"></el-tab-pane> </el-tabs>
-        <el-form-item label="考试类型">
-          <el-select
-            v-model="exportStructureCopy.examTypeOld"
-            placeholder="请选择"
-            disabled
-          >
-            <el-option
-              v-for="item in EXAM_TYPES"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="考试名称">
-          <el-select
-            v-model="exportStructureCopy.examIdOld"
-            placeholder="请选择"
-            disabled
-          >
-            <el-option
-              v-for="item in examList"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="导出类型">
-          <el-select
-            v-model="exportStructureCopy.exportTypeOld"
-            placeholder="请选择"
-            disabled
-          >
-            <el-option
-              v-for="item in EXPORT_TYPES"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-tabs> <el-tab-pane label="新结构信息"></el-tab-pane> </el-tabs>
-        <el-form-item label="考试类型">
-          <el-select
-            v-model="exportStructureCopy.examType"
-            placeholder="请选择"
-            @change="searchExamId"
-          >
-            <el-option
-              v-for="item in EXAM_TYPES"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-          <span
-            v-if="check_value(exportStructureCopy.examType)"
-            class="error_message error_other"
-            >请选择考试类型</span
-          >
-        </el-form-item>
-        <el-form-item label="考试名称">
-          <el-select v-model="exportStructureCopy.examId" placeholder="请选择">
-            <el-option
-              v-for="item in examListNew"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            ></el-option>
-          </el-select>
-          <span
-            v-if="check_value(exportStructureCopy.examId)"
-            class="error_message error_other"
-            >请选择考试名称</span
-          >
-        </el-form-item>
-        <el-row class="margin_top_10 margin_left_120">
-          <el-button type="primary" @click="saveCopy">保 存</el-button>
-          <!-- <el-button @click="resetForm3"
-            ><i class="el-icon-refresh"></i> 重 置</el-button
-          > -->
-          <el-button type="primary" @click="cancleCopy"
-            ><i class="el-icon-arrow-left"></i> 返 回</el-button
-          >
-        </el-row>
-      </el-form>
-    </el-dialog>
-    <!-- 新增窗口 -->
-    <el-dialog title="新增导出结构" :visible.sync="dialogModel" width="500px">
-      <el-form
-        :model="exportStructure"
-        label-position="right"
-        label-width="78px"
-        :inline="true"
-      >
-        <el-row>
-          <div style="color: #f56c6c; margin-bottom: -30px">*</div>
-          <el-form-item label="考试类型">
-            <el-select
-              v-model="exportStructure.examType"
-              placeholder="请选择"
-              @change="searchExportStructure('examType')"
-            >
-              <el-option
-                v-for="item in EXAM_TYPES"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              ></el-option>
-            </el-select>
-            <span
-              v-if="check_value(exportStructure.examType)"
-              class="error_message error_other"
-              >请选择考试类型</span
-            >
-          </el-form-item>
-        </el-row>
-        <el-row>
-          <div style="color: #f56c6c; margin-bottom: -30px; margin-top: 8px">
-            *
-          </div>
-          <el-form-item label="考试名称">
-            <el-select
-              v-model="exportStructure.examId"
-              filterable
-              placeholder="请选择"
-              @change="searchExportStructure('examId')"
-            >
-              <el-option
-                v-for="item in examListByExamType"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              ></el-option>
-            </el-select>
-            <span
-              v-if="check_value(exportStructure.examId)"
-              class="error_message error_other"
-              >请选择考试名称</span
-            >
-          </el-form-item>
-        </el-row>
-        <el-row>
-          <div style="color: #f56c6c; margin-bottom: -30px; margin-top: 8px">
-            *
-          </div>
-          <el-form-item label="导出类型">
-            <el-select
-              v-model="exportStructure.exportType"
-              placeholder="请选择"
-              :disabled="button"
-            >
-              <el-option
-                v-for="item in EXPORT_TYPES"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              ></el-option>
-            </el-select>
-            <span
-              v-if="check_value(exportStructure.exportType)"
-              class="error_message error_other"
-              >请选择导出类型</span
-            >
-          </el-form-item>
-        </el-row>
-        <!-- 判断机考还是传统 -->
-        <div v-if="exportStructure.exportType == 'NORMAL'">
-          <div
-            v-for="(item, index) in exportStructure.questionTypeNums"
-            :key="index"
-          >
-            <el-row>
-              <div
-                style="
-                  color: #f56c6c;
-                  margin-bottom: -30px;
-                  margin-left: 26px;
-                  margin-top: 8px;
-                "
-              >
-                *
-              </div>
-              <el-form-item
-                :label="item.questionType | questionType"
-                label-width="78px"
-              >
-                <el-input
-                  v-model="item.quantity"
-                  style="width: 220px"
-                  :disabled="button"
-                ></el-input>
-                <span
-                  v-if="check(item.quantity)"
-                  class="error_message error_other"
-                >
-                  请输入正整数或0
-                </span>
-              </el-form-item>
-            </el-row>
-          </div>
-        </div>
-        <el-row class="margin_top_10 margin_left_120">
-          <el-button type="primary" :disabled="button" @click="save"
-            >保 存</el-button
-          >
-          <!-- <el-button @click="resetForm2"
-            ><i class="el-icon-refresh"></i> 重 置</el-button
-          > -->
-          <el-button type="primary" @click="cancel"
-            ><i class="el-icon-arrow-left"></i> 返 回</el-button
-          >
-        </el-row>
-      </el-form>
-    </el-dialog>
-  </section>
-</template>
-<script>
-import { QUESTION_API, EXAM_WORK_API } from "@/constants/constants";
-import { EXAM_TYPES, EXPORT_TYPES } from "../constants/constants";
-import { mapState } from "vuex";
-import _ from "lodash";
-export default {
-  data() {
-    return {
-      isShow: false,
-      loading: false,
-      dialogModel: false,
-      dialogCopyModel: false,
-      formSearch: {
-        examType: null,
-        examId: null,
-        exportType: null,
-      },
-      exportStructure: {
-        examType: "",
-        examId: "",
-        examName: "",
-        exportType: "",
-        useable: "1", //默认启用
-        questionTypeNums: [
-          {
-            questionType: "SINGLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "MULTIPLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "BOOL_ANSWER_QUESTION",
-            quantity: "",
-          },
-        ],
-      },
-      exportStructureCopy: {
-        examTypeOld: "",
-        examIdOld: "",
-        exportTypeOld: "",
-        examType: "",
-        examId: "",
-        useable: "1",
-        questionTypeNums: [
-          {
-            questionType: "SINGLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "MULTIPLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "BOOL_ANSWER_QUESTION",
-            quantity: "",
-          },
-        ],
-      },
-      EXAM_TYPES: EXAM_TYPES,
-      EXPORT_TYPES: EXPORT_TYPES,
-      examList: [],
-      examListByExamType: [],
-      tableData: [],
-      pageSize: 10,
-      currentPage: 1,
-      total: 10,
-      button: false,
-      examListNew: [],
-      disMessage: false,
-      reShow: false,
-    };
-  },
-  computed: {
-    ...mapState({ user: (state) => state.user }),
-  },
-  created() {
-    this.getExams("");
-    this.search();
-  },
-  methods: {
-    resetForm() {
-      this.formSearch = {
-        examType: null,
-        examId: null,
-        exportType: null,
-      };
-    },
-    searchFrom() {
-      this.currentPage = 1;
-      this.search();
-    },
-    search() {
-      if (this.formSearch.examType === "") {
-        this.formSearch.examType = null;
-      }
-      this.tableData = [];
-      this.loading = true;
-      var url =
-        QUESTION_API +
-        "/findPageByExportStructure/" +
-        this.currentPage +
-        "/" +
-        this.pageSize;
-      this.$http.post(url, this.formSearch).then((response) => {
-        this.tableData = response.data.content;
-        this.total = response.data.totalElements;
-        this.loading = false;
-      });
-    },
-    //新增考试结构
-    add() {
-      this.dialogModel = true;
-      this.button = false;
-      this.isShow = false;
-      this.exportStructure = {
-        examType: "",
-        examId: "",
-        examName: "",
-        exportType: "",
-        useable: "1", //默认启用
-        questionTypeNums: [
-          {
-            questionType: "SINGLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "MULTIPLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "BOOL_ANSWER_QUESTION",
-            quantity: "",
-          },
-        ],
-      };
-    },
-    handleCurrentChange(val) {
-      this.currentPage = val;
-      this.search();
-    },
-    handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.search();
-    },
-    closeQuesDialog() {
-      this.dialogModel = false;
-    },
-    //表单验证
-    check(value) {
-      if (this.disMessage) {
-        return false;
-      }
-      if (this.reShow) {
-        return false;
-      }
-      var r = /^\+?[1-9][0-9]*$/;
-      if ((r.test(value) || value === "0") && this.isShow) {
-        return false;
-      }
-      return true;
-    },
-    check_value(value) {
-      if (!value && this.isShow) {
-        return true;
-      }
-      return false;
-    },
-    save() {
-      this.reShow = false;
-      this.isShow = true;
-      if (this.check_value(this.exportStructure.examType)) {
-        return false;
-      }
-      if (this.check_value(this.exportStructure.examId)) {
-        return false;
-      }
-      if (this.check_value(this.exportStructure.exportType)) {
-        return false;
-      }
-      if (this.exportStructure.exportType == "NORMAL") {
-        for (var i = 0; i < this.exportStructure.questionTypeNums.length; i++) {
-          if (this.check(this.exportStructure.questionTypeNums[i].quantity)) {
-            return false;
-          }
-        }
-      }
-      let examId = this.exportStructure.examId;
-      this.exportStructure.examName = _.filter(this.examList, function (item) {
-        return item.id == examId;
-      })[0].name;
-      this.$http
-        .post(QUESTION_API + "/saveExportStructure", this.exportStructure)
-        .then(() => {
-          this.$notify({
-            title: "提示",
-            message: "保存成功",
-            type: "success",
-          });
-          this.closeQuesDialog();
-          this.search();
-        });
-    },
-    //重置2
-    resetForm2() {
-      this.exportStructure = {
-        examType: "",
-        examId: "",
-        examName: "",
-        exportType: "",
-        useable: "1", //默认启用
-        questionTypeNums: [
-          {
-            questionType: "SINGLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "MULTIPLE_ANSWER_QUESTION",
-            quantity: "",
-          },
-          {
-            questionType: "BOOL_ANSWER_QUESTION",
-            quantity: "",
-          },
-        ],
-      };
-      this.isShow = false;
-      this.button = false;
-    },
-    //取消
-    cancel() {
-      this.isShow = false;
-      this.button = false;
-      this.dialogModel = false;
-    },
-    //取消复用
-    cancleCopy() {
-      this.isShow = false;
-      this.dialogCopyModel = false;
-    },
-    //重置3
-    resetForm3() {
-      this.exportStructureCopy.examType = "";
-      this.exportStructureCopy.examId = "";
-      this.isShow = false;
-    },
-    //复用
-    copy(row) {
-      this.dialogCopyModel = true;
-      this.exportStructureCopy.examTypeOld = row.examType;
-      this.exportStructureCopy.examIdOld = parseInt(row.examId);
-      this.exportStructureCopy.exportTypeOld = row.exportType;
-      this.exportStructureCopy.questionTypeNums = row.questionTypeNums;
-      this.exportStructureCopy.examType = "";
-      this.exportStructureCopy.examId = "";
-    },
-    //新增的时候,先查询
-    searchExportStructure(type) {
-      this.disMessage = false;
-      if (type == "examType") {
-        this.$http
-          .get(
-            EXAM_WORK_API +
-              "/exam/queryByNameLike?enable=true&name=&examTypes=" +
-              this.exportStructure.examType
-          )
-          .then((response) => {
-            this.examListByExamType = response.data;
-            this.exportStructure.examId = "";
-            this.resetExportStructure();
-          });
-      }
-      if (this.exportStructure.examType && this.exportStructure.examId) {
-        var url =
-          QUESTION_API + "/findExportStructure/" + this.exportStructure.examId;
-        this.$http
-          .get(url)
-          .then((response) => {
-            console.log(response);
-            if (!response.data.id) {
-              //如果没有数据
-              this.resetExportStructure();
-            } else {
-              this.button = true;
-              this.exportStructure.exportType = response.data.exportType;
-              this.exportStructure.useable = response.data.useable
-                ? response.data.useable.toString()
-                : "1";
-              for (
-                var i = 0;
-                i < this.exportStructure.questionTypeNums.length;
-                i++
-              ) {
-                this.exportStructure.questionTypeNums[i].quantity =
-                  response.data.questionTypeNums[i].quantity;
-              }
-              this.disMessage = true;
-              console.log("非空对象");
-            }
-          })
-          .catch(() => {});
-      }
-    },
-    resetExportStructure() {
-      this.button = false;
-      this.reShow = true;
-      this.exportStructure.exportType = "";
-      this.exportStructure.useable = "1";
-      for (var i = 0; i < this.exportStructure.questionTypeNums.length; i++) {
-        this.exportStructure.questionTypeNums[i].quantity = "";
-      }
-    },
-    //点击复用,选择
-    searchExamId() {
-      if (this.exportStructureCopy.examType) {
-        this.$http
-          .get(
-            EXAM_WORK_API +
-              "/exam/queryByNameLike?enable=true&name=&examTypes=" +
-              this.exportStructureCopy.examType
-          )
-          .then((response) => {
-            let examListFilter = response.data;
-            var url =
-              QUESTION_API +
-              "/findExportStructureByExamType/" +
-              this.exportStructureCopy.examType;
-            this.$http.get(url).then((response) => {
-              let examListOld = response.data;
-              //两个数组相减
-              this.examListNew = _.filter(examListFilter, function (exam) {
-                return examListOld.indexOf(exam.id.toString()) == -1;
-              });
-            });
-          });
-      }
-    },
-    //保存复用
-    saveCopy() {
-      this.isShow = true;
-      if (this.check_value(this.exportStructureCopy.examType) === true) {
-        return false;
-      }
-      if (this.check_value(this.exportStructureCopy.examId) === true) {
-        return false;
-      }
-      this.exportStructure.examType = this.exportStructureCopy.examType;
-      this.exportStructure.examId = this.exportStructureCopy.examId;
-      this.exportStructure.exportType = this.exportStructureCopy.exportTypeOld;
-      this.exportStructure.useable = this.exportStructureCopy.useable;
-      this.exportStructure.questionTypeNums = this.exportStructureCopy.questionTypeNums;
-      let examId = this.exportStructure.examId;
-      this.exportStructure.examName = _.filter(
-        this.examListNew,
-        function (item) {
-          return item.id == examId;
-        }
-      )[0].name;
-      this.$http
-        .post(QUESTION_API + "/saveExportStructure", this.exportStructure)
-        .then(() => {
-          this.$notify({
-            title: "提示",
-            message: "保存成功",
-            type: "success",
-          });
-          this.dialogCopyModel = false;
-          this.search();
-        });
-    },
-    //删除
-    del(row) {
-      this.$confirm("是否删除该条导出结构", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      }).then(() => {
-        this.loading = true;
-        var url = QUESTION_API + "/deleteExportStructure/" + row.id;
-        this.$http.delete(url).then(
-          () => {
-            this.$notify({
-              type: "success",
-              message: "删除成功!",
-            });
-            this.loading = false;
-            this.search();
-          },
-          () => {
-            this.$notify({
-              type: "error",
-              message: "删除失败!",
-            });
-            this.loading = false;
-          }
-        );
-      });
-      this.loading = false;
-    },
-    //查询考试
-    getExams(query) {
-      query = query.trim();
-      var examType = this.formSearch.examType;
-      if (this.formSearch.examType == null) {
-        examType = "";
-      }
-      this.$http
-        .get(
-          EXAM_WORK_API +
-            "/exam/queryByNameLike?enable=true&name=" +
-            query +
-            "&examTypes=" +
-            examType
-        )
-        .then((response) => {
-          this.examList = response.data;
-        });
-    },
-    searchExams() {
-      this.formSearch.examId = null;
-      this.getExams("");
-    },
-  },
-};
-</script>
-<style scoped src="../styles/Common.css"></style>

+ 2 - 2
src/modules/questions/views/ExportTemplate.vue

@@ -290,7 +290,7 @@
   </section>
 </template>
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants.js";
+import { QUESTION_API } from "@/constants/constants.js";
 import { mapState } from "vuex";
 
 export default {
@@ -630,7 +630,7 @@ export default {
     init() {
       if (this.isSuperAdmin) {
         this.$httpWithMsg
-          .get(CORE_API + "/org/getRootOrgList")
+          .get(QUESTION_API + "/org/getRootOrgList")
           .then((response) => {
             this.rootOrgList = response.data;
           });

+ 0 - 903
src/modules/questions/views/ExtractPaperInfo.vue

@@ -1,903 +0,0 @@
-<template>
-  <section
-    v-loading="loading"
-    class="content"
-    element-loading-text="保存调卷规则及生成试卷文件中..."
-  >
-    <LinkTitlesCustom :current-paths="['考试管理', '调卷规则', '调卷详情']" />
-    <!-- 正文信息 -->
-    <div class="box-body">
-      <el-form
-        ref="extractPaperForm"
-        :inline="true"
-        :model="extractConfig"
-        label-position="right"
-        label-width="120px"
-      >
-        <el-row>
-          <el-form-item label="考试名称">
-            <el-select
-              v-model="extractConfig.examId"
-              filterable
-              clearable
-              placeholder="请选择"
-              :remote-method="getExams"
-              remote
-              :disabled="isInsert"
-              @change="getExamCourses"
-            >
-              <el-option
-                v-for="item in examList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="课程名称">
-            <el-select
-              v-model="extractConfig.courseCode"
-              filterable
-              clearable
-              placeholder="请选择"
-              :disabled="isInsert"
-              @change="getPaperTypeList"
-            >
-              <el-option
-                v-for="item in courseInfoSelect"
-                :key="item.courseNo"
-                :label="item.courseInfo"
-                :value="item.courseNo"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-row>
-
-        <el-tabs v-model="tabs">
-          <el-tab-pane label="步骤一:调卷模式选择" name="first">
-            <el-form-item prop="status">
-              <el-radio-group
-                v-model="extractConfig.callType"
-                class="pull_right_ss"
-              >
-                <el-radio label="WHOLE_SET">成套调用</el-radio>
-                <!-- <el-radio label="RESTRUCT">重组调用</el-radio> -->
-              </el-radio-group>
-            </el-form-item>
-          </el-tab-pane>
-        </el-tabs>
-        <el-tabs v-model="tabs">
-          <el-tab-pane label="步骤二:试卷抽取比例" name="first">
-            <el-row>
-              <el-col :span="24">
-                <el-tag v-if="extractConfig.examType === 'TRADITION'"
-                  >传统考试</el-tag
-                >
-                <el-tag v-if="extractConfig.examType === 'ONLINE'"
-                  >在线考试</el-tag
-                >
-                <el-tag v-if="extractConfig.examType === 'PRACTICE'"
-                  >练习考试</el-tag
-                >
-              </el-col>
-            </el-row>
-            <el-row v-for="(examPaper, num) in examPaperList" :key="num">
-              <el-col :span="24">
-                <el-form-item label="试卷类型" class="pull-left">
-                  <el-input
-                    v-model="examPaper.groupCode"
-                    class="input_width_lg"
-                    placeholder="请输入试卷类型"
-                    disabled
-                  ></el-input>
-                </el-form-item>
-                <el-button
-                  v-if="extractConfig.examType != 'TRADITION'"
-                  type="primary"
-                  @click="addOnLinePaper(examPaper.groupCode)"
-                  ><i class="el-icon-plus"></i> 新增试卷
-                </el-button>
-              </el-col>
-              <el-col
-                v-for="(paperInfo, index) in examPaper.paperInfoList"
-                :key="paperInfo.selectedPaperId"
-                :span="20"
-                :offset="2"
-              >
-                <el-form-item>
-                  <span>试卷选定</span>
-                  <el-select
-                    v-model="paperInfo.paper.id"
-                    filterable
-                    placeholder="请选择"
-                    class="select_width_lg"
-                    @change="searchAudioTimeConfig"
-                  >
-                    <el-option
-                      v-for="item in paperList"
-                      :key="item.id"
-                      :label="item.name"
-                      :value="item.id"
-                    >
-                    </el-option>
-                  </el-select>
-                  <span>选取几率</span>
-                  <span>
-                    <el-input
-                      v-model="paperInfo.weight"
-                      class="input_width_sms"
-                      :disabled="extractConfig.examType === 'TRADITION'"
-                    ></el-input
-                    >%
-                    <i
-                      v-if="index > 0"
-                      class="el-icon-delete"
-                      @click.prevent="
-                        removePaperInfo(examPaper.groupCode, paperInfo)
-                      "
-                    ></i> </span
-                  >&nbsp; <span :class="'errorMsg_' + num + '_' + index"></span>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-tab-pane>
-        </el-tabs>
-        <div>
-          <el-tabs v-model="tabs">
-            <el-tab-pane label="步骤三:随机设定" name="first">
-              <el-form-item
-                label="客观题小题乱序"
-                prop="scrambling_the_question_order"
-              >
-                <el-radio-group
-                  v-model="extractConfig.scrambling_the_question_order"
-                  class="pull_right_sm"
-                >
-                  <el-radio :label="1">开启</el-radio>
-                  <el-radio :label="0">关闭</el-radio>
-                </el-radio-group>
-              </el-form-item>
-              <br />
-              <el-form-item
-                label="客观题选项乱序"
-                prop="scrambling_the_option_order"
-              >
-                <el-radio-group
-                  v-model="extractConfig.scrambling_the_option_order"
-                  class="pull_right_sm"
-                >
-                  <el-radio :label="1">开启</el-radio>
-                  <el-radio :label="0">关闭</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-tab-pane>
-          </el-tabs>
-        </div>
-        <div v-show="extractConfig.examType != 'PRACTICE'" style="padding: 5px">
-          <el-tabs v-model="tabs">
-            <el-tab-pane label="步骤四:音频播放次数设置" name="first">
-              <el-row
-                v-show="audioTimeConfigList.length > 0"
-                class="row_header_word"
-              >
-                <el-col :span="4" :offset="1">试卷类型</el-col>
-                <el-col :span="4">试卷名称</el-col>
-                <el-col :span="3">大题号</el-col>
-                <el-col :span="3">小题号</el-col>
-                <el-col :span="4">播放次数</el-col>
-              </el-row>
-              <el-row
-                v-for="(audioTimeConfigInner, index) in audioTimeConfigList"
-                :key="index"
-                class="margin-top-10"
-              >
-                <el-col :span="4" :offset="1">
-                  {{ audioTimeConfigInner.groupCode }}
-                </el-col>
-                <el-col :span="4">
-                  {{ audioTimeConfigInner.paper.name }}
-                </el-col>
-                <el-col :span="3">
-                  {{ audioTimeConfigInner.paperDetailUnit.paperDetail.number }}
-                </el-col>
-                <el-col :span="3">
-                  {{ audioTimeConfigInner.paperDetailUnit.number }}
-                </el-col>
-                <el-col :span="4">
-                  <el-input
-                    v-model="audioTimeConfigInner.playTime"
-                    class="input_width_ss"
-                    size="small"
-                    >次
-                  </el-input>
-                </el-col>
-              </el-row>
-              <el-row v-show="audioTimeConfigList.length == 0">
-                <el-col :span="18" :offset="1"> 无音频试题 </el-col>
-              </el-row>
-            </el-tab-pane>
-          </el-tabs>
-        </div>
-        <div>
-          <el-tabs v-model="tabs">
-            <el-row>
-              <el-col>
-                <el-form-item label="是否生成文件">
-                  <el-radio-group v-model="isbuildFile">
-                    <el-radio label="1">是</el-radio>
-                    <el-radio label="0">否</el-radio>
-                  </el-radio-group>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row v-if="isbuildFile == '1'">
-              <el-form-item label="小题序号">
-                <el-radio-group v-model="seqMode" class="input">
-                  <el-radio label="MODE1">单题型连续</el-radio>
-                  <el-radio label="MODE2">客观题整体连续</el-radio>
-                  <el-radio label="MODE3">按大题独立</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-row>
-            <el-row :gutter="20">
-              <el-col :span="12" :offset="1">
-                <el-button type="primary" @click="submitForm"> 保存 </el-button>
-                <el-button type="primary" @click="back"
-                  ><i class="el-icon-arrow-left"></i> 返 回</el-button
-                >
-              </el-col>
-            </el-row>
-          </el-tabs>
-        </div>
-      </el-form>
-    </div>
-  </section>
-</template>
-<script>
-import { EXAM_WORK_API, QUESTION_API } from "@/constants/constants";
-import { mapState } from "vuex";
-import _ from "lodash";
-import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
-export default {
-  components: { LinkTitlesCustom },
-  data() {
-    return {
-      loading: false,
-      seqMode: "MODE1",
-      extractConfig: {
-        examId: "", //考试ID
-        examName: "", //考试名称
-        examType: "", //考试类型:网络考试、传统考试
-        courseCode: "", //课程代码
-        courseName: "", //课程名称
-        callType: "WHOLE_SET", //调卷类型:默认成套调用
-        examPaperList: [],
-        scrambling_the_question_order: 0, //小题乱序  默认关闭
-        scrambling_the_option_order: 0, //选项乱序  默认关闭
-      },
-      examPaperList: [],
-      audioTimeConfig: {
-        examId: "",
-        examName: "",
-        paper: {
-          id: "",
-        },
-        groupCode: "",
-        courseCode: "",
-        playTime: "",
-      },
-      audioTimeConfigModelList: [],
-      tabs: "first",
-      paperList: [],
-      isbuildFile: "0",
-      audioTimeConfigList: [],
-      paperName: "",
-      examList: [],
-      courseList: [],
-      courseAll: [],
-      isInsert: false,
-    };
-  },
-  computed: {
-    ...mapState({ user: (state) => state.user }),
-    courseInfoSelect() {
-      var courseList = [];
-      for (let course of this.courseList) {
-        var courseInfo = course.courseName + "(" + course.courseCode + ")";
-        courseList.push({
-          courseNo: course.courseCode,
-          courseName: course.courseName,
-          courseInfo: courseInfo,
-        });
-      }
-      return courseList;
-    },
-  },
-  //初始化
-  created: function () {
-    let extractConfigId = this.$route.params.extractConfigId;
-    //1.查询考试集合
-    this.getExams("");
-    if (extractConfigId) {
-      this.isInsert = true;
-      //规则ID存在,表示是修改操作
-      this.getExtractConfig(extractConfigId);
-    }
-  },
-  methods: {
-    //根据考务查询考试集合
-    getExams(query) {
-      query = query.trim();
-      this.$http
-        .get(
-          EXAM_WORK_API + "/exam/queryByNameLike?name=" + query + "&enable=true"
-        )
-        .then((response) => {
-          this.examList = response.data;
-        });
-    },
-    //根据考试查询课程
-    getExamCourses() {
-      if (!this.isInsert) {
-        this.extractConfig.courseCode = "";
-        this.courseList = [];
-        if (this.extractConfig.examId) {
-          //查询该考试下的课程
-          this.$http
-            .get(
-              QUESTION_API +
-                "/findCourseByExtractConfig/" +
-                this.extractConfig.examId
-            )
-            .then((response) => {
-              this.courseList = response.data;
-            });
-        }
-        //查询考试对象,获取考试类型:离线,在线,传统
-        if (this.extractConfig.examId) {
-          this.$http
-            .get(EXAM_WORK_API + "/exam/" + this.extractConfig.examId)
-            .then((response) => {
-              var exam = response.data;
-              this.extractConfig.examType = exam.examType;
-              this.extractConfig.examName = exam.name;
-            });
-        }
-      }
-    },
-    //根据考试ID和课程code取出试卷类型集合
-    getPaperTypeList() {
-      if (!this.isInsert) {
-        var id = "";
-        for (let course of this.courseList) {
-          if (this.extractConfig.courseCode == course.courseCode) {
-            id = course.courseId;
-            break;
-          }
-        }
-        this.$http
-          .get(
-            EXAM_WORK_API +
-              "/exam/queryExamCoursePaperTypeList?examId=" +
-              this.extractConfig.examId +
-              "&courseId=" +
-              id
-          )
-          .then((response) => {
-            let examPaperArr = response.data;
-            console.log("examPaperArr:", examPaperArr);
-            if (examPaperArr && examPaperArr.length > 0) {
-              let _examPaperList = [];
-              for (let examPaper of examPaperArr) {
-                let groupCode = examPaper.paperType;
-                let weight =
-                  this.extractConfig.examType == "TRADITION" ? 100 : "";
-                let examPaperListByGroupCode = this.getWeightFromExamPaperList(
-                  groupCode
-                );
-                if (examPaperListByGroupCode) {
-                  _examPaperList.push({
-                    groupCode: groupCode,
-                    paperInfoList: examPaperListByGroupCode,
-                  });
-                } else {
-                  _examPaperList.push({
-                    groupCode: groupCode,
-                    paperInfoList: [
-                      {
-                        weight: weight,
-                        paper: { id: "" },
-                      },
-                    ],
-                  });
-                }
-              }
-              this.examPaperList = _examPaperList;
-            }
-          });
-        this.getPaperList();
-      }
-    },
-    //根据groupCode得到examPaper集合
-    getWeightFromExamPaperList(groupCode) {
-      let examPaperListByGroupCode = [];
-      let examPaperList = this.extractConfig.examPaperList;
-      if (!examPaperList || examPaperList.length == 0) {
-        return null;
-      }
-      for (let examPaper of examPaperList) {
-        if (examPaper.groupCode == groupCode) {
-          examPaperListByGroupCode.push(examPaper);
-        }
-      }
-      return examPaperListByGroupCode;
-    },
-    //根据课程,查询试卷集合
-    getPaperList() {
-      if (this.extractConfig.courseCode) {
-        this.$http
-          .get(
-            QUESTION_API +
-              "/getGenPaper?courseNo=" +
-              this.extractConfig.courseCode
-          )
-          .then((response) => {
-            this.paperList = response.data;
-          });
-      }
-    },
-    //根据选择试卷集合查询音频题
-    searchAudioTimeConfig() {
-      this.audioTimeConfigModelList = [];
-      //取到数组里面每个对象
-      for (var i = 0; i < this.examPaperList.length; i++) {
-        //定一个试卷的集合,用来去重
-        var paperIds = [];
-        for (var j = 0; j < this.examPaperList[i].paperInfoList.length; j++) {
-          paperIds.push(this.examPaperList[i].paperInfoList[j].paper.id);
-        }
-        //对试卷集合进行去重
-        console.log("paperIds:", paperIds);
-        var ids = [];
-        ids = _.uniq(paperIds);
-        for (var k = 0; k < ids.length; k++) {
-          //把对象添加到集合
-          this.audioTimeConfigModelList.push({
-            courseCode: this.extractConfig.courseCode,
-            groupCode: this.examPaperList[i].groupCode,
-            paper: {
-              id: ids[k],
-            },
-            examId: this.extractConfig.examId,
-            examName: this.extractConfig.examName,
-          });
-        }
-      }
-      this.$http
-        .post(
-          QUESTION_API + "/audioTimeConfig/all",
-          this.audioTimeConfigModelList
-        )
-        .then((response) => {
-          this.audioTimeConfigList = response.data;
-        });
-    },
-    //增加在线考试试卷
-    addOnLinePaper(groupCode) {
-      let num = 0;
-      for (let i = 0; i < this.examPaperList.length; i++) {
-        if (this.examPaperList[i].groupCode == groupCode) {
-          num = i;
-          break;
-        }
-      }
-      this.examPaperList[num].paperInfoList.push({
-        weight: 0,
-        paper: {
-          id: "",
-        },
-      });
-    },
-    //删除试卷
-    removePaperInfo(groupCode, item) {
-      let num = 0;
-      for (let i = 0; i < this.examPaperList.length; i++) {
-        if (this.examPaperList[i].groupCode == groupCode) {
-          num = i;
-          break;
-        }
-      }
-      let index = this.examPaperList[num].paperInfoList.indexOf(item);
-      if (index !== -1) {
-        this.examPaperList[num].paperInfoList.splice(index, 1);
-      }
-      if (this.extractConfig.examType != "PRACTICE") {
-        //重新查询一次所有试卷的音频题数
-        this.searchAudioTimeConfig();
-      }
-    },
-    //保存提交
-    submitForm() {
-      this.saveExtractConfig();
-    },
-    //保存调卷规则
-    saveExtractConfig() {
-      if (!this.extractConfig.examId) {
-        this.$notify({
-          message: "请选择考试",
-          type: "error",
-        });
-        return false;
-      }
-      if (!this.extractConfig.courseCode) {
-        if (this.isInsert) {
-          this.$notify({
-            message:
-              "考务数据中,该场考试下已经没有这门课程,无法保存调卷规则。",
-            type: "error",
-          });
-        } else {
-          this.$notify({
-            message: "请选择课程",
-            type: "error",
-          });
-        }
-        return false;
-      }
-      if (this.extractConfig.examType != "PRACTICE") {
-        for (let audioTimeConfig of this.audioTimeConfigList) {
-          if (!this.checkValue(audioTimeConfig.playTime)) {
-            this.$notify({
-              message: "播放次数只能为整数",
-              type: "error",
-            });
-            return false;
-          }
-        }
-      }
-      let myExamPaperList = this.verificationData();
-      if (myExamPaperList.length > 0) {
-        this.loading = true;
-        this.extractConfig.examPaperList = myExamPaperList;
-        this.$http
-          .put(
-            QUESTION_API +
-              "/extractConfig" +
-              "/" +
-              this.isbuildFile +
-              "?seqMode=" +
-              this.seqMode,
-            this.extractConfig
-          )
-          .then(
-            () => {
-              if (this.extractConfig.examType != "PRACTICE") {
-                this.addAudioTimeConfig();
-              }
-              this.loading = false;
-              this.$notify({ type: "success", message: "保存成功" });
-              this.back();
-            },
-            (error) => {
-              this.loading = false;
-              this.$notify({
-                type: "error",
-                message: error.response.data.desc,
-              });
-            }
-          );
-      }
-    },
-    //音频播放次数校验
-    checkValue(val) {
-      if (/(^[0-9]\d*$)/.test(val)) {
-        return true;
-      } else {
-        return false;
-      }
-    },
-    //新增音频播放次数
-    addAudioTimeConfig() {
-      if (!this.audioTimeConfigList || this.audioTimeConfigList.length == 0) {
-        /* 未设置时则清理已存在的数据 */
-        this.$http
-          .post(
-            QUESTION_API +
-              "/deleteAudioTimeConfig/" +
-              this.extractConfig.examId +
-              "/" +
-              this.extractConfig.courseCode
-          )
-          .then(() => {});
-      } else {
-        this.$http
-          .post(
-            QUESTION_API +
-              "/addAudioTimeConfig?examId=" +
-              this.extractConfig.examId +
-              "&courseCode=" +
-              this.extractConfig.courseCode,
-            this.audioTimeConfigList
-          )
-          .then(() => {});
-      }
-    },
-    //校验调卷规则数据
-    verificationData() {
-      let myExamPaperList = [];
-      let examPaperList = this.examPaperList;
-      for (let i = 0; i < examPaperList.length; i++) {
-        let selectedPaperIds = []; //校验试卷重复性
-        let weightCount = 0; //校验概率之和
-        let _paperInfoList = examPaperList[i].paperInfoList;
-        let groupCode = examPaperList[i].groupCode;
-        if (!groupCode) {
-          this.$notify({
-            message: "试卷类型不能为空",
-            type: "error",
-            duration: 2000,
-          });
-          break;
-        }
-        for (let j = 0; j < _paperInfoList.length; j++) {
-          if (!_paperInfoList[j].paper.id) {
-            myExamPaperList = [];
-            // $(".errorMsg_" + i + "_" + j)
-            //   .text("试卷不能为空")
-            //   .show();
-            document.getElementsByClassName(
-              "errorMsg_" + i + "_" + j
-            )[0].innerHTML = "试卷不能为空";
-            document.getElementsByClassName(
-              "errorMsg_" + i + "_" + j
-            )[0].style.display = "inline";
-            break;
-          } else {
-            //$(".errorMsg_" + i + "_" + j).hide();
-            document.getElementsByClassName(
-              "errorMsg_" + i + "_" + j
-            )[0].style.display = "none";
-          }
-          var reg = /^([1]?\d{1,2})$/;
-          if (
-            !reg.test(_paperInfoList[j].weight) ||
-            _paperInfoList[j].weight == 0
-          ) {
-            myExamPaperList = [];
-            // $(".errorMsg_" + i + "_" + j)
-            //   .text("请输入1-100的整数")
-            //   .show();
-            document.getElementsByClassName(
-              "errorMsg_" + i + "_" + j
-            )[0].innerHTML = "请输入1-100的整数";
-            document.getElementsByClassName(
-              "errorMsg_" + i + "_" + j
-            )[0].style.display = "inline";
-            break;
-          } else {
-            //$(".errorMsg_" + i + "_" + j).hide();
-            if (document.getElementsByClassName("errorMsg_" + i + "_" + j)) {
-              document.getElementsByClassName(
-                "errorMsg_" + i + "_" + j
-              )[0].style.display = "none";
-            }
-            weightCount += parseInt(_paperInfoList[j].weight);
-            selectedPaperIds.push(_paperInfoList[j].paper.id);
-            myExamPaperList.push({
-              groupCode: groupCode,
-              paper: {
-                id: _paperInfoList[j].paper.id,
-              },
-              weight: _paperInfoList[j].weight,
-            });
-          }
-        }
-        if (myExamPaperList.length == 0) {
-          break;
-        } else {
-          if (_.uniq(selectedPaperIds).length != selectedPaperIds.length) {
-            myExamPaperList = [];
-            this.$notify({
-              message: "试卷选择不能重复",
-              type: "error",
-              duration: 2000,
-            });
-            break;
-          }
-          if (weightCount != 100) {
-            myExamPaperList = [];
-            this.$notify({
-              message: "试卷选取几率总和必须等于100",
-              type: "error",
-              duration: 2000,
-            });
-            break;
-          }
-        }
-      }
-      return myExamPaperList;
-    },
-    //返回
-    back() {
-      if (this.isInsert) {
-        this.$router.push({
-          path: "/questions/extract_paper_rule/1",
-        });
-      } else {
-        if (this.extractConfig.examId) {
-          sessionStorage.setItem(
-            "extract_config_add_examId",
-            this.extractConfig.examId
-          );
-          this.$router.push({
-            path: "/questions/extract_paper_rule/2",
-          });
-        } else {
-          this.$router.push({
-            path: "/questions/extract_paper_rule/0",
-          });
-        }
-      }
-    },
-    //修改调卷规则
-    getExtractConfig(extractConfigId) {
-      this.$http
-        .get(QUESTION_API + "/extractConfig/" + extractConfigId)
-        .then((response) => {
-          this.extractConfig = response.data;
-          //查询该考试下的课程
-          this.$http
-            .get(
-              EXAM_WORK_API +
-                "/exam/queryExamCourseList?examId=" +
-                this.extractConfig.examId +
-                "&enable=true&name=" +
-                this.extractConfig.courseCode
-            )
-            .then((response) => {
-              this.courseList = response.data;
-              if (!this.courseList || this.courseList.length < 1) {
-                this.$notify({
-                  message: "考务中,该场考试下面,没有设置课程!",
-                  type: "error",
-                });
-              } else {
-                //根据考试ID和课程code取出试卷类型集合
-                this.getPaperTypes();
-              }
-            });
-        });
-    },
-    //根据考试ID和课程code取出试卷类型集合
-    getPaperTypes() {
-      var id = "";
-      if (this.courseList && this.courseList.length > 0) {
-        for (let course of this.courseList) {
-          if (this.extractConfig.courseCode == course.courseCode) {
-            id = course.courseId;
-            break;
-          }
-        }
-        if (id != "") {
-          //查询该课程下的所有试卷
-          this.getPaperList();
-          this.$http
-            .get(
-              EXAM_WORK_API +
-                "/exam/queryExamCoursePaperTypeList?examId=" +
-                this.extractConfig.examId +
-                "&courseId=" +
-                id
-            )
-            .then((response) => {
-              let examPaperArr = response.data;
-              if (examPaperArr && examPaperArr.length > 0) {
-                let _examPaperList = [];
-                for (let examPaper of examPaperArr) {
-                  let groupCode = examPaper.paperType;
-                  let weight =
-                    this.extractConfig.examType == "TRADITION" ? 100 : "";
-                  let examPaperListByGroupCode = this.getWeightFromExamPaperList(
-                    groupCode
-                  );
-                  if (examPaperListByGroupCode) {
-                    _examPaperList.push({
-                      groupCode: groupCode,
-                      paperInfoList: examPaperListByGroupCode,
-                    });
-                  } else {
-                    _examPaperList.push({
-                      groupCode: groupCode,
-                      paperInfoList: [
-                        {
-                          weight: weight,
-                          paper: { id: "" },
-                        },
-                      ],
-                    });
-                  }
-                }
-                this.examPaperList = _examPaperList;
-                if (this.extractConfig.examType != "PRACTICE") {
-                  this.searchAddAudioTimeConfig();
-                }
-              }
-            });
-          this.getPaperList();
-        } else {
-          this.$notify({
-            message: "考务中,该场考试下面,没有设置该门课程!",
-            type: "error",
-          });
-        }
-      }
-    },
-    //存在调卷规则id,先查询
-    searchAddAudioTimeConfig() {
-      this.audioTimeConfigModelList = [];
-      //取到数组里面每个对象
-      for (var i = 0; i < this.examPaperList.length; i++) {
-        //定一个试卷的集合,用来去重
-        var paperIds = [];
-        for (var j = 0; j < this.examPaperList[i].paperInfoList.length; j++) {
-          paperIds.push(this.examPaperList[i].paperInfoList[j].paper.id);
-        }
-        //对试卷集合进行去重
-        var ids = [];
-        ids = _.uniq(paperIds);
-        for (var k = 0; k < ids.length; k++) {
-          //把对象添加到集合
-          this.audioTimeConfigModelList.push({
-            courseCode: this.extractConfig.courseCode,
-            groupCode: this.examPaperList[i].groupCode,
-            paper: {
-              id: ids[k],
-            },
-            examId: this.extractConfig.examId,
-            examName: this.extractConfig.examName,
-          });
-        }
-      }
-      this.$http
-        .post(
-          QUESTION_API + "/audioTimeConfig/update",
-          this.audioTimeConfigModelList
-        )
-        .then((response) => {
-          this.audioTimeConfigList = response.data;
-        });
-    },
-  },
-};
-</script>
-<style scoped>
-.pull_right_ss {
-  margin-left: 30px;
-}
-.paper_title_top {
-  margin-top: -10px;
-}
-.input_width_sms {
-  width: 80px;
-}
-.input_width_ss {
-  width: 50px;
-}
-.el-icon-delete {
-  cursor: pointer;
-}
-[class^="errorMsg_"] {
-  color: #ff4949;
-  display: none;
-}
-.margin-top-10 {
-  margin-top: 10px;
-}
-
-.select_width_lg {
-  width: 420px;
-}
-</style>
-<style scoped src="../styles/Common.css"></style>

+ 0 - 711
src/modules/questions/views/ExtractPaperRule.vue

@@ -1,711 +0,0 @@
-<template>
-  <section class="content">
-    <div v-show="isClear == 1">
-      <LinkTitlesCustom :current-paths="['考试管理', '调卷规则']" />
-    </div>
-    <!-- 正文信息 -->
-    <div class="box-body">
-      <el-form
-        :inline="true"
-        :model="formSearch"
-        label-position="right"
-        label-width="70px"
-      >
-        <el-row>
-          <el-col :span="6">
-            <el-form-item label="考试名称">
-              <el-select
-                v-model="formSearch.examId"
-                class="search_width"
-                filterable
-                :remote-method="getExams"
-                remote
-                clearable
-                placeholder="请选择"
-                size="small"
-                @change="getExamCourses"
-              >
-                <el-option
-                  v-for="item in examList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="课程名称">
-              <el-select
-                v-model="formSearch.courseNo"
-                class="search_width"
-                filterable
-                :remote-method="getCourses"
-                remote
-                clearable
-                placeholder="请选择"
-                size="small"
-                @focus="(e) => getCourses(e.target.value)"
-              >
-                <el-option
-                  v-for="item in courseInfoSelect"
-                  :key="item.courseNo"
-                  :label="item.courseInfo"
-                  :value="item.courseNo"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <div class="search_down">
-              <el-button size="small" type="primary" @click="searchFrom"
-                ><i class="el-icon-search"></i> 查询</el-button
-              >
-              <el-button size="small" type="primary" @click="markRules"
-                ><i class="el-icon-plus"></i> 新增</el-button
-              >
-            </div>
-          </el-col>
-        </el-row>
-        <div
-          style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0"
-        ></div>
-        <el-row>
-          <el-form-item>
-            <span>批量操作:</span>
-            <el-button size="small" type="primary" @click="openBatchExpDialog"
-              ><i class="el-icon-download"></i> 下载成卷
-            </el-button>
-          </el-form-item>
-        </el-row>
-      </el-form>
-      <div style="width: 100%; margin-bottom: 10px"></div>
-      <!-- 页面列表 -->
-      <el-table :data="tableData" border style="width: 100%">
-        <el-table-column label="考试名称" width="180">
-          <template slot-scope="scope">
-            <span>{{ scope.row.examName }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="考试类型">
-          <template slot-scope="scope">
-            <div class="el_table_inner_left">
-              <span v-show="scope.row.examType == 'ONLINE'">在线考试</span>
-              <span v-show="scope.row.examType == 'TRADITION'">传统考试</span>
-              <span v-show="scope.row.examType == 'PRACTICE'">练习考试</span>
-              <span v-show="scope.row.examType == 'OFFLINE'">离线考试</span>
-              <span v-show="scope.row.examType == 'PRINT_EXAM'"
-                >分布式印刷考试</span
-              >
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="课程名称">
-          <template slot-scope="scope">
-            <span>{{ scope.row.courseName }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="课程代码" width="140">
-          <template slot-scope="scope">
-            <span>{{ scope.row.courseCode }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="调卷类型">
-          <template slot-scope="scope">
-            <div class="el_table_inner_left">
-              <span v-show="scope.row.callType == 'WHOLE_SET'">成套调用</span>
-              <span v-show="scope.row.callType == 'RESTRUCT'">重组调用</span>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="调卷规则">
-          <template slot-scope="scope">
-            <span v-show="scope.row.id">
-              <el-tag type="success">已制定</el-tag>
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="180">
-          <template slot-scope="scope">
-            <div class="operate_left">
-              <el-button
-                v-if="scope.row.id"
-                size="mini"
-                type="primary"
-                plain
-                @click="updateRules(scope.row)"
-                ><i class="el-icon-edit"></i>编辑
-              </el-button>
-              <el-button
-                v-if="scope.row.ifFinish == 1"
-                size="mini"
-                type="primary"
-                plain
-                @click="openSingleExportPaperDialog(scope.row)"
-                ><i class="el-icon-download"></i> 下载
-              </el-button>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div class="page pull-right">
-        <el-pagination
-          :current-page="currentPage"
-          :page-size="pageSize"
-          :page-sizes="[10, 20, 50, 100, 200, 300]"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="total"
-          @current-change="handleCurrentChange"
-          @size-change="handleSizeChange"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <el-dialog title="导出" :visible.sync="exportDialog">
-      <el-form :model="exportModel" label-position="right" label-width="80px">
-        <el-row>
-          <el-col :md="24">
-            <el-form-item label="考试名称">
-              <el-select
-                v-model="exportModel.examId"
-                filterable
-                clearable
-                :disabled="
-                  exportDialog.exportWay == 'SINGLE' &&
-                  exportModel.courseCode != ''
-                "
-                @change="checkPaperStructure"
-              >
-                <el-option
-                  v-for="item in examList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row v-show="exportModel.courseId">
-          <el-col :md="24">
-            <el-form-item label="课程名称">
-              <el-input v-model="exportModel.courseName" disabled></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :md="24">
-            <el-form-item
-              v-if="exportModel.examType != 'PRINT_EXAM'"
-              label="导出内容"
-            >
-              <el-checkbox-group
-                v-if="exportModel.exportType == 'NORMAL'"
-                v-model="exportModel.exportContentList"
-              >
-                <el-checkbox label="PAPER" :disabled="paperDisabled"
-                  >试卷</el-checkbox
-                >
-                <el-checkbox label="ANSWER" :disabled="answerDisabled"
-                  >答案</el-checkbox
-                >
-                <el-checkbox
-                  label="PAPER_STRUCTURE_OBJECTIVE,PAPER_STRUCTURE_SUBJECTIVE"
-                  :disabled="structureDisabled"
-                  >试卷结构
-                </el-checkbox>
-              </el-checkbox-group>
-              <el-checkbox-group
-                v-if="exportModel.exportType == 'ONLINE'"
-                v-model="exportModel.exportContentList"
-              >
-                <el-checkbox
-                  label="COMPUTERTEST_PACKAGE"
-                  :disabled="onlineDisabled"
-                  >机考数据包
-                </el-checkbox>
-              </el-checkbox-group>
-            </el-form-item>
-            <el-form-item
-              v-if="exportModel.examType == 'PRINT_EXAM'"
-              label="导出内容"
-            >
-              <el-checkbox-group v-model="exportModel.exportContentList">
-                <el-checkbox label="PAPER" :disabled="paperDisabled"
-                  >试卷</el-checkbox
-                >
-                <el-checkbox label="ANSWER" :disabled="answerDisabled"
-                  >答案</el-checkbox
-                >
-                <el-checkbox
-                  v-if="isShowPrintExamPackage"
-                  label="PRINT_EXAM_PACKAGE"
-                  >分布式印刷数据包
-                </el-checkbox>
-                <el-input
-                  v-if="isShowPrintExamPackagePassword"
-                  v-model="printExamPackagePassword"
-                  placeholder="加密密码 (可选)"
-                  type="password"
-                  style="width: 150px"
-                ></el-input>
-              </el-checkbox-group>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :md="24" class="text-center">
-            <el-button type="primary" @click="exportPaperInfo"
-              >开始导出</el-button
-            >
-          </el-col>
-        </el-row>
-      </el-form>
-    </el-dialog>
-  </section>
-</template>
-
-<script>
-import { CORE_API, EXAM_WORK_API, QUESTION_API } from "@/constants/constants";
-import { LEVEL_TYPE } from "../constants/constants";
-import { mapState } from "vuex";
-import _ from "lodash";
-import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
-export default {
-  components: { LinkTitlesCustom },
-  data() {
-    return {
-      isClear: 0,
-      formSearch: {
-        examId: "",
-        courseNo: "",
-        courseName: "",
-      },
-      tableData: [],
-      currentPage: 1,
-      levelList: LEVEL_TYPE,
-      pageSize: 10,
-      total: 0,
-      examList: [], //考试list
-      courseList: [], //课程list
-      loading: false,
-      paperModels: "",
-      exportDialog: false,
-      exportModel: {
-        examType: "",
-        examId: "",
-        courseId: "",
-        courseName: "",
-        exportWay: "",
-        exportType: "NORMAL",
-        exportContentList: [],
-      },
-      paperDisabled: true,
-      answerDisabled: true,
-      structureDisabled: true,
-      onlineDisabled: true,
-      courseAllList: [],
-      isShowPrintExamPackage: false,
-      isShowPrintExamPackagePassword: false,
-      printExamPackagePassword: "",
-    };
-  },
-  computed: {
-    ...mapState({ user: (state) => state.user }),
-    courseInfoSelect() {
-      var courseList = [];
-      for (let course of this.courseList) {
-        var courseInfo = course.name + "(" + course.code + ")";
-        courseList.push({
-          courseNo: course.code,
-          courseName: course.name,
-          courseInfo: courseInfo,
-        });
-      }
-      return courseList;
-    },
-  },
-  watch: {
-    $route: "initVue",
-  },
-  created() {
-    this.initVue();
-  },
-  methods: {
-    //初始化
-    initialize(examId) {
-      this.examList = [];
-      //查询所有考试
-      this.$http.get(EXAM_WORK_API + "/exam/" + examId).then((response) => {
-        this.examList.push(response.data);
-        this.formSearch.examId = parseInt(examId);
-        this.searchRulePaper();
-      });
-    },
-    //查询列表
-    searchFrom() {
-      this.currentPage = 1;
-      this.searchRulePaper();
-    },
-    searchRulePaper() {
-      if (!this.formSearch.examId) {
-        this.$notify({
-          message: "请选择考试",
-          type: "warning",
-        });
-        return false;
-      }
-      this.loading = true;
-      let currentPage = this.currentPage;
-      this.currentPage = 1;
-      this.$http
-        .get(
-          QUESTION_API +
-            "/findPageExtractConfig/" +
-            currentPage +
-            "/" +
-            this.pageSize +
-            "?examId=" +
-            this.formSearch.examId +
-            "&courseNo=" +
-            this.formSearch.courseNo
-        )
-        .then((response) => {
-          this.tableData = response.data.content;
-          this.total = response.data.totalElements;
-          this.currentPage = Number(currentPage);
-          this.loading = false;
-        })
-        .catch((error) => {
-          this.loading = false;
-          this.$notify({
-            message: error.response.data.desc,
-            type: "error",
-          });
-          this.tableData = [];
-          this.total = 0;
-        });
-    },
-    //分页
-    handleCurrentChange(val) {
-      this.currentPage = val;
-      this.searchRulePaper();
-    },
-    handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.searchRulePaper();
-    },
-    //制定调卷规则
-    markRules() {
-      sessionStorage.setItem("extract_paper_examId", this.formSearch.examId);
-      this.$router.push({
-        name: "extract_paper_info_add",
-      });
-    },
-    getCourseName(courseNo) {
-      for (let course of this.courseList) {
-        if (course.code == courseNo) {
-          this.formSearch.courseName = course.name;
-        }
-      }
-    },
-    //编辑调卷规则
-    updateRules(row) {
-      this.getCourseName(this.formSearch.courseNo);
-      sessionStorage.setItem("extract_paper_examId", row.examId);
-      sessionStorage.setItem(
-        "extract_paper_courseNo",
-        this.formSearch.courseNo
-      );
-      sessionStorage.setItem(
-        "extract_paper_courseName",
-        this.formSearch.courseName
-      );
-      sessionStorage.setItem("extract_paper_currentPage", this.currentPage);
-      this.$router.push({
-        name: "extract_paper_info_edit",
-        params: { extractConfigId: row.id },
-      });
-    },
-    openSingleExportPaperDialog(row) {
-      this.exportModel = {
-        examType: row.examType,
-        examId: row.examId,
-        examName: row.examName,
-        courseId: row.courseCode,
-        courseName: row.courseName,
-        exportType: "NORMAL",
-        exportWay: "SINGLE",
-        exportContentList: [],
-      };
-      this.checkPaperStructure();
-      this.exportDialog = true;
-      /* 分布式印刷数据包设置 */
-      //this.exportModel.examType = 'PRINT_EXAM';//todo
-      this.isShowPrintExamPackage = true;
-      this.isShowPrintExamPackagePassword = false;
-      this.printExamPackagePassword = "";
-    },
-    openBatchExpDialog() {
-      this.exportModel = {
-        examType: "",
-        examId: "",
-        examName: "",
-        courseId: "",
-        courseName: "",
-        exportType: "NORMAL",
-        exportWay: "BATCH",
-        exportContentList: [],
-      };
-      this.resetDisabled();
-      this.exportDialog = true;
-      /* 分布式印刷数据包设置 */
-      this.isShowPrintExamPackage = false;
-      this.isShowPrintExamPackagePassword = false;
-      this.printExamPackagePassword = "";
-    },
-    checkPaperStructure() {
-      if (!this.exportModel.examId) {
-        return false;
-      }
-      this.exportModel.exportContentList = [];
-      let examFile = {
-        examId: this.exportModel.examId,
-        courseId: this.exportModel.courseId ? this.exportModel.courseId : null,
-      };
-      this.resetDisabled();
-      this.$http
-        .post(QUESTION_API + "/findExamFile", examFile)
-        .then((response) => {
-          let examFiles = response.data;
-          if (examFiles != null && examFiles.length > 0) {
-            this.paperDisabled = this.isDisabled(examFiles, "PAPER");
-            this.answerDisabled = this.isDisabled(examFiles, "ANSWER");
-            this.onlineDisabled = this.isDisabled(
-              examFiles,
-              "COMPUTERTEST_PACKAGE"
-            );
-
-            this.$http
-              .get(
-                QUESTION_API + "/findExportStructure/" + this.exportModel.examId
-              )
-              .then((response) => {
-                this.exportModel.exportType = response.data
-                  ? response.data.exportType
-                  : "NORMAL";
-                this.structureDisabled = !response.data;
-                if (this.exportModel.exportWay == "SINGLE") {
-                  this.structureDisabled = this.isDisabled(
-                    examFiles,
-                    "PAPER_STRUCTURE_OBJECTIVE"
-                  );
-                }
-              });
-          } else {
-            this.resetDisabled();
-          }
-        });
-    },
-    isDisabled(examFiles, fileType) {
-      return (
-        _.filter(examFiles, function (examFile) {
-          return examFile.examFileType == fileType;
-        }).length == 0
-      );
-    },
-    resetDisabled() {
-      this.paperDisabled = true;
-      this.answerDisabled = true;
-      this.structureDisabled = true;
-      this.onlineDisabled = true;
-    },
-    exportPaperInfo() {
-      let examId = this.exportModel.examId;
-      let courseId = this.exportModel.courseId;
-      let exportWay = this.exportModel.exportWay;
-      if (!examId) {
-        this.$notify({
-          message: "请选择考试",
-          type: "error",
-        });
-        return false;
-      }
-      if (this.exportModel.exportContentList.length == 0) {
-        this.$notify({
-          message: "请选择导出内容",
-          type: "error",
-        });
-        return false;
-      }
-      if (this.printExamPackagePassword.length > 0) {
-        var reg = /^[0-9A-Za-z]{6,12}$/;
-        if (!reg.test(this.printExamPackagePassword)) {
-          this.$notify({
-            message: "加密密码请输入6至12位的数字或字母!",
-            type: "error",
-          });
-          return false;
-        }
-      }
-      let exportContentList = this.exportModel.exportContentList.toString();
-      var key = this.user.key;
-      var token = this.user.token;
-      this.$http
-        .get(
-          QUESTION_API +
-            "/exportBatchExamPaperInfoCheck/" +
-            exportWay +
-            "/" +
-            examId +
-            "?$key=" +
-            key +
-            "&$token=" +
-            token
-        )
-        .then(
-          (response) => {
-            console.log(response);
-            if (response.data) {
-              this.$notify({
-                message: response.data.desc,
-                type: "error",
-              });
-            } else {
-              var key = this.user.key;
-              var token = this.user.token;
-              if (exportWay == "SINGLE") {
-                window.location.href =
-                  QUESTION_API +
-                  "/exportSingleExamPaperInfo/" +
-                  this.user.rootOrgId +
-                  "/" +
-                  exportWay +
-                  "/" +
-                  examId +
-                  "/" +
-                  courseId +
-                  "/" +
-                  exportContentList +
-                  "/" +
-                  this.user.displayName +
-                  "?psw=" +
-                  this.printExamPackagePassword +
-                  "&$key=" +
-                  key +
-                  "&$token=" +
-                  token;
-              } else if (exportWay == "BATCH") {
-                window.location.href =
-                  QUESTION_API +
-                  "/exportBatchExamPaperInfo/" +
-                  this.user.rootOrgId +
-                  "/" +
-                  exportWay +
-                  "/" +
-                  examId +
-                  "/" +
-                  exportContentList +
-                  "/" +
-                  this.user.displayName +
-                  "?$key=" +
-                  key +
-                  "&$token=" +
-                  token;
-              }
-            }
-          },
-          (error) => {
-            this.$notify({
-              message: error.response.data.desc,
-              type: "error",
-            });
-          }
-        );
-    },
-    removeItem() {
-      sessionStorage.removeItem("extract_paper_currentPage");
-      sessionStorage.removeItem("extract_paper_examId");
-      sessionStorage.removeItem("extract_paper_courseNo");
-    },
-    //查询所有课程
-    getCourses(query) {
-      query = query.trim();
-      this.courseLoading = true;
-      this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
-        .then((response) => {
-          this.courseList = response.data;
-          console.log("this.courseList:", this.courseList);
-          this.courseLoading = false;
-        });
-    },
-    //查询考试
-    getExams(query) {
-      query = query.trim();
-      this.$http
-        .get(
-          EXAM_WORK_API + "/exam/queryByNameLike?name=" + query + "&enable=true"
-        )
-        .then((response) => {
-          this.examList = response.data;
-        });
-    },
-    //清空课程列表
-    getExamCourses() {
-      this.formSearch.courseNo = "";
-    },
-    initVue() {
-      this.isClear = this.$route.params.isClear;
-      if (this.isClear == 0 || !this.isClear) {
-        this.removeItem();
-        //查询所有考试
-        this.getExams("");
-        this.formSearch = {
-          examId: "",
-          courseNo: "",
-          courseName: "",
-        };
-        this.currentPage = 1;
-      } else if (this.isClear == 2) {
-        this.formSearch.examId =
-          sessionStorage.getItem("extract_config_add_examId") == ""
-            ? ""
-            : parseInt(sessionStorage.getItem("extract_config_add_examId"));
-        if (this.formSearch.examId) {
-          this.initialize(this.formSearch.examId);
-        }
-        this.currentPage = 1;
-      } else {
-        this.formSearch.courseNo =
-          sessionStorage.getItem("extract_paper_courseNo") == "null"
-            ? ""
-            : sessionStorage.getItem("extract_paper_courseNo");
-        this.formSearch.courseName =
-          sessionStorage.getItem("extract_paper_courseName") == "null"
-            ? ""
-            : sessionStorage.getItem("extract_paper_courseName");
-        this.formSearch.examId =
-          sessionStorage.getItem("extract_paper_examId") == ""
-            ? ""
-            : parseInt(sessionStorage.getItem("extract_paper_examId"));
-        this.currentPage =
-          sessionStorage.getItem("extract_paper_currentPage") == null
-            ? 1
-            : parseInt(sessionStorage.getItem("extract_paper_currentPage"));
-        if (this.formSearch.examId) {
-          this.initialize(this.formSearch.examId);
-        }
-        if (this.formSearch.courseName) {
-          this.getCourses(this.formSearch.courseName);
-        }
-      }
-    },
-  },
-};
-</script>
-<style scoped src="../styles/Common.css"></style>

+ 3 - 116
src/modules/questions/views/GenPaper.vue

@@ -337,57 +337,6 @@
       </el-form>
     </el-dialog>
 
-    <el-dialog title="传送印刷平台" :visible.sync="dialogModel" width="500px">
-      <el-form
-        ref="printFrom"
-        :model="printFrom"
-        :rules="rules"
-        label-position="right"
-        label-width="120px"
-        inline-message
-      >
-        <el-row>
-          <el-form-item label="学校名称">
-            <el-input
-              v-model="Org.name"
-              class="dialog_input_width"
-              :disabled="true"
-            ></el-input>
-          </el-form-item>
-        </el-row>
-        <el-row>
-          <el-form-item label="考试名称" prop="examId">
-            <el-select
-              v-model="printFrom.examId"
-              class="dialog_input_width"
-              filterable
-              clearable
-              :remote-method="getExams"
-              remote
-              placeholder="请选择"
-            >
-              <el-option
-                v-for="item in examList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-row>
-        <el-row class="margin_top_10 margin_left_120">
-          <el-button type="primary" @click="sendPrint('printFrom')"
-            >保 存</el-button
-          >
-          <el-button @click="resetForm2('printFrom')"
-            ><i class="el-icon-refresh"></i> 重 置</el-button
-          >
-          <el-button type="primary" @click="cancel('printFrom')"
-            ><i class="el-icon-arrow-left"></i> 返 回</el-button
-          >
-        </el-row>
-      </el-form>
-    </el-dialog>
     <el-dialog
       title="属性修改"
       :visible.sync="quesPropertyDialog"
@@ -457,7 +406,7 @@
 </template>
 
 <script>
-import { CORE_API, QUESTION_API, EXAM_WORK_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import { LEVEL_TYPE, PUBLICITY_LIST } from "../constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
@@ -570,7 +519,6 @@ export default {
   },
   created() {
     this.initVue();
-    this.searchExamList();
     this.searchOrgName();
   },
   methods: {
@@ -782,7 +730,7 @@ export default {
       }
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;
@@ -901,71 +849,10 @@ export default {
       this.printFrom.examId = "";
       this.$refs[formData].clearValidate();
     },
-    //传至印刷模块
-    sendPrint(formData) {
-      this.$refs[formData].validate((valid) => {
-        if (valid) {
-          var orgId = "";
-          for (let exam of this.examList) {
-            if (exam.id == this.printFrom.examId) {
-              orgId = exam.rootOrgId;
-            }
-          }
-          if (orgId != "" || orgId == "0") {
-            for (let printPid of this.rowIds) {
-              this.$http.get(
-                QUESTION_API +
-                  "/sendPrint/" +
-                  printPid +
-                  "/" +
-                  this.printFrom.examId +
-                  "/" +
-                  orgId
-              );
-            }
-            this.$notify({
-              message: "已推送",
-              type: "success",
-            });
-            this.resetForm2(formData);
-            this.dialogModel = false;
-            this.rowIds = [];
-          }
-        } else {
-          return false;
-        }
-      });
-    },
-    //查询考试
-    getExams(query) {
-      if (query) {
-        query = query.trim();
-      }
-      this.$http
-        .get(
-          EXAM_WORK_API + "/exam/queryByNameLike?name=" + query + "&enable=true"
-        )
-        .then((response) => {
-          this.examList = response.data;
-        });
-    },
-    searchExamList() {
-      //查询所有考试
-      this.$http
-        .get(EXAM_WORK_API + "/exam/queryByNameLike?name=&enable=true")
-        .then((response) => {
-          var list = response.data;
-          for (var i = 0; i < list.length; i++) {
-            if (list[i].examType == "TRADITION") {
-              this.examList.push(list[i]);
-            }
-          }
-        });
-    },
     //根据orgId查询学校名称
     searchOrgName() {
       this.$http
-        .get(CORE_API + "/org/rootOrg/" + this.user.rootOrgId)
+        .get(QUESTION_API + "/org/rootOrg/" + this.user.rootOrgId)
         .then((response) => {
           this.Org = response.data;
         });

+ 2 - 2
src/modules/questions/views/GenPaperDetail.vue

@@ -737,7 +737,7 @@
 </template>
 
 <script>
-import { QUESTION_API, CORE_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import { mapState } from "vuex";
 export default {
   data() {
@@ -808,7 +808,7 @@ export default {
   created() {
     this.genPaper.courseNo = this.$route.params.courseNo;
     var url =
-      CORE_API +
+      QUESTION_API +
       "/course/byCode?" +
       "rootOrgId=" +
       this.user.rootOrgId +

+ 2 - 2
src/modules/questions/views/ImportPaper.vue

@@ -393,7 +393,7 @@
 </template>
 
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import { LEVEL_TYPE, PUBLICITY_LIST } from "../constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
@@ -594,7 +594,7 @@ export default {
     getCourses(query) {
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;

+ 2 - 2
src/modules/questions/views/ImportPaperInfo.vue

@@ -122,7 +122,7 @@
   </section>
 </template>
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
@@ -296,7 +296,7 @@ export default {
       query = query.trim();
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;

+ 2 - 2
src/modules/questions/views/InsertBluePaperStructure.vue

@@ -231,7 +231,7 @@
 </template>
 <script>
 import { QUESTION_TYPES } from "../constants/constants";
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import ckeditor from "../component/ckeditor.vue";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
@@ -632,7 +632,7 @@ export default {
       query = query.trim();
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;

+ 2 - 2
src/modules/questions/views/InsertPaperStructure.vue

@@ -208,7 +208,7 @@
 </template>
 
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import ckeditor from "../component/ckeditor.vue";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
@@ -550,7 +550,7 @@ export default {
         if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
           this.courseLoading = true;
           this.$http
-            .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+            .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
             .then((response) => {
               this.courseList = response.data;
               this.courseLoading = false;

+ 2 - 2
src/modules/questions/views/InsertPaperTitle.vue

@@ -132,7 +132,7 @@
   </section>
 </template>
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import { mapState } from "vuex";
 export default {
   data() {
@@ -242,7 +242,7 @@ export default {
       query = query.trim();
       this.courseLoading = true;
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           this.courseLoading = false;

+ 2 - 2
src/modules/questions/views/PaperStructure.vue

@@ -168,7 +168,7 @@
 </template>
 
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
   components: { LinkTitlesCustom },
@@ -360,7 +360,7 @@ export default {
         if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
           this.courseLoading = true;
           this.$http
-            .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+            .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
             .then((response) => {
               this.courseList = response.data;
               this.courseLoading = false;

+ 2 - 2
src/modules/questions/views/PropertyInfo.vue

@@ -147,7 +147,7 @@
 </template>
 
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
 export default {
   components: { LinkTitlesCustom },
@@ -233,7 +233,7 @@ export default {
       this.courseList = [];
       if (query) {
         this.courseLoading = true;
-        this.$http.get(CORE_API + "/course/" + query).then((response) => {
+        this.$http.get(QUESTION_API + "/course/" + query).then((response) => {
           var courseBean = response.data;
           this.courseList.push(courseBean);
         });

+ 2 - 2
src/modules/questions/views/Question.vue

@@ -339,7 +339,7 @@
   </section>
 </template>
 <script>
-import { CORE_API, QUESTION_API } from "@/constants/constants";
+import { QUESTION_API } from "@/constants/constants";
 import { QUESTION_TYPES, LEVEL_TYPE } from "../constants/constants";
 export default {
   data() {
@@ -564,7 +564,7 @@ export default {
     //查询所有课程
     getCourses(query) {
       this.$http
-        .get(CORE_API + "/course/query?name=" + query + "&enable=true")
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
         .then((response) => {
           this.courseList = response.data;
           if (this.formSearch.courseNo) {

+ 1 - 1
src/modules/questions/views/School.vue

@@ -1,7 +1,7 @@
 <template>
   <section class="content">
     <div
-      v-loading.fullscreen="loading"
+      v-loading.body="loading"
       class="box-body"
       element-loading-text="请稍后..."
     >