Parcourir la source

Merge branch 'zhangtao' of gitadmin/tuoheng_lc_web into develop

tags/v1.0.0^2
zhangtao il y a 2 ans
Parent
révision
d8f80c6402
1 fichiers modifiés avec 6 ajouts et 12 suppressions
  1. +6
    -12
      src/utils/dictionary.js

+ 6
- 12
src/utils/dictionary.js Voir le fichier

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

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

export const getQuestionList = async function() {
if (getQuestion()) {
const data = getQuestion()
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)
} 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()
removeQuestion()

Chargement…
Annuler
Enregistrer