Merge branch 'dd-7' of git.oa00.com:xiaowen/swsWecat into dd-7

* 'dd-7' of git.oa00.com:xiaowen/swsWecat:
  cxw-010203
dev
liuyongli 3 years ago
commit 356760fed0

@ -1,6 +1,5 @@
const app = getApp(); const app = getApp();
import brokenLine from "../../option/stackingLineOption" import brokenLine from "../../option/stackingLineOption"
const dName = ['微博', '其他', '短视频', '微信', 'APP', '论坛', '新闻']
const dColor = ['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF'] const dColor = ['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF']
Component({ Component({
data: { data: {
@ -30,8 +29,6 @@ Component({
let sTimeType = e.detail.sTimeType; let sTimeType = e.detail.sTimeType;
let sStartTime = e.detail.sStartTime; let sStartTime = e.detail.sStartTime;
let sEndTime = e.detail.sEndTime; let sEndTime = e.detail.sEndTime;
// this.getAmount(sTimeType, sStartTime, sEndTime);
// this.getTrend(sTimeType, sStartTime, sEndTime);
this.getData(sTimeType, sStartTime, sEndTime) this.getData(sTimeType, sStartTime, sEndTime)
}, },
@ -61,17 +58,30 @@ Component({
sEndTime: sEndTime sEndTime: sEndTime
} }
app.globalData.request(obj).then(res => { app.globalData.request(obj).then(res => {
let arr = [] let data = res || [];
let bar = [[],[],[],[],[],[] let times = []
] let dNameObj = {}
res.forEach(ele => { for(let i = 0; i < data.length; i++) {
for (let i = 0; i < ele.Data.length; i++) { times.push(data[i].Time);
bar[i].push(ele.Data[i].value) let a1 = data[i].Data || [];
for(let j = 0; j < a1.length; j++) {
let row = a1[j];
if(dNameObj[row.key]) {
let val = dNameObj[row.key];
val.push(row.value);
} else {
dNameObj[row.key] = [row.value];
}
} }
arr.push(ele.Time) }
}) const bar = [];
const dName = [];
for(let key in dNameObj) {
dName.push(key);
bar.push(dNameObj[key])
}
this.setData({ this.setData({
dataOption: brokenLine(dName, bar, dColor, arr), dataOption: brokenLine(dName, bar, dColor, times)
}) })
resolve(true) resolve(true)
}).catch(() => { }).catch(() => {

@ -4,13 +4,16 @@ export default function histogram(dx = [], ds = [], color1 = '', direction = tru
// direction true为垂直 false为水平 // direction true为垂直 false为水平
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: "axis",
axisPointer: { // 坐标轴指示器,坐标轴触发有效 backgroundColor: "#08182F",
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' color: "#fff",
}, borderColor: "#3373CC",
confine: true textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
}, },
dataZoom: direction?[{ //添加X轴滚动条 dataZoom: direction?[{ //添加X轴滚动条
type: 'inside', type: 'inside',
show: false, show: false,

@ -1,7 +1,17 @@
// 象形 // 象形
export default function pictographicOption(dRegion = [], dValue = [], dSum = 0) { export default function pictographicOption(dRegion = [], dValue = [], dSum = 0) {
return { return {
tooltip: {}, tooltip: {
trigger: "item",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
},
xAxis: { xAxis: {
show: false, show: false,
type: 'value' type: 'value'

@ -2,7 +2,15 @@
export default function pieOption(color = [], data = [], ) { export default function pieOption(color = [], data = [], ) {
return { return {
tooltip: { tooltip: {
trigger: 'item' trigger: 'item',
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
}, },
// 注释字体样式 // 注释字体样式
legend: { legend: {

@ -3,11 +3,15 @@ export default function sHistogram(dx = [], ds = [], data = [], color2 = []) {
// MS判断多条数据还是单条数据 true为单条false为多条 // MS判断多条数据还是单条数据 true为单条false为多条
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: "axis",
axisPointer: { // 坐标轴指示器,坐标轴触发有效 backgroundColor: "#08182F",
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' color: "#fff",
}, borderColor: "#3373CC",
confine: true textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
}, },
legend: { legend: {
icon: 'rectangle', //data图标样式 icon: 'rectangle', //data图标样式

@ -2,11 +2,15 @@
export default function brokenLines(dName = [], dValue = [], dColor = [], dx = []) { export default function brokenLines(dName = [], dValue = [], dColor = [], dx = []) {
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: "axis",
axisPointer: { // 坐标轴指示器,坐标轴触发有效 backgroundColor: "#08182F",
type: 'line' // 默认为直线,可选为:'line' | 'shadow' color: "#fff",
}, borderColor: "#3373CC",
confine: true textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
}, },
legend: { legend: {
icon: 'rectangle', //data图标样式 icon: 'rectangle', //data图标样式

@ -120,7 +120,6 @@ Page({
}) })
} }
app.globalData.request(obj, (database) => { app.globalData.request(obj, (database) => {
console.log('54321',database)
this.setData({ this.setData({
totalNum: database.totalNum totalNum: database.totalNum
}) })

Loading…
Cancel
Save