فهرست منبع

修改取题目的方式和参数2

JXDS18FUJT 1 سال پیش
والد
کامیت
6b8d1cce32

BIN
jpcj-pc.zip


+ 3 - 1
src/api/index.ts

@@ -5,13 +5,15 @@ import question from './question/question'
 import three from './three/three'
 import traffic from './traffic/traffic'
 import score from './score/score'
+import question2 from './question2/question2'
 const api  = {
     login,
     open,
     question,
     traffic,
     three,
-    score
+    score,
+    question2
 
     
 

+ 40 - 6
src/api/open/open.ts

@@ -1,9 +1,21 @@
 import request from "../request"
 import { openApi } from "./type"
 export default {
+    //获取分类的新接口
+    question2InfoGetQuestionColumn(params: {
+        model: string,
+        subject: string
+
+    }): Promise<openApi.question2InfoGetQuestionColumn> {
+        return request({
+            params,
+            url: '/open-api/question2/info/getQuestionColumn'
+        })
+
+    },
     questionInfoSelectFreeQuestionInfo(params: {
         subject: number
-    }):Promise<openApi.selectFreeQuestionInfoRes> {
+    }): Promise<openApi.selectFreeQuestionInfoRes> {
         return request({
             params,
             url: "/open-api/question/info/selectFreeQuestionInfo",
@@ -11,15 +23,37 @@ export default {
 
         })
     },
-    questionInfoSelectTestK14QuestionInfoList(params:{
-        subject:number,
-        gs:string
-    }):Promise<openApi.selectFreeQuestionInfoRes>{
+    //获取题目的新接口
+    question2InfoList(params: {
+        columnAll?: string
+        model?: string,
+        subject: string | number
+    }): Promise<openApi.selectFreeQuestionInfoRes> {
+        return request({
+            params,
+            url: "/open-api/question2/info/list"
+        })
+
+    },
+    //获取模拟考试题目
+    questionInfoSelectTestK14QuestionInfoList(params: {
+        subject: number,
+        gs: string
+    }): Promise<openApi.selectFreeQuestionInfoRes> {
         return request({
             params,
             url: "/open-api/question/info/selectTestK14QuestionInfoList",
             method: 'get'
         })
+    },
+    question2InfoSelectTestK14QuestionInfoList(params:{
+        subject: number,
+        model: string
+    }): Promise<openApi.selectFreeQuestionInfoRes> {
+        return request({
+            params,
+            url: "/open-api/question2/info/selectTestK14QuestionInfoList",
+            method: 'get'
+        })
     }
 }
-    

+ 17 - 3
src/api/open/type.d.ts

@@ -6,9 +6,9 @@ interface Res {
 export declare namespace openApi {
     interface selectFreeQuestionInfoRes extends Res {
         rows: {
-            isSkipWrong?:boolean
+            isSkipWrong?: boolean
             isError?: boolean
-            isComplete?:boolean
+            isComplete?: boolean
             userAnswer: string | string[]
             optsArr: string[]
             answer: string
@@ -54,8 +54,22 @@ export declare namespace openApi {
             updateTime: string
 
         }[]
-        total:number
+        total: number
 
     }
+    interface question2InfoGetQuestionColumn extends Res {
+      data: {
+            "createTime": string,
+            "updateTime": null,
+            "id": number,
+            "columnId": number,
+            "sort": number,
+            "model": string,
+            "subject": string,
+            "title": string
+        }[]
+  
+    }
+
 }
 

+ 30 - 0
src/api/question2/question2.ts

@@ -0,0 +1,30 @@
+import { Axios, AxiosPromise } from "axios"
+import request from "../request"
+import {question2Api} from './type'
+export default {
+    //获取分类的新接口
+    question2InfoGetQuestionColumn(params:{
+        model:string,
+        subject:string
+
+    }){
+        return request({
+            params,
+            url:'student/question2/info/getQuestionColumn'
+        })
+
+    },
+    //获取题目的新接口
+    question2InfoList(params:{
+        columnAll?:string
+        model?:string,
+        subject:string|number
+    }):Promise<question2Api.selectTestK14QuestionInfoList>{
+        return request({
+            params,
+            url:"student/question2/info/list"
+        })
+
+    }
+
+}

+ 59 - 0
src/api/question2/type.d.ts

@@ -0,0 +1,59 @@
+interface Res {
+    code: number,
+    msg: string
+
+}
+export declare namespace question2Api {
+    interface selectTestK14QuestionInfoList extends Res {
+        total:number
+        rows: {
+      
+            isError?: boolean
+            isComplete?: boolean
+            userAnswer: string | string[]
+            optsArr: string[]
+            answer: string
+            answerkeyword: string
+            answermp3: string
+            chapterId: number
+            classIssue: string
+            classIssueName: string
+            classSort: number
+            createTime: string
+            diffDegree: number
+            excellIssue: string
+            excellIssueName: string
+            excellSort: number
+            explainGif: string
+            explainJq: string
+            explainJs: string
+            explainMp3: string
+            explainjsmp3: string
+            id: number
+            idYdt: number
+            image: string
+            imageYdt: string
+            isNew: number
+            issue: string
+            issuemp3: string
+            liceBus: string
+            liceCar: string
+            liceMoto: null
+            liceTruck: string
+            number: number
+            opts: string
+            placeIssue: null
+            placeIssueName: null
+            placeSort: null
+            questionType: number
+            sequeIssue: string
+            sequeIssueName: string
+            sequeSort: number
+            skillkeyword: string
+            subject: number
+            titlekeyword: string
+            updateTime: string
+
+        }[]
+    }
+}

+ 6 - 1
src/store/index.ts

@@ -10,7 +10,8 @@ export default createStore({
       autoRead: boolean,
       autoRed: boolean
 
-    }
+    },
+    model:'cart'
   },
   getters: {
   },
@@ -25,6 +26,10 @@ export default createStore({
       return state
 
 
+    },
+    SET_MODEL(state,model:string){
+      state.model = model
+      return state
     }
   },
   actions: {

+ 2 - 2
src/views/driverExam/index.vue

@@ -229,9 +229,9 @@ export default defineComponent({
       alertVisible: ref(false),
       dialogVisible: ref(false),
       ...useDriverExam(
-        api.open.questionInfoSelectTestK14QuestionInfoList({
+        api.open.question2InfoSelectTestK14QuestionInfoList({
           subject: Number(route.query.subject),
-          gs: route.query.gs as string,
+          model: route.query.model as string,
         })
       ),
     };

+ 8 - 15
src/views/home/components/leftTab/index.vue

@@ -91,9 +91,7 @@ export default defineComponent({
               path: "/home/practiseSelect",
               query: {
                 subject: 1,
-                liceBus: "1",
-                liceTruck: "1",
-                liceCar: "1",
+            
               },
             },
             // {
@@ -106,9 +104,7 @@ export default defineComponent({
               path: "/home/selectDriveExamSubject",
               query: {
                 subject: 1,
-                liceBus: "1",
-                liceTruck: "1",
-                liceCar: "1",
+               
               },
             },
           ],
@@ -125,9 +121,7 @@ export default defineComponent({
               path: "/home/practiseSelect",
               query: {
                 subject: 4,
-                liceBus: "1",
-                liceTruck: "1",
-                liceCar: "1",
+          
               },
             },
             // {
@@ -140,9 +134,7 @@ export default defineComponent({
               path: "/home/selectDriveExamSubject",
               query: {
                 subject: 4,
-                liceBus: "1",
-                liceTruck: "1",
-                liceCar: "1",
+            
               },
             },
           ],
@@ -160,7 +152,7 @@ export default defineComponent({
               isSelect: false,
               query: {
                 subject: 1,
-                liceMoto: "1",
+                model: "mtc",
               },
             },
             // {
@@ -173,7 +165,7 @@ export default defineComponent({
               path: "/home/selectDriveExamSubject",
               query: {
                 subject: 1,
-                liceMoto: "1",
+                model: "mtc",
               },
             },
           ],
@@ -192,7 +184,7 @@ export default defineComponent({
               query: {
                 subject: 4,
 
-                liceMoto: "1",
+                model: "mtc",
               },
             },
             // {
@@ -205,6 +197,7 @@ export default defineComponent({
               path: "/home/selectDriveExamSubject",
               query: {
                 subject: 4,
+                model: "mtc",
               },
             },
           ],

+ 116 - 83
src/views/home/practiseSelect/index.vue

@@ -2,50 +2,61 @@
 
 <template>
   <div class="content">
+    <div class="flex mb15 items-center bg-white pt10 pb10 pl50">
+      <div class="vertical-line mr10"></div>
+      <span class="font20 font-bold mr15">车型选择</span>
+      <div :class="{
+        'bg-primary-yellow': model == 'cart'
+      }" @click="changeCarModel('cart')" class="lh34 ml15 select-border1 round4 pr15 pl15">
+        轿车
+      </div>
+      <div :class="{
+        'bg-primary-yellow': model == 'bus'
+      }" @click="changeCarModel('bus')" class="lh34 ml15 select-border1 round4 pr15 pl15">
+        客车
+      </div>
+      <div :class="{
+        'bg-primary-yellow': model == 'truck'
+      }" @click="changeCarModel('truck')" class="lh34 ml15 select-border1 round4 pr15 pl15">
+        货车
+      </div>
+    </div>
     <div class="bg-white pl50 pt30">
+
       <div class="flex items-center">
         <div class="vertical-line mr10"></div>
         <span class="font20 font-bold mr15">技巧练习</span>
         <!-- <div class="lh34 select-border1 round4 pr15 pl15">试听</div> -->
       </div>
+
+
       <div class="">
         <div class="flex justify-normal flex-wrap w-11/12">
-          <div
-            v-for="(item, index) in list"
-            :key="index"
-            class="flex radius4 pt15"
-          >
+          <div v-for="(item, index) in list" :key="index" class="flex radius4 pt15">
             <div class="lh34 w185 text-left font18">
-              {{ index + 1 }}. {{ item.classIssueName }}
+              {{ index + 1 }}. {{ item.title }}
             </div>
-            <div class="flex">
-              <!-- <div
+          <div class="flex">
+            <!-- <div
                 class="w64 lh34 mr15 round4 overflow-hidden select-border3 bg-gray-100 text-gray-500 cursor-not-allowed"
               >
-                视频
-              </div> -->
-              <router-link
-                :to="
-                  '/studySkill?subject=' +
-                  ($route.query.subject || 4) +
-                  '&classIssue=' +
-                  (item.classIssue || '')
-                "
-              >
-                <div
-                  class="w64 lh34 mr15 round4 overflow-hidden select-border2 "
-                >
+                              视频
+                            </div> -->
+              <router-link :to="
+                '/studySkill?subject=' +
+                ($route.query.subject || 4) +
+                '&columnAll=' +
+                (item.columnId || '')
+              ">
+                <div class="w64 lh34 mr15 round4 overflow-hidden select-border2 ">
                   练习
                 </div>
               </router-link>
-           
-                <div
-                @click="checkLocalWrongList()"
-                  class="w64 lh34 mr15 round4 overflow-hidden select-border2"
-                >
-                  回顾
-                </div>
-          
+
+              <div @click="checkLocalWrongList()" class="w64 lh34 mr15 round4 overflow-hidden select-border2">
+                回顾
+              </div>
+
             </div>
           </div>
         </div>
@@ -53,38 +64,27 @@
       <div class="flex items-center pt30 pb30">
         <div class="vertical-line mr10"></div>
         <span class="font20 font-bold mr15">全部错误题回顾</span>
-       
-          <div @click="checkLocalWrongList()" class="lh34 round4 pr15 pl15 select-border1 mr15">
-            错误回顾
-          </div>
-        <div
-          @click="
-            () => {
-              dialogVisible = true;
-            }
-          "
-          class="lh34 round4 pr15 pl15 select-border1"
-        >
+
+        <div @click="checkLocalWrongList()" class="lh34 round4 pr15 pl15 select-border1 mr15">
+          错误回顾
+        </div>
+        <div @click="
+          () => {
+            dialogVisible = true;
+          }
+        " class="lh34 round4 pr15 pl15 select-border1">
           清空全部错题
         </div>
       </div>
     </div>
-    <mProblemAlert
-      v-model:visible="alertVisible"
-      title="开启"
-      content="禁止重复"
-    ></mProblemAlert>
-    <mProblemDialog
-      @confirm="deleteAllWrong()"
-      v-model:visible="dialogVisible"
-      title="提示"
-      content="是否要清空全部错题"
-    ></mProblemDialog>
+    <mProblemAlert v-model:visible="alertVisible" title="开启" content="禁止重复"></mProblemAlert>
+    <mProblemDialog @confirm="deleteAllWrong()" v-model:visible="dialogVisible" title="提示" content="是否要清空全部错题">
+    </mProblemDialog>
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from "vue";
+import { computed, defineComponent, ref } from "vue";
 import api from "@/api";
 import { useRoute } from "vue-router";
 import mProblemDialog from "@/components/mProblemDialog/index.vue";
@@ -92,37 +92,45 @@ import mProblemAlert from "@/components/mProblemAlert/index.vue";
 import { message } from "ant-design-vue";
 import router from "@/router";
 import store from "@/store";
+
 export default defineComponent({
   name: "practiseSelect",
   setup() {
     const route = useRoute();
     const subject = route.query.subject
     const dialogVisible = ref(false);
+    const model = computed(() => {
+      return store.state.model
+    })
     let list = ref<
       {
-        createTime?: string;
-        updateTime?: string;
-        classIssue?: string;
-        classIssueName: string;
+        "createTime": string,
+        "updateTime": null,
+        "id": number,
+        "columnId": number,
+        "sort": number,
+        "model": string,
+        "subject": string,
+        "title": string
       }[]
     >([]);
     const deleteAllWrong = () => {
-    store.dispatch('ClearDriver'+subject+'WrongList')
-     dialogVisible.value = false;
+      store.dispatch('ClearDriver' + subject + 'WrongList')
+      dialogVisible.value = false;
     };
-    const checkLocalWrongList=()=>{
+    const checkLocalWrongList = () => {
       const subject = route.query.subject as string
-      let name = 'driverExam'+subject+'_local_wrong_list'
-      let list = JSON.parse(window.localStorage.getItem(name)||'[]')
-      if(list.length==0){
+      let name = 'driverExam' + subject + '_local_wrong_list'
+      let list = JSON.parse(window.localStorage.getItem(name) || '[]')
+      if (list.length == 0) {
         message.warn({
-          content:'没有对应的错题'
+          content: '没有对应的错题'
         })
         return
       }
       router.push({
-        path:'/reviewDriverError',
-        query:{
+        path: '/reviewDriverError',
+        query: {
           subject
 
         }
@@ -130,16 +138,14 @@ export default defineComponent({
 
 
     }
-    api.question
-      .questionInfoSelectFlQuestionInfo({
-        subject: Number(route.query.subject),
-        liceBus: route.query.liceBus as string,
-        liceCar: route.query.liceCar as string,
-        liceMoto: route.query.liceMoto as string,
-        liceTruck: route.query.liceTruck as string,
+
+    api.open
+      .question2InfoGetQuestionColumn({
+        subject: 'k'+(route.query.subject||'1')+'_3',
+        model: model.value
       })
       .then((res) => {
-        res.data.shift();
+
         list.value = res.data;
       });
 
@@ -147,23 +153,39 @@ export default defineComponent({
       dialogVisible,
       alertVisible: ref(false),
       list: list,
+      model,
       deleteAllWrong,
       checkLocalWrongList
     };
   },
+  methods: {
+    changeCarModel(model: string) {
+      store.commit('SET_MODEL', model)
+      
+      api.open
+      .question2InfoGetQuestionColumn({
+        subject: 'k'+(this.$route.query.subject||'1')+'_3',
+        model: this.model
+      })
+      .then((res) => {
+
+        this.list = res.data;
+        message.success({
+          content: '切换成功'
+        })
+      });
+    },
+  },
   watch: {
     "$route.query"(nowVal, oldVal) {
       if (JSON.stringify(nowVal) == "{}") {
         return;
       }
 
-      api.question
-        .questionInfoSelectFlQuestionInfo({
-          subject: Number(this.$route.query.subject),
-          liceBus: this.$route.query.liceBus as string,
-          liceCar: this.$route.query.liceCar as string,
-          liceMoto: this.$route.query.liceMoto as string,
-          liceTruck: this.$route.query.liceTruck as string,
+      api.open
+        .question2InfoGetQuestionColumn({
+          subject: 'k1_3',
+          model: this.model
         })
         .then((res) => {
           res.data.shift();
@@ -179,41 +201,52 @@ export default defineComponent({
 </script>
 
 <style lang="scss" scoped>
-a{
+.bg-primary-yellow {
+  background-color: #f9de5b;
+}
+
+a {
   color: black;
   text-decoration: none;
 
 }
+
 .select-border1 {
   border: 1px solid #f9de5b;
 }
+
 .select-border2 {
   border: 1px solid #f9de5b;
   color: black;
   text-decoration: none;
 }
+
 .select-border3 {
   border: 1px solid #d8d8d8;
 }
+
 .select-border1:hover {
   border: 1px solid #f9de5b;
   background-color: #f9de5b;
   cursor: pointer;
 }
+
 .select-border2:hover {
   border: 1px solid #f9de5b;
   background-color: rgba(255, 247, 204, 1);
   cursor: pointer;
-  
+
 }
 
 
 .radius4 {
   border-radius: 4px;
 }
+
 .bg-primary-yellow {
   background-color: #f9de5b;
 }
+
 .bg-light-yellow {
   background: #fff7cc;
 }

+ 5 - 5
src/views/home/selectDriveExamSubject/index.vue

@@ -7,19 +7,19 @@
         <span>(注意科目四,各车型一样)</span>
         <div class="flex">
           <div
-            @click="goDriveExam('xc')"
+            @click="goDriveExam('cart')"
             class="lh34 ml15 select-border1 round4 pr15 pl15"
           >
             轿车
           </div>
           <div
-            @click="goDriveExam('kc')"
+            @click="goDriveExam('bus')"
             class="lh34 ml15 select-border1 round4 pr15 pl15"
           >
             客车
           </div>
           <div
-            @click="goDriveExam('hc')"
+            @click="goDriveExam('truck')"
             class="lh34 ml15 select-border1 round4 pr15 pl15"
           >
             货车
@@ -112,11 +112,11 @@ export default defineComponent({
     };
   },
   methods: {
-    goDriveExam(gs: string) {
+    goDriveExam(model: string) {
       this.$router.push({
         path: "/examInstructions",
         query: {
-          gs: gs,
+          model,
           ...this.$route.query,
         },
       });

+ 2 - 4
src/views/studySkill/index.vue

@@ -309,11 +309,9 @@ export default defineComponent({
       alert2Visible: ref(false),
       dialogVisible: ref(false),
       ...useDriverExam(
-        api.question.questionInfoQlist({
+        api.open.question2InfoList({
           subject: Number(route.query.subject),
-          classIssue: route.query.classIssue as string,
-          classIssueName: "",
-          isRand: "",
+          columnAll:route.query.columnAll as string
         }),
         {
           autoAnswer: false,