You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.8 KiB
65 lines
1.8 KiB
import brokenLine from "../../option/stackingLineOption"
|
|
import moment from "moment"
|
|
|
|
// const dName=['正面', '中性','负面']
|
|
const dName=[]
|
|
const dValue=[]
|
|
// const dValue=[
|
|
// [250, 326, 178, 349, 900, 1300, 140],
|
|
// [200, 382, 661, 34, 909, 1308, 150],
|
|
// [20, 32, 41, 354, 90, 130, 10],
|
|
// ]
|
|
const dColor=['#FF4852','#FF6E25','#FFBF00']
|
|
// const data=['00:00', '04:00', '08:00', '12:00', '16:00', '20:00', '24:00']
|
|
const data = []
|
|
const app = getApp()
|
|
Component({
|
|
data: {
|
|
showChart: true,
|
|
positiveOption:brokenLine(dName,dValue,dColor,data),
|
|
negativeOption: brokenLine(dName,dValue,dColor,data),
|
|
Time:moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
},
|
|
onShow() {
|
|
this.getTabBar().init();
|
|
},
|
|
lifetimes: {
|
|
attached() {
|
|
app.globalData.request({action: 'getAffections0528',sType:'Home' ,sTimeType:34,}).then(res => {
|
|
let arr = []
|
|
|
|
res.forEach(ele => {
|
|
let ol = {
|
|
data:ele.Time
|
|
}
|
|
ele.Data.forEach(val =>{
|
|
let obj = {
|
|
dName:val.key,
|
|
dValue:val.value,
|
|
// data:
|
|
}
|
|
arr.push(obj)
|
|
})
|
|
arr.push(ol)
|
|
|
|
})
|
|
this.setData({
|
|
positiveOption:arr,
|
|
})
|
|
console.log('111',arr)
|
|
// console.log('22',obj)
|
|
})
|
|
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
priceSel(e){
|
|
this.setData({
|
|
intervalSel: e.currentTarget.dataset.index
|
|
})
|
|
}
|
|
|
|
}
|
|
}) |