|
@@ -77,6 +77,13 @@
|
|
|
@click="getData"
|
|
|
>{{ buttonText }}</el-button>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item v-if="withExport">
|
|
|
+ <img
|
|
|
+ src="../../../assets/nav/ic_export.png"
|
|
|
+ class="btn-icon-only"
|
|
|
+ @click="exportClickHandler"
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -101,6 +108,10 @@ export default {
|
|
|
buttonText: {
|
|
|
type: String,
|
|
|
default: '查询'
|
|
|
+ },
|
|
|
+ withExport: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -143,13 +154,13 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
changeHandler(value) {
|
|
|
- this.getInOrOut(value)
|
|
|
- this.formData.airline = ''
|
|
|
+ this.formData.inOrOut = ''
|
|
|
+ this.formData.interval = ''
|
|
|
this.formData.company = ''
|
|
|
+ this.formData.airline = ''
|
|
|
this.formData.airport = ''
|
|
|
this.formData.terminal = ''
|
|
|
- this.formData.interval = ''
|
|
|
- this.formData.inOrOut = ''
|
|
|
+ this.setInOrOutOptions(value)
|
|
|
this.formItems[4].disabled = true
|
|
|
this.formItems[5].disabled = true
|
|
|
this.formItems[6].disabled = true
|
|
@@ -217,6 +228,8 @@ export default {
|
|
|
filterable: true,
|
|
|
clearable: true,
|
|
|
disabled: true,
|
|
|
+ queryId: DATACONTENT_ID.AirlineId,
|
|
|
+ setKey: 'a2',
|
|
|
options: []
|
|
|
},
|
|
|
{
|
|
@@ -226,6 +239,8 @@ export default {
|
|
|
filterable: true,
|
|
|
clearable: true,
|
|
|
disabled: true,
|
|
|
+ queryId: DATACONTENT_ID.AreaId,
|
|
|
+ setKey: 'a5',
|
|
|
options: []
|
|
|
},
|
|
|
{
|
|
@@ -236,6 +251,8 @@ export default {
|
|
|
clearable: true,
|
|
|
// multiple: true,
|
|
|
disabled: true,
|
|
|
+ queryId: DATACONTENT_ID.AirportId,
|
|
|
+ setKey: 'a2',
|
|
|
options: []
|
|
|
},
|
|
|
{
|
|
@@ -248,6 +265,8 @@ export default {
|
|
|
},
|
|
|
clearable: true,
|
|
|
disabled: true,
|
|
|
+ queryId: DATACONTENT_ID.TerminalId,
|
|
|
+ setKey: 'a2',
|
|
|
options: []
|
|
|
}
|
|
|
]
|
|
@@ -271,21 +290,8 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.formItems.forEach(item => {
|
|
|
- switch (item.prop) {
|
|
|
- case 'airline':
|
|
|
- this.getAirline()
|
|
|
- break
|
|
|
- case 'company':
|
|
|
- this.getCompany()
|
|
|
- break
|
|
|
- case 'airport':
|
|
|
- this.getAirport()
|
|
|
- break
|
|
|
- case 'terminal':
|
|
|
- this.getTerminal()
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
+ if (item.queryId && item.setKey) {
|
|
|
+ this.getOptions(item.queryId, item.setKey, item.prop)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -297,128 +303,191 @@ export default {
|
|
|
// console.log(this.formData)
|
|
|
this.$emit('getFormData', this.formData)
|
|
|
},
|
|
|
- async getInOrOut(data) {
|
|
|
- try {
|
|
|
- const res = await Query({
|
|
|
- id: DATACONTENT_ID.inOrOutId,
|
|
|
- dataContent: [data]
|
|
|
- })
|
|
|
- if (res.code === '0') {
|
|
|
- const arr = []
|
|
|
- for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
- arr.push({
|
|
|
- label: res.returnData.listValues[i].a5,
|
|
|
- value: res.returnData.listValues[i].a5
|
|
|
- })
|
|
|
- }
|
|
|
- const theItem = this.formItems.find(item => item.prop === 'inOrOut')
|
|
|
- theItem && (theItem.options = arr)
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('出错了', error)
|
|
|
- }
|
|
|
- },
|
|
|
- async getAirline() {
|
|
|
- try {
|
|
|
- const res = await Query({
|
|
|
- id: DATACONTENT_ID.AirlineId,
|
|
|
- dataContent: []
|
|
|
- })
|
|
|
- if (res.code === '0') {
|
|
|
- const arr = []
|
|
|
- for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
- arr.push({
|
|
|
- label: res.returnData.listValues[i].a2,
|
|
|
- value: res.returnData.listValues[i].a2
|
|
|
- })
|
|
|
- }
|
|
|
- const theItem = this.formItems.find(item => item.prop === 'airline')
|
|
|
- theItem && (theItem.options = arr)
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('出错了', error)
|
|
|
- }
|
|
|
- },
|
|
|
- async getCompany() {
|
|
|
- try {
|
|
|
- const res = await Query({
|
|
|
- id: DATACONTENT_ID.AreaId,
|
|
|
- dataContent: []
|
|
|
- })
|
|
|
- if (res.code === '0') {
|
|
|
- const arr = []
|
|
|
- for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
- arr.push({
|
|
|
- label: res.returnData.listValues[i].a4,
|
|
|
- value: res.returnData.listValues[i].a4
|
|
|
- })
|
|
|
- }
|
|
|
- const theItem = this.formItems.find(item => item.prop === 'company')
|
|
|
- theItem && (theItem.options = arr)
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('出错了', error)
|
|
|
- }
|
|
|
+ exportClickHandler() {
|
|
|
+ this.$emit('export')
|
|
|
+ this.$message.info('开发中')
|
|
|
},
|
|
|
- async getAirport() {
|
|
|
- try {
|
|
|
- const res = await Query({
|
|
|
- id: DATACONTENT_ID.AirportId,
|
|
|
- dataContent: []
|
|
|
- })
|
|
|
- if (res.code === '0') {
|
|
|
- const arr = []
|
|
|
- for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
- arr.push({
|
|
|
- label: res.returnData.listValues[i].a2,
|
|
|
- value: res.returnData.listValues[i].a2
|
|
|
- })
|
|
|
- }
|
|
|
- const theItem = this.formItems.find(item => item.prop === 'airport')
|
|
|
- theItem && (theItem.options = arr)
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log('出错了', error)
|
|
|
+ setInOrOutOptions(range) {
|
|
|
+ const theInOrOutItem = this.formItems.find(item => item.prop === 'inOrOut')
|
|
|
+ switch (range) {
|
|
|
+ case '全部':
|
|
|
+ case '航线':
|
|
|
+ theInOrOutItem.options = [
|
|
|
+ {
|
|
|
+ label: '全部',
|
|
|
+ value: '全部'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ this.formData.inOrOut = '全部'
|
|
|
+ this.formItems[1].disabled = true
|
|
|
+ break
|
|
|
+ case '基地分公司':
|
|
|
+ case '航站':
|
|
|
+ case '航站楼':
|
|
|
+ theInOrOutItem.options = [
|
|
|
+ {
|
|
|
+ value: '全部',
|
|
|
+ label: '全部'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '进港',
|
|
|
+ label: '进港'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '离港',
|
|
|
+ label: '离港'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ this.formItems[1].disabled = false
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ theInOrOutItem.options = []
|
|
|
+ this.formItems[1].disabled = false
|
|
|
+ break
|
|
|
}
|
|
|
},
|
|
|
- async getTerminal() {
|
|
|
+ async getOptions(queryId, setKey, prop) {
|
|
|
try {
|
|
|
- const res = await Query({
|
|
|
- id: DATACONTENT_ID.TerminalId,
|
|
|
+ const { code, returnData, message } = await Query({
|
|
|
+ id: queryId,
|
|
|
dataContent: []
|
|
|
})
|
|
|
- if (res.code === '0') {
|
|
|
- const arr = []
|
|
|
- for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
- arr.push({
|
|
|
- label: res.returnData.listValues[i].a2,
|
|
|
- value: res.returnData.listValues[i].a2
|
|
|
- })
|
|
|
- }
|
|
|
- const theItem = this.formItems.find(item => item.prop === 'terminal')
|
|
|
- theItem && (theItem.options = arr)
|
|
|
+ if (Number(code) === 0) {
|
|
|
+ const arr = returnData.listValues.map(element => ({
|
|
|
+ label: element[setKey],
|
|
|
+ value: element[setKey]
|
|
|
+ }))
|
|
|
+ const theItem = this.formItems.find(item => item.prop === prop)
|
|
|
+ theItem.options = arr
|
|
|
} else {
|
|
|
- this.$message.error(res.message)
|
|
|
+ this.$message.error(message)
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log('出错了', error)
|
|
|
}
|
|
|
}
|
|
|
+ // async getInOrOut(data) {
|
|
|
+ // try {
|
|
|
+ // const res = await Query({
|
|
|
+ // id: DATACONTENT_ID.inOrOutId,
|
|
|
+ // dataContent: [data]
|
|
|
+ // })
|
|
|
+ // if (res.code === '0') {
|
|
|
+ // const arr = []
|
|
|
+ // for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
+ // arr.push({
|
|
|
+ // label: res.returnData.listValues[i].a5,
|
|
|
+ // value: res.returnData.listValues[i].a5
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const theItem = this.formItems.find(item => item.prop === 'inOrOut')
|
|
|
+ // theItem && (theItem.options = arr)
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log('出错了', error)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async getAirline() {
|
|
|
+ // try {
|
|
|
+ // const res = await Query({
|
|
|
+ // id: DATACONTENT_ID.AirlineId,
|
|
|
+ // dataContent: []
|
|
|
+ // })
|
|
|
+ // if (res.code === '0') {
|
|
|
+ // const arr = []
|
|
|
+ // for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
+ // arr.push({
|
|
|
+ // label: res.returnData.listValues[i].a2,
|
|
|
+ // value: res.returnData.listValues[i].a2
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const theItem = this.formItems.find(item => item.prop === 'airline')
|
|
|
+ // theItem && (theItem.options = arr)
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log('出错了', error)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async getCompany() {
|
|
|
+ // try {
|
|
|
+ // const res = await Query({
|
|
|
+ // id: DATACONTENT_ID.AreaId,
|
|
|
+ // dataContent: []
|
|
|
+ // })
|
|
|
+ // if (res.code === '0') {
|
|
|
+ // const arr = []
|
|
|
+ // for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
+ // arr.push({
|
|
|
+ // label: res.returnData.listValues[i].a4,
|
|
|
+ // value: res.returnData.listValues[i].a4
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const theItem = this.formItems.find(item => item.prop === 'company')
|
|
|
+ // theItem && (theItem.options = arr)
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log('出错了', error)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async getAirport() {
|
|
|
+ // try {
|
|
|
+ // const res = await Query({
|
|
|
+ // id: DATACONTENT_ID.AirportId,
|
|
|
+ // dataContent: []
|
|
|
+ // })
|
|
|
+ // if (res.code === '0') {
|
|
|
+ // const arr = []
|
|
|
+ // for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
+ // arr.push({
|
|
|
+ // label: res.returnData.listValues[i].a2,
|
|
|
+ // value: res.returnData.listValues[i].a2
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const theItem = this.formItems.find(item => item.prop === 'airport')
|
|
|
+ // theItem && (theItem.options = arr)
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log('出错了', error)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // async getTerminal() {
|
|
|
+ // try {
|
|
|
+ // const res = await Query({
|
|
|
+ // id: DATACONTENT_ID.TerminalId,
|
|
|
+ // dataContent: []
|
|
|
+ // })
|
|
|
+ // if (res.code === '0') {
|
|
|
+ // const arr = []
|
|
|
+ // for (let i = 0; i < res.returnData.listValues.length; i++) {
|
|
|
+ // arr.push({
|
|
|
+ // label: res.returnData.listValues[i].a2,
|
|
|
+ // value: res.returnData.listValues[i].a2
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // const theItem = this.formItems.find(item => item.prop === 'terminal')
|
|
|
+ // theItem && (theItem.options = arr)
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message)
|
|
|
+ // }
|
|
|
+ // } catch (error) {
|
|
|
+ // console.log('出错了', error)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.flight-statistics-header {
|
|
|
- padding-top: 14px;
|
|
|
+ padding-top: 24px;
|
|
|
min-height: 80px;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
@@ -454,7 +523,8 @@ export default {
|
|
|
&:not(:last-child) {
|
|
|
margin-right: 8px;
|
|
|
}
|
|
|
- &:nth-last-child(2) {
|
|
|
+ &:nth-last-child(2),
|
|
|
+ &:nth-last-child(3) {
|
|
|
margin-right: 16px;
|
|
|
}
|
|
|
.el-form-item__content {
|
|
@@ -520,6 +590,11 @@ export default {
|
|
|
border-radius: 4px;
|
|
|
font-family: Helvetica, 'Microsoft YaHei';
|
|
|
}
|
|
|
+ .btn-icon-only {
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|