|
@@ -34,7 +34,7 @@ export const useSubjectList = (type: ExerciseType.ListType) => {
|
|
|
|
|
|
|
|
|
}
|
|
|
- else if (type = "wrong") {
|
|
|
+ else if (type == "wrong") {
|
|
|
const collectionModel = new CollectionModel(type);
|
|
|
const result = await collectionModel.getList({
|
|
|
carType: query.vehicle as CollectionAndWrongType.CarType,
|
|
@@ -74,6 +74,44 @@ export const useSubjectList = (type: ExerciseType.ListType) => {
|
|
|
// const collectionList.value.push(...result.collectionList)
|
|
|
// const questionList.value.push(...result.rows)
|
|
|
}
|
|
|
+ else if(type=="collection"){
|
|
|
+ const collectionModel = new CollectionModel(type);
|
|
|
+ const result = await collectionModel.getList({
|
|
|
+ carType: query.vehicle as CollectionAndWrongType.CarType,
|
|
|
+ km: query.name as CollectionAndWrongType.Km,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 50
|
|
|
+ });
|
|
|
+ console.log(result.collectionList)
|
|
|
+ if(result.rows.length==0){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ result.rows.forEach(item => {
|
|
|
+ item.isTrue = null
|
|
|
+ if (typeof item.opts == "string") {
|
|
|
+ item.opts = item.opts.split("-")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let questionItem: Test.QuestionInfo =result.rows[0]
|
|
|
+ let questionIndex = 0
|
|
|
+ //排序
|
|
|
+ if (query.questionId) {
|
|
|
+ result.rows.forEach((item, index) => {
|
|
|
+ if (item.id == Number(query.questionId)) {
|
|
|
+ questionIndex = index
|
|
|
+ questionItem = item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ result.rows.splice(questionIndex,1)
|
|
|
+ result.rows.unshift(questionItem)
|
|
|
+
|
|
|
+ }
|
|
|
+ res = {
|
|
|
+ total: result.total,
|
|
|
+ list: result.rows
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
else {
|
|
|
res = await testModel.getFreeList({
|
|
|
...query,
|