Quellcode durchsuchen

change question type

tags/v1.0.0^2
zhangtao vor 2 Jahren
Ursprung
Commit
bf8f886b82
1 geänderte Dateien mit 13 neuen und 5 gelöschten Zeilen
  1. +13
    -5
      src/utils/dictionary.js

+ 13
- 5
src/utils/dictionary.js Datei anzeigen

@@ -1,6 +1,6 @@
import { getQuestionType } from '@/api/task/index.js'
import { dataToSelect } from '@/utils/handleData.js'
import { setQuestion } from './question.js'
import { setQuestion, getQuestion } from './question.js'
import { ref } from 'vue'

export const QUESTION_TYPE = ref([])
@@ -55,11 +55,19 @@ export const MENU_STATUS = [
]

export const getQuestionList = async function() {
const res = await getQuestionType()
if (res.code === 0) {
const data = dataToSelect(res.data, { label: 'content', value: 'code' })
setQuestion(data)
if (getQuestion()) {
const data = getQuestion()
QUESTION_TYPE.value = data
QUESTION_TYPE_ALL.value = [{ label: '全部', value: 'all' }].concat(data)
} else {
const res = await getQuestionType()
if (res.code === 0) {
const data = dataToSelect(res.data, { label: 'content', value: 'code' })
setQuestion(data)
QUESTION_TYPE.value = data
QUESTION_TYPE_ALL.value = [{ label: '全部', value: 'all' }].concat(data)
}
}
}

getQuestionList()

Laden…
Abbrechen
Speichern