fanzhen0117

This commit is contained in:
fanzhen123
2020-01-17 15:08:44 +08:00
parent 007cda245e
commit 14658634dc
4 changed files with 368 additions and 154 deletions

View File

@@ -369,7 +369,7 @@ class computedFunc {
})
// 总数据处理
this.transBeforeData.areaName.forEach((itemName, indexName) => {
console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData')
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData')
var tableLine = {}
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
if (dataKey === 0) {

View File

@@ -1,6 +1,6 @@
<template>
<div>
<div class="chartsCont" v-if="transBefore&&!loadings">
<div class="chartsCont" v-show="transBefore&&!loadings">
<Echarts
v-if="indStatic!==0"
:echartsDatarts="echartsDatarts"
@@ -115,11 +115,6 @@ export default {
advancedStates: {
type: Boolean,
required: true
},
// 加载状态
loadings: {
type: Boolean,
required: true
}
},
data () {
@@ -366,7 +361,8 @@ export default {
// 列宽数组
lieWidthArr: [],
// 指标或地区次数 true为1次 false为非1次
labelAreaNum: true
labelAreaNum: true,
loadings: true
}
},
watch: {
@@ -505,7 +501,7 @@ export default {
},
// 监听下拉状态变化
stateTells (val) {
console.log(val, 'jjjjjj')
// console.log(val, 'jjjjjj')
// if (val) {
// if (JSON.parse(sessionStorage.getItem('classFiyData')) && JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) {
// this.transBefore = {}
@@ -598,8 +594,11 @@ export default {
downLaSelectArea (valStrinf) {
console.log(valStrinf, '555222000选中')
console.log(this.$store.state.AreaAllCountData, 'kkkkk数据')
if (this.$store.state.defaultShowDataState && this.labelAreaNum && this.$store.state.defaultShowLabelAreaState !== 'defaultOnLine') {
if (this.$store.state.defaultShowDataState && this.labelAreaNum && this.$store.state.defaultShowLabelAreaState === 'defaultLocal') {
this.transBefore = this.$store.state.transBefore
setTimeout(() => {
this.loadings = false
}, 1500)
} else {
if (this.$route.query.type === 'area') {
if (!this.$store.state.advancedSearchState) {
@@ -624,7 +623,9 @@ export default {
this.$store.state.areaIndexName = valStrinf
this.selectState = 2
}
// if (!this.labelAreaNum) {
this.advancedSearchDataShow()
// }
}
}
}
@@ -674,33 +675,24 @@ export default {
* */
/* eslint-disable */
downLaSelects() {
// console.log(this.$store.state.advancedSearchState, 'this.$store.state.advancedSearchState0000000000000000000000')
// console.log(this.leftState, 'this.leftState')
// if (this.leftState) {
// if (this.$route.query.type !== 'area') {
// if (!this.$store.state.advancedSearchState) {
// this.getDatas()
// } else {
// this.advancedSearchDataShow()
// }
// } else {
// }
// } else {
if (this.$route.query.type !== 'area') {
console.log('走这里000125')
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowLabelAreaState === 'defaultOnLine') {// 显示默认数据并且是显示默认线上数据
console.log(12550)
if (!this.$store.state.advancedSearchState) {
this.getDatas()
} else {
this.advancedSearchDataShow()
}
} else if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowLabelAreaState === 'normal') {// 显示默认数据并且是正常显示数据
console.log(12551)
if (!this.$store.state.advancedSearchState) {
this.getDatas()
} else {
this.advancedSearchDataShow()
}
} else if (this.$route.query.defaultLeftId !== 'default') {// 显示非正常数据
console.log(12552)
if (!this.$store.state.advancedSearchState) {
this.getDatas()
} else {
@@ -708,11 +700,12 @@ export default {
}
}
} else {
console.log(this.$store.state.timeNum,'this.$store.state.timeNum')
console.log(this.$store.state.timeNum, 'this.$store.state.timeNum')
if (this.$route.query.defaultLeftId === 'default' && !this.$store.state.timeNum) {// 显示非正常数据
if (!this.$store.state.advancedSearchState) {
this.getDatas()
} else {
console.log(this.$store.state.timeNum, 'downLaSelects')
this.advancedSearchDataShow()
}
}
@@ -750,27 +743,32 @@ export default {
this.$store.state.noDataState = false
this.leftState = true
}
if (this.$store.state.defaultShowDataState && this.$route.query.type !== 'area') {
this.$store.state.transdtr = true
// 全局总数据
this.transBefore = this.$store.state.transBefore
this.leftState = true
console.log(this.$store.state.transBefore, 'this.transBefore if')
if (!this.$store.state.advancedSearchState) {
if (this.$store.state.defaultShowDataState && this.$route.query.type !== 'area') {
this.$store.state.transdtr = true
// 全局总数据
this.transBefore = this.$store.state.transBefore
this.leftState = true
console.log(this.$store.state.transBefore, 'this.transBefore if')
console.log(this.$store.state.SelecttDimension, 'this.$store.state.SelecttDimension')
if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') {
this.transState = true
} else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') {
this.transState = false
}
this.chartsStatusMegger.transState = this.transState
} else {
console.log(this.$store.state.transBefore, 'this.transBefore else')
this.$parent.childChartsCutShow()
if (this.$store.state.yesNoClickChange && this.$store.state.defaultShowLabelAreaState === 'defaultLocal') {
this.$parent.changeCutShow()
}
}
console.log(this.$store.state.SelecttDimension, 'this.$store.state.SelecttDimension')
if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') {
this.transState = true
} else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') {
this.transState = false
}
this.chartsStatusMegger.transState = this.transState
} else {
console.log(this.$store.state.transBefore, 'this.transBefore else')
console.log('0000000000000000000011111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222')
this.$parent.childChartsCutShow()
if (this.$store.state.yesNoClickChange && this.$store.state.defaultShowLabelAreaState === 'defaultLocal') {
this.$parent.changeCutShow()
}
}
console.log(this.$store.state.SelecttDimension, 'this.$store.state.SelecttDimension')
}).catch((fail) => {
console.log(fail)
})
@@ -1112,6 +1110,9 @@ export default {
},
// 获取后台数据表中的数据
getDatas() {
// 加载数据
this.transBefore = null
this.loadings = true
if (!this.$store.state.advancedSearchState) {
// 初始化计算数据
if (this.transBefore) {
@@ -1141,7 +1142,7 @@ export default {
if (this.downLaSelect.area === '' || this.downLaSelect.label === '') {
console.log(this.downLaSelect.area, 'this.downLaSelect.area')
let brrtf = {}
brrtf.tableExplain = res.data.data.tableExplain
brrtf.tableExplain = res.data.data.tableExplain ? res.data.data.tableExplain : ''
brrtf.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
brrtf.termsName = res.data.data.termsName
brrtf.termsExplain = res.data.data.termsExplain
@@ -1183,7 +1184,7 @@ export default {
console.log(this.$store.state.noChangeData, 'this.$store.state.noChangeDatathis.$store.state.noChangeDatathis.$store.state.noChangeData')
} else {
this.transBefore = {}
this.transBefore.tableExplain = res.data.data.tableExplain
this.transBefore.tableExplain = res.data.data.tableExplain ? res.data.data.tableExplain : ''
this.transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
this.transBefore.termsName = res.data.data.termsName
this.transBefore.termsExplain = res.data.data.termsExplain
@@ -1202,7 +1203,7 @@ export default {
}
} else {
this.transBefore = {}
this.transBefore.tableExplain = res.data.data.tableExplain
this.transBefore.tableExplain = res.data.data.tableExplain ? res.data.data.tableExplain : ''
this.transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
this.transBefore.termsName = res.data.data.termsName
this.transBefore.termsExplain = res.data.data.termsExplain
@@ -1236,6 +1237,7 @@ export default {
this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.transBefore))
// this.transState = this.$store.state.yesNoClickZZ
console.log(this.$store.state.SelecttDimension, 'this.$store.state.SelecttDimension')
this.loadings = false
}).catch((fail) => {
console.log(fail, 2369)
})
@@ -1243,10 +1245,17 @@ export default {
} else {
this.transBefore = this.$store.state.transBefore
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
this.loadings = false
}
},
// 高级查询数据渲染
advancedSearchDataShow() {
console.log('这里是高级查询!')
console.log(this.$store.state.advanceData, '这里是高级查询!')
console.log(this.$store.state.areaIndexName, '这里是高级查询!')
console.log(this.$store.state.labelIndexName, '这里是高级查询!')
this.transBefore = null
this.loadings = true
this.$axios({
method: 'POST',
url: 'data/data/query',
@@ -1264,13 +1273,23 @@ export default {
// 请求接口完成 请求成功
if (res.data.code === 200) {
let transBefore = {}
transBefore.tableExplain = res.data.data.tableExplain
transBefore.tableExplain = res.data.data.tableExplain ? res.data.data.tableExplain : ''
transBefore.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
transBefore.termsName = res.data.data.termsName
transBefore.termsExplain = res.data.data.termsExplain
transBefore.areaName = res.data.data.areaName
transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData[0]
// 转置后在请求数据 需要将数据转置
if (this.$store.state.yesNoClickZZ && !this.leftState) {
let transBeforeAreaData = JSON.parse(JSON.stringify(res.data.data.transBeforeAreaData[0]))
transBefore.transBeforeAreaData = transBeforeAreaData[0].map((col, index) => {
return transBeforeAreaData.map((row, key) => {
return row[index]
})
})
} else {
transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData[0]
}
console.log(transBefore, '000')
this.$store.state.transdtr = true
// 全局总数据
@@ -1290,6 +1309,7 @@ export default {
// 告诉父组件我完成任务重置状态
this.$emit('prentsState', false)
this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.transBefore))
this.loadings = false
}).catch((fail) => {
console.log(fail)
})
@@ -1431,9 +1451,9 @@ export default {
letter-spacing: 0.125rem;
color: #333333;
}
& > .tableExplain::-webkit-scrollbar {
display: none;
}
// & > .tableExplain::-webkit-scrollbar {
// display: none;
// }
}
// 指标解释
.slotExplain {

View File

@@ -208,20 +208,24 @@ export default {
// }
],
// 默认数据显示状态
defaultStateShowData: true
defaultStateShowData: true,
// 是否点击了序列true 是 false否
yesNoClickXX: false
}
},
watch: {
// 监听左侧菜单的数据变化
defaultDataRight: {
handler (val) {
// console.log(val, '左侧数据变化chartsCut')
console.log(val, '左侧数据变化chartsCut')
if (val) {
// 初始化公共数据
if (this.$route.query.type !== 'area') {
this.searchSelect(this.$route.query.type, null)
} else {
this.searchSelect(val.f, null)
if (!this.$store.state.advancedSearchState) {
if (this.$route.query.type !== 'area') {
this.searchSelect(this.$route.query.type, null)
} else {
this.searchSelect(val.f, null)
}
}
}
},
@@ -384,6 +388,7 @@ export default {
// 指标地区数据渲染
showLabelArea () {
console.log(this.stateChangeSDF, this.$store.state.dataArealabelTime, '走走走')
if (this.$store.state.classifyIdDataState) {
if (!this.$store.state.advancedSearchState) { // 非高级查询
if (this.stateChangeSDF) { // 指标
@@ -429,23 +434,37 @@ export default {
}
} else { // 高级查询
if (this.$route.query.type !== 'area') {
console.log('直接走1')
this.$emit('stateDFGHJ', true)
} else {
if (this.stateChangeSDF) { // 指标
this.options = this.$store.state.dataArealabelTime.quotaArr.map((item, index) => {
return {
value: item,
label: item
}
})
console.log(this.$store.state.yesNoClickZZ, 'this.$store.state.yesNoClickZZ')
if (this.$store.state.advancedSearchState && !this.yesNoClickXX) {
this.options = this.$store.state.advanceData.map((item, index) => {
return item.name
}).map((item, index) => {
return {
value: item,
label: item
}
})
} else {
this.options = this.$store.state.dataArealabelTime.quotaArr.map((item, index) => {
return {
value: item,
label: item
}
})
}
this.options.unshift({
value: '序列',
label: '序列'
})
console.log(this.$store.state.defaultShowDataState, 'this.$store.state.defaultShowDataState1')
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState) {
console.log(this.$store.state.defaultShowDataState, 'this.$store.state.defaultShowDataState10')
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState && this.$store.state.defaultShowLabelAreaState !== 'normal') {
this.value = [this.$store.state.newSelectLabelArea.sequenceCont]
} else {
console.log(this.options, 'this.optionsk102569')
this.value = [this.options[1].value]
}
console.log(this.value, 'this.options')
@@ -453,18 +472,29 @@ export default {
this.$emit('stateDFGHJ', true)
this.$emit('statertfResu', this.value[0])
} else { // 地区
this.options = this.$store.state.dataArealabelTime.areaArr.map((item, index) => {
return {
value: item,
label: item
}
})
if (this.$store.state.advancedSearchState && !this.yesNoClickXX) {
this.options = this.$store.state.advanceData.map((item, index) => {
return item.name
}).map((item, index) => {
return {
value: item,
label: item
}
})
} else {
this.options = this.$store.state.dataArealabelTime.areaArr.map((item, index) => {
return {
value: item,
label: item
}
})
}
this.options.unshift({
value: '序列',
label: '序列'
})
console.log(this.$store.state.defaultShowDataState, 'this.$store.state.defaultShowDataState2')
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState) {
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState && this.$store.state.defaultShowLabelAreaState !== 'normal') {
this.value = [this.$store.state.newSelectLabelArea.sequenceCont]
} else {
this.value = [this.options[1].value]
@@ -688,6 +718,7 @@ export default {
console.log(value)
console.log(this.value, 'this.value')
if (value[0] === '序列') {
this.yesNoClickXX = !this.yesNoClickXX
this.stateChangeSDF = !this.stateChangeSDF
this.$store.state.newSelectDaaState = this.stateChangeSDF
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
@@ -737,6 +768,7 @@ export default {
}
},
callBackValOpen (res) { // 展开回调
this.$store.state.defaultShowLabelAreaState = 'normal'
console.log(res, '展开')
console.log(this.$store.state.SelecttDimension, 'this.$store.state.advancedSearchState0000000000000000000000')
this.changesInputStu()

View File

@@ -205,7 +205,6 @@
:statesDf="statesDf"
@tellAreadly="tellAreadly"
@prentsState="prentsState"
:downLaSelects="downLaSelect"
@stateDataGet="stateDataGet"
:showTableState="showTableState"
@statertyui="statertyui"
@@ -213,7 +212,6 @@
:advancedStates="advancedStates"
@tellParentsShowClos="tellParentsShowClos"
@tellChangeFan="tellChangeFan"
:loadings.sync="loading&&$store.state.classifyIdDataState"
></ChartsCont>
</div>
<div class="container">
@@ -476,7 +474,7 @@ export default {
* @desc 触发子组件 childChartCont 的downLaSelects方法
*/
chuFachildChartCont () {
console.log(this.$refs, 'this.$refs')
console.log(this.$refs, 'this.$refs789')
this.$nextTick(() => {
this.$refs.childChartCont.downLaSelects()
})
@@ -544,6 +542,7 @@ export default {
this.$store.state.yesNoClickChange = false
this.$store.state.timeNum = true
this.$store.state.yesNoClickZZ = false
this.$store.state.defaultShowLabelAreaState = 'normal'
},
handleClose (key, keyPath) {
console.log(key, keyPath, '关闭打印')
@@ -683,10 +682,14 @@ export default {
return item.classify_id
})
this.$nextTick(() => {
this.$store.state.defaultShowLabelAreaState = 'normal'
console.log(this.$store.state.advancedSelectClassfiid, 'this.$store.state.advancedSelectClassfiid')
// 左侧菜单数据
this.$refs.childChartsCut.searchSelect(this.$store.state.selectDataLeft.f, null)
this.getCateData()
this.childChartContShow(this.$store.state.advancedSelectClassfiid)
this.$store.state.labelIndexName = this.$store.state.advanceData[0].nameText
this.$store.state.timeNum = true
})
break
}
@@ -914,48 +917,154 @@ export default {
// 获取本地保存数据
if (this.$store.state.transBefore) {
if (this.$route.query.type !== 'area') { // 非地区数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
arrtsBGY.push({
type: this.$route.query.type,
if (!this.$store.state.advancedSearchState) { // 非高级查询数据存默认数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
arrtsBGY.push({
type: this.$route.query.type,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension, // 左侧选中
advancedSearchState: this.$store.state.advancedSearchState
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = this.$store.state.transBefore
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = this.$store.state.allNochangeInitData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
arrtsBGY.find(item => item.type === this.$route.query.type).advancedSearchState = this.$store.state.advancedSearchState
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
}
} else { // 本地不存在
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$store.state.selectDataLeft.f,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension// 左侧选中
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = this.$store.state.transBefore
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = this.$store.state.allNochangeInitData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
SelecttDimension: this.$store.state.SelecttDimension,
advancedSearchState: this.$store.state.advancedSearchState
}]))
}
} else { // 高级查询保存默认数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
arrtsBGY.push({
type: this.$route.query.type,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension, // 左侧选中
advancedSearchState: this.$store.state.advancedSearchState, // 高级查询状态
advanceData: this.$store.state.advanceData, // 高级查询数据
areaIndexName: this.$store.state.areaIndexName, // 地区名称
labelIndexName: this.$store.state.labelIndexName // 指标名称
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = this.$store.state.transBefore
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = this.$store.state.allNochangeInitData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
arrtsBGY.find(item => item.type === this.$route.query.type).advancedSearchState = this.$store.state.advancedSearchState
arrtsBGY.find(item => item.type === this.$route.query.type).advanceData = this.$store.state.advanceData
arrtsBGY.find(item => item.type === this.$route.query.type).areaIndexName = this.$store.state.areaIndexName
arrtsBGY.find(item => item.type === this.$route.query.type).labelIndexName = this.$store.state.labelIndexName
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
}
} else { // 本地不存在
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$store.state.selectDataLeft.f,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension,
advancedSearchState: this.$store.state.advancedSearchState, // 高级查询状态
advanceData: this.$store.state.advanceData, // 高级查询数据
areaIndexName: this.$store.state.areaIndexName, // 地区名称
labelIndexName: this.$store.state.labelIndexName // 指标名称
}]))
}
} else { // 本地不存在
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$store.state.selectDataLeft.f,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension
}]))
}
} else { // 地区数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
if (!this.$store.state.advancedSearchState) { // 非高级查询数据存默认数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
btyData.transBeforeAreaData = btyAreaData[0].map((col, index) => {
return btyAreaData.map((row, key) => {
return row[index]
})
})
}
arrtsBGY.push({
type: this.$route.query.type,
allNochangeInitData: btyData,
transBefore: btyData,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension,
yesNoClickChange: this.$store.state.yesNoClickChange, // 维度转换是否被点击
yesNoClickZZ: this.$store.state.yesNoClickZZ, // 转置是否被点击
advancedSearchState: this.$store.state.advancedSearchState
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
btyData.transBeforeAreaData = btyAreaData[0].map((col, index) => {
return btyAreaData.map((row, key) => {
return row[index]
})
})
}
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = btyData
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = btyData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickChange = this.$store.state.yesNoClickChange
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickZZ = this.$store.state.yesNoClickZZ
arrtsBGY.find(item => item.type === this.$route.query.type).advancedSearchState = this.$store.state.advancedSearchState
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
}
} else { // 本地不存在
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
@@ -965,22 +1074,82 @@ export default {
})
})
}
arrtsBGY.push({
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$route.query.type,
allNochangeInitData: btyData,
transBefore: btyData,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
// sequenceCont:,//序列选中内容
// sequenceState://序列状态 筛选指标 筛选地区
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension,
SelecttDimension: this.$store.state.SelecttDimension, // 行列代表的是指标、地区、时间
yesNoClickChange: this.$store.state.yesNoClickChange, // 维度转换是否被点击
yesNoClickZZ: this.$store.state.yesNoClickZZ// 转置是否被点击
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
yesNoClickZZ: this.$store.state.yesNoClickZZ, // 维度转换是否被点击
advancedSearchState: this.$store.state.advancedSearchState
}]))
}
} else { // 高级查询数据存默认数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
btyData.transBeforeAreaData = btyAreaData[0].map((col, index) => {
return btyAreaData.map((row, key) => {
return row[index]
})
})
}
arrtsBGY.push({
type: this.$route.query.type,
allNochangeInitData: btyData,
transBefore: btyData,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension,
yesNoClickChange: this.$store.state.yesNoClickChange, // 维度转换是否被点击
yesNoClickZZ: this.$store.state.yesNoClickZZ, // 转置是否被点击
advancedSearchState: this.$store.state.advancedSearchState, // 高级查询状态
advanceData: this.$store.state.advanceData, // 高级查询数据
areaIndexName: this.$store.state.areaIndexName, // 地区名称
labelIndexName: this.$store.state.labelIndexName // 指标名称
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
btyData.transBeforeAreaData = btyAreaData[0].map((col, index) => {
return btyAreaData.map((row, key) => {
return row[index]
})
})
}
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = btyData
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = btyData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickChange = this.$store.state.yesNoClickChange
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickZZ = this.$store.state.yesNoClickZZ
arrtsBGY.find(item => item.type === this.$route.query.type).advancedSearchState = this.$store.state.advancedSearchState
arrtsBGY.find(item => item.type === this.$route.query.type).advanceData = this.$store.state.advanceData
arrtsBGY.find(item => item.type === this.$route.query.type).areaIndexName = this.$store.state.areaIndexName
arrtsBGY.find(item => item.type === this.$route.query.type).labelIndexName = this.$store.state.labelIndexName
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
}
} else { // 本地不存在
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
@@ -990,43 +1159,26 @@ export default {
})
})
}
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = btyData
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = btyData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickChange = this.$store.state.yesNoClickChange
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickZZ = this.$store.state.yesNoClickZZ
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$route.query.type,
allNochangeInitData: btyData,
transBefore: btyData,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
// sequenceCont:,//序列选中内容
// sequenceState://序列状态 筛选指标 筛选地区
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension, // 行列代表的是指标、地区、时间
yesNoClickChange: this.$store.state.yesNoClickChange, // 维度转换是否被点击
yesNoClickZZ: this.$store.state.yesNoClickZZ, // 维度转换是否被点击
advancedSearchState: this.$store.state.advancedSearchState, // 高级查询状态
advanceData: this.$store.state.advanceData, // 高级查询数据
areaIndexName: this.$store.state.areaIndexName, // 地区名称
labelIndexName: this.$store.state.labelIndexName // 指标名称
}]))
}
} else { // 本地不存在
let btyData = JSON.parse(JSON.stringify(this.$store.state.allNochangeInitData))
if (this.$store.state.yesNoClickZZ) {
let btyAreaData = btyData.transBeforeAreaData
btyData.transBeforeAreaData = btyAreaData[0].map((col, index) => {
return btyAreaData.map((row, key) => {
return row[index]
})
})
}
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$route.query.type,
allNochangeInitData: btyData,
transBefore: btyData,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.yesNoClickChange ? { sequenceCont: this.$store.state.newSelectChangeData, sequenceState: 3 } : this.$store.state.newSelectLabelArea
// sequenceCont:,//序列选中内容
// sequenceState://序列状态 筛选指标 筛选地区
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension, // 行列代表的是指标、地区、时间
yesNoClickChange: this.$store.state.yesNoClickChange, // 维度转换是否被点击
yesNoClickZZ: this.$store.state.yesNoClickZZ// 维度转换是否被点击
}]))
}
}
this.$alert('默认数据已保存!', '温馨提示', {
@@ -1323,12 +1475,21 @@ export default {
console.log(JSON.parse(arrData).find(item => item.type === this.$route.query.type))
// 调用子组件 searchSelect 方法渲染下拉
// 赋值数据
// console.log(JSON.parse(arrData).find(item => item.type === this.$route.query.type).transBefore, '赋值数据')
this.$store.state.selectDataLeft = JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft
console.log(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate.time.value, '全职0')
this.$store.state.selectData = JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate.time.value
console.log(this.$store.state.selectDataLeft, '赋值数据')
this.$store.state.selectfilter = this.$store.state.selectDataLeft.f
this.$store.state.SelecttDimension = JSON.parse(arrData).find(item => item.type === this.$route.query.type).SelecttDimension
this.$store.state.yesNoClickZZ = JSON.parse(arrData).find(item => item.type === this.$route.query.type).yesNoClickZZ
this.$store.state.yesNoClickChange = JSON.parse(arrData).find(item => item.type === this.$route.query.type).yesNoClickChange
this.$store.state.advancedSearchState = JSON.parse(arrData).find(item => item.type === this.$route.query.type).advancedSearchState
// 高级查询
if (this.$store.state.advancedSearchState) {
this.$store.state.advanceData = JSON.parse(arrData).find(item => item.type === this.$route.query.type).advanceData
this.$store.state.areaIndexName = JSON.parse(arrData).find(item => item.type === this.$route.query.type).areaIndexName
this.$store.state.labelIndexName = JSON.parse(arrData).find(item => item.type === this.$route.query.type).labelIndexName
}
if (this.$route.query.type === 'area') {
let changeDarat = JSON.parse(JSON.stringify(JSON.parse(arrData).find(item => item.type === this.$route.query.type).allNochangeInitData))
this.$store.state.transBefore = JSON.parse(JSON.stringify(changeDarat))
@@ -1343,8 +1504,6 @@ export default {
this.$store.state.allNochangeInitData = JSON.parse(arrData).find(item => item.type === this.$route.query.type).allNochangeInitData
}
console.log(this.$store.state.SelecttDimension, 'this.$store.state.advancedSearchState0000000000000000000000')
this.$refs.childChartsCut.searchSelect(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft.f, JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate)
this.$refs.childChartCont.getInfor(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft.id)
if (this.$store.state.yesNoClickChange && this.$route.query.type === 'area') {
if ((this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') || (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb')) {
this.$store.state.noSelecttDimension = 'dq'
@@ -1354,8 +1513,11 @@ export default {
this.$store.state.noSelecttDimension = 'sj'
}
this.$store.state.newSelectChangeData = [JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate.sequence.sequenceCont]
// this.$refs.childChartsCut.areaDimensionDo(true)
}
this.$refs.childChartsCut.searchSelect(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft.f, JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate)
this.$refs.childChartCont.getInfor(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft.id)
if (this.$store.state.advancedSearchState) {
this.$refs.childChartCont.advancedSearchDataShow()
}
} else {
this.$axios({