@@ -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) | |||
} | |||
})() |
@@ -12,7 +12,7 @@ | |||
</template> | |||
<script> | |||
import { reactive, toRefs, onMounted } from 'vue' | |||
import { reactive, toRefs, onMounted, onUnmounted } from 'vue' | |||
import search from './tools/search.js' | |||
import HeadSearch from '@/components/Search/index.vue' | |||
import PositionMsg from '@/components/PositionMsg/index.vue' | |||
@@ -46,6 +46,10 @@ export default { | |||
handleSearch() | |||
}) | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
handleSearch |
@@ -8,8 +8,8 @@ const data = reactive([ | |||
value: null, | |||
props: { | |||
type: 'daterange', | |||
valueFormat: 'yyyy-MM-dd HH:mm:ss', | |||
format: 'yyyy-MM-dd HH:mm:ss' | |||
valueFormat: 'yyyy-MM-dd', | |||
format: 'yyyy-MM-dd' | |||
} | |||
}, | |||
{ |
@@ -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 || '-' | |||
}) | |||
@@ -25,7 +25,7 @@ import HeadSearch from '@/components/Search/index.vue' | |||
import DataTable from '@/components/DataTable/index.vue' | |||
import MapDrawer from './components/MapDrawer.vue' | |||
import PreviewModal from './components/PreviewModal.vue' | |||
import { reactive, unref, toRefs } from 'vue' | |||
import { reactive, unref, toRefs, onUnmounted } from 'vue' | |||
import { getQuestionList } from '@/api/task/index.js' | |||
export default { | |||
@@ -57,6 +57,10 @@ export default { | |||
data.modalShow = true | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
function getTableData(list) { | |||
data.pageData = list.items | |||
} |
@@ -8,8 +8,8 @@ const data = reactive([ | |||
value: null, | |||
props: { | |||
type: 'daterange', | |||
valueFormat: 'yyyy-MM-dd HH:mm:ss', | |||
format: 'yyyy-MM-dd HH:mm:ss' | |||
valueFormat: 'yyyy-MM-dd', | |||
format: 'yyyy-MM-dd' | |||
} | |||
}, | |||
{ |
@@ -56,7 +56,7 @@ const data = reactive({ | |||
render(row) { | |||
return h(TableTags, { | |||
data: row.type, | |||
filters: QUESTION_TYPE | |||
filters: QUESTION_TYPE.value | |||
}) | |||
} | |||
}, |
@@ -22,7 +22,7 @@ import { search, getAirOptions } from './tools/search.js' | |||
import HeadSearch from '@/components/Search/index.vue' | |||
import DataTable from '@/components/DataTable/index.vue' | |||
import ReportDrawer from './components/ReportDrawer.vue' | |||
import { reactive, unref, toRefs } from 'vue' | |||
import { reactive, unref, toRefs, onUnmounted } from 'vue' | |||
import { getReportList } from '@/api/report/index.js' | |||
export default { | |||
@@ -48,6 +48,10 @@ export default { | |||
return await getReportList(_params) | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
loadDataTable |
@@ -28,7 +28,7 @@ import headSearch from '@/components/Search/index.vue' | |||
import dataTable from '@/components/DataTable/index.vue' | |||
import DepartmentModal from './components/DepartmentModal.vue' | |||
import { getDeptList } from '@/api/system/dept/index.js' | |||
import { unref, toRefs, reactive } from 'vue' | |||
import { unref, toRefs, reactive, onUnmounted } from 'vue' | |||
export default { | |||
name: 'MenuPage', | |||
@@ -54,6 +54,10 @@ export default { | |||
data.modalShow = true | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
loadDataTable, |
@@ -27,7 +27,7 @@ import headSearch from '@/components/Search/index.vue' | |||
import dataTable from '@/components/DataTable/index.vue' | |||
import MenuModal from './components/MenuModal.vue' | |||
import { getMenuList } from '@/api/system/menu/index.js' | |||
import { unref, reactive, toRefs } from 'vue' | |||
import { unref, reactive, toRefs, onUnmounted } from 'vue' | |||
export default { | |||
name: 'MenuPage', | |||
@@ -53,6 +53,10 @@ export default { | |||
data.modalShow = true | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
loadDataTable, |
@@ -41,7 +41,7 @@ import dataTable from '@/components/DataTable/index.vue' | |||
import RoleModal from './components/RoleModal.vue' | |||
import ConfigModal from './components/ConfigModal.vue' | |||
import { getRoleList } from '@/api/system/role/index' | |||
import { ref, unref, toRefs, reactive } from 'vue' | |||
import { ref, unref, toRefs, reactive, onUnmounted } from 'vue' | |||
export default { | |||
name: 'MenuPage', | |||
@@ -82,6 +82,10 @@ export default { | |||
} | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
loadDataTable, |
@@ -38,7 +38,7 @@ import headSearch from '@/components/Search/index.vue' | |||
import dataTable from '@/components/DataTable/index.vue' | |||
import UserModal from './components/UserModal.vue' | |||
import { getUserList } from '@/api/system/user/index.js' | |||
import { unref, ref, toRefs, reactive } from 'vue' | |||
import { unref, ref, toRefs, reactive, onUnmounted } from 'vue' | |||
export default { | |||
name: 'MenuPage', | |||
@@ -80,6 +80,10 @@ export default { | |||
} | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
loadDataTable, |
@@ -46,7 +46,7 @@ import TaskModal from './components/TaskModal.vue' | |||
import LiveDrawer from './components/LiveDrawer.vue' | |||
import DemandDrawer from './components/DemandDrawer.vue' | |||
import VerifyDrawer from './components/VerifyDrawer.vue' | |||
import { reactive, ref, unref, toRefs } from 'vue' | |||
import { reactive, ref, unref, toRefs, onUnmounted } from 'vue' | |||
import { getTaskList } from '@/api/task/index.js' | |||
export default { | |||
@@ -94,6 +94,10 @@ export default { | |||
} | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
return { | |||
...toRefs(data), | |||
searchRef, |
@@ -26,7 +26,7 @@ | |||
<ConfirmModal v-if="confirmModal" v-model:visible="confirmModal" :data="pageData" :select-row="rowData" @update-data="handleReload" /> | |||
<!-- 图片位置 --> | |||
<position-drawer v-model:visible="positionDrawer" :data="rowData" /> | |||
<position-drawer v-model:visible="positionDrawer" :data="pageData" /> | |||
</template> | |||
@@ -38,7 +38,7 @@ import DataTable from '@/components/DataTable/index.vue' | |||
import ConfirmModal from './components/ConfirmModal.vue' | |||
import PositionDrawer from './components/PositionDrawer.vue' | |||
import { getQuestionList, generateReport, questionAnalyze } from '@/api/task/index.js' | |||
import { unref, reactive, toRefs, provide } from 'vue' | |||
import { unref, reactive, toRefs, provide, onUnmounted } from 'vue' | |||
export default { | |||
name: 'QuestionPage', | |||
components: { HeadSearch, DataTable, ConfirmModal, PositionDrawer }, | |||
@@ -152,6 +152,10 @@ export default { | |||
} | |||
} | |||
onUnmounted(() => { | |||
data.searchParams = null | |||
}) | |||
function handleReload() { | |||
data.handleSearch(data.searchParams, false) | |||
} |
@@ -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 | |||
}) | |||
} | |||
}, |