|
@@ -202,18 +202,15 @@ Page({
|
|
|
// this.setCardFivePie();
|
|
// this.setCardFivePie();
|
|
|
this.setCardXuTuOption({normalTotal:15});
|
|
this.setCardXuTuOption({normalTotal:15});
|
|
|
// this.setCardFivePie_rght();
|
|
// this.setCardFivePie_rght();
|
|
|
- // var cardSixBarList = [{"name":"北京","orderNum":50},{"name":"上海","orderNum":30},{"name":"安徽","orderNum":20},{"name":"成都","orderNum":20},{"name":"广东","orderNum":20}];
|
|
|
|
|
- // var cardSixLineList = [{name:'标签1',data:[10,15,18,25,15]},{name:'标签2',data:[14,16,20,28,17]},{name:'标签3',data:[20,24,28,32,22]}]
|
|
|
|
|
- // this.setCardSixBar(cardSixBarList,cardSixLineList);
|
|
|
|
|
- // var sixRightBarList = [{data:[120, 132, 101, 134, 90, 230, 210]},{data:[220, 182, 191, 234, 290, 330, 310]},{data:[150, 232, 201, 154, 190, 330, 410]}]
|
|
|
|
|
- // this.setCardSixRightBar(sixRightBarList);
|
|
|
|
|
- // var sevenCardPieList = [
|
|
|
|
|
- // {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
- // {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
- // {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
- // {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
- // ]
|
|
|
|
|
- // this.setSevenCardPie(sevenCardPieList);
|
|
|
|
|
|
|
+ var sixRightBarList = [{data:[120, 132, 101, 134, 90, 230, 210]},{data:[220, 182, 191, 234, 290, 330, 310]},{data:[150, 232, 201, 154, 190, 330, 410]}]
|
|
|
|
|
+ this.setCardSixRightBar(sixRightBarList);
|
|
|
|
|
+ var sevenCardPieList = [
|
|
|
|
|
+ {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
+ {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
+ {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
+ {data:[{ name: "标签1", value: 50 },{ name: "标签2", value: 20 },{ name: "标签3", value: 10 }]},
|
|
|
|
|
+ ]
|
|
|
|
|
+ this.setSevenCardPie(sevenCardPieList);
|
|
|
// var sevenCardPieList = [
|
|
// var sevenCardPieList = [
|
|
|
// { name: "标签1", value: 50 },
|
|
// { name: "标签1", value: 50 },
|
|
|
// { name: "标签2", value: 20 },
|
|
// { name: "标签2", value: 20 },
|
|
@@ -270,6 +267,12 @@ Page({
|
|
|
this.getUserDefaultMenuList();
|
|
this.getUserDefaultMenuList();
|
|
|
// 图5 主产品在库、在途、结束统计
|
|
// 图5 主产品在库、在途、结束统计
|
|
|
this.getSignProductState();
|
|
this.getSignProductState();
|
|
|
|
|
+ // 主产品正常、预警统计
|
|
|
|
|
+ this.getSignPorductNormalWarningState();
|
|
|
|
|
+ // 主产品使用量、生产量统计
|
|
|
|
|
+ this.getSignProductUsedProduceState();
|
|
|
|
|
+ // 主产品不同年度 使用量统计
|
|
|
|
|
+ this.getSignPrroductYearUsedProduceState();
|
|
|
},
|
|
},
|
|
|
getOrderWarnOption(list){
|
|
getOrderWarnOption(list){
|
|
|
var fontSize = 12
|
|
var fontSize = 12
|
|
@@ -515,6 +518,32 @@ Page({
|
|
|
{stack: 0, end: 1, productName: "红霉素", trans: 0},
|
|
{stack: 0, end: 1, productName: "红霉素", trans: 0},
|
|
|
]
|
|
]
|
|
|
this.setCard_two_left_one(cardTwo_leftOne);
|
|
this.setCard_two_left_one(cardTwo_leftOne);
|
|
|
|
|
+ // 主产品正常、预警统计
|
|
|
|
|
+ this.setCardEightBar([
|
|
|
|
|
+ {normal: 1, warning: 0, product_name: "阿莫西林"},
|
|
|
|
|
+ {normal: 0, warning: 1, product_name: "红霉素"},
|
|
|
|
|
+ {normal: 1, warning: 9, product_name: "新型冠状病毒疫苗"}
|
|
|
|
|
+ ]);
|
|
|
|
|
+ var list = [
|
|
|
|
|
+ {product_name: "阿莫西林",data:[{data: 1,index: 39,color:"#2D59E6"},{data:1,index:872,color:"#71CCFF"}]},
|
|
|
|
|
+ {product_name: "红霉素",data:[{data:1,index: 266,color: "#2D59E6"},{data: 1,index: 862,color:"#71CCFF"}]},
|
|
|
|
|
+ {product_name: "新型冠状病毒疫苗",data:[{data:10,index: 555, color: "#2D59E6"},{data:1,index:200,color:"#71CCFF"}]},
|
|
|
|
|
+
|
|
|
|
|
+ ];
|
|
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
|
|
+ for (let lindex = 0; lindex < list[index].data.length; lindex++) {
|
|
|
|
|
+ var color = list[index].data[lindex].color;
|
|
|
|
|
+ var total = list[index].data[lindex].data;
|
|
|
|
|
+ var itemIndex = list[index].data[lindex].index;
|
|
|
|
|
+ that.setCardFivePie_rght(color,total,itemIndex);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ var seriesSixBar = [
|
|
|
|
|
+ {name: 2022, type: "line", stack: "Total",data:[1, 1, 6]},
|
|
|
|
|
+ {name: 2021, type: "line", stack: "Total",data:[4, 0,0]},
|
|
|
|
|
+ ]
|
|
|
|
|
+ var cardSixLineList = ["阿莫西林", "红霉素", "新型冠状病毒疫苗"];
|
|
|
|
|
+ this.setCardSixBar(seriesSixBar,cardSixLineList);
|
|
|
},
|
|
},
|
|
|
showMap1(markers) {
|
|
showMap1(markers) {
|
|
|
var that = this;
|
|
var that = this;
|
|
@@ -1502,24 +1531,15 @@ Page({
|
|
|
color:'#485465',
|
|
color:'#485465',
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
- option.color = ['red','rgb(114,205,255)','rgb(10,92,170)']
|
|
|
|
|
|
|
+ option.color = ['#2D59E6','#FFAF36','#7FD1FF']
|
|
|
option.grid.top='20%';
|
|
option.grid.top='20%';
|
|
|
option.grid.bottom='13%';
|
|
option.grid.bottom='13%';
|
|
|
option.series = [];
|
|
option.series = [];
|
|
|
option.xAxis.data = [];
|
|
option.xAxis.data = [];
|
|
|
const echartsData = [
|
|
const echartsData = [
|
|
|
- {
|
|
|
|
|
- name:'在库',
|
|
|
|
|
- data:list.map(item=>item.stack)
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name:'结束',
|
|
|
|
|
- data:list.map(item=>item.end)
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name:'在途',
|
|
|
|
|
- data:list.map(item=>item.trans)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ {name:'在库',data:list.map(item=>item.stack)},
|
|
|
|
|
+ {name:'结束',data:list.map(item=>item.end)},
|
|
|
|
|
+ {name:'在途',data:list.map(item=>item.trans)}
|
|
|
]
|
|
]
|
|
|
option.xAxis.data = list.map(item=>item.productName);
|
|
option.xAxis.data = list.map(item=>item.productName);
|
|
|
echartsData.map((item,index)=>{
|
|
echartsData.map((item,index)=>{
|
|
@@ -1533,7 +1553,6 @@ Page({
|
|
|
data:item.data
|
|
data:item.data
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
- console.log(option);
|
|
|
|
|
chart.setOption(option);
|
|
chart.setOption(option);
|
|
|
return chart;
|
|
return chart;
|
|
|
})
|
|
})
|
|
@@ -2124,7 +2143,39 @@ Page({
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- setCardFivePie_rght(list){
|
|
|
|
|
|
|
+ // 主产品使用量、生产量统计
|
|
|
|
|
+ getSignProductUsedProduceState(){
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ app.requestP({
|
|
|
|
|
+ url: '/daping/signProductUsedProduceState',
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ statisticSproductList:res.data.data.map(item=>{
|
|
|
|
|
+ return {
|
|
|
|
|
+ product_name:item.product_name,
|
|
|
|
|
+ data:[
|
|
|
|
|
+ {data:item.produce,index:Math.floor(Math.random()*1000),color:'#2D59E6'},
|
|
|
|
|
+ {data:item.end,index:Math.floor(Math.random()*1000),color:'#71CCFF'},
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ }),
|
|
|
|
|
+ },()=>{
|
|
|
|
|
+ var list = that.data.statisticSproductList;
|
|
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
|
|
+ for (let lindex = 0; lindex < list[index].data.length; lindex++) {
|
|
|
|
|
+ var color = list[index].data[lindex].color;
|
|
|
|
|
+ var total = list[index].data[lindex].data;
|
|
|
|
|
+ var itemIndex = list[index].data[lindex].index;
|
|
|
|
|
+ that.setCardFivePie_rght(color,total,itemIndex);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(err=>{
|
|
|
|
|
+ app.showToptip(this,'err',err.data.msg)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ setCardFivePie_rght(color,total,itemIndex){
|
|
|
var that = this;
|
|
var that = this;
|
|
|
var placeHolderStyle = {
|
|
var placeHolderStyle = {
|
|
|
normal: {
|
|
normal: {
|
|
@@ -2141,59 +2192,91 @@ Page({
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
- that.selectComponent('#product_five_right').init((canvas, width, height, dpr) => {
|
|
|
|
|
|
|
+ that.selectComponent('#product_five_right'+itemIndex).init((canvas, width, height, dpr) => {
|
|
|
const chart = echarts.init(canvas, null, {
|
|
const chart = echarts.init(canvas, null, {
|
|
|
width: width,
|
|
width: width,
|
|
|
height: height,
|
|
height: height,
|
|
|
devicePixelRatio: dpr
|
|
devicePixelRatio: dpr
|
|
|
});
|
|
});
|
|
|
- var option = this.getStaticPieChart();
|
|
|
|
|
- var position = [['20%','20%'],['20%','50%'],['20%','80%'],['50%','20%'],['50%','50%'],['50%','80%'],['80%','20%'],['80%','50%'],['80%','80%']]
|
|
|
|
|
- position.map(item=>{
|
|
|
|
|
- option.series.push({
|
|
|
|
|
- type: "pie",
|
|
|
|
|
- clockWise: true, //顺时加载
|
|
|
|
|
- hoverAnimation: false, //鼠标移入变大
|
|
|
|
|
- silent:false,
|
|
|
|
|
- radius: [20, 23],
|
|
|
|
|
- center: item,
|
|
|
|
|
- itemStyle: placeHolderStyle,
|
|
|
|
|
- label:{
|
|
|
|
|
- normal:{
|
|
|
|
|
- show:true,
|
|
|
|
|
- position:'center',
|
|
|
|
|
- color:'#485465',
|
|
|
|
|
- formatter:'{d}',
|
|
|
|
|
- emphasis:{
|
|
|
|
|
- show:true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ var option = that.getStaticPieChart();
|
|
|
|
|
+ option.series = [];
|
|
|
|
|
+ option.color = [color];
|
|
|
|
|
+ option.series.push({
|
|
|
|
|
+ type: "pie",
|
|
|
|
|
+ silent: 1,
|
|
|
|
|
+ radius: ["65%", "80%"],
|
|
|
|
|
+ label: {
|
|
|
|
|
+ show: false,
|
|
|
|
|
+ },
|
|
|
|
|
+ labelLine: 0,
|
|
|
|
|
+ emphasis: {
|
|
|
|
|
+ label: {
|
|
|
|
|
+ show: true,
|
|
|
|
|
+ fontSize: "40",
|
|
|
|
|
+ fontWeight: "bold",
|
|
|
},
|
|
},
|
|
|
- data: [
|
|
|
|
|
- {
|
|
|
|
|
- value: 0.6,
|
|
|
|
|
- itemStyle:{
|
|
|
|
|
- normal:{
|
|
|
|
|
- color:'#0e74ff'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ data: [
|
|
|
|
|
+ {
|
|
|
|
|
+ value:total,
|
|
|
|
|
+ label: {
|
|
|
|
|
+ show: true,
|
|
|
|
|
+ fontSize: 8 * 1.5,
|
|
|
|
|
+ color: '#485465',
|
|
|
|
|
+ position: "center",
|
|
|
|
|
+ formatter: "{c}",
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- value: 0.4,
|
|
|
|
|
- itemStyle:{
|
|
|
|
|
- normal:{
|
|
|
|
|
- color:"rgb(243,243,251)"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // { value: 55 ,},
|
|
|
|
|
+ ],
|
|
|
|
|
+ })
|
|
|
|
|
+ chart.setOption(option);
|
|
|
|
|
+ return chart;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 主产品不同年度 使用量统计
|
|
|
|
|
+ getSignPrroductYearUsedProduceState(){
|
|
|
|
|
+ app.requestP({
|
|
|
|
|
+ url: '/daping/signPrroductYearUsedProduceState',
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ var xAxisName = [];
|
|
|
|
|
+ var seriesYear = [];
|
|
|
|
|
+ var series = [];
|
|
|
|
|
+ res.data.data.map((item,index)=>{
|
|
|
|
|
+ item.map((itemChild)=>{
|
|
|
|
|
+ if(xAxisName.indexOf(itemChild.productName) == -1){
|
|
|
|
|
+ xAxisName.push(itemChild.productName);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(seriesYear.indexOf(itemChild.year) == -1){
|
|
|
|
|
+ seriesYear.push(itemChild.year);
|
|
|
|
|
+ series.push({
|
|
|
|
|
+ name:itemChild.year,
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ stack: "Total",
|
|
|
|
|
+ data:[itemChild.produce]
|
|
|
|
|
+ })
|
|
|
|
|
+ }else{
|
|
|
|
|
+ series.map((serItem,i)=>{
|
|
|
|
|
+ if(serItem.name == itemChild.year){
|
|
|
|
|
+ series[i].data.push(itemChild.produce)
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ if(serItem.name != itemChild.year){
|
|
|
|
|
+ series[i].data.push(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
+ if(index == res.data.data.length-1){
|
|
|
|
|
+ this.setCardSixBar(series,xAxisName);
|
|
|
|
|
+ this.setCardSixRightBar(series,xAxisName)
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- chart.setOption(option)
|
|
|
|
|
- return chart;
|
|
|
|
|
|
|
+ }).catch(err=>{
|
|
|
|
|
+ app.showToptip(this,'err',err.data.msg)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- setCardSixBar(list,lineList){
|
|
|
|
|
|
|
+ setCardSixBar(lineList,xAxisName){
|
|
|
var that = this;
|
|
var that = this;
|
|
|
that.selectComponent('#product_six_left').init((canvas, width, height, dpr) => {
|
|
that.selectComponent('#product_six_left').init((canvas, width, height, dpr) => {
|
|
|
const chart = echarts.init(canvas, null, {
|
|
const chart = echarts.init(canvas, null, {
|
|
@@ -2202,14 +2285,24 @@ Page({
|
|
|
devicePixelRatio: dpr
|
|
devicePixelRatio: dpr
|
|
|
});
|
|
});
|
|
|
var colors = ['#F71404','#2D59E6','#71CCFF']
|
|
var colors = ['#F71404','#2D59E6','#71CCFF']
|
|
|
- var option = that.getCysOrderOption(list);
|
|
|
|
|
- option.color = ['rgb(243,243,251)'];
|
|
|
|
|
- option.grid.top = '20%'
|
|
|
|
|
- option.yAxis.axisLabel.color = '#000';
|
|
|
|
|
|
|
+ var option = that.getStaticBarChart();
|
|
|
|
|
+ option.color = ['#F71404','#2D59E6','#71CCFF'];
|
|
|
|
|
+ option.grid.top = '26%'
|
|
|
|
|
+ option.series = [];
|
|
|
|
|
+ option.xAxis.data = xAxisName;
|
|
|
|
|
+ option.title={
|
|
|
|
|
+ text: '单位:支',
|
|
|
|
|
+ left: 'right',
|
|
|
|
|
+ top:'15%',
|
|
|
|
|
+ textStyle: {
|
|
|
|
|
+ color: '#666',
|
|
|
|
|
+ fontSize: 12,
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
option.legend = {
|
|
option.legend = {
|
|
|
- data:lineList.map(item=>item.name),
|
|
|
|
|
|
|
+ data:lineList.map(item=>item.name+''),
|
|
|
icon:"circle",
|
|
icon:"circle",
|
|
|
- top:"2%",
|
|
|
|
|
|
|
+ top:"10%",
|
|
|
right:"auto",
|
|
right:"auto",
|
|
|
itemWidth:8,
|
|
itemWidth:8,
|
|
|
itemHeight:8,
|
|
itemHeight:8,
|
|
@@ -2220,7 +2313,7 @@ Page({
|
|
|
}
|
|
}
|
|
|
lineList.map((item,index)=>{
|
|
lineList.map((item,index)=>{
|
|
|
option.series.push({
|
|
option.series.push({
|
|
|
- name:item.name,
|
|
|
|
|
|
|
+ name:item.name+'',
|
|
|
type:'line',
|
|
type:'line',
|
|
|
data:item.data,
|
|
data:item.data,
|
|
|
lineStyle:{
|
|
lineStyle:{
|
|
@@ -2239,7 +2332,7 @@ Page({
|
|
|
return chart
|
|
return chart
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- setCardSixRightBar(list){
|
|
|
|
|
|
|
+ setCardSixRightBar(lineList,xAxisName){
|
|
|
var that = this;
|
|
var that = this;
|
|
|
that.selectComponent('#product_six_right').init((canvas, width, height, dpr) => {
|
|
that.selectComponent('#product_six_right').init((canvas, width, height, dpr) => {
|
|
|
const chart = echarts.init(canvas, null, {
|
|
const chart = echarts.init(canvas, null, {
|
|
@@ -2249,16 +2342,47 @@ Page({
|
|
|
});
|
|
});
|
|
|
var option = this.setCardLineTotal();
|
|
var option = this.setCardLineTotal();
|
|
|
option.series = [];
|
|
option.series = [];
|
|
|
- list.map(item=>{
|
|
|
|
|
|
|
+ var colors = ['#F71404','#2D59E6','#71CCFF'];
|
|
|
|
|
+ option.color = ['#F71404','#2D59E6','#71CCFF'];
|
|
|
|
|
+ option.grid.top = '26%'
|
|
|
|
|
+ option.xAxis.data = xAxisName;
|
|
|
|
|
+ option.title={
|
|
|
|
|
+ text: '单位:支',
|
|
|
|
|
+ left: 'right',
|
|
|
|
|
+ top:'15%',
|
|
|
|
|
+ textStyle: {
|
|
|
|
|
+ color: '#666',
|
|
|
|
|
+ fontSize: 12,
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ option.legend = {
|
|
|
|
|
+ data:lineList.map(item=>item.name+''),
|
|
|
|
|
+ icon:"circle",
|
|
|
|
|
+ top:"10%",
|
|
|
|
|
+ right:"auto",
|
|
|
|
|
+ itemWidth:8,
|
|
|
|
|
+ itemHeight:8,
|
|
|
|
|
+ textStyle:{
|
|
|
|
|
+ fontSize:8,
|
|
|
|
|
+ color:'#485465',
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+ lineList.map((item,index)=>{
|
|
|
option.series.push({
|
|
option.series.push({
|
|
|
- type: 'line',
|
|
|
|
|
- stack: 'Total',
|
|
|
|
|
|
|
+ name:item.name+'',
|
|
|
|
|
+ type:'line',
|
|
|
|
|
+ data:item.data,
|
|
|
areaStyle: {},
|
|
areaStyle: {},
|
|
|
- showSymbol:false,
|
|
|
|
|
- emphasis: {
|
|
|
|
|
- focus: 'series'
|
|
|
|
|
|
|
+ lineStyle:{
|
|
|
|
|
+ normal:{
|
|
|
|
|
+ color:colors[index]
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
- data: item.data,
|
|
|
|
|
|
|
+ itemStyle:{
|
|
|
|
|
+ normal:{
|
|
|
|
|
+ color:colors[index]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
chart.setOption(option)
|
|
chart.setOption(option)
|
|
@@ -2401,6 +2525,17 @@ Page({
|
|
|
return chart;
|
|
return chart;
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 主产品正常、预警统计
|
|
|
|
|
+ getSignPorductNormalWarningState(){
|
|
|
|
|
+ app.requestP({
|
|
|
|
|
+ url: '/daping/signPorductNormalWarningState',
|
|
|
|
|
+ method: 'post',
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ this.setCardEightBar(res.data.data)
|
|
|
|
|
+ }).catch(err=>{
|
|
|
|
|
+ app.showToptip(this,'err',err.data.msg)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
setCardEightBar(list){
|
|
setCardEightBar(list){
|
|
|
var that = this;
|
|
var that = this;
|
|
|
that.selectComponent('#product_eight_left').init((canvas, width, height, dpr) => {
|
|
that.selectComponent('#product_eight_left').init((canvas, width, height, dpr) => {
|
|
@@ -2411,8 +2546,16 @@ Page({
|
|
|
});
|
|
});
|
|
|
var option = that.getStaticBarChart();
|
|
var option = that.getStaticBarChart();
|
|
|
option.series = [];
|
|
option.series = [];
|
|
|
|
|
+ option.grid.top='20%';
|
|
|
|
|
+ option.grid.bottom='13%';
|
|
|
|
|
+ option.xAxis.data = list.map(item=>item.product_name);
|
|
|
|
|
+ const echartsData = [
|
|
|
|
|
+ {name:'正常',data:list.map(item=>item.normal)},
|
|
|
|
|
+ {name:'报警',data:list.map(item=>item.warning)},
|
|
|
|
|
+ ]
|
|
|
|
|
+ option.color = ['#2D59E6','#E1291C']
|
|
|
option.legend = {
|
|
option.legend = {
|
|
|
- data:list.map(item=>item.name),
|
|
|
|
|
|
|
+ data:echartsData.map(item=>item.name),
|
|
|
icon:"circle",
|
|
icon:"circle",
|
|
|
top:"2%",
|
|
top:"2%",
|
|
|
right:"auto",
|
|
right:"auto",
|
|
@@ -2423,13 +2566,14 @@ Page({
|
|
|
color:'#485465',
|
|
color:'#485465',
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
- option.grid.top='20%';
|
|
|
|
|
- option.grid.bottom='13%';
|
|
|
|
|
- list.map((item,index)=>{
|
|
|
|
|
|
|
+ echartsData.map((item,index)=>{
|
|
|
option.series.push({
|
|
option.series.push({
|
|
|
- name:item.name,
|
|
|
|
|
|
|
+ name: item.name,
|
|
|
type: 'bar',
|
|
type: 'bar',
|
|
|
- data:item.data
|
|
|
|
|
|
|
+ emphasis: {
|
|
|
|
|
+ focus: "series",
|
|
|
|
|
+ },
|
|
|
|
|
+ data:item.data,
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
chart.setOption(option);
|
|
chart.setOption(option);
|
|
@@ -2446,7 +2590,8 @@ Page({
|
|
|
});
|
|
});
|
|
|
var option = that.getStaticBarChart();
|
|
var option = that.getStaticBarChart();
|
|
|
option.title = {
|
|
option.title = {
|
|
|
- text: '历来所有疫苗的数据',
|
|
|
|
|
|
|
+ show:false,
|
|
|
|
|
+ text: '',
|
|
|
top:'10%',
|
|
top:'10%',
|
|
|
textStyle: {
|
|
textStyle: {
|
|
|
color: '#999',
|
|
color: '#999',
|
|
@@ -2512,7 +2657,7 @@ Page({
|
|
|
list.map((item,index)=>{
|
|
list.map((item,index)=>{
|
|
|
option.series.push({
|
|
option.series.push({
|
|
|
name: item.name,
|
|
name: item.name,
|
|
|
- type: index != list.length -1 ? 'bar' :'line',
|
|
|
|
|
|
|
+ type: 'bar',
|
|
|
stack: "Ad",
|
|
stack: "Ad",
|
|
|
emphasis: {
|
|
emphasis: {
|
|
|
focus: "series",
|
|
focus: "series",
|