|
@@ -7,6 +7,7 @@ import * as echarts from '../../ec-canvas/echarts';
|
|
|
|
|
|
let chart = null;
|
|
let chart = null;
|
|
let option = {}
|
|
let option = {}
|
|
|
|
+
|
|
function initChart(canvas, width, height, dpr) {
|
|
function initChart(canvas, width, height, dpr) {
|
|
chart = echarts.init(canvas, null, {
|
|
chart = echarts.init(canvas, null, {
|
|
width: width,
|
|
width: width,
|
|
@@ -30,17 +31,15 @@ function initChart(canvas, width, height, dpr) {
|
|
type: 'value',
|
|
type: 'value',
|
|
show: false,
|
|
show: false,
|
|
},
|
|
},
|
|
- dataZoom: [
|
|
|
|
- { //Y轴固定,让内容滚动
|
|
|
|
- type: 'slider',
|
|
|
|
- show: true,
|
|
|
|
- yAxisIndex: [0],
|
|
|
|
- start: 1,
|
|
|
|
- end: 50,//设置X轴刻度之间的间隔(根据数据量来调整)
|
|
|
|
- filterMode:'none',
|
|
|
|
- zoomLock: true,
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ dataZoom: [{ //Y轴固定,让内容滚动
|
|
|
|
+ type: 'slider',
|
|
|
|
+ show: true,
|
|
|
|
+ yAxisIndex: [0],
|
|
|
|
+ start: 1,
|
|
|
|
+ end: 50, //设置X轴刻度之间的间隔(根据数据量来调整)
|
|
|
|
+ filterMode: 'none',
|
|
|
|
+ zoomLock: true,
|
|
|
|
+ }, ],
|
|
series: [{
|
|
series: [{
|
|
data: [],
|
|
data: [],
|
|
type: 'bar',
|
|
type: 'bar',
|
|
@@ -52,8 +51,8 @@ function initChart(canvas, width, height, dpr) {
|
|
}],
|
|
}],
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
|
- type: 'cross', // 默认为直线,可选为:'line' | 'shadow' | 'cross'
|
|
|
|
|
|
+ axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
|
+ type: 'cross', // 默认为直线,可选为:'line' | 'shadow' | 'cross'
|
|
axis: "y",
|
|
axis: "y",
|
|
},
|
|
},
|
|
showContent: false
|
|
showContent: false
|
|
@@ -74,10 +73,18 @@ Page({
|
|
projects: [],
|
|
projects: [],
|
|
project_id: '',
|
|
project_id: '',
|
|
project_ids: [],
|
|
project_ids: [],
|
|
- sort_types: [
|
|
|
|
- { text: '筛选类型', value: '' },
|
|
|
|
- { text: '按年筛选', value: 'year' },
|
|
|
|
- { text: '按月筛选', value: 'month' }
|
|
|
|
|
|
+ sort_types: [{
|
|
|
|
+ text: '筛选类型',
|
|
|
|
+ value: ''
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '按年筛选',
|
|
|
|
+ value: 'year'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ text: '按月筛选',
|
|
|
|
+ value: 'month'
|
|
|
|
+ }
|
|
],
|
|
],
|
|
sort_type: '',
|
|
sort_type: '',
|
|
project_names: '',
|
|
project_names: '',
|
|
@@ -134,7 +141,9 @@ Page({
|
|
*/
|
|
*/
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
app.resetDataFilter()
|
|
app.resetDataFilter()
|
|
- api.getByName(this, 'projects/getAll', 'projects', { type: 'drop_menu' });
|
|
|
|
|
|
+ api.getByName(this, 'projects/getAll', 'projects', {
|
|
|
|
+ type: 'drop_menu'
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// startX(e) {
|
|
// startX(e) {
|
|
@@ -165,7 +174,9 @@ Page({
|
|
var chartIndex = this.data.chartIndex
|
|
var chartIndex = this.data.chartIndex
|
|
chartIndex = type == '+' ? (chartIndex + 1) : (chartIndex - 1)
|
|
chartIndex = type == '+' ? (chartIndex + 1) : (chartIndex - 1)
|
|
if (chartIndex < 0 || chartIndex > 2) return false;
|
|
if (chartIndex < 0 || chartIndex > 2) return false;
|
|
- this.setData({ chartIndex })
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ chartIndex
|
|
|
|
+ })
|
|
this.getChartData()
|
|
this.getChartData()
|
|
},
|
|
},
|
|
popclose: function () {
|
|
popclose: function () {
|
|
@@ -302,7 +313,6 @@ Page({
|
|
type: 'value',
|
|
type: 'value',
|
|
show: false
|
|
show: false
|
|
}]
|
|
}]
|
|
-
|
|
|
|
option.legend = {
|
|
option.legend = {
|
|
data: data.legends,
|
|
data: data.legends,
|
|
bottom: 40
|
|
bottom: 40
|
|
@@ -364,6 +374,8 @@ Page({
|
|
bottom: 40
|
|
bottom: 40
|
|
}
|
|
}
|
|
var title = '设备最大单价费用排行'
|
|
var title = '设备最大单价费用排行'
|
|
|
|
+ title = (data.info.length != 0 ? data.info[0] + '-' + data.info[1] + '-' + data.info[2] + '-' + data.info[3] : '') + '\n' + '\n' + title
|
|
|
|
+ console.log(data)
|
|
option.title = {
|
|
option.title = {
|
|
text: title,
|
|
text: title,
|
|
left: 'center',
|
|
left: 'center',
|
|
@@ -456,7 +468,7 @@ Page({
|
|
navigate: function (e) {
|
|
navigate: function (e) {
|
|
var url = e.currentTarget.dataset.url
|
|
var url = e.currentTarget.dataset.url
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: url,
|
|
|
|
|
|
+ url: url + '?status=1',
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|