fanzhen0102

This commit is contained in:
fanzhen123
2020-01-02 17:42:12 +08:00
parent 55a139750a
commit eb36f54609
7 changed files with 112 additions and 227 deletions

View File

@@ -3,7 +3,6 @@
function draw (canvaswidth, canvasheight, refidentifying) {
var showNum = []
var canvas = refidentifying // 获取到canvas的对象演员
console.log(canvas.getContext)
var context = canvas.getContext('2d') // 获取到canvas画图的环境演员表演的舞台
canvas.width = canvaswidth
canvas.height = canvasheight

View File

@@ -75,6 +75,7 @@ class computedFunc {
series: [{
name: '访问来源',
type: 'pie',
avoidLabelOverlap: true,
radius: '55%',
center: ['50%', '50%'],
data: [{
@@ -120,7 +121,6 @@ class computedFunc {
// 总数据处理
countData: []
}
console.log(this.transBeforeData)
}
// 初始化所有的数据
initAllData () {
@@ -196,6 +196,7 @@ class computedFunc {
series: [{
name: '访问来源',
type: 'pie',
avoidLabelOverlap: true,
radius: '55%',
center: ['50%', '50%'],
data: [{
@@ -247,8 +248,6 @@ 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.resturkkkkk')
listArrs.push(0) // 必选第一项
if (this.restur.tableLine.length < listArrs.length) {
listArrs = this.restur.tableLine.map((item, index) => {
@@ -269,7 +268,6 @@ class computedFunc {
})
})
// this.selectData.tableLine = this.restur.tableLine
console.log(JSON.parse(JSON.stringify(this.restur.countData)), '12222')
let datart = JSON.parse(JSON.stringify(this.restur.countData))
let csd1 = datart.map((itemCol, indexCol) => {
let newArr = {}
@@ -291,7 +289,6 @@ class computedFunc {
return row[index]
})
})
// console.log(this.transData, '转置后')
}
// 处理行列图表数据
comRowColAllData (arr) {
@@ -300,7 +297,6 @@ class computedFunc {
return row[index]
})
})
// console.log(this.transData, '转置后')
}
// 处理非地区数据转置前的数据,返回可渲染的数据格式
comTransBefore () {
@@ -319,7 +315,6 @@ class computedFunc {
this.transBeforeData.termsName.forEach((itemName, indexName) => {
var tableLine = {}
this.transBeforeData.transBeforeTermsData[indexName].forEach((dataList, dataKey) => {
// console.log(dataKey)
if (dataKey === 0) {
tableLine['table_line0'] = itemName
}
@@ -348,7 +343,6 @@ class computedFunc {
this.transBeforeData.timeArr.forEach((itemName, indexName) => {
var tableLine = {}
this.transData[indexName].forEach((dataList, dataKey) => {
// console.log(dataKey)
if (dataKey === 0) {
tableLine['table_line0'] = itemName
}
@@ -360,7 +354,6 @@ class computedFunc {
}
// 处理非地区数据转置后的数据,返回可渲染的数据格式
comTransAreabefore () {
console.log(this.transBeforeData, 'this.transBeforeData100025')
// 表头数据处理
this.restur.tableLine.push({
labelId: 'table_line0',
@@ -373,13 +366,9 @@ 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) {
tableLine['table_line0'] = itemName
}
@@ -391,7 +380,6 @@ class computedFunc {
}
// 处理地区数据转置后的数据,返回可渲染的数据格式
comTransAreaAfter () {
console.log(this.transBeforeData, 'this.transBeforeDataname')
// 表头数据处理
this.restur.tableLine.push({
labelId: 'table_line0',
@@ -406,10 +394,8 @@ class computedFunc {
// 将数据转置
// 总数据处理
this.transBeforeData.timeArr.forEach((itemName, indexName) => {
console.log(itemName, 'itemName')
var tableLine = {}
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
// console.log(dataKey)
if (dataKey === 0) {
tableLine['table_line0'] = itemName
}
@@ -417,7 +403,6 @@ class computedFunc {
})
this.restur.countData.push(tableLine)
})
console.log(this.restur, 'kkk999')
return this.restur
}
// 地区数据对于维度转化的处理 时间======指标
@@ -434,13 +419,9 @@ class computedFunc {
})
})
// 总数据处理
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
}
@@ -464,17 +445,9 @@ class computedFunc {
})
})
// 总数据处理
// 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
}
@@ -482,7 +455,6 @@ class computedFunc {
})
this.restur.countData.push(tableLine)
})
console.log(this.restur, 'this.restur')
return this.restur
}
// 地区数据对于维度转化的处理 地区======指标
@@ -499,13 +471,9 @@ 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) {
tableLine['table_line0'] = itemName
}
@@ -529,13 +497,9 @@ class computedFunc {
})
})
// 总数据处理
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
}
@@ -547,7 +511,6 @@ class computedFunc {
}
// SUM求和 ============对行运算
dataSumLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'SUM求和' + this.restur.computedNum,
@@ -558,8 +521,6 @@ class computedFunc {
arr.shift()
return math.add(...arr).toFixed(2)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -568,7 +529,6 @@ class computedFunc {
}
// SUM求和 ============对列运算
dataSumList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -581,7 +541,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.add(...item).toFixed(2)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -595,7 +554,6 @@ class computedFunc {
}
// x平均数 ========>对行运算
dataAVGLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'x平均数' + this.restur.computedNum,
@@ -606,8 +564,6 @@ class computedFunc {
arr.shift()
return (math.add(...arr).toFixed(2)) / arr.length
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -616,7 +572,6 @@ class computedFunc {
}
// x平均数 ============对列运算
dataAVGList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -629,7 +584,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return (math.add(...item).toFixed(2)) / item.length
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -643,7 +597,6 @@ class computedFunc {
}
// MAX最大值 ============对行运算
dataMAXLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'MAX最大值' + this.restur.computedNum,
@@ -654,8 +607,6 @@ class computedFunc {
arr.shift()
return math.max(...arr)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -664,7 +615,6 @@ class computedFunc {
}
// MAX最大值 ============对列运算
dataMAXList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -677,7 +627,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.max(...item)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -691,7 +640,6 @@ class computedFunc {
}
// MIN最小值 ============对行运算
dataMINLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'MIN最小值' + this.restur.computedNum,
@@ -702,8 +650,6 @@ class computedFunc {
arr.shift()
return math.min(...arr)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -712,7 +658,6 @@ class computedFunc {
}
// MIN最小值 ============对列运算
dataMINList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -725,7 +670,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.min(...item)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -739,7 +683,6 @@ class computedFunc {
}
// MD中位数 ============对行运算
dataMDLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'MD中位数' + this.restur.computedNum,
@@ -750,8 +693,6 @@ class computedFunc {
arr.shift()
return math.median(...arr).toFixed(2)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -760,7 +701,6 @@ class computedFunc {
}
// MD中位数 ============对列运算
dataMDList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -773,7 +713,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.median(...item).toFixed(2)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -787,7 +726,6 @@ class computedFunc {
}
// MO众数 ============对行运算
dataMOLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'MO众数' + this.restur.computedNum,
@@ -798,8 +736,6 @@ class computedFunc {
arr.shift()
return math.mode(...arr)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -808,7 +744,6 @@ class computedFunc {
}
// MO众数 ============对列运算
dataMOList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -821,7 +756,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.mode(...item)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -835,7 +769,6 @@ class computedFunc {
}
// S²方差 ============对行运算
dataSSLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'S²方差' + this.restur.computedNum,
@@ -846,8 +779,6 @@ class computedFunc {
arr.shift()
return math.variance(...arr).toFixed(2)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -856,7 +787,6 @@ class computedFunc {
}
// S²方差 ============对列运算
dataSSList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -869,7 +799,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.variance(...item).toFixed(2)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -883,7 +812,6 @@ class computedFunc {
}
// S标准差 ============对行运算
dataSLine () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
dataRs.tableLine.push({
label: 'S标准差' + this.restur.computedNum,
@@ -894,8 +822,6 @@ class computedFunc {
arr.shift()
return math.std(...arr).toFixed(2)
})
// console.log(bth, '求和')
// console.log(dataRs.countData, bth.length)
dataRs.countData.forEach((item, index) => {
item['table_line' + (dataRs.tableLine.length - 1)] = bth[index]
})
@@ -904,7 +830,6 @@ class computedFunc {
}
// S标准差 ============对列运算
dataSList () {
console.log(this.restur, '对行运算')
let dataRs = JSON.parse(JSON.stringify(this.restur))
// 处理现在的数据
let datarts = this.restur.countData.map((item, index) => {
@@ -917,7 +842,6 @@ class computedFunc {
let transSum = this.transData.map((item, index) => {
return math.std(...item).toFixed(2)
})
console.log(transSum, 'transSum')
let returObj = {}
transSum.forEach((item, index) => {
if (index === 0) {
@@ -934,7 +858,6 @@ class computedFunc {
dataVerticalMapRow () {
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()
@@ -962,7 +885,6 @@ class computedFunc {
type: 'value',
splitNumber: 6
}]
console.log(this.chartsDatazz)
return this.chartsDatazz
}
// 竖状图数据 ============列转换
@@ -981,7 +903,6 @@ class computedFunc {
})
// 将数据转置
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',
@@ -1012,7 +933,6 @@ class computedFunc {
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()
@@ -1040,7 +960,6 @@ class computedFunc {
type: 'value',
splitNumber: 6
}]
console.log(this.chartsDatazz)
return this.chartsDatazz
}
// 竖状图数据 ============列转换 地区===时间
@@ -1059,7 +978,6 @@ class computedFunc {
})
// 将数据转置
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',
@@ -1134,7 +1052,6 @@ class computedFunc {
})
// 将数据转置
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',
@@ -1209,7 +1126,6 @@ class computedFunc {
})
// 将数据转置
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: 'line',
@@ -1247,7 +1163,6 @@ class computedFunc {
this.chartsDatazzPie.legend.data = termsLine
let cloneSarr = JSON.parse(JSON.stringify(this.selectData.countData))
console.log(this.selectData, 'this.selectData.countData')
this.chartsDatazzPie.series = cloneSarr.map((item, index) => {
let obju = Object.values(item)
let keys = obju.shift()
@@ -1271,15 +1186,12 @@ class computedFunc {
}
}
})
console.log(this.chartsDatazzPie, 'this.chartsDatazzPie')
return this.chartsDatazzPie
}
// 饼图数据 ============列转换
dataPieMapCol () {
let cloneLine = JSON.parse(JSON.stringify(this.selectData.tableLine))
console.log(cloneLine, '10236')
let cloneSarr = JSON.parse(JSON.stringify(this.selectData.countData))
console.log(cloneSarr, 'this.selectData.countData')
this.chartsDatazzPie.legend.data = cloneSarr.map((item, index) => {
return Object.values(item)[0]
})
@@ -1289,7 +1201,6 @@ class computedFunc {
radius: '55%',
center: ['40%', '50%'],
data: cloneSarr.map((itemObj, indexObj) => {
console.log(Object.values(itemObj))
return {
name: Object.values(itemObj)[0],
value: Object.values(itemObj)[1]
@@ -1303,7 +1214,6 @@ class computedFunc {
}
}
}
console.log(this.chartsDatazzPie, 'this.chartsDatazzPie')
return this.chartsDatazzPie
}
// 导出至EXcel tableData:表数据 tableLine列数据 listInputVal:选中列下标 lineInputVal选中行下标
@@ -1326,7 +1236,6 @@ class computedFunc {
// })
// lastAllData.push(hangAllDatas)
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
@@ -1344,7 +1253,6 @@ class computedFunc {
})
objData.tableData = shHangData
// 导出的数据
// console.log(objData, '导出的数据')
return objData
}
// 新增指标

View File

@@ -11,18 +11,3 @@
}
})
})()
// (function () {
// var _URL = window.URL
// Object.defineProperty(window, 'URL', {
// set: function (value) {
// console.trace('set URL')
// console.log(value)
// _URL = value
// },
// get: function (value) {
// console.trace('get URL')
// console.log(value)
// return _URL
// }
// })
// })()

View File

@@ -701,101 +701,104 @@ export default {
},
// 地区数据转置
areaTrans () {
if (this.transState) { // 当时间在表头上的时候
console.log(this.$store.state.SelecttDimension, '2020')
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
this.objCompBefore = new ComputedData(this.transBefore)
var objDatasBefore = this.objCompBefore.comTransAreabefore()
this.tableLine = objDatasBefore.tableLine
this.tableData = objDatasBefore.countData
console.log(objDatasBefore, 'objDatasAfter1')
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
let objCompAfter = new ComputedData(this.transBefore)
var objDatasAfter = objCompAfter.comTransAreaAfter()
this.tableLine = objDatasAfter.tableLine
this.tableData = objDatasAfter.countData
console.log(objDatasAfter, 'objDatasAfter2')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
console.log(this.transBefore, 'this.transBeforethis.transBeforethis.transBefore')
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeLabelTime = objCompAfter.comTransAreabeforeLabelTime()
this.tableLine = comTransAreabeforeLabelTime.tableLine
this.tableData = comTransAreabeforeLabelTime.countData
console.log(comTransAreabeforeLabelTime, 'comTransAreabeforeLabelTime')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeTimeLabel = objCompAfter.comTransAreabeforeTimeLabel()
this.tableLine = comTransAreabeforeTimeLabel.tableLine
this.tableData = comTransAreabeforeTimeLabel.countData
console.log(comTransAreabeforeTimeLabel, 'comTransAreabeforeTimeLabel')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeAreaLabel = objCompAfter.comTransAreabeforeAreaLabel()
this.tableLine = comTransAreabeforeAreaLabel.tableLine
this.tableData = comTransAreabeforeAreaLabel.countData
console.log(comTransAreabeforeAreaLabel, 'comTransAreabeforeAreaLabel')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeLabelArea = objCompAfter.comTransAreabeforeLabelArea()
this.tableLine = comTransAreabeforeLabelArea.tableLine
this.tableData = comTransAreabeforeLabelArea.countData
console.log(comTransAreabeforeLabelArea, 'comTransAreabeforeLabelArea')
this.objCompBefore = objCompAfter
}
} else { // 当指标名称在表头上
console.log(this.$store.state.SelecttDimension, '2020')
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
let objCompAfter = new ComputedData(this.transBefore)
var objDatasAfterB = objCompAfter.comTransAreaAfter()
this.tableLine = objDatasAfterB.tableLine
this.tableData = objDatasAfterB.countData
console.log(objDatasAfterB, 'objDatasAfterB')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
this.objCompBefore = new ComputedData(this.transBefore)
var objDatasBeforeB = this.objCompBefore.comTransAreabefore()
this.tableLine = objDatasBeforeB.tableLine
this.tableData = objDatasBeforeB.countData
console.log(objDatasBeforeB, 'objDatasBeforeB')
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeTimeLabelB = objCompAfter.comTransAreabeforeTimeLabel()
this.tableLine = comTransAreabeforeTimeLabelB.tableLine
this.tableData = comTransAreabeforeTimeLabelB.countData
console.log(comTransAreabeforeTimeLabelB, 'comTransAreabeforeTimeLabelB')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeLabelTimeB = objCompAfter.comTransAreabeforeLabelTime()
this.tableLine = comTransAreabeforeLabelTimeB.tableLine
this.tableData = comTransAreabeforeLabelTimeB.countData
console.log(comTransAreabeforeLabelTimeB, 'comTransAreabeforeLabelTimeB')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeLabelAreaB = objCompAfter.comTransAreabeforeLabelArea()
this.tableLine = comTransAreabeforeLabelAreaB.tableLine
this.tableData = comTransAreabeforeLabelAreaB.countData
console.log(comTransAreabeforeLabelAreaB, 'comTransAreabeforeLabelAreaB')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeAreaLabelB = objCompAfter.comTransAreabeforeAreaLabel()
this.tableLine = comTransAreabeforeAreaLabelB.tableLine
this.tableData = comTransAreabeforeAreaLabelB.countData
console.log(comTransAreabeforeAreaLabelB, 'comTransAreabeforeAreaLabelB')
this.objCompBefore = objCompAfter
}
console.log(this.transState, 'this.transState')
// if (true) { // 当时间在表头上的时候
console.log(this.$store.state.SelecttDimension, '2020')
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
this.objCompBefore = new ComputedData(this.transBefore)
var objDatasBefore = this.objCompBefore.comTransAreabefore()
this.tableLine = objDatasBefore.tableLine
this.tableData = objDatasBefore.countData
console.log(objDatasBefore, 'objDatasAfter1')
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
let objCompAfter = new ComputedData(this.transBefore)
var objDatasAfter = objCompAfter.comTransAreaAfter()
this.tableLine = objDatasAfter.tableLine
this.tableData = objDatasAfter.countData
console.log(objDatasAfter, 'objDatasAfter2')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
console.log(this.transBefore, 'this.transBeforethis.transBeforethis.transBefore')
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeLabelTime = objCompAfter.comTransAreabeforeLabelTime()
this.tableLine = comTransAreabeforeLabelTime.tableLine
this.tableData = comTransAreabeforeLabelTime.countData
console.log(comTransAreabeforeLabelTime, 'comTransAreabeforeLabelTime')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeTimeLabel = objCompAfter.comTransAreabeforeTimeLabel()
this.tableLine = comTransAreabeforeTimeLabel.tableLine
this.tableData = comTransAreabeforeTimeLabel.countData
console.log(comTransAreabeforeTimeLabel, 'comTransAreabeforeTimeLabel')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeAreaLabel = objCompAfter.comTransAreabeforeAreaLabel()
this.tableLine = comTransAreabeforeAreaLabel.tableLine
this.tableData = comTransAreabeforeAreaLabel.countData
console.log(comTransAreabeforeAreaLabel, 'comTransAreabeforeAreaLabel')
this.objCompBefore = objCompAfter
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
let objCompAfter = new ComputedData(this.transBefore)
var comTransAreabeforeLabelArea = objCompAfter.comTransAreabeforeLabelArea()
this.tableLine = comTransAreabeforeLabelArea.tableLine
this.tableData = comTransAreabeforeLabelArea.countData
console.log(comTransAreabeforeLabelArea, 'comTransAreabeforeLabelArea')
this.objCompBefore = objCompAfter
}
// }
// else { // 当指标名称在表头上
// console.log(this.$store.state.SelecttDimension, '2020')
// if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
// let objCompAfter = new ComputedData(this.transBefore)
// var objDatasAfterB = objCompAfter.comTransAreaAfter()
// this.tableLine = objDatasAfterB.tableLine
// this.tableData = objDatasAfterB.countData
// console.log(objDatasAfterB, 'objDatasAfterB')
// this.objCompBefore = objCompAfter
// } else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
// this.objCompBefore = new ComputedData(this.transBefore)
// var objDatasBeforeB = this.objCompBefore.comTransAreabefore()
// this.tableLine = objDatasBeforeB.tableLine
// this.tableData = objDatasBeforeB.countData
// console.log(objDatasBeforeB, 'objDatasBeforeB')
// } else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
// let objCompAfter = new ComputedData(this.transBefore)
// var comTransAreabeforeTimeLabelB = objCompAfter.comTransAreabeforeTimeLabel()
// this.tableLine = comTransAreabeforeTimeLabelB.tableLine
// this.tableData = comTransAreabeforeTimeLabelB.countData
// console.log(comTransAreabeforeTimeLabelB, 'comTransAreabeforeTimeLabelB')
// this.objCompBefore = objCompAfter
// } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
// let objCompAfter = new ComputedData(this.transBefore)
// var comTransAreabeforeLabelTimeB = objCompAfter.comTransAreabeforeLabelTime()
// this.tableLine = comTransAreabeforeLabelTimeB.tableLine
// this.tableData = comTransAreabeforeLabelTimeB.countData
// console.log(comTransAreabeforeLabelTimeB, 'comTransAreabeforeLabelTimeB')
// this.objCompBefore = objCompAfter
// } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
// let objCompAfter = new ComputedData(this.transBefore)
// var comTransAreabeforeLabelAreaB = objCompAfter.comTransAreabeforeLabelArea()
// this.tableLine = comTransAreabeforeLabelAreaB.tableLine
// this.tableData = comTransAreabeforeLabelAreaB.countData
// console.log(comTransAreabeforeLabelAreaB, 'comTransAreabeforeLabelAreaB')
// this.objCompBefore = objCompAfter
// } else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
// let objCompAfter = new ComputedData(this.transBefore)
// var comTransAreabeforeAreaLabelB = objCompAfter.comTransAreabeforeAreaLabel()
// this.tableLine = comTransAreabeforeAreaLabelB.tableLine
// this.tableData = comTransAreabeforeAreaLabelB.countData
// console.log(comTransAreabeforeAreaLabelB, 'comTransAreabeforeAreaLabelB')
// this.objCompBefore = objCompAfter
// }
// }
},
// 渲染列表数据
showTable () {
// 改变转置状态
// this.transState = !this.transState
console.log(121212121)
if (this.areaDataState !== 'area') { // 非地区数据转置
this.wrongAreaTrans()
} else { // 地区数据转置
@@ -939,25 +942,8 @@ export default {
console.log('k11111111111')
this.objCompBefore.inputSelectData(this.listInputVal, this.lineInputVal)
this.rowColIndex === 0 ? (this.echartsDatarts = this.objCompBefore.dataVerticalMapRow()) : (this.echartsDatarts = this.objCompBefore.dataVerticalMapCol())
// if (this.$route.query.type !== 'area') { // 非地区数据
// } else { // 地区数据
// if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
// this.rowColIndex === 0 ? (this.echartsDatarts = this.objCompBefore.dataVerticalMapColAreaDQSJ()) : (this.echartsDatarts = this.objCompBefore.dataVerticalMapRowAreaSJDQ())
// console.log('地区-时间')
// } else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
// this.rowColIndex === 0 ? (this.echartsDatarts = this.objCompBefore.dataVerticalMapRowAreaSJDQ()) : (this.echartsDatarts = this.objCompBefore.dataVerticalMapColAreaDQSJ())
// console.log('时间-地区')
// } else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
// console.log('指标-时间')
// } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
// console.log('时间-指标')
// } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
// console.log('地区-指标')
// } else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
// console.log('指标-地区')
// }
// }
this.pieStatic = false
this.lineStatic = true
break
case 2:
if (this.pieStatic) {
@@ -970,12 +956,14 @@ export default {
this.objCompBefore.inputSelectData(this.listInputVal, this.lineInputVal)
this.rowColIndex === 0 ? (this.echartsDatarts = this.objCompBefore.dataAcrossMapRow()) : (this.echartsDatarts = this.objCompBefore.dataAcrossMapCol())
this.pieStatic = false
this.lineStatic = true
break
case 3:
console.log(this.lineStatic, this.rowColIndex, '状态改变')
console.log(this.listInputVal, this.lineInputVal, '行列数据前')
// console.log(this.lineStatic, this.rowColIndex, '状态改变')
if (this.lineStatic && this.rowColIndex === 0) {
console.log(10086)
this.lineInputVal = [0]
this.listInputVal = [1, 2, 3]
this.lineStatic = true
@@ -983,6 +971,7 @@ export default {
this.lineInputVal = [0, 1, 2, 3]
this.listInputVal = [1]
this.lineStatic = true
console.log(10087)
}
console.log(this.listInputVal, this.lineInputVal, '行列数据后')
this.objCompBefore.inputSelectData(this.listInputVal, this.lineInputVal)
@@ -1000,6 +989,7 @@ export default {
this.objCompBefore.inputSelectData(this.listInputVal, this.lineInputVal)
this.rowColIndex === 0 ? (this.echartsDatarts = this.objCompBefore.dataBrokenLineMapRow()) : (this.echartsDatarts = this.objCompBefore.dataBrokenLineMapCol())
this.pieStatic = false
this.lineStatic = true
break
}
},

View File

@@ -10,11 +10,8 @@
<img :src="item.url" alt />
</div>
</div>
<div
class="chart_right"
v-if="(($store.state.SelecttDimension.row === 'sj' && $store.state.SelecttDimension.col === 'dq')||($store.state.SelecttDimension.row === 'sj' && $store.state.SelecttDimension.col === 'zb'))&&!$store.state.areaDimensionState"
>
<div class="chart_right_area" v-if="$route.query.type==='area'">
<div class="chart_right">
<div class="chart_right_area" v-if="$route.query.type==='area'&&!$store.state.areaDimensionState">
{{stateChangeSDF?'指标':'地区'}}
<el-cascader
v-model="value"
@@ -25,7 +22,7 @@
></el-cascader>
</div>
<!-- 根据时间筛选 -->
<div class="chart_right_time" v-if="cityDataTime&&cityDefaultNameTime">
<div class="chart_right_time" v-if="!$store.state.areaDimensionState">
时间
<div class="chart_right_cont">
<PullDownComponents
@@ -64,7 +61,7 @@
</div>
</div>
</div>
<div class="chart_right" v-else>
<div class="chart_right" v-if="$route.query.type==='area'&&$store.state.areaDimensionState">
{{leftLabel[$store.state.noSelecttDimension]}}
<el-cascader
v-model="valueDimension"
@@ -498,7 +495,7 @@ export default {
}
break
case 'year':
if (this.timeUsrr.length < 5 && /^[0-9]+$/.test(this.timeUsrr.substring(0, 4))) {
if ((this.timeUsrr.length < 5 && /^[0-9]+$/.test(this.timeUsrr.substring(0, 4))) || (this.timeUsrr.length < 10 && (this.timeUsrr.split('-')[0] < this.timeUsrr.split('-')[1]))) {
this.$store.state.selectData = this.timeUsrr
this.$parent.changeBrother()
this.timeUsrr = ''

View File

@@ -201,7 +201,13 @@ export default {
}
// 关闭窗口
this.$store.state.dimensionState = false
this.$store.state.areaDimensionState = true
if (this.$route.query.type === 'area') {
this.$store.state.noAreadimensionState = false
this.$store.state.areaDimensionState = true
} else {
this.$store.state.noAreadimensionState = true
this.$store.state.areaDimensionState = false
}
}).catch((fail) => {
console.log(fail, 2369)
})

View File

@@ -164,7 +164,7 @@ export default {
this.myEchartsObj = echarts.init(this.$refs.myEcharts, 'macarons')
// 绘制图表
this.myEchartsObj.setOption(this.option, true)
this.myEchartsObj.resize()
// this.myEchartsObj.resize()
},
// 行列转换
checkedSelect (ind) {