|
@@ -73,6 +73,7 @@
|
|
|
import Table from '@/views/newQuery/components/table.vue'
|
|
|
import TimeZoneSelector from "@/components/TimeZoneSelector"
|
|
|
import { throttledExportToExcel } from "@/utils/table"
|
|
|
+import { combine } from '@/utils'
|
|
|
import pf from '@/layout/mixin/publicFunc'
|
|
|
import Item from './item.vue'
|
|
|
export default {
|
|
@@ -121,7 +122,7 @@ export default {
|
|
|
}
|
|
|
const newDatas = _.cloneDeep(this.deArrs)
|
|
|
if (newDatas && newDatas.length) {
|
|
|
- const m = this.combine3(newDatas, 'depStation_iataCd', 'arrStation_iataCd')
|
|
|
+ const m = combine(newDatas, 'depStation_iataCd', 'arrStation_iataCd')
|
|
|
m.forEach((item, index) => {
|
|
|
const obj = {
|
|
|
item,
|
|
@@ -135,36 +136,8 @@ export default {
|
|
|
mounted () {
|
|
|
this.table1 = this.dataContent
|
|
|
this.table2 = this.showObj
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
- combine3 (array, startKey, endKey) {
|
|
|
- const caculatedArray = []
|
|
|
- const weightMap = {}
|
|
|
- const set = new Set()
|
|
|
- array.forEach(item => {
|
|
|
- const caculated = caculatedArray.some(
|
|
|
- caculatedItem =>
|
|
|
- item[startKey] === caculatedItem[startKey] &&
|
|
|
- item[endKey] === caculatedItem[endKey]
|
|
|
- )
|
|
|
- if (!caculated) {
|
|
|
- caculatedArray.push(item)
|
|
|
- set.add(item[startKey])
|
|
|
- set.add(item[endKey])
|
|
|
- if (!weightMap[item[startKey]]) {
|
|
|
- weightMap[item[startKey]] = 0
|
|
|
- }
|
|
|
- if (weightMap[item[endKey]]) {
|
|
|
- weightMap[item[endKey]] += 1
|
|
|
- } else {
|
|
|
- weightMap[item[endKey]] = 1
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- const result = [...set]
|
|
|
- return result.sort((a, b) => weightMap[a] - weightMap[b])
|
|
|
- },
|
|
|
// 获取基本信息
|
|
|
async getViewInfo (dataContent = this.dataContent) {
|
|
|
const { code, returnData } = await this.getQueryList(SERVICE_ID.bagViewId, dataContent)
|