...
|
...
|
@@ -11,12 +11,39 @@ Page({ |
|
|
*/
|
|
|
data: {
|
|
|
showModal: false,
|
|
|
monthList: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
|
|
modalTitle: ["选择时间", "选择地磅", "选择货物"],
|
|
|
modalNum: 2,
|
|
|
monthList: ["货物名字", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", ],
|
|
|
time: '2019.01.01-2019.01.31',
|
|
|
changeColor: -1,
|
|
|
changeColor: 0,
|
|
|
tabList: ["出库", "流水"],
|
|
|
tabNum: 0,
|
|
|
tableTitle: ["时间", "地磅", "货物名称", "重量(T)"],
|
|
|
trList: [{
|
|
|
date: "09.12",
|
|
|
position: "大厅左上角",
|
|
|
name: "名字妙哉妙",
|
|
|
num: "18",
|
|
|
btn: "详情"
|
|
|
},
|
|
|
{
|
|
|
date: "09.12",
|
|
|
position: "大厅左上角",
|
|
|
name: "啦啦啦啦啦啦啦啦啦啦",
|
|
|
num: "18",
|
|
|
btn: "详情"
|
|
|
},
|
|
|
{
|
|
|
date: "09.12",
|
|
|
position: "车间后方大转盘",
|
|
|
name: "啦啦啦啦啦啦啦啦啦啦",
|
|
|
num: "18",
|
|
|
btn: "详情"
|
|
|
},
|
|
|
],
|
|
|
ec: {
|
|
|
|
|
|
onInit: function (canvas, width, height) {
|
|
|
onInit: function(canvas, width, height) {
|
|
|
|
|
|
chart = echarts.init(canvas, null, {
|
|
|
|
...
|
...
|
@@ -37,32 +64,15 @@ Page({ |
|
|
},
|
|
|
|
|
|
},
|
|
|
choice(e) {
|
|
|
let index = e.currentTarget.dataset.id;
|
|
|
index = index + 1
|
|
|
if (index == 1 || index == 3 || index == 5 || index == 7 || index == 8 || index == 10 || index == 12) {
|
|
|
this.setData({
|
|
|
time: "(" + "2019." + "0" + index + ".01" + "-2019" + index + ".31" + ")"
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
time: "(" + "2019." + "0" + index + ".01" + "-2019" + index + ".30" + ")"
|
|
|
})
|
|
|
}
|
|
|
this.setData({
|
|
|
changeColor: index - 1
|
|
|
})
|
|
|
},
|
|
|
three() {
|
|
|
changeTab(e) {
|
|
|
this.setData({
|
|
|
time: '近30天',
|
|
|
showt: !this.data.showt
|
|
|
tabNum: e.currentTarget.dataset.id
|
|
|
})
|
|
|
|
|
|
},
|
|
|
toShowModal(e) {
|
|
|
this.setData({
|
|
|
showModal: true
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -71,19 +81,26 @@ Page({ |
|
|
showModal: false
|
|
|
});
|
|
|
},
|
|
|
choice(e) {
|
|
|
|
|
|
this.setData({
|
|
|
changeColor: e.currentTarget.dataset.id
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
onLoad: function(options) {
|
|
|
|
|
|
this.echartsComponnet = this.selectComponent('#mychart');
|
|
|
|
|
|
|
|
|
//如果是第一次绘制
|
|
|
|
|
|
if (!Chart) {
|
|
|
|
|
|
this.init_echarts(); //初始化图表
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.setOption(Chart); //更新数据
|
...
|
...
|
@@ -93,7 +110,7 @@ Page({ |
|
|
},
|
|
|
//初始化图表
|
|
|
|
|
|
init_echarts: function () {
|
|
|
init_echarts: function() {
|
|
|
|
|
|
this.echartsComponnet.init((canvas, width, height) => {
|
|
|
|
...
|
...
|
@@ -117,7 +134,7 @@ Page({ |
|
|
|
|
|
},
|
|
|
|
|
|
setOption: function (Chart) {
|
|
|
setOption: function(Chart) {
|
|
|
|
|
|
Chart.clear(); // 清除
|
|
|
|
...
|
...
|
@@ -178,7 +195,7 @@ Page({ |
|
|
|
|
|
position: 'left',
|
|
|
|
|
|
name: '千瓦时', //纵坐标名称
|
|
|
name: '重量', //纵坐标名称
|
|
|
|
|
|
nameTextStyle: { //在name值存在下,设置name的样式
|
|
|
|
...
|
...
|
@@ -188,12 +205,12 @@ Page({ |
|
|
|
|
|
},
|
|
|
|
|
|
splitNumber: 5, //坐标轴的分割段数
|
|
|
splitNumber: 10, //坐标轴的分割段数
|
|
|
|
|
|
|
|
|
min: 0,
|
|
|
|
|
|
max: 500,
|
|
|
max: 100,
|
|
|
|
|
|
},
|
|
|
|
...
|
...
|
@@ -201,7 +218,7 @@ Page({ |
|
|
|
|
|
type: 'line',
|
|
|
|
|
|
data: [100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 100, 120, 123, 142, 231, 231, 123, 341, 234, 432, 253],
|
|
|
data: [10, 12, 13, 14, 23, 31, 23, 31, 48, 43, 1, 100, 23, 42, 21, 31, 23, 34, 97, 43, 59, 67, 82, 42, 23, 31, 13, 34, 34, 43, 25],
|
|
|
|
|
|
symbol: 'true',
|
|
|
|
...
|
...
|
@@ -211,7 +228,7 @@ Page({ |
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: '#6495F8'
|
|
|
color: '#ED3676'
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -234,49 +251,62 @@ Page({ |
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady: function () {
|
|
|
onReady: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
onShow: function() {
|
|
|
this.echartsComponnet = this.selectComponent('#mychart');
|
|
|
|
|
|
|
|
|
//如果是第一次绘制
|
|
|
|
|
|
if (!Chart) {
|
|
|
this.init_echarts(); //初始化图表
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.setOption(Chart); //更新数据
|
|
|
|
|
|
}
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
*/
|
|
|
onHide: function () {
|
|
|
onHide: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
*/
|
|
|
onUnload: function () {
|
|
|
onUnload: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
*/
|
|
|
onPullDownRefresh: function () {
|
|
|
onPullDownRefresh: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
onReachBottom: function() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage: function () {
|
|
|
onShareAppMessage: function() {
|
|
|
|
|
|
}
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|