背景色根据数值由深到浅

render: (h,params) => {
                  let color
                  if (Number(params.row.time0)<=5) {
                    color = '#ffffff'
                  } else if (Number(params.row.time0)>5&&Number(params.row.time0)<=20) {
                    color = '#fff1c6'
                  } else if (Number(params.row.time0)>20&&Number(params.row.time0)<=80) {
                    color = '#e4c198'
                  } else if (Number(params.row.time0)>80&&Number(params.row.time0)<=120) {
                    color = '#e47f77'
                  } else if (Number(params.row.time0)>120&&Number(params.row.time0)<=200) {
                    color = '#e45c55'
                  } else if (Number(params.row.time0)>200&&Number(params.row.time0)<=350) {
                    color = '#e4453d'
                  } else if (Number(params.row.time2)>350) {
                    color = '#ff3994'
                  }
                  return h(
                    "div",
                    {
                      attrs: {
                        title: params.row.time0
                      },
                      style: {
                        overflow: "hidden",
                        whiteSpace: "nowrap",
                        textOverflow: "ellipsis",
                        backgroundColor: color
                      }
                    },
                    params.row.time0
                  )
                }

  

 

posted @ 2018-08-22 15:56  anne_zhou  阅读(692)  评论(0编辑  收藏  举报