fanzhen1221
This commit is contained in:
@@ -371,6 +371,22 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-submenu__title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
flex-flow: row-reverse;
|
||||
// border: 1px solid red;
|
||||
padding: 0;
|
||||
}
|
||||
/deep/ .el-submenu__icon-arrow {
|
||||
position: static;
|
||||
margin-top: 0.25rem;
|
||||
margin-right: 0.42rem;
|
||||
// left: 0;
|
||||
// right: auto;
|
||||
}
|
||||
.advancedQuery {
|
||||
margin-top: 1.25rem;
|
||||
width: 100%;
|
||||
|
||||
@@ -573,6 +573,8 @@ export default {
|
||||
this.$store.state.transBefore = this.transBefore
|
||||
// 全局永久不变数据
|
||||
this.$store.state.noChangeData = JSON.parse(JSON.stringify(this.transBefore))
|
||||
} else {
|
||||
console.log('走else')
|
||||
}
|
||||
// } else {
|
||||
// console.log(this.defaultDataRight, '获取左侧选中数据555')
|
||||
@@ -1074,6 +1076,8 @@ export default {
|
||||
// 全局总数据
|
||||
this.$store.state.transBefore = null
|
||||
this.$store.state.noChangeData = null
|
||||
// 调用父组件的comTime方法告诉父组件重置状态
|
||||
this.$parent.comTime({ name: '', extendData: '', active: true })
|
||||
}
|
||||
if (this.$route.query.type !== 'area') {
|
||||
this.$store.state.SelecttDimension.col = 'zb'
|
||||
@@ -1129,6 +1133,14 @@ export default {
|
||||
}).catch((fail) => {
|
||||
console.log(fail)
|
||||
})
|
||||
},
|
||||
// 兄弟组件调用此方法实现查询数据重渲染
|
||||
brotherFuncShowData () {
|
||||
if (this.$store.state.advancedSearchState) {
|
||||
this.advancedSearchDataShow()
|
||||
} else {
|
||||
this.getDatas()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -34,17 +34,15 @@
|
||||
<div class="chart_right_time" v-if="cityDataTime">
|
||||
时间:
|
||||
<div class="chart_right_cont">
|
||||
<cityPicker
|
||||
:level="jishuTime"
|
||||
:selectpattern="selectpatternTime"
|
||||
:city-data="cityDataTime"
|
||||
:default-city="cityDefaultNameTime"
|
||||
@choice-caller="choiceCallerTime"
|
||||
@visible-change="changesInputStu"
|
||||
:isHideProp="isHideProp"
|
||||
@stateInfor="stateInfor"
|
||||
:stateRTY="stateRTY"
|
||||
></cityPicker>
|
||||
<PullDownComponents
|
||||
ref="childPullDownComponents"
|
||||
:pullDowmData="cityDataTime"
|
||||
:initDefaultSelect="cityDefaultNameTime"
|
||||
@callBackVal="callBackVal"
|
||||
@callBackValOpen="callBackValOpen"
|
||||
@callBackValClose="callBackValClose"
|
||||
v-if="cityDefaultNameTime"
|
||||
></PullDownComponents>
|
||||
<div class="bottom" v-if="showInputStu" @click.stop="showKuangCat">
|
||||
<input
|
||||
type="text"
|
||||
@@ -86,7 +84,7 @@
|
||||
</template>
|
||||
<script>
|
||||
// 引入下拉组件
|
||||
import cityPicker from '@/components/cityPicker/CityPicker.vue'
|
||||
import PullDownComponents from '@/components/pullDownComponents/PullDownComponents.vue'
|
||||
export default {
|
||||
name: 'chartsCut',
|
||||
props: {
|
||||
@@ -115,7 +113,7 @@ export default {
|
||||
}
|
||||
},
|
||||
components: {
|
||||
cityPicker: cityPicker
|
||||
PullDownComponents: PullDownComponents
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -153,14 +151,9 @@ export default {
|
||||
// 栏目级数
|
||||
jishuTime: 1,
|
||||
// 默认显示栏目
|
||||
cityDefaultNameTime: '最近1个月',
|
||||
cityDefaultNameTime: null,
|
||||
// 筛选数据
|
||||
selectpatternTime: [
|
||||
{
|
||||
field: 'userProvinceId',
|
||||
placeholder: '最近13个月'
|
||||
}
|
||||
],
|
||||
selectpatternTime: null,
|
||||
listImg: [
|
||||
{
|
||||
url: require('../../../static/chartsCut/list.png'),
|
||||
@@ -313,6 +306,7 @@ export default {
|
||||
// 改变选中值索引
|
||||
if (this.$store.state.selectData !== undefined) {
|
||||
console.log(this.$store.state.selectData, '被选中的值')
|
||||
console.log(resu[2], '被选中的值2')
|
||||
|
||||
this.$store.state.selectData = resu[2].indexID
|
||||
this.showInputStu = false
|
||||
@@ -346,12 +340,18 @@ export default {
|
||||
if (res.data.code === 200) {
|
||||
// console.log(Object.keys(res.data.data.list))
|
||||
// console.log(Object.values(res.data.data.list))
|
||||
// this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => {
|
||||
// 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
|
||||
this.cityDataTime = Object.keys(res.data.data.list).map((item, index) => {
|
||||
return { 'id': '110000', 'name': Object.values(res.data.data.list)[index], 'parentId': '100000', 'shortName': '北京', 'cityCode': '', indexID: item }
|
||||
return { name: Object.values(res.data.data.list)[index], extendData: item }
|
||||
})
|
||||
// 默认选中第一个
|
||||
this.cityDefaultNameTime = this.cityDataTime[0].name
|
||||
this.$store.state.selectData = this.cityDataTime[0].indexID
|
||||
this.cityDefaultNameTime = { name: this.cityDataTime[0].name, activeIndex: 0 }
|
||||
this.$store.state.selectData = this.cityDataTime[0].extendData
|
||||
// console.log(this.$store.state.selectData, 'this.cityDataTime[0].indexID')
|
||||
// 告诉父组件我获取到了
|
||||
this.$emit('stateTell', true)
|
||||
@@ -426,6 +426,11 @@ export default {
|
||||
alert('您查询的时间格式有误,请重新输入!')
|
||||
} else {
|
||||
this.$store.state.selectData = this.timeUsrr
|
||||
console.log(this.$store.state.selectData, '时间')
|
||||
// 调用父组件(Dataweb)中的changeBrother方法来调用ChartCont组件中的brotherFuncShowData方法
|
||||
this.$parent.changeBrother()
|
||||
this.timeUsrr = ''
|
||||
this.childFuncChangeDown()
|
||||
}
|
||||
} else {
|
||||
alert('您查询的时间格式有误,请重新输入!111')
|
||||
@@ -435,13 +440,25 @@ export default {
|
||||
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
|
||||
this.$parent.changeBrother()
|
||||
this.timeUsrr = ''
|
||||
this.childFuncChangeDown()
|
||||
} else {
|
||||
alert('您查询的时间格式有误,请重新输入!111')
|
||||
}
|
||||
break
|
||||
case 'year':
|
||||
if (this.timeUsrr.length < 5 && /^[0-9]+$/.test(this.timeUsrr.substring(0, 4))) {
|
||||
this.$store.state.selectData = this.timeUsrr
|
||||
this.$parent.changeBrother()
|
||||
this.timeUsrr = ''
|
||||
this.childFuncChangeDown()
|
||||
} else {
|
||||
alert('您查询的时间格式有误,请重新输入!111')
|
||||
}
|
||||
break
|
||||
case 'area':
|
||||
|
||||
break
|
||||
}
|
||||
} else {
|
||||
@@ -453,6 +470,33 @@ export default {
|
||||
console.log(value)
|
||||
console.log(this.value, 'this.value')
|
||||
this.$emit('statertfResu', value[0])
|
||||
},
|
||||
// 调用子组件方法改变下拉框的显示隐藏
|
||||
childFuncChangeDown () {
|
||||
let dataNer = JSON.parse(JSON.stringify(this.cityDataTime))
|
||||
dataNer[3] = { name: this.$store.state.selectData, extendData: this.$store.state.selectData }
|
||||
this.cityDataTime = dataNer
|
||||
console.log(this.cityDataTime, 'this.cityDataTime')
|
||||
// 默认选中最后一个
|
||||
this.cityDefaultNameTime = { name: this.cityDataTime[3].name, activeIndex: 3 }
|
||||
this.$store.state.selectData = this.cityDataTime[3].extendData
|
||||
},
|
||||
// 当前选中的时间列表
|
||||
callBackVal (res) {
|
||||
if (this.$store.state.selectData !== undefined) {
|
||||
console.log(this.$store.state.selectData, '被选中的值')
|
||||
console.log(res, '被选中的值2')
|
||||
this.$store.state.selectData = res.extendData
|
||||
this.$emit('comTime', res)
|
||||
}
|
||||
},
|
||||
callBackValOpen (res) { // 展开回调
|
||||
console.log(res, '展开')
|
||||
this.changesInputStu()
|
||||
},
|
||||
callBackValClose (res) { // 关闭回调
|
||||
console.log(res, '展开')
|
||||
this.changesInputStu()
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -44,16 +44,6 @@ export default {
|
||||
isDisabled: false,
|
||||
filterDatas: [],
|
||||
values: []
|
||||
}, {
|
||||
isHide: true,
|
||||
isDisabled: true,
|
||||
filterDatas: [],
|
||||
values: []
|
||||
}, {
|
||||
isHide: true,
|
||||
isDisabled: true,
|
||||
filterDatas: [],
|
||||
values: []
|
||||
}
|
||||
],
|
||||
removalCityArray: [],
|
||||
@@ -74,12 +64,6 @@ export default {
|
||||
{
|
||||
field: 'userProvinceId',
|
||||
placeholder: '请选择省份'
|
||||
}, {
|
||||
field: 'userCityId',
|
||||
placeholder: '请选择城市'
|
||||
}, {
|
||||
field: 'userDistrictId',
|
||||
placeholder: '请选择区县'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -116,7 +100,7 @@ export default {
|
||||
watch: {
|
||||
cityData: {
|
||||
handler: function (newVal, oldVal) {
|
||||
// console.log(newVal, '5555555555')
|
||||
console.log(newVal, '5555555555')
|
||||
this.initDatakf()
|
||||
},
|
||||
immediate: true,
|
||||
@@ -137,6 +121,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
toggleList(index) {
|
||||
console.log(this.cityData,'kkkIndex')
|
||||
// 设置列表显示/隐藏
|
||||
this.$set(this.inlay[index], 'isHide', !this.inlay[index].isHide)
|
||||
// 下拉框显示/隐藏触发的回调
|
||||
@@ -213,6 +198,8 @@ export default {
|
||||
return this.storage ? this.inlay[index].values[1] : this.inlay[index].values[0]
|
||||
},
|
||||
choice(city, index) {
|
||||
console.log(city,'city')
|
||||
console.log(index,'index')
|
||||
const inlay = this.inlay[index]
|
||||
// 显示的城市名称是全称还是简写
|
||||
const name = this.shortName ? city.shortName : city.name
|
||||
@@ -399,7 +386,7 @@ export default {
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 2px #f3f3f3;
|
||||
max-height: 150px;
|
||||
max-height: 104px;//默认150
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
text-align: left;
|
||||
|
||||
@@ -393,6 +393,22 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-submenu__title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
flex-flow: row-reverse;
|
||||
// border: 1px solid red;
|
||||
padding: 0;
|
||||
}
|
||||
/deep/ .el-submenu__icon-arrow {
|
||||
position: static;
|
||||
margin-top: 0.25rem;
|
||||
margin-right: 0.42rem;
|
||||
// left: 0;
|
||||
// right: auto;
|
||||
}
|
||||
.bgcolor {
|
||||
background-color: #95cee4;
|
||||
color: #fff;
|
||||
|
||||
@@ -232,7 +232,8 @@ export default {
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: staData
|
||||
type: staData,
|
||||
defaultLeftId: 'default'
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -245,7 +246,8 @@ export default {
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: staData
|
||||
type: staData,
|
||||
defaultLeftId: 'default'
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
284
src/components/pullDownComponents/PullDownComponents.vue
Normal file
284
src/components/pullDownComponents/PullDownComponents.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<div class="city-picker">
|
||||
<div :class="['city-picker-item', { hide: pullDownlistShowState }]">
|
||||
<!--hide显示隐藏下拉列表 false显示 true隐藏-->
|
||||
<input
|
||||
type="text"
|
||||
:placeholder="defaultData.name"
|
||||
:value="defaultData.name"
|
||||
readonly
|
||||
unselectable="on"
|
||||
@click.stop="showList"
|
||||
/>
|
||||
<input type="hidden" name="hidden" value="hidden" />
|
||||
<ul class="city-picker-list">
|
||||
<li
|
||||
v-for="(item,index) in showData"
|
||||
:key="index"
|
||||
:class="['caller', {active: item.active}]"
|
||||
@click="selectListData(index)"
|
||||
>{{item.name}}</li>
|
||||
<!--active当前选中 true选中 false不选中-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'pullDownComponents',
|
||||
// 传入参数介绍
|
||||
props: {
|
||||
// 下拉列表所有需要显示的数据
|
||||
pullDowmData: {
|
||||
type: Array, // 数组对象格式[{name:'名字1',extendData:'扩展数据可以是任意格式'}]
|
||||
required: true
|
||||
},
|
||||
// 初始化数据时,默认选中的数据
|
||||
initDefaultSelect: {
|
||||
type: Object, // 对象数据格式{name:'默认选中姓名',activeIndex:0} index为默认选中的下标
|
||||
required: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
initDefaultSelect: {
|
||||
handler: function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.defaultData = newVal
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
},
|
||||
pullDowmData: {
|
||||
handler: function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.showData = newVal.map((item, index) => {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
name: item.name, extendData: item.extendData, active: this.defaultData.activeIndex === index ? true : false
|
||||
}
|
||||
})
|
||||
// 将选中的值回调给父组件
|
||||
this.$emit('callBackVal', this.showData[this.defaultData.activeIndex])
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
},
|
||||
// 展开关闭
|
||||
pullDownlistShowState(valNew, oldVal) {
|
||||
if (valNew) {//false开true关
|
||||
// 关闭回调
|
||||
this.$emit('callBackValClose', false)
|
||||
} else {
|
||||
// 展开回调
|
||||
this.$emit('callBackValOpen', true)
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 展示数据
|
||||
showData: [
|
||||
{ name: '名字1', extendData: '扩展数据可以是任意格式', active: true },
|
||||
{ name: '名字2', extendData: '扩展数据可以是任意格式', active: false }
|
||||
],
|
||||
// 默认显示选中数据
|
||||
defaultData: {
|
||||
name: '',
|
||||
activeIndex: 0
|
||||
},
|
||||
// 下拉列表显示状态 true不显示 false显示
|
||||
pullDownlistShowState: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 点击展开隐藏列表
|
||||
showList() {
|
||||
this.pullDownlistShowState = !this.pullDownlistShowState
|
||||
},
|
||||
// 选中列表中的某一个
|
||||
selectListData(activeIndex) {
|
||||
this.showData.forEach((item, index) => {
|
||||
/* eslint-disable */
|
||||
activeIndex === index ? (item.active = true, this.defaultData = { name: item.name, activeIndex: index }) : (item.active = false)
|
||||
})
|
||||
// 关闭下拉框
|
||||
this.pullDownlistShowState = true
|
||||
// 将选中的值回调给父组件
|
||||
this.$emit('callBackVal',this.showData[activeIndex])
|
||||
},
|
||||
// 改变窗口状态
|
||||
changeWinState() {
|
||||
this.pullDownlistShowState = true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
// 点击其他地方关闭窗口
|
||||
document.addEventListener('click', function (e) {
|
||||
/* eslint-disable */
|
||||
console.log(that, '12569')
|
||||
if (e.target.className !== 'city-picker') {
|
||||
if (!that.pullDownlistShowState) {
|
||||
that.pullDownlistShowState = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
input::-webkit-input-placeholder {
|
||||
color: #606266 !important;
|
||||
}
|
||||
input::-moz-input-placeholder {
|
||||
color: #606266 !important;
|
||||
}
|
||||
input::-ms-input-placeholder {
|
||||
color: #606266 !important;
|
||||
}
|
||||
input::-o-input-placeholder {
|
||||
color: #606266 !important;
|
||||
}
|
||||
|
||||
.city-picker {
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.city-picker-item {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 150px;
|
||||
margin-left: 10px;
|
||||
position: relative;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
&:after {
|
||||
content: "";
|
||||
border-right: 6px solid transparent;
|
||||
border-left: 6px solid transparent;
|
||||
border-bottom: 6px solid #ccc;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 5px;
|
||||
-webkit-transition-duration: 400ms;
|
||||
-moz-transition-duration: 400ms;
|
||||
-o-transition-duration: 400ms;
|
||||
transition-duration: 400ms;
|
||||
}
|
||||
&.hide {
|
||||
.city-picker-list {
|
||||
-webkit-transform: translateY(-2%);
|
||||
-moz-transform: translateY(-2%);
|
||||
-ms-transform: translateY(-2%);
|
||||
-o-transform: translateY(-2%);
|
||||
transform: translateY(-2%);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
&:after {
|
||||
-webkit-transform: rotate(180deg);
|
||||
-moz-transform: rotate(180deg);
|
||||
-ms-transform: rotate(180deg);
|
||||
-o-transform: rotate(180deg);
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
input[type="text"] {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
color: #606266;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
text-indent: 5px;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
text-decoration: none;
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
&:hover {
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
&:disabled {
|
||||
background-color: #eef1f6;
|
||||
cursor: not-allowed;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.city-picker-list {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 2px #f3f3f3;
|
||||
max-height: 104px; //默认150
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-transition-duration: 400ms;
|
||||
-moz-transition-duration: 400ms;
|
||||
-o-transition-duration: 400ms;
|
||||
transition-duration: 400ms;
|
||||
-webkit-transform: translateY(0);
|
||||
-moz-transform: translateY(0);
|
||||
-ms-transform: translateY(0);
|
||||
-o-transform: translateY(0);
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
position: absolute;
|
||||
top: 120%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
.caller {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
list-style: none;
|
||||
padding: 8px;
|
||||
-webkit-transition-duration: 400ms;
|
||||
-moz-transition-duration: 400ms;
|
||||
-o-transition-duration: 400ms;
|
||||
transition-duration: 400ms;
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
&:hover {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
&.active {
|
||||
position: relative;
|
||||
text-indent: 10px;
|
||||
&:after {
|
||||
content: "";
|
||||
background: #67bfdc;
|
||||
border-radius: 50%;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 5px;
|
||||
bottom: 10px;
|
||||
margin-top: -4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -183,7 +183,7 @@
|
||||
<!-- 图标切换 -->
|
||||
<ChartsCut
|
||||
@cutStatic="cutStatic"
|
||||
v-if="$store.state.transdtr"
|
||||
v-show="$store.state.transdtr&&$store.state.transBefore"
|
||||
:defaultDataRight="defaultDataRight"
|
||||
@stateTell="stateTell"
|
||||
@comTime="comTime"
|
||||
@@ -194,9 +194,11 @@
|
||||
:areaDimensionStateS="areaDimensionStateS"
|
||||
@emmitStateAd="emmitStateAd"
|
||||
:labelAreaStateks="labelAreaStateks"
|
||||
ref="childChartsCut"
|
||||
></ChartsCut>
|
||||
<!-- 列表内容 -->
|
||||
<ChartsCont
|
||||
ref="childChartCont"
|
||||
:indStatic="indStatic"
|
||||
:chartsStatusMegger="chartsStatusMegger"
|
||||
:defaultDataRight="defaultDataRight"
|
||||
@@ -454,7 +456,9 @@ export default {
|
||||
// 高级查询数据渲染
|
||||
advancedStates: false,
|
||||
// 指标与地区互换状态
|
||||
labelAreaStateks: false
|
||||
labelAreaStateks: false,
|
||||
// 存储过滤出来的所有值 左侧菜单
|
||||
filterDataArr: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -1005,28 +1009,44 @@ export default {
|
||||
break
|
||||
}
|
||||
},
|
||||
// 默认选中的列
|
||||
defaultSelectLie () {
|
||||
let stateStatic = []
|
||||
// 当数据不是从导航进来时找到其选中其选中的数据作为默认的左侧选中数据
|
||||
defaultDataSelectDG () { // 此方法返回一个默认选中的代码数组
|
||||
let defaultCodeIndex = null
|
||||
let objectData = null
|
||||
// 最终默认选中
|
||||
this.leftCateData.forEach((item1, index1) => {
|
||||
if (index1 === this.leftCateData.length - 1) {
|
||||
stateStatic.push('' + index1)
|
||||
if (item1.children) {
|
||||
if (this.$route.query.defaultLeftId.toString() === item1.id) {
|
||||
defaultCodeIndex = [index1]
|
||||
objectData = item1
|
||||
console.log(111)
|
||||
} else {
|
||||
if (item1.children !== undefined) {
|
||||
item1.children.forEach((item2, index2) => {
|
||||
if (index2 === 0) {
|
||||
stateStatic.push('' + index1 + '-' + index2)
|
||||
if (item2.children) {
|
||||
if (this.$route.query.defaultLeftId.toString() === item2.id) {
|
||||
defaultCodeIndex = [index1, index2]
|
||||
objectData = item2
|
||||
console.log(222)
|
||||
} else {
|
||||
if (item2.children !== undefined) {
|
||||
item2.children.forEach((item3, index3) => {
|
||||
if (index3 === 0) {
|
||||
stateStatic.push('' + index1 + '-' + index2 + '-' + index3)
|
||||
if (item3.children) {
|
||||
if (this.$route.query.defaultLeftId.toString() === item3.id) {
|
||||
defaultCodeIndex = [index1, index2, index3]
|
||||
objectData = item3
|
||||
console.log(defaultCodeIndex, objectData, 333)
|
||||
} else {
|
||||
if (item3.children !== undefined) {
|
||||
item3.children.forEach((item4, index4) => {
|
||||
if (index4 === 0) {
|
||||
stateStatic.push('' + index1 + '-' + index2 + '-' + index3 + '-' + index4)
|
||||
if (item4.children) {
|
||||
if (this.$route.query.defaultLeftId.toString() === item4.id) {
|
||||
defaultCodeIndex = [index1, index2, index3, index4]
|
||||
objectData = item4
|
||||
console.log(444)
|
||||
} else {
|
||||
if (item4.children !== undefined) {
|
||||
item4.children.forEach((item5, index5) => {
|
||||
if (index5 === 0) {
|
||||
stateStatic.push('' + index1 + '-' + index2 + '-' + index3 + '-' + index4 + '-' + index5)
|
||||
if (this.$route.query.defaultLeftId.toString() === item5.id) {
|
||||
defaultCodeIndex = [index1, index2, index3, index4, index5]
|
||||
objectData = item5
|
||||
console.log(555)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1041,39 +1061,95 @@ 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.filterDataArr = {
|
||||
defaultCode: defaultCodeIndex.map((item, index) => {
|
||||
return defaultCodeIndex.filter((list, key) => { return key <= index }).join('-')
|
||||
}),
|
||||
objectData: objectData
|
||||
}
|
||||
},
|
||||
// 默认选中的列
|
||||
defaultSelectLie () {
|
||||
console.log(this.leftCateData, 'this.leftCateDatathis.leftCateDatathis.leftCateData')
|
||||
console.log(this.$route.query.defaultLeftId, 'this.$router.query.defaultLeftId')
|
||||
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]
|
||||
// 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].children[0]
|
||||
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0].children[0]
|
||||
}
|
||||
} else {
|
||||
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0].children[0]
|
||||
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0]
|
||||
}
|
||||
} else {
|
||||
dataDome = this.leftCateData[this.leftCateData.length - 1].children[0]
|
||||
dataDome = this.leftCateData[this.leftCateData.length - 1]
|
||||
}
|
||||
} else {
|
||||
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
|
||||
} else { // 从数据更新,快速
|
||||
this.defaultDataSelectDG()
|
||||
console.log(this.filterDataArr, '非导航左侧选中')
|
||||
console.log(this.filterDataArr.defaultCode, '代码')
|
||||
this.defaultSelectLies = this.filterDataArr.defaultCode
|
||||
this.$store.state.openOpenLeft = this.filterDataArr.defaultCode
|
||||
this.$store.state.selectDataLeft = this.filterDataArr.objectData
|
||||
this.defaultDataRight = this.filterDataArr.objectData
|
||||
this.$store.state.selectfilter = this.filterDataArr.objectData.f
|
||||
}
|
||||
this.defaultDataRight = dataDome
|
||||
this.$store.state.selectDataLeft = this.defaultDataRight
|
||||
console.log(this.defaultDataRight, '1250')
|
||||
this.$store.state.selectfilter = this.defaultDataRight.f
|
||||
},
|
||||
comTime (res) {
|
||||
console.log(res, '被选中的')
|
||||
this.downLaSelect = res.indexID
|
||||
console.log(res, '被选中的111')
|
||||
this.downLaSelect = res.extendData
|
||||
},
|
||||
// 接收子组件传值新增指标
|
||||
emitStatesd (val) {
|
||||
@@ -1126,6 +1202,10 @@ export default {
|
||||
// 改变状态
|
||||
tellChangeFan (val) {
|
||||
this.labelAreaStateks = val
|
||||
},
|
||||
// 调用子组件的方法
|
||||
changeBrother () {
|
||||
this.$refs.childChartCont.brotherFuncShowData()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -1179,9 +1259,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/deep/ .el-submenu__title {
|
||||
padding: 0;
|
||||
}
|
||||
/deep/ .el-menu--horizontal .el-menu .el-menu-item,
|
||||
.el-menu--horizontal .el-menu .el-submenu__title {
|
||||
color: #8fa3ae;
|
||||
@@ -1199,10 +1276,21 @@ export default {
|
||||
/deep/ .el-menu.el-menu--horizontal {
|
||||
border: none;
|
||||
}
|
||||
/deep/ .el-submenu__title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
flex-flow: row-reverse;
|
||||
// border: 1px solid red;
|
||||
padding: 0;
|
||||
}
|
||||
/deep/ .el-submenu__icon-arrow {
|
||||
position: static;
|
||||
margin-top: -0.25rem;
|
||||
margin-left: 0.25rem;
|
||||
margin-top: 0.25rem;
|
||||
margin-right: 0.42rem;
|
||||
// left: 0;
|
||||
// right: auto;
|
||||
}
|
||||
.content {
|
||||
width: 100%;
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<div
|
||||
v-for="(listLeft,keyLeft) in item.textArrLeft"
|
||||
:key="keyLeft"
|
||||
@click="jumpLianjie(true,item.type)"
|
||||
@click="jumpLianjie(true,listLeft)"
|
||||
>{{listLeft.name}}</div>
|
||||
</div>
|
||||
<div class="center"></div>
|
||||
@@ -55,7 +55,7 @@
|
||||
<div
|
||||
v-for="(listRight,keyRight) in item.textArrRight"
|
||||
:key="keyRight"
|
||||
@click="jumpLianjie(true,item.type)"
|
||||
@click="jumpLianjie(true,listRight)"
|
||||
class="ListpaneRight"
|
||||
>{{listRight.name}}</div>
|
||||
</div>
|
||||
@@ -115,7 +115,7 @@
|
||||
<div class="title">数据更新</div>
|
||||
<div class="content">
|
||||
<div v-for="(item,index) in dataUpdata" :key="index">
|
||||
<div class="up" @click="jumpLianjie(false,item.filter)">
|
||||
<div class="up" @click="jumpLianjie(false,item)">
|
||||
{{computedStr(item.title)}}
|
||||
<!-- <div style="border:1px solid red;width:12rem;height: 2.125rem;"></div> -->
|
||||
<div class="next">({{item.updataTime}})</div>
|
||||
@@ -126,7 +126,11 @@
|
||||
<div class="right2">
|
||||
<div class="title">24小时热文</div>
|
||||
<div class="content">
|
||||
<div v-for="(item,index) in twentyFourtimeData" :key="index" @click="$router.push({path:'/listDetails',query:{id:item.id}})">
|
||||
<div
|
||||
v-for="(item,index) in twentyFourtimeData"
|
||||
:key="index"
|
||||
@click="$router.push({path:'/listDetails',query:{id:item.id}})"
|
||||
>
|
||||
<img :src="item.url" alt />
|
||||
<div>
|
||||
<div class="top" :title="item.title">{{item.title}}</div>
|
||||
@@ -503,6 +507,7 @@ export default {
|
||||
let arrts = []
|
||||
res.data.data.list.forEach((item, index) => {
|
||||
let objuu = {
|
||||
id: item.id,
|
||||
title: item.name,
|
||||
updataTime: item.time,
|
||||
table_name: item.table_name,
|
||||
@@ -545,38 +550,87 @@ export default {
|
||||
})
|
||||
},
|
||||
// 跳转至数据
|
||||
jumpLianjie (state, value) {
|
||||
console.log(value, 'this.indexDatalabel[this.selectLabelS]')
|
||||
if (state) {
|
||||
if (value === 1) {
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: this.indexDatalabel[this.selectLabelS]
|
||||
jumpLianjie (state, objStex) {
|
||||
console.log(state, 'statestatestate')
|
||||
console.log(objStex, 'this.indexDatalabel[this.objStex]')
|
||||
switch (state) {
|
||||
case true:// 快速查询(专题统计报表)
|
||||
if (objStex.type === '1') { // 非地区
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: this.indexDatalabel[this.selectLabelS],
|
||||
defaultLeftId: objStex.id
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: 'area'
|
||||
)
|
||||
} else if (objStex.type === '2') { // 地区
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: 'area',
|
||||
defaultLeftId: objStex.id
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: value
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
break
|
||||
case false:// 数据更新
|
||||
if (objStex.type === '1') { // 非地区
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: objStex.filter,
|
||||
defaultLeftId: objStex.id
|
||||
}
|
||||
}
|
||||
)
|
||||
} else if (objStex.type === '2') { // 地区
|
||||
this.$router.push(
|
||||
{
|
||||
path: '/datasweb',
|
||||
query: {
|
||||
type: 'area',
|
||||
defaultLeftId: objStex.id
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
break
|
||||
}
|
||||
// if (state) {
|
||||
// if (value === 1) {
|
||||
// this.$router.push(
|
||||
// {
|
||||
// path: '/datasweb',
|
||||
// query: {
|
||||
// type: this.indexDatalabel[this.selectLabelS]
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// } else {
|
||||
// this.$router.push(
|
||||
// {
|
||||
// path: '/datasweb',
|
||||
// query: {
|
||||
// type: 'area'
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
// } else {
|
||||
// this.$router.push(
|
||||
// {
|
||||
// path: '/datasweb',
|
||||
// query: {
|
||||
// type: value
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user