fanzhen1219
This commit is contained in:
@@ -247,7 +247,19 @@ class computedFunc {
|
||||
// 重定向数组
|
||||
let listArrs = JSON.parse(JSON.stringify(listArr))
|
||||
let lineArrs = JSON.parse(JSON.stringify(lineArr))
|
||||
console.log(listArrs, lineArrs)
|
||||
console.log(this.restur, 'this.restur')
|
||||
listArrs.push(0) // 必选第一项
|
||||
if (this.restur.tableLine.length < listArrs.length) {
|
||||
listArrs = this.restur.tableLine.map((item, index) => {
|
||||
return index
|
||||
})
|
||||
}
|
||||
if (this.restur.countData.length < lineArrs.length) {
|
||||
lineArrs = this.restur.countData.map((item, index) => {
|
||||
return index
|
||||
})
|
||||
}
|
||||
// 处理数据显示
|
||||
this.selectData.tableLine = []
|
||||
listArrs.forEach((items, indexs) => {
|
||||
@@ -359,8 +371,11 @@ class computedFunc {
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.areaName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
@@ -401,6 +416,130 @@ class computedFunc {
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 时间======指标
|
||||
comTransAreabeforeTimeLabel () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '时间'
|
||||
})
|
||||
this.transBeforeData.termsName.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.timeArr.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 指标======时间
|
||||
comTransAreabeforeLabelTime () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '指标'
|
||||
})
|
||||
this.transBeforeData.timeArr.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
// console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData')
|
||||
// console.log(this.transBeforeData.termsName, 'this.transBeforeData.termsName')
|
||||
this.transBeforeData.termsName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
// console.log(itemName, '[itemName]')
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 地区======指标
|
||||
comTransAreabeforeAreaLabel () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '地区'
|
||||
})
|
||||
this.transBeforeData.termsName.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.areaName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// 地区数据对于维度转化的处理 指标======地区
|
||||
comTransAreabeforeLabelArea () {
|
||||
// 表头数据处理
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line0',
|
||||
label: '指标'
|
||||
})
|
||||
this.transBeforeData.areaName.forEach((itemTime, indexTime) => {
|
||||
this.restur.tableLine.push({
|
||||
labelId: 'table_line' + (indexTime + 1),
|
||||
label: itemTime
|
||||
})
|
||||
})
|
||||
// 总数据处理
|
||||
console.log(this.transBeforeData, 'this.transBeforeDataname')
|
||||
this.transBeforeData.termsName.forEach((itemName, indexName) => {
|
||||
var tableLine = {}
|
||||
// console.log(this.transBeforeData.transBeforeAreaData, 'this.transBeforeData.transBeforeAreaData[indexName]')
|
||||
// console.log(indexName, '[indexName]')
|
||||
this.transBeforeData.transBeforeAreaData[indexName].forEach((dataList, dataKey) => {
|
||||
// console.log(dataKey)
|
||||
if (dataKey === 0) {
|
||||
tableLine['table_line0'] = itemName
|
||||
}
|
||||
tableLine['table_line' + (dataKey + 1)] = dataList
|
||||
})
|
||||
this.restur.countData.push(tableLine)
|
||||
})
|
||||
return this.restur
|
||||
}
|
||||
// SUM求和 ============对行运算
|
||||
dataSumLine () {
|
||||
console.log(this.restur, '对行运算')
|
||||
@@ -785,6 +924,7 @@ class computedFunc {
|
||||
this.restur = dataRs
|
||||
return this.restur
|
||||
}
|
||||
// ========================================================非地区数据
|
||||
// 竖状图数据 ============行转换
|
||||
dataVerticalMapRow () {
|
||||
let termsName = []
|
||||
@@ -862,6 +1002,84 @@ class computedFunc {
|
||||
}]
|
||||
return this.chartsDatazz
|
||||
}
|
||||
// =========================================================地区数据
|
||||
// 竖状图数据 ============行转换 时间===地区
|
||||
dataVerticalMapRowAreaSJDQ () {
|
||||
let termsName = []
|
||||
let cloneSarr = JSON.parse(JSON.stringify(this.selectData.countData))
|
||||
console.log(this.chartsDatazz, '1012')
|
||||
this.chartsDatazz.series = cloneSarr.map((item, index) => {
|
||||
let obju = Object.values(item)
|
||||
let keys = obju.shift()
|
||||
termsName.push(keys)
|
||||
return {
|
||||
name: keys,
|
||||
type: 'bar',
|
||||
data: obju
|
||||
}
|
||||
})
|
||||
this.chartsDatazz.legend = {
|
||||
type: 'scroll',
|
||||
bottom: 0,
|
||||
data: termsName
|
||||
}
|
||||
let timeArr = this.selectData.tableLine.map((item, index) => {
|
||||
return item.label
|
||||
})
|
||||
timeArr.shift()
|
||||
this.chartsDatazz.xAxis = [{
|
||||
type: 'category',
|
||||
data: timeArr
|
||||
}]
|
||||
this.chartsDatazz.yAxis = [{
|
||||
type: 'value',
|
||||
splitNumber: 6
|
||||
}]
|
||||
console.log(this.chartsDatazz)
|
||||
return this.chartsDatazz
|
||||
}
|
||||
// 竖状图数据 ============列转换 地区===时间
|
||||
dataVerticalMapColAreaDQSJ () {
|
||||
this.chartsDatazz.yAxis = [{
|
||||
type: 'value',
|
||||
splitNumber: 6
|
||||
}]
|
||||
let cloneSarr = JSON.parse(JSON.stringify(this.selectData.countData))
|
||||
let termsName = []
|
||||
let seriess = cloneSarr.map((item, index) => {
|
||||
let obju = Object.values(item)
|
||||
let keys = obju.shift()
|
||||
termsName.push(keys)
|
||||
return obju
|
||||
})
|
||||
// 将数据转置
|
||||
this.chartsDatazz.series = this.comRowColAllData(seriess).map((item, index) => {
|
||||
console.log(this.selectData.tableLine[index + 1].label, '454545')
|
||||
return {
|
||||
name: this.selectData.tableLine[index + 1].label,
|
||||
type: 'bar',
|
||||
data: item
|
||||
}
|
||||
})
|
||||
let timeArr = this.selectData.tableLine.map((item, index) => {
|
||||
return item.label
|
||||
})
|
||||
timeArr.shift()
|
||||
this.chartsDatazz.legend = {
|
||||
type: 'scroll',
|
||||
bottom: 0,
|
||||
data: timeArr
|
||||
}
|
||||
this.chartsDatazz.xAxis = [{
|
||||
type: 'category',
|
||||
data: termsName
|
||||
}]
|
||||
this.chartsDatazz.yAxis = [{
|
||||
type: 'value',
|
||||
splitNumber: 6
|
||||
}]
|
||||
return this.chartsDatazz
|
||||
}
|
||||
// 横状图数据 ============行转换
|
||||
dataAcrossMapRow () {
|
||||
let termsName = []
|
||||
@@ -1105,7 +1323,9 @@ class computedFunc {
|
||||
shHangData = tableData.map((item, index) => {
|
||||
// console.log(Object.values(item).filter((list, key) => { return yuan.indexOf(key) !== -1 }))
|
||||
// tableData.forEach((list, key) => {
|
||||
return Object.values(item).filter((list, key) => { return yuan.indexOf(key) !== -1 })
|
||||
return Object.values(item).filter((list, key) => {
|
||||
return yuan.indexOf(key) !== -1
|
||||
})
|
||||
// })
|
||||
}).filter((item, index) => {
|
||||
return lineInputVal.indexOf(index) !== -1
|
||||
|
||||
@@ -9,35 +9,45 @@
|
||||
<el-col :span="24">
|
||||
<el-menu
|
||||
class="el-menu-vertical-demo"
|
||||
:default-openeds="defaultOpenDataCode"
|
||||
@open="handleOpen"
|
||||
@close="handleClose"
|
||||
@select="selectActive"
|
||||
style="border:none"
|
||||
>
|
||||
<el-submenu :index="''+index1" v-for="(item1,index1) in leftCateData" :key="index1">
|
||||
<el-submenu
|
||||
:index="''+index1"
|
||||
v-for="(item1,index1) in leftCateData"
|
||||
:key="index1"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item1.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item1.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2"
|
||||
v-for="(item2,index2) in item1.children"
|
||||
:key="index2"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item2.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item2.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2+'-'+index3"
|
||||
v-for="(item3,index3) in item2.children"
|
||||
:key="index3"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item3.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item3.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2+'-'+index3+'-'+index4"
|
||||
v-for="(item4,index4) in item3.children"
|
||||
:key="index4"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item4.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item4.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2+'-'+index3+'-'+index4+'-'+index5"
|
||||
v-for="(item5,index5) in item4.children"
|
||||
:key="index5"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item5.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item4.name}}</template>
|
||||
</el-submenu>
|
||||
@@ -120,6 +130,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
// 默认展开
|
||||
defaultOpenDataCode: null,
|
||||
zhibiaoImg: require('../../../static/chatCont/zhibiaojieshi.png'),
|
||||
leftCateData: null,
|
||||
checkboxState: false,
|
||||
@@ -180,8 +191,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleOpen (key, keyPath) {
|
||||
console.log(key, keyPath)
|
||||
this.getCateData()
|
||||
console.log(key, keyPath, '开444')
|
||||
console.log(key.split('-'))
|
||||
let datart = []
|
||||
key.split('-').forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
datart = this.leftCateData[item]
|
||||
} else {
|
||||
datart = datart.children[item]
|
||||
}
|
||||
})
|
||||
console.log(datart.id, 1010111)
|
||||
this.selectClassId = datart.id
|
||||
this.$store.state.selectDataLeft = datart
|
||||
this.searchArealy()
|
||||
},
|
||||
handleClose (key, keyPath) {
|
||||
console.log(key, keyPath)
|
||||
@@ -247,7 +270,8 @@ export default {
|
||||
method: 'GET',
|
||||
url: 'data/data/list',
|
||||
params: {
|
||||
type: this.$route.query.type
|
||||
type: this.$route.query.type === 'area' ? 2 : 1,
|
||||
f: this.$store.state.selectDataLeft.f
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '左侧菜单')
|
||||
@@ -255,7 +279,7 @@ export default {
|
||||
if (res.data.code === 200) {
|
||||
this.leftCateData = res.data.data.list
|
||||
this.selectClassId = this.leftCateData[0].id
|
||||
console.log(this.selectClassId,'this.selectClassId000')
|
||||
console.log(this.selectClassId, 'this.selectClassId000')
|
||||
this.searchArealy()
|
||||
}
|
||||
}).catch((fail) => {
|
||||
@@ -342,6 +366,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getCateData()
|
||||
this.defaultOpenDataCode = this.$store.state.openOpenLeft
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -106,6 +106,26 @@ export default {
|
||||
stateTells: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
downLaSelects: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
downLaSelectArea: {
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
showTableState: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
areaDimensionStateS: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
advancedStates: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -323,7 +343,7 @@ export default {
|
||||
// 调用存储的对象
|
||||
objCompBefore: null,
|
||||
// echarts渲染的数据======>非饼图
|
||||
echartsDatarts: { ghg: 1 },
|
||||
echartsDatarts: {},
|
||||
// 饼图数据
|
||||
echartsDatartsPie: {},
|
||||
// 行列转换索引状态0行1列
|
||||
@@ -342,10 +362,26 @@ export default {
|
||||
downLaSelect: {
|
||||
area: '',
|
||||
label: ''
|
||||
}
|
||||
},
|
||||
// 执行状态
|
||||
hangZhiState: false,
|
||||
// 高级查询数据
|
||||
startsyui: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听父组件高级查询
|
||||
startsyui (val, oldValue) {
|
||||
console.log(val, oldValue, '12333333')
|
||||
if (val) {
|
||||
console.log(this.$store.state.transBefore, '12')
|
||||
this.transBefore = this.$store.state.transBefore
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// // 告诉父组件渲染完毕
|
||||
this.$emit('tellParentsShowClos', false)
|
||||
this.startsyui = false
|
||||
}
|
||||
},
|
||||
// 监听对象
|
||||
// chartsStatusMegger: {
|
||||
// handler (newval, oldVal) {
|
||||
@@ -384,10 +420,16 @@ export default {
|
||||
immediate: true,
|
||||
deep: true
|
||||
},
|
||||
transBefore (newval, oldval) {
|
||||
if (newval && this.transBefore) {
|
||||
this.showTable()
|
||||
}
|
||||
transBefore: {
|
||||
handler (newval, oldval) {
|
||||
console.log(newval, 1020202)
|
||||
if (newval && this.transBefore) {
|
||||
console.log(this.transBefore, 'kkkkkkkkkkkkkkkkkkkkk')
|
||||
this.showTable()
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
},
|
||||
indStatic (newValue, oldValue) {
|
||||
console.log(newValue, 'newValue1212')
|
||||
@@ -423,6 +465,51 @@ export default {
|
||||
immediate: true,
|
||||
deep: true
|
||||
},
|
||||
downLaSelects (val) {
|
||||
console.log(val, 'va;111')
|
||||
if (val) {
|
||||
this.$store.state.selectData = val
|
||||
if (!this.$store.state.advancedSearchState) {
|
||||
this.getDatas()
|
||||
} else {
|
||||
this.advancedSearchDataShow()
|
||||
}
|
||||
}
|
||||
},
|
||||
downLaSelectArea (valStrinf) {
|
||||
console.log(this.$store.state.AreaAllCountData, '555222000')
|
||||
console.log(valStrinf, '555222000选中')
|
||||
console.log(this.$store.state.AreaAllCountData, 'kkkkk数据')
|
||||
if (this.$store.state.AreaAllCountData) {
|
||||
if (this.selectState === 2) {
|
||||
if (this.$store.state.AreaAllCountData.areaName.indexOf(valStrinf) !== -1) {
|
||||
let jsonData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
jsonData.transBeforeAreaData = this.$store.state.AreaAllCountData.transBeforeAreaData[this.$store.state.AreaAllCountData.areaName.indexOf(valStrinf)]
|
||||
this.transBefore = jsonData
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
} else {
|
||||
this.selectState = 1
|
||||
this.getDatas()
|
||||
// 告诉父组件改变筛选值
|
||||
this.$emit('tellChangeFan', true)
|
||||
}
|
||||
} else {
|
||||
console.log(this.$store.state.AreaAllCountData.termsName.indexOf(valStrinf), 'this.$store.state.AreaAllCountData.areaName.indexOf(valStrinf)')
|
||||
if (this.$store.state.AreaAllCountData.termsName.indexOf(valStrinf) !== -1) {
|
||||
let jsonData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
jsonData.transBeforeAreaData = this.$store.state.AreaAllCountData.transBeforeAreaData[this.$store.state.AreaAllCountData.termsName.indexOf(valStrinf)]
|
||||
this.transBefore = jsonData
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
console.log(this.$store.state.AreaAllCountData.transBeforeAreaData[this.$store.state.AreaAllCountData.termsName.indexOf(valStrinf)], '1010111')
|
||||
} else {
|
||||
this.selectState = 2
|
||||
this.getDatas()
|
||||
// 告诉父组件改变筛选值
|
||||
this.$emit('tellChangeFan', true)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 监听行列图表转换
|
||||
rowColIndex (newVal, oldVal) {
|
||||
if (this.transBefore) {
|
||||
@@ -445,7 +532,7 @@ export default {
|
||||
this.transBefore.areaName = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.areaName
|
||||
this.transBefore.transBeforeTermsData = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
console.log(this.transBefore, '000kkkkkkkkkkkkk')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
@@ -456,7 +543,9 @@ export default {
|
||||
console.log(this.$store.state.selectData, 'this.$store.state.selectData')
|
||||
console.log(this.$store.state.selectfilter, 'this.$store.state.selectfilter')
|
||||
this.$nextTick(() => {
|
||||
// this.getDatas()
|
||||
if (this.hangZhiState) {
|
||||
this.getDatas()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -466,6 +555,7 @@ export default {
|
||||
},
|
||||
// 监听下拉状态变化
|
||||
stateTells (val) {
|
||||
console.log(val, 'jjjjjj')
|
||||
if (val) {
|
||||
console.log(val, 'jjjjjj')
|
||||
if (JSON.parse(localStorage.getItem('classFiyData')) && JSON.parse(localStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) {
|
||||
@@ -483,12 +573,13 @@ export default {
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
} else {
|
||||
console.log(this.defaultDataRight, '获取左侧选中数据555')
|
||||
console.log(this.$store.state.selectData, 'this.$store.state.selectData')
|
||||
console.log(this.$store.state.selectfilter, 'this.$store.state.selectfilter')
|
||||
this.getDatas()
|
||||
}
|
||||
// } else {
|
||||
// console.log(this.defaultDataRight, '获取左侧选中数据555')
|
||||
// console.log(this.$store.state.selectData, 'this.$store.state.selectData')
|
||||
// console.log(this.$store.state.selectfilter, 'this.$store.state.selectfilter')
|
||||
// this.getDatas()
|
||||
// }
|
||||
}
|
||||
},
|
||||
statesDf (val) {
|
||||
@@ -501,12 +592,52 @@ export default {
|
||||
this.transBefore.areaName = this.$store.state.transBefore.areaName
|
||||
this.transBefore.transBeforeTermsData = this.$store.state.transBefore.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = this.$store.state.transBefore.transBeforeAreaData
|
||||
// this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// console.log(this.transBefore, '我要改变')
|
||||
// 重新渲染表格
|
||||
this.$refs.table.doLayout()
|
||||
// 告诉父组件改完了
|
||||
this.$emit('tellAreadly', 1)
|
||||
}
|
||||
},
|
||||
showTableState (val) { // 监听清除空行空列后重新渲染表格
|
||||
if (val) {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = this.$store.state.transBefore.tableExplain
|
||||
this.transBefore.timeArr = this.$store.state.transBefore.timeArr
|
||||
this.transBefore.termsName = this.$store.state.transBefore.termsName
|
||||
this.transBefore.termsExplain = this.$store.state.transBefore.termsExplain
|
||||
this.transBefore.areaName = this.$store.state.transBefore.areaName
|
||||
this.transBefore.transBeforeTermsData = this.$store.state.transBefore.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = this.$store.state.transBefore.transBeforeAreaData
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
this.$refs.table.doLayout()
|
||||
// 告诉父组件重新渲染表格完毕
|
||||
this.$emit('statertyui', false)
|
||||
}
|
||||
},
|
||||
// 监听地区数据维度转换状态
|
||||
areaDimensionStateS (newVal) {
|
||||
console.log(newVal, '1011111')
|
||||
// if (newVal) {
|
||||
if (this.$store.state.transBefore !== null) {
|
||||
this.transBefore = {}
|
||||
this.transBefore.tableExplain = this.$store.state.transBefore.tableExplain
|
||||
this.transBefore.timeArr = this.$store.state.transBefore.timeArr
|
||||
this.transBefore.termsName = this.$store.state.transBefore.termsName
|
||||
this.transBefore.termsExplain = this.$store.state.transBefore.termsExplain
|
||||
this.transBefore.areaName = this.$store.state.transBefore.areaName
|
||||
this.transBefore.transBeforeTermsData = this.$store.state.transBefore.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = this.$store.state.transBefore.transBeforeAreaData
|
||||
} else {
|
||||
this.transBefore = null
|
||||
}
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
this.$refs.table.doLayout()
|
||||
this.showTable()
|
||||
// 告诉父组件重新渲染表格完毕
|
||||
this.$emit('statertyui', false)
|
||||
// }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -529,17 +660,84 @@ export default {
|
||||
// 地区数据转置
|
||||
areaTrans () {
|
||||
if (this.transState) { // 当时间在表头上的时候
|
||||
this.objCompBefore = new ComputedData(this.transBefore)
|
||||
var objDatasBefore = this.objCompBefore.comTransAreabefore()
|
||||
this.tableLine = objDatasBefore.tableLine
|
||||
this.tableData = objDatasBefore.countData
|
||||
console.log(objDatasBefore, 'objDatasAfter')
|
||||
console.log(this.$store.state.SelecttDimension, '2020')
|
||||
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
this.objCompBefore = new ComputedData(this.transBefore)
|
||||
var objDatasBefore = this.objCompBefore.comTransAreabefore()
|
||||
this.tableLine = objDatasBefore.tableLine
|
||||
this.tableData = objDatasBefore.countData
|
||||
console.log(objDatasBefore, 'objDatasAfter1')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var objDatasAfter = objCompAfter.comTransAreaAfter()
|
||||
this.tableLine = objDatasAfter.tableLine
|
||||
this.tableData = objDatasAfter.countData
|
||||
console.log(objDatasAfter, 'objDatasAfter2')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
console.log(this.transBefore, 'this.transBeforethis.transBeforethis.transBefore')
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeLabelTime = objCompAfter.comTransAreabeforeLabelTime()
|
||||
this.tableLine = comTransAreabeforeLabelTime.tableLine
|
||||
this.tableData = comTransAreabeforeLabelTime.countData
|
||||
console.log(comTransAreabeforeLabelTime, 'comTransAreabeforeLabelTime')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeTimeLabel = objCompAfter.comTransAreabeforeTimeLabel()
|
||||
this.tableLine = comTransAreabeforeTimeLabel.tableLine
|
||||
this.tableData = comTransAreabeforeTimeLabel.countData
|
||||
console.log(comTransAreabeforeTimeLabel, 'comTransAreabeforeTimeLabel')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeAreaLabel = objCompAfter.comTransAreabeforeAreaLabel()
|
||||
this.tableLine = comTransAreabeforeAreaLabel.tableLine
|
||||
this.tableData = comTransAreabeforeAreaLabel.countData
|
||||
console.log(comTransAreabeforeAreaLabel, 'comTransAreabeforeAreaLabel')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeLabelArea = objCompAfter.comTransAreabeforeLabelArea()
|
||||
this.tableLine = comTransAreabeforeLabelArea.tableLine
|
||||
this.tableData = comTransAreabeforeLabelArea.countData
|
||||
console.log(comTransAreabeforeLabelArea, 'comTransAreabeforeLabelArea')
|
||||
}
|
||||
} else { // 当指标名称在表头上
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var objDatasAfter = objCompAfter.comTransAreaAfter()
|
||||
this.tableLine = objDatasAfter.tableLine
|
||||
this.tableData = objDatasAfter.countData
|
||||
console.log(objDatasAfter, 'objDatasAfter')
|
||||
console.log(this.$store.state.SelecttDimension, '2020')
|
||||
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var objDatasAfterB = objCompAfter.comTransAreaAfter()
|
||||
this.tableLine = objDatasAfterB.tableLine
|
||||
this.tableData = objDatasAfterB.countData
|
||||
console.log(objDatasAfterB, 'objDatasAfterB')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
this.objCompBefore = new ComputedData(this.transBefore)
|
||||
var objDatasBeforeB = this.objCompBefore.comTransAreabefore()
|
||||
this.tableLine = objDatasBeforeB.tableLine
|
||||
this.tableData = objDatasBeforeB.countData
|
||||
console.log(objDatasBeforeB, 'objDatasBeforeB')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeTimeLabelB = objCompAfter.comTransAreabeforeTimeLabel()
|
||||
this.tableLine = comTransAreabeforeTimeLabelB.tableLine
|
||||
this.tableData = comTransAreabeforeTimeLabelB.countData
|
||||
console.log(comTransAreabeforeTimeLabelB, 'comTransAreabeforeTimeLabelB')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeLabelTimeB = objCompAfter.comTransAreabeforeLabelTime()
|
||||
this.tableLine = comTransAreabeforeLabelTimeB.tableLine
|
||||
this.tableData = comTransAreabeforeLabelTimeB.countData
|
||||
console.log(comTransAreabeforeLabelTimeB, 'comTransAreabeforeLabelTimeB')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeLabelAreaB = objCompAfter.comTransAreabeforeLabelArea()
|
||||
this.tableLine = comTransAreabeforeLabelAreaB.tableLine
|
||||
this.tableData = comTransAreabeforeLabelAreaB.countData
|
||||
console.log(comTransAreabeforeLabelAreaB, 'comTransAreabeforeLabelAreaB')
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
let objCompAfter = new ComputedData(this.transBefore)
|
||||
var comTransAreabeforeAreaLabelB = objCompAfter.comTransAreabeforeAreaLabel()
|
||||
this.tableLine = comTransAreabeforeAreaLabelB.tableLine
|
||||
this.tableData = comTransAreabeforeAreaLabelB.countData
|
||||
console.log(comTransAreabeforeAreaLabelB, 'comTransAreabeforeAreaLabelB')
|
||||
}
|
||||
}
|
||||
},
|
||||
// 渲染列表数据
|
||||
@@ -674,7 +872,7 @@ export default {
|
||||
// 图表渲染
|
||||
chartsShow () {
|
||||
// 改变值行值
|
||||
|
||||
console.log(this.$route.query.type, '1010111')
|
||||
switch (this.indStatic) {
|
||||
case 1:
|
||||
if (this.pieStatic) {
|
||||
@@ -700,7 +898,9 @@ export default {
|
||||
this.pieStatic = false
|
||||
break
|
||||
case 3:
|
||||
console.log(this.lineStatic, this.rowColIndex, '555025')
|
||||
console.log(this.lineStatic, this.rowColIndex, '状态改变')
|
||||
console.log(this.listInputVal, this.lineInputVal, '行列数据前')
|
||||
// console.log(this.lineStatic, this.rowColIndex, '状态改变')
|
||||
if (this.lineStatic && this.rowColIndex === 0) {
|
||||
this.lineInputVal = [0]
|
||||
this.listInputVal = [1, 2, 3]
|
||||
@@ -710,10 +910,11 @@ export default {
|
||||
this.listInputVal = [1]
|
||||
this.lineStatic = true
|
||||
}
|
||||
console.log(this.listInputVal, this.lineInputVal)
|
||||
console.log(this.listInputVal, this.lineInputVal, '行列数据后')
|
||||
this.objCompBefore.inputSelectData(this.listInputVal, this.lineInputVal)
|
||||
this.rowColIndex === 0 ? (this.echartsDatarts = this.objCompBefore.dataPieMapRow()) : (this.echartsDatarts = this.objCompBefore.dataPieMapCol())
|
||||
this.pieStatic = true
|
||||
this.lineStatic = false
|
||||
break
|
||||
case 4:
|
||||
if (this.pieStatic) {
|
||||
@@ -732,13 +933,15 @@ export default {
|
||||
rowColInd (ind) {
|
||||
// 0行1列
|
||||
this.rowColIndex = ind
|
||||
// 重置默认
|
||||
this.lineStatic = true
|
||||
},
|
||||
// 每列input选中
|
||||
listInput (ind) {
|
||||
console.log(ind, '列')
|
||||
if (this.indStatic === 3 && this.rowColIndex === 1) {
|
||||
this.listInputVal = [ind]
|
||||
this.$refs.listInputSelect[ind].checked = true
|
||||
// this.$refs.listInputSelect[ind].checked = true
|
||||
} else {
|
||||
this.listInputVal.indexOf(ind) === -1 ? (this.listInputVal.push(ind)) : (this.listInputVal.splice(this.listInputVal.indexOf(ind), 1))
|
||||
}
|
||||
@@ -747,68 +950,105 @@ export default {
|
||||
// 每行input选中
|
||||
lineInput (ind) {
|
||||
console.log(ind, '行')
|
||||
console.log(this.rowColIndex, '行this.rowColIndex')
|
||||
console.log(this.indStatic, '行this.indStatic')
|
||||
console.log(this.$refs.lineInputSelect, '行this.lineInputSelect')
|
||||
if (this.indStatic === 3 && this.rowColIndex === 0) {
|
||||
// this.$refs.lineInputSelect.forEach((item, index) => {
|
||||
// if (index === ind) {
|
||||
// item.checked = true
|
||||
// } else {
|
||||
// item.checked = false
|
||||
// }
|
||||
// })
|
||||
console.log(this.listInputVal, this.lineInputVal, '好哥们1')
|
||||
this.lineInputVal = [ind]
|
||||
this.$refs.lineInputSelect[ind].checked = true
|
||||
// this.$refs.lineInputSelect[ind].checked = true
|
||||
console.log(this.listInputVal, this.lineInputVal, '好哥们2')
|
||||
} else {
|
||||
this.lineInputVal.indexOf(ind) === -1 ? (this.lineInputVal.push(ind)) : (this.lineInputVal.splice(this.lineInputVal.indexOf(ind), 1))
|
||||
}
|
||||
|
||||
this.chartsShow()
|
||||
},
|
||||
// 获取后台数据表中的数据
|
||||
getDatas () {
|
||||
// 初始化计算数据
|
||||
if (this.transBefore) {
|
||||
this.objCompBefore.initAllData()
|
||||
}
|
||||
console.log(this.$store.state.selectData, '执行')
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/detail',
|
||||
params: {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
table_name: this.defaultDataRight.table_name, // 表名
|
||||
id: this.defaultDataRight.id, // 分类id
|
||||
area: this.downLaSelect.area, // 选中的地区
|
||||
quota: this.downLaSelect.label, // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
f: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
data: this.$store.state.selectData // 时间
|
||||
if (!this.$store.state.advancedSearchState) {
|
||||
// 初始化计算数据
|
||||
if (this.transBefore) {
|
||||
this.objCompBefore.initAllData()
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '获取数据展示数据')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
if (res.data.data.areaName.length !== 0) {
|
||||
if (this.downLaSelect.area === '' || this.downLaSelect.label === '') {
|
||||
console.log(this.downLaSelect.area, 'this.downLaSelect.area')
|
||||
let brrtf = {}
|
||||
// this.transBefore = {}
|
||||
brrtf.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
|
||||
brrtf.areaName = res.data.data.areaName
|
||||
if (this.$route.query.type === 'area') {
|
||||
console.log('走这里')
|
||||
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData[0]
|
||||
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
console.log(this.$store.state.selectData, '执行')
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/detail',
|
||||
params: {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
table_name: this.defaultDataRight.table_name, // 表名
|
||||
id: this.defaultDataRight.id, // 分类id
|
||||
area: this.downLaSelect.area, // 选中的地区
|
||||
quota: this.downLaSelect.label, // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
f: this.$store.state.selectfilter, // year=>年度分类,monthly=>月度分类,quarter=>季度分类
|
||||
data: this.$store.state.selectData // 时间
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '获取数据展示数据')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
if (res.data.data.areaName.length !== 0) {
|
||||
if (this.downLaSelect.area === '' || this.downLaSelect.label === '') {
|
||||
console.log(this.downLaSelect.area, 'this.downLaSelect.area')
|
||||
let brrtf = {}
|
||||
// this.transBefore = {}
|
||||
brrtf.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
|
||||
brrtf.areaName = res.data.data.areaName
|
||||
if (this.$route.query.type === 'area') {
|
||||
console.log('走这里')
|
||||
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData[0]
|
||||
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
} else {
|
||||
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData[0]
|
||||
}
|
||||
console.log(brrtf, 'brrtf')
|
||||
this.transBefore = brrtf
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
if (this.selectState === 1) {
|
||||
this.$store.state.labelArea = this.transBefore.termsName
|
||||
} else {
|
||||
this.$store.state.labelArea = this.transBefore.areaName
|
||||
}
|
||||
this.$store.state.AreaAllCountData = res.data.data
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
console.log(this.$store.state.noChangeData, 'this.$store.state.noChangeDatathis.$store.state.noChangeDatathis.$store.state.noChangeData')
|
||||
} else {
|
||||
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData[0]
|
||||
this.transBefore = {}
|
||||
this.transBefore.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
|
||||
this.transBefore.areaName = res.data.data.areaName
|
||||
this.transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
}
|
||||
console.log(brrtf, 'brrtf')
|
||||
this.transBefore = brrtf
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
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
|
||||
@@ -824,37 +1064,70 @@ export default {
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
}
|
||||
this.hangZhiState = true
|
||||
} else {
|
||||
this.transBefore = {}
|
||||
this.transBefore.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
|
||||
this.transBefore.areaName = res.data.data.areaName
|
||||
this.transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
this.transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
this.transBefore = null
|
||||
// this.$store.state.transdtr = null
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
this.$store.state.transBefore = null
|
||||
this.$store.state.noChangeData = null
|
||||
}
|
||||
} else {
|
||||
this.transBefore = null
|
||||
// this.$store.state.transdtr = null
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = null
|
||||
this.$store.state.noChangeData = null
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.$store.state.SelecttDimension.col = 'zb'
|
||||
this.$store.state.SelecttDimension.row = 'sj'
|
||||
}
|
||||
this.$emit('stateDataGet', false)
|
||||
}).catch((fail) => {
|
||||
console.log(fail, 2369)
|
||||
})
|
||||
} else {
|
||||
this.transBefore = this.$store.state.transBefore
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
}
|
||||
},
|
||||
// 高级查询数据渲染
|
||||
advancedSearchDataShow () {
|
||||
this.$axios({
|
||||
method: 'POST',
|
||||
url: 'data/data/query',
|
||||
data: {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1,
|
||||
data: this.$store.state.advanceData,
|
||||
area: this.downLaSelect.area,
|
||||
quota: this.downLaSelect.label,
|
||||
cate: this.selectState,
|
||||
f: this.$route.query.type,
|
||||
date: this.$store.state.selectData
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '高级查询数据展示')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
let transBefore = {}
|
||||
transBefore.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
|
||||
console.log(transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = transBefore
|
||||
this.transBefore = transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(transBefore))
|
||||
} else {
|
||||
this.$store.state.transBefore = null
|
||||
}
|
||||
// 告诉父组件我完成任务重置状态
|
||||
this.$emit('prentsState', false)
|
||||
}).catch((fail) => {
|
||||
console.log(fail, 2369)
|
||||
console.log(fail)
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -921,11 +1194,15 @@ export default {
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// this.getDatas()
|
||||
// 还原高级查询状态
|
||||
this.$store.state.advancedSearchState = false
|
||||
console.log(this.advancedStates, 'this.advancedStates111')
|
||||
this.startsyui = this.advancedStates
|
||||
},
|
||||
updated () {
|
||||
// 重新渲染表格
|
||||
this.$refs.table.doLayout()
|
||||
console.log(this.advancedStates, 'this.advancedStates')
|
||||
},
|
||||
mounted () {
|
||||
// console.log(new ComputedData())
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
>
|
||||
<img :src="item.url" alt />
|
||||
</div>
|
||||
<div class="chart_right">
|
||||
<div class="chart_right" v-if="!areaDimensionStateS">
|
||||
<!-- 指标地区cut -->
|
||||
<div class="chart_right_area" v-if="$route.query.type==='area'">
|
||||
指标:
|
||||
<!-- <div class="chart_right_area" v-if="$route.query.type!=='area'">
|
||||
{{stateChangeSDF?'指标:':'地区:'}}
|
||||
<cityPicker
|
||||
:level="jishuArea"
|
||||
:selectpattern="selectpatternArea"
|
||||
@@ -19,6 +19,16 @@
|
||||
:default-city="cityDefaultNameArea"
|
||||
@choice-caller="choiceCallerArea"
|
||||
></cityPicker>
|
||||
</div>-->
|
||||
<div class="chart_right_area" v-if="$route.query.type==='area'">
|
||||
{{stateChangeSDF?'指标:':'地区:'}}
|
||||
<el-cascader
|
||||
v-model="value"
|
||||
:options="options"
|
||||
@change="handleChange"
|
||||
style="width:12rem"
|
||||
size="small"
|
||||
></el-cascader>
|
||||
</div>
|
||||
<!-- 根据时间筛选 -->
|
||||
<div class="chart_right_time" v-if="cityDataTime">
|
||||
@@ -32,14 +42,46 @@
|
||||
@choice-caller="choiceCallerTime"
|
||||
@visible-change="changesInputStu"
|
||||
:isHideProp="isHideProp"
|
||||
@stateInfor="stateInfor"
|
||||
:stateRTY="stateRTY"
|
||||
></cityPicker>
|
||||
<div class="bottom" v-if="showInputStu" @click="showKuangCat">
|
||||
<input type="text" placeholder="请输入时间" v-model="timeUsrr" />
|
||||
<span>确认</span>
|
||||
<div class="bottom" v-if="showInputStu" @click.stop="showKuangCat">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入时间"
|
||||
v-model="timeUsrr"
|
||||
@focus="focusShow"
|
||||
@blur="focusShow"
|
||||
/>
|
||||
<span @click="trueShuru()">确认</span>
|
||||
<div class="explainTrue" v-if="kuangState">
|
||||
<br />
|
||||
<span style="color:#67bfdc">列:输入格式如下</span>
|
||||
<br />月:201901,201902
|
||||
<br />
|
||||
<br />季:2019A,2019B,
|
||||
<br />
|
||||
<br /> 2019C,2019D
|
||||
<br />
|
||||
<br />年:2019,2018
|
||||
<br />
|
||||
<br />其他:2018-2019
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart_right" v-if="areaDimensionStateS&&this.$store.state.transBefore">
|
||||
{{leftLabel[$store.state.noSelecttDimension]}}:
|
||||
<el-cascader
|
||||
v-model="valueDimension"
|
||||
:options="optionsDimension"
|
||||
@change="handleChangeDimension"
|
||||
style="width:12rem"
|
||||
size="small"
|
||||
></el-cascader>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -52,6 +94,24 @@ export default {
|
||||
defaultDataRight: {
|
||||
type: Object,
|
||||
required: false
|
||||
},
|
||||
stateDataGetVal: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
labelAreaState: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
// 地区数据维度转换状态
|
||||
areaDimensionStateS: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
// 指标地区状态
|
||||
labelAreaStateks: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -59,6 +119,8 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// 提示语logo
|
||||
explainLogo: require('../../../static/nav/xl.png'),
|
||||
// 控制下拉框显示隐藏
|
||||
isHideProp: true,
|
||||
// 栏目数据 结构不可变
|
||||
@@ -78,12 +140,12 @@ export default {
|
||||
// 栏目级数
|
||||
jishuArea: 1,
|
||||
// 默认显示栏目
|
||||
cityDefaultNameArea: '居民消费价格',
|
||||
cityDefaultNameArea: '居民价格',
|
||||
// 筛选数据
|
||||
selectpatternArea: [
|
||||
{
|
||||
field: 'userProvinceId',
|
||||
placeholder: '居民消费价格'
|
||||
placeholder: '居民消费价'
|
||||
}
|
||||
],
|
||||
// 栏目数据 结构不可变
|
||||
@@ -91,7 +153,7 @@ export default {
|
||||
// 栏目级数
|
||||
jishuTime: 1,
|
||||
// 默认显示栏目
|
||||
cityDefaultNameTime: '最近13个月',
|
||||
cityDefaultNameTime: '最近1个月',
|
||||
// 筛选数据
|
||||
selectpatternTime: [
|
||||
{
|
||||
@@ -124,14 +186,39 @@ export default {
|
||||
// 按时间查询
|
||||
timeUsrr: '',
|
||||
// 时间筛选输入框是否显示
|
||||
showInputStu: false
|
||||
showInputStu: false,
|
||||
// 控制下拉框的显示隐藏
|
||||
stateRTY: true,
|
||||
// 指标地区转换状态 true为指标 false为地区
|
||||
stateChangeSDF: true,
|
||||
// 提示框状态
|
||||
kuangState: false,
|
||||
value: [],
|
||||
options: [
|
||||
{
|
||||
value: 'zhinan',
|
||||
label: '指南'
|
||||
}
|
||||
],
|
||||
leftLabel: {
|
||||
'sj': '时间',
|
||||
'zb': '指标',
|
||||
'dq': '地区'
|
||||
},
|
||||
valueDimension: [],
|
||||
optionsDimension: [
|
||||
{
|
||||
value: '',
|
||||
label: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听左侧菜单的数据变化
|
||||
defaultDataRight: {
|
||||
handler (val) {
|
||||
console.log(val, '左侧数据变化chartsCut')
|
||||
// console.log(val, '左侧数据变化chartsCut')
|
||||
if (val) {
|
||||
// 初始化公共数据
|
||||
if (this.$route.query.type !== 'area') {
|
||||
@@ -143,9 +230,72 @@ export default {
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
},
|
||||
// 监听数据渲染变化
|
||||
stateDataGetVal (newVal, oldVal) {
|
||||
console.log(this.$store.state.transBefore, '啦啦啦')
|
||||
if (!newVal) {
|
||||
// this.showLabelArea()
|
||||
}
|
||||
},
|
||||
labelAreaState (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.showLabelArea()
|
||||
}
|
||||
},
|
||||
labelAreaStateks (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.stateChangeSDF = !this.stateChangeSDF
|
||||
this.showLabelArea()
|
||||
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
this.$store.state.SelecttDimension.col = 'zb'
|
||||
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
this.$store.state.SelecttDimension.col = 'dq'
|
||||
}
|
||||
console.log(this.$store.state.transBefore, 'bbbbbbbbbbbbbbbbbbb')
|
||||
this.$nextTick(() => {
|
||||
this.$parent.tellChangeFan(false)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 监听地区维度转换数据变换
|
||||
areaDimensionStateS (newVal) {
|
||||
if (newVal) {
|
||||
if (this.$store.state.noSelecttDimension === 'sj') {
|
||||
this.optionsDimension = this.$store.state.transBefore.timeArr.map((item, index) => {
|
||||
return {
|
||||
value: item,
|
||||
label: item
|
||||
}
|
||||
})
|
||||
this.valueDimension = [this.optionsDimension[0].value]
|
||||
} else if (this.$store.state.noSelecttDimension === 'dq') {
|
||||
this.optionsDimension = this.$store.state.transBefore.areaName.map((item, index) => {
|
||||
return {
|
||||
value: item,
|
||||
label: item
|
||||
}
|
||||
})
|
||||
this.valueDimension = [this.optionsDimension[0].value]
|
||||
} else if (this.$store.state.noSelecttDimension === 'zb') {
|
||||
this.optionsDimension = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
value: item,
|
||||
label: item
|
||||
}
|
||||
})
|
||||
this.valueDimension = [this.optionsDimension[0].value]
|
||||
}
|
||||
// 告诉父组件数据渲染完
|
||||
this.$emit('emmitStateAd', false)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 地区维度转换筛选
|
||||
handleChangeDimension () {
|
||||
console.log(this.valueDimension, 'this.valueDimension')
|
||||
},
|
||||
// 点击切换图表
|
||||
cutChartsTap (ind) {
|
||||
// console.log(ind)
|
||||
@@ -153,8 +303,8 @@ export default {
|
||||
},
|
||||
// 被选中时触发
|
||||
choiceCallerArea (resu) {
|
||||
console.log(resu, '5+656565')
|
||||
console.log(this.cityDefaultName)
|
||||
console.log(resu[2], '5+656565')
|
||||
// this.$emit('statertfResu', resu[2])
|
||||
},
|
||||
// 被选中时触发
|
||||
choiceCallerTime (resu) {
|
||||
@@ -165,9 +315,11 @@ export default {
|
||||
console.log(this.$store.state.selectData, '被选中的值')
|
||||
|
||||
this.$store.state.selectData = resu[2].indexID
|
||||
this.showInputStu = false
|
||||
this.$emit('comTime', resu[2])
|
||||
}
|
||||
// 将值传给父组件
|
||||
this.$emit('comTime', resu[2].name)
|
||||
|
||||
// this.showInputStu = !this.showInputStu
|
||||
},
|
||||
changesInputStu () {
|
||||
@@ -178,6 +330,7 @@ export default {
|
||||
showKuangCat () {
|
||||
console.log(1250)
|
||||
this.isHideProp = false
|
||||
this.stateRTY = false
|
||||
},
|
||||
// 查询下拉筛选条件
|
||||
searchSelect (type) {
|
||||
@@ -197,16 +350,110 @@ export default {
|
||||
return { 'id': '110000', 'name': Object.values(res.data.data.list)[index], 'parentId': '100000', 'shortName': '北京', 'cityCode': '', indexID: item }
|
||||
})
|
||||
// 默认选中第一个
|
||||
this.cityDefaultNameTime = this.cityDataTime[0].name
|
||||
this.$store.state.selectData = this.cityDataTime[0].indexID
|
||||
console.log(this.$store.state.selectData, 'this.cityDataTime[0].indexID')
|
||||
// console.log(this.$store.state.selectData, 'this.cityDataTime[0].indexID')
|
||||
// 告诉父组件我获取到了
|
||||
this.$emit('stateTell', true)
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
}
|
||||
},
|
||||
stateInfor (val) {
|
||||
if (val) {
|
||||
this.stateRTY = val
|
||||
} else {
|
||||
this.showInputStu = val
|
||||
}
|
||||
},
|
||||
// 指标地区数据渲染
|
||||
showLabelArea () {
|
||||
console.log(this.stateChangeSDF, '走走走')
|
||||
if (this.stateChangeSDF) { // 指标
|
||||
console.log(this.$store.state.transBefore, 'thisthisthisthisthis')
|
||||
this.cityDataArea = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return { 'id': '110000', 'name': item, 'parentId': '100000', 'shortName': '北京', 'cityCode': '', type: 1 }
|
||||
})
|
||||
this.cityDataArea.unshift({ 'id': '110000', 'name': '-序列-', 'parentId': '100000', 'shortName': '北京', 'cityCode': '', type: 1 })
|
||||
this.cityDefaultNameArea = this.cityDataArea[1].name
|
||||
this.selectpatternArea.placeholder = this.cityDataArea[1].name
|
||||
|
||||
this.options = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
value: item,
|
||||
label: item
|
||||
}
|
||||
})
|
||||
this.options.unshift({
|
||||
value: '序列',
|
||||
label: '序列'
|
||||
})
|
||||
this.value = [this.options[1].value]
|
||||
console.log(this.value, 'this.options')
|
||||
// 告诉父组件已经完成任务
|
||||
this.$emit('stateDFGHJ', true)
|
||||
this.$emit('statertfResu', this.value[0])
|
||||
} else { // 地区
|
||||
this.options = this.$store.state.transBefore.areaName.map((item, index) => {
|
||||
return {
|
||||
value: item,
|
||||
label: item
|
||||
}
|
||||
})
|
||||
this.options.unshift({
|
||||
value: '序列',
|
||||
label: '序列'
|
||||
})
|
||||
this.value = [this.options[1].value]
|
||||
console.log(this.value, 'this.options')
|
||||
// 告诉父组件已经完成任务
|
||||
this.$emit('stateDFGHJ', true)
|
||||
this.$emit('statertfResu', this.value[0])
|
||||
}
|
||||
},
|
||||
// 聚焦显示提示的搜索框
|
||||
focusShow () {
|
||||
this.kuangState = !this.kuangState
|
||||
},
|
||||
// 确定输入
|
||||
trueShuru () {
|
||||
if (this.timeUsrr !== '') {
|
||||
switch (this.$route.query.type) {
|
||||
case 'monthly':
|
||||
if (this.timeUsrr[this.timeUsrr.length - 2] < 2 && this.timeUsrr.length < 7 && /^[0-9]+$/.test(this.timeUsrr)) {
|
||||
if (this.timeUsrr[this.timeUsrr.length - 2] === 1 && this.timeUsrr[this.timeUsrr.length - 1] > 2) {
|
||||
alert('您查询的时间格式有误,请重新输入!')
|
||||
} else {
|
||||
this.$store.state.selectData = this.timeUsrr
|
||||
}
|
||||
} else {
|
||||
alert('您查询的时间格式有误,请重新输入!111')
|
||||
}
|
||||
break
|
||||
case 'quarter':
|
||||
let arr = ['A', 'B', 'C', 'D']
|
||||
if (arr.indexOf(this.timeUsrr[this.timeUsrr.length - 1]) !== -1 && this.timeUsrr.length < 6 && /^[0-9]+$/.test(this.timeUsrr.substring(0, 4))) {
|
||||
this.$store.state.selectData = this.timeUsrr
|
||||
} else {
|
||||
alert('您查询的时间格式有误,请重新输入!111')
|
||||
}
|
||||
break
|
||||
case 'year':
|
||||
break
|
||||
case 'area':
|
||||
break
|
||||
}
|
||||
} else {
|
||||
alert('您查询的时间格式有误,请重新输入!')
|
||||
}
|
||||
},
|
||||
// 选中
|
||||
handleChange (value) {
|
||||
console.log(value)
|
||||
console.log(this.value, 'this.value')
|
||||
this.$emit('statertfResu', value[0])
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.cityDataArea = this.cityDataAreas
|
||||
@@ -288,6 +535,21 @@ export default {
|
||||
letter-spacing: 0.25rem;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
& > span:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
& > .explainTrue {
|
||||
position: absolute;
|
||||
top: 1.8rem;
|
||||
width: 18.75rem;
|
||||
height: 22.5rem;
|
||||
background-image: url("../../../static/nav/xl.png");
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,11 @@ export default {
|
||||
isHideProp: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
stateRTY: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
// required: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -300,7 +305,12 @@ export default {
|
||||
/* eslint-disable */
|
||||
// console.log(that.isHideProp, '12569')
|
||||
if (e.target.className !== 'city-picker') {
|
||||
that.modifyNature(that.inlay, 'isHide', true)
|
||||
if (that.stateRTY) {
|
||||
that.modifyNature(that.inlay, 'isHide', true)
|
||||
that.$emit('stateInfor', false)
|
||||
}else{
|
||||
that.$emit('stateInfor', true)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<div class="container">
|
||||
<div class="top">
|
||||
<span>维度转换</span>
|
||||
<!--地区-->
|
||||
<img :src="imgUrl" alt @click="$store.state.dimensionState = false" />
|
||||
</div>
|
||||
<div class="main">
|
||||
@@ -66,6 +67,11 @@ export default {
|
||||
'指标': 'zb',
|
||||
'时间': 'sj',
|
||||
'地区': 'dq'
|
||||
},
|
||||
arrValueZd: {
|
||||
'zb': '指标',
|
||||
'sj': '时间',
|
||||
'dq': '地区'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -79,27 +85,16 @@ export default {
|
||||
},
|
||||
// 维度转换默认
|
||||
change3D () {
|
||||
if (this.$store.state.transState) {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.rowVal = '指标'
|
||||
this.colVal = '时间'
|
||||
} else {
|
||||
this.rowVal = '地区'
|
||||
this.colVal = '时间'
|
||||
}
|
||||
} else {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.rowVal = '时间'
|
||||
this.colVal = '指标'
|
||||
} else {
|
||||
this.rowVal = '时间'
|
||||
this.colVal = '地区'
|
||||
}
|
||||
}
|
||||
this.rowVal = this.arrValueZd[this.$store.state.SelecttDimension.col]
|
||||
this.colVal = this.arrValueZd[this.$store.state.SelecttDimension.row]
|
||||
},
|
||||
// 确定维度转换
|
||||
trueChange () {
|
||||
this.trueChangeArea()
|
||||
if (this.rowVal === this.colVal) {
|
||||
alert('维度转换格式错误!行列相同')
|
||||
} else {
|
||||
this.trueChangeArea()
|
||||
}
|
||||
},
|
||||
trueChangeArea () {
|
||||
console.log(this.arrValue[this.colVal], 'this.$store.state.noChangeDatathis.$store.state.noChangeDatathis.$store.state.noChangeData')
|
||||
@@ -107,9 +102,10 @@ export default {
|
||||
console.log(this.$store.state.noChangeData)
|
||||
let paramsd = {}
|
||||
if ((this.arrValue[this.colVal] === 'sj' && this.arrValue[this.rowVal] === 'zb') || (this.arrValue[this.colVal] === 'zb' && this.arrValue[this.rowVal] === 'sj')) {
|
||||
this.$store.state.noSelecttDimension = 'dq'
|
||||
paramsd = {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
data: 3,
|
||||
data: this.$store.state.selectDataLeft.id,
|
||||
area: this.$store.state.noChangeData.areaName[0], // 选中的地区
|
||||
quota: '', // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
@@ -120,9 +116,10 @@ export default {
|
||||
col: this.arrValue[this.rowVal]
|
||||
}
|
||||
} else if ((this.arrValue[this.colVal] === 'sj' && this.arrValue[this.rowVal] === 'dq') || (this.arrValue[this.colVal] === 'dq' && this.arrValue[this.rowVal] === 'sj')) {
|
||||
this.$store.state.noSelecttDimension = 'zb'
|
||||
paramsd = {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
data: 3,
|
||||
data: this.$store.state.selectDataLeft.id,
|
||||
area: '', // 选中的地区
|
||||
quota: this.$store.state.noChangeData.termsName[0], // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
@@ -133,9 +130,10 @@ export default {
|
||||
col: this.arrValue[this.rowVal]
|
||||
}
|
||||
} else if ((this.arrValue[this.colVal] === 'zb' && this.arrValue[this.rowVal] === 'dq') || (this.arrValue[this.colVal] === 'dq' && this.arrValue[this.rowVal] === 'zb')) {
|
||||
this.$store.state.noSelecttDimension = 'sj'
|
||||
paramsd = {
|
||||
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
|
||||
data: 3,
|
||||
data: this.$store.state.selectDataLeft.id,
|
||||
area: '', // 选中的地区
|
||||
quota: '', // 选中的指标
|
||||
cate: this.selectState, // 1筛选指标 2筛选地区
|
||||
@@ -146,6 +144,8 @@ export default {
|
||||
col: this.arrValue[this.rowVal]
|
||||
}
|
||||
}
|
||||
this.$store.state.SelecttDimension.row = this.arrValue[this.colVal]
|
||||
this.$store.state.SelecttDimension.col = this.arrValue[this.rowVal]
|
||||
this.$axios({
|
||||
method: 'POST',
|
||||
url: 'data/data/wd-trans',
|
||||
@@ -163,15 +163,22 @@ export default {
|
||||
transBefore.termsExplain = res.data.data.termsExplain
|
||||
transBefore.areaName = res.data.data.areaName
|
||||
transBefore.transBeforeTermsData = res.data.data.transBeforeTermsData
|
||||
transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData
|
||||
console.log(this.transBefore, '000')
|
||||
transBefore.transBeforeAreaData = res.data.data.transBeforeAreaData[0]
|
||||
console.log(transBefore, '000')
|
||||
this.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
this.$store.state.AreaAllCountData = JSON.parse(JSON.stringify(res.data.data))
|
||||
this.$store.state.transBefore = transBefore
|
||||
// 告诉父组件维度转换发生改变
|
||||
this.$emit('areaDimensionState', true)
|
||||
// }
|
||||
} else {
|
||||
this.$store.state.transBefore = null
|
||||
// 告诉父组件维度转换发生改变
|
||||
this.$emit('areaDimensionState', true)
|
||||
}
|
||||
// 关闭窗口
|
||||
this.$store.state.dimensionState = false
|
||||
}).catch((fail) => {
|
||||
console.log(fail, 2369)
|
||||
})
|
||||
|
||||
@@ -145,10 +145,11 @@ export default {
|
||||
watch: {
|
||||
echartsDatarts: {
|
||||
handler (newVal, oldVal) {
|
||||
console.log(newVal, '11111')
|
||||
if (newVal !== undefined) {
|
||||
this.option = JSON.parse(JSON.stringify(newVal))
|
||||
this.drawEcharts()
|
||||
this.$nextTick(() => {
|
||||
this.drawEcharts()
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
|
||||
@@ -73,7 +73,157 @@ export default {
|
||||
if (newVal === 'hang') {
|
||||
// 行列新增渲染
|
||||
if (this.$route.query.type === 'area') {
|
||||
this.datalist = this.$store.state.noChangeData.areaName
|
||||
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
@@ -173,13 +323,26 @@ export default {
|
||||
})
|
||||
this.$store.state.selectLabelHang = lebalIndex
|
||||
console.log(lebalIndex, '下标')
|
||||
|
||||
this.$store.state.transBefore.termsExplain = this.$store.state.noChangeData.termsExplain.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
this.$store.state.transBefore.termsName = this.$store.state.noChangeData.termsName.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
switch (this.$store.state.SelecttDimension.col) {
|
||||
case 'dq':
|
||||
this.$store.state.transBefore.areaName = this.$store.state.noChangeData.areaName.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
break
|
||||
case 'zb':
|
||||
this.$store.state.transBefore.termsExplain = this.$store.state.noChangeData.termsExplain.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
this.$store.state.transBefore.termsName = this.$store.state.noChangeData.termsName.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
break
|
||||
case 'sj':
|
||||
this.$store.state.transBefore.timeArr = this.$store.state.noChangeData.timeArr.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
break
|
||||
}
|
||||
this.$store.state.transBefore.transBeforeAreaData = this.$store.state.noChangeData.transBeforeAreaData.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
@@ -206,20 +369,24 @@ export default {
|
||||
// })
|
||||
// 数据转置
|
||||
let gdt = JSON.parse(JSON.stringify(this.$store.state.noChangeData.transBeforeTermsData))
|
||||
|
||||
let waiBrr = gdt[0].map(function (col, index) {
|
||||
return gdt.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
console.log(waiBrr, 'gdt125000')
|
||||
waiBrr = waiBrr.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
console.log(waiBrr, 'waiBrr过滤后')
|
||||
// 转置回来
|
||||
waiBrr = waiBrr.map(function (col, index) {
|
||||
waiBrr = waiBrr[0].map(function (col, index) {
|
||||
return waiBrr.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
console.log(waiBrr, '转置回来')
|
||||
// 赋值
|
||||
this.$store.state.transBefore.transBeforeTermsData = waiBrr
|
||||
this.$store.state.transBefore.timeArr = this.$store.state.noChangeData.timeArr.filter((item, index) => {
|
||||
@@ -262,9 +429,26 @@ export default {
|
||||
})
|
||||
// 赋值
|
||||
this.$store.state.transBefore.transBeforeAreaData = waiBrr
|
||||
this.$store.state.transBefore.timeArr = this.$store.state.noChangeData.timeArr.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
switch (this.$store.state.SelecttDimension.row) {
|
||||
case 'dq':
|
||||
this.$store.state.transBefore.areaName = this.$store.state.noChangeData.areaName.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
break
|
||||
case 'zb':
|
||||
this.$store.state.transBefore.termsExplain = this.$store.state.noChangeData.termsExplain.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
this.$store.state.transBefore.termsName = this.$store.state.noChangeData.termsName.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
break
|
||||
case 'sj':
|
||||
this.$store.state.transBefore.timeArr = this.$store.state.noChangeData.timeArr.filter((item, index) => {
|
||||
return lebalIndex.indexOf(index) !== -1
|
||||
})
|
||||
break
|
||||
}
|
||||
this.$store.state.editWindowState = false
|
||||
this.$emit('emitState', true)
|
||||
console.log(this.$store.state.transBefore, 'this.$store.state.transBefore')
|
||||
@@ -277,7 +461,157 @@ export default {
|
||||
this.radioSelect = 'hang'
|
||||
console.log(this.$store.state.selectLabelHang)
|
||||
if (this.$route.query.type === 'area') {
|
||||
this.datalist = this.$store.state.noChangeData.areaName
|
||||
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: true,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
let state = true
|
||||
if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
|
||||
state = false
|
||||
} else {
|
||||
state = true
|
||||
}
|
||||
console.log(state, 'state')
|
||||
return {
|
||||
text: item,
|
||||
state: state,
|
||||
id: index
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this.$store.state.selectLabelHang) {
|
||||
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
|
||||
|
||||
@@ -102,10 +102,36 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
radioValue (newValue, oldValue) {
|
||||
console.log(newValue)
|
||||
if (newValue === 'hang') {
|
||||
// 行列新增渲染
|
||||
if (this.$route.query.type === 'area') {
|
||||
this.labelData = this.$store.state.transBefore.areaName
|
||||
switch (this.$store.state.SelecttDimension.col) {
|
||||
case 'dq':
|
||||
this.labelData = this.$store.state.transBefore.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'sj':
|
||||
this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'zb':
|
||||
this.labelData = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
break
|
||||
}
|
||||
} else {
|
||||
this.labelData = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
@@ -116,12 +142,42 @@ export default {
|
||||
}
|
||||
} else if (newValue === 'lie') {
|
||||
// 行列新增渲染
|
||||
this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
if (this.$route.query.type === 'area') {
|
||||
console.log(this.$store.state.SelecttDimension.row, this.$store.state.SelecttDimension.col)
|
||||
switch (this.$store.state.SelecttDimension.row) {
|
||||
case 'dq':
|
||||
this.labelData = this.$store.state.transBefore.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'sj':
|
||||
this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
break
|
||||
case 'zb':
|
||||
this.labelData = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
break
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -219,27 +275,72 @@ export default {
|
||||
this.closeX()
|
||||
this.$emit('emitState', true)
|
||||
} else {
|
||||
// 循环地区名称 回调一个计算后的数组
|
||||
|
||||
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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
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) => {
|
||||
if (this.$store.state.transBefore.areaName.indexOf(list) !== -1) {
|
||||
comStr += this.$store.state.transBefore.transBeforeAreaData[index][this.$store.state.transBefore.areaName.indexOf(list)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
// 将处理完的数据放到全局变量中
|
||||
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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
// 将处理完的数据放到全局变量中
|
||||
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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
// 将处理完的数据放到全局变量中
|
||||
this.$store.state.transBefore.termsName.push(this.insertName)
|
||||
this.$store.state.transBefore.termsExplain.push('')
|
||||
break
|
||||
}
|
||||
// 将处理完的数据放到全局变量中
|
||||
this.$store.state.transBefore.termsName.push(this.insertName)
|
||||
this.$store.state.transBefore.termsExplain.push('')
|
||||
this.$store.state.transBefore.transBeforeTermsData.push(dataStrArr)
|
||||
this.$store.state.transBefore.transBeforeAreaData.push(dataStrArr)
|
||||
this.closeX()
|
||||
this.$emit('emitState', true)
|
||||
}
|
||||
@@ -285,8 +386,8 @@ export default {
|
||||
this.closeX()
|
||||
this.$emit('emitState', true)
|
||||
} else {
|
||||
// console.log(this.$store.state.transBefore.transBeforeTermsData)
|
||||
let bsfyu = this.$store.state.transBefore.transBeforeTermsData
|
||||
// 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) => {
|
||||
@@ -294,33 +395,98 @@ export default {
|
||||
})
|
||||
})
|
||||
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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
console.log(dataStrArr, '101025')
|
||||
datarts.push(dataStrArr)
|
||||
// 将数据转置回来
|
||||
let newZz = datarts[0].map(function (col, index) {
|
||||
return datarts.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
console.log(dataStrArr, '101025')
|
||||
datarts.push(dataStrArr)
|
||||
// 将数据转置回来
|
||||
newZz = datarts[0].map(function (col, index) {
|
||||
return datarts.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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
console.log(dataStrArr, '101025')
|
||||
datarts.push(dataStrArr)
|
||||
// 将数据转置回来
|
||||
newZz = datarts[0].map(function (col, index) {
|
||||
return datarts.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)]
|
||||
} else {
|
||||
comStr += list
|
||||
}
|
||||
})
|
||||
// console.log(comStr)
|
||||
// console.log(eval(comStr))
|
||||
return eval(comStr).toString()
|
||||
})
|
||||
console.log(dataStrArr, '101025')
|
||||
datarts.push(dataStrArr)
|
||||
// 将数据转置回来
|
||||
newZz = datarts[0].map(function (col, index) {
|
||||
return datarts.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
// 将处理完的数据放到全局变量中
|
||||
this.$store.state.transBefore.termsName.push(this.insertName)
|
||||
this.$store.state.transBefore.termsExplain.push('')
|
||||
break
|
||||
}
|
||||
// 将处理完的数据放到全局变量中
|
||||
this.$store.state.transBefore.timeArr.push(this.insertName)
|
||||
this.$store.state.transBefore.transBeforeTermsData = newZz
|
||||
// this.$store.state.transBefore.timeArr.push(this.insertName)
|
||||
this.$store.state.transBefore.transBeforeAreaData = newZz
|
||||
this.closeX()
|
||||
this.$emit('emitState', true)
|
||||
}
|
||||
@@ -335,7 +501,49 @@ export default {
|
||||
mounted() {
|
||||
// 行列新增渲染
|
||||
if (this.$route.query.type === 'area') {
|
||||
this.labelData = this.$store.state.transBefore.areaName
|
||||
if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
this.labelData = this.$store.state.transBefore.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
|
||||
this.labelData = this.$store.state.transBefore.timeArr.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
} else 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 (this.$store.state.SelecttDimension.row === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
|
||||
this.labelData = this.$store.state.transBefore.areaName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
|
||||
this.labelData = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
state: false
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.labelData = this.$store.state.transBefore.termsName.map((item, index) => {
|
||||
return {
|
||||
|
||||
@@ -1,47 +1,31 @@
|
||||
<template>
|
||||
<div class="mapData">
|
||||
<div class="mapDataLeft" v-if="leftDafrt">
|
||||
<div>指标名称</div>
|
||||
<div v-if="leftDafrt.length!==0">指标名称</div>
|
||||
<!-- 指标名称 -->
|
||||
<div
|
||||
v-for="(item,index) in leftDafrt"
|
||||
:key="index"
|
||||
:class="{bgcolor:item.state}"
|
||||
@click="trickChange(index)"
|
||||
>{{item.name}}</div>
|
||||
<div style="margin:0 auto;color:#8fa3ae;font-size:1.375rem;" v-if="leftDafrt.length===0">暂无指标名</div>
|
||||
</div>
|
||||
<div class="mapDataRight">
|
||||
<div class="maptopSty">
|
||||
<!-- 年 -->
|
||||
<div class="yearD">
|
||||
<cityPicker
|
||||
:level="jishuTime"
|
||||
:selectpattern="selectpatternTime"
|
||||
:city-data="cityDataTime"
|
||||
:default-city="cityDefaultNameTime"
|
||||
@choice-caller="choiceCallerTime"
|
||||
@visible-change="changesInputStu"
|
||||
></cityPicker>
|
||||
<el-cascader v-model="value" :options="options" @change="handleChange"></el-cascader>
|
||||
</div>
|
||||
<!-- 月 -->
|
||||
<!-- 季 -->
|
||||
<div class="monthD">
|
||||
<cityPicker
|
||||
:level="jishuTime"
|
||||
:selectpattern="selectMonth"
|
||||
:city-data="monthDatas"
|
||||
:default-city="monthData"
|
||||
@choice-caller="monthDataState"
|
||||
@visible-change="monthDataChange"
|
||||
></cityPicker>
|
||||
</div>
|
||||
<!-- <div style="margin:0 auto;color:#8fa3ae;font-size:1.375rem;">该指标下暂无数据</div> -->
|
||||
</div>
|
||||
<div ref="mapRefs"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// 引入下拉组件
|
||||
import cityPicker from '@/components/cityPicker/CityPicker.vue'
|
||||
// 引入数据计算js用于机选渲染的数据
|
||||
// import ComputedData from '../../assets/js/computeddata'
|
||||
import china from 'echarts/map/json/china.json'
|
||||
@@ -51,9 +35,6 @@ echarts.registerMap('china', china)
|
||||
require('echarts/theme/shine')
|
||||
export default {
|
||||
name: 'mapData',
|
||||
components: {
|
||||
cityPicker: cityPicker
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// 控制下拉框显示隐藏
|
||||
@@ -157,12 +138,12 @@ export default {
|
||||
// 栏目级数
|
||||
jishuTime: 1,
|
||||
// 默认显示栏目
|
||||
cityDefaultNameTime: '2019年',
|
||||
cityDefaultNameTime: '',
|
||||
// 筛选数据
|
||||
selectpatternTime: [
|
||||
{
|
||||
field: 'userProvinceId',
|
||||
placeholder: '2019年'
|
||||
placeholder: '2019'
|
||||
}
|
||||
],
|
||||
// 栏目数据 结构不可变
|
||||
@@ -189,7 +170,16 @@ export default {
|
||||
{ 'id': '110000', 'name': '4月', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' }
|
||||
],
|
||||
// 左侧数据
|
||||
leftDafrt: null
|
||||
leftDafrt: null,
|
||||
// 总的地图数据
|
||||
AllMapCount: null,
|
||||
value: [],
|
||||
options: [
|
||||
{
|
||||
value: 'zhinan',
|
||||
label: '指南'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -199,7 +189,8 @@ export default {
|
||||
method: 'GET',
|
||||
url: 'data/data/list',
|
||||
params: {
|
||||
type: this.$route.query.type
|
||||
type: this.$route.query.type === 'area' ? 2 : 1,
|
||||
f: this.$store.state.selectDataLeft.f
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '左侧菜单')
|
||||
@@ -279,8 +270,9 @@ export default {
|
||||
},
|
||||
// 被选中时触发
|
||||
choiceCallerTime (resu) {
|
||||
console.log(resu)
|
||||
console.log(this.cityDefaultName)
|
||||
console.log(resu, 1011111)
|
||||
// this.option.series[0].data = this.AllMapCount[resu[0]]
|
||||
// this.showMapData()
|
||||
},
|
||||
changesInputStu () {
|
||||
console.log(12569)
|
||||
@@ -294,7 +286,7 @@ export default {
|
||||
},
|
||||
// 地图左侧指标名称显示
|
||||
searchDataMap () {
|
||||
console.log(this.$store.state.selectDataLeft.id)
|
||||
console.log(this.$store.state.selectDataLeft, '10111110')
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/quota',
|
||||
@@ -343,15 +335,48 @@ export default {
|
||||
console.log(res, '数据地图数据')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
console.log()
|
||||
console.log(res.data.data.list, 'Object.values(res.data.data.list)')
|
||||
this.option.legend.data = [this.leftDafrt.find((item, index) => { return item.state === true }).name]
|
||||
this.option.series[0].name = [this.leftDafrt.find((item, index) => { return item.state === true }).name]
|
||||
this.option.series[0].data = res.data.data.list
|
||||
this.AllMapCount = res.data.data.list
|
||||
this.cityDataTime = this.monthDatas
|
||||
// 筛选的数据
|
||||
this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => {
|
||||
return { 'id': '110000', 'name': item, 'parentId': '100000', 'shortName': '北京', 'cityCode': '' }
|
||||
})
|
||||
this.cityDefaultNameTime = this.cityDataTime[0].name
|
||||
this.selectpatternTime[0].placeholder = this.cityDataTime[0].name
|
||||
console.log(this.cityDataTime)
|
||||
this.options = Object.keys(res.data.data.list).map((item, index) => {
|
||||
return {
|
||||
value: item,
|
||||
label: item
|
||||
}
|
||||
})
|
||||
this.value = [this.options[0].value]
|
||||
this.option.series[0].data = this.AllMapCount[this.options[0].value]
|
||||
this.showMapData()
|
||||
// this.option.series[0].data = Object.values(res.data.data.list)
|
||||
// this.showMapData()
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
},
|
||||
// 点击改变指标名称
|
||||
trickChange (ind) {
|
||||
this.leftDafrt.forEach((item, index) => {
|
||||
index === ind ? item.state = true : item.state = false
|
||||
})
|
||||
this.getLabelDatart()
|
||||
// this.showMapData()
|
||||
},
|
||||
// 选中
|
||||
handleChange (value) {
|
||||
console.log(value)
|
||||
console.log(this.value, 'this.value')
|
||||
this.option.series[0].data = this.AllMapCount[value[0]]
|
||||
this.showMapData()
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -363,6 +388,7 @@ export default {
|
||||
// this.showMapData()
|
||||
// 查询左侧数据
|
||||
// this.searchDataMap()
|
||||
this.cityDataTime = this.monthDatas
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -396,6 +422,9 @@ export default {
|
||||
align-items: center;
|
||||
font-size: 1.375rem;
|
||||
}
|
||||
& > div:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
& > div:nth-child(1) {
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
|
||||
@@ -111,6 +111,11 @@ export default {
|
||||
imgIdentify: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$auth (newVal, oldVal) {
|
||||
console.log(newVal, '$auth$auth$auth$auth')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
navClick (indexs, url) {
|
||||
if (indexs !== 1) {
|
||||
@@ -148,6 +153,7 @@ export default {
|
||||
},
|
||||
loginWindow () {
|
||||
this.showWinStatic = true
|
||||
this.$auth.auth = true
|
||||
this.get_identity()
|
||||
},
|
||||
// 关闭登录窗口
|
||||
@@ -177,11 +183,13 @@ export default {
|
||||
alert(res.data.message)
|
||||
if (res.data.code === 200) {
|
||||
this.showWinStatic = !this.showWinStatic
|
||||
this.$auth.auth = this.showWinStatic
|
||||
// 用户信息存本地
|
||||
localStorage.setItem('username', res.data.data.username)
|
||||
localStorage.setItem('pic', res.data.data.pic)
|
||||
localStorage.setItem('userPwd', this.userpwd)
|
||||
localStorage.setItem('token', 'Bearer ' + res.data.data.token)
|
||||
localStorage.setItem('tokenB', res.data.data.token)
|
||||
// 登录状态
|
||||
localStorage.setItem('userLogin', true)
|
||||
console.log(this.$route, '000111')
|
||||
@@ -196,7 +204,9 @@ export default {
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log(!this.showWinStatic, 'this.showWinStatic')
|
||||
this.showWinStatic = !this.showWinStatic
|
||||
this.$auth.auth = this.showWinStatic
|
||||
}
|
||||
},
|
||||
// 获取验证码图片及内容
|
||||
@@ -212,6 +222,7 @@ export default {
|
||||
},
|
||||
regirest () {
|
||||
this.showWinStatic = !this.showWinStatic
|
||||
this.$auth.auth = this.showWinStatic
|
||||
this.$router.push({ path: '/register' })
|
||||
},
|
||||
// 跳到数据页面
|
||||
@@ -248,13 +259,19 @@ export default {
|
||||
method: 'GET',
|
||||
url: 'member/index/logout',
|
||||
params: {
|
||||
'access-token': localStorage.getItem('token')
|
||||
'access-token': localStorage.getItem('tokenB')
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
alert(res.data.message)
|
||||
// 请求接口完成注册 请求成功
|
||||
if (res.data.code === 200) {
|
||||
console.log(this.$route.path, 'this.$router.path')
|
||||
if (this.$route.path !== '/') {
|
||||
this.$router.push({
|
||||
path: '/'
|
||||
})
|
||||
}
|
||||
localStorage.clear()
|
||||
this.$router.go(0)
|
||||
}
|
||||
@@ -270,10 +287,22 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
mounted () {
|
||||
let that = this
|
||||
this.userLogin = localStorage.getItem('userLogin')
|
||||
this.userName = localStorage.getItem('username')
|
||||
this.userPic = localStorage.getItem('pic')
|
||||
// 监听对象的变化
|
||||
/* eslint-disable */
|
||||
Object.defineProperty(this.$auth, 'auth', {
|
||||
set: function (newVal) {
|
||||
console.log(newVal, 'newValnewValnewVal')
|
||||
that.showWinStatic = newVal
|
||||
that.get_identity()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
306
src/components/noAreaDimension/NoAreaDimension.vue
Normal file
306
src/components/noAreaDimension/NoAreaDimension.vue
Normal file
@@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<div class="dimension">
|
||||
<div class="container">
|
||||
<div class="top">
|
||||
<span>维度转换</span>
|
||||
<!--地区-->
|
||||
<img :src="imgUrl" alt @click="$store.state.noAreadimensionState = false" />
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="row">
|
||||
<div></div>
|
||||
<div class="row_main">
|
||||
<div :class="{active:rowVal==='指标'}" @click="changeTabel('指标','row')">指标</div>
|
||||
<div :class="{active:rowVal==='时间'}" @click="changeTabel('时间','row')">时间</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row_main">
|
||||
<div :class="{active:colVal==='指标'}" @click="changeTabel('指标','col')">指标</div>
|
||||
<div :class="{active:colVal==='时间'}" @click="changeTabel('时间','col')">时间</div>
|
||||
</div>
|
||||
<div class="tabel">
|
||||
<div>
|
||||
<div>{{rowVal}}</div>
|
||||
<div>{{colVal}}</div>
|
||||
<div>{{colVal}}</div>
|
||||
<div>{{colVal}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>{{rowVal}}</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div>
|
||||
<div>{{rowVal}}</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div>
|
||||
<div>{{rowVal}}</div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div @click="trueChange()">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'dimension',
|
||||
data () {
|
||||
return {
|
||||
imgUrl: require('../../../static/nav/deleteImg.png'),
|
||||
rowVal: '指标',
|
||||
colVal: '时间',
|
||||
arrValue: {
|
||||
'指标': 'zb',
|
||||
'时间': 'sj'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeTabel (stateSD, strd) {
|
||||
if (strd === 'row') {
|
||||
this.rowVal = stateSD
|
||||
} else if (strd === 'col') {
|
||||
this.colVal = stateSD
|
||||
}
|
||||
},
|
||||
// 维度转换默认
|
||||
change3D () {
|
||||
if (this.$store.state.transState) {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.rowVal = '指标'
|
||||
this.colVal = '时间'
|
||||
} else {
|
||||
this.rowVal = '地区'
|
||||
this.colVal = '时间'
|
||||
}
|
||||
} else {
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.rowVal = '时间'
|
||||
this.colVal = '指标'
|
||||
} else {
|
||||
this.rowVal = '时间'
|
||||
this.colVal = '地区'
|
||||
}
|
||||
}
|
||||
},
|
||||
// 确定维度转换
|
||||
trueChange () {
|
||||
if (this.rowVal === this.colVal) {
|
||||
alert('维度转换格式错误!行列相同')
|
||||
} else if (this.$store.state.SelecttDimension.col === this.arrValue[this.rowVal]) {
|
||||
this.$store.state.noAreadimensionState = false
|
||||
} else {
|
||||
// 告诉父组件转置
|
||||
this.$emit('changeSetZZ', true)
|
||||
this.$store.state.SelecttDimension.col = this.arrValue[this.rowVal]
|
||||
this.$store.state.SelecttDimension.row = this.arrValue[this.colVal]
|
||||
this.$store.state.noAreadimensionState = false
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.change3D()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.dimension {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 10;
|
||||
& > .container {
|
||||
width: 64.375rem;
|
||||
height: 33rem;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
& > .top {
|
||||
margin-top: 1rem;
|
||||
width: 59.375rem;
|
||||
height: 3.875rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 0.125rem solid #bdbdbd;
|
||||
font-size: 1.375rem;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
letter-spacing: 0rem;
|
||||
color: #333333;
|
||||
& > img {
|
||||
width: 1.3125rem;
|
||||
height: 1.3125rem;
|
||||
}
|
||||
& > img:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
& > .main {
|
||||
margin-top: 2.6rem;
|
||||
width: 59.375rem;
|
||||
& > .row {
|
||||
width: 59.375rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
& > div:nth-child(1) {
|
||||
width: 5.25rem;
|
||||
height: 3.125rem;
|
||||
}
|
||||
& > .row_main {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
& > div {
|
||||
width: 5.25rem;
|
||||
height: 3.125rem;
|
||||
background-color: #a8daf1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
}
|
||||
& > div:nth-child(1) {
|
||||
border-radius: 0.1875rem 0 0 0.1875rem;
|
||||
}
|
||||
& > div:nth-child(3) {
|
||||
border-radius: 0 0.1875rem 0.1875rem 0;
|
||||
}
|
||||
& > .active {
|
||||
background-color: #52b6e3;
|
||||
}
|
||||
}
|
||||
& > div:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
& > .col {
|
||||
width: 59.375rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
& > .row_main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
& > div {
|
||||
width: 5.25rem;
|
||||
height: 3.125rem;
|
||||
background-color: #a8daf1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
}
|
||||
& > div:nth-child(1) {
|
||||
border-radius: 0.1875rem 0 0 0.1875rem;
|
||||
}
|
||||
& > div:nth-child(3) {
|
||||
border-radius: 0 0.1875rem 0.1875rem 0;
|
||||
}
|
||||
& > .active {
|
||||
background-color: #52b6e3;
|
||||
}
|
||||
& > div:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
& > .tabel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
& > div {
|
||||
height: 2.5rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
& > div {
|
||||
height: 2.5rem;
|
||||
width: 13.265rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid black;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
& > .bottom {
|
||||
width: 59.375rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
& > div:nth-child(1) {
|
||||
width: 15.625rem;
|
||||
height: 3.1875rem;
|
||||
background-color: #52b6e3;
|
||||
border-radius: 0.3125rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
letter-spacing: 0rem;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
& > div:nth-child(2) {
|
||||
width: 15.625rem;
|
||||
height: 3.1875rem;
|
||||
border: solid 0.125rem #dbdbdb;
|
||||
border-radius: 0.3125rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: normal;
|
||||
font-stretch: normal;
|
||||
letter-spacing: 0rem;
|
||||
color: #666666;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
& > div {
|
||||
margin: 3rem 1.2rem;
|
||||
}
|
||||
& > div:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="search">
|
||||
<div class="kuang">
|
||||
<input type="text" v-model="searchContext" placeholder="全站搜索" @keyup.enter="blurUpset" />
|
||||
<img :src="imgUrl.search" alt />
|
||||
<img :src="imgUrl.search" alt @click="blurUpset" />
|
||||
</div>
|
||||
<div class="tjHold">
|
||||
统计热词
|
||||
@@ -29,6 +29,10 @@ export default {
|
||||
methods: {
|
||||
blurUpset (textCont) {
|
||||
console.log(textCont, '3523')
|
||||
if (this.searchContext === '') {
|
||||
alert('搜索词不能为空!')
|
||||
return
|
||||
}
|
||||
if (this.$route.path === '/searchList') {
|
||||
this.$router.push({
|
||||
path: '/'
|
||||
|
||||
16
src/main.js
16
src/main.js
@@ -70,11 +70,13 @@ axios.interceptors.request.use(config => {
|
||||
// 返回拦截器(后)
|
||||
axios.interceptors.response.use(data => {
|
||||
// console.log(localStorage.getItem('token'))
|
||||
if (localStorage.getItem('token') !== null && data.data.code === 401) {
|
||||
alert('您没有该账号的登陆权限,请重新登录后再次操作!')
|
||||
localStorage.clear()
|
||||
window.location.reload()
|
||||
if (localStorage.getItem('token') && data.data.code === 403) {
|
||||
alert('您没有查看此分类下数据的权限!')
|
||||
}
|
||||
// let daraRes = []
|
||||
// if(data.data.code===200){
|
||||
// daraRes===
|
||||
// }
|
||||
return data
|
||||
})
|
||||
// IP端
|
||||
@@ -93,8 +95,10 @@ axios({
|
||||
localStorage.setItem('pic', res.data.data.pic)
|
||||
localStorage.setItem('userPwd', '123456')
|
||||
localStorage.setItem('token', 'Bearer ' + res.data.data.token)
|
||||
localStorage.setItem('tokenB', res.data.data.token)
|
||||
// 登录状态
|
||||
localStorage.setItem('userLogin', true)
|
||||
Vue.prototype.$auth = true
|
||||
}
|
||||
// 请求接口完成 请求成功
|
||||
}).catch((fail) => {
|
||||
@@ -105,6 +109,10 @@ Vue.prototype.$identify = identify.default
|
||||
Vue.prototype.$axios = axios
|
||||
// 引入设置dom元素高度的插件
|
||||
Vue.prototype.$detector = require('element-resize-detector')
|
||||
// vue人员权限
|
||||
Vue.prototype.$auth = {
|
||||
auth: false
|
||||
}
|
||||
|
||||
Vue.use(VueAwesomeSwiper)
|
||||
Vue.use(ElementUI)
|
||||
|
||||
@@ -30,7 +30,7 @@ import cs from '@/views/cs.vue'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
let RouterObj = new Router({
|
||||
mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes: [{
|
||||
@@ -105,3 +105,23 @@ export default new Router({
|
||||
}
|
||||
]
|
||||
})
|
||||
RouterObj.beforeEach((to, from, next) => {
|
||||
console.log(to, 'to')
|
||||
if (to.name === 'personalCenter' || to.name === 'datasweb') {
|
||||
console.log(localStorage.getItem('token'), 'localStorage.getItem()')
|
||||
if (!localStorage.getItem('token')) {
|
||||
alert('您没有该账号的登陆权限,请重新登录后再次操作!')
|
||||
// 权限通过时赋值
|
||||
console.log(Vue.prototype.$auth, 'Vue.prototype.$auth')
|
||||
Vue.prototype.$auth.auth = true
|
||||
console.log(Vue.prototype.$auth, 'Vue.prototype.$auth')
|
||||
// localStorage.clear()
|
||||
// window.location.reload()
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
export default RouterObj
|
||||
|
||||
22
src/store.js
22
src/store.js
@@ -53,8 +53,26 @@ export default new Vuex.Store({
|
||||
// 下拉筛选条件
|
||||
selectData: null,
|
||||
// 转置状态
|
||||
transState: true
|
||||
|
||||
transState: true,
|
||||
// 非地区维度转换
|
||||
noAreadimensionState: false,
|
||||
// 高级查询状态
|
||||
advancedSearchState: false,
|
||||
// 定义一个局的指标与地区互换的数据组
|
||||
labelArea: null,
|
||||
// 地区数据总数据
|
||||
AreaAllCountData: null,
|
||||
// 地区数据维度转换状态
|
||||
areaDimensionState: false,
|
||||
// 当前维度转换没有被选中的维度标记
|
||||
noSelecttDimension: 'zb',
|
||||
// 当前维度转换选中的
|
||||
SelecttDimension: {
|
||||
row: 'sj',
|
||||
col: 'dq'
|
||||
},
|
||||
// 左侧当前展开
|
||||
openOpenLeft: null
|
||||
},
|
||||
mutations: {},
|
||||
actions: {
|
||||
|
||||
@@ -71,6 +71,14 @@ export default {
|
||||
})
|
||||
break
|
||||
}
|
||||
this.axios.all([
|
||||
this.axios({ url: '', method: 'GET', params: {} }),
|
||||
this.axios({ url: '', method: 'POST', data: {} })
|
||||
]).then(
|
||||
this.axios.spread((res1, res2) => {
|
||||
console.log(res1, res2)
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,40 +117,44 @@
|
||||
<el-col :span="24">
|
||||
<el-menu
|
||||
:default-openeds="defaultSelectLies"
|
||||
class="el-menu-vertical-demo"
|
||||
@open="handleOpen"
|
||||
@close="handleClose"
|
||||
@select="selectActive"
|
||||
style="border:none"
|
||||
:unique-opened="true"
|
||||
>
|
||||
<el-submenu
|
||||
:index="''+index1"
|
||||
v-for="(item1,index1) in leftCateData"
|
||||
:key="index1"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item1.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item1.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2"
|
||||
v-for="(item2,index2) in item1.children"
|
||||
:key="index2"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item2.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item2.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2+'-'+index3"
|
||||
v-for="(item3,index3) in item2.children"
|
||||
:key="index3"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item3.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item3.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2+'-'+index3+'-'+index4"
|
||||
v-for="(item4,index4) in item3.children"
|
||||
:key="index4"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item4.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item4.name}}</template>
|
||||
<el-submenu
|
||||
:index="index1+'-'+index2+'-'+index3+'-'+index4+'-'+index5"
|
||||
v-for="(item5,index5) in item4.children"
|
||||
:key="index5"
|
||||
:style="{'background-color':$store.state.selectDataLeft.id===item5.id?'#95CEE4':''}"
|
||||
>
|
||||
<template slot="title">{{item5.name}}</template>
|
||||
</el-submenu>
|
||||
@@ -182,6 +186,14 @@
|
||||
v-if="$store.state.transdtr"
|
||||
:defaultDataRight="defaultDataRight"
|
||||
@stateTell="stateTell"
|
||||
@comTime="comTime"
|
||||
:stateDataGetVal="stateDataGetVal"
|
||||
@stateDFGHJ="stateDFGHJ"
|
||||
@statertfResu="statertfResu"
|
||||
:labelAreaState="labelAreaState"
|
||||
:areaDimensionStateS="areaDimensionStateS"
|
||||
@emmitStateAd="emmitStateAd"
|
||||
:labelAreaStateks="labelAreaStateks"
|
||||
></ChartsCut>
|
||||
<!-- 列表内容 -->
|
||||
<ChartsCont
|
||||
@@ -189,10 +201,18 @@
|
||||
:chartsStatusMegger="chartsStatusMegger"
|
||||
:defaultDataRight="defaultDataRight"
|
||||
:stateTells="stateTells"
|
||||
@comTime="comTime"
|
||||
:statesDf="statesDf"
|
||||
@tellAreadly="tellAreadly"
|
||||
@prentsState="prentsState"
|
||||
:downLaSelects="downLaSelect"
|
||||
@stateDataGet="stateDataGet"
|
||||
:downLaSelectArea="downLaSelectArea"
|
||||
:showTableState="showTableState"
|
||||
@statertyui="statertyui"
|
||||
:areaDimensionStateS="areaDimensionStateS"
|
||||
:advancedStates="advancedStates"
|
||||
@tellParentsShowClos="tellParentsShowClos"
|
||||
@tellChangeFan="tellChangeFan"
|
||||
></ChartsCont>
|
||||
</div>
|
||||
<div class="container">
|
||||
@@ -240,7 +260,15 @@
|
||||
<!-- 添加收藏 -->
|
||||
<AddCollect v-if="$store.state.addCollectState"></AddCollect>
|
||||
<!-- 维度转换 -->
|
||||
<Dimension v-if="$store.state.dimensionState" @changeValue="changeValue"></Dimension>
|
||||
<!--地区-->
|
||||
<Dimension
|
||||
v-if="$store.state.dimensionState"
|
||||
@changeValue="changeValue"
|
||||
@areaDimensionState="areaDimensionState"
|
||||
></Dimension>
|
||||
<!-- 维度转换 -->
|
||||
<!--非地区-->
|
||||
<NoAreaDimension v-if="$store.state.noAreadimensionState" @changeSetZZ="changeValue"></NoAreaDimension>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -271,8 +299,10 @@ import EditCom from '@/components/editCom/EditCom.vue'
|
||||
import AddCollect from '@/components/addCollect/AddCollect.vue'
|
||||
// 指标解释
|
||||
import LabelExplain from '@/components/labelExplain/LabelExplain.vue'
|
||||
// 维度转换
|
||||
// 维度转换 地区
|
||||
import Dimension from '@/components/dimension/Dimension.vue'
|
||||
// 维度转换 非地区
|
||||
import NoAreaDimension from '@/components/noAreaDimension/NoAreaDimension.vue'
|
||||
// 引入数据计算js用于机选渲染的数据
|
||||
import ComputedData from '../../assets/js/computeddata'
|
||||
// 引入全局的createObjectUrl用于覆盖window.URL
|
||||
@@ -294,7 +324,8 @@ export default {
|
||||
EditCom: EditCom,
|
||||
AddCollect: AddCollect,
|
||||
LabelExplain: LabelExplain,
|
||||
Dimension: Dimension
|
||||
Dimension: Dimension,
|
||||
NoAreaDimension: NoAreaDimension
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -402,17 +433,28 @@ export default {
|
||||
leftCateData: null,
|
||||
// 简单查询、高级查询、数据地图切换状态(simpleness(简单)、advanced(高级) 、map(地图))
|
||||
cutStateSeach: 'simpleness',
|
||||
// 下拉筛选的数据
|
||||
downLaSelect: {
|
||||
area: '',
|
||||
label: ''
|
||||
},
|
||||
// 下拉筛选的数据时间
|
||||
downLaSelect: '',
|
||||
// 下拉筛选的数据地区
|
||||
downLaSelectArea: '',
|
||||
// 新增指标状态
|
||||
statesDf: 1,
|
||||
// 数据加载状态
|
||||
stateTells: false,
|
||||
// 维度转换时(若不是地区数据只进行转置操作)
|
||||
changeState: false
|
||||
changeState: false,
|
||||
// 数据请求成功后的状态
|
||||
stateDataGetVal: false,
|
||||
// 扩展数据完成后
|
||||
labelAreaState: false,
|
||||
// 清除空行空列
|
||||
showTableState: false,
|
||||
// 地区数据维度转换状态
|
||||
areaDimensionStateS: false,
|
||||
// 高级查询数据渲染
|
||||
advancedStates: false,
|
||||
// 指标与地区互换状态
|
||||
labelAreaStateks: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -425,6 +467,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 地区数据维度转换状态
|
||||
areaDimensionState (val) {
|
||||
this.areaDimensionStateS = !this.areaDimensionStateS
|
||||
},
|
||||
// 维度转换非地区转置
|
||||
changeValue (val) {
|
||||
this.changeState = val
|
||||
@@ -435,7 +481,8 @@ export default {
|
||||
method: 'GET',
|
||||
url: 'data/data/list',
|
||||
params: {
|
||||
type: this.$route.query.type
|
||||
type: this.$route.query.type === 'area' ? 2 : 1,
|
||||
f: this.$route.query.type === 'area' ? '' : this.$route.query.type
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, '左侧菜单')
|
||||
@@ -465,6 +512,7 @@ export default {
|
||||
},
|
||||
handleOpen (key, keyPath) {
|
||||
console.log(key, keyPath, '开')
|
||||
this.$store.state.openOpenLeft = keyPath
|
||||
console.log(key.split('-'))
|
||||
let datart = []
|
||||
key.split('-').forEach((item, index) => {
|
||||
@@ -476,10 +524,11 @@ export default {
|
||||
})
|
||||
console.log(datart)
|
||||
this.defaultDataRight = datart
|
||||
this.$store.state.selectDataLeft = this.defaultDataRight
|
||||
this.$store.state.selectfilter = this.defaultDataRight.f
|
||||
},
|
||||
handleClose (key, keyPath) {
|
||||
// console.log(key, keyPath)
|
||||
console.log(key, keyPath, '关闭打印')
|
||||
},
|
||||
selectActive (key, keyPath) {
|
||||
// console.log(key, keyPath)
|
||||
@@ -516,15 +565,23 @@ export default {
|
||||
// console.log('鼠标离开')
|
||||
},
|
||||
clickAllCate (hierarchy, ind) {
|
||||
let that = this
|
||||
switch (ind) {
|
||||
case 0:
|
||||
this.cutStateSeach = 'simpleness'
|
||||
this.$store.state.advancedSearchState = false
|
||||
break
|
||||
case 1:
|
||||
this.cutStateSeach = 'advanced'
|
||||
this.$store.state.advancedSearchState = true
|
||||
break
|
||||
case 2:
|
||||
this.cutStateSeach = 'map'
|
||||
if (this.$route.query.type === 'area') {
|
||||
this.cutStateSeach = 'map'
|
||||
} else {
|
||||
alert('地图功能对非地区数据无效!')
|
||||
}
|
||||
this.$store.state.advancedSearchState = false
|
||||
break
|
||||
case 3:// 添加收藏
|
||||
this.$store.state.addCollectState = true
|
||||
@@ -568,6 +625,10 @@ export default {
|
||||
case 'search':// 调接进行高级查询
|
||||
// 调用接口查询高级查询的数据
|
||||
console.log(this.$store.state.advanceData)
|
||||
if (this.$store.state.advanceData.length < 4) {
|
||||
alert('筛选数据数据不能少于4条!')
|
||||
return
|
||||
}
|
||||
this.$axios({
|
||||
method: 'GET',
|
||||
url: 'data/data/quick',
|
||||
@@ -589,7 +650,7 @@ export default {
|
||||
area: '',
|
||||
quota: '',
|
||||
cate: '',
|
||||
filter: this.$route.query.type,
|
||||
f: this.$route.query.type,
|
||||
date: Object.keys(res.data.data.list)[0]
|
||||
|
||||
}
|
||||
@@ -597,8 +658,27 @@ export default {
|
||||
console.log(res, '高级查询数据展示')
|
||||
// 请求接口完成 请求成功
|
||||
if (res.data.code === 200) {
|
||||
|
||||
let transBefore = {}
|
||||
transBefore.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
|
||||
console.log(transBefore, '000')
|
||||
that.$store.state.transdtr = true
|
||||
// 全局总数据
|
||||
that.$store.state.transBefore = transBefore
|
||||
// 全局永久不变数据
|
||||
that.$store.state.noChangeData = JSON.parse(JSON.stringify(transBefore))
|
||||
that.cutStateSeach = 'simpleness'
|
||||
that.advancedStates = true
|
||||
} else {
|
||||
that.$store.state.transBefore = null
|
||||
that.advancedStates = true
|
||||
}
|
||||
// 告诉子组件渲染高级查询数据
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
@@ -606,7 +686,6 @@ export default {
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
|
||||
break
|
||||
}
|
||||
},
|
||||
@@ -640,33 +719,101 @@ export default {
|
||||
this.$router.go(0)
|
||||
break
|
||||
case '清除空行空列':// 清除空行空列
|
||||
this.$router.go(0)
|
||||
if (this.$store.state.transBefore) {
|
||||
// this.$router.go(0)
|
||||
console.log(this.$store.state.transBefore, 'this.$store.state.transBefore')
|
||||
if (this.$route.query.type === 'area') {
|
||||
// 先过滤每一行
|
||||
this.$store.state.transBefore = this.$store.state.transBefore.filter((item, index) => {
|
||||
return !item.some((item, index) => {
|
||||
let firstHang = []// 过滤掉的下标=====》地区
|
||||
this.$store.state.transBefore.transBeforeAreaData = this.$store.state.transBefore.transBeforeAreaData.filter((item, index) => {
|
||||
if (item.every((item, index) => { return item === '' })) {
|
||||
firstHang.push(index)
|
||||
}
|
||||
return !item.every((item, index) => {
|
||||
return item === ''
|
||||
}) === true
|
||||
})
|
||||
// 在过滤每一列
|
||||
// 行列转置
|
||||
this.$store.state.transBefore = this.$store.state.transBefore[0].map(function (col, index) {
|
||||
return this.$store.state.transBefore.map((row, key) => {
|
||||
let brrCe = this.$store.state.transBefore.transBeforeAreaData
|
||||
this.$store.state.transBefore.transBeforeAreaData = brrCe[0].map(function (col, index) {
|
||||
return brrCe.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
// 在过滤每一行
|
||||
this.$store.state.transBefore = this.$store.state.transBefore.filter((item, index) => {
|
||||
return !item.some((item, index) => {
|
||||
let secendHang = []// 过滤掉的下标=====》时间
|
||||
this.$store.state.transBefore.transBeforeAreaData = this.$store.state.transBefore.transBeforeAreaData.filter((item, index) => {
|
||||
if (item.every((item, index) => { return item === '' })) {
|
||||
secendHang.push(index)
|
||||
}
|
||||
return !item.every((item, index) => {
|
||||
return item === ''
|
||||
}) === true
|
||||
})
|
||||
// 行列转置
|
||||
this.$store.state.transBefore = this.$store.state.transBefore[0].map(function (col, index) {
|
||||
return this.$store.state.transBefore.map((row, key) => {
|
||||
let arrCe = this.$store.state.transBefore.transBeforeAreaData
|
||||
this.$store.state.transBefore.transBeforeAreaData = arrCe[0].map(function (col, index) {
|
||||
return arrCe.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
// 将时间和地区名过滤掉
|
||||
this.$store.state.transBefore.areaName = this.$store.state.transBefore.areaName.filter((item, index) => {
|
||||
return firstHang.indexOf(index) === -1
|
||||
})
|
||||
this.$store.state.transBefore.timeArr = this.$store.state.transBefore.timeArr.filter((item, index) => {
|
||||
return secendHang.indexOf(index) === -1
|
||||
})
|
||||
console.log(this.$store.state.transBefore, 'this.$store.state.transBefore.transBeforeAreaData')
|
||||
this.showTableState = true
|
||||
} else { // 非地区数据
|
||||
// 先过滤每一行
|
||||
let firstHang = []// 过滤掉的下标=====》地区
|
||||
this.$store.state.transBefore.transBeforeTermsData = this.$store.state.transBefore.transBeforeTermsData.filter((item, index) => {
|
||||
if (item.every((item, index) => { return item === '' })) {
|
||||
firstHang.push(index)
|
||||
}
|
||||
return !item.every((item, index) => {
|
||||
return item === ''
|
||||
}) === true
|
||||
})
|
||||
// 在过滤每一列
|
||||
// 行列转置
|
||||
let brrCe = this.$store.state.transBefore.transBeforeTermsData
|
||||
this.$store.state.transBefore.transBeforeTermsData = brrCe[0].map(function (col, index) {
|
||||
return brrCe.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
// 在过滤每一行
|
||||
let secendHang = []// 过滤掉的下标=====》时间
|
||||
this.$store.state.transBefore.transBeforeTermsData = this.$store.state.transBefore.transBeforeTermsData.filter((item, index) => {
|
||||
if (item.every((item, index) => { return item === '' })) {
|
||||
secendHang.push(index)
|
||||
}
|
||||
return !item.every((item, index) => {
|
||||
return item === ''
|
||||
}) === true
|
||||
})
|
||||
// 行列转置
|
||||
let arrCe = this.$store.state.transBefore.transBeforeTermsData
|
||||
this.$store.state.transBefore.transBeforeTermsData = arrCe[0].map(function (col, index) {
|
||||
return arrCe.map((row, key) => {
|
||||
return row[index]
|
||||
})
|
||||
})
|
||||
// 将时间和地区名过滤掉
|
||||
this.$store.state.transBefore.termsName = this.$store.state.transBefore.termsName.filter((item, index) => {
|
||||
return firstHang.indexOf(index) === -1
|
||||
})
|
||||
this.$store.state.transBefore.termsExplain = this.$store.state.transBefore.termsExplain.filter((item, index) => {
|
||||
return firstHang.indexOf(index) === -1
|
||||
})
|
||||
this.$store.state.transBefore.timeArr = this.$store.state.transBefore.timeArr.filter((item, index) => {
|
||||
return secendHang.indexOf(index) === -1
|
||||
})
|
||||
console.log(this.$store.state.transBefore, 'this.$store.state.transBefore.transBeforeAreaData')
|
||||
this.showTableState = true
|
||||
}
|
||||
break
|
||||
case '编辑':
|
||||
@@ -677,7 +824,13 @@ export default {
|
||||
this.$store.state.transState = this.chartsStatusMegger.transState
|
||||
break
|
||||
case '维度转换':
|
||||
this.$store.state.dimensionState = true
|
||||
if (this.$route.query.type === 'area') {
|
||||
this.$store.state.dimensionState = true
|
||||
} else {
|
||||
this.$store.state.noAreadimensionState = true
|
||||
// this.chartsStatusMegger.transState = !this.chartsStatusMegger.transState
|
||||
// this.$store.state.transState = this.chartsStatusMegger.transState
|
||||
}
|
||||
break
|
||||
case '保存默认':// 将分类id 和 分类数据存入本地
|
||||
// 获取本地保存数据
|
||||
@@ -890,10 +1043,11 @@ export default {
|
||||
})
|
||||
this.defaultSelectLies = stateStatic
|
||||
console.log(this.defaultSelectLies, 'stateStatic')
|
||||
this.$store.state.openOpenLeft = stateStatic
|
||||
let dataDome = []
|
||||
console.log(stateStatic, '数据')
|
||||
console.log(this.leftCateData[this.leftCateData.length - 1], '数据length-1')
|
||||
this.$store.state.selectDataLeft = this.leftCateData[this.leftCateData.length - 1]
|
||||
|
||||
// console.log(this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children[0].children[0], '1')
|
||||
if (this.leftCateData[this.leftCateData.length - 1].children !== undefined) {
|
||||
if (this.leftCateData[this.leftCateData.length - 1].children[0].children !== undefined) {
|
||||
@@ -913,11 +1067,13 @@ export default {
|
||||
dataDome = this.leftCateData[this.leftCateData.length - 1]
|
||||
}
|
||||
this.defaultDataRight = dataDome
|
||||
this.$store.state.selectDataLeft = this.defaultDataRight
|
||||
console.log(this.defaultDataRight, '1250')
|
||||
this.$store.state.selectfilter = this.defaultDataRight.f
|
||||
},
|
||||
comTime (res) {
|
||||
this.downLaSelect.time = res
|
||||
console.log(res, '被选中的')
|
||||
this.downLaSelect = res.indexID
|
||||
},
|
||||
// 接收子组件传值新增指标
|
||||
emitStatesd (val) {
|
||||
@@ -940,8 +1096,37 @@ export default {
|
||||
// 重置参数
|
||||
prentsState (val) {
|
||||
this.stateTells = val
|
||||
this.labelAreaState = true
|
||||
},
|
||||
// 改变状态
|
||||
stateDataGet (val) {
|
||||
this.stateDataGetVal = val
|
||||
},
|
||||
stateDFGHJ (val) {
|
||||
this.stateDataGetVal = val
|
||||
this.labelAreaState = false
|
||||
},
|
||||
// 地区数据下拉发生变化
|
||||
statertfResu (val) {
|
||||
console.log(val, '1010110')
|
||||
this.downLaSelectArea = val
|
||||
},
|
||||
// 重置清除空行空列状态
|
||||
statertyui (val) {
|
||||
this.showTableState = val
|
||||
},
|
||||
// 重置维度转换状态
|
||||
emmitStateAd (val) {
|
||||
// this.areaDimensionStateS = val
|
||||
},
|
||||
// 重置高级查询状态
|
||||
tellParentsShowClos (val) {
|
||||
this.advancedStates = val
|
||||
},
|
||||
// 改变状态
|
||||
tellChangeFan (val) {
|
||||
this.labelAreaStateks = val
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
// 计算字符串
|
||||
@@ -984,16 +1169,6 @@ export default {
|
||||
// console.log(this.$route.query.type)
|
||||
this.initValue = this.computedNumberPx(200)
|
||||
console.log(this.computedNumberPx(200))
|
||||
// this.$detector().listenTo(this.$refs.leftHeight, (element) => {
|
||||
// console.log(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.getCateData()
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="cont">
|
||||
<!-- 全局搜索 -->
|
||||
<search></search>
|
||||
<div class="cont_content">
|
||||
<div class="cont_content" v-if="cont_basic.length>0">
|
||||
<div class="header">
|
||||
<div class="left">个人中心</div>
|
||||
<div class="right">
|
||||
@@ -92,11 +92,15 @@
|
||||
@current-change="currentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<div class="collect_no" v-if="!collect">暂无收藏记录</div>
|
||||
<div
|
||||
class="collect_no"
|
||||
v-if="!collect"
|
||||
>{{!collect?collect.length!==0?'':'暂无收藏记录':'加载中...'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="cont_basic.length===0" class="cont_content_basic">数据加载中...</div>
|
||||
</div>
|
||||
|
||||
<!-- 页脚信息 -->
|
||||
@@ -150,26 +154,26 @@ export default {
|
||||
staticSelect: '基本设置',
|
||||
// 基本设置数据
|
||||
cont_basic: [
|
||||
{
|
||||
keys: '用户名称',
|
||||
values: '张三'
|
||||
},
|
||||
{
|
||||
keys: '邮箱',
|
||||
values: '1234567@163.com'
|
||||
},
|
||||
{
|
||||
keys: '所属部门',
|
||||
values: '部门'
|
||||
},
|
||||
{
|
||||
keys: '机构名称',
|
||||
values: '某某机构'
|
||||
},
|
||||
{
|
||||
keys: '机构地址',
|
||||
values: '某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某'
|
||||
}
|
||||
// {
|
||||
// keys: '用户名称',
|
||||
// values: '张三'
|
||||
// },
|
||||
// {
|
||||
// keys: '邮箱',
|
||||
// values: '1234567@163.com'
|
||||
// },
|
||||
// {
|
||||
// keys: '所属部门',
|
||||
// values: '部门'
|
||||
// },
|
||||
// {
|
||||
// keys: '机构名称',
|
||||
// values: '某某机构'
|
||||
// },
|
||||
// {
|
||||
// keys: '机构地址',
|
||||
// values: '某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某'
|
||||
// }
|
||||
],
|
||||
// 密码
|
||||
password: localStorage.getItem('userPwd'),
|
||||
@@ -182,38 +186,39 @@ export default {
|
||||
// 收藏搜索
|
||||
searchCollect: '',
|
||||
// 收藏列表数据
|
||||
collect: [
|
||||
{
|
||||
name: '发的货接口的话接口io福达合金你接口撒环能科技河南地方撒即可',
|
||||
database: '月度数据发的货接口的话接口io福达合金你接口撒环能科技河南地方撒即可',
|
||||
birthTime: '2019-09-18',
|
||||
staticInput: false
|
||||
},
|
||||
{
|
||||
name: '1',
|
||||
database: '月度数据',
|
||||
birthTime: '2019-09-18',
|
||||
staticInput: false
|
||||
},
|
||||
{
|
||||
name: '1',
|
||||
database: '月度数据',
|
||||
birthTime: '2019-09-18',
|
||||
staticInput: false
|
||||
},
|
||||
{
|
||||
name: '1',
|
||||
database: '月度数据',
|
||||
birthTime: '2019-09-18',
|
||||
staticInput: false
|
||||
},
|
||||
{
|
||||
name: '1',
|
||||
database: '月度数据',
|
||||
birthTime: '2019-09-18',
|
||||
staticInput: false
|
||||
}
|
||||
],
|
||||
// collect: [
|
||||
// // {
|
||||
// // name: '发的货接口的话接口io福达合金你接口撒环能科技河南地方撒即可',
|
||||
// // database: '月度数据发的货接口的话接口io福达合金你接口撒环能科技河南地方撒即可',
|
||||
// // birthTime: '2019-09-18',
|
||||
// // staticInput: false
|
||||
// // },
|
||||
// // {
|
||||
// // name: '1',
|
||||
// // database: '月度数据',
|
||||
// // birthTime: '2019-09-18',
|
||||
// // staticInput: false
|
||||
// // },
|
||||
// // {
|
||||
// // name: '1',
|
||||
// // database: '月度数据',
|
||||
// // birthTime: '2019-09-18',
|
||||
// // staticInput: false
|
||||
// // },
|
||||
// // {
|
||||
// // name: '1',
|
||||
// // database: '月度数据',
|
||||
// // birthTime: '2019-09-18',
|
||||
// // staticInput: false
|
||||
// // },
|
||||
// // {
|
||||
// // name: '1',
|
||||
// // database: '月度数据',
|
||||
// // birthTime: '2019-09-18',
|
||||
// // staticInput: false
|
||||
// // }
|
||||
// ],
|
||||
collect: null,
|
||||
// 我的收藏名称
|
||||
collectName: '',
|
||||
// 分页配置
|
||||
@@ -376,11 +381,35 @@ export default {
|
||||
// 请求接口完成 请求成功
|
||||
// alert(res.data.message)
|
||||
if (res.data.code === 200) {
|
||||
this.cont_basic[0].values = res.data.data.username
|
||||
this.cont_basic[1].values = res.data.data.email
|
||||
this.cont_basic[2].values = res.data.data.company_dept
|
||||
this.cont_basic[3].values = res.data.data.company_name
|
||||
this.cont_basic[4].values = res.data.data.company_addr
|
||||
let resdatares = [
|
||||
{
|
||||
keys: '用户名称',
|
||||
values: '张三'
|
||||
},
|
||||
{
|
||||
keys: '邮箱',
|
||||
values: '1234567@163.com'
|
||||
},
|
||||
{
|
||||
keys: '所属部门',
|
||||
values: '部门'
|
||||
},
|
||||
{
|
||||
keys: '机构名称',
|
||||
values: '某某机构'
|
||||
},
|
||||
{
|
||||
keys: '机构地址',
|
||||
values: '某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某某'
|
||||
}
|
||||
]
|
||||
resdatares[0].values = res.data.data.username
|
||||
resdatares[1].values = res.data.data.email
|
||||
resdatares[2].values = res.data.data.company_dept
|
||||
resdatares[3].values = res.data.data.company_name
|
||||
resdatares[4].values = res.data.data.company_addr
|
||||
this.cont_basic = resdatares
|
||||
console.log(this.cont_basic, 'this.cont_basic')
|
||||
}
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
@@ -904,5 +933,14 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
& > .cont_content_basic {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
height: 38rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="content_cont">
|
||||
<!-- 主内容 -->
|
||||
<div class="mainCont">
|
||||
<div class="mainCont_content">
|
||||
<div class="mainCont_content" v-if="pageConfiguration.countSize!==0">
|
||||
<div class="header">
|
||||
<div class="left">相关搜索约为 {{pageConfiguration.countSize}} 条</div>
|
||||
<div class="right">
|
||||
@@ -52,8 +52,8 @@
|
||||
@current-change="currentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<div v-if="pageConfiguration.countSize===0" style="height:20rem;width:100%;display:flex;align-items:center;justify-content:center;font-size:1.56rem;">哎呦,没有搜到结果呦!再试一遍吧!</div>
|
||||
</div>
|
||||
<div v-if="pageConfiguration.countSize===0" style="height:20rem;width:100%;display:flex;align-items:center;justify-content:center;font-size:1.56rem;">哎呦,没有搜到结果呦!再试一遍吧!</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -86,10 +86,10 @@ export default {
|
||||
},
|
||||
// 栏目数据 结构不可变
|
||||
cityData: [
|
||||
{ 'id': '110000', 'name': '年度数据', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' },
|
||||
{ 'id': '110000', 'name': '季度数据', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' },
|
||||
{ 'id': '110000', 'name': '月度数据', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' },
|
||||
{ 'id': '110000', 'name': '-全部-', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' }
|
||||
// { 'id': '110000', 'name': '年度数据', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' },
|
||||
// { 'id': '110000', 'name': '季度数据', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' },
|
||||
// { 'id': '110000', 'name': '月度数据', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' },
|
||||
// { 'id': '110000', 'name': '-全部-', 'parentId': '100000', 'shortName': '北京', 'cityCode': '' }
|
||||
],
|
||||
// 栏目级数
|
||||
jishu: 1,
|
||||
@@ -104,14 +104,14 @@ export default {
|
||||
],
|
||||
// 搜索到的数据
|
||||
searchData: [
|
||||
{ id: 1, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 2, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 3, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 4, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 5, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 6, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 7, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
{ id: 8, name: '张三', className: 'table1', lmss: '年度数据' }
|
||||
// { id: 1, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 2, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 3, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 4, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 5, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 6, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 7, name: '张三', className: 'table1', lmss: '年度数据' },
|
||||
// { id: 8, name: '张三', className: 'table1', lmss: '年度数据' }
|
||||
],
|
||||
// 分页
|
||||
// 分页配置
|
||||
|
||||
Reference in New Issue
Block a user