// 关键词 let keyidArr = []; let keyid = 0; let starKeyId = 0; let keyname = ''; let keylegend = []; let nameK = '' let reg = /\w\d+$/; $('.backKey_icon').click(function () { for (let i = 0; i < keyidArr.length; i++) { if (keyidArr[i].id == keyid) { console.log(keyidArr[i - 1].id) $('.keyWordTitle').text(keyidArr[i - 1].name + '问题分类') $('.head_title').text(keyidArr[i - 1].name + '关键字数据分析') keyWordTable(keyidArr[i - 1].id); keyidArr.pop(keyidArr[i].id) keyid = keyidArr[i - 1].id } } }) $('.closeKey_icon').click(function () { $('.bulletFrame').hide(); $('.bulletFrameT').hide(); if ($('.bulletFrame').css('display') == 'none') { $('.body').css('opacity', '1') } if ($('.bulletFrameT').css('display') == 'none') { $('.body').css('opacity', '1') } keyidArr = []; keyid = 0 }) function getKeyClass(id, classId, con) { $('.bulletFrame').show(); $('.secondLevel_keyWord').show(); $('.secondLevel_keyWord').siblings().hide() if ($('.bulletFrame').css('display') == 'block') { $('.body').css('opacity', '0.4') } laydate.render({ elem: '#keyDate', type: 'datetime', calendar: true, done: function (value) { $('.keyWordTitle').text(keyidArr[0].name + '问题分类') $('.head_title').text(keyidArr[0].name + '关键字数据分析') keyWordTable(keyidArr[0].id, keyidArr[0].name, value); } }); if (classId == '1') { workTable(id); } else { getTimes('.statisticsTime') keyidArr.push({ name: con, id: id }) keyid = id $('.keyWordTitle').text(con + '问题分类') $('.head_title').text(con + '关键字数据分析') keyWordTable(id, con, getNowTime()); } } function keyWordTable(id, con, value) { console.log(value) var $tableLeft = $('#keyWordlist'); $tableLeft.bootstrapTable('destroy'); //初始化表格,动态从服务器加载数据 $tableLeft.bootstrapTable({ method: "get", //使用get请求到服务器获取数据 url: huayi.config.callcenter_url + "/InfoNew/GetKeyCountByNow", striped: false, //表格显示条纹 pagination: false, //启动分页 pageSize: 12, //每页显示的记录数 pageNumber: 1, //当前第几页 fixedColumns: false, fixedNumber: 3, pageList: [5, 10, 20, 50, 100], //记录数可选列表 search: false, //是否启用查询 showColumns: false, //显示下拉框勾选要显示的列 showRefresh: false, //显示刷新按钮 sidePagination: "server", //表示服务端请求 //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder //设置为limit可以获取limit, offset, search, sort, order queryParamsType: "undefined", queryParams: function queryParams(params) { //设置查询参数 var param = { pid: id, timetype:keyCountDataType, date: value } return param }, onLoadSuccess: function (data) { //加载成功时执行 const newDataL = {}; const piData = []; newDataL.state = data.state; newDataL.message = data.message; newDataL.rows = data.data.Date; data.data.Date.forEach(function (v, n) { piData.push({ value: v.Count, name: v.KeyName.replace(reg, '') }) }) var nameArray = piData.map(item => { return item.name }) keyword_chart('keywordPie', nameArray, piData, con); $('.total').text(data.data.Total) $('.classTotal').text(data.data.ClaseeCount) $('.prot').text(data.data.ClassTotal) $tableLeft.bootstrapTable('load', newDataL); }, onLoadError: function () { //加载失败时执行 layer.msg("加载数据失败", { time: 1500, icon: 2 }); } }); } function keyword_chart(dom, nameArray, piData, con) { let keywordPieChart = echarts.init(document.getElementById(dom)); let keywordNum = []; let keywordName = []; var rich = { percent: { color: "#FFF", align: 'right', fontSize: 15, fontWeight: '500', //padding: [0, 5] } } nameArray.forEach(function (v, n) { keywordNum.push({ num: Number(v.substr(v.length - 2, 2)), value: v }) }) let max; for (let i = 0; i < keywordNum.length; i++) { for (let j = i; j < keywordNum.length; j++) { if (keywordNum[i].num < keywordNum[j].num) { max = keywordNum[j]; keywordNum[j] = keywordNum[i]; keywordNum[i] = max; } } } keywordNum.forEach(function (v, n) { keywordName.push(v.value.replace(reg, '')); }) console.log(keywordName) keywordName.forEach(function (v, n) { if (v.length > 20) { keylegend = [{ icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '610', // data: keywordName.slice(0, 6), data: keywordName.slice(0, 1), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [5, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '620', // data: keywordName.slice(6, 12), data: keywordName.slice(1, 2), width: 28, height: 25, itemGap: 20, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [10, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(2, 3), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [20, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(3, 4), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [40, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(4, 5), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [60, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(5, 6), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [80, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(6, keywordName.length), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [100, 10] }] } else { if (con == '营商管理03') { keylegend = [{ icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '610', // data: keywordName.slice(0, 6), data: keywordName.slice(0, 6), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [15, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '620', // data: keywordName.slice(6, 12), data: keywordName.slice(6, 12), width: 28, height: 25, itemGap: 20, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [40, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(12, 18), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [65, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(18, keywordName.length), width: 30, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [90, 10] } ] } else { keylegend = [{ icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '610', // data: keywordName.slice(0, 6), data: keywordName.slice(0, 5), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [15, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '620', // data: keywordName.slice(6, 12), data: keywordName.slice(5, 10), width: 28, height: 25, itemGap: 20, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [40, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(10, 15), width: 28, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [65, 10] }, { icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', top: '630', // data: keywordName.slice(12, keywordName.length), data: keywordName.slice(15, keywordName.length), width: 30, height: 25, textStyle: { color: '#fff', padding: [0, 5], fontSize: 15 }, padding: [90, 10] } ] } } }) keywordName.reverse(); option = { legend: keylegend, color: ['#008aff', '#88ffb7', '#00bba7', '#fddb6a', '#fb6a76', '#ff0000', '#e5a0ff', '#9b56ff', '#8200f0', '#68f6ff', '#FF8352', '#E271DE', '#F8456B', '#3751E6', '#FFC722', '#00BFA5', "#EAEA26" ], series: [{ name: '访问来源', type: 'pie', radius: '58%', data: piData, emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } }, label: { normal: { show: false, formatter: function (params) { if (params.name.length > 9 && params.name.length < 35) { return params.name.substring(0, 20) + '\n' + params.name.substring(20, params.name.length) + ':' + params.value; } else if (params.name.length > 35) { return params.name.substring(0, 18) + '\n' + params.name.substring(18, 36) + '\n' + params.name.substring(36, params.name.length) + ':' + params.value; } else { return params.name + ':' + params.value; } } }, emphasis: { // position: 'left', show: true, textStyle: { color: '#fff', fontSize: '14', fontWeight: 'bold' }, labelLine: { show: true }, length: 1 } } }] }; keywordPieChart.setOption(option); } function Code(val, row, index) { let num = index + 1 return "" + num + "" // return index + 1; } function Code(val, row, index) { let num = index + 1 return "" + num + "" // return index + 1; } function getKeyName(v, r) { for (let i = 0; i < keyidArr.length; i++) { if (keyidArr[i].id == keyid) { if (keyidArr[0].id == keyid) { console.log('1111', keyname) $('.backKey_icon').css('display', 'none') } else { $('.backKey_icon').css('display', 'block') } } } return '' + v + '' } function getKeyBili(v) { return "
" + v + "
" } function getKeyNum(v) { return "
" + v + "
" } //办理时长 function timeSecTable(dom, type) { getTimes('.dataTT') var $tableLeft = $(dom); $tableLeft.bootstrapTable('destroy'); //初始化表格,动态从服务器加载数据 $tableLeft.bootstrapTable({ method: "get", //使用get请求到服务器获取数据 url: huayi.config.callcenter_url + "/InfoNew/GetDeptDayTime", striped: false, //表格显示条纹 pagination: false, //启动分页 pageSize: 12, //每页显示的记录数 pageNumber: 1, //当前第几页 fixedColumns: false, fixedNumber: 3, pageList: [5, 10, 20, 50, 100], //记录数可选列表 search: false, //是否启用查询 showColumns: false, //显示下拉框勾选要显示的列 showRefresh: false, //显示刷新按钮 sidePagination: "server", //表示服务端请求 //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder //设置为limit可以获取limit, offset, search, sort, order queryParamsType: "undefined", queryParams: function queryParams(params) { //设置查询参数 var param = { type: type }; return param; }, onLoadSuccess: function (data) { //加载成功时执行 // data.reverse(); const newDataL = {}; newDataL.state = "success"; newDataL.message = "加载成功"; newDataL.rows = data; $tableLeft.bootstrapTable('load', newDataL); }, onLoadError: function () { //加载失败时执行 layer.msg("加载数据失败", { time: 1500, icon: 2 }); } }); } //办理时长表格操作 function getCompanyName(v, r) { return '' + v + '' } function trend(val, row) { var str = ''; if (row.trend.substring(0, 1) == '-' && row.trend.length > 1) { str = ''; } else if (row.trend.substring(0, 1) != '-' && row.trend.length > 1) { str = ''; } else { str = ''; } return str } //绩效考核 function testSecTable(id, type, group, value) { var $tableLeft = $(id); $tableLeft.bootstrapTable('destroy'); //初始化表格,动态从服务器加载数据 $tableLeft.bootstrapTable({ method: "get", //使用get请求到服务器获取数据 url: huayi.config.callcenter_url + "/InfoNew/GetDeptDeptAchievements", striped: false, //表格显示条纹 pagination: false, //启动分页 pageSize: 12, //每页显示的记录数 pageNumber: 1, //当前第几页 fixedColumns: false, fixedNumber: 3, pageList: [5, 10, 20, 50, 100], //记录数可选列表 search: false, //是否启用查询 showColumns: false, //显示下拉框勾选要显示的列 showRefresh: false, //显示刷新按钮 sidePagination: "server", //表示服务端请求 //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder //设置为limit可以获取limit, offset, search, sort, order queryParamsType: "undefined", queryParams: function queryParams(params) { //设置查询参数 return { type: type, starttime: value && value.split(' ~ ')[0], endtime: value && value.split(' ~ ')[1] } }, onLoadSuccess: function (data) { //加载成功时执行 const newDataL = {}; const typeData1 = []; const typeData2 = []; var max; for (var i = 0; i < data.length; i++) { for (var j = i; j < data.length; j++) { if (data[i].total < data[j].total) { max = data[j]; data[j] = data[i]; data[i] = max; } } } if (type == 1) { data.forEach(function (v, n) { if (v.workordrcount <= 10) { typeData1.push(v) } else { typeData2.push(v) } }) if (group == 0) { newDataL.rows = typeData2; } else if (group == 1) { newDataL.rows = typeData1; } } else { newDataL.rows = data; } newDataL.state = "success"; newDataL.message = "加载成功"; console.log(newDataL) $tableLeft.bootstrapTable('load', newDataL); }, onLoadError: function () { //加载失败时执行 layer.msg("加载数据失败", { time: 1500, icon: 2 }); } }); } //绩效考核表格操作 function getRank(val, row, index) { return index + 1 } //工单数量 function getWorkOrders(val, row) { return '' + val + '' } //不满意数量 function getDissatisfied(val, row) { return '' + val + '' } //超期数量 function getOverdue(val, row) { return '' + val + '' } function getBackWorkOrders(val, row) { return '' + val + '' } function getBacCkWorkOrders(val, row) { return '' + val + '' } function awaySort(objArr, key) { let result = objArr.slice(0); return result.sort((a, b) => b[key] -a[key] ); } //热线整合受理情况&重大事件 function getHonelineChart2(data, dom) { data = awaySort(data,"landArea") data.length = 10 let hotline2 = echarts.init(document.getElementById(dom)); const CubeLeft = echarts.graphic.extendShape({ shape: { x: 0, y: 0 }, buildPath: function (ctx, shape) { const xAxisPoint = shape.xAxisPoint const c0 = [shape.x, shape.y] const c1 = [shape.x - 20, shape.y - 4] const c2 = [xAxisPoint[0] - 20, xAxisPoint[1] - 4] const c3 = [xAxisPoint[0], xAxisPoint[1]] ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]) .closePath() } }) const CubeRight = echarts.graphic.extendShape({ shape: { x: 0, y: 0 }, buildPath: function (ctx, shape) { const xAxisPoint = shape.xAxisPoint const c1 = [shape.x, shape.y] const c2 = [xAxisPoint[0], xAxisPoint[1]] const c3 = [xAxisPoint[0] + 8, xAxisPoint[1] - 4] const c4 = [shape.x + 8, shape.y - 4] ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]) .closePath() } }) const CubeTop = echarts.graphic.extendShape({ shape: { x: 0, y: 0 }, buildPath: function (ctx, shape) { // 逆时针 角 y 负数向上 X 负数向左 const c1 = [shape.x, shape.y] const c2 = [shape.x + 8, shape.y - 4] const c3 = [shape.x - 11, shape.y - 8] const c4 = [shape.x - 20, shape.y - 4] ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]) .closePath() } }) echarts.graphic.registerShape('CubeLeft', CubeLeft) echarts.graphic.registerShape('CubeRight', CubeRight) echarts.graphic.registerShape('CubeTop', CubeTop) let MAX = [] let VALUE = [] let LEV = [] let chartData = [].concat(data) chartData.forEach(item => { VALUE.push(item.landArea) LEV.push(item.level) }) let maxItem = [].concat(VALUE).sort((a, b) => b - a)[0] let SUM = 0 for (let item of VALUE) { SUM += item MAX.push(maxItem) } option = { tooltip: { trigger: 'item', textStyle: { color: '#ffe400', fontSize: '16', fontWeight: '500' }, position: 'top', backgroundColor: 'rgba(250,250,250,0)', transitionDuration: 0.4, formatter: function (params) { return '
' + VALUE[params.dataIndex] + '
'; } }, grid: { right: "5%", top: "20%", left: "5%", bottom: "5%", containLabel: true }, xAxis: { type: 'category', data: LEV, axisLine: { show: true, lineStyle: { color: '#687e89' } }, offset: 10, axisTick: { show: false }, axisLabel: { fontSize: 14, rotate: -45, color: '#fff' } }, yAxis: [{ nameTextStyle: { color: "#f4f5f5", padding: [0, 0, 10, -5], fontSize: 16 }, axisLabel: { color: "#f4f5f5", fontSize: 16 }, axisTick: { lineStyle: { color: "#687f8a", width: 1 }, show: true }, splitLine: { show: true, lineStyle: { color: "#687f8a", type: "dashed" } }, axisLine: { lineStyle: { color: "#687f8a", width: 1, type: "solid" }, show: true, // "symbol":['none', 'arrow'], symbol: ['none', 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20' ], symbolOffset: 5, symbolSize: [35, 38], }, name: "条" }], series: [{ type: 'custom', renderItem: (params, api) => { const location = api.coord([api.value(0), api.value(1)]) return { type: 'group', children: [{ type: 'CubeLeft', shape: { api, xValue: api.value(0), yValue: api.value(1), x: location[0], y: location[1], xAxisPoint: api.coord([api.value(0), 0]) }, style: { fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#3fffea' }, { offset: 1, color: '#007eff' }]) }, }, { type: 'CubeRight', shape: { api, xValue: api.value(0), yValue: api.value(1), x: location[0], y: location[1], xAxisPoint: api.coord([api.value(0), 0]) }, style: { fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#2fbeaf' // 顶部 }, { offset: 1, color: '#015fbf' // 底部 }]) } }, { type: 'CubeTop', shape: { api, xValue: api.value(0), yValue: api.value(1), x: location[0], y: location[1], xAxisPoint: api.coord([api.value(0), 0]) }, style: { fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#9ffff5' }, { offset: 1, color: '#9ffff5' }]) }, } ] } }, data: VALUE }, { type: 'bar', itemStyle: { color: 'rgba(255,255,255,0)' }, emphasis: { itemStyle: { opacity: 0.2, color: 'rgb(60,118,77)' } }, data: MAX },] } hotline2.setOption(option); if (dom == 'hotline2') { hotline2.on('click', function (params) { workTable('', '', '', params.name, '', '', '', '', 0) }) } else if (dom == 'events') { hotline2.on('click', function (params) { console.log() var keyValue = getKey(data,'level',params.name,'key') workTable('', '', '', '', "", '', '', keyValue, 0) }) } else if (dom == 'channel') { hotline2.on('click', function (params) { // console.log(params) sourceCountId.forEach(function (v, n) { if (v.name == params.name) { workTable('', '', '', '', '', '', '', '', 0, '', v.id) } }) }) } } function getKey(data,key1,value,key2){ var dataValue data.forEach(function (ele) { if (ele[key1]===value) { dataValue =ele[key2] } }) return dataValue } //受理工单类型 function getAcceptanceType() { var $tableLeft = $('#acceptancelist'); $tableLeft.bootstrapTable('destroy'); //初始化表格,动态从服务器加载数据 $tableLeft.bootstrapTable({ method: "get", //使用get请求到服务器获取数据 url: huayi.config.callcenter_url + "/InfoNew/GetTypeCount", striped: false, //表格显示条纹 pagination: false, //启动分页 pageSize: 12, //每页显示的记录数 pageNumber: 1, //当前第几页 fixedColumns: false, fixedNumber: 3, pageList: [5, 10, 20, 50, 100], //记录数可选列表 search: false, //是否启用查询 showColumns: false, //显示下拉框勾选要显示的列 showRefresh: false, //显示刷新按钮 sidePagination: "server", //表示服务端请求 //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder //设置为limit可以获取limit, offset, search, sort, order queryParamsType: "undefined", queryParams: function queryParams(params) { //设置查询参数 var param = { timetype:typeCountDataType } return param }, onLoadSuccess: function (data) { //加载成功时执行 const newDataL = {}; let handTotal = 0; newDataL.state = data.state; newDataL.message = data.message; newDataL.rows = data.data; $tableLeft.bootstrapTable('load', newDataL); new doAjax({ url: huayi.config.callcenter_url + "/InfoNew/GetHandling", data: { timetype:typeCountDataType }, callBack: function (res) { let handingData = [{ value: res[0].db, name: '督办' }, { value: res[0].zhib, name: '直办' }, { value: res[0].zub, name: '转办' }, { value: res[0].cb, name: '催办' } ] handTotal = res[0].db + res[0].zhib + res[0].zub + res[0].cb; $('.acceptanceType_wrap .total').text(handTotal); getTimes('.statisticsTime') getHandling(handingData); } }); }, onLoadError: function () { //加载失败时执行 layer.msg("加载数据失败", { time: 1500, icon: 2 }); } }); } function getHandling(data) { let sortPie = echarts.init(document.getElementById('acceptancePie')); option = { legend: [{ icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`, orient: 'vertical', data: ['督办', '直办', '转办', '催办'], left: '80%', top: 'center', align: 'left', textStyle: { color: "#fff", fontSize: 18 }, padding: [10, 60], itemGap: 20 }], color: ['#c046ff', '#00a8ff', '#00ffe4', '#f1b31e'], series: [{ name: '访问来源', type: 'pie', radius: '76%', data: data, emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } }, label: { normal: { show: false, formatter: function (params) { return params.name + ':' + params.value // return }, }, emphasis: { position: 'left', show: true, textStyle: { color: '#fff', fontSize: '18', fontWeight: 'bold' }, length: 1 } }, }] }; sortPie.setOption(option); sortPie.on('click', function (params) { console.log(params.name) if (params.name == '直办') { workTable('', '', '', '', '', '', '', '', 0, 2) } else if (params.name == '督办') { workTable('', '', '', '', '', '', '', '', 0, 1) } else if (params.name == '转办') { workTable('', '', '', '', '', '', '', '', 0, 3) } else { workTable('', '', '', '', '', '', '', '', 0, 4) } }) } function getAcceptanceName(val, row) { if (row.type == '咨询') { return '' + val + '' } else if (row.type == '投诉') { return '' + val + '' } else if (row.type == '建议') { return '' + val + '' } else if (row.type == '其他') { return '' + val + '' } else if (row.type == '求助') { return '' + val + '' } else if (row.type == '表扬') { return '' + val + '' } else if (row.type == '举报') { return '' + val + '' } } //时段话务 function trafficMonthChart(hours, monthCount, dayCount) { let traffic = echarts.init(document.getElementById('traffic2')); option = { tooltip: { trigger: 'axis', axisPointer: { show: true, type: 'line', lineStyle: { type: 'dashed' } }, textStyle: { color: '#fff', fontSize: 16, fontWeight: '600', }, position: ['75%', '55%'], backgroundColor: 'rgba(250,250,250,0)', formatter: function (params) { console.log() let str = '
接通率:' + ((params[1].value / params[0].value) * 100).toFixed(0) + '%
' return str; } }, grid: { top: '18%', bottom: '12%' }, xAxis: [{ type: "category", boundaryGap: false, scale: true, axisLabel: { formatter: '{value}', fontSize: 13, margin: 10, textStyle: { color: "#f4f4f8" } }, axisLine: { show: true, lineStyle: { color: "#525fa6" } }, splitLine: { show: false, lineStyle: { color: "#243753" } }, axisTick: { show: false }, data: hours }], yAxis: [{ boundaryGap: false, type: "value", // scale:true, axisLabel: { textStyle: { color: "#f4f4f8" } }, nameTextStyle: { color: "#fff", fontSize: 12, lineHeight: 40 }, splitLine: { show: true, lineStyle: { color: "#516cb8", type: "dashed" } }, axisLine: { lineStyle: { color: "#8393c8", width: 1, type: "solid" }, show: true, // "symbol":['none', 'arrow'], symbol: ['none', 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20' ], symbolOffset: 5, symbolSize: [35, 38], }, name: "条" }], series: [{ name: "话务量", type: "line", smooth: true, showSymbol: false, symbol: 'circle', symbolSize: 4, zlevel: 3, itemStyle: { color: '#08fcff' }, lineStyle: { normal: { width: 2, color: "#08fcff", } }, label: { show: true, position: 'top', color: '#fff', fontSize: 14, fontWeight: '600', formatter: function (params) { console.log(params) return params.seriesName + ':' + params.value } }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: "#087caa" }, { offset: 0.8, color: "#091576" } ], false ), } }, emphasis: { itemStyle: { color: '#fff', shadowBlur: 10, shadowOffsetX: 1, shadowOffsetY: 1, shadowColor: 'rgb(250,250, 250)' } }, data: monthCount }, { name: "接通量", type: "line", smooth: true, showSymbol: false, symbol: 'circle', symbolSize: 4, zlevel: 3, itemStyle: { color: '#ffe000' }, label: { show: true, position: 'top', color: '#fff', fontSize: 14, fontWeight: '600', formatter: function (params) { return params.seriesName + ':' + params.value } }, lineStyle: { normal: { width: 2, color: "#ffe000", } }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: "#739952" }, { offset: 0.8, color: "#091576" } ], false ), } }, emphasis: { itemStyle: { color: '#fff', shadowBlur: 10, shadowOffsetX: 1, shadowOffsetY: 1, shadowColor: 'rgb(250,250, 250)' } }, data: dayCount }] }; traffic.setOption(option); } function trafficDayChart(dataArr) { let traffic3 = echarts.init(document.getElementById('rexian')); // 头部菱形 const diamondData = dataArr.result.reduce((pre, cur, index) => { pre[index] = cur.data.map((el, id) => el + (pre[index - 1] ? pre[index - 1][id] : 0)) return pre }, []) // color const color = [ [{ offset: 0, color: "#efff37", }, { offset: 0.5, color: "#efff37", }, { offset: 0.5, color: "#d5e700", }, { offset: 1, color: "#d5e700", }], [{ offset: 0, color: "#f67c20", }, { offset: 0.5, color: "#f67c20", }, { offset: 0.5, color: "#cc681e", }, { offset: 1, color: "#cc681e", }], [{ offset: 0, color: "#32ffee", }, { offset: 0.5, color: "#32ffee", }, { offset: 0.5, color: "#00e8d5", }, { offset: 1, color: "#00e8d5", }], [{ offset: 0, color: "#dc0707", }, { offset: 0.5, color: "#dc0707", }, { offset: 0.5, color: "#af0808", }, { offset: 1, color: "#af0808", }], ] // series let series = dataArr.result.reduce((p, c, i, array) => { p.push({ z: i + 1, stack: '总量', type: 'bar', name: c.name, barGap: '-100%', barWidth: 30, data: c.data, itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } }, }, { z: i + 10, type: 'pictorialBar', symbolPosition: 'end', symbol: 'diamond', symbolOffset: [0, '-50%'], symbolSize: [30, 10], data: diamondData[i], itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } }, tooltip: { show: false }, }) // 是否最后一个了? if (p.length === (array.length) * 2) { p.push({ z: array.length * 2, type: "pictorialBar", symbolPosition: "start", data: dataArr.result[0].data, symbol: "diamond", symbolOffset: ["0%", "50%"], symbolSize: [30, 10], itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } }, tooltip: { show: false }, }) return p } return p }, []) // tooltip const tooltip = { trigger: 'axis', axisPointer: { show: true, type: 'line', lineStyle: { type: 'dashed' } }, textStyle: { color: '#ffe400', fontSize: '14' }, backgroundColor: 'rgba(250,250,250,0)', formatter: function (params) { let str = '
' params.forEach(function (v, n) { if (v.seriesName != '上部1') { str += '
' + v.seriesName + ':' + v.value + '
' } }) return str; } } const legend = { data: dataArr.result.map(item => item.name), textStyle: { fontSize: 14, color: '#fff' }, itemWidth: 25, itemHeight: 15, itemGap: 15, // top: '5%', // 禁止点击 selectedMode: false, } // grid const grid = { left: '3%', right: '4%', bottom: '3%', containLabel: true, tooltip: { textStyle: { color: '#fff' } } } // xAxis const xAxis = { axisTick: { show: true }, axisLine: { show: true, lineStyle: { color: "#525fa6" } }, axisLabel: { textStyle: { fontSize: 16, color: '#fff' }, }, data: dataArr.xdata } // yAxis const yAxis = [{ boundaryGap: false, type: "value", // scale:true, axisLabel: { textStyle: { color: "#f4f4f8" } }, nameTextStyle: { color: "#fff", fontSize: 12, lineHeight: 40 }, splitLine: { show: true, lineStyle: { color: "#516cb8", type: "dashed" } } }] // 渲染 option = { tooltip, xAxis, yAxis, series, grid, legend } traffic3.setOption(option) } function getS(dataArr) { let traffic3 = echarts.init(document.getElementById('heji')); // 头部菱形 const diamondData = dataArr.result.reduce((pre, cur, index) => { pre[index] = cur.data.map((el, id) => el + (pre[index - 1] ? pre[index - 1][id] : 0)) return pre }, []) // color const color = [ [{ offset: 0, color: "#efff37", }, { offset: 0.5, color: "#efff37", }, { offset: 0.5, color: "#d5e700", }, { offset: 1, color: "#d5e700", }], [{ offset: 0, color: "#f67c20", }, { offset: 0.5, color: "#f67c20", }, { offset: 0.5, color: "#cc681e", }, { offset: 1, color: "#cc681e", }], [{ offset: 0, color: "#32ffee", }, { offset: 0.5, color: "#32ffee", }, { offset: 0.5, color: "#00e8d5", }, { offset: 1, color: "#00e8d5", }], [{ offset: 0, color: "#dc0707", }, { offset: 0.5, color: "#dc0707", }, { offset: 0.5, color: "#af0808", }, { offset: 1, color: "#af0808", }], ] // series let series = dataArr.result.reduce((p, c, i, array) => { p.push({ z: i + 1, stack: '总量', type: 'bar', name: c.name, barGap: '-100%', barWidth: 30, data: c.data, itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } }, }, { z: i + 10, type: 'pictorialBar', symbolPosition: 'end', symbol: 'diamond', symbolOffset: [0, '-50%'], symbolSize: [30, 10], data: diamondData[i], itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } }, tooltip: { show: false }, }) // 是否最后一个了? if (p.length === (array.length) * 2) { p.push({ z: array.length * 2, type: "pictorialBar", symbolPosition: "start", data: dataArr.result[0].data, symbol: "diamond", symbolOffset: ["0%", "50%"], symbolSize: [30, 10], itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } }, tooltip: { show: false }, }) return p } return p }, []) // tooltip const tooltip = { trigger: 'axis', axisPointer: { show: true, type: 'line', lineStyle: { type: 'dashed' } }, textStyle: { color: '#ffe400', fontSize: '14' }, backgroundColor: 'rgba(250,250,250,0)', formatter: function (params) { let str = '
' params.forEach(function (v, n) { if (v.seriesName != '上部1') { str += '
' + v.seriesName + ':' + v.value + '
' } }) return str; } } // grid const grid = { left: '3%', right: '4%', bottom: '3%', containLabel: true, tooltip: { textStyle: { color: '#fff' } } } // xAxis const xAxis = { axisTick: { show: true }, axisLine: { show: true, lineStyle: { color: "#525fa6" } }, axisLabel: { textStyle: { fontSize: 16, color: '#fff' }, }, data: dataArr.xdata } // yAxis const yAxis = [{ boundaryGap: false, type: "value", // scale:true, axisLabel: { textStyle: { color: "#f4f4f8" } }, nameTextStyle: { color: "#fff", fontSize: 12, lineHeight: 40 }, splitLine: { show: true, lineStyle: { color: "#516cb8", type: "dashed" } } }] // 渲染 option = { tooltip, xAxis, yAxis, series, grid } traffic3.setOption(option) } //坐席监控 //实时话务统计 function getRealTimeTraffi(hours, hrCount, hcCount) { let realTimeTraffi = echarts.init(document.getElementById('realTimeTraffi')); option = { grid: { top: '20%', bottom: '20%' }, legend: { data: ['呼入', '呼出'], textStyle: { color: '#fff', fontSize: 14, padding: [0, 5] }, right: 25, top: -5 }, tooltip: { trigger: 'axis', axisPointer: { show: true, type: 'line', lineStyle: { type: 'dashed' } }, textStyle: { color: '#fff', fontSize: 16, fontWeight: '600', }, backgroundColor: 'rgba(250,250,250,0)', formatter: function (params) { let str = '
' params.forEach(function (v, n) { // if(v.seriesName!='上部1'){ str += '
' + v.seriesName + ':' + v.value + '
' // } }) return str; } }, xAxis: [{ type: "category", boundaryGap: false, scale: true, axisLabel: { formatter: '{value}', fontSize: 13, margin: 10, textStyle: { color: "#f4f4f8" } }, axisLine: { show: true, lineStyle: { color: "#849cc9" } }, splitLine: { show: false, lineStyle: { color: "#849cc9" } }, axisTick: { show: false }, data: hours }], yAxis: [{ boundaryGap: false, type: "value", // scale:true, axisLabel: { textStyle: { color: "#f4f4f8" } }, nameTextStyle: { color: "#fff", fontSize: 12, lineHeight: 40 }, splitLine: { show: true, lineStyle: { color: "#849cc9", type: "dashed" } }, axisLine: { lineStyle: { color: "#849cc9", width: 1, type: "solid" }, show: true, // "symbol":['none', 'arrow'], symbol: ['none', 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20' ], symbolOffset: 5, symbolSize: [35, 38], }, }], series: [{ name: "呼入", type: "line", smooth: true, showSymbol: false, symbol: 'circle', symbolSize: 4, zlevel: 3, itemStyle: { color: '#08fcff' }, lineStyle: { normal: { width: 2, color: "#01cde6", } }, // label: { // show: true, // position: 'top', // color: '#fff', // fontSize: 14, // fontWeight: '600', // formatter: function (params) { // console.log(params) // return params.seriesName + ':' + params.value // } // }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: "#0571ae" }, { offset: 0.8, color: "#093085" } ], false ), } }, emphasis: { itemStyle: { color: '#fff', shadowBlur: 10, shadowOffsetX: 1, shadowOffsetY: 1, shadowColor: 'rgb(250,250, 250)' } }, data: hrCount }, { name: "呼出", type: "line", smooth: true, showSymbol: false, symbol: 'circle', symbolSize: 4, zlevel: 3, itemStyle: { color: '#ffe000' }, // label: { // show: true, // position: 'top', // color: '#fff', // fontSize: 14, // fontWeight: '600', // formatter: function (params) { // return params.seriesName + ':' + params.value // } // }, lineStyle: { normal: { width: 2, color: "#ffd200", } }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [{ offset: 0, color: "#626a55" }, { offset: 0.8, color: "#093085" } ], false ), } }, emphasis: { itemStyle: { color: '#fff', shadowBlur: 10, shadowOffsetX: 1, shadowOffsetY: 1, shadowColor: 'rgb(250,250, 250)' } }, data: hcCount }] }; realTimeTraffi.setOption(option); }