fanzhen0108

This commit is contained in:
fanzhen123
2020-01-12 17:25:17 +08:00
parent f250f6698f
commit ca8fac994d
8 changed files with 758 additions and 361 deletions

View File

@@ -520,8 +520,14 @@ class computedFunc {
labelId: 'table_line' + dataRs.tableLine.length labelId: 'table_line' + dataRs.tableLine.length
}) })
let bth = dataRs.countData.map((item, index) => { let bth = dataRs.countData.map((item, index) => {
// console.log(item, 'item002255')
var arr = Object.values(item) var arr = Object.values(item)
arr.shift() arr.shift()
if (arr.length < 2) {
arr.push('0')
arr.push('0')
}
console.log(arr, 'arr000')
return math.add(...arr).toFixed(2) return math.add(...arr).toFixed(2)
}) })
dataRs.countData.forEach((item, index) => { dataRs.countData.forEach((item, index) => {

View File

@@ -62,7 +62,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 列表 表说明--> <!-- 列表 表说明-->
<div class="tableExplain">{{transBefore.tableExplain}}</div> <div class="tableExplain" v-html="computedTableExplain"></div>
<!-- 指标弹窗 --> <!-- 指标弹窗 -->
</div> </div>
<div v-if="!transBefore&&!loadings" class="tishi54">暂无数据</div> <div v-if="!transBefore&&!loadings" class="tishi54">暂无数据</div>
@@ -108,10 +108,6 @@ export default {
// type: String, // type: String,
// required: true // required: true
// }, // },
downLaSelectArea: {
type: String,
required: false
},
showTableState: { showTableState: {
type: Boolean, type: Boolean,
required: true required: true
@@ -372,7 +368,9 @@ export default {
// 初始化左侧状态 // 初始化左侧状态
leftState: false, leftState: false,
// 列宽数组 // 列宽数组
lieWidthArr: [] lieWidthArr: [],
// 指标或地区次数 true为1次 false为非1次
labelAreaNum: true
} }
}, },
watch: { watch: {
@@ -405,6 +403,8 @@ export default {
tableData: { tableData: {
handler () { handler () {
this.$store.state.tableData = this.tableData this.$store.state.tableData = this.tableData
// console.log('需要保存默认的数据')
this.needSaveDefaultData()
}, },
immediate: true, immediate: true,
deep: true deep: true
@@ -462,38 +462,6 @@ export default {
immediate: true, immediate: true,
deep: true deep: true
}, },
downLaSelectArea (valStrinf) {
console.log(valStrinf, '555222000选中')
console.log(this.$store.state.AreaAllCountData, 'kkkkk数据')
if (!this.$store.state.advancedSearchState) {
if (this.$store.state.newSelectDaaState) {
this.$store.state.labelIndexName = valStrinf
this.$store.state.areaIndexName = ''
this.selectState = 1
} else {
this.$store.state.labelIndexName = ''
this.$store.state.areaIndexName = valStrinf
this.selectState = 2
}
// if (this.leftState) {
this.getDatas()
// }
} else {
console.log(this.leftState, '走这里')
if (this.$store.state.newSelectDaaState) {
this.$store.state.labelIndexName = valStrinf
this.$store.state.areaIndexName = ''
this.selectState = 1
} else {
this.$store.state.labelIndexName = ''
this.$store.state.areaIndexName = valStrinf
this.selectState = 2
}
// if (this.leftState) {
this.advancedSearchDataShow()
// }
}
},
// 监听行列图表转换 // 监听行列图表转换
rowColIndex (newVal, oldVal) { rowColIndex (newVal, oldVal) {
if (this.transBefore) { if (this.transBefore) {
@@ -504,35 +472,31 @@ export default {
defaultDataRight: { defaultDataRight: {
handler (val) { handler (val) {
console.log(val, '左侧数据变化') console.log(val, '左侧数据变化')
this.$store.state.defaultShowDataState = false
// 还原转置状态和行列状态
this.transState = true
this.chartsStatusMegger.transState = this.transState
if (this.$route.query.type !== 'area') {
this.$store.state.SelecttDimension = {
row: 'sj',
col: 'zb'
}
} else {
this.$store.state.SelecttDimension = {
row: 'sj',
col: 'dq'
}
}
if (val) { if (val) {
// 初始化公共数据 // 初始化公共数据
// console.log(this.objCompBefore, 'this.objCompBefore') // console.log(this.defaultDataRight, '获取左侧选中数据555')
if (JSON.parse(sessionStorage.getItem('classFiyData')) && JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) { this.leftState = false
this.transBefore = {} // 恢复高级查询状态
this.transBefore.tableExplain = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.tableExplain this.$store.state.advancedSearchState = false
this.transBefore.timeArr = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.timeArr.map((item, index) => { return item.toString() })
this.transBefore.termsName = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsName
this.transBefore.termsExplain = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsExplain
this.transBefore.areaName = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.areaName
this.transBefore.transBeforeTermsData = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeTermsData
this.transBefore.transBeforeAreaData = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeAreaData
console.log(this.transBefore, '000kkkkkkkkkkkkk')
this.$store.state.transdtr = true
// 全局总数据
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.leftState = false
// 恢复高级查询状态
this.$store.state.advancedSearchState = false
}
// 调接口拿到所有当前分类下的所有的指标、地区、时间 // 调接口拿到所有当前分类下的所有的指标、地区、时间
this.getInfor([val.id]) this.getInfor([val.id])
} }
// 默认数据关闭
}, },
immediate: false, immediate: false,
deep: true deep: true
@@ -540,24 +504,24 @@ export default {
// 监听下拉状态变化 // 监听下拉状态变化
stateTells (val) { stateTells (val) {
console.log(val, 'jjjjjj') console.log(val, 'jjjjjj')
if (val) { // if (val) {
if (JSON.parse(sessionStorage.getItem('classFiyData')) && JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) { // if (JSON.parse(sessionStorage.getItem('classFiyData')) && JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id)) {
this.transBefore = {} // this.transBefore = {}
this.transBefore.tableExplain = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.tableExplain // this.transBefore.tableExplain = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.tableExplain
this.transBefore.timeArr = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.timeArr.map((item, index) => { return item.toString() }) // this.transBefore.timeArr = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.timeArr.map((item, index) => { return item.toString() })
this.transBefore.termsName = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsName // this.transBefore.termsName = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsName
this.transBefore.termsExplain = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsExplain // this.transBefore.termsExplain = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.termsExplain
this.transBefore.areaName = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.areaName // this.transBefore.areaName = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.areaName
this.transBefore.transBeforeTermsData = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeTermsData // this.transBefore.transBeforeTermsData = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeTermsData
this.transBefore.transBeforeAreaData = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeAreaData // this.transBefore.transBeforeAreaData = JSON.parse(sessionStorage.getItem('classFiyData')).find(item => item.id === this.defaultDataRight.id).data.transBeforeAreaData
console.log(this.transBefore, '000') // console.log(this.transBefore, '000')
// this.$store.state.transdtr = true // // this.$store.state.transdtr = true
// 全局总数据 // // 全局总数据
this.$store.state.transBefore = this.transBefore // this.$store.state.transBefore = this.transBefore
// 全局永久不变数据 // // 全局永久不变数据
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore)) // this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
} // }
} // }
}, },
// 筛选 // 筛选
statesDf (val) { statesDf (val) {
@@ -617,6 +581,60 @@ export default {
} }
}, },
methods: { methods: {
/**
* @desc 显示默认的数据
*
* */
showSaveDefaultData () {
},
/**
* @desc 调接口显示表格数据
* @param valStrinf string 当前选中的时间
*
* */
downLaSelectArea (valStrinf) {
console.log(valStrinf, '555222000选中')
console.log(this.$store.state.AreaAllCountData, 'kkkkk数据')
if (this.$store.state.defaultShowDataState && this.labelAreaNum) {
this.transBefore = this.$store.state.transBefore
} else {
if (!this.$store.state.advancedSearchState) {
if (this.$store.state.newSelectDaaState) {
this.$store.state.labelIndexName = valStrinf
this.$store.state.areaIndexName = ''
this.selectState = 1
} else {
this.$store.state.labelIndexName = ''
this.$store.state.areaIndexName = valStrinf
this.selectState = 2
}
this.getDatas()
} else {
console.log(this.leftState, '走这里')
if (this.$store.state.newSelectDaaState) {
this.$store.state.labelIndexName = valStrinf
this.$store.state.areaIndexName = ''
this.selectState = 1
} else {
this.$store.state.labelIndexName = ''
this.$store.state.areaIndexName = valStrinf
this.selectState = 2
}
this.advancedSearchDataShow()
}
}
this.labelAreaNum = false
},
/**
* @desc 计算需要保存默认的数据
* @return 返回一个保存默认数据的对象改变store中的数据
*
* */
needSaveDefaultData () {
// console.log(this.tableLine)
// console.log(this.tableData)
},
/** /**
* @desc 计算列宽,返回每一列中内容最大的那个的内容长度 * @desc 计算列宽,返回每一列中内容最大的那个的内容长度
* @return 返回一个含有每列最大的内容的长度的数组 * @return 返回一个含有每列最大的内容的长度的数组
@@ -677,8 +695,34 @@ export default {
this.$store.state.dataArealabelTime = res.data.data this.$store.state.dataArealabelTime = res.data.data
// 该分类下无数据 // 该分类下无数据
this.$store.state.classifyIdDataState = false this.$store.state.classifyIdDataState = false
// =======================
this.$store.state.transdtr = true
this.transBefore = null
// 全局总数据
this.$store.state.transBefore = null
this.$store.state.allNochangeInitData = null
this.$store.state.noChangeData = null
// 调用父组件的comTime方法告诉父组件重置状态
this.$store.state.noDataState = false
this.leftState = true
}
if (this.$store.state.defaultShowDataState && this.$route.query.type !== 'area') {
this.$store.state.transdtr = true
// 全局总数据
this.transBefore = this.$store.state.transBefore
this.leftState = true
console.log(this.$store.state.transBefore, 'this.transBefore if')
console.log(this.$store.state.SelecttDimension, 'this.$store.state.SelecttDimension')
if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') {
this.transState = true
} else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') {
this.transState = false
}
this.chartsStatusMegger.transState = this.transState
} else {
console.log(this.$store.state.transBefore, 'this.transBefore else')
this.$parent.childChartsCutShow()
} }
this.$parent.childChartsCutShow()
}).catch((fail) => { }).catch((fail) => {
console.log(fail) console.log(fail)
}) })
@@ -692,8 +736,8 @@ export default {
this.tableData = objDatasBefore.countData this.tableData = objDatasBefore.countData
console.log(objDatasBefore, 'objDatasBefore') console.log(objDatasBefore, 'objDatasBefore')
} else { // 当指标名称在表头上 } else { // 当指标名称在表头上
let objCompAfter = new ComputedData(this.transBefore) this.objCompBefore = new ComputedData(this.transBefore)
var objDatasAfter = objCompAfter.comTransAfter() var objDatasAfter = this.objCompBefore.comTransAfter()
this.tableLine = objDatasAfter.tableLine this.tableLine = objDatasAfter.tableLine
this.tableData = objDatasAfter.countData this.tableData = objDatasAfter.countData
console.log(objDatasAfter, 'objDatasAfter') console.log(objDatasAfter, 'objDatasAfter')
@@ -1022,58 +1066,79 @@ export default {
this.objCompBefore.initAllData() this.objCompBefore.initAllData()
} }
console.log(this.$store.state.selectData, '执行') console.log(this.$store.state.selectData, '执行')
this.$axios({ console.log(this.$store.state.selectDataLeft, '左侧选中')
method: 'GET', if (this.$store.state.selectDataLeft) {
url: 'data/data/detail', this.$axios({
params: { method: 'GET',
type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区 url: 'data/data/detail',
table_name: this.defaultDataRight.table_name, // 表名 params: {
id: this.defaultDataRight.id, // 分类id type: this.$route.query.type === 'area' ? 2 : 1, // 1非地区 2地区
area: this.$store.state.areaIndexName, // 选中的地区 table_name: this.$store.state.selectDataLeft.table_name, // 表名
quota: this.$store.state.labelIndexName, // 选中的指标 id: this.$store.state.selectDataLeft.id, // 分类id
cate: this.selectState, // 1筛选指标 2筛选地区 area: this.$store.state.areaIndexName, // 选中的地区
f: this.$store.state.selectfilter, // year=>年度分类monthly=>月度分类quarter=>季度分类 quota: this.$store.state.labelIndexName, // 选中的指标
data: this.$store.state.selectData // 时间 cate: this.selectState, // 1筛选指标 2筛选地区
} f: this.$store.state.selectfilter, // year=>年度分类monthly=>月度分类quarter=>季度分类
}).then(res => { data: this.$store.state.selectData // 时间
console.log(res, '获取数据展示数据') }
// 请求接口完成 请求成功 }).then(res => {
if (res.data.code === 200) { console.log(res, '获取数据展示数据')
if (res.data.data.areaName.length !== 0) { // 请求接口完成 请求成功
if (this.downLaSelect.area === '' || this.downLaSelect.label === '') { if (res.data.code === 200) {
console.log(this.downLaSelect.area, 'this.downLaSelect.area') if (res.data.data.areaName.length !== 0) {
let brrtf = {} if (this.downLaSelect.area === '' || this.downLaSelect.label === '') {
// this.transBefore = {} console.log(this.downLaSelect.area, 'this.downLaSelect.area')
brrtf.tableExplain = res.data.data.tableExplain let brrtf = {}
brrtf.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() }) // this.transBefore = {}
brrtf.termsName = res.data.data.termsName brrtf.tableExplain = res.data.data.tableExplain
brrtf.termsExplain = res.data.data.termsExplain brrtf.timeArr = res.data.data.timeArr.map((item, index) => { return item.toString() })
brrtf.areaName = res.data.data.areaName brrtf.termsName = res.data.data.termsName
if (this.$route.query.type === 'area') { brrtf.termsExplain = res.data.data.termsExplain
console.log('走这里') brrtf.areaName = res.data.data.areaName
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData[0] if (this.$route.query.type === 'area') {
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData 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 { } else {
brrtf.transBeforeAreaData = res.data.data.transBeforeAreaData this.transBefore = {}
brrtf.transBeforeTermsData = res.data.data.transBeforeTermsData[0] 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))
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 { } else {
this.transBefore = {} this.transBefore = {}
this.transBefore.tableExplain = res.data.data.tableExplain this.transBefore.tableExplain = res.data.data.tableExplain
@@ -1089,50 +1154,32 @@ export default {
this.$store.state.transBefore = this.transBefore this.$store.state.transBefore = this.transBefore
// 全局永久不变数据 // 全局永久不变数据
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore)) this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
// 告诉父组件我完成任务重置状态 // 告诉父组件我完成任务重置状态
this.$emit('prentsState', false) this.$emit('prentsState', false)
} }
this.hangZhiState = true
this.$emit('update:loading', false)
} else { } else {
this.transBefore = {} this.transBefore = null
this.transBefore.tableExplain = res.data.data.tableExplain // this.$store.state.transdtr = null
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.transBefore = null
// 全局永久不变数据 this.$store.state.noChangeData = null
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore)) // 调用父组件的comTime方法告诉父组件重置状态
// 告诉父组件我完成任务重置状态 this.$parent.comTime({ name: '', extendData: '', active: true })
this.$emit('prentsState', false) this.$store.state.noDataState = false
this.$emit('update:loading', false)
} }
this.hangZhiState = true if (this.$route.query.type !== 'area') {
this.$emit('update:loading', false) this.$store.state.SelecttDimension.col = 'zb'
} else { this.$store.state.SelecttDimension.row = 'sj'
this.transBefore = null }
// this.$store.state.transdtr = null this.leftState = true
// 全局总数据 this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.transBefore))
this.$store.state.transBefore = null }).catch((fail) => {
this.$store.state.noChangeData = null console.log(fail, 2369)
// 调用父组件的comTime方法告诉父组件重置状态 })
this.$parent.comTime({ name: '', extendData: '', active: true }) }
this.$store.state.noDataState = false
this.$emit('update:loading', false)
}
if (this.$route.query.type !== 'area') {
this.$store.state.SelecttDimension.col = 'zb'
this.$store.state.SelecttDimension.row = 'sj'
}
this.leftState = true
this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(this.transBefore))
}).catch((fail) => {
console.log(fail, 2369)
})
} else { } else {
this.transBefore = this.$store.state.transBefore this.transBefore = this.$store.state.transBefore
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore)) this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
@@ -1201,6 +1248,11 @@ export default {
} }
}, },
computed: { computed: {
// 计算表说明字符串
computedTableExplain() {
this.transBefore.tableExplain ? this.transBefore.tableExplain = this.transBefore.tableExplain : this.transBefore.tableExplain = ''
return this.transBefore.tableExplain.replace(/\\n/gm, "<br/>")
},
// 行计算样式 // 行计算样式
computedLineSty() { computedLineSty() {
return (ind) => { return (ind) => {
@@ -1288,6 +1340,9 @@ export default {
// 转置状态 // 转置状态
this.transState = this.chartsStatusMegger.transState this.transState = this.chartsStatusMegger.transState
this.leftState = false this.leftState = false
if (this.$route.query.defaultLeftId !== 'default') {
this.$store.state.defaultShowDataState = false
}
} }
} }
</script> </script>
@@ -1300,22 +1355,19 @@ export default {
} }
.chartsCont { .chartsCont {
margin: 1.5rem 0; margin: 1.5rem 0;
// border: 0.0625rem solid red;
padding: 0 1.5rem; padding: 0 1.5rem;
& > .tableExplain { & > .tableExplain {
padding: 0.75rem; padding: 0.75rem;
margin: 1.75rem auto; margin: 1.75rem auto;
// width: 53.375rem;
height: 18rem; height: 18rem;
border: 0.0625rem solid rgba(172, 172, 172, 0.38); border: 0.0625rem solid rgba(172, 172, 172, 0.38);
border-radius: 0.5rem; border-radius: 0.5rem;
box-shadow: 0rem 0.1875rem 1rem 0rem rgba(172, 172, 172, 0.38); box-shadow: 0rem 0.1875rem 1rem 0rem rgba(172, 172, 172, 0.38);
// line-height: 1.8rem;
overflow-y: scroll; overflow-y: scroll;
font-size: 1rem; font-size: 1.2rem;
font-weight: normal; font-weight: normal;
font-stretch: normal; font-stretch: normal;
line-height: 1.5rem; line-height: 2rem;
letter-spacing: 0.125rem; letter-spacing: 0.125rem;
color: #333333; color: #333333;
} }

View File

@@ -203,7 +203,9 @@ export default {
value: '', value: '',
label: '' label: ''
} }
] ],
// 默认数据显示状态
defaultStateShowData: true
} }
}, },
watch: { watch: {
@@ -214,9 +216,9 @@ export default {
if (val) { if (val) {
// 初始化公共数据 // 初始化公共数据
if (this.$route.query.type !== 'area') { if (this.$route.query.type !== 'area') {
this.searchSelect(this.$route.query.type) this.searchSelect(this.$route.query.type, null)
} else { } else {
this.searchSelect(val.f) this.searchSelect(val.f, null)
} }
} }
}, },
@@ -309,7 +311,7 @@ export default {
// 改变选中值索引 // 改变选中值索引
if (this.$store.state.selectData !== undefined) { if (this.$store.state.selectData !== undefined) {
console.log(this.$store.state.selectData, '被选中的值') console.log(this.$store.state.selectData, '被选中的值')
console.log(resu[2], '被选中的值2') console.log(resu[2], '被选中的值2000')
this.$store.state.selectData = resu[2].indexID this.$store.state.selectData = resu[2].indexID
this.showInputStu = false this.showInputStu = false
@@ -330,7 +332,7 @@ export default {
this.stateRTY = false this.stateRTY = false
}, },
// 查询下拉筛选条件 // 查询下拉筛选条件
searchSelect (type) { searchSelect (type, defaultDataSelect) {
this.$axios({ this.$axios({
method: 'GET', method: 'GET',
url: 'data/data/quick', url: 'data/data/quick',
@@ -344,9 +346,9 @@ export default {
this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => { this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => {
return { name: Object.values(res.data.data.list)[index], extendData: item } return { name: Object.values(res.data.data.list)[index], extendData: item }
}) })
// 默认选中第一个 // 默认选最后一个
this.cityDefaultNameTime = { name: this.cityDataTime[0].name, activeIndex: 0 } this.cityDefaultNameTime = { name: this.cityDataTime[this.cityDataTime.length - 1].name, activeIndex: this.cityDataTime.length - 1 }
this.$store.state.selectData = this.cityDataTime[0].extendData this.$store.state.selectData = this.cityDataTime[this.cityDataTime.length - 1].extendData
// 告诉父组件我获取到了 // 告诉父组件我获取到了
this.$emit('stateTell', true) this.$emit('stateTell', true)
if (!this.$route.query.type !== 'area') { if (!this.$route.query.type !== 'area') {
@@ -381,7 +383,11 @@ export default {
value: '序列', value: '序列',
label: '序列' label: '序列'
}) })
this.value = [this.options[1].value] if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState) {
this.value = [this.$store.state.newSelectLabelArea.sequenceCont]
} else {
this.value = [this.options[1].value]
}
console.log(this.value, 'this.options') console.log(this.value, 'this.options')
// 告诉父组件已经完成任务 // 告诉父组件已经完成任务
this.$emit('stateDFGHJ', true) this.$emit('stateDFGHJ', true)
@@ -397,7 +403,11 @@ export default {
value: '序列', value: '序列',
label: '序列' label: '序列'
}) })
this.value = [this.options[1].value] if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState) {
this.value = [this.$store.state.newSelectLabelArea.sequenceCont]
} else {
this.value = [this.options[1].value]
}
console.log(this.value, 'this.options') console.log(this.value, 'this.options')
// 告诉父组件已经完成任务 // 告诉父组件已经完成任务
this.$emit('stateDFGHJ', true) this.$emit('stateDFGHJ', true)
@@ -418,7 +428,12 @@ export default {
value: '序列', value: '序列',
label: '序列' label: '序列'
}) })
this.value = [this.options[1].value] console.log(this.$store.state.defaultShowDataState, 'this.$store.state.defaultShowDataState1')
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState) {
this.value = [this.$store.state.newSelectLabelArea.sequenceCont]
} else {
this.value = [this.options[1].value]
}
console.log(this.value, 'this.options') console.log(this.value, 'this.options')
// 告诉父组件已经完成任务 // 告诉父组件已经完成任务
this.$emit('stateDFGHJ', true) this.$emit('stateDFGHJ', true)
@@ -434,7 +449,12 @@ export default {
value: '序列', value: '序列',
label: '序列' label: '序列'
}) })
this.value = [this.options[1].value] console.log(this.$store.state.defaultShowDataState, 'this.$store.state.defaultShowDataState2')
if (this.$route.query.defaultLeftId === 'default' && this.$store.state.defaultShowDataState) {
this.value = [this.$store.state.newSelectLabelArea.sequenceCont]
} else {
this.value = [this.options[1].value]
}
console.log(this.value, 'this.options') console.log(this.value, 'this.options')
// 告诉父组件已经完成任务 // 告诉父组件已经完成任务
this.$emit('stateDFGHJ', true) this.$emit('stateDFGHJ', true)
@@ -443,6 +463,10 @@ export default {
} }
} }
} }
this.$store.state.newSelectLabelArea = {
sequenceCont: this.value[0],
sequenceState: this.stateChangeSDF ? 1 : 2// 1筛选指标 2筛选地区
}
}, },
// 聚焦显示提示的搜索框 // 聚焦显示提示的搜索框
focusShow () { focusShow () {
@@ -656,8 +680,13 @@ export default {
} else if (this.$store.state.SelecttDimension.row === 'sj' && 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' this.$store.state.SelecttDimension.col = 'dq'
} }
this.$store.state.defaultShowDataState = false
this.showLabelArea() this.showLabelArea()
} else { } else {
this.$store.state.newSelectLabelArea = {
sequenceCont: value[0],
sequenceState: this.stateChangeSDF ? 1 : 2// 1筛选指标 2筛选地区
}
this.$emit('statertfResu', value[0]) this.$emit('statertfResu', value[0])
} }
}, },
@@ -681,6 +710,10 @@ export default {
console.log(this.$store.state.selectData, '被选中的值') console.log(this.$store.state.selectData, '被选中的值')
console.log(res, '被选中的值2') console.log(res, '被选中的值2')
this.$store.state.selectData = res.extendData this.$store.state.selectData = res.extendData
this.$store.state.newSelectTime = {
name: res.name,
value: res.extendData
}
this.$emit('comTime', res) this.$emit('comTime', res)
} }
}, },

View File

@@ -218,6 +218,7 @@ export default {
}) })
this.$store.state.befaultAfter = 'wdzh' this.$store.state.befaultAfter = 'wdzh'
} }
this.$store.state.yesNoClickChange = true
}).catch((fail) => { }).catch((fail) => {
console.log(fail, 2369) console.log(fail, 2369)
}) })

View File

@@ -225,55 +225,264 @@ export default {
} }
} }
} else { } else {
if (!this.$store.state.selectLabelHang) { if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => { if (!this.$store.state.selectLabelHang) {
return { this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
text: item, return {
state: true, text: item,
id: index state: true,
} id: index
}) }
} else { })
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => { } else {
let state = true this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
if (this.$store.state.selectLabelHang.indexOf(index) === -1) { let state = true
state = false if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
} else { state = false
state = true } else {
} state = true
console.log(state, 'state') }
return { console.log(state, 'state')
text: item, return {
state: state, text: item,
id: index 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 (newVal === 'lie') { } else if (newVal === 'lie') {
if (!this.$store.state.selectLabelLie) { // 行列新增渲染
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => { if (this.$route.query.type === 'area') {
return { if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
text: item, if (!this.$store.state.selectLabelHang) {
state: true, this.datalist = this.$store.state.noChangeData.areaName.map((item, index) => {
id: index return {
} text: item,
}) state: true,
} else { id: index
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => { }
let state = true })
if (this.$store.state.selectLabelLie.indexOf(index) === -1) {
state = false
} else { } else {
state = true 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
}
})
} }
console.log(state, 'state') } else if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'dq') {
return { if (!this.$store.state.selectLabelHang) {
text: item, this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
state: state, return {
id: index 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 === 'sj') {
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 === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
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 === 'dq' && this.$store.state.SelecttDimension.col === 'zb') {
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 === 'zb' && this.$store.state.SelecttDimension.col === 'dq') {
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 === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
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 === 'sj') {
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
}
})
}
}
} }
} }
} }
@@ -487,6 +696,7 @@ export default {
}) })
} }
} else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') { } else if (this.$store.state.SelecttDimension.row === 'dq' && this.$store.state.SelecttDimension.col === 'sj') {
console.log('编辑!')
if (!this.$store.state.selectLabelHang) { if (!this.$store.state.selectLabelHang) {
this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => { this.datalist = this.$store.state.noChangeData.timeArr.map((item, index) => {
return { return {
@@ -613,29 +823,56 @@ export default {
} }
} }
} else { } else {
if (!this.$store.state.selectLabelHang) { if (this.$store.state.SelecttDimension.row === 'sj' && this.$store.state.SelecttDimension.col === 'zb') {
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => { if (!this.$store.state.selectLabelHang) {
return { this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
text: item, return {
state: true, text: item,
id: index state: true,
} id: index
}) }
} else { })
this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => { } else {
let state = true this.datalist = this.$store.state.noChangeData.termsName.map((item, index) => {
if (this.$store.state.selectLabelHang.indexOf(index) === -1) { let state = true
state = false if (this.$store.state.selectLabelHang.indexOf(index) === -1) {
} else { state = false
state = true } else {
} state = true
console.log(state, 'state') }
return { console.log(state, 'state')
text: item, return {
state: state, text: item,
id: index 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
}
})
}
} }
} }
// console.log(this.datalist, 'this.dataList') // console.log(this.datalist, 'this.dataList')

View File

@@ -12,7 +12,6 @@
<div class="row_main"> <div class="row_main">
<div :class="{active:colVal==='指标'}" @click="changeTabel('指标','col')">指标</div> <div :class="{active:colVal==='指标'}" @click="changeTabel('指标','col')">指标</div>
<div :class="{active:colVal==='时间'}" @click="changeTabel('时间','col')">时间</div> <div :class="{active:colVal==='时间'}" @click="changeTabel('时间','col')">时间</div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
@@ -79,20 +78,25 @@ export default {
// 维度转换默认 // 维度转换默认
change3D () { change3D () {
if (this.$store.state.transState) { if (this.$store.state.transState) {
if (this.$route.query.type !== 'area') { console.log(this.$store.state.SelecttDimension, 'this.$store.state.SelecttDimension')
if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'sj') {
this.rowVal = '指标' this.rowVal = '指标'
this.colVal = '时间' this.colVal = '时间'
} else { } else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'zb') {
this.rowVal = '地区'
this.colVal = '时间'
}
} else {
if (this.$route.query.type !== 'area') {
this.rowVal = '时间' this.rowVal = '时间'
this.colVal = '指标' this.colVal = '指标'
} else { } else if (this.$store.state.SelecttDimension.col === 'dq' && this.$store.state.SelecttDimension.row === 'sj') {
this.rowVal = '地区'
this.colVal = '时间'
} else if (this.$store.state.SelecttDimension.col === 'sj' && this.$store.state.SelecttDimension.row === 'dq') {
this.rowVal = '时间' this.rowVal = '时间'
this.colVal = '地区' this.colVal = '地区'
} else if (this.$store.state.SelecttDimension.col === 'dq' && this.$store.state.SelecttDimension.row === 'zb') {
this.rowVal = '地区'
this.colVal = '指标'
} else if (this.$store.state.SelecttDimension.col === 'zb' && this.$store.state.SelecttDimension.row === 'dq') {
this.rowVal = '指标'
this.colVal = '地区'
} }
} }
}, },
@@ -108,13 +112,14 @@ export default {
} else { } else {
// 告诉父组件转置 // 告诉父组件转置
this.$emit('changeSetZZ', true) this.$emit('changeSetZZ', true)
this.$store.state.SelecttDimension.col = this.arrValue[this.rowVal] // this.$store.state.SelecttDimension.col = this.arrValue[this.rowVal]
this.$store.state.SelecttDimension.row = this.arrValue[this.colVal] // this.$store.state.SelecttDimension.row = this.arrValue[this.colVal]
this.$store.state.noAreadimensionState = false this.$store.state.noAreadimensionState = false
} }
} }
}, },
mounted () { mounted () {
console.log('我只醒了')
this.change3D() this.change3D()
} }
} }

View File

@@ -111,7 +111,22 @@ export default new Vuex.Store({
// 初始化请求的所有数据(全局不变) // 初始化请求的所有数据(全局不变)
allNochangeInitData: null, allNochangeInitData: null,
// 转置状态和维度转换状态先后(默认先点击维度转换)wdzh zz // 转置状态和维度转换状态先后(默认先点击维度转换)wdzh zz
befaultAfter: 'no' befaultAfter: 'no',
// =======>保存默认用
// 当前选中的时间 object
newSelectTime: null,
// 当前选中的指标或者地区
newSelectLabelArea: null,
// 默认数据所需查询的数据
defaultDataId: '',
// 默认显示时间状态(本地显示或线上显示)===>defaultLocal defaultOnLine
defaultShowTimeState: 'defaultOnLine',
// 默认显示地区或指标状态(本地显示或线上显示)===>defaultLocal defaultOnLine
defaultShowLabelAreaState: 'defaultOnLine',
// 默认数据显示状态 true显示 false不显示
defaultShowDataState: true,
// 是否点击维度转换的确定按钮
yesNoClickChange: false
}, },
mutations: {}, mutations: {},

View File

@@ -111,10 +111,10 @@
:style="{'width':(left!=initValue?left>initValue?(25.375+computedNumberRem(left-initValue)):(25.375-computedNumberRem(initValue-left)):25.375)+'rem','height':'100%'}" :style="{'width':(left!=initValue?left>initValue?(25.375+computedNumberRem(left-initValue)):(25.375-computedNumberRem(initValue-left)):25.375)+'rem','height':'100%'}"
> >
<!-- 左侧导航 --> <!-- 左侧导航 -->
<el-row class="tac" v-if="defaultSelectLies"> <el-row class="tac" v-if="leftCateData">
<el-col :span="24"> <el-col :span="24">
<el-menu <el-menu
:default-openeds="$store.state.advancedSearchState?[]:defaultSelectLies" :default-openeds="defaultSelectLies"
@open="handleOpen" @open="handleOpen"
@close="handleClose" @close="handleClose"
@select="selectActive" @select="selectActive"
@@ -124,35 +124,35 @@
:index="''+index1" :index="''+index1"
v-for="(item1,index1) in leftCateData" v-for="(item1,index1) in leftCateData"
:key="index1" :key="index1"
:style="{'background-color':$store.state.selectDataLeft.id===item1.id?'#95CEE4':''}" :style="{'background-color':$store.state.selectDataLeft?$store.state.selectDataLeft.id===item1.id?'#95CEE4':'':''}"
> >
<template slot="title">{{item1.name}}</template> <template slot="title">{{item1.name}}</template>
<el-submenu <el-submenu
:index="index1+'-'+index2" :index="index1+'-'+index2"
v-for="(item2,index2) in item1.children" v-for="(item2,index2) in item1.children"
:key="index2" :key="index2"
:style="{'background-color':$store.state.selectDataLeft.id===item2.id?'#95CEE4':''}" :style="{'background-color':$store.state.selectDataLeft?$store.state.selectDataLeft.id===item2.id?'#95CEE4':'':''}"
> >
<template slot="title">{{item2.name}}</template> <template slot="title">{{item2.name}}</template>
<el-submenu <el-submenu
:index="index1+'-'+index2+'-'+index3" :index="index1+'-'+index2+'-'+index3"
v-for="(item3,index3) in item2.children" v-for="(item3,index3) in item2.children"
:key="index3" :key="index3"
:style="{'background-color':$store.state.selectDataLeft.id===item3.id?'#95CEE4':''}" :style="{'background-color':$store.state.selectDataLeft?$store.state.selectDataLeft.id===item3.id?'#95CEE4':'':''}"
> >
<template slot="title">{{item3.name}}</template> <template slot="title">{{item3.name}}</template>
<el-submenu <el-submenu
:index="index1+'-'+index2+'-'+index3+'-'+index4" :index="index1+'-'+index2+'-'+index3+'-'+index4"
v-for="(item4,index4) in item3.children" v-for="(item4,index4) in item3.children"
:key="index4" :key="index4"
:style="{'background-color':$store.state.selectDataLeft.id===item4.id?'#95CEE4':''}" :style="{'background-color':$store.state.selectDataLeft?$store.state.selectDataLeft.id===item4.id?'#95CEE4':'':''}"
> >
<template slot="title">{{item4.name}}</template> <template slot="title">{{item4.name}}</template>
<el-submenu <el-submenu
:index="index1+'-'+index2+'-'+index3+'-'+index4+'-'+index5" :index="index1+'-'+index2+'-'+index3+'-'+index4+'-'+index5"
v-for="(item5,index5) in item4.children" v-for="(item5,index5) in item4.children"
:key="index5" :key="index5"
:style="{'background-color':$store.state.selectDataLeft.id===item5.id?'#95CEE4':''}" :style="{'background-color':$store.state.selectDataLeft?$store.state.selectDataLeft.id===item5.id?'#95CEE4':'':''}"
> >
<template slot="title">{{item5.name}}</template> <template slot="title">{{item5.name}}</template>
</el-submenu> </el-submenu>
@@ -207,7 +207,6 @@
@prentsState="prentsState" @prentsState="prentsState"
:downLaSelects="downLaSelect" :downLaSelects="downLaSelect"
@stateDataGet="stateDataGet" @stateDataGet="stateDataGet"
:downLaSelectArea="downLaSelectArea"
:showTableState="showTableState" :showTableState="showTableState"
@statertyui="statertyui" @statertyui="statertyui"
:areaDimensionStateS="areaDimensionStateS" :areaDimensionStateS="areaDimensionStateS"
@@ -334,7 +333,7 @@ export default {
return { return {
loading: true, loading: true,
// 左侧当前默认 // 左侧当前默认
defaultSelectLies: null, defaultSelectLies: [],
// 右侧默认显示数据 // 右侧默认显示数据
defaultDataRight: null, defaultDataRight: null,
// 菜单配置 // 菜单配置
@@ -542,6 +541,7 @@ export default {
this.defaultDataRight = datart this.defaultDataRight = datart
this.$store.state.selectDataLeft = this.defaultDataRight this.$store.state.selectDataLeft = this.defaultDataRight
this.$store.state.selectfilter = this.defaultDataRight.f this.$store.state.selectfilter = this.defaultDataRight.f
this.$store.state.yesNoClickChange = false
}, },
handleClose (key, keyPath) { handleClose (key, keyPath) {
console.log(key, keyPath, '关闭打印') console.log(key, keyPath, '关闭打印')
@@ -900,25 +900,92 @@ export default {
this.cutStatic(0) this.cutStatic(0)
// 获取本地保存数据 // 获取本地保存数据
if (this.$store.state.transBefore) { if (this.$store.state.transBefore) {
if (JSON.parse(sessionStorage.getItem('classFiyData'))) { if (this.$route.query.type !== 'area') { // 非地区数据
let arrtsBGY = JSON.parse(sessionStorage.getItem('classFiyData')) if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
console.log(this.defaultDataRight.id, 'this.defaultDataRight.id') let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.id === this.defaultDataRight.id)) { if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
arrtsBGY.push({ arrtsBGY.push({
id: this.defaultDataRight.id, type: this.$route.query.type,
data: this.$store.state.transBefore allNochangeInitData: this.$store.state.allNochangeInitData,
}) transBefore: this.$store.state.transBefore,
sessionStorage.setItem('classFiyData', JSON.stringify(arrtsBGY)) selectDate: {
} else { time: this.$store.state.newSelectTime
console.log('走这里') },
arrtsBGY.find(item => item.id === this.defaultDataRight.id).data = this.$store.state.transBefore selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
sessionStorage.setItem('classFiyData', JSON.stringify(arrtsBGY)) SelecttDimension: this.$store.state.SelecttDimension// 左侧选中
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = this.$store.state.transBefore
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = this.$store.state.allNochangeInitData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
}
} else { // 本地不存在
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$store.state.selectDataLeft.f,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension
}]))
}
} else { // 地区数据
if (JSON.parse(localStorage.getItem('classFiyData'))) { // 本地存在
let arrtsBGY = JSON.parse(localStorage.getItem('classFiyData'))
if (!arrtsBGY.find(item => item.type === this.$route.query.type)) {
arrtsBGY.push({
type: this.$route.query.type,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.newSelectLabelArea
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension,
yesNoClickChange: this.$store.state.yesNoClickChange// 维度转换是否被点击
})
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
} else {
console.log('走这里')
arrtsBGY.find(item => item.type === this.$route.query.type).transBefore = this.$store.state.transBefore
arrtsBGY.find(item => item.type === this.$route.query.type).allNochangeInitData = this.$store.state.allNochangeInitData
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate = {
time: this.$store.state.newSelectTime
}
arrtsBGY.find(item => item.type === this.$route.query.type).selectDate.sequence = this.$store.state.newSelectLabelArea
arrtsBGY.find(item => item.type === this.$route.query.type).selectDataLeft = this.$store.state.selectDataLeft
arrtsBGY.find(item => item.type === this.$route.query.type).SelecttDimension = this.$store.state.SelecttDimension
arrtsBGY.find(item => item.type === this.$route.query.type).yesNoClickChange = this.$store.state.yesNoClickChange
localStorage.setItem('classFiyData', JSON.stringify(arrtsBGY))
}
} else { // 本地不存在
localStorage.setItem('classFiyData', JSON.stringify([{
type: this.$route.query.type,
allNochangeInitData: this.$store.state.allNochangeInitData,
transBefore: this.$store.state.transBefore,
selectDate: {
time: this.$store.state.newSelectTime,
sequence: this.$store.state.newSelectLabelArea
// sequenceCont:,//序列选中内容
// sequenceState://序列状态 筛选指标 筛选地区
},
selectDataLeft: this.$store.state.selectDataLeft, // 左侧选中
SelecttDimension: this.$store.state.SelecttDimension, // 行列代表的是指标、地区、时间
yesNoClickChange: this.$store.state.yesNoClickChange// 维度转换是否被点击
}]))
} }
} else {
sessionStorage.setItem('classFiyData', JSON.stringify([{
id: this.defaultDataRight.id,
data: this.$store.state.transBefore
}]))
} }
this.$alert('默认数据已保存!', '温馨提示', { this.$alert('默认数据已保存!', '温馨提示', {
confirmButtonText: '确定' confirmButtonText: '确定'
@@ -1155,72 +1222,7 @@ export default {
console.log(this.$route.query.defaultLeftId, 'this.$router.query.defaultLeftId') console.log(this.$route.query.defaultLeftId, 'this.$router.query.defaultLeftId')
// 非高级查询 // 非高级查询
if (!this.$store.state.advancedSearchState) { if (!this.$store.state.advancedSearchState) {
if (this.$route.query.defaultLeftId === 'default') { // 从导航中点击 if (this.$route.query.defaultLeftId !== 'default') { // 从数据更新,快速
let stateStatic = []
this.leftCateData.forEach((item1, index1) => {
if (index1 === this.leftCateData.length - 1) {
stateStatic.push('' + index1)
if (item1.children) {
item1.children.forEach((item2, index2) => {
if (index2 === 0) {
stateStatic.push('' + index1 + '-' + index2)
if (item2.children) {
item2.children.forEach((item3, index3) => {
if (index3 === 0) {
stateStatic.push('' + index1 + '-' + index2 + '-' + index3)
if (item3.children) {
item3.children.forEach((item4, index4) => {
if (index4 === 0) {
stateStatic.push('' + index1 + '-' + index2 + '-' + index3 + '-' + index4)
if (item4.children) {
item4.children.forEach((item5, index5) => {
if (index5 === 0) {
stateStatic.push('' + index1 + '-' + index2 + '-' + index3 + '-' + index4 + '-' + index5)
}
})
}
}
})
}
}
})
}
}
})
}
}
})
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')
// 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) {
if (this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children !== undefined) {
if (this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children[0].children !== undefined) {
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children[0].children[0]
} else {
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0].children[0].children[0]
}
} else {
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0].children[0]
}
} else {
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0]
}
} else {
dataDome = this.leftCateData[this.leftCateData.length - 1]
}
this.defaultDataRight = dataDome
this.$store.state.selectDataLeft = this.defaultDataRight
console.log(this.defaultDataRight, '1250')
console.log(this.$store.state.selectDataLeft, '12500')
this.$store.state.selectfilter = this.defaultDataRight.f
} else { // 从数据更新,快速
this.defaultDataSelectDG() this.defaultDataSelectDG()
console.log(this.filterDataArr, '非导航左侧选中') console.log(this.filterDataArr, '非导航左侧选中')
console.log(this.filterDataArr.defaultCode, '代码') console.log(this.filterDataArr.defaultCode, '代码')
@@ -1229,10 +1231,53 @@ export default {
this.$store.state.selectDataLeft = this.filterDataArr.objectData this.$store.state.selectDataLeft = this.filterDataArr.objectData
this.defaultDataRight = this.filterDataArr.objectData this.defaultDataRight = this.filterDataArr.objectData
this.$store.state.selectfilter = this.filterDataArr.objectData.f this.$store.state.selectfilter = this.filterDataArr.objectData.f
} else {
// 处理默认显示数据
this.defaultShowData()
}
}
},
// 默认选中的数据
defaultShowData () {
// 调用子组件showSaveDefaultData方法显示默认数据
// this.$refs.childChartCont.showSaveDefaultData()
// 本地存在保存的数据
// 调用接口请求默认显示数据
let arrData = localStorage.getItem('classFiyData')
if (!arrData) {
return
}
if (JSON.parse(arrData).find(item => item.type === this.$route.query.type)) {
console.log(JSON.parse(arrData).find(item => item.type === this.$route.query.type))
// 调用子组件 searchSelect 方法渲染下拉
// 赋值数据
// console.log(JSON.parse(arrData).find(item => item.type === this.$route.query.type).transBefore, '赋值数据')
this.$refs.childChartsCut.searchSelect(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft.f, JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate)
this.$refs.childChartCont.getInfor(JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft.id)
this.$store.state.selectDataLeft = JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDataLeft
this.$store.state.SelecttDimension = JSON.parse(arrData).find(item => item.type === this.$route.query.type).SelecttDimension
if (this.$route.query.type === 'area') {
let changeDarat = JSON.parse(JSON.stringify(JSON.parse(arrData).find(item => item.type === this.$route.query.type).allNochangeInitData))
this.$store.state.transBefore = JSON.parse(JSON.stringify(changeDarat))
this.$store.state.noChangeData = JSON.parse(JSON.stringify(changeDarat))
this.$store.state.allNochangeInitData = JSON.parse(JSON.stringify(changeDarat))
this.$store.state.newSelectLabelArea = JSON.parse(arrData).find(item => item.type === this.$route.query.type).selectDate.sequence
} else {
this.$store.state.transBefore = JSON.parse(arrData).find(item => item.type === this.$route.query.type).allNochangeInitData
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.$store.state.transBefore))
this.$store.state.allNochangeInitData = JSON.parse(arrData).find(item => item.type === this.$route.query.type).allNochangeInitData
} }
} else { } else {
// this.defaultDataRight = [] this.$axios({
// this.defaultSelectLies = [] method: 'GET',
url: 'data/data/default',
params: {
type: this.$route.query.type
}
}).then(res => {
console.log(res, '默认展示id')
this.$store.state.defaultDataId = res.data.data
})
} }
}, },
comTime (res) { comTime (res) {
@@ -1276,6 +1321,8 @@ export default {
console.log(val, '1010110') console.log(val, '1010110')
this.downLaSelectArea = val this.downLaSelectArea = val
this.indStatic = 0 this.indStatic = 0
// 调用childChartCont组件方法获取数据
this.$refs.childChartCont.downLaSelectArea(this.downLaSelectArea)
}, },
// 重置清除空行空列状态 // 重置清除空行空列状态
statertyui (val) { statertyui (val) {
@@ -1307,6 +1354,7 @@ export default {
}, },
// 调用子组件的方法重置筛选数据 // 调用子组件的方法重置筛选数据
childChartsCutShow () { childChartsCutShow () {
console.log('kfa555')
this.$refs.childChartsCut.showLabelArea() this.$refs.childChartsCut.showLabelArea()
}, },
// 调用子组件的方法重置筛选数据 // 调用子组件的方法重置筛选数据