fanzhen1219
This commit is contained in:
@@ -247,7 +247,19 @@ class computedFunc {
|
||||
// 重定向数组
|
||||
let listArrs = JSON.parse(JSON.stringify(listArr))
|
||||
let lineArrs = JSON.parse(JSON.stringify(lineArr))
|
||||
console.log(listArrs, lineArrs)
|
||||
console.log(this.restur, 'this.restur')
|
||||
listArrs.push(0) // 必选第一项
|
||||
if (this.restur.tableLine.length < listArrs.length) {
|
||||
listArrs = this.restur.tableLine.map((item, index) => {
|
||||
return index
|
||||
})
|
||||
}
|
||||
if (this.restur.countData.length < lineArrs.length) {
|
||||
lineArrs = this.restur.countData.map((item, index) => {
|
||||
return index
|
||||
})
|
||||
}
|
||||
// 处理数据显示
|
||||
this.selectData.tableLine = []
|
||||
listArrs.forEach((items, indexs) => {
|
||||
@@ -359,8 +371,11 @@ class computedFunc {
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.areaName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
@@ -401,6 +416,130 @@ class computedFunc {
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 时间======指标
|
||||
comTransAreabeforeTimeLabel () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '时间'
|
||||
})
|
||||
this.transBeforeData.termsName.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.timeArr.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 指标======时间
|
||||
comTransAreabeforeLabelTime () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '指标'
|
||||
})
|
||||
this.transBeforeData.timeArr.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
// console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData')
|
||||
// console.log(this.transBeforeData.termsName, 'this.transBeforeData.termsName')
|
||||
this.transBeforeData.termsName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
// console.log(itemName, '[itemName]')
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 地区======指标
|
||||
comTransAreabeforeAreaLabel () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '地区'
|
||||
})
|
||||
this.transBeforeData.termsName.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.areaName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 指标======地区
|
||||
comTransAreabeforeLabelArea () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '指标'
|
||||
})
|
||||
this.transBeforeData.areaName.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.termsName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// SUM求和 ============对行运算
|
||||
dataSumLine () {
|
||||
console.log(this.restur, '对行运算')
|
||||
@@ -785,6 +924,7 @@ class computedFunc {
|
||||
this.restur = dataRs
|
||||
return this.restur
|
||||
}
|
||||
// ========================================================非地区数据
|
||||
// 竖状图数据 ============行转换
|
||||
dataVerticalMapRow () {
|
||||
let termsName = []
|
||||
@@ -862,6 +1002,84 @@ class computedFunc {
|
||||
}]
|
||||
return this.chartsDatazz
|
||||
}
|
||||
// =========================================================地区数据
|
||||
// 竖状图数据 ============行转换 时间===地区
|
||||
dataVerticalMapRowAreaSJDQ () {
|
||||
let termsName = []
|
||||
let cloneSarr = JSON.parse(JSON.stringify(this.selectData.countData))
|
||||
console.log(this.chartsDatazz, '1012')
|
||||
this.chartsDatazz.series = cloneSarr.map((item, index) => {
|
||||
let obju = Object.values(item)
|
||||
let keys = obju.shift()
|
||||
termsName.push(keys)
|
||||
return {
|
||||
name: keys,
|
||||
type: 'bar',
|
||||
data: obju
|
||||
}
|
||||
})
|
||||
this.chartsDatazz.legend = {
|
||||
type: 'scroll',
|
||||
bottom: 0,
|
||||
data: termsName
|
||||
}
|
||||
let timeArr = this.selectData.tableLine.map((item, index) => {
|
||||
return item.label
|
||||
})
|
||||
timeArr.shift()
|
||||
this.chartsDatazz.xAxis = [{
|
||||
type: 'category',
|
||||
data: timeArr
|
||||
}]
|
||||
this.chartsDatazz.yAxis = [{
|
||||
type: 'value',
|
||||
splitNumber: 6
|
||||
}]
|
||||
console.log(this.chartsDatazz)
|
||||
return this.chartsDatazz
|
||||
}
|
||||
// 竖状图数据 ============列转换 地区===时间
|
||||
dataVerticalMapColAreaDQSJ () {
|
||||
this.chartsDatazz.yAxis = [{
|
||||
type: 'value',
|
||||
splitNumber: 6
|
||||
}]
|
||||
let cloneSarr = JSON.parse(JSON.stringify(this.selectData.countData))
|
||||
let termsName = []
|
||||
let seriess = cloneSarr.map((item, index) => {
|
||||
let obju = Object.values(item)
|
||||
let keys = obju.shift()
|
||||
termsName.push(keys)
|
||||
return obju
|
||||
})
|
||||
// 将数据转置
|
||||
this.chartsDatazz.series = this.comRowColAllData(seriess).map((item, index) => {
|
||||
console.log(this.selectData.tableLine[index + 1].label, '454545')
|
||||
return {
|
||||
name: this.selectData.tableLine[index + 1].label,
|
||||
type: 'bar',
|
||||
data: item
|
||||
}
|
||||
})
|
||||
let timeArr = this.selectData.tableLine.map((item, index) => {
|
||||
return item.label
|
||||
})
|
||||
timeArr.shift()
|
||||
this.chartsDatazz.legend = {
|
||||
type: 'scroll',
|
||||
bottom: 0,
|
||||
data: timeArr
|
||||
}
|
||||
this.chartsDatazz.xAxis = [{
|
||||
type: 'category',
|
||||
data: termsName
|
||||
}]
|
||||
this.chartsDatazz.yAxis = [{
|
||||
type: 'value',
|
||||
splitNumber: 6
|
||||
}]
|
||||
return this.chartsDatazz
|
||||
}
|
||||
// 横状图数据 ============行转换
|
||||
dataAcrossMapRow () {
|
||||
let termsName = []
|
||||
@@ -1105,7 +1323,9 @@ class computedFunc {
|
||||
shHangData = tableData.map((item, index) => {
|
||||
// console.log(Object.values(item).filter((list, key) => { return yuan.indexOf(key) !== -1 }))
|
||||
// tableData.forEach((list, key) => {
|
||||
return Object.values(item).filter((list, key) => { return yuan.indexOf(key) !== -1 })
|
||||
return Object.values(item).filter((list, key) => {
|
||||
return yuan.indexOf(key) !== -1
|
||||
})
|
||||
// })
|
||||
}).filter((item, index) => {
|
||||
return lineInputVal.indexOf(index) !== -1
|
||||
|
||||
Reference in New Issue
Block a user