Commit 594e45cd authored by leon's avatar leon

feat:charts add new config

parent 86237de4
...@@ -113,27 +113,29 @@ export default { ...@@ -113,27 +113,29 @@ export default {
} }
}) })
chart.on('datazoom', event => { chart.on('datazoom', event => {
// 配置了滑动事件
if(that.elementInfo.dataZoom.slider) {
// 传递参数给其他组件 // 传递参数给其他组件
that.echartsDataZoom(event) that.echartsDataZoom(event)
// 处理dataZoom的拖动事件 // 处理dataZoom的拖动事件
that.handleDataZoomEvent(event) that.handleDataZoomEvent(event)
}
}) })
return chart return chart
}, },
initChart() { initChart() {
// 等待子组件完全挂载完成---chart初始化完成 // 等待子组件完全挂载完成---chart初始化完成
this.$nextTick().then(() => { this.$nextTick().then(() => {
const { categories, series, preview, images } = const { categories, series, preview, images } = this.elementData.dataList
this.elementData.dataList var count = categories.length
if(count < this.elementInfo.dataZoom.count) {
this.elementInfo.dataZoom.start = 0
this.elementInfo.dataZoom.end = 100
}
if (this.labelShow) { if (this.labelShow) {
// 处理初始状态时,数值显示的数量是否超过了配置的最大值 // 处理初始状态时,数值显示的数量是否超过了配置的最大值
let count = categories.length
if (this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) { if (this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) {
count = count = (count *(this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start)) / 100
(count *
(this.elementInfo.dataZoom.end -
this.elementInfo.dataZoom.start)) /
100
} }
if ( if (
this.elementInfo.option.dataset.maxCount != null && this.elementInfo.option.dataset.maxCount != null &&
......
...@@ -91,10 +91,13 @@ ...@@ -91,10 +91,13 @@
that.handleEchartsClick(event) that.handleEchartsClick(event)
}) })
chart.on('datazoom', event => { chart.on('datazoom', event => {
// 配置了滑动事件
if(that.elementInfo.dataZoom.slider) {
// 传递参数给其他组件 // 传递参数给其他组件
that.echartsDataZoom(event) that.echartsDataZoom(event)
// 处理dataZoom的拖动事件 // 处理dataZoom的拖动事件
that.handleDataZoomEvent(event) that.handleDataZoomEvent(event)
}
}) })
return chart return chart
}, },
...@@ -102,13 +105,13 @@ ...@@ -102,13 +105,13 @@
// 等待子组件完全挂载完成---chart初始化完成 // 等待子组件完全挂载完成---chart初始化完成
this.$nextTick().then(() => { this.$nextTick().then(() => {
const { categories, series } = this.elementData.dataList const { categories, series } = this.elementData.dataList
if(this.labelShow) { var count = categories.length
// 处理初始状态时,数值显示的数量是否超过了配置的最大值 if(count < this.elementInfo.dataZoom.count) {
let count = categories.length
if(count < this.elementInfo.option.dataset.maxCount) {
this.elementInfo.dataZoom.start = 0 this.elementInfo.dataZoom.start = 0
this.elementInfo.dataZoom.end = 100 this.elementInfo.dataZoom.end = 100
} }
if(this.labelShow) {
// 处理初始状态时,数值显示的数量是否超过了配置的最大值
if(this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) { if(this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) {
count = count * (this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start) / 100 count = count * (this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start) / 100
} }
......
...@@ -83,10 +83,13 @@ ...@@ -83,10 +83,13 @@
that.handleEchartsClick(event) that.handleEchartsClick(event)
}) })
chart.on('datazoom', event => { chart.on('datazoom', event => {
// 配置了滑动事件
if(that.elementInfo.dataZoom.slider) {
// 传递参数给其他组件 // 传递参数给其他组件
that.echartsDataZoom(event) that.echartsDataZoom(event)
// 处理dataZoom的拖动事件 // 处理dataZoom的拖动事件
that.handleDataZoomEvent(event) that.handleDataZoomEvent(event)
}
}) })
return chart return chart
}, },
...@@ -94,9 +97,13 @@ ...@@ -94,9 +97,13 @@
// 等待子组件完全挂载完成---chart初始化完成 // 等待子组件完全挂载完成---chart初始化完成
this.$nextTick().then(() => { this.$nextTick().then(() => {
const { categories, series } = this.elementData.dataList const { categories, series } = this.elementData.dataList
var count = categories.length
if(count < this.elementInfo.dataZoom.count) {
this.elementInfo.dataZoom.start = 0
this.elementInfo.dataZoom.end = 100
}
if(this.labelShow) { if(this.labelShow) {
// 处理初始状态时,数值显示的数量是否超过了配置的最大值 // 处理初始状态时,数值显示的数量是否超过了配置的最大值
let count = categories.length
if(this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) { if(this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) {
count = count * (this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start) / 100 count = count * (this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start) / 100
} }
......
...@@ -82,10 +82,13 @@ ...@@ -82,10 +82,13 @@
that.handleEchartsClick(event) that.handleEchartsClick(event)
}) })
chart.on('datazoom', event => { chart.on('datazoom', event => {
// 配置了滑动事件
if(that.elementInfo.dataZoom.slider) {
// 传递参数给其他组件 // 传递参数给其他组件
that.echartsDataZoom(event) that.echartsDataZoom(event)
// 处理dataZoom的拖动事件 // 处理dataZoom的拖动事件
that.handleDataZoomEvent(event) that.handleDataZoomEvent(event)
}
}) })
return chart return chart
}, },
...@@ -93,9 +96,13 @@ ...@@ -93,9 +96,13 @@
// 等待子组件完全挂载完成---chart初始化完成 // 等待子组件完全挂载完成---chart初始化完成
this.$nextTick().then(() => { this.$nextTick().then(() => {
const { categories, series } = this.elementData.dataList const { categories, series } = this.elementData.dataList
var count = categories.length
if(count < this.elementInfo.dataZoom.count) {
this.elementInfo.dataZoom.start = 0
this.elementInfo.dataZoom.end = 100
}
if(this.labelShow) { if(this.labelShow) {
// 处理初始状态时,数值显示的数量是否超过了配置的最大值 // 处理初始状态时,数值显示的数量是否超过了配置的最大值
var count = categories.length
if(this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) { if(this.elementInfo.dataZoom && this.elementInfo.dataZoom.show) {
count = count * (this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start) / 100 count = count * (this.elementInfo.dataZoom.end - this.elementInfo.dataZoom.start) / 100
} }
......
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
that.elementInfo.table.column = columns that.elementInfo.table.column = columns
} }
that.chartTables = that.elementData.dataList.chartTables that.chartTables = that.elementData.dataList.chartTables
// if(that.elementInfo.table.tableCell.autoHeight) { if(that.elementInfo.table.tableCell.autoHeight) {
that.calculateCellHeight() that.calculateCellHeight()
// } }
}) })
}, },
......
<template> <template>
<view class="wrapper" :class="{'tabs-layout': showTabs}"> <view class="wrapper" :class="{'tabs-layout': showTabs}" :style="{width: `${theStyle.width - theStyle.left}px`, left:`${theStyle.left}px`}">
<!-- 普通选项卡 --> <!-- 普通选项卡 -->
<NormalTabs <NormalTabs
v-if="showTabs" v-if="showTabs"
:elementInfo="tabsElement" :elementInfo="tabsElement"
style="height: 40px;margin-top: 5px;"
:style="{width: `${theStyle.width - theStyle.left}px`}" :style="{width: `${theStyle.width - theStyle.left}px`}"
></NormalTabs> ></NormalTabs>
<view :style="{height: `${theStyle.height}px`, width: `${theStyle.width - theStyle.left}px`}"> <view :style="{height: `${theStyle.height}px`, width: `${theStyle.width - theStyle.left}px`}">
...@@ -38,7 +37,7 @@ ...@@ -38,7 +37,7 @@
const { windowWidth, windowHeight, screenHeight, safeArea } = uni.getSystemInfoSync() const { windowWidth, windowHeight, screenHeight, safeArea } = uni.getSystemInfoSync()
const reduceBottom = screenHeight - safeArea.bottom const reduceBottom = screenHeight - safeArea.bottom
return { return {
height: this.showTabs ? windowHeight - reduceBottom - 50 : windowHeight - reduceBottom, height: this.showTabs ? windowHeight - reduceBottom - this.tabsElement.height : windowHeight - reduceBottom,
width: windowWidth, width: windowWidth,
left: safeArea.left left: safeArea.left
} }
...@@ -50,7 +49,6 @@ ...@@ -50,7 +49,6 @@
if(this.linkTabsId && uni.getStorageSync('reportInfo')) { if(this.linkTabsId && uni.getStorageSync('reportInfo')) {
let info = JSON.parse(uni.getStorageSync('reportInfo')) let info = JSON.parse(uni.getStorageSync('reportInfo'))
const data = info.list.find(item => item.id === this.linkTabsId) const data = info.list.find(item => item.id === this.linkTabsId)
data.height = this.theStyle.height
this.tabsElement = data this.tabsElement = data
} }
// 去掉全屏的定制按钮 // 去掉全屏的定制按钮
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
async getReportCharts() { async getReportCharts() {
clearInterval(this.timename) clearInterval(this.timename)
const that = this const that = this
let res = await that.$u.api.getReportCharts({id: '63647c3932f1997dd2ed53bf'}) let res = await that.$u.api.getReportCharts({id: '627a16644606332538b4633c'})
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
uni.$emit('handlePullDownRefresh') uni.$emit('handlePullDownRefresh')
const { Status, Result: { info, list } } = res.data const { Status, Result: { info, list } } = res.data
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
if (item.child.index.length) { if (item.child.index.length) {
item.child.index.forEach(child => { item.child.index.forEach(child => {
const index = data.list.findIndex(i => i.id === child ) const index = data.list.findIndex(i => i.id === child )
data.list[index].linkTabsId = item data.list[index].linkTabsId = item.id
}) })
} }
if (item.child.data.length) { if (item.child.data.length) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment