From 6928ddbc113771701799e8cbcffff2f5e52e6d13 Mon Sep 17 00:00:00 2001 From: fanzhen123 <1575502816@qq.com> Date: Wed, 8 Jan 2020 18:46:59 +0800 Subject: [PATCH] fanzhen0108 --- src/assets/js/computeddata.js | 1 + src/components/chartsCont/ChartsCont.vue | 49 +- src/components/dimension/Dimension.vue | 1 + src/components/insertLabel/InsertLabel.vue | 846 +++++++++++++----- .../noAreaDimension/NoAreaDimension.vue | 9 +- src/store.js | 7 +- src/views/datasweb/Datasweb.vue | 11 + src/views/help/Help.vue | 401 +++++++-- static/help/details1054.png | Bin 0 -> 908240 bytes static/help/details1074.png | Bin 0 -> 693 bytes static/help/details1163.png | Bin 0 -> 628518 bytes static/help/details1175.png | Bin 0 -> 14160 bytes static/help/details125.png | Bin 0 -> 977158 bytes static/help/details1260.png | Bin 0 -> 993126 bytes static/help/details1269.png | Bin 0 -> 990472 bytes static/help/details134.png | Bin 0 -> 981592 bytes static/help/details159.png | Bin 0 -> 1414 bytes static/help/details1599.png | Bin 0 -> 972712 bytes static/help/details162.png | Bin 0 -> 1001586 bytes static/help/details1738.png | Bin 0 -> 924405 bytes static/help/details1835.png | Bin 0 -> 326517 bytes static/help/details1863.png | Bin 0 -> 321503 bytes static/help/details191.png | Bin 0 -> 917818 bytes static/help/details275.png | Bin 0 -> 604095 bytes static/help/details319.png | Bin 0 -> 439522 bytes static/help/details409.png | Bin 0 -> 1232525 bytes static/help/details457.png | Bin 0 -> 2063 bytes static/help/details567.png | Bin 0 -> 999770 bytes static/help/details606.png | Bin 0 -> 797287 bytes static/help/details690.png | Bin 0 -> 2817 bytes static/help/details717.png | Bin 0 -> 2704 bytes static/help/details824.png | Bin 0 -> 287132 bytes static/help/details84.png | Bin 0 -> 997135 bytes static/help/details876.png | Bin 0 -> 977158 bytes static/help/details928.png | Bin 0 -> 997135 bytes 35 files changed, 996 insertions(+), 329 deletions(-) create mode 100644 static/help/details1054.png create mode 100644 static/help/details1074.png create mode 100644 static/help/details1163.png create mode 100644 static/help/details1175.png create mode 100644 static/help/details125.png create mode 100644 static/help/details1260.png create mode 100644 static/help/details1269.png create mode 100644 static/help/details134.png create mode 100644 static/help/details159.png create mode 100644 static/help/details1599.png create mode 100644 static/help/details162.png create mode 100644 static/help/details1738.png create mode 100644 static/help/details1835.png create mode 100644 static/help/details1863.png create mode 100644 static/help/details191.png create mode 100644 static/help/details275.png create mode 100644 static/help/details319.png create mode 100644 static/help/details409.png create mode 100644 static/help/details457.png create mode 100644 static/help/details567.png create mode 100644 static/help/details606.png create mode 100644 static/help/details690.png create mode 100644 static/help/details717.png create mode 100644 static/help/details824.png create mode 100644 static/help/details84.png create mode 100644 static/help/details876.png create mode 100644 static/help/details928.png diff --git a/src/assets/js/computeddata.js b/src/assets/js/computeddata.js index 254580d..b16bcbe 100644 --- a/src/assets/js/computeddata.js +++ b/src/assets/js/computeddata.js @@ -418,6 +418,7 @@ class computedFunc { label: itemTime }) }) + console.log(this.transBeforeData, 'this.transBeforeData101') // 总数据处理 this.transBeforeData.timeArr.forEach((itemName, indexName) => { var tableLine = {} diff --git a/src/components/chartsCont/ChartsCont.vue b/src/components/chartsCont/ChartsCont.vue index 8a5183a..6ceea4b 100644 --- a/src/components/chartsCont/ChartsCont.vue +++ b/src/components/chartsCont/ChartsCont.vue @@ -385,16 +385,6 @@ export default { this.startsyui = false } }, - // 监听对象 - // chartsStatusMegger: { - // handler (newval, oldVal) { - // this.transState = this.chartsStatusMegger.transState - // this.nowDataTJ = this.chartsStatusMegger.computedStatic - // this.showTable() - // }, - // immediate: true, - // deep: true - // } listInputVal: { handler () { this.$store.state.listInputVal = this.listInputVal @@ -683,6 +673,17 @@ export default { areaTrans() { console.log(this.transState, 'this.transState') console.log(this.$store.state.SelecttDimension, '2020') + if (this.$route.query.type === 'area' && this.$store.state.transClickState) { + let transpositionData = JSON.parse(JSON.stringify(this.transBefore.transBeforeAreaData)) + this.transBefore.transBeforeAreaData = transpositionData[0].map(function (col, index) { + return transpositionData.map((row, key) => { + return row[index] + }) + }) + console.log(this.transBefore, 'transpositionData') + // 数据转置完成恢复 + this.$store.state.transClickState = false + } if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') { this.objCompBefore = new ComputedData(this.transBefore) var objDatasBefore = this.objCompBefore.comTransAreabefore() @@ -731,7 +732,7 @@ export default { showTable() { // 改变转置状态 console.log(121212121) - if (this.areaDataState !== 'area') { // 非地区数据转置 + if (this.$route.query.type !== 'area') { // 非地区数据转置 this.wrongAreaTrans() } else { // 地区数据转置 this.areaTrans() @@ -1085,6 +1086,7 @@ export default { this.$store.state.SelecttDimension.row = 'sj' } this.leftState = true + this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.transBefore)) }).catch((fail) => { console.log(fail, 2369) }) @@ -1137,6 +1139,7 @@ export default { this.leftState = true // 告诉父组件我完成任务重置状态 this.$emit('prentsState', false) + this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.transBefore)) }).catch((fail) => { console.log(fail) }) @@ -1160,22 +1163,22 @@ export default { return (ind) => { let styStatic = false if (this.transState) { - if (this.transBefore.transBeforeTermsData[0] !== undefined) { - if (ind > (this.transBefore.transBeforeTermsData[0].length)) { + if (this.$route.query.type !== 'area') { + if (ind > (this.$store.state.allNochangeInitData.transBeforeTermsData[0].length)) { styStatic = true } } else { - if (ind > (this.transBefore.transBeforeAreaData[0].length)) { + if (ind > (this.$store.state.allNochangeInitData.transBeforeAreaData[0].length)) { styStatic = true } } } else { - if (this.transBefore.transBeforeTermsData[0] !== undefined) { - if (ind > (this.transBefore.transBeforeTermsData.length)) { + if (this.$route.query.type !== 'area') { + if (ind > (this.$store.state.allNochangeInitData.transBeforeTermsData.length)) { styStatic = true } } else { - if (ind > (this.transBefore.transBeforeAreaData.length)) { + if (ind > (this.$store.state.allNochangeInitData.transBeforeAreaData.length)) { styStatic = true } } @@ -1188,22 +1191,22 @@ export default { return (ind) => { let styStatic = false if (this.transState) { - if (this.transBefore.transBeforeTermsData[0] !== undefined) { - if (ind > (this.transBefore.transBeforeTermsData.length - 1)) { + if (this.$route.query.type !== 'area') { + if (ind > (this.$store.state.allNochangeInitData.transBeforeTermsData.length - 1)) { styStatic = true } } else { - if (ind > (this.transBefore.transBeforeAreaData.length - 1)) { + if (ind > (this.$store.state.allNochangeInitData.transBeforeAreaData.length - 1)) { styStatic = true } } } else { - if (this.transBefore.transBeforeTermsData[0] !== undefined) { - if (ind > (this.transBefore.transBeforeTermsData[0].length - 1)) { + if (this.$route.query.type !== 'area') { + if (ind > (this.$store.state.allNochangeInitData.transBeforeTermsData[0].length - 1)) { styStatic = true } } else { - if (ind > (this.transBefore.transBeforeAreaData[0].length - 1)) { + if (ind > (this.$store.state.allNochangeInitData.transBeforeAreaData[0].length - 1)) { styStatic = true } } diff --git a/src/components/dimension/Dimension.vue b/src/components/dimension/Dimension.vue index 691a562..4af44d2 100644 --- a/src/components/dimension/Dimension.vue +++ b/src/components/dimension/Dimension.vue @@ -208,6 +208,7 @@ export default { this.$store.state.noAreadimensionState = true this.$store.state.areaDimensionState = false } + this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.$store.state.transBefore)) }).catch((fail) => { console.log(fail, 2369) }) diff --git a/src/components/insertLabel/InsertLabel.vue b/src/components/insertLabel/InsertLabel.vue index 28f3bc2..efa3b99 100644 --- a/src/components/insertLabel/InsertLabel.vue +++ b/src/components/insertLabel/InsertLabel.vue @@ -59,23 +59,23 @@ export default { fontComput: '', insertName: '', labelData: [ - { text: '健康的说法更健康', state: false }, - { text: '健康的说jksdfhjjk', state: false }, - { text: '健聚划算df覅㐇', state: false }, - { text: '健聚dfgs划算覅㐇', state: false }, - { text: '健聚jdskfasdfhn 划算覅㐇', state: false }, - { text: '健聚sdg划asd算覅㐇', state: false }, - { text: '健聚dsfg划f算覅㐇', state: false }, - { text: '健聚划sdasdffasf算覅㐇', state: false }, - { text: '健聚划sdasdff算覅㐇', state: false }, - { text: '健聚划sdf算覅s㐇', state: false }, - { text: '健聚划sdafsdf算ssd覅㐇', state: false }, - { text: '健聚划sasdfdf算覅㐇', state: false }, - { text: '健聚划ssadfdf算覅㐇', state: false }, - { text: '健聚划sdf算覅㐇', state: false }, - { text: '健聚划ssdafgfdf算s覅㐇', state: false }, - { text: '健聚划sdaasfdf算s覅㐇', state: false }, - { text: '健聚划sdasfdfa算覅㐇', state: false } + // { text: '健康的说法更健康', state: false }, + // { text: '健康的说jksdfhjjk', state: false }, + // { text: '健聚划算df覅㐇', state: false }, + // { text: '健聚dfgs划算覅㐇', state: false }, + // { text: '健聚jdskfasdfhn 划算覅㐇', state: false }, + // { text: '健聚sdg划asd算覅㐇', state: false }, + // { text: '健聚dsfg划f算覅㐇', state: false }, + // { text: '健聚划sdasdffasf算覅㐇', state: false }, + // { text: '健聚划sdasdff算覅㐇', state: false }, + // { text: '健聚划sdf算覅s㐇', state: false }, + // { text: '健聚划sdafsdf算ssd覅㐇', state: false }, + // { text: '健聚划sasdfdf算覅㐇', state: false }, + // { text: '健聚划ssadfdf算覅㐇', state: false }, + // { text: '健聚划sdf算覅㐇', state: false }, + // { text: '健聚划ssdafgfdf算s覅㐇', state: false }, + // { text: '健聚划sdaasfdf算s覅㐇', state: false }, + // { text: '健聚划sdasfdfa算覅㐇', state: false } ], computers: [ { text: '*', state: false }, @@ -103,6 +103,8 @@ export default { watch: { radioValue (newValue, oldValue) { console.log(newValue) + this.fontComput = '' + this.insertName = '' if (newValue === 'hang') { // 行列新增渲染 if (this.$route.query.type === 'area') { @@ -133,12 +135,21 @@ export default { break } } else { - this.labelData = this.$store.state.transBefore.termsName.map((item, index) => { - return { - text: item, - state: false - } - }) + if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') { + this.labelData = this.$store.state.transBefore.termsName.map((item, index) => { + return { + text: item, + state: false + } + }) + } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') { + this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => { + return { + text: item, + state: false + } + }) + } } } else if (newValue === 'lie') { // 行列新增渲染 @@ -171,12 +182,21 @@ export default { break } } else { - this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => { - return { - text: item, - state: false - } - }) + if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') { + this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => { + return { + text: item, + state: false + } + }) + } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') { + this.labelData = this.$store.state.transBefore.termsName.map((item, index) => { + return { + text: item, + state: false + } + }) + } } } } @@ -254,248 +274,571 @@ export default { let newarr = [] if (this.radioValue === 'hang') { if (this.$route.query.type !== 'area') { - // 循环指标名称 回调一个计算后的数组 - - let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeTermsData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { - comStr += this.$store.state.transBefore.transBeforeTermsData[index][this.$store.state.transBefore.termsName.indexOf(list)] === '' ? '0' : this.$store.state.transBefore.transBeforeTermsData[index][this.$store.state.transBefore.termsName.indexOf(list)] - } else { - comStr += list - } + if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') { + if (this.$store.state.transBefore.termsName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.termsName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.termsName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() - }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.termsName.push(this.insertName) - this.$store.state.transBefore.termsExplain.push('') - this.$store.state.transBefore.transBeforeTermsData.push(dataStrArr) + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.termsName.push(this.insertName) + this.$store.state.transBefore.termsExplain.push('') + this.$store.state.transBefore.transBeforeTermsData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') { + if (this.$store.state.transBefore.timeArr.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeTermsData + this.$store.state.transBefore.transBeforeTermsData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.timeArr.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.timeArr.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.timeArr.push(this.insertName) + this.$store.state.transBefore.transBeforeTermsData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeTermsData)) + this.$store.state.transBefore.transBeforeTermsData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + // console.log(this.$store.state.transBefore, '转之后') + // 循环指标名称 回调一个计算后的数组 + } this.closeX() this.$emit('emitState', true) } else { - let dataStrArr = null - switch (this.$store.state.SelecttDimension.col) { - case 'dq': - // 循环地区名称 回调一个计算后的数组 - dataStrArr = this.$store.state.transBefore.areaName.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeAreaData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - console.log(list) - if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) { - comStr += this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.areaName.indexOf(list)] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.areaName.indexOf(list)] - } else { - comStr += list - } - }) - console.log(comStr, 'kkk10') - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() + if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') { + if (this.$store.state.transBefore.termsName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.areaName.push(this.insertName) - break - case 'sj': - // 循环地区名称 回调一个计算后的数组 - dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeAreaData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { - comStr += this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.timeArr.indexOf(list)] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.timeArr.indexOf(list)] - } else { - comStr += list - } - }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] + } else { + comStr += list + } }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.timeArr.push(this.insertName) - break - case 'zb': - // 循环地区名称 回调一个计算后的数组 - dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeAreaData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { - comStr += this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.termsName.indexOf(list)] == '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.termsName.indexOf(list)] - } else { - comStr += list - } - }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.termsName.push(this.insertName) + this.$store.state.transBefore.termsExplain.push('') + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') { + if (this.$store.state.transBefore.timeArr.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.termsName.push(this.insertName) - this.$store.state.transBefore.termsExplain.push('') - break + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeAreaData + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.timeArr.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + // console.log(this.$store.state.transBefore, '转之后') + // 循环指标名称 回调一个计算后的数组 + } else if (this.$store.state.SelecttDimension.col === 'dq' && this.$store.state.SelecttDimension.row === 'sj') { + if (this.$store.state.transBefore.areaName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.areaName.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'dq') { + if (this.$store.state.transBefore.timeArr.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeAreaData + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.areaName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.timeArr.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + } else if (this.$store.state.SelecttDimension.col === 'dq' && this.$store.state.SelecttDimension.row === 'zb') { + if (this.$store.state.transBefore.areaName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.areaName.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'dq') { + if (this.$store.state.transBefore.termsName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeAreaData + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.areaName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.termsName.push(this.insertName) + this.$store.state.transBefore.termsExplain.push('') + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + // console.log(this.$store.state.transBefore, '转之后') + // 循环指标名称 回调一个计算后的数组 } - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) this.closeX() this.$emit('emitState', true) } - } else { + } else if (this.radioValue === 'lie') { if (this.$route.query.type !== 'area') { - // console.log(this.$store.state.transBefore.transBeforeTermsData) - let bsfyu = this.$store.state.transBefore.transBeforeTermsData - // 将数据进行转置 - let datarts = bsfyu[0].map(function (col, index) { - return bsfyu.map((row, key) => { - return row[index] + if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') { + if (this.$store.state.transBefore.termsName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.termsName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.termsName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() }) - }) - console.log(datarts) - // 循环年 - let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeTermsData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { - comStr += datarts[index][this.$store.state.transBefore.timeArr.indexOf(list)]===''?'0':datarts[index][this.$store.state.transBefore.timeArr.indexOf(list)] - } else { - comStr += list - } + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.termsName.push(this.insertName) + this.$store.state.transBefore.termsExplain.push('') + this.$store.state.transBefore.transBeforeTermsData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') { + if (this.$store.state.transBefore.timeArr.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeTermsData + this.$store.state.transBefore.transBeforeTermsData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() - }) - console.log(dataStrArr, '101025') - datarts.push(dataStrArr) - // 将数据转置回来 - let newZz = datarts[0].map(function (col, index) { - return datarts.map((row, key) => { - return row[index] + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.timeArr.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeTermsData[this.$store.state.transBefore.timeArr.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() }) - }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.timeArr.push(this.insertName) - this.$store.state.transBefore.transBeforeTermsData = newZz + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.timeArr.push(this.insertName) + this.$store.state.transBefore.transBeforeTermsData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeTermsData)) + this.$store.state.transBefore.transBeforeTermsData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + // console.log(this.$store.state.transBefore, '转之后') + // 循环指标名称 回调一个计算后的数组 + } this.closeX() this.$emit('emitState', true) } else { - // console.log(this.$store.state.transBefore.transBeforeAreaData) - let bsfyu = this.$store.state.transBefore.transBeforeAreaData - // 将数据进行转置 - let datarts = bsfyu[0].map(function (col, index) { - return bsfyu.map((row, key) => { - return row[index] + if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') { + if (this.$store.state.transBefore.termsName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() }) - }) - console.log(datarts) - let dataStrArr = null - let newZz = null - switch (this.$store.state.SelecttDimension.row) { - case 'dq': - // 循环年 - dataStrArr = this.$store.state.transBefore.areaName.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeAreaData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) { - comStr += datarts[index][this.$store.state.transBefore.areaName.indexOf(list)]===''?'0':datarts[index][this.$store.state.transBefore.areaName.indexOf(list)] - } else { - comStr += list - } - }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.termsName.push(this.insertName) + this.$store.state.transBefore.termsExplain.push('') + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') { + if (this.$store.state.transBefore.timeArr.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' }) - console.log(dataStrArr, '101025') - datarts.push(dataStrArr) - // 将数据转置回来 - newZz = datarts[0].map(function (col, index) { - return datarts.map((row, key) => { - return row[index] - }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeAreaData + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.areaName.push(this.insertName) - break - case 'sj': - // 循环年 - dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeAreaData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { - comStr += datarts[index][this.$store.state.transBefore.timeArr.indexOf(list)]===''?'0':datarts[index][this.$store.state.transBefore.timeArr.indexOf(list)] - } else { - comStr += list - } - }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] + } else { + comStr += list + } }) - console.log(dataStrArr, '101025') - datarts.push(dataStrArr) - // 将数据转置回来 - newZz = datarts[0].map(function (col, index) { - return datarts.map((row, key) => { - return row[index] - }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.timeArr.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.timeArr.push(this.insertName) - break - case 'zb': - // 循环年 - dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 - // console.log(this.$store.state.transBefore.transBeforeAreaData[index]) - // 定义拼接计算的字符串 - let comStr = '' - newArrat.forEach((list, key) => { - if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { - comStr += datarts[index][this.$store.state.transBefore.termsName.indexOf(list)]===''?'0':datarts[index][this.$store.state.transBefore.termsName.indexOf(list)] - } else { - comStr += list - } - }) - // console.log(comStr) - // console.log(eval(comStr)) - return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(this.$store.state.transBefore, '转之后') + // 循环指标名称 回调一个计算后的数组 + } else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'dq') { + if (this.$store.state.transBefore.areaName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' }) - console.log(dataStrArr, '101025') - datarts.push(dataStrArr) - // 将数据转置回来 - newZz = datarts[0].map(function (col, index) { - return datarts.map((row, key) => { - return row[index] - }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.timeArr.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] + } else { + comStr += list + } }) - // 将处理完的数据放到全局变量中 - this.$store.state.transBefore.termsName.push(this.insertName) - this.$store.state.transBefore.termsExplain.push('') - break + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.areaName.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'dq' && this.$store.state.SelecttDimension.row === 'sj') { + if (this.$store.state.transBefore.timeArr.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeAreaData + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.areaName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.timeArr.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.timeArr.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.timeArr.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + } else if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'dq') { + if (this.$store.state.transBefore.areaName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.termsName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.areaName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // 循环指标名称 回调一个计算后的数组 + // console.log(dataStrArr, 'dataStrArr新增指标') + // 将处理完的数据放到全局变量中 + this.$store.state.transBefore.areaName.push(this.insertName) + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + } else if (this.$store.state.SelecttDimension.col === 'dq' && this.$store.state.SelecttDimension.row === 'zb') { + if (this.$store.state.transBefore.termsName.indexOf(this.insertName) !== -1) { + this.$alert('您新增的指标名称已经存在请重新输入!', '温馨提示', { + confirmButtonText: '确定' + }) + return + } + // 将数据先进行转置 + var arrData = this.$store.state.transBefore.transBeforeAreaData + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore') + let dataStrArr = this.$store.state.transBefore.areaName.map((item, index) => {//外层 + // 定义拼接计算的字符串 + let comStr = '' + newArrat.forEach((list, key) => { + if (this.$store.state.transBefore.termsName.indexOf(list) !== -1) { + comStr += this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] === '' ? '0' : this.$store.state.transBefore.transBeforeAreaData[this.$store.state.transBefore.termsName.indexOf(list)][index] + } else { + comStr += list + } + }) + // console.log(comStr, 'comStr') + // console.log(eval(comStr)) + return parseFloat(eval(comStr).toString()).toFixed(2).toString() + }) + // console.log(dataStrArr, 'dataStrArr新增指标') + this.$store.state.transBefore.termsName.push(this.insertName) + this.$store.state.transBefore.termsExplain.push('') + this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr) + // 转置回来 + arrData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + this.$store.state.transBefore.transBeforeAreaData = arrData[0].map(function (col, index) { + return arrData.map((row, key) => { + return row[index] + }) + }) + // console.log(this.$store.state.transBefore, '转之后') + // 循环指标名称 回调一个计算后的数组 } - // 将处理完的数据放到全局变量中 - // this.$store.state.transBefore.timeArr.push(this.insertName) - this.$store.state.transBefore.transBeforeAreaData = newZz this.closeX() this.$emit('emitState', true) } - - } } else { // alert('您输入的表达式正确,请重新输入!') @@ -552,12 +895,21 @@ export default { }) } } else { - this.labelData = this.$store.state.transBefore.termsName.map((item, index) => { - return { - text: item, - state: false - } - }) + if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') { + this.labelData = this.$store.state.transBefore.termsName.map((item, index) => { + return { + text: item, + state: false + } + }) + } else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') { + this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => { + return { + text: item, + state: false + } + }) + } } } diff --git a/src/components/noAreaDimension/NoAreaDimension.vue b/src/components/noAreaDimension/NoAreaDimension.vue index c14efdd..e5ab30d 100644 --- a/src/components/noAreaDimension/NoAreaDimension.vue +++ b/src/components/noAreaDimension/NoAreaDimension.vue @@ -10,14 +10,15 @@