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 @@
-
指标
-
时间
+
指标
+
时间
+
-
指标
-
时间
+
指标
+
时间
diff --git a/src/store.js b/src/store.js index 4b2493e..1584bf8 100644 --- a/src/store.js +++ b/src/store.js @@ -105,7 +105,12 @@ export default new Vuex.Store({ // 当前选中需要筛选的是指标还是地区 true指标 false地区 newSelectDaaState: true, // 高级查询选中的当前分类 - advancedSelectClassfiid: null + advancedSelectClassfiid: null, + // 转置被点击了 + transClickState: false, + // 初始化请求的所有数据(全局不变) + allNochangeInitData: null + }, mutations: {}, actions: { diff --git a/src/views/datasweb/Datasweb.vue b/src/views/datasweb/Datasweb.vue index e75c349..45eee09 100644 --- a/src/views/datasweb/Datasweb.vue +++ b/src/views/datasweb/Datasweb.vue @@ -847,6 +847,17 @@ export default { break case '转置': if (this.$store.state.transBefore) { + // 当前数据是地区数据时点击转置需要将数据进行转置 + if (this.$route.query.type === 'area') { + // let transpositionData = JSON.parse(JSON.stringify(this.$store.state.transBefore.transBeforeAreaData)) + // this.$store.state.transBefore.transBeforeAreaData = transpositionData[0].map(function (col, index) { + // return transpositionData.map((row, key) => { + // return row[index] + // }) + // }) + this.$store.state.transClickState = true + } + console.log(this.$store.state.transBefore, 'this.$store.state.transBefore0022555') // 改变转置状态 let zhuanChange = { row: this.$store.state.SelecttDimension.col, diff --git a/src/views/help/Help.vue b/src/views/help/Help.vue index bb7eeaa..cb8c5c2 100644 --- a/src/views/help/Help.vue +++ b/src/views/help/Help.vue @@ -22,47 +22,135 @@ - - - + + + - 数据查询 - 指标查询 - - + + + + + + + - 我的收藏 - 添加收藏 - 新增指标 - 筛选指标 - 统计 - 恢复 - 去除空行空列 - 编辑 - 维度转换 - 行列转置 - 保存默认 - 恢复默认 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - 指标选择 - 地区选择 + + + - + - - - - + @@ -70,7 +158,7 @@
-
+
@@ -96,8 +184,10 @@ export default { }, data () { return { + defaultNew: ['1'], imgurl: { - pos: require('../../../static/company/posweizhi.png') + pos: require('../../../static/company/posweizhi.png'), + htmlShow1: '1010' }, // left的高度 leftHeights: null, @@ -105,17 +195,206 @@ export default { htmlStr: '', allHtml: [ { - name: '数据查询', - code: '1-1-1', + name: '前言', + code: '1', htmls: ` - 国家统计数据库全新改版, 提供了以下服务:
- - 详实的月度、季度、年度数据以及普查、地区、部门、国际数据
- - 提供多种文件输出、制表、绘图、指标解释、表格转置、可视化图表、数据地理信息系统等多种功能
+ 前言
+ 知识数据平台网络提供了以下服务:
+ - 详实的月度、季度、年度数据以及地区数据
+ - 提供文件导出、制表、指标解释、表格转置、可视化图表、数据地图信息系统等多种功能
其中具有特色的服务为:
- 数据挖掘随心所欲
- 海量数据一键下载
- - 精品资源一键分享



- 所做的一切,只为让数据生活更简单。下面,就让我们一起来阅读国家统计局数据库入门指南,让这篇用户手册来指引你如何使用数据库。跟着导航一起操作,即可进入轻松的查数之旅。` + 所做的一切,只为让数据生活更简单。下面,就让我们一起来阅读入门指南,让这篇用户手册来指引你如何查询数据。跟着导航一起操作,即可进入轻松的查询之旅。

+ ` + }, + { + name: '数据查询', + code: '1-1-1', + htmls: ` + 简单查询 - 数据查询
+ 1.在【分类栏】中选择想要查询的指标分类,在右侧【结果栏】中显示出分类下所有指标的数据。用户可以按时间进行筛选。时间基于当前时间。
+
+ 2.左右拖拽功能
+ 拖拽下图所示蓝色拖拽条,可左右拖拽适当调整宽度。
+ > 拖拽前:
+
+ > 拖拽后:
+

+ ` + }, + { + name: '指标解释', + code: '1-1-2', + htmls: ` + 简单查询 - 指标解释
+
1、点击指标名称或指标名称前的

+
+ 弹出【指标解释】界面,用户可以了解到指标的相关解释。
+
+ 2.点击【复制到粘贴板】按钮,复制文字,通过键盘上【CTRL+V】可以根据自身需要将文字粘贴到文档或其它地方。


+ ` + }, + { + name: '我的收藏', + code: '1-1-3-1', + htmls: ` + 简单查询 - 功能操作 - 我的收藏
+ 【我的收藏】页面如下:
+
+ 可在“搜索框”中输入要搜索的已收藏的文件名。
+ ` + }, + { + name: '添加收藏', + code: '1-1-3-2', + htmls: ` + 简单查询 - 功能操作 - 添加收藏
+ 收藏页面如下图:
+
+ 直接在输入框中输入用户自定义的收藏名称,点击【保存】保存当前操作,点击【取消】取消当前操作。
+ ` + }, + { + name: '新增指标', + code: '1-1-3-3', + htmls: ` + 简单查询 - 功能操作 - 新增指标
+ 1.选择【数据管理】下的【新增指标】,打开【新增指标】界面:
+
+ • 可在输入框中填写新增指标的名称。 +
• 在列表中选择一个需要计算的指标,双击指标名称或点击 按钮选中到“新增指标结果框”内。
+ • 在操作键盘处选择操作的运算符及数字,如果进行多指标计算,可在左侧列表框里多次选择指标。 + • 点击【确定】保存新增指标,点击【取消】取消以上操作。 + 报表新增后的指标数据如下图所示:
+
+ ` + }, + { + name: '筛选指标', + code: '1-1-3-4', + htmls: ` + 简单查询 - 功能操作 - 筛选指标
+ 选择【数据管理】下的【筛选】,打开【筛选指标】界面。
+
+ • 可通过“行、列”按钮选择对行对列操作筛选。 + • 在左侧指标列表框中选择要筛选的指标(新增指标和统计指标也会在列表中出现),在【数值】框中填写筛选的值。 +
•点击 按钮将选中的指标添加到“右侧筛选条件”框中,也可通过按钮将已在右侧列表中的指标移除。
+ • 点击【确定】按钮对当前报表进行筛选,点击【取消】取消操作。 + ` + }, + { + name: '统计运算', + code: '1-1-3-5', + htmls: ` + 简单查询 - 功能操作 - 统计运算
+ 选择【数据管理】下的【统计】,展开更多选择条件:【对行运算】、【对列运算】,以下为计算方式:
+
+ • 选择【对行运算】下的【SUM求和】的计算方式后,数据报表新增一列,得到每行计算后的结果如下图: +
+ • 选择【对列运算】下的【SUM求和】的计算方式后,数据报表新增一行,得到每列计算后的结果如下图: +
+ ` + }, + { + name: '恢复', + code: '1-1-3-6', + htmls: ` + 简单查询 - 功能操作 - 恢复
+ 选择【数据管理】下的【恢复】,数据报表恢复默认初始状态
+ ` + }, + { + name: '去除空行空列', + code: '1-1-3-7', + htmls: ` + 简单查询 - 功能操作 - 去除空行空列
+ 选择【数据管理】下的【去除空行空列】,将报表中的行、列为空的记录去掉。
+ ` + }, + { + name: '编辑', + code: '1-1-3-8', + htmls: ` + 简单查询 - 功能操作 - 编辑
+ 选择【报表管理】下的【编辑】,弹出编辑窗口,如下图:
+
+ • 可对行、列进行编辑。 +
• 可通过复选框,勾选指标,也可通过右侧“全选”“反选”按钮快速操作。
+ • 点击确定,查看编辑后的报表。 + ` + }, + { + name: '维度转换', + code: '1-1-3-9', + htmls: ` + 简单查询 - 功能操作 - 维度转换
+ 选择【报表管理】下的【维度转换】, 弹出【维度转换】窗口。
+
+
• 通过点击行、列上按钮,设置行、列上显示指标或时间。
+ • 点击【确认】按钮,查看数报表的维度变化。 + ` + }, + { + name: '行列转置', + code: '1-1-3-10', + htmls: ` + 简单查询 - 功能操作 - 行列转置
+ 选择【报表管理】下的【转置】,报表中的行和列互换。
+ • 转置前:
+
+ • 转置后: +
+ ` + }, + { + name: '保存默认', + code: '1-1-3-11', + htmls: ` + 简单查询 - 功能操作 - 保存默认
+ 选择【报表管理】下的【保存默认】,将修改后的报表条件及数据保存为该报表的默认显示。
+ ` + }, + { + name: '指标选择', + code: '1-2-1', + htmls: ` + 高级查询 - 指标选择
+ 高级查询首先要选择指标,分为简单查询和模糊查找。
+ • 简单查询
+ 1. 在【指标】中选择想要查询的指标分类,该分类下的指标将显示在“指标列表”中。
+ 2. 选择“指标列表”中的指标项,选中的指标显示在右侧的“已选择的指标”中。
+ • 模糊查找
+ 在“指标列表”的搜索框中输入要查找的指标名称,点击【查询】按钮,在所有的指标范围内查找符合条件的指标名称,显示在“指标列表”中。
+ 如果想在当前查找结果中进行二次查找,勾选【结果中筛选】前的复选框。
+
+ 选好指标后,点击【查询数据】按钮,查看已选指标结果页面。
+ ` + }, + { + name: '数据地图', + code: '1-3', + htmls: ` + 数据地图
+ 当鼠标滑过地图上的地区时,会根据鼠标所指的地区,显示对应的数据信息框。
+ 如需查看其他时间的数据,在【时间】下拉框中选择时间
+ 通过左侧指标列表选择指标进行查看,指标数据会以不同的色阶在地图中显示
+
+ ` + }, + { + name: '搜索', + code: '1-4', + htmls: ` + 搜索
+ 1.在搜索框中填入要搜索的关键字:指标名称,
+ 示例:用户需查找指标名为游客的数据,在搜索框中输入“游客”
+ 2. 点击【搜索】按钮,进入搜索页面,页面上显示出符合条件的所有指标,如下图:
+
+ 用户可以通过【筛选栏目】下拉框来进行筛选,如下图。
+
+ + ` } ] } @@ -123,13 +402,14 @@ export default { methods: { handleOpen (key, keyPath) { console.log(key, keyPath) + this.defaultNew = keyPath + this.showColoect(key) }, handleClose (key, keyPath) { console.log(key, keyPath) }, selectActive (key, keyPath) { - console.log(key, keyPath) - this.showColoect(key) + console.log(key, keyPath, '00') }, // 渲染我的收藏 showColoect (key) { @@ -142,20 +422,31 @@ export default { } }, mounted () { - this.showColoect('1-1-1') - this.$detector().listenTo(this.$refs.leftHeight, (element) => { - var width = element.offsetWidth - var height = element.offsetHeight - this.$nextTick(() => { - console.log('Size: ' + width + 'x' + height) - // 使echarts尺寸重置 - this.leftHeights = height / (160 / ((1920 - 17) / document.body.clientWidth) / 10) - }) - }) + this.showColoect('1') } }