Преглед на файлове

对接部分接口,完善页面

yellowtaotao преди 4 години
родител
ревизия
1adb11b97d

+ 3 - 1
src/api/modules/answerManagement.js

@@ -1,7 +1,9 @@
 /* JTXT系统相关api */
 export default {
   API_LIST_ANSWER_MANAGEMENT: {
-    // 创建每日、每周、专项答题规则
+    // 创建每日、每周答题规则
     INTERFACE_POST_ANSWER_RULE_ADD: 'question-rules',
+    // 创建专项答题
+    INTERFACE_POST_ANSWER_RULE_ADD_SPECIAL: 'special-questions',
   }
 };

+ 0 - 1
src/router/common/common.js

@@ -6,7 +6,6 @@ export default [
     path: "/",
     component: layout,
     redirect: "/home",
-    // redirect: "/login",
     children: [
       {
         path: "home",

+ 2 - 0
src/styles/components/index.less

@@ -8,6 +8,8 @@
 .app-container {
   width: 100%;
   height: 100%;
+  overflow-y: auto;
+  overflow-x: hidden;
   .company-info {
     height: 80px;
     display: flex;

+ 0 - 2
src/views/Home.vue

@@ -337,8 +337,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
-  overflow-x: hidden;
   .count-basic-data {
     display: flex;
     .count-basic-data-item {

+ 8 - 0
src/views/answerManagement/answerManagementDay.vue

@@ -135,6 +135,14 @@ export default {
     },
     // 操作:点击提交按钮
     handleSubmitFun() {
+      if (
+        !this.questionsNum ||
+        isNaN(this.questionsNum) ||
+        !Number(this.questionsNum)
+      ) {
+        this.$message.error('请输入大于零的试题数量(数字)');
+        return;
+      }
       let findCondition = this.formatQuestionTypeConditionChooseValue(
         this.checkedQuestionTypeConditionChildren
       ); // 获取试题类型信息-子类

+ 456 - 40
src/views/answerManagement/answerManagementSpecial.vue

@@ -5,8 +5,8 @@
         <div class="basic-information-title">基本信息</div>
         <div class="basic-information-form">
           <a-form
-            :form="anserRuleSpecialForm"
-            @submit="handleSubmitFun"
+            :form="anserRuleSpecialBasicForm"
+            @submit="handleSubmitBasicFun"
             style="width: 515px;"
             :loading="loading"
             :label-col="labelCol"
@@ -31,7 +31,8 @@
                 v-decorator="[
                   'engineeringWorkChooseValue',
                   {
-                    rules: [{ required: true, message: '请选择工种类别!' }],
+                    initialValue: engineeringWork,
+                    rules: [{ message: '请选择工种类别!' }],
                   },
                 ]"
               >
@@ -43,9 +44,159 @@
                 >
               </a-select>
             </a-form-item>
+            <a-form-item v-show="false">
+              <a-button
+                id="answerManagementSpecialBasic"
+                type="primary"
+                html-type="submit"
+                >提交</a-button
+              >
+            </a-form-item>
           </a-form>
         </div>
       </div>
+      <div class="common-card a-card-margin-top basic-information-box">
+        <div class="basic-information-title">出题范围</div>
+        <div class="basic-information-form">
+          <div class="answer-select-div">
+            <div class="create-select-item">
+              <span>父类:</span>
+              <a-select
+                v-model="typeConditionParentValue"
+                @change="selectTypeConditionParent"
+              >
+                <a-select-option
+                  v-for="(item, index) in typeConditionParentList"
+                  :key="index"
+                  :value="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </div>
+            <div class="create-select-item">
+              <span>子类:</span>
+              <a-select
+                v-model="typeConditionChildrenValue"
+                :disabled="!typeConditionParentValue"
+              >
+                <a-select-option
+                  v-for="(item, index) in typeConditionChildrenList"
+                  :key="index"
+                  :value="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </div>
+          </div>
+        </div>
+        <div class="basic-information-title">出题数量</div>
+        <div class="basic-information-form">
+          <a-form
+            :form="anserRuleSpecialNumForm"
+            @submit="handleSubmitAreaFun"
+            style="width: 515px;"
+            :loading="loading"
+            :label-col="labelCol"
+            :wrapper-col="{ span: 7 }"
+          >
+            <a-form-item label="单选题">
+              <a-input
+                placeholder="请输入单选题数量"
+                :maxLength="3"
+                type="number"
+                v-decorator="[
+                  'singleNum',
+                  {
+                    rules: [{ required: true, message: '请输入单选题数量!' }],
+                  },
+                ]"
+              />
+            </a-form-item>
+            <a-form-item label="多选题">
+              <a-input
+                placeholder="请输入多选题数量"
+                :maxLength="3"
+                type="number"
+                v-decorator="[
+                  'multiNum',
+                  {
+                    rules: [{ required: true, message: '请输入多选题数量!' }],
+                  },
+                ]"
+              />
+            </a-form-item>
+            <a-form-item label="判断题">
+              <a-input
+                placeholder="请输入判断题数量"
+                :maxLength="3"
+                type="number"
+                v-decorator="[
+                  'trueFalseNum',
+                  {
+                    rules: [{ required: true, message: '请输入判断题数量!' }],
+                  },
+                ]"
+              />
+            </a-form-item>
+            <a-form-item label="填空题">
+              <a-input
+                placeholder="请输入填空题数量"
+                :maxLength="3"
+                type="number"
+                v-decorator="[
+                  'gapFillingNum',
+                  {
+                    rules: [{ required: true, message: '请输入填空题数量!' }],
+                  },
+                ]"
+              />
+            </a-form-item>
+            <a-form-item :label-col="labelCol" :wrapper-col="{ span: 24 }">
+              <div class="submit-row">
+                <a-button type="primary" html-type="submit">提交</a-button>
+              </div>
+            </a-form-item>
+          </a-form>
+        </div>
+      </div>
+      <div class="common-card a-card-margin-top">
+        <!-- 表单 -->
+        <a-table
+          :columns="current_columns"
+          :data-source="current_tableData"
+          :row-key="(record) => record.id"
+          :pagination="current_pagination"
+          @change="handleCurrentTableChangePage"
+        >
+          <template slot="questionCategory" slot-scope="text, record">
+            <span>{{
+              record.questionCategory ? record.questionCategory.name : '不限'
+            }}</span>
+          </template>
+          <template slot="rootQuestionCategory" slot-scope="text, record">
+            <span>{{
+              record.rootQuestionCategory
+                ? record.rootQuestionCategory.name
+                : '不限'
+            }}</span>
+          </template>
+          <template slot="action" slot-scope="text, record">
+            <a @click="toQuestionDetailFun(record)">详情</a>
+            <!-- <a-divider type="vertical" />
+            <a @click="deleteCurrentTableQuestionFun(record)">删除</a> -->
+          </template>
+        </a-table>
+        <div class="submit-row-add">
+          <a-button
+            type="primary"
+            :disabled="!current_tableData || !current_tableData.length"
+            @click="handleSubmitAll"
+            >发布</a-button
+          >
+        </div>
+      </div>
     </a-spin>
     <div class="company-info">
       <span>
@@ -56,9 +207,12 @@
 </template>
 
 <script>
-import { formatePathParams } from '@/filters';
+import { formatePathParams, formateUrlParams } from '@/filters';
 import { mapGetters } from 'vuex';
-import { ANSWER_MANAGEMENT_RULE_TYPE } from '@/common/Constant';
+import {
+  ANSWER_MANAGEMENT_RULE_TYPE,
+  EXAM_QUESTION_TYPE,
+} from '@/common/Constant';
 export default {
   name: 'answerManagementSpecial',
   props: {},
@@ -66,18 +220,37 @@ export default {
   data() {
     return {
       loading: false, // 是否显示加载动画
-      anserRuleSpecialForm: this.$form.createForm(this, {
-        name: 'answerManagementSpecial',
+      anserRuleSpecialBasicForm: this.$form.createForm(this, {
+        name: 'answerManagementSpecialBasic',
+      }),
+      anserRuleSpecialNumForm: this.$form.createForm(this, {
+        name: 'answerManagementSpecialNum',
       }),
       // 基础信息的表单
       labelCol: { span: 6 }, // 表单行中label的占位
       wrapperCol: { span: 18 }, // 表单行中内容的占位
       engineeringWorkList: [], // 工种数据列表
-      questionTypeConditionParent: [], // 试题类型列表-父类
-      checkedQuestionTypeConditionParent: '', // 所选试题类型-父类
-      questionTypeConditionChildren: [], // 试题类型列表-子类
-      checkedQuestionTypeConditionChildren: '', // 所选试题类型-子类
-      questionsNum: '', // 试题数量
+      engineeringWork: '', // 工种默认值
+      specialName: '',
+      bank_questionType: [], // 试题类别列表
+      typeConditionParentList: [], // 试题类型列表-父类
+      typeConditionParentValue: '', // 所选试题类型-父类
+      typeConditionChildrenList: [], // 试题类型列表-子类
+      typeConditionChildrenValue: '', // 所选试题类型-子类
+      questionInfo: {
+        singleNum: '', // 单选题数量
+        multiNum: '', // 多选题数量
+        trueFalseNum: '', // 判断题数量
+        gapFillingNum: '', // 填空题数量
+      }, // 试题数量信息
+      // 当前试题列表
+      current_columns: [], // form表单的列参数
+      current_tableData: [], // 表单数据
+      current_pagination: {
+        pageSize: 7,
+        current: 1,
+        total: 0,
+      }, // 分页参数
     };
   },
   created() {
@@ -96,24 +269,84 @@ export default {
     //初始化数据
     initDataFun() {
       // 工种类别
-      this.engineeringWorkList = this.GET_ENGINEERING_WORK_LIST;
+      this.engineeringWorkList = [
+        { name: '不限', id: '' },
+        ...this.GET_ENGINEERING_WORK_LIST,
+      ];
       this.engineeringWork = this.engineeringWorkList[0].id;
       // 试题类型列表-父类
-      this.questionTypeConditionParent = [
+      this.typeConditionParentList = [
         { name: '不限', id: '' },
         ...this.GET_EXAM_QUESTION_TYPE_CONDITION_PARENT,
       ];
+      this.typeConditionParentValue = this.typeConditionParentList[0].id;
+
+      // 试题类别
+      this.bank_questionType = [
+        { name: '全部', code: '' },
+        ...EXAM_QUESTION_TYPE,
+      ];
+
+      // 表单的列的配置参数
+      this.current_columns = [
+        {
+          title: '试题编号',
+          dataIndex: 'id',
+          key: 'id',
+          width: 240,
+        },
+        {
+          title: '试题',
+          dataIndex: 'content',
+          key: 'content',
+        },
+        {
+          title: '试题类别',
+          dataIndex: 'typeTxt',
+          key: 'typeTxt',
+          scopedSlots: { customRender: 'typeTxt' },
+          width: 100,
+        },
+        {
+          title: '试题父类',
+          dataIndex: 'questionCategory',
+          key: 'questionCategory',
+          scopedSlots: { customRender: 'questionCategory' },
+          width: 150,
+        },
+        {
+          title: '试题子类',
+          dataIndex: 'rootQuestionCategory',
+          key: 'rootQuestionCategory',
+          scopedSlots: { customRender: 'rootQuestionCategory' },
+          width: 150,
+        },
+        {
+          title: '工种',
+          dataIndex: 'engineerTypeTxt',
+          key: 'engineerTypeTxt',
+          scopedSlots: { customRender: 'engineerTypeTxt' },
+          width: 100,
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          key: 'action',
+          scopedSlots: { customRender: 'action' },
+          width: 150,
+        },
+      ];
     },
     // 查询:试题类型列表-子类
     getTableChildrenListFun() {
-      if (!this.checkedQuestionTypeConditionParent) {
-        this.checkedQuestionTypeConditionChildren = '';
-        this.questionTypeConditionChildren = [];
+      if (!this.typeConditionParentValue) {
+        this.typeConditionChildrenValue = '';
+        this.typeConditionChildrenList = [];
         return;
       }
       this.loading = true;
       let params = {
-        categoryId: this.checkedQuestionTypeConditionParent,
+        categoryId: this.typeConditionParentValue,
       };
       this.$_http
         .get(
@@ -123,33 +356,68 @@ export default {
           )
         )
         .then((res) => {
-          this.questionTypeConditionChildren = res.data;
-          this.checkedQuestionTypeConditionChildren = this.questionTypeConditionChildren[0].id;
+          this.typeConditionChildrenList = res.data;
+          this.typeConditionChildrenValue = this.typeConditionChildrenList[0].id;
           this.loading = false;
         })
         .catch(() => {
           this.loading = false;
         });
     },
+    // 操作:选择了父类
+    selectTypeConditionParent() {
+      this.getTableChildrenListFun(); // 查询:试题类型列表-子类
+    },
     // 操作:点击提交按钮
-    handleSubmitFun() {
-      let findCondition = this.formatQuestionTypeConditionChooseValue(
-        this.checkedQuestionTypeConditionChildren
-      ); // 获取试题类型信息-子类
-      let params = {
-        ruleType: ANSWER_MANAGEMENT_RULE_TYPE.WEEK.ruleType,
-        questionCategories: findCondition ? [findCondition] : [],
-        totalQuestionNum: this.questionsNum,
-      };
-      this.$_http
-        .post(this.$_API.INTERFACE_POST_ANSWER_RULE_ADD, params)
-        .then(() => {
-          this.$message.success('创建每周答题成功');
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
+    handleSubmitAreaFun(e) {
+      // 验证:出题数量
+      e.preventDefault();
+      this.anserRuleSpecialNumForm.validateFields((err, values) => {
+        if (!err) {
+          this.questionInfo = {
+            singleNum: values.singleNum,
+            multiNum: values.multiNum,
+            trueFalseNum: values.trueFalseNum,
+            gapFillingNum: values.gapFillingNum,
+          };
+          // 验证:基础信息
+          document.getElementById('answerManagementSpecialBasic').click();
+        }
+      });
+    },
+    // 验证:基础信息
+    handleSubmitBasicFun(e) {
+      e.preventDefault();
+      this.anserRuleSpecialBasicForm.validateFields((err, values) => {
+        if (!err) {
+          let findCondition = this.formatQuestionTypeConditionChooseValue(
+            this.typeConditionChildrenValue
+          ); // 获取试题类型信息-子类
+          let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
+            values.engineeringWorkChooseValue
+          ); // 获取工种信息
+          this.engineeringWork = values.engineeringWorkChooseValue;
+          this.specialName = values.name;
+          let params = {
+            name: values.name,
+            engineerTypes: [engineerTypeInfo], // 信息集合:工种
+            ruleType: ANSWER_MANAGEMENT_RULE_TYPE.CHALLENGE.ruleType,
+            questionCategories: findCondition ? [findCondition] : [],
+            totalQuestionNum:
+              Number(this.questionInfo.singleNum) +
+              Number(this.questionInfo.multiNum) +
+              Number(this.questionInfo.trueFalseNum) +
+              Number(this.questionInfo.gapFillingNum),
+            numPerQuestionType: {
+              DanXuan: Number(this.questionInfo.singleNum),
+              DuoXuan: Number(this.questionInfo.multiNum),
+              PanDuan: Number(this.questionInfo.trueFalseNum),
+              TianKong: Number(this.questionInfo.gapFillingNum),
+            },
+          };
+          this.httpQuestPreAssembledVolumeFun(params); // 表单提交请求:预组卷
+        }
+      });
     },
     // 获取试题类型信息-子类
     formatQuestionTypeConditionChooseValue(id) {
@@ -157,8 +425,20 @@ export default {
         return null;
       }
       let seleteItem = null;
-      for (let i = 0; i < this.questionTypeConditionChildren.length; i++) {
-        let item = this.questionTypeConditionChildren[i];
+      for (let i = 0; i < this.typeConditionChildrenList.length; i++) {
+        let item = this.typeConditionChildrenList[i];
+        if (item.id === id) {
+          seleteItem = item;
+          break;
+        }
+      }
+      return seleteItem;
+    },
+    // 获取工种信息
+    formatEngineeringWorkChooseValue(id) {
+      let seleteItem = {};
+      for (let i = 0; i < this.engineeringWorkList.length; i++) {
+        let item = this.engineeringWorkList[i];
         if (item.id === id) {
           seleteItem = item;
           break;
@@ -166,6 +446,114 @@ export default {
       }
       return seleteItem;
     },
+    // 操作:详情
+    toQuestionDetailFun(record) {
+      console.log('查看某个试题的详情', record);
+      // if (!record || !record.id) {
+      //   this.$message.error('数据异常,请重新进入当前页面');
+      //   return;
+      // }
+      // switch (record.type) {
+      //   case EXAM_QUESTION_TYPE[0].code:
+      //     this.$router.push({
+      //       path: '/examQuestionManagement/create/singleChoice',
+      //       query: { id: record.id },
+      //     });
+      //     break;
+      //   case EXAM_QUESTION_TYPE[1].code:
+      //     this.$router.push({
+      //       path: '/examQuestionManagement/create/multipleChoice',
+      //       query: { id: record.id },
+      //     });
+      //     break;
+      //   case EXAM_QUESTION_TYPE[2].code:
+      //     this.$router.push({
+      //       path: '/examQuestionManagement/create/trueOrFalse',
+      //       query: { id: record.id },
+      //     });
+      //     break;
+      //   case EXAM_QUESTION_TYPE[3].code:
+      //     this.$router.push({
+      //       path: '/examQuestionManagement/create/gapFilling',
+      //       query: { id: record.id },
+      //     });
+      //     break;
+      //   default:
+      //     this.$message.error('试题类别异常,无法查看详情');
+      //     break;
+      // }
+    },
+    // 切换:表格页码
+    handleCurrentTableChangePage(pagination) {
+      const pager = { ...this.current_pagination };
+      pager.current = pagination.current;
+      this.current_pagination = pager;
+    },
+
+    // 表单提交请求:预组卷
+    httpQuestPreAssembledVolumeFun(params) {
+      this.loading = true;
+      let urlParams = {
+        engineertypeid: this.engineeringWork,
+      };
+      this.$_http
+        .post(
+          formateUrlParams(
+            this.$_API.INTERFACE_POST_EXAM_QUESTIONS_AUTO,
+            urlParams
+          ),
+          params
+        )
+        .then((res) => {
+          let resData = res.data;
+          resData.forEach((item) => {
+            // 试题类别
+            this.bank_questionType.forEach((it) => {
+              if (item.type === it.code) {
+                item.typeTxt = it.name;
+              }
+            });
+            // 工种
+            if (
+              item.engineerTypes &&
+              item.engineerTypes[0] &&
+              item.engineerTypes[0].id
+            ) {
+              item.engineerTypeTxt = item.engineerTypes[0].name;
+            } else {
+              item.engineerTypeTxt = '不限';
+            }
+          });
+          this.current_tableData = resData;
+          this.current_pagination.total = resData.length;
+          this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    // 操作:发布
+    handleSubmitAll() {
+      this.loading = true;
+      let params = {
+        name: this.specialName,
+        questionList: this.current_tableData,
+      };
+      this.$_http
+        .post(
+          formateUrlParams(this.$_API.INTERFACE_POST_ANSWER_RULE_ADD_SPECIAL, {
+            engineertypeid: this.engineeringWork,
+          }),
+          params
+        )
+        .then(() => {
+          this.loading = false;
+          this.$message.success('添加专项答题成功');
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
   },
 };
 </script>
@@ -174,4 +562,32 @@ export default {
 
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
+.answer-select-div {
+  display: flex;
+  align-items: center;
+  padding-left: 50px;
+  margin: @paddingMarginVal 0;
+  .create-select-item {
+    display: flex;
+    align-items: center;
+    > span {
+      flex-wrap: nowrap;
+      white-space: nowrap;
+      margin: 0 10px 0 @paddingMarginVal;
+      color: @mainColorBlack85;
+    }
+  }
+}
+.submit-row {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+}
+
+.submit-row-add {
+  width: 100%;
+  padding: @navTopHight 0;
+  display: flex;
+  justify-content: center;
+}
 </style>

+ 8 - 0
src/views/answerManagement/answerManagementWeek.vue

@@ -135,6 +135,14 @@ export default {
     },
     // 操作:点击提交按钮
     handleSubmitFun() {
+      if (
+        !this.questionsNum ||
+        isNaN(this.questionsNum) ||
+        !Number(this.questionsNum)
+      ) {
+        this.$message.error('请输入大于零的试题数量(数字)');
+        return;
+      }
       let findCondition = this.formatQuestionTypeConditionChooseValue(
         this.checkedQuestionTypeConditionChildren
       ); // 获取试题类型信息-子类

+ 0 - 1
src/views/articleManagement/articleCreate.vue

@@ -305,7 +305,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .information-title {
     font-size: 18px;
     font-weight: bold;

+ 0 - 1
src/views/articleManagement/articleList.vue

@@ -323,7 +323,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .article-list-item {
     width: 100%;
     padding-bottom: @paddingMarginVal;

+ 0 - 1
src/views/engineeringWorkManagement/engineeringWorkList.vue

@@ -171,7 +171,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .engineeringWork-create {
     width: 100%;
     .engineeringWork-create-title {

+ 73 - 17
src/views/examManagement/examAutomaticVolumeFormation.vue

@@ -299,7 +299,19 @@
           :pagination="current_pagination"
           @change="handleCurrentTableChangePage"
         >
-          <template slot="points" slot-scope="text, record">
+          <template slot="questionCategory" slot-scope="text, record">
+            <span>{{
+              record.questionCategory ? record.questionCategory.name : '不限'
+            }}</span>
+          </template>
+          <template slot="rootQuestionCategory" slot-scope="text, record">
+            <span>{{
+              record.rootQuestionCategory
+                ? record.rootQuestionCategory.name
+                : '不限'
+            }}</span>
+          </template>
+          <!-- <template slot="points" slot-scope="text, record">
             <a-input
               :value="record.points"
               type="number"
@@ -311,13 +323,22 @@
                 }
               "
             />
-          </template>
+          </template> -->
           <template slot="action" slot-scope="text, record">
             <a @click="toQuestionDetailFun(record)">详情</a>
-            <a-divider type="vertical" />
-            <a @click="deleteCurrentTableQuestionFun(record)">删除</a>
+            <!-- <a-divider type="vertical" />
+            <a @click="deleteCurrentTableQuestionFun(record)">删除</a> -->
           </template>
         </a-table>
+
+        <div class="submit-row-add">
+          <a-button
+            type="primary"
+            :disabled="!current_tableData || !current_tableData.length"
+            @click="httpQuestAddQuestionsFun"
+            >组卷</a-button
+          >
+        </div>
       </div>
     </a-spin>
     <div class="company-info">
@@ -329,7 +350,7 @@
 </template>
 
 <script>
-import { EXAM_TYPE } from '@/common/Constant'; // EXAM_QUESTION_TYPE
+import { EXAM_TYPE, EXAM_QUESTION_TYPE } from '@/common/Constant'; // EXAM_QUESTION_TYPE
 import {
   formateSeconds,
   formateUrlParams,
@@ -446,6 +467,7 @@ export default {
         gapFillingNum: '', // 填空题数量
         gapFillingGrade: '',
       },
+      examId: null, // 当前提交预组卷生成的考试ID
     };
   },
   created() {
@@ -484,7 +506,7 @@ export default {
       // 工种类别
       this.engineeringWorkList = this.GET_ENGINEERING_WORK_LIST;
       this.examDetailData.engineeringWork = this.engineeringWorkList[0].id;
-      // 试题类型
+      // 试题类型-父类
       this.questionTypeConditionParent = [
         { name: '全部', id: '' },
         ...this.GET_EXAM_QUESTION_TYPE_CONDITION_PARENT,
@@ -516,16 +538,16 @@ export default {
         },
         {
           title: '试题父类',
-          dataIndex: 'parentId',
-          key: 'parentId',
-          scopedSlots: { customRender: 'parentId' },
+          dataIndex: 'questionCategory',
+          key: 'questionCategory',
+          scopedSlots: { customRender: 'questionCategory' },
           width: 150,
         },
         {
           title: '试题子类',
-          dataIndex: 'categoryid',
-          key: 'categoryid',
-          scopedSlots: { customRender: 'categoryid' },
+          dataIndex: 'rootQuestionCategory',
+          key: 'rootQuestionCategory',
+          scopedSlots: { customRender: 'rootQuestionCategory' },
           width: 150,
         },
         {
@@ -842,7 +864,13 @@ export default {
             tages: [],
             engineerTypes: engineerTypeInfo ? [engineerTypeInfo] : [], // 信息集合:工种
             examCategory: values.examTypeChooseValue, // 考试类别
-            totalpoints: this.current_tableGradesCount, // 总分
+            totalpoints:
+              this.questionInfo.singleNum * this.questionInfo.singleGrade +
+              this.questionInfo.multiNum * this.questionInfo.multiGrade +
+              this.questionInfo.trueFalseNum *
+                this.questionInfo.trueFalseGrade +
+              this.questionInfo.gapFillingNum *
+                this.questionInfo.gapFillingGrade, // 总分
           };
           if (this.examDetailData.id) {
             params.id = this.examDetailData.id;
@@ -889,7 +917,9 @@ export default {
           formateUrlParams(this.$_API.INTERFACE_POST_EXAM_ADD_INFO, urlParams),
           params
         )
-        .then(() => {
+        .then((res) => {
+          console.log(res);
+          this.examId = res.id;
           this.loading = false;
           this.httpQuestPreAssembledVolumeFun(urlParams.engineertypeid); // 表单提交请求:预组卷
         })
@@ -932,7 +962,28 @@ export default {
         )
         .then((res) => {
           console.log(res.data);
-          this.current_tableData = res.data.content;
+          let resData = res.data;
+          resData.forEach((item) => {
+            switch (item.type) {
+              case EXAM_QUESTION_TYPE[0].code:
+                item.points = this.questionInfo.singleGrade;
+                break;
+              case EXAM_QUESTION_TYPE[1].code:
+                item.points = this.questionInfo.multiNum;
+                break;
+              case EXAM_QUESTION_TYPE[2].code:
+                item.points = this.questionInfo.trueFalseNum;
+                break;
+              case EXAM_QUESTION_TYPE[3].code:
+                item.points = this.questionInfo.gapFillingNum;
+                break;
+              default:
+                item.points = '';
+                break;
+            }
+          });
+          this.current_tableData = resData;
+          this.current_pagination.total = resData.length;
           this.loading = false;
         })
         .catch(() => {
@@ -947,7 +998,7 @@ export default {
         let obj = {
           examId: examId,
           questionId: item.id,
-          points: item.points,
+          questionPoints: item.points,
         };
         dataArr.push(obj);
       });
@@ -975,7 +1026,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .other-information-box {
     width: 100%;
     .other-information-title {
@@ -1021,5 +1071,11 @@ export default {
     display: flex;
     justify-content: center;
   }
+  .submit-row-add {
+    width: 100%;
+    padding: @navTopHight 0;
+    display: flex;
+    justify-content: center;
+  }
 }
 </style>

+ 18 - 6
src/views/examManagement/examManagementDetail.vue

@@ -76,6 +76,18 @@
           :scroll="{ y: tableHeight }"
           :pagination="false"
         >
+          <template slot="questionCategory" slot-scope="text, record">
+            <span>{{
+              record.questionCategory ? record.questionCategory.name : '不限'
+            }}</span>
+          </template>
+          <template slot="rootQuestionCategory" slot-scope="text, record">
+            <span>{{
+              record.rootQuestionCategory
+                ? record.rootQuestionCategory.name
+                : '不限'
+            }}</span>
+          </template>
           <template slot="status" slot-scope="text">
             <span
               :class="
@@ -203,15 +215,15 @@ export default {
         },
         {
           title: '试题父类',
-          dataIndex: 'parentId',
-          key: 'parentId',
-          scopedSlots: { customRender: 'parentId' },
+          dataIndex: 'questionCategory',
+          key: 'questionCategory',
+          scopedSlots: { customRender: 'questionCategory' },
         },
         {
           title: '试题子类',
-          dataIndex: 'categoryid',
-          key: 'categoryid',
-          scopedSlots: { customRender: 'categoryid' },
+          dataIndex: 'rootQuestionCategory',
+          key: 'rootQuestionCategory',
+          scopedSlots: { customRender: 'rootQuestionCategory' },
         },
         {
           title: '工种',

+ 37 - 14
src/views/examManagement/examManualVolumeFormation.vue

@@ -189,6 +189,18 @@
           :pagination="current_pagination"
           @change="handleCurrentTableChangePage"
         >
+          <template slot="questionCategory" slot-scope="text, record">
+            <span>{{
+              record.questionCategory ? record.questionCategory.name : '不限'
+            }}</span>
+          </template>
+          <template slot="rootQuestionCategory" slot-scope="text, record">
+            <span>{{
+              record.rootQuestionCategory
+                ? record.rootQuestionCategory.name
+                : '不限'
+            }}</span>
+          </template>
           <template slot="points" slot-scope="text, record">
             <a-input
               :value="record.points"
@@ -333,6 +345,18 @@
             :loading="loading"
             :pagination="false"
           >
+            <template slot="questionCategory" slot-scope="text, record">
+              <span>{{
+                record.questionCategory ? record.questionCategory.name : '不限'
+              }}</span>
+            </template>
+            <template slot="rootQuestionCategory" slot-scope="text, record">
+              <span>{{
+                record.rootQuestionCategory
+                  ? record.rootQuestionCategory.name
+                  : '不限'
+              }}</span>
+            </template>
             <template slot="action" slot-scope="text, record">
               <a @click="toQuestionDetailFun(record)">详情</a>
               <a-divider type="vertical" />
@@ -593,16 +617,16 @@ export default {
         },
         {
           title: '试题父类',
-          dataIndex: 'parentId',
-          key: 'parentId',
-          scopedSlots: { customRender: 'parentId' },
+          dataIndex: 'questionCategory',
+          key: 'questionCategory',
+          scopedSlots: { customRender: 'questionCategory' },
           width: 150,
         },
         {
           title: '试题子类',
-          dataIndex: 'categoryid',
-          key: 'categoryid',
-          scopedSlots: { customRender: 'categoryid' },
+          dataIndex: 'rootQuestionCategory',
+          key: 'rootQuestionCategory',
+          scopedSlots: { customRender: 'rootQuestionCategory' },
           width: 150,
         },
         {
@@ -851,16 +875,16 @@ export default {
         },
         {
           title: '试题父类',
-          dataIndex: 'parentId',
-          key: 'parentId',
-          scopedSlots: { customRender: 'parentId' },
+          dataIndex: 'questionCategory',
+          key: 'questionCategory',
+          scopedSlots: { customRender: 'questionCategory' },
           width: 150,
         },
         {
           title: '试题子类',
-          dataIndex: 'categoryid',
-          key: 'categoryid',
-          scopedSlots: { customRender: 'categoryid' },
+          dataIndex: 'rootQuestionCategory',
+          key: 'rootQuestionCategory',
+          scopedSlots: { customRender: 'rootQuestionCategory' },
           width: 150,
         },
         {
@@ -1213,7 +1237,7 @@ export default {
         let obj = {
           examId: examId,
           questionId: item.id,
-          points: item.points,
+          questionPoints: item.points,
         };
         dataArr.push(obj);
       });
@@ -1241,7 +1265,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .current-table-title {
     font-size: 18px;
     color: @mainColorBlack65;

+ 18 - 9
src/views/examQuestionManagement/examQuestionList.vue

@@ -110,6 +110,18 @@
           <template slot="type" slot-scope="text, record">
             <span>{{ record.typeTxt }}</span>
           </template>
+          <template slot="questionCategory" slot-scope="text, record">
+            <span>{{
+              record.questionCategory ? record.questionCategory.name : '不限'
+            }}</span>
+          </template>
+          <template slot="rootQuestionCategory" slot-scope="text, record">
+            <span>{{
+              record.rootQuestionCategory
+                ? record.rootQuestionCategory.name
+                : '不限'
+            }}</span>
+          </template>
           <template slot="action" slot-scope="text, record">
             <a @click="toQuestionDetailFun(record)">详情</a>
             <a-divider type="vertical" />
@@ -235,15 +247,15 @@ export default {
         },
         {
           title: '试题父类',
-          dataIndex: 'parentId',
-          key: 'parentId',
-          scopedSlots: { customRender: 'parentId' },
+          dataIndex: 'questionCategory',
+          key: 'questionCategory',
+          scopedSlots: { customRender: 'questionCategory' },
         },
         {
           title: '试题子类',
-          dataIndex: 'categoryid',
-          key: 'categoryid',
-          scopedSlots: { customRender: 'categoryid' },
+          dataIndex: 'rootQuestionCategory',
+          key: 'rootQuestionCategory',
+          scopedSlots: { customRender: 'rootQuestionCategory' },
         },
         {
           title: '工种',
@@ -467,9 +479,6 @@ export default {
           that.$_http
             .delete(that.$_API.INTERFACE_DELETE_EXAMS_QUESTION_DELETE_LIST, {
               data: that.selectedRowKeys,
-              headers: {
-                'Content-Type': 'application/json',
-              },
             })
             .then(() => {
               that.selectedRowKeys = [];

+ 0 - 1
src/views/examQuestionManagement/examQuestionTypeCondition.vue

@@ -299,7 +299,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .questionTypeCondition-create {
     width: 100%;
     .questionTypeCondition-create-title {

+ 4 - 4
src/views/examQuestionManagement/examQusetionCreateGapFilling.vue

@@ -229,9 +229,9 @@ export default {
       e.preventDefault();
       this.aquestionAddForm.validateFields((err, values) => {
         if (!err) {
-          let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
-            values.engineeringWorkChooseValue
-          ); // 获取工种信息
+          // let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
+          //   values.engineeringWorkChooseValue
+          // ); // 获取工种信息
           // 需要拼接到请求地址后面的参数
           let urlParams = {
             categoryid: this.typeConditionChildrenValue, // 试题类型ID
@@ -241,7 +241,7 @@ export default {
           let params = {
             content: values.content, // 内容
             finalAnswer: this.formatQuestionAnswersArr(values), // 正确答案
-            engineerTypes: [engineerTypeInfo], // 工种信息集合
+            // engineerTypes: [engineerTypeInfo], // 工种信息集合
             type: this.questionType, // 试题类型ID
             answers: [], // 选项
           };

+ 12 - 7
src/views/examQuestionManagement/examQusetionCreateMultiple.vue

@@ -258,9 +258,9 @@ export default {
       e.preventDefault();
       this.aquestionAddForm.validateFields((err, values) => {
         if (!err) {
-          let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
-            values.engineeringWorkChooseValue
-          ); // 获取工种信息
+          // let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
+          //   values.engineeringWorkChooseValue
+          // ); // 获取工种信息
           // 需要拼接到请求地址后面的参数
           let urlParams = {
             categoryid: this.typeConditionChildrenValue, // 试题类型ID
@@ -272,7 +272,7 @@ export default {
             finalAnswer: this.formatQuestionFinalAnswerArr(
               values.finalAnswerIndexs
             ), // 正确答案
-            engineerTypes: [engineerTypeInfo], // 工种信息集合
+            // engineerTypes: [engineerTypeInfo], // 工种信息集合
             type: this.questionType, // 试题类型ID
             answers: this.formatQuestionAnswersArr(values), // 选项
           };
@@ -294,11 +294,16 @@ export default {
     },
     // 把答案下标转换为大写英文字母放入一个数组中
     formatQuestionFinalAnswerArr(indexs) {
-      let arr = '';
+      let arr = [];
       indexs.forEach((item) => {
-        arr += formatQuestionIndex(item);
+        arr.push(formatQuestionIndex(item));
+      });
+      arr.sort();
+      let str = '';
+      arr.forEach((item) => {
+        str = str + item;
       });
-      return [arr];
+      return [str];
     },
     // 把选项放入一个数组中
     formatQuestionAnswersArr(values) {

+ 4 - 4
src/views/examQuestionManagement/examQusetionCreateSingle.vue

@@ -282,9 +282,9 @@ export default {
       e.preventDefault();
       this.aquestionAddForm.validateFields((err, values) => {
         if (!err) {
-          let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
-            values.engineeringWorkChooseValue
-          ); // 获取工种信息 typeConditionParentValue
+          // let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
+          //   values.engineeringWorkChooseValue
+          // ); // 获取工种信息 typeConditionParentValue
           // 需要拼接到请求地址后面的参数
           let urlParams = {
             categoryid: this.typeConditionChildrenValue, // 试题类型ID
@@ -296,7 +296,7 @@ export default {
             finalAnswer: this.formatQuestionFinalAnswerArr(
               values.finalAnswerIndexs
             ), // 正确答案
-            engineerTypes: [engineerTypeInfo], // 信息集合:工种
+            // engineerTypes: [engineerTypeInfo], // 信息集合:工种
             type: this.questionType, // 试题类型ID
             // tages: [this.answerDate], // 日期
             answers: this.formatQuestionAnswersArr(values), // 选项

+ 4 - 4
src/views/examQuestionManagement/examQusetionCreateTrueOrFalse.vue

@@ -242,9 +242,9 @@ export default {
       e.preventDefault();
       this.aquestionAddForm.validateFields((err, values) => {
         if (!err) {
-          let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
-            values.engineeringWorkChooseValue
-          ); // 获取工种信息
+          // let engineerTypeInfo = this.formatEngineeringWorkChooseValue(
+          //   values.engineeringWorkChooseValue
+          // ); // 获取工种信息
           // 需要拼接到请求地址后面的参数
           let urlParams = {
             categoryid: this.typeConditionChildrenValue, // 试题类型ID
@@ -256,7 +256,7 @@ export default {
             finalAnswer: this.formatQuestionFinalAnswerArr(
               values.finalAnswerIndexs
             ), // 正确答案
-            engineerTypes: [engineerTypeInfo], // 工种信息集合
+            // engineerTypes: [engineerTypeInfo], // 工种信息集合
             type: this.questionType, // 试题类型ID
             answers: this.formatQuestionAnswersArr(values), // 选项
           };

+ 0 - 1
src/views/user/userManagementList.vue

@@ -286,7 +286,6 @@ export default {
 <style lang="less" scoped>
 @import '~@/styles/common/variable.less';
 .app-container {
-  overflow-y: auto;
   .basic-information-title {
     font-size: 18px;
     font-weight: bold;