@@ -1,3 +1,10 @@ | |||
import { getQuestionType } from '@/api/task/index.js' | |||
import { dataToSelect } from '@/utils/handleData.js' | |||
import { ref } from 'vue' | |||
export const QUESTION_TYPE = ref([]) | |||
export const QUESTION_TYPE_ALL = ref([]) | |||
export const TASK_STATUS = [ | |||
{ label: '待飞行', value: 1 }, | |||
{ label: '飞行中', value: 2 }, | |||
@@ -15,13 +22,6 @@ export const TASK_TYPE = [ | |||
{ label: '应急巡检', value: 2 } | |||
] | |||
export const QUESTION_TYPE = [ | |||
{ label: '林场问题图斑', value: 'LC001' }, | |||
{ label: '病虫树', value: 'LC002' }, | |||
{ label: '人员活动', value: 'LC003' }, | |||
{ label: '火灾隐患', value: 'LC004' } | |||
] | |||
export const QUESTION_STATUS = [ | |||
{ label: '已确认', value: 1 }, | |||
{ label: '已忽略', value: 2 }, | |||
@@ -52,3 +52,12 @@ export const MENU_STATUS = [ | |||
{ label: '在用', value: 1 }, | |||
{ label: '停用', value: 2 } | |||
] | |||
const getQuestionList = (async function() { | |||
const res = await getQuestionType() | |||
if (res.code === 0) { | |||
const data = dataToSelect(res.data, { label: 'content', value: 'code' }) | |||
QUESTION_TYPE.value = data | |||
QUESTION_TYPE_ALL.value = [{ label: '全部', value: 'all' }].concat(data) | |||
} | |||
})() |
@@ -77,7 +77,7 @@ export default defineComponent({ | |||
}) | |||
const getQuestionType = computed(() => { | |||
const row = QUESTION_TYPE.find((item) => { return item.value === data.selectRow.type }) | |||
const row = QUESTION_TYPE.value.find((item) => { return item.value === data.selectRow.type }) | |||
return row?.label || '-' | |||
}) | |||
@@ -56,7 +56,7 @@ const data = reactive({ | |||
render(row) { | |||
return h(TableTags, { | |||
data: row.type, | |||
filters: QUESTION_TYPE | |||
filters: QUESTION_TYPE.value | |||
}) | |||
} | |||
}, |
@@ -1,5 +1,5 @@ | |||
import { reactive } from 'vue' | |||
import { QUESTION_TYPE, QUESTION_STATUS } from '@/utils/dictionary.js' | |||
import { QUESTION_TYPE_ALL, QUESTION_STATUS } from '@/utils/dictionary.js' | |||
const data = reactive([ | |||
{ | |||
@@ -9,10 +9,7 @@ const data = reactive([ | |||
value: 'all', | |||
props: { | |||
placeholder: '请选择问题类型', | |||
options: [ | |||
{ label: '全部', value: 'all' }, | |||
...QUESTION_TYPE | |||
] | |||
options: QUESTION_TYPE_ALL | |||
} | |||
}, | |||
{ |
@@ -86,7 +86,7 @@ const data = reactive({ | |||
render(row) { | |||
return h(TableTags, { | |||
data: row.type, | |||
filters: QUESTION_TYPE | |||
filters: QUESTION_TYPE.value | |||
}) | |||
} | |||
}, |