|
@@ -7,7 +7,6 @@ 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,
|
|
@@ -15,11 +14,11 @@ function initChart(canvas, width, height, dpr) {
|
|
devicePixelRatio: dpr // new
|
|
devicePixelRatio: dpr // new
|
|
});
|
|
});
|
|
canvas.setChart(chart);
|
|
canvas.setChart(chart);
|
|
- chart.on('click',function(params){
|
|
|
|
|
|
+ chart.on('click', function (params) {
|
|
console.log(params)
|
|
console.log(params)
|
|
})
|
|
})
|
|
option = {
|
|
option = {
|
|
- color:["#5992fd"],
|
|
|
|
|
|
+ color: ["#5992fd"],
|
|
legend: {
|
|
legend: {
|
|
data: []
|
|
data: []
|
|
},
|
|
},
|
|
@@ -33,8 +32,21 @@ function initChart(canvas, width, height, dpr) {
|
|
},
|
|
},
|
|
series: [{
|
|
series: [{
|
|
data: [],
|
|
data: [],
|
|
- type: 'bar'
|
|
|
|
- }]
|
|
|
|
|
|
+ type: 'bar',
|
|
|
|
+ label: {
|
|
|
|
+ normal: {
|
|
|
|
+ show: true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ }],
|
|
|
|
+ tooltip: {
|
|
|
|
+ trigger: 'axis',
|
|
|
|
+ axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
|
|
+ type: 'cross', // 默认为直线,可选为:'line' | 'shadow' | 'cross'
|
|
|
|
+ axis: "y",
|
|
|
|
+ },
|
|
|
|
+ showContent: false
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
chart.setOption(option);
|
|
chart.setOption(option);
|
|
@@ -47,6 +59,8 @@ Page({
|
|
* 页面的初始数据
|
|
* 页面的初始数据
|
|
*/
|
|
*/
|
|
data: {
|
|
data: {
|
|
|
|
+ projectinfoname: "",
|
|
|
|
+ projectinfoprice: "",
|
|
projects: [],
|
|
projects: [],
|
|
project_id: '',
|
|
project_id: '',
|
|
project_ids: [],
|
|
project_ids: [],
|
|
@@ -101,7 +115,8 @@ Page({
|
|
onInit: initChart
|
|
onInit: initChart
|
|
},
|
|
},
|
|
detail_data: [],
|
|
detail_data: [],
|
|
- orderBy: 'asc'
|
|
|
|
|
|
+ orderBy: 'asc',
|
|
|
|
+ recordX: 0
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -112,6 +127,29 @@ Page({
|
|
api.getByName(this, 'projects/getAll', 'projects', { type: 'drop_menu' });
|
|
api.getByName(this, 'projects/getAll', 'projects', { type: 'drop_menu' });
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // startX(e) {
|
|
|
|
+ // console.log(e)
|
|
|
|
+ // this.setData({
|
|
|
|
+ // recordX: e.touches[0].clientX
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
|
|
+ // moveX(e) {
|
|
|
|
+ // console.log(e)
|
|
|
|
+ // let currentX = e.changedTouches[0].clientX
|
|
|
|
+ // var chartIndex = this.data.chartIndex
|
|
|
|
+ // if (currentX - this.data.recordX <= -60) {
|
|
|
|
+ // chartIndex = (chartIndex + 1)
|
|
|
|
+ // console.log(chartIndex)
|
|
|
|
+ // }
|
|
|
|
+ // if (currentX - this.data.recordX >= 60) {
|
|
|
|
+ // chartIndex = (chartIndex - 1)
|
|
|
|
+ // console.log(chartIndex)
|
|
|
|
+ // }
|
|
|
|
+ // if (chartIndex < 0 || chartIndex > 2) return false;
|
|
|
|
+ // this.setData({ chartIndex })
|
|
|
|
+ // this.getChartData()
|
|
|
|
+ // },
|
|
|
|
+
|
|
changeChartIndex: function (e) {
|
|
changeChartIndex: function (e) {
|
|
var type = e.currentTarget.dataset.type
|
|
var type = e.currentTarget.dataset.type
|
|
var chartIndex = this.data.chartIndex
|
|
var chartIndex = this.data.chartIndex
|
|
@@ -120,7 +158,11 @@ Page({
|
|
this.setData({ chartIndex })
|
|
this.setData({ chartIndex })
|
|
this.getChartData()
|
|
this.getChartData()
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ popclose: function () {
|
|
|
|
+ this.setData({
|
|
|
|
+ projectShow: false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
updateValue: function (e) {
|
|
updateValue: function (e) {
|
|
var name = e.currentTarget.dataset.name
|
|
var name = e.currentTarget.dataset.name
|
|
var value = e.currentTarget.dataset.value
|
|
var value = e.currentTarget.dataset.value
|
|
@@ -210,7 +252,7 @@ Page({
|
|
bottom: 10,
|
|
bottom: 10,
|
|
textStyle: {
|
|
textStyle: {
|
|
fontSize: 14,
|
|
fontSize: 14,
|
|
- color:"#5992fd"
|
|
|
|
|
|
+ color: "#5992fd"
|
|
},
|
|
},
|
|
}
|
|
}
|
|
option.yAxis = [{
|
|
option.yAxis = [{
|
|
@@ -248,7 +290,7 @@ Page({
|
|
} else if (chartIndex == 1) {
|
|
} else if (chartIndex == 1) {
|
|
option.xAxis = [{
|
|
option.xAxis = [{
|
|
type: 'value',
|
|
type: 'value',
|
|
- show:false
|
|
|
|
|
|
+ show: false
|
|
}]
|
|
}]
|
|
|
|
|
|
option.legend = {
|
|
option.legend = {
|
|
@@ -265,7 +307,7 @@ Page({
|
|
bottom: 10,
|
|
bottom: 10,
|
|
textStyle: {
|
|
textStyle: {
|
|
fontSize: 14,
|
|
fontSize: 14,
|
|
- color:"#5992fd"
|
|
|
|
|
|
+ color: "#5992fd"
|
|
},
|
|
},
|
|
}
|
|
}
|
|
option.yAxis = [{
|
|
option.yAxis = [{
|
|
@@ -304,7 +346,7 @@ Page({
|
|
} else {
|
|
} else {
|
|
option.xAxis = [{
|
|
option.xAxis = [{
|
|
type: 'value',
|
|
type: 'value',
|
|
- show:false
|
|
|
|
|
|
+ show: false
|
|
}]
|
|
}]
|
|
|
|
|
|
option.legend = {
|
|
option.legend = {
|
|
@@ -318,7 +360,7 @@ Page({
|
|
bottom: 10,
|
|
bottom: 10,
|
|
textStyle: {
|
|
textStyle: {
|
|
fontSize: 14,
|
|
fontSize: 14,
|
|
- color:"#5992fd"
|
|
|
|
|
|
+ color: "#5992fd"
|
|
},
|
|
},
|
|
}
|
|
}
|
|
option.yAxis = [{
|
|
option.yAxis = [{
|