Browse Source

Merge branch 'zhangtao' of gitadmin/tuoheng_lc_web into develop

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
20cc729143
2 changed files with 14 additions and 11 deletions
  1. +2
    -1
      src/views/report-manage/all-report/index.vue
  2. +12
    -10
      src/views/report-manage/all-report/tools/search.js

+ 2
- 1
src/views/report-manage/all-report/index.vue View File



<script> <script>
import table from './tools/table.js' import table from './tools/table.js'
import search from './tools/search.js'
import { search, getAirOptions } from './tools/search.js'
import HeadSearch from '@/components/Search/index.vue' import HeadSearch from '@/components/Search/index.vue'
import DataTable from '@/components/DataTable/index.vue' import DataTable from '@/components/DataTable/index.vue'
import ReportDrawer from './components/ReportDrawer.vue' import ReportDrawer from './components/ReportDrawer.vue'
name: 'TaskAll', name: 'TaskAll',
components: { HeadSearch, DataTable, ReportDrawer }, components: { HeadSearch, DataTable, ReportDrawer },
setup() { setup() {
getAirOptions()
const data = reactive({ const data = reactive({
search, search,
...toRefs(table) ...toRefs(table)

+ 12
- 10
src/views/report-manage/all-report/tools/search.js View File

import { reactive } from 'vue'
import { reactive, ref } from 'vue'
import { TASK_TYPE } from '@/utils/dictionary.js' import { TASK_TYPE } from '@/utils/dictionary.js'
import { airportList } from '@/api/dashboard/index.js'
import { dataToSelect } from '@/utils/handleData.js'


const data = reactive([
const airOptions = ref([])

export const search = reactive([
{ {
label: '任务编号', label: '任务编号',
key: 'code',
key: 'reportNo',
props: { props: {
placeholder: '请输入任务编号' placeholder: '请输入任务编号'
} }
type: 'select', type: 'select',
props: { props: {
placeholder: '请选择巡检机场', placeholder: '请选择巡检机场',
options: [],
onUpdateValue: () => {
const index = data.findIndex((item) => item.key === 'route')
data[index].value = ''
}
options: airOptions
} }
}, },
{ {
} }
]) ])


export default data

export const getAirOptions = async function() {
const res = await airportList()
airOptions.value = dataToSelect(res.data, { label: 'name', value: 'id' })
}

Loading…
Cancel
Save