/** * @Description 文件描述 * @Author zhangming * @Date 2021-02-08 16:38:41 * @LastEditTime 2021-03-29 09:52:13 * @LastEditors zhangming */ function dataToChar(inData) { // console.log(inData, '5555'); var newList = []; if (inData.datas && inData.datas[0]) { inData.datas[0].map((item, index) => { newList.push({ value: item, name: inData.groups[0][index] }) }) } // if (inData.groups && inData.groups[0]) { // newList.map((res, index) => { // inData.groups[0].map((item, num) => { // if (index === num) { // newList.push({ name: item }) // } // }) // }) // } outData = newList; return outData; }; function dataToChar1(inData) { var newList = []; if (inData.datas && inData.datas[1]) { inData.datas[1].map((item, index) => { newList.push({ value: item, name: inData.groups[0][index] }) }) } outData = newList; return outData; }; function dataToChar2(inData) { var newList = []; if (inData.datas && inData.datas[2]) { inData.datas[2].map((item, index) => { newList.push({ value: item, name: inData.groups[0][index] }) }) } outData = newList; return outData; }; function dataMoreBar(inData) { var outData = []; inData.map((item) => { outData.push({ value: item.total, name: item.didgroup, }) }) return outData; } function getExplorer() { var explorer = window.navigator.userAgent; if (isIE()) { return "IE"; } //firefox else if (explorer.indexOf("Firefox") >= 0) { return "Firefox"; } //Chrome else if (explorer.indexOf("Chrome") >= 0) { return "Chrome"; } //Opera else if (explorer.indexOf("Opera") >= 0) { return "Opera"; } //Safari else if (explorer.indexOf("Safari") >= 0) { return "Safari"; } } function isIE() { if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; } //计算宽度高度 function autoWinSize() { var clientHeight = document.documentElement.clientHeight - 100; var clientWidth = document.documentElement.clientWidth * 0.85; var ex = getExplorer(); var exheight = 24; if ("Firefox" == ex) { exheight += 10; } if ("IE" == ex) { exheight += 15; } if (clientWidth < 800) { clientWidth = 800; } if (clientWidth > 1000) { clientWidth = 1000; } if (clientHeight < 200) { clientHeight = 200; } if (clientHeight > 496) { clientHeight = 496 + exheight; } return { height: clientHeight, width: clientWidth }; }