Browse Source

Merge branch 'zhangtao' of gitadmin/tuoheng_lc_web into develop

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
d8f80c6402
1 changed files with 6 additions and 12 deletions
  1. +6
    -12
      src/utils/dictionary.js

+ 6
- 12
src/utils/dictionary.js View File

@@ -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()

Loading…
Cancel
Save