|
@@ -14,7 +14,7 @@
|
|
|
:prop="item.prop"
|
|
|
:label="item.label"
|
|
|
:style="{
|
|
|
- width: item.width || '120px'
|
|
|
+ width: item.width || '120px',
|
|
|
}"
|
|
|
>
|
|
|
<template v-if="item.inputType === 'input'">
|
|
@@ -104,32 +104,32 @@ export default {
|
|
|
props: {
|
|
|
title: {
|
|
|
type: String,
|
|
|
- default: ''
|
|
|
+ default: '',
|
|
|
},
|
|
|
items: {
|
|
|
type: Array,
|
|
|
- default: undefined
|
|
|
+ default: undefined,
|
|
|
},
|
|
|
customItems: {
|
|
|
type: Array,
|
|
|
- default: () => []
|
|
|
+ default: () => [],
|
|
|
},
|
|
|
data: {
|
|
|
type: Object,
|
|
|
- default: undefined
|
|
|
+ default: undefined,
|
|
|
},
|
|
|
buttonText: {
|
|
|
type: String,
|
|
|
- default: '查询'
|
|
|
+ default: '查询',
|
|
|
},
|
|
|
withExport: {
|
|
|
type: Boolean,
|
|
|
- default: true
|
|
|
+ default: true,
|
|
|
},
|
|
|
withSetting: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
- }
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -155,24 +155,24 @@ export default {
|
|
|
options: [
|
|
|
{
|
|
|
value: '全部',
|
|
|
- label: '全部'
|
|
|
+ label: '全部',
|
|
|
},
|
|
|
{
|
|
|
value: '航线',
|
|
|
- label: '航线'
|
|
|
+ label: '航线',
|
|
|
},
|
|
|
{
|
|
|
value: '基地分公司',
|
|
|
- label: '基地分公司'
|
|
|
+ label: '基地分公司',
|
|
|
},
|
|
|
{
|
|
|
value: '航站',
|
|
|
- label: '航站'
|
|
|
+ label: '航站',
|
|
|
},
|
|
|
{
|
|
|
value: '航站楼',
|
|
|
- label: '航站楼'
|
|
|
- }
|
|
|
+ label: '航站楼',
|
|
|
+ },
|
|
|
],
|
|
|
changeHandler(value) {
|
|
|
this.setInOrOutOptions(value)
|
|
@@ -180,7 +180,7 @@ export default {
|
|
|
航线: 'airline',
|
|
|
基地分公司: 'area',
|
|
|
航站: 'airport',
|
|
|
- 航站楼: 'terminal'
|
|
|
+ 航站楼: 'terminal',
|
|
|
}
|
|
|
Object.entries(rangeMap).forEach(([k, v]) => {
|
|
|
const theItem = this.formItems.find(item => item.prop === v)
|
|
@@ -191,7 +191,7 @@ export default {
|
|
|
theItem && (theItem.disabled = true)
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
prop: 'inOrOut',
|
|
@@ -199,7 +199,7 @@ export default {
|
|
|
placeholder: '进离港',
|
|
|
requiredWarning: '请先选择进离港',
|
|
|
clearable: true,
|
|
|
- options: []
|
|
|
+ options: [],
|
|
|
},
|
|
|
{
|
|
|
prop: 'interval',
|
|
@@ -210,28 +210,28 @@ export default {
|
|
|
options: [
|
|
|
{
|
|
|
value: '日',
|
|
|
- label: '按日统计'
|
|
|
+ label: '按日统计',
|
|
|
},
|
|
|
{
|
|
|
value: '月',
|
|
|
- label: '按月统计'
|
|
|
+ label: '按月统计',
|
|
|
},
|
|
|
{
|
|
|
value: '季',
|
|
|
- label: '按季统计'
|
|
|
+ label: '按季统计',
|
|
|
},
|
|
|
{
|
|
|
value: '年',
|
|
|
- label: '按年统计'
|
|
|
- }
|
|
|
- ]
|
|
|
+ label: '按年统计',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
prop: 'dateTime',
|
|
|
inputType: 'datePicker',
|
|
|
clearable: true,
|
|
|
width: '240px',
|
|
|
- requiredWarning: '请先选择统计时间范围'
|
|
|
+ requiredWarning: '请先选择统计时间范围',
|
|
|
},
|
|
|
{
|
|
|
prop: 'airline',
|
|
@@ -244,7 +244,7 @@ export default {
|
|
|
disabled: true,
|
|
|
queryId: SERVICE_ID.airlineOptions,
|
|
|
setKey: 'a2',
|
|
|
- options: []
|
|
|
+ options: [],
|
|
|
},
|
|
|
{
|
|
|
prop: 'area',
|
|
@@ -255,7 +255,7 @@ export default {
|
|
|
disabled: true,
|
|
|
queryId: SERVICE_ID.areaOptions,
|
|
|
setKey: 'a5',
|
|
|
- options: []
|
|
|
+ options: [],
|
|
|
},
|
|
|
{
|
|
|
prop: 'airport',
|
|
@@ -268,7 +268,7 @@ export default {
|
|
|
disabled: true,
|
|
|
queryId: SERVICE_ID.AirportId,
|
|
|
setKey: 'a2',
|
|
|
- options: []
|
|
|
+ options: [],
|
|
|
},
|
|
|
{
|
|
|
prop: 'terminal',
|
|
@@ -279,16 +279,16 @@ export default {
|
|
|
disabled: true,
|
|
|
queryId: SERVICE_ID.TerminalId,
|
|
|
setKey: 'a2',
|
|
|
- options: []
|
|
|
- }
|
|
|
- ]
|
|
|
+ options: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['savedFormDataMap']),
|
|
|
formDataObj() {
|
|
|
return JSON.parse(JSON.stringify(this.formData))
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
items: {
|
|
@@ -296,25 +296,28 @@ export default {
|
|
|
val && (this.formItems = val)
|
|
|
},
|
|
|
deep: true,
|
|
|
- immediate: true
|
|
|
+ immediate: true,
|
|
|
},
|
|
|
data: {
|
|
|
handler(val) {
|
|
|
val && (this.formData = val)
|
|
|
},
|
|
|
deep: true,
|
|
|
- immediate: true
|
|
|
+ immediate: true,
|
|
|
},
|
|
|
formDataObj: {
|
|
|
handler(val, oldVal) {
|
|
|
this.formItems.forEach(item => {
|
|
|
- if (item.changeHandler && String(val[item.prop]) !== String(oldVal[item.prop])) {
|
|
|
+ if (
|
|
|
+ item.changeHandler &&
|
|
|
+ String(val[item.prop]) !== String(oldVal[item.prop])
|
|
|
+ ) {
|
|
|
item.changeHandler.call(this, val[item.prop])
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.customItems.forEach(item => {
|
|
@@ -331,7 +334,12 @@ export default {
|
|
|
const savedFormData = this.savedFormDataMap[this.$route.name]
|
|
|
this.formItems.forEach(item => {
|
|
|
if (item.queryId && item.setKey) {
|
|
|
- this.getOptions(item.queryId, item.setKey, item.prop)
|
|
|
+ this.getOptions(
|
|
|
+ item.prop,
|
|
|
+ item.queryId,
|
|
|
+ item.setKey,
|
|
|
+ item.setLabel ?? item.setKey
|
|
|
+ )
|
|
|
}
|
|
|
if (savedFormData?.[item.prop]) {
|
|
|
this.formData[item.prop] = savedFormData[item.prop]
|
|
@@ -345,7 +353,10 @@ export default {
|
|
|
getData() {
|
|
|
try {
|
|
|
this.formItems.forEach(item => {
|
|
|
- if (item.requiredWarning && (!this.formData[item.prop] || this.formData[item.prop].length === 0)) {
|
|
|
+ if (
|
|
|
+ item.requiredWarning &&
|
|
|
+ (!this.formData[item.prop] || this.formData[item.prop].length === 0)
|
|
|
+ ) {
|
|
|
throw new Error(item.requiredWarning)
|
|
|
}
|
|
|
})
|
|
@@ -365,7 +376,7 @@ export default {
|
|
|
}
|
|
|
this.$emit('getFormData', this.formData)
|
|
|
this.$store.dispatch('savedSettings/saveFormData', {
|
|
|
- formData: this.formData
|
|
|
+ formData: this.formData,
|
|
|
})
|
|
|
},
|
|
|
exportClickHandler() {
|
|
@@ -375,7 +386,9 @@ export default {
|
|
|
this.$emit('setting')
|
|
|
},
|
|
|
setInOrOutOptions(range) {
|
|
|
- const theInOrOutItem = this.formItems.find(item => item.prop === 'inOrOut')
|
|
|
+ const theInOrOutItem = this.formItems.find(
|
|
|
+ item => item.prop === 'inOrOut'
|
|
|
+ )
|
|
|
switch (range) {
|
|
|
case '全部':
|
|
|
case '航线':
|
|
@@ -383,8 +396,8 @@ export default {
|
|
|
theInOrOutItem.options = [
|
|
|
{
|
|
|
label: '全部',
|
|
|
- value: '全部'
|
|
|
- }
|
|
|
+ value: '全部',
|
|
|
+ },
|
|
|
]
|
|
|
theInOrOutItem.disabled = true
|
|
|
}
|
|
@@ -397,16 +410,16 @@ export default {
|
|
|
theInOrOutItem.options = [
|
|
|
{
|
|
|
value: '全部',
|
|
|
- label: '全部'
|
|
|
+ label: '全部',
|
|
|
},
|
|
|
{
|
|
|
value: '进港',
|
|
|
- label: '进港'
|
|
|
+ label: '进港',
|
|
|
},
|
|
|
{
|
|
|
value: '离港',
|
|
|
- label: '离港'
|
|
|
- }
|
|
|
+ label: '离港',
|
|
|
+ },
|
|
|
]
|
|
|
theInOrOutItem.disabled = false
|
|
|
}
|
|
@@ -419,16 +432,18 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
},
|
|
|
- async getOptions(queryId, setKey, prop) {
|
|
|
+ async getOptions(prop, queryId, setKey, setLabel) {
|
|
|
try {
|
|
|
const { code, returnData, message } = await TempQuery({
|
|
|
serviceId: queryId,
|
|
|
- dataContent: []
|
|
|
+ dataContent: [],
|
|
|
+ pageSize: 9999
|
|
|
})
|
|
|
- if (Number(code) === 0) {
|
|
|
- const arr = returnData.listValues.map(element => ({
|
|
|
- label: element[setKey],
|
|
|
- value: element[setKey]
|
|
|
+ if (String(code) === '0') {
|
|
|
+ const listValues = returnData.listValues || returnData
|
|
|
+ const arr = listValues.map(element => ({
|
|
|
+ label: element[setLabel],
|
|
|
+ value: element[setKey],
|
|
|
}))
|
|
|
const theItem = this.formItems.find(item => item.prop === prop)
|
|
|
theItem.options = arr
|
|
@@ -438,15 +453,12 @@ export default {
|
|
|
} catch (error) {
|
|
|
this.$message.error('失败')
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style
|
|
|
- lang="scss"
|
|
|
- scoped
|
|
|
->
|
|
|
+<style lang="scss" scoped>
|
|
|
.flight-statistics-header {
|
|
|
padding-top: 24px;
|
|
|
min-height: 80px;
|