暫無描述

second_index.js 58KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823
  1. // 关键词
  2. let keyidArr = [];
  3. let keyid = 0;
  4. let starKeyId = 0;
  5. let keyname = '';
  6. let keylegend = [];
  7. let nameK = ''
  8. let reg = /\w\d+$/;
  9. $('.backKey_icon').click(function () {
  10. for (let i = 0; i < keyidArr.length; i++) {
  11. if (keyidArr[i].id == keyid) {
  12. console.log(keyidArr[i - 1].id)
  13. $('.keyWordTitle').text(keyidArr[i - 1].name + '问题分类')
  14. $('.head_title').text(keyidArr[i - 1].name + '关键字数据分析')
  15. keyWordTable(keyidArr[i - 1].id);
  16. keyidArr.pop(keyidArr[i].id)
  17. keyid = keyidArr[i - 1].id
  18. }
  19. }
  20. })
  21. $('.closeKey_icon').click(function () {
  22. $('.bulletFrame').hide();
  23. $('.bulletFrameT').hide();
  24. if ($('.bulletFrame').css('display') == 'none') {
  25. $('.body').css('opacity', '1')
  26. }
  27. if ($('.bulletFrameT').css('display') == 'none') {
  28. $('.body').css('opacity', '1')
  29. }
  30. keyidArr = [];
  31. keyid = 0
  32. })
  33. function getKeyClass(id, classId, con) {
  34. $('.bulletFrame').show();
  35. $('.secondLevel_keyWord').show();
  36. $('.secondLevel_keyWord').siblings().hide()
  37. if ($('.bulletFrame').css('display') == 'block') {
  38. $('.body').css('opacity', '0.4')
  39. }
  40. laydate.render({
  41. elem: '#keyDate',
  42. type: 'datetime',
  43. calendar: true,
  44. done: function (value) {
  45. $('.keyWordTitle').text(keyidArr[0].name + '问题分类')
  46. $('.head_title').text(keyidArr[0].name + '关键字数据分析')
  47. keyWordTable(keyidArr[0].id, keyidArr[0].name, value);
  48. }
  49. });
  50. if (classId == '1') {
  51. workTable(id);
  52. } else {
  53. getTimes('.statisticsTime')
  54. keyidArr.push({
  55. name: con,
  56. id: id
  57. })
  58. keyid = id
  59. $('.keyWordTitle').text(con + '问题分类')
  60. $('.head_title').text(con + '关键字数据分析')
  61. keyWordTable(id, con, getNowTime());
  62. }
  63. }
  64. function keyWordTable(id, con, value) {
  65. console.log(value)
  66. var $tableLeft = $('#keyWordlist');
  67. $tableLeft.bootstrapTable('destroy');
  68. //初始化表格,动态从服务器加载数据
  69. $tableLeft.bootstrapTable({
  70. method: "get", //使用get请求到服务器获取数据
  71. url: huayi.config.callcenter_url + "/InfoNew/GetKeyCountByNow",
  72. striped: false, //表格显示条纹
  73. pagination: false, //启动分页
  74. pageSize: 12, //每页显示的记录数
  75. pageNumber: 1, //当前第几页
  76. fixedColumns: false,
  77. fixedNumber: 3,
  78. pageList: [5, 10, 20, 50, 100], //记录数可选列表
  79. search: false, //是否启用查询
  80. showColumns: false, //显示下拉框勾选要显示的列
  81. showRefresh: false, //显示刷新按钮
  82. sidePagination: "server", //表示服务端请求
  83. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  84. //设置为limit可以获取limit, offset, search, sort, order
  85. queryParamsType: "undefined",
  86. queryParams: function queryParams(params) { //设置查询参数
  87. var param = {
  88. pid: id,
  89. token: $.cookie("token"),
  90. timetype:keyCountDataType,
  91. date: value
  92. }
  93. return param
  94. },
  95. onLoadSuccess: function (data) { //加载成功时执行
  96. const newDataL = {};
  97. const piData = [];
  98. newDataL.state = data.state;
  99. newDataL.message = data.message;
  100. newDataL.rows = data.data.Date;
  101. data.data.Date.forEach(function (v, n) {
  102. piData.push({
  103. value: v.Count,
  104. name: v.KeyName.replace(reg, '')
  105. })
  106. })
  107. var nameArray = piData.map(item => {
  108. return item.name
  109. })
  110. keyword_chart('keywordPie', nameArray, piData, con);
  111. $('.total').text(data.data.Total)
  112. $('.classTotal').text(data.data.ClaseeCount)
  113. $('.prot').text(data.data.ClassTotal)
  114. $tableLeft.bootstrapTable('load', newDataL);
  115. },
  116. onLoadError: function () { //加载失败时执行
  117. layer.msg("加载数据失败", {
  118. time: 1500,
  119. icon: 2
  120. });
  121. }
  122. });
  123. }
  124. function keyword_chart(dom, nameArray, piData, con) {
  125. let keywordPieChart = echarts.init(document.getElementById(dom));
  126. let keywordNum = [];
  127. let keywordName = [];
  128. var rich = {
  129. percent: {
  130. color: "#FFF",
  131. align: 'right',
  132. fontSize: 15,
  133. fontWeight: '500',
  134. //padding: [0, 5]
  135. }
  136. }
  137. nameArray.forEach(function (v, n) {
  138. keywordNum.push({
  139. num: Number(v.substr(v.length - 2, 2)),
  140. value: v
  141. })
  142. })
  143. let max;
  144. for (let i = 0; i < keywordNum.length; i++) {
  145. for (let j = i; j < keywordNum.length; j++) {
  146. if (keywordNum[i].num < keywordNum[j].num) {
  147. max = keywordNum[j];
  148. keywordNum[j] = keywordNum[i];
  149. keywordNum[i] = max;
  150. }
  151. }
  152. }
  153. keywordNum.forEach(function (v, n) {
  154. keywordName.push(v.value.replace(reg, ''));
  155. })
  156. console.log(keywordName)
  157. keywordName.forEach(function (v, n) {
  158. if (v.length > 20) {
  159. keylegend = [{
  160. 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`,
  161. orient: 'vertical',
  162. top: '610',
  163. // data: keywordName.slice(0, 6),
  164. data: keywordName.slice(0, 1),
  165. width: 28,
  166. height: 25,
  167. textStyle: {
  168. color: '#fff',
  169. padding: [0, 5],
  170. fontSize: 15
  171. },
  172. padding: [5, 10]
  173. }, {
  174. 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`,
  175. orient: 'vertical',
  176. top: '620',
  177. // data: keywordName.slice(6, 12),
  178. data: keywordName.slice(1, 2),
  179. width: 28,
  180. height: 25,
  181. itemGap: 20,
  182. textStyle: {
  183. color: '#fff',
  184. padding: [0, 5],
  185. fontSize: 15
  186. },
  187. padding: [10, 10]
  188. }, {
  189. 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`,
  190. orient: 'vertical',
  191. top: '630',
  192. // data: keywordName.slice(12, keywordName.length),
  193. data: keywordName.slice(2, 3),
  194. width: 28,
  195. height: 25,
  196. textStyle: {
  197. color: '#fff',
  198. padding: [0, 5],
  199. fontSize: 15
  200. },
  201. padding: [20, 10]
  202. },
  203. {
  204. 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`,
  205. orient: 'vertical',
  206. top: '630',
  207. // data: keywordName.slice(12, keywordName.length),
  208. data: keywordName.slice(3, 4),
  209. width: 28,
  210. height: 25,
  211. textStyle: {
  212. color: '#fff',
  213. padding: [0, 5],
  214. fontSize: 15
  215. },
  216. padding: [40, 10]
  217. }, {
  218. 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`,
  219. orient: 'vertical',
  220. top: '630',
  221. // data: keywordName.slice(12, keywordName.length),
  222. data: keywordName.slice(4, 5),
  223. width: 28,
  224. height: 25,
  225. textStyle: {
  226. color: '#fff',
  227. padding: [0, 5],
  228. fontSize: 15
  229. },
  230. padding: [60, 10]
  231. }, {
  232. 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`,
  233. orient: 'vertical',
  234. top: '630',
  235. // data: keywordName.slice(12, keywordName.length),
  236. data: keywordName.slice(5, 6),
  237. width: 28,
  238. height: 25,
  239. textStyle: {
  240. color: '#fff',
  241. padding: [0, 5],
  242. fontSize: 15
  243. },
  244. padding: [80, 10]
  245. }, {
  246. 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`,
  247. orient: 'vertical',
  248. top: '630',
  249. // data: keywordName.slice(12, keywordName.length),
  250. data: keywordName.slice(6, keywordName.length),
  251. width: 28,
  252. height: 25,
  253. textStyle: {
  254. color: '#fff',
  255. padding: [0, 5],
  256. fontSize: 15
  257. },
  258. padding: [100, 10]
  259. }]
  260. } else {
  261. if (con == '营商管理03') {
  262. keylegend = [{
  263. 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`,
  264. orient: 'vertical',
  265. top: '610',
  266. // data: keywordName.slice(0, 6),
  267. data: keywordName.slice(0, 6),
  268. width: 28,
  269. height: 25,
  270. textStyle: {
  271. color: '#fff',
  272. padding: [0, 5],
  273. fontSize: 15
  274. },
  275. padding: [15, 10]
  276. }, {
  277. 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`,
  278. orient: 'vertical',
  279. top: '620',
  280. // data: keywordName.slice(6, 12),
  281. data: keywordName.slice(6, 12),
  282. width: 28,
  283. height: 25,
  284. itemGap: 20,
  285. textStyle: {
  286. color: '#fff',
  287. padding: [0, 5],
  288. fontSize: 15
  289. },
  290. padding: [40, 10]
  291. }, {
  292. 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`,
  293. orient: 'vertical',
  294. top: '630',
  295. // data: keywordName.slice(12, keywordName.length),
  296. data: keywordName.slice(12, 18),
  297. width: 28,
  298. height: 25,
  299. textStyle: {
  300. color: '#fff',
  301. padding: [0, 5],
  302. fontSize: 15
  303. },
  304. padding: [65, 10]
  305. },
  306. {
  307. 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`,
  308. orient: 'vertical',
  309. top: '630',
  310. // data: keywordName.slice(12, keywordName.length),
  311. data: keywordName.slice(18, keywordName.length),
  312. width: 30,
  313. height: 25,
  314. textStyle: {
  315. color: '#fff',
  316. padding: [0, 5],
  317. fontSize: 15
  318. },
  319. padding: [90, 10]
  320. }
  321. ]
  322. } else {
  323. keylegend = [{
  324. 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`,
  325. orient: 'vertical',
  326. top: '610',
  327. // data: keywordName.slice(0, 6),
  328. data: keywordName.slice(0, 5),
  329. width: 28,
  330. height: 25,
  331. textStyle: {
  332. color: '#fff',
  333. padding: [0, 5],
  334. fontSize: 15
  335. },
  336. padding: [15, 10]
  337. }, {
  338. 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`,
  339. orient: 'vertical',
  340. top: '620',
  341. // data: keywordName.slice(6, 12),
  342. data: keywordName.slice(5, 10),
  343. width: 28,
  344. height: 25,
  345. itemGap: 20,
  346. textStyle: {
  347. color: '#fff',
  348. padding: [0, 5],
  349. fontSize: 15
  350. },
  351. padding: [40, 10]
  352. }, {
  353. 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`,
  354. orient: 'vertical',
  355. top: '630',
  356. // data: keywordName.slice(12, keywordName.length),
  357. data: keywordName.slice(10, 15),
  358. width: 28,
  359. height: 25,
  360. textStyle: {
  361. color: '#fff',
  362. padding: [0, 5],
  363. fontSize: 15
  364. },
  365. padding: [65, 10]
  366. },
  367. {
  368. 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`,
  369. orient: 'vertical',
  370. top: '630',
  371. // data: keywordName.slice(12, keywordName.length),
  372. data: keywordName.slice(15, keywordName.length),
  373. width: 30,
  374. height: 25,
  375. textStyle: {
  376. color: '#fff',
  377. padding: [0, 5],
  378. fontSize: 15
  379. },
  380. padding: [90, 10]
  381. }
  382. ]
  383. }
  384. }
  385. })
  386. keywordName.reverse();
  387. option = {
  388. legend: keylegend,
  389. color: ['#008aff', '#88ffb7', '#00bba7', '#fddb6a', '#fb6a76',
  390. '#ff0000', '#e5a0ff', '#9b56ff', '#8200f0', '#68f6ff',
  391. '#FF8352', '#E271DE', '#F8456B', '#3751E6', '#FFC722',
  392. '#00BFA5', "#EAEA26"
  393. ],
  394. series: [{
  395. name: '访问来源',
  396. type: 'pie',
  397. radius: '58%',
  398. data: piData,
  399. emphasis: {
  400. itemStyle: {
  401. shadowBlur: 10,
  402. shadowOffsetX: 0,
  403. shadowColor: 'rgba(0, 0, 0, 0.5)'
  404. }
  405. },
  406. label: {
  407. normal: {
  408. show: false,
  409. formatter: function (params) {
  410. if (params.name.length > 9 && params.name.length < 35) {
  411. return params.name.substring(0, 20) + '\n' + params.name.substring(20, params.name.length) + ':' + params.value;
  412. } else if (params.name.length > 35) {
  413. return params.name.substring(0, 18) + '\n' + params.name.substring(18, 36) + '\n' + params.name.substring(36, params.name.length) + ':' + params.value;
  414. } else {
  415. return params.name + ':' + params.value;
  416. }
  417. }
  418. },
  419. emphasis: {
  420. // position: 'left',
  421. show: true,
  422. textStyle: {
  423. color: '#fff',
  424. fontSize: '14',
  425. fontWeight: 'bold'
  426. },
  427. labelLine: {
  428. show: true
  429. },
  430. length: 1
  431. }
  432. }
  433. }]
  434. };
  435. keywordPieChart.setOption(option);
  436. }
  437. function Code(val, row, index) {
  438. let num = index + 1
  439. return "<span style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width:50px;text-align: center;'>" +
  440. num + "</span>"
  441. // return index + 1;
  442. }
  443. function getKeyName(v, r) {
  444. for (let i = 0; i < keyidArr.length; i++) {
  445. if (keyidArr[i].id == keyid) {
  446. if (keyidArr[0].id == keyid) {
  447. console.log('1111', keyname)
  448. $('.backKey_icon').css('display', 'none')
  449. } else {
  450. $('.backKey_icon').css('display', 'block')
  451. }
  452. }
  453. }
  454. return '<span class="workAct" onclick="getKeyClass(\'' + r.KeyId + '\',\'' + r.ClassCount + '\',\'' + r.KeyName +
  455. '\')">' + v + '</span>'
  456. }
  457. function getKeyBili(v) {
  458. return "<div style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width:70px;margin:0 auto;'>" +
  459. v + "</div>"
  460. }
  461. function getKeyNum(v) {
  462. return "<div style='display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width:29px;margin:0 auto;'>" +
  463. v + "</div>"
  464. }
  465. //办理时长
  466. function timeSecTable(dom, type) {
  467. getTimes('.dataTT')
  468. var $tableLeft = $(dom);
  469. $tableLeft.bootstrapTable('destroy');
  470. //初始化表格,动态从服务器加载数据
  471. $tableLeft.bootstrapTable({
  472. method: "get", //使用get请求到服务器获取数据
  473. url: huayi.config.callcenter_url + "/InfoNew/GetDeptDayTime",
  474. striped: false, //表格显示条纹
  475. pagination: false, //启动分页
  476. pageSize: 12, //每页显示的记录数
  477. pageNumber: 1, //当前第几页
  478. fixedColumns: false,
  479. fixedNumber: 3,
  480. pageList: [5, 10, 20, 50, 100], //记录数可选列表
  481. search: false, //是否启用查询
  482. showColumns: false, //显示下拉框勾选要显示的列
  483. showRefresh: false, //显示刷新按钮
  484. sidePagination: "server", //表示服务端请求
  485. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  486. //设置为limit可以获取limit, offset, search, sort, order
  487. queryParamsType: "undefined",
  488. queryParams: function queryParams(params) { //设置查询参数
  489. var param = {
  490. token: $.cookie("token"),
  491. type: type
  492. };
  493. return param;
  494. },
  495. onLoadSuccess: function (data) { //加载成功时执行
  496. // data.reverse();
  497. const newDataL = {};
  498. newDataL.state = "success";
  499. newDataL.message = "加载成功";
  500. newDataL.rows = data;
  501. $tableLeft.bootstrapTable('load', newDataL);
  502. },
  503. onLoadError: function () { //加载失败时执行
  504. layer.msg("加载数据失败", {
  505. time: 1500,
  506. icon: 2
  507. });
  508. }
  509. });
  510. }
  511. //办理时长表格操作
  512. function getCompanyName(v, r) {
  513. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + r.deptid + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + ''
  514. + '\',\'' + '' + '\',\'' + 0 + '\')">' + v + '</span>'
  515. }
  516. function trend(val, row) {
  517. var str = '';
  518. if (row.trend.substring(0, 1) == '-' && row.trend.length > 1) {
  519. str = '<ul class="tool_downs">' +
  520. '<li><img src="./image/second/down_arrow.png" alt="" style="vertical-align: middle;padding-right: 3px;">' + row
  521. .trend.substring(1) + '<li>' +
  522. '</ul>';
  523. } else if (row.trend.substring(0, 1) != '-' && row.trend.length > 1) {
  524. str = '<ul class="tool_downs">' +
  525. '<li><img src="./image/second/up_arrow.png" alt="" style="vertical-align: middle;padding-right: 3px;">' + row
  526. .trend + '<li>' +
  527. '</ul>';
  528. } else {
  529. str = '<ul class="tool_downs">' +
  530. '<li>' + row.trend + '<li>' +
  531. '</ul>';
  532. }
  533. return str
  534. }
  535. //绩效考核
  536. function testSecTable(id, type, group, value) {
  537. var $tableLeft = $(id);
  538. $tableLeft.bootstrapTable('destroy');
  539. //初始化表格,动态从服务器加载数据
  540. $tableLeft.bootstrapTable({
  541. method: "get", //使用get请求到服务器获取数据
  542. url: huayi.config.callcenter_url + "/InfoNew/GetDeptDeptAchievements",
  543. striped: false, //表格显示条纹
  544. pagination: false, //启动分页
  545. pageSize: 12, //每页显示的记录数
  546. pageNumber: 1, //当前第几页
  547. fixedColumns: false,
  548. fixedNumber: 3,
  549. pageList: [5, 10, 20, 50, 100], //记录数可选列表
  550. search: false, //是否启用查询
  551. showColumns: false, //显示下拉框勾选要显示的列
  552. showRefresh: false, //显示刷新按钮
  553. sidePagination: "server", //表示服务端请求
  554. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  555. //设置为limit可以获取limit, offset, search, sort, order
  556. queryParamsType: "undefined",
  557. queryParams: function queryParams(params) { //设置查询参数
  558. return {
  559. token: $.cookie("token"),
  560. type: type,
  561. starttime: value && value.split(' ~ ')[0],
  562. endtime: value && value.split(' ~ ')[1]
  563. }
  564. },
  565. onLoadSuccess: function (data) { //加载成功时执行
  566. const newDataL = {};
  567. const typeData1 = [];
  568. const typeData2 = [];
  569. var max;
  570. for (var i = 0; i < data.length; i++) {
  571. for (var j = i; j < data.length; j++) {
  572. if (data[i].total < data[j].total) {
  573. max = data[j];
  574. data[j] = data[i];
  575. data[i] = max;
  576. }
  577. }
  578. }
  579. if (type == 1) {
  580. data.forEach(function (v, n) {
  581. if (v.workordrcount <= 10) {
  582. typeData1.push(v)
  583. } else {
  584. typeData2.push(v)
  585. }
  586. })
  587. if (group == 0) {
  588. newDataL.rows = typeData2;
  589. } else if (group == 1) {
  590. newDataL.rows = typeData1;
  591. }
  592. } else {
  593. newDataL.rows = data;
  594. }
  595. newDataL.state = "success";
  596. newDataL.message = "加载成功";
  597. console.log(newDataL)
  598. $tableLeft.bootstrapTable('load', newDataL);
  599. },
  600. onLoadError: function () { //加载失败时执行
  601. layer.msg("加载数据失败", {
  602. time: 1500,
  603. icon: 2
  604. });
  605. }
  606. });
  607. }
  608. //绩效考核表格操作
  609. function getRank(val, row, index) {
  610. return index + 1
  611. }
  612. //工单数量
  613. function getWorkOrders(val, row) {
  614. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + row.deptid + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + ''
  615. + '\',\'' + '' + '\',\'' + 0 + '\',\'' + '' + '\',\'' + '' + '\',\'' + 3 + '\')">' + val + '</span>'
  616. }
  617. //不满意数量
  618. function getDissatisfied(val, row) {
  619. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + row.deptid + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + ''
  620. + '\',\'' + '' + '\',\'' + 0 + '\',\'' + '' + '\',\'' + '' + '\',\'' + 4 + '\')">' + val + '</span>'
  621. }
  622. //超期数量
  623. function getOverdue(val, row) {
  624. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + row.deptid + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + ''
  625. + '\',\'' + '' + '\',\'' + 0 + '\',\'' + '' + '\',\'' + '' + '\',\'' + 5 + '\')">' + val + '</span>'
  626. }
  627. function getBackWorkOrders(val, row) {
  628. return '<span class="workAct" onclick="backWorkTable(\'' + row.deptid + '\',\'' + 0 + '\')">' + val + '</span>'
  629. }
  630. function getBacCkWorkOrders(val, row) {
  631. return '<span class="workAct" onclick="backWorkTable(\'' + row.deptid + '\',\'' + 1 + '\')">' + val + '</span>'
  632. }
  633. function awaySort(objArr, key) {
  634. let result = objArr.slice(0);
  635. return result.sort((a, b) => b[key] -a[key] );
  636. }
  637. //热线整合受理情况&重大事件
  638. function getHonelineChart2(data, dom) {
  639. data = awaySort(data,"landArea")
  640. data.length = 10
  641. let hotline2 = echarts.init(document.getElementById(dom));
  642. const CubeLeft = echarts.graphic.extendShape({
  643. shape: {
  644. x: 0,
  645. y: 0
  646. },
  647. buildPath: function (ctx, shape) {
  648. const xAxisPoint = shape.xAxisPoint
  649. const c0 = [shape.x, shape.y]
  650. const c1 = [shape.x - 20, shape.y - 4]
  651. const c2 = [xAxisPoint[0] - 20, xAxisPoint[1] - 4]
  652. const c3 = [xAxisPoint[0], xAxisPoint[1]]
  653. ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1])
  654. .closePath()
  655. }
  656. })
  657. const CubeRight = echarts.graphic.extendShape({
  658. shape: {
  659. x: 0,
  660. y: 0
  661. },
  662. buildPath: function (ctx, shape) {
  663. const xAxisPoint = shape.xAxisPoint
  664. const c1 = [shape.x, shape.y]
  665. const c2 = [xAxisPoint[0], xAxisPoint[1]]
  666. const c3 = [xAxisPoint[0] + 8, xAxisPoint[1] - 4]
  667. const c4 = [shape.x + 8, shape.y - 4]
  668. ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1])
  669. .closePath()
  670. }
  671. })
  672. const CubeTop = echarts.graphic.extendShape({
  673. shape: {
  674. x: 0,
  675. y: 0
  676. },
  677. buildPath: function (ctx, shape) {
  678. // 逆时针 角 y 负数向上 X 负数向左
  679. const c1 = [shape.x, shape.y]
  680. const c2 = [shape.x + 8, shape.y - 4]
  681. const c3 = [shape.x - 11, shape.y - 8]
  682. const c4 = [shape.x - 20, shape.y - 4]
  683. ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1])
  684. .closePath()
  685. }
  686. })
  687. echarts.graphic.registerShape('CubeLeft', CubeLeft)
  688. echarts.graphic.registerShape('CubeRight', CubeRight)
  689. echarts.graphic.registerShape('CubeTop', CubeTop)
  690. let MAX = []
  691. let VALUE = []
  692. let LEV = []
  693. let chartData = [].concat(data)
  694. chartData.forEach(item => {
  695. VALUE.push(item.landArea)
  696. LEV.push(item.level)
  697. })
  698. let maxItem = [].concat(VALUE).sort((a, b) => b - a)[0]
  699. let SUM = 0
  700. for (let item of VALUE) {
  701. SUM += item
  702. MAX.push(maxItem)
  703. }
  704. option = {
  705. tooltip: {
  706. trigger: 'item',
  707. textStyle: {
  708. color: '#ffe400',
  709. fontSize: '16',
  710. fontWeight: '500'
  711. },
  712. position: 'top',
  713. backgroundColor: 'rgba(250,250,250,0)',
  714. transitionDuration: 0.4,
  715. formatter: function (params) {
  716. return '<div style="background-image: url(image/second/reminder_box2.png);width:50px;height:33px;line-height:30px;background-size: 100% 100%;text-align:center;">' +
  717. VALUE[params.dataIndex] + '</div>';
  718. }
  719. },
  720. grid: {
  721. right: "5%",
  722. top: "20%",
  723. left: "5%",
  724. bottom: "5%",
  725. containLabel: true
  726. },
  727. xAxis: {
  728. type: 'category',
  729. data: LEV,
  730. axisLine: {
  731. show: true,
  732. lineStyle: {
  733. color: '#687e89'
  734. }
  735. },
  736. offset: 10,
  737. axisTick: {
  738. show: false
  739. },
  740. axisLabel: {
  741. fontSize: 14,
  742. rotate: -45,
  743. color: '#fff'
  744. }
  745. },
  746. yAxis: [{
  747. nameTextStyle: {
  748. color: "#f4f5f5",
  749. padding: [0, 0, 10, -5],
  750. fontSize: 16
  751. },
  752. axisLabel: {
  753. color: "#f4f5f5",
  754. fontSize: 16
  755. },
  756. axisTick: {
  757. lineStyle: {
  758. color: "#687f8a",
  759. width: 1
  760. },
  761. show: true
  762. },
  763. splitLine: {
  764. show: true,
  765. lineStyle: {
  766. color: "#687f8a",
  767. type: "dashed"
  768. }
  769. },
  770. axisLine: {
  771. lineStyle: {
  772. color: "#687f8a",
  773. width: 1,
  774. type: "solid"
  775. },
  776. show: true,
  777. // "symbol":['none', 'arrow'],
  778. symbol: ['none',
  779. 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20'
  780. ],
  781. symbolOffset: 5,
  782. symbolSize: [35, 38],
  783. },
  784. name: "条"
  785. }],
  786. series: [{
  787. type: 'custom',
  788. renderItem: (params, api) => {
  789. const location = api.coord([api.value(0), api.value(1)])
  790. return {
  791. type: 'group',
  792. children: [{
  793. type: 'CubeLeft',
  794. shape: {
  795. api,
  796. xValue: api.value(0),
  797. yValue: api.value(1),
  798. x: location[0],
  799. y: location[1],
  800. xAxisPoint: api.coord([api.value(0), 0])
  801. },
  802. style: {
  803. fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  804. offset: 0,
  805. color: '#3fffea'
  806. }, {
  807. offset: 1,
  808. color: '#007eff'
  809. }])
  810. },
  811. },
  812. {
  813. type: 'CubeRight',
  814. shape: {
  815. api,
  816. xValue: api.value(0),
  817. yValue: api.value(1),
  818. x: location[0],
  819. y: location[1],
  820. xAxisPoint: api.coord([api.value(0), 0])
  821. },
  822. style: {
  823. fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  824. offset: 0,
  825. color: '#2fbeaf' // 顶部
  826. }, {
  827. offset: 1,
  828. color: '#015fbf' // 底部
  829. }])
  830. }
  831. }, {
  832. type: 'CubeTop',
  833. shape: {
  834. api,
  835. xValue: api.value(0),
  836. yValue: api.value(1),
  837. x: location[0],
  838. y: location[1],
  839. xAxisPoint: api.coord([api.value(0), 0])
  840. },
  841. style: {
  842. fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  843. offset: 0,
  844. color: '#9ffff5'
  845. }, {
  846. offset: 1,
  847. color: '#9ffff5'
  848. }])
  849. },
  850. }
  851. ]
  852. }
  853. },
  854. data: VALUE
  855. }, {
  856. type: 'bar',
  857. itemStyle: {
  858. color: 'rgba(255,255,255,0)'
  859. },
  860. emphasis: {
  861. itemStyle: {
  862. opacity: 0.2,
  863. color: 'rgb(60,118,77)'
  864. }
  865. },
  866. data: MAX
  867. },]
  868. }
  869. hotline2.setOption(option);
  870. if (dom == 'hotline2') {
  871. hotline2.on('click', function (params) {
  872. workTable('', '', '', params.name, '', '', '', '', 0)
  873. })
  874. } else if (dom == 'events') {
  875. hotline2.on('click', function (params) {
  876. console.log()
  877. var keyValue = getKey(data,'level',params.name,'key')
  878. workTable('', '', '', '', "", '', '', keyValue, 0)
  879. })
  880. } else if (dom == 'channel') {
  881. hotline2.on('click', function (params) {
  882. // console.log(params)
  883. sourceCountId.forEach(function (v, n) {
  884. if (v.name == params.name) {
  885. workTable('', '', '', '', '', '', '', '', 0, '', v.id)
  886. }
  887. })
  888. })
  889. }
  890. }
  891. function getKey(data,key1,value,key2){
  892. var dataValue
  893. data.forEach(function (ele) {
  894. if (ele[key1]===value) {
  895. dataValue =ele[key2]
  896. }
  897. })
  898. return dataValue
  899. }
  900. //受理工单类型
  901. function getAcceptanceType() {
  902. var $tableLeft = $('#acceptancelist');
  903. $tableLeft.bootstrapTable('destroy');
  904. //初始化表格,动态从服务器加载数据
  905. $tableLeft.bootstrapTable({
  906. method: "get", //使用get请求到服务器获取数据
  907. url: huayi.config.callcenter_url + "/InfoNew/GetTypeCount",
  908. striped: false, //表格显示条纹
  909. pagination: false, //启动分页
  910. pageSize: 12, //每页显示的记录数
  911. pageNumber: 1, //当前第几页
  912. fixedColumns: false,
  913. fixedNumber: 3,
  914. pageList: [5, 10, 20, 50, 100], //记录数可选列表
  915. search: false, //是否启用查询
  916. showColumns: false, //显示下拉框勾选要显示的列
  917. showRefresh: false, //显示刷新按钮
  918. sidePagination: "server", //表示服务端请求
  919. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  920. //设置为limit可以获取limit, offset, search, sort, order
  921. queryParamsType: "undefined",
  922. queryParams: function queryParams(params) { //设置查询参数
  923. var param = {
  924. token: $.cookie("token"),
  925. timetype:typeCountDataType
  926. }
  927. return param
  928. },
  929. onLoadSuccess: function (data) { //加载成功时执行
  930. const newDataL = {};
  931. let handTotal = 0;
  932. newDataL.state = data.state;
  933. newDataL.message = data.message;
  934. newDataL.rows = data.data;
  935. $tableLeft.bootstrapTable('load', newDataL);
  936. new doAjax({
  937. url: huayi.config.callcenter_url + "/InfoNew/GetHandling",
  938. data: {
  939. token: $.cookie("token"),
  940. timetype:typeCountDataType
  941. },
  942. callBack: function (res) {
  943. let handingData = [{
  944. value: res[0].db,
  945. name: '督办'
  946. }, {
  947. value: res[0].zhib,
  948. name: '直办'
  949. }, {
  950. value: res[0].zub,
  951. name: '转办'
  952. },
  953. {
  954. value: res[0].cb,
  955. name: '催办'
  956. }
  957. ]
  958. handTotal = res[0].db + res[0].zhib + res[0].zub + res[0].cb;
  959. $('.acceptanceType_wrap .total').text(handTotal);
  960. getTimes('.statisticsTime')
  961. getHandling(handingData);
  962. }
  963. });
  964. },
  965. onLoadError: function () { //加载失败时执行
  966. layer.msg("加载数据失败", {
  967. time: 1500,
  968. icon: 2
  969. });
  970. }
  971. });
  972. }
  973. function getHandling(data) {
  974. let sortPie = echarts.init(document.getElementById('acceptancePie'));
  975. option = {
  976. legend: [{
  977. 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`,
  978. orient: 'vertical',
  979. data: ['督办', '直办', '转办', '催办'],
  980. left: '80%',
  981. top: 'center',
  982. align: 'left',
  983. textStyle: {
  984. color: "#fff",
  985. fontSize: 18
  986. },
  987. padding: [10, 60],
  988. itemGap: 20
  989. }],
  990. color: ['#c046ff', '#00a8ff', '#00ffe4', '#f1b31e'],
  991. series: [{
  992. name: '访问来源',
  993. type: 'pie',
  994. radius: '76%',
  995. data: data,
  996. emphasis: {
  997. itemStyle: {
  998. shadowBlur: 10,
  999. shadowOffsetX: 0,
  1000. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1001. }
  1002. },
  1003. label: {
  1004. normal: {
  1005. show: false,
  1006. formatter: function (params) {
  1007. return params.name + ':' + params.value
  1008. // return
  1009. },
  1010. },
  1011. emphasis: {
  1012. position: 'left',
  1013. show: true,
  1014. textStyle: {
  1015. color: '#fff',
  1016. fontSize: '18',
  1017. fontWeight: 'bold'
  1018. },
  1019. length: 1
  1020. }
  1021. },
  1022. }]
  1023. };
  1024. sortPie.setOption(option);
  1025. sortPie.on('click', function (params) {
  1026. console.log(params.name)
  1027. if (params.name == '直办') {
  1028. workTable('', '', '', '', '', '', '', '', 0, 2)
  1029. } else if (params.name == '督办') {
  1030. workTable('', '', '', '', '', '', '', '', 0, 1)
  1031. } else if (params.name == '转办') {
  1032. workTable('', '', '', '', '', '', '', '', 0, 3)
  1033. } else {
  1034. workTable('', '', '', '', '', '', '', '', 0, 4)
  1035. }
  1036. })
  1037. }
  1038. function getAcceptanceName(val, row) {
  1039. if (row.type == '咨询') {
  1040. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 9 +
  1041. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1042. } else if (row.type == '投诉') {
  1043. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 11 +
  1044. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1045. } else if (row.type == '建议') {
  1046. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 12 +
  1047. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1048. } else if (row.type == '其他') {
  1049. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 90 +
  1050. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1051. } else if (row.type == '求助') {
  1052. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 10 +
  1053. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1054. } else if (row.type == '表扬') {
  1055. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 13 +
  1056. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1057. } else if (row.type == '举报') {
  1058. return '<span class="workAct" onclick="workTable(\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + '' + '\',\'' + 89 +
  1059. '\',\'' + '' + '\',\'' + '' + '\',\'' + 0 + '\')">' + val + '</span>'
  1060. }
  1061. }
  1062. //时段话务
  1063. function trafficMonthChart(hours, monthCount, dayCount) {
  1064. let traffic = echarts.init(document.getElementById('traffic2'));
  1065. option = {
  1066. tooltip: {
  1067. trigger: 'axis',
  1068. axisPointer: {
  1069. show: true,
  1070. type: 'line',
  1071. lineStyle: {
  1072. type: 'dashed'
  1073. }
  1074. },
  1075. textStyle: {
  1076. color: '#fff',
  1077. fontSize: 16,
  1078. fontWeight: '600',
  1079. },
  1080. position: ['75%', '55%'],
  1081. backgroundColor: 'rgba(250,250,250,0)',
  1082. formatter: function (params) {
  1083. console.log()
  1084. let str = '<div style="position: absolute;top:-315px;left:-423px">接通率:' + ((params[1].value / params[0].value) * 100).toFixed(0) + '%</div>'
  1085. return str;
  1086. }
  1087. },
  1088. grid: {
  1089. top: '18%',
  1090. bottom: '12%'
  1091. },
  1092. xAxis: [{
  1093. type: "category",
  1094. boundaryGap: false,
  1095. scale: true,
  1096. axisLabel: {
  1097. formatter: '{value}',
  1098. fontSize: 13,
  1099. margin: 10,
  1100. textStyle: {
  1101. color: "#f4f4f8"
  1102. }
  1103. },
  1104. axisLine: {
  1105. show: true,
  1106. lineStyle: {
  1107. color: "#525fa6"
  1108. }
  1109. },
  1110. splitLine: {
  1111. show: false,
  1112. lineStyle: {
  1113. color: "#243753"
  1114. }
  1115. },
  1116. axisTick: {
  1117. show: false
  1118. },
  1119. data: hours
  1120. }],
  1121. yAxis: [{
  1122. boundaryGap: false,
  1123. type: "value",
  1124. // scale:true,
  1125. axisLabel: {
  1126. textStyle: {
  1127. color: "#f4f4f8"
  1128. }
  1129. },
  1130. nameTextStyle: {
  1131. color: "#fff",
  1132. fontSize: 12,
  1133. lineHeight: 40
  1134. },
  1135. splitLine: {
  1136. show: true,
  1137. lineStyle: {
  1138. color: "#516cb8",
  1139. type: "dashed"
  1140. }
  1141. },
  1142. axisLine: {
  1143. lineStyle: {
  1144. color: "#8393c8",
  1145. width: 1,
  1146. type: "solid"
  1147. },
  1148. show: true,
  1149. // "symbol":['none', 'arrow'],
  1150. symbol: ['none',
  1151. 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20'
  1152. ],
  1153. symbolOffset: 5,
  1154. symbolSize: [35, 38],
  1155. },
  1156. name: "条"
  1157. }],
  1158. series: [{
  1159. name: "话务量",
  1160. type: "line",
  1161. smooth: true,
  1162. showSymbol: false,
  1163. symbol: 'circle',
  1164. symbolSize: 4,
  1165. zlevel: 3,
  1166. itemStyle: {
  1167. color: '#08fcff'
  1168. },
  1169. lineStyle: {
  1170. normal: {
  1171. width: 2,
  1172. color: "#08fcff",
  1173. }
  1174. },
  1175. label: {
  1176. show: true,
  1177. position: 'top',
  1178. color: '#fff',
  1179. fontSize: 14,
  1180. fontWeight: '600',
  1181. formatter: function (params) {
  1182. console.log(params)
  1183. return params.seriesName + ':' + params.value
  1184. }
  1185. },
  1186. areaStyle: {
  1187. normal: {
  1188. color: new echarts.graphic.LinearGradient(
  1189. 0,
  1190. 0,
  1191. 0,
  1192. 1,
  1193. [{
  1194. offset: 0,
  1195. color: "#087caa"
  1196. },
  1197. {
  1198. offset: 0.8,
  1199. color: "#091576"
  1200. }
  1201. ],
  1202. false
  1203. ),
  1204. }
  1205. },
  1206. emphasis: {
  1207. itemStyle: {
  1208. color: '#fff',
  1209. shadowBlur: 10,
  1210. shadowOffsetX: 1,
  1211. shadowOffsetY: 1,
  1212. shadowColor: 'rgb(250,250, 250)'
  1213. }
  1214. },
  1215. data: monthCount
  1216. }, {
  1217. name: "接通量",
  1218. type: "line",
  1219. smooth: true,
  1220. showSymbol: false,
  1221. symbol: 'circle',
  1222. symbolSize: 4,
  1223. zlevel: 3,
  1224. itemStyle: {
  1225. color: '#ffe000'
  1226. },
  1227. label: {
  1228. show: true,
  1229. position: 'top',
  1230. color: '#fff',
  1231. fontSize: 14,
  1232. fontWeight: '600',
  1233. formatter: function (params) {
  1234. return params.seriesName + ':' + params.value
  1235. }
  1236. },
  1237. lineStyle: {
  1238. normal: {
  1239. width: 2,
  1240. color: "#ffe000",
  1241. }
  1242. },
  1243. areaStyle: {
  1244. normal: {
  1245. color: new echarts.graphic.LinearGradient(
  1246. 0,
  1247. 0,
  1248. 0,
  1249. 1,
  1250. [{
  1251. offset: 0,
  1252. color: "#739952"
  1253. },
  1254. {
  1255. offset: 0.8,
  1256. color: "#091576"
  1257. }
  1258. ],
  1259. false
  1260. ),
  1261. }
  1262. },
  1263. emphasis: {
  1264. itemStyle: {
  1265. color: '#fff',
  1266. shadowBlur: 10,
  1267. shadowOffsetX: 1,
  1268. shadowOffsetY: 1,
  1269. shadowColor: 'rgb(250,250, 250)'
  1270. }
  1271. },
  1272. data: dayCount
  1273. }]
  1274. };
  1275. traffic.setOption(option);
  1276. }
  1277. function trafficDayChart(dataArr) {
  1278. let traffic3 = echarts.init(document.getElementById('rexian'));
  1279. // 头部菱形
  1280. const diamondData = dataArr.result.reduce((pre, cur, index) => {
  1281. pre[index] = cur.data.map((el, id) => el + (pre[index - 1] ? pre[index - 1][id] : 0))
  1282. return pre
  1283. }, [])
  1284. // color
  1285. const color = [
  1286. [{ offset: 0, color: "#efff37", }, { offset: 0.5, color: "#efff37", }, { offset: 0.5, color: "#d5e700", }, { offset: 1, color: "#d5e700", }],
  1287. [{ offset: 0, color: "#f67c20", }, { offset: 0.5, color: "#f67c20", }, { offset: 0.5, color: "#cc681e", }, { offset: 1, color: "#cc681e", }],
  1288. [{ offset: 0, color: "#32ffee", }, { offset: 0.5, color: "#32ffee", }, { offset: 0.5, color: "#00e8d5", }, { offset: 1, color: "#00e8d5", }],
  1289. [{ offset: 0, color: "#dc0707", }, { offset: 0.5, color: "#dc0707", }, { offset: 0.5, color: "#af0808", }, { offset: 1, color: "#af0808", }],
  1290. ]
  1291. // series
  1292. let series = dataArr.result.reduce((p, c, i, array) => {
  1293. p.push({
  1294. z: i + 1,
  1295. stack: '总量',
  1296. type: 'bar',
  1297. name: c.name,
  1298. barGap: '-100%',
  1299. barWidth: 30,
  1300. data: c.data,
  1301. itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
  1302. }, {
  1303. z: i + 10,
  1304. type: 'pictorialBar',
  1305. symbolPosition: 'end',
  1306. symbol: 'diamond',
  1307. symbolOffset: [0, '-50%'],
  1308. symbolSize: [30, 10],
  1309. data: diamondData[i],
  1310. itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
  1311. tooltip: { show: false },
  1312. })
  1313. // 是否最后一个了?
  1314. if (p.length === (array.length) * 2) {
  1315. p.push({
  1316. z: array.length * 2,
  1317. type: "pictorialBar",
  1318. symbolPosition: "start",
  1319. data: dataArr.result[0].data,
  1320. symbol: "diamond",
  1321. symbolOffset: ["0%", "50%"],
  1322. symbolSize: [30, 10],
  1323. itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } },
  1324. tooltip: { show: false },
  1325. })
  1326. return p
  1327. }
  1328. return p
  1329. }, [])
  1330. // tooltip
  1331. const tooltip = {
  1332. trigger: 'axis',
  1333. axisPointer: {
  1334. show: true,
  1335. type: 'line',
  1336. lineStyle: {
  1337. type: 'dashed'
  1338. }
  1339. },
  1340. textStyle: {
  1341. color: '#ffe400',
  1342. fontSize: '14'
  1343. },
  1344. backgroundColor: 'rgba(250,250,250,0)',
  1345. formatter: function (params) {
  1346. let str = '<div style="background-image: url(image/key_frame.png);width:134px;height:130px;line-height:25px;background-size: 100% 100%;padding:13px 10px;">'
  1347. params.forEach(function (v, n) {
  1348. if (v.seriesName != '上部1') {
  1349. str +=
  1350. '<div><span style="color:#fff;width:75px;text-align: center;display: inline-block;">' +
  1351. v.seriesName +
  1352. ':</span><span style:"width:55px;text-align: center;display: inline-block;">' +
  1353. v.value + '</span></div>'
  1354. }
  1355. })
  1356. return str;
  1357. }
  1358. }
  1359. const legend = {
  1360. data: dataArr.result.map(item => item.name),
  1361. textStyle: { fontSize: 14, color: '#fff' },
  1362. itemWidth: 25,
  1363. itemHeight: 15,
  1364. itemGap: 15,
  1365. // top: '5%',
  1366. // 禁止点击
  1367. selectedMode: false,
  1368. }
  1369. // grid
  1370. const grid = {
  1371. left: '3%',
  1372. right: '4%',
  1373. bottom: '3%',
  1374. containLabel: true,
  1375. tooltip: {
  1376. textStyle: {
  1377. color: '#fff'
  1378. }
  1379. }
  1380. }
  1381. // xAxis
  1382. const xAxis = {
  1383. axisTick: { show: true },
  1384. axisLine: {
  1385. show: true,
  1386. lineStyle: {
  1387. color: "#525fa6"
  1388. }
  1389. },
  1390. axisLabel: { textStyle: { fontSize: 16, color: '#fff' }, },
  1391. data: dataArr.xdata
  1392. }
  1393. // yAxis
  1394. const yAxis = [{
  1395. boundaryGap: false,
  1396. type: "value",
  1397. // scale:true,
  1398. axisLabel: {
  1399. textStyle: {
  1400. color: "#f4f4f8"
  1401. }
  1402. },
  1403. nameTextStyle: {
  1404. color: "#fff",
  1405. fontSize: 12,
  1406. lineHeight: 40
  1407. },
  1408. splitLine: {
  1409. show: true,
  1410. lineStyle: {
  1411. color: "#516cb8",
  1412. type: "dashed"
  1413. }
  1414. }
  1415. }]
  1416. // 渲染
  1417. option = {
  1418. tooltip, xAxis, yAxis, series, grid, legend
  1419. }
  1420. traffic3.setOption(option)
  1421. }
  1422. function getS(dataArr) {
  1423. let traffic3 = echarts.init(document.getElementById('heji'));
  1424. // 头部菱形
  1425. const diamondData = dataArr.result.reduce((pre, cur, index) => {
  1426. pre[index] = cur.data.map((el, id) => el + (pre[index - 1] ? pre[index - 1][id] : 0))
  1427. return pre
  1428. }, [])
  1429. // color
  1430. const color = [
  1431. [{ offset: 0, color: "#efff37", }, { offset: 0.5, color: "#efff37", }, { offset: 0.5, color: "#d5e700", }, { offset: 1, color: "#d5e700", }],
  1432. [{ offset: 0, color: "#f67c20", }, { offset: 0.5, color: "#f67c20", }, { offset: 0.5, color: "#cc681e", }, { offset: 1, color: "#cc681e", }],
  1433. [{ offset: 0, color: "#32ffee", }, { offset: 0.5, color: "#32ffee", }, { offset: 0.5, color: "#00e8d5", }, { offset: 1, color: "#00e8d5", }],
  1434. [{ offset: 0, color: "#dc0707", }, { offset: 0.5, color: "#dc0707", }, { offset: 0.5, color: "#af0808", }, { offset: 1, color: "#af0808", }],
  1435. ]
  1436. // series
  1437. let series = dataArr.result.reduce((p, c, i, array) => {
  1438. p.push({
  1439. z: i + 1,
  1440. stack: '总量',
  1441. type: 'bar',
  1442. name: c.name,
  1443. barGap: '-100%',
  1444. barWidth: 30,
  1445. data: c.data,
  1446. itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
  1447. }, {
  1448. z: i + 10,
  1449. type: 'pictorialBar',
  1450. symbolPosition: 'end',
  1451. symbol: 'diamond',
  1452. symbolOffset: [0, '-50%'],
  1453. symbolSize: [30, 10],
  1454. data: diamondData[i],
  1455. itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
  1456. tooltip: { show: false },
  1457. })
  1458. // 是否最后一个了?
  1459. if (p.length === (array.length) * 2) {
  1460. p.push({
  1461. z: array.length * 2,
  1462. type: "pictorialBar",
  1463. symbolPosition: "start",
  1464. data: dataArr.result[0].data,
  1465. symbol: "diamond",
  1466. symbolOffset: ["0%", "50%"],
  1467. symbolSize: [30, 10],
  1468. itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } },
  1469. tooltip: { show: false },
  1470. })
  1471. return p
  1472. }
  1473. return p
  1474. }, [])
  1475. // tooltip
  1476. const tooltip = {
  1477. trigger: 'axis',
  1478. axisPointer: {
  1479. show: true,
  1480. type: 'line',
  1481. lineStyle: {
  1482. type: 'dashed'
  1483. }
  1484. },
  1485. textStyle: {
  1486. color: '#ffe400',
  1487. fontSize: '14'
  1488. },
  1489. backgroundColor: 'rgba(250,250,250,0)',
  1490. formatter: function (params) {
  1491. let str = '<div style="background-image: url(image/key_frame.png);width:134px;height:130px;line-height:25px;background-size: 100% 100%;padding:13px 10px;">'
  1492. params.forEach(function (v, n) {
  1493. if (v.seriesName != '上部1') {
  1494. str +=
  1495. '<div><span style="color:#fff;width:75px;text-align: center;display: inline-block;">' +
  1496. v.seriesName +
  1497. ':</span><span style:"width:55px;text-align: center;display: inline-block;">' +
  1498. v.value + '</span></div>'
  1499. }
  1500. })
  1501. return str;
  1502. }
  1503. }
  1504. // grid
  1505. const grid = {
  1506. left: '3%',
  1507. right: '4%',
  1508. bottom: '3%',
  1509. containLabel: true,
  1510. tooltip: {
  1511. textStyle: {
  1512. color: '#fff'
  1513. }
  1514. }
  1515. }
  1516. // xAxis
  1517. const xAxis = {
  1518. axisTick: { show: true },
  1519. axisLine: {
  1520. show: true,
  1521. lineStyle: {
  1522. color: "#525fa6"
  1523. }
  1524. },
  1525. axisLabel: { textStyle: { fontSize: 16, color: '#fff' }, },
  1526. data: dataArr.xdata
  1527. }
  1528. // yAxis
  1529. const yAxis = [{
  1530. boundaryGap: false,
  1531. type: "value",
  1532. // scale:true,
  1533. axisLabel: {
  1534. textStyle: {
  1535. color: "#f4f4f8"
  1536. }
  1537. },
  1538. nameTextStyle: {
  1539. color: "#fff",
  1540. fontSize: 12,
  1541. lineHeight: 40
  1542. },
  1543. splitLine: {
  1544. show: true,
  1545. lineStyle: {
  1546. color: "#516cb8",
  1547. type: "dashed"
  1548. }
  1549. }
  1550. }]
  1551. // 渲染
  1552. option = {
  1553. tooltip, xAxis, yAxis, series, grid
  1554. }
  1555. traffic3.setOption(option)
  1556. }
  1557. //坐席监控
  1558. //实时话务统计
  1559. function getRealTimeTraffi(hours, hrCount, hcCount) {
  1560. let realTimeTraffi = echarts.init(document.getElementById('realTimeTraffi'));
  1561. option = {
  1562. grid: {
  1563. top: '20%',
  1564. bottom: '20%'
  1565. },
  1566. legend: {
  1567. data: ['呼入', '呼出'],
  1568. textStyle: {
  1569. color: '#fff',
  1570. fontSize: 14,
  1571. padding: [0, 5]
  1572. },
  1573. right: 25,
  1574. top: -5
  1575. },
  1576. tooltip: {
  1577. trigger: 'axis',
  1578. axisPointer: {
  1579. show: true,
  1580. type: 'line',
  1581. lineStyle: {
  1582. type: 'dashed'
  1583. }
  1584. },
  1585. textStyle: {
  1586. color: '#fff',
  1587. fontSize: 16,
  1588. fontWeight: '600',
  1589. },
  1590. backgroundColor: 'rgba(250,250,250,0)',
  1591. formatter: function (params) {
  1592. let str = '<div style="background-image: url(image/key_frame.png);width:128px;height:70px;line-height:25px;background-size: 100% 100%;padding:7px 8px;">'
  1593. params.forEach(function (v, n) {
  1594. // if(v.seriesName!='上部1'){
  1595. str +=
  1596. '<div><span style="color:#fff;width:75px;text-align: center;display: inline-block;">' +
  1597. v.seriesName +
  1598. ':</span><span style:"width:55px;text-align: center;display: inline-block;">' +
  1599. v.value + '</span></div>'
  1600. // }
  1601. })
  1602. return str;
  1603. }
  1604. },
  1605. xAxis: [{
  1606. type: "category",
  1607. boundaryGap: false,
  1608. scale: true,
  1609. axisLabel: {
  1610. formatter: '{value}',
  1611. fontSize: 13,
  1612. margin: 10,
  1613. textStyle: {
  1614. color: "#f4f4f8"
  1615. }
  1616. },
  1617. axisLine: {
  1618. show: true,
  1619. lineStyle: {
  1620. color: "#849cc9"
  1621. }
  1622. },
  1623. splitLine: {
  1624. show: false,
  1625. lineStyle: {
  1626. color: "#849cc9"
  1627. }
  1628. },
  1629. axisTick: {
  1630. show: false
  1631. },
  1632. data: hours
  1633. }],
  1634. yAxis: [{
  1635. boundaryGap: false,
  1636. type: "value",
  1637. // scale:true,
  1638. axisLabel: {
  1639. textStyle: {
  1640. color: "#f4f4f8"
  1641. }
  1642. },
  1643. nameTextStyle: {
  1644. color: "#fff",
  1645. fontSize: 12,
  1646. lineHeight: 40
  1647. },
  1648. splitLine: {
  1649. show: true,
  1650. lineStyle: {
  1651. color: "#849cc9",
  1652. type: "dashed"
  1653. }
  1654. },
  1655. axisLine: {
  1656. lineStyle: {
  1657. color: "#849cc9",
  1658. width: 1,
  1659. type: "solid"
  1660. },
  1661. show: true,
  1662. // "symbol":['none', 'arrow'],
  1663. symbol: ['none',
  1664. 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20'
  1665. ],
  1666. symbolOffset: 5,
  1667. symbolSize: [35, 38],
  1668. },
  1669. }],
  1670. series: [{
  1671. name: "呼入",
  1672. type: "line",
  1673. smooth: true,
  1674. showSymbol: false,
  1675. symbol: 'circle',
  1676. symbolSize: 4,
  1677. zlevel: 3,
  1678. itemStyle: {
  1679. color: '#08fcff'
  1680. },
  1681. lineStyle: {
  1682. normal: {
  1683. width: 2,
  1684. color: "#01cde6",
  1685. }
  1686. },
  1687. // label: {
  1688. // show: true,
  1689. // position: 'top',
  1690. // color: '#fff',
  1691. // fontSize: 14,
  1692. // fontWeight: '600',
  1693. // formatter: function (params) {
  1694. // console.log(params)
  1695. // return params.seriesName + ':' + params.value
  1696. // }
  1697. // },
  1698. areaStyle: {
  1699. normal: {
  1700. color: new echarts.graphic.LinearGradient(
  1701. 0,
  1702. 0,
  1703. 0,
  1704. 1,
  1705. [{
  1706. offset: 0,
  1707. color: "#0571ae"
  1708. },
  1709. {
  1710. offset: 0.8,
  1711. color: "#093085"
  1712. }
  1713. ],
  1714. false
  1715. ),
  1716. }
  1717. },
  1718. emphasis: {
  1719. itemStyle: {
  1720. color: '#fff',
  1721. shadowBlur: 10,
  1722. shadowOffsetX: 1,
  1723. shadowOffsetY: 1,
  1724. shadowColor: 'rgb(250,250, 250)'
  1725. }
  1726. },
  1727. data: hrCount
  1728. }, {
  1729. name: "呼出",
  1730. type: "line",
  1731. smooth: true,
  1732. showSymbol: false,
  1733. symbol: 'circle',
  1734. symbolSize: 4,
  1735. zlevel: 3,
  1736. itemStyle: {
  1737. color: '#ffe000'
  1738. },
  1739. // label: {
  1740. // show: true,
  1741. // position: 'top',
  1742. // color: '#fff',
  1743. // fontSize: 14,
  1744. // fontWeight: '600',
  1745. // formatter: function (params) {
  1746. // return params.seriesName + ':' + params.value
  1747. // }
  1748. // },
  1749. lineStyle: {
  1750. normal: {
  1751. width: 2,
  1752. color: "#ffd200",
  1753. }
  1754. },
  1755. areaStyle: {
  1756. normal: {
  1757. color: new echarts.graphic.LinearGradient(
  1758. 0,
  1759. 0,
  1760. 0,
  1761. 1,
  1762. [{
  1763. offset: 0,
  1764. color: "#626a55"
  1765. },
  1766. {
  1767. offset: 0.8,
  1768. color: "#093085"
  1769. }
  1770. ],
  1771. false
  1772. ),
  1773. }
  1774. },
  1775. emphasis: {
  1776. itemStyle: {
  1777. color: '#fff',
  1778. shadowBlur: 10,
  1779. shadowOffsetX: 1,
  1780. shadowOffsetY: 1,
  1781. shadowColor: 'rgb(250,250, 250)'
  1782. }
  1783. },
  1784. data: hcCount
  1785. }]
  1786. };
  1787. realTimeTraffi.setOption(option);
  1788. }