index.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423
  1. <template>
  2. <div class="statistics-dashboard">
  3. <!-- 数据概览 (Data Overview) -->
  4. <el-card class="overview-section" shadow="never">
  5. <div slot="header" class="header">
  6. <span>数据概览</span>
  7. </div>
  8. <el-row :gutter="20">
  9. <el-col :span="3">
  10. <div class="data-card">
  11. <div class="card-title">
  12. <i class="el-icon-user-solid"></i>
  13. 分公司数量
  14. </div>
  15. <div class="card-value highlight">
  16. <count-to :start-val="0" :end-val="dealderCount" :duration="3600" class="card-panel-num" /></div>
  17. </div>
  18. </el-col>
  19. <el-col :span="3">
  20. <div class="data-card">
  21. <div class="card-title">
  22. <i class="el-icon-user"></i>
  23. 销售数量
  24. </div>
  25. <div class="card-value highlight">
  26. <count-to :start-val="0" :end-val="groupMgrCount" :duration="3600" class="card-panel-num" />
  27. </div>
  28. </div>
  29. </el-col>
  30. <el-col :span="3">
  31. <div class="data-card">
  32. <div class="card-title">
  33. <i class="el-icon-shopping-cart-full"></i>
  34. 会员数量
  35. </div>
  36. <div class="card-value highlight">
  37. <count-to :start-val="0" :end-val="memberCount" :duration="3600" class="card-panel-num" /></div>
  38. <div class="card-badge">
  39. </div>
  40. </div>
  41. </el-col>
  42. <el-col :span="3">
  43. <div class="data-card">
  44. <div class="card-title">
  45. <i class="el-icon-money"></i>
  46. 可用余额
  47. </div>
  48. <div class="card-value highlight">
  49. <count-to :start-val="0" :end-val="balance" :duration="3600" class="card-panel-num" />
  50. </div>
  51. </div>
  52. </el-col>
  53. <el-col :span="3">
  54. <div class="data-card">
  55. <div class="card-title">
  56. <span>今日消耗</span>
  57. </div>
  58. <div class="card-value highlight">
  59. <count-to :start-val="0" :end-val="todayComsumption" :duration="3600" class="card-panel-num" />
  60. </div>
  61. <div class="card-sub">
  62. <span>昨日消耗(元)</span>
  63. <span class="sub-value">
  64. <count-to :start-val="0" :end-val="yesterdayComsumption" :duration="3600" class="card-panel-num" />
  65. </span>
  66. </div>
  67. <el-progress :percentage="percentage" :show-text="false" color="#409EFF"></el-progress>
  68. <div class="card-desc">{{remainMessage}}</div>
  69. </div>
  70. </el-col>
  71. <el-col :span="3">
  72. <div class="data-card">
  73. <div class="card-title">
  74. <span class="cdn-label">CDN</span>
  75. 今日
  76. </div>
  77. <div class="card-value highlight">{{formatBytes(this.todayTraffic)}}
  78. </div>
  79. <div class="card-sub">
  80. <span>本月</span>
  81. <span class="sub-value">{{formatBytes(this.thisMonthTraffic)}}</span>
  82. </div>
  83. </div>
  84. </el-col>
  85. <el-col :span="3">
  86. <div class="data-card">
  87. <div class="card-title">
  88. <i class="el-icon-message"></i>
  89. 短信剩余条数
  90. </div>
  91. <div class="card-value highlight">
  92. <count-to :start-val="0" :end-val="smsRemainCount" :duration="3600" class="card-panel-num" />
  93. </div>
  94. </div>
  95. </el-col>
  96. <el-col :span="3">
  97. <div class="data-card">
  98. <div class="card-title">
  99. 平台今日看课人数
  100. </div>
  101. <div class="card-value highlight">
  102. <count-to :start-val="0" :end-val="todayWatchUserCount" :duration="3600" class="card-panel-num" />
  103. </div>
  104. <div class="card-sub">
  105. <span>配额上限</span>
  106. <span class="sub-value">
  107. <count-to :start-val="0" :end-val="todayWatchUserCount" :duration="3600" class="card-panel-num" />/<count-to :start-val="0" :end-val="versionLimit" :duration="3600" class="card-panel-num" /></span>
  108. </div>
  109. <el-progress :percentage="todayWatchUserCount/versionLimit" :show-text="false" color="#409EFF"></el-progress>
  110. </div>
  111. </el-col>
  112. </el-row>
  113. </el-card>
  114. <!-- 分析概览 (Analysis Overview) -->
  115. <div class="analysis-section" shadow="never">
  116. <div slot="header" class="header">
  117. <span>分析概览</span>
  118. <div class="tab-group">
  119. <el-radio-group v-model="queryTime" size="medium" @change="handleAnalysis">
  120. <el-radio-button label="今日"></el-radio-button>
  121. <el-radio-button label="昨日"></el-radio-button>
  122. <el-radio-button label="本周"></el-radio-button>
  123. <el-radio-button label="本月"></el-radio-button>
  124. <el-radio-button label="上月"></el-radio-button>
  125. </el-radio-group>
  126. </div>
  127. <div class="action-group">
  128. <el-button size="small" plain icon="el-icon-refresh" @click="manualRefresh">手动刷新</el-button>
  129. <el-dropdown @command="handleAutoRefresh" trigger="click">
  130. <el-button size="small" plain>
  131. 自动刷新
  132. <i class="el-icon-arrow-down el-icon--right"></i>
  133. </el-button>
  134. <el-dropdown-menu slot="dropdown">
  135. <el-dropdown-item :command="0" :class="{ 'is-active': !autoRefreshInterval }">关闭</el-dropdown-item>
  136. <el-dropdown-item :command="5" :class="{ 'is-active': autoRefreshInterval === 5 }">5分钟</el-dropdown-item>
  137. <el-dropdown-item :command="10" :class="{ 'is-active': autoRefreshInterval === 10 }">10分钟</el-dropdown-item>
  138. <el-dropdown-item :command="15" :class="{ 'is-active': autoRefreshInterval === 15 }">15分钟</el-dropdown-item>
  139. </el-dropdown-menu>
  140. </el-dropdown>
  141. <el-button size="small" type="primary" @click="refresh">刷新</el-button>
  142. </div>
  143. </div>
  144. </div>
  145. <div>
  146. <el-row :gutter="20">
  147. <el-col :span="12" style="position: relative">
  148. <div class="analysis-card-check" :class="selectedDiv===0?'analysis-card-check-selected color':''" @click="handleToggleDiv(0)">
  149. <div class="analysis-card">
  150. <div class="card-icon"><i class="el-icon-monitor"></i></div>
  151. <div class="card-content">
  152. <div class="card-row">
  153. <span>观看人数</span>
  154. <span class="highlight">
  155. <count-to :start-val="0" :end-val="watchUserCount" :duration="3600" class="card-panel-num" />
  156. </span>
  157. </div>
  158. <div class="card-row">
  159. <span>完播人数</span>
  160. <span class="highlight">
  161. <count-to :start-val="0" :end-val="completedUserCount" :duration="3600" class="card-panel-num" />
  162. </span>
  163. </div>
  164. <div class="card-row">
  165. <span>完播率</span>
  166. <span class="highlight">{{completedRate}}%</span>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="analysis-card">
  171. <div class="card-icon"><i class="el-icon-video-play"></i></div>
  172. <div class="card-content">
  173. <div class="card-row">
  174. <span>观看次数</span>
  175. <span class="highlight">
  176. <count-to :start-val="0" :end-val="watchCount" :duration="3600" class="card-panel-num" /></span>
  177. </div>
  178. <div class="card-row">
  179. <span>完播次数</span>
  180. <span class="highlight">
  181. <count-to :start-val="0" :end-val="completedCount" :duration="3600" class="card-panel-num" />
  182. </span>
  183. </div>
  184. <div class="card-row">
  185. <span>视频完播率</span>
  186. <span class="highlight">{{watchRate}}</span>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </el-col>
  192. <el-col :span="6" style="position: relative">
  193. <div class="analysis-card-check" :class="selectedDiv===1?'analysis-card-check-selected color':''" @click="handleToggleDiv(1)">
  194. <div class="analysis-card">
  195. <div class="card-icon"><i class="el-icon-headset"></i></div>
  196. <div class="card-content">
  197. <div class="card-row">
  198. <span>答题人数</span>
  199. <span class="highlight">
  200. <count-to :start-val="0" :end-val="answerMemberCount" :duration="3600" class="card-panel-num" />
  201. </span>
  202. </div>
  203. <div class="card-row">
  204. <span>正确人数</span>
  205. <span class="highlight">
  206. <count-to :start-val="0" :end-val="correctUserCount" :duration="3600" class="card-panel-num" />
  207. </span>
  208. </div>
  209. <div class="card-row">
  210. <span>正确率</span>
  211. <span class="highlight">{{correctRate}}%</span>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </el-col>
  217. <el-col :span="6" style="position: relative">
  218. <div class="analysis-card-check" :class="selectedDiv===2?'analysis-card-check-selected color':''" @click="handleToggleDiv(2)">
  219. <div class="analysis-card">
  220. <div class="card-icon"><i class="el-icon-present"></i></div>
  221. <div class="card-content">
  222. <div class="card-row">
  223. <span>答题红包个数</span>
  224. <span class="highlight">
  225. <count-to :start-val="0" :end-val="rewardCount" :duration="3600" class="card-panel-num" />
  226. </span>
  227. </div>
  228. <div class="card-row">
  229. <span>答题红包金额(元)</span>
  230. <span class="highlight">
  231. <count-to :start-val="0" :end-val="rewardMoney" :duration="3600" class="card-panel-num" /></span>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </el-col>
  237. </el-row>
  238. </div>
  239. <!-- 图表区域 (Charts Area) -->
  240. <transition name="fade">
  241. <el-row :gutter="20" class="charts-section" v-show="selectedDiv===0">
  242. <el-col :span="12">
  243. <el-card shadow="never">
  244. <div slot="header" class="chart-header">
  245. <span>会员观看、完播人数趋势图</span>
  246. <div class="legend">
  247. <div class="legend-item">
  248. <span class="dot viewer-dot"></span>
  249. <span>观看人数</span>
  250. </div>
  251. <div class="legend-item">
  252. <span class="dot complete-dot"></span>
  253. <span>完播人数</span>
  254. </div>
  255. </div>
  256. <el-button size="small" plain class="view-more">平台每日统计 <i class="el-icon-arrow-right"></i></el-button>
  257. </div>
  258. <div ref="viewerChart" class="chart-container"></div>
  259. </el-card>
  260. </el-col>
  261. <el-col :span="12">
  262. <el-card shadow="never">
  263. <div slot="header" class="chart-header">
  264. <span>经销商会员观看TOP10</span>
  265. <div class="legend">
  266. <el-radio-group v-model="viewerType" size="small" @change="handleDealerChartData">
  267. <el-radio-button label="0">按观看人数</el-radio-button>
  268. <el-radio-button label="1">按完播人数</el-radio-button>
  269. </el-radio-group>
  270. </div>
  271. <el-button size="small" plain class="view-more">经销商统计 <i class="el-icon-arrow-right"></i></el-button>
  272. </div>
  273. <div ref="dealerChart" class="chart-container"></div>
  274. </el-card>
  275. </el-col>
  276. </el-row>
  277. </transition>
  278. <transition name="fade">
  279. <el-row :gutter="20" class="charts-section" v-show="selectedDiv===1">
  280. <el-card shadow="never">
  281. <div slot="header" class="chart-header">
  282. <span>课程观看TOP10</span>
  283. <div class="legend">
  284. <el-radio-group v-model="viewerType" size="small" @change="handleCourseWatchChart">
  285. <el-radio-button label="0">按观看人数</el-radio-button>
  286. <el-radio-button label="1">按完播人数</el-radio-button>
  287. <el-radio-button label="2">按答题人数</el-radio-button>
  288. <el-radio-button label="3">按正确人数</el-radio-button>
  289. </el-radio-group>
  290. </div>
  291. <div class="legend">
  292. <el-radio-group v-model="delerSort" @change="handleCourseWatchChart">
  293. <el-radio label="DESC">前10名</el-radio>
  294. <el-radio label="ASC">倒数10名</el-radio>
  295. </el-radio-group>
  296. </div>
  297. <div class="legend">
  298. <div class="legend-item">
  299. <span class="dot viewer-dot"></span>
  300. <span>观看人数</span>
  301. </div>
  302. <div class="legend-item">
  303. <span class="dot complete-dot"></span>
  304. <span>完播人数</span>
  305. </div>
  306. <div class="legend-item">
  307. <span class="dot" style="background-color: #E6A23C"></span>
  308. <span>答题人数</span>
  309. </div>
  310. <div class="legend-item">
  311. <span class="dot" style="background-color: #F56C6C"></span>
  312. <span>正确人数</span>
  313. </div>
  314. </div>
  315. <el-button size="small" plain class="view-more">经销商统计 <i class="el-icon-arrow-right"></i></el-button>
  316. </div>
  317. <div ref="courseWatchChart" class="chart-container"></div>
  318. </el-card>
  319. </el-row>
  320. </transition>
  321. <transition name="fade">
  322. <el-row :gutter="20" class="charts-section" v-show="selectedDiv===2">
  323. <el-col :span="12">
  324. <el-card shadow="never">
  325. <div slot="header" class="chart-header">
  326. <span>答题红包金额TOP10</span>
  327. <div class="legend">
  328. <el-radio-group v-model="dataType" size="small" @change="handleAnswerRedPackViewerChart">
  329. <el-radio-button label="0">按经销商排行</el-radio-button>
  330. <el-radio-button label="1">按课程排行</el-radio-button>
  331. </el-radio-group>
  332. </div>
  333. <el-button size="small" plain class="view-more">红包记录 <i class="el-icon-arrow-right"></i></el-button>
  334. </div>
  335. <div ref="answerRedPackViewerChart" class="chart-container"></div>
  336. </el-card>
  337. </el-col>
  338. <el-col :span="12">
  339. <el-card shadow="never">
  340. <div slot="header" class="chart-header">
  341. <span>答题红包金额趋势图</span>
  342. <div class="legend">
  343. <div class="legend-item">
  344. <span class="dot viewer-dot"></span>
  345. <span>答题红包金额</span>
  346. </div>
  347. </div>
  348. <el-button size="small" plain class="view-more">红包记录 <i class="el-icon-arrow-right"></i></el-button>
  349. </div>
  350. <div ref="answerRedPackMoneyViewerChart" class="chart-container"></div>
  351. </el-card>
  352. </el-col>
  353. </el-row>
  354. </transition>
  355. </div>
  356. </template>
  357. <script>
  358. import * as echarts from 'echarts'
  359. import CountTo from "vue-count-to";
  360. import {
  361. analysisPreview,
  362. authorizationInfo,
  363. dealerAggregated, deaMemberTopTen, rechargeComsumption, rewardMoneyTopTen, rewardMoneyTrend,
  364. smsBalance, trafficLog,
  365. watchCourseTopTen, watchEndPlayTrend
  366. } from "@/api/statistics/statistics";
  367. import dayjs from 'dayjs';
  368. const viewCharOption = {
  369. tooltip: {
  370. trigger: 'axis',
  371. axisPointer: {
  372. type: 'shadow'
  373. }
  374. },
  375. grid: {
  376. left: '3%',
  377. right: '4%',
  378. bottom: '3%',
  379. containLabel: true
  380. },
  381. xAxis: {
  382. type: 'category',
  383. data: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']
  384. },
  385. yAxis: {
  386. type: 'value'
  387. },
  388. series: [
  389. {
  390. name: '观看人数',
  391. type: 'bar',
  392. data: [],
  393. itemStyle: {
  394. color: '#409EFF'
  395. }
  396. },
  397. {
  398. name: '完播人数',
  399. type: 'bar',
  400. data: [],
  401. itemStyle: {
  402. color: '#67C23A'
  403. }
  404. }
  405. ]
  406. }
  407. const dealerOption = {
  408. tooltip: {
  409. trigger: 'axis',
  410. axisPointer: {
  411. type: 'shadow'
  412. }
  413. },
  414. grid: {
  415. left: '3%',
  416. right: '4%',
  417. bottom: '3%',
  418. containLabel: true
  419. },
  420. xAxis: {
  421. type: 'value'
  422. },
  423. yAxis: {
  424. type: 'category',
  425. data: []
  426. },
  427. series: [
  428. {
  429. name: '观看人数',
  430. type: 'bar',
  431. data: [],
  432. itemStyle: {
  433. color: '#409EFF'
  434. }
  435. }
  436. ]
  437. }
  438. const courseWatchOption = {
  439. tooltip: {
  440. trigger: 'axis',
  441. axisPointer: {
  442. type: 'shadow'
  443. }
  444. },
  445. grid: {
  446. left: '3%',
  447. right: '4%',
  448. bottom: '8%',
  449. top: '3%',
  450. containLabel: true
  451. },
  452. xAxis: {
  453. type: 'category',
  454. data: [],
  455. axisLabel: {
  456. interval: 0,
  457. rotate: 30,
  458. fontSize: 10,
  459. width: 100,
  460. overflow: 'truncate'
  461. }
  462. },
  463. yAxis: {
  464. type: 'value',
  465. splitLine: {
  466. lineStyle: {
  467. type: 'dashed'
  468. }
  469. }
  470. },
  471. series: [
  472. {
  473. name: '观看人数',
  474. type: 'bar',
  475. data: [],
  476. itemStyle: {
  477. color: '#409EFF'
  478. }
  479. },
  480. {
  481. name: '完播人数',
  482. type: 'bar',
  483. data: [],
  484. itemStyle: {
  485. color: '#67C23A'
  486. }
  487. },
  488. {
  489. name: '答题人数',
  490. type: 'bar',
  491. data: [],
  492. itemStyle: {
  493. color: '#E6A23C'
  494. }
  495. },
  496. {
  497. name: '正确人数',
  498. type: 'bar',
  499. data: [],
  500. itemStyle: {
  501. color: '#F56C6C'
  502. }
  503. }
  504. ]
  505. }
  506. const lineChartOption = {
  507. tooltip: {
  508. trigger: 'axis',
  509. axisPointer: {
  510. type: 'cross' // 改为 'cross' 更适合折线图
  511. }
  512. // 你可能想要自定义 tooltip 的 formatter 来显示时间和金额
  513. // formatter: function (params) {
  514. // const point = params[0];
  515. // const date = new Date(point.value[0]);
  516. // // 自定义时间格式
  517. // const formattedTime = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
  518. // return `${point.seriesName}<br/>${formattedTime} : ${point.value[1]} 元`;
  519. // }
  520. },
  521. grid: {
  522. left: '3%',
  523. right: '4%',
  524. bottom: '8%', // 如果x轴标签旋转,可能需要更大的 bottom
  525. top: '5%', // 增加一点顶部空间给可能的 Y 轴名称
  526. containLabel: true
  527. },
  528. xAxis: {
  529. type: 'time', // X轴类型改为 'time'
  530. // data: [], // 时间轴不需要单独设置 data,数据在 series 中提供
  531. axisLabel: {
  532. // interval: 0, // 时间轴通常自动处理间隔,可以先移除或注释掉
  533. rotate: 30, // 保留旋转,如果标签可能重叠
  534. fontSize: 10,
  535. // width: 100, // width 和 overflow 对于时间轴可能行为不同,按需调整
  536. // overflow: 'truncate',
  537. formatter: null // ECharts 会自动格式化时间,如需特定格式可用 function 或字符串模板
  538. // 例如: formatter: '{yyyy}-{MM}-{dd}\n{HH}:{mm}'
  539. }
  540. },
  541. yAxis: {
  542. type: 'value',
  543. name: '金额 (元)', // 添加 Y 轴名称
  544. nameLocation: 'end', // 名称位置
  545. nameTextStyle: {
  546. align: 'right',
  547. padding: [0, 10, 0, 0] // 调整名称与轴线的距离
  548. },
  549. splitLine: {
  550. lineStyle: {
  551. type: 'dashed'
  552. }
  553. },
  554. axisLabel: {
  555. formatter: '{value} 元' // 可选:给 Y 轴刻度添加单位
  556. }
  557. },
  558. series: [
  559. {
  560. name: '答题红包金额',
  561. type: 'line', // 系列类型改为 'line'
  562. // data: [], // 数据格式需要是 [[时间1, 金额1], [时间2, 金额2], ...]
  563. // 时间可以是时间戳 (毫秒), 'YYYY-MM-DD HH:mm:ss' 格式字符串, 或者 Date 对象
  564. // 例如: [['2023-10-26 08:00:00', 120], ['2023-10-26 09:00:00', 200]]
  565. data: [
  566. // 示例数据,你需要用实际数据替换
  567. // ['2024-01-01 10:00:00', 5.5],
  568. // ['2024-01-01 11:00:00', 8.2],
  569. // ['2024-01-02 09:30:00', 6.0],
  570. // ['2024-01-03 14:00:00', 10.8],
  571. ],
  572. itemStyle: { // 控制数据点(标记)的样式
  573. color: '#409EFF'
  574. },
  575. lineStyle: { // 控制线的样式
  576. color: '#409EFF'
  577. },
  578. smooth: false, // 是否平滑曲线,可设为 true
  579. symbol: 'circle', // 数据点标记形状,'emptyCircle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
  580. symbolSize: 4 // 数据点标记大小
  581. }
  582. ]
  583. };
  584. const redPackageOption = {
  585. tooltip: {
  586. trigger: 'axis',
  587. axisPointer: {
  588. type: 'shadow'
  589. }
  590. },
  591. grid: {
  592. left: '3%',
  593. right: '4%',
  594. bottom: '8%',
  595. top: '3%',
  596. containLabel: true
  597. },
  598. xAxis: {
  599. type: 'category',
  600. data: [],
  601. axisLabel: {
  602. interval: 0,
  603. rotate: 30,
  604. fontSize: 10,
  605. width: 100,
  606. overflow: 'truncate'
  607. }
  608. },
  609. yAxis: {
  610. type: 'value',
  611. splitLine: {
  612. lineStyle: {
  613. type: 'dashed'
  614. }
  615. }
  616. },
  617. series: [
  618. {
  619. name: '答题红包金额',
  620. type: 'bar',
  621. data: [],
  622. itemStyle: {
  623. color: '#409EFF'
  624. }
  625. }
  626. ]
  627. }
  628. export default {
  629. name: 'StatisticsDashboard',
  630. components: {CountTo},
  631. data() {
  632. return {
  633. percentage: 0,
  634. // 预测message
  635. remainMessage: '',
  636. // 当天使用流量
  637. todayTraffic: 0,
  638. // 当月使用流量
  639. thisMonthTraffic: 0,
  640. dataType: '0',
  641. delerSort: 'DESC',
  642. smsRemainCount: 0,
  643. viewerType: '0',
  644. viewerChart: null,
  645. dealerChart: null,
  646. // 分公司数量
  647. dealderCount: 0,
  648. // 销售数量
  649. groupMgrCount: 0,
  650. // 会员总数量
  651. memberCount: 0,
  652. // 正常会员数量
  653. normalNum: 0,
  654. // 黑名单会员数量
  655. blackNum: 0,
  656. // 观看人数
  657. watchUserCount: 0,
  658. // 完播人数
  659. completedUserCount: 0,
  660. // 完播率
  661. completedRate: 0,
  662. // 观看次数
  663. watchCount:0,
  664. // 完播次数
  665. completedCount: 0,
  666. // 视频完播率
  667. watchRate: 0,
  668. // 答题人数
  669. answerMemberCount: 0,
  670. // 正确人数
  671. correctUserCount: 0,
  672. correctRate: 0.0,
  673. // 答题红包个数
  674. rewardCount: 0,
  675. // 答题红包金额
  676. rewardMoney: 0.0,
  677. queryTime: '今日',
  678. todayWatchUserCount: 0,
  679. versionLimit: 0,
  680. /// 选中的分析概览
  681. selectedDiv: 0,
  682. filterType: 0,
  683. answerRedPackViewerChart: null,
  684. answerRedPackMoneyViewerChart: null,
  685. todayComsumption: 0,
  686. yesterdayComsumption: 0,
  687. balance: 0
  688. }
  689. },
  690. mounted() {
  691. this.$nextTick(() => {
  692. this.initViewerChart()
  693. this.initDealerChart()
  694. this.initCourseWatchChart();
  695. this.initAnswerRedPackViewerChart();
  696. this.initAnswerRedPackMoneyViewerChart();
  697. // 监听窗口大小变化,重新渲染图表
  698. window.addEventListener('resize', () => {
  699. this.viewerChart && this.viewerChart.resize()
  700. this.dealerChart && this.dealerChart.resize()
  701. })
  702. })
  703. },
  704. created() {
  705. this.refresh();
  706. },
  707. methods: {
  708. /**
  709. * 计算余额预计可持续的天数
  710. * @param {number} balance - 当前账户余额
  711. * @param {number} todayConsumption - 今日消耗金额
  712. * @param {number} yesterdayConsumption - 昨日消耗金额
  713. * @return {Object} 包含天数和进度百分比的对象
  714. */
  715. calculateRemainingDays(balance, todayConsumption, yesterdayConsumption) {
  716. // 如果今日和昨日消耗都为0,则无法预测(避免除以0)
  717. if (todayConsumption === 0 && yesterdayConsumption === 0) {
  718. return {
  719. days: Infinity,
  720. percentage: 0,
  721. message: '暂无消耗数据'
  722. };
  723. }
  724. // 计算每日平均消耗量
  725. const avgDailyConsumption = (todayConsumption + yesterdayConsumption) / 2;
  726. // 如果平均消耗为0,则无法预测
  727. if (avgDailyConsumption === 0) {
  728. return {
  729. days: Infinity,
  730. percentage: 0,
  731. message: '暂无消耗数据'
  732. };
  733. }
  734. // 计算剩余天数(向下取整)
  735. const remainingDays = Math.floor(balance / avgDailyConsumption);
  736. // 计算进度条百分比,最大为100
  737. // 这里假设100天是满值,可以根据需要调整
  738. const maxDays = 100;
  739. const percentage = Math.min(100, Math.max(0, Math.round((remainingDays / maxDays) * 100)));
  740. let message = '';
  741. if (remainingDays > 365) {
  742. message = '预测余额充足';
  743. } else {
  744. message = `预测不足${remainingDays}天`;
  745. }
  746. return {
  747. days: remainingDays,
  748. percentage: 100 - percentage,
  749. message: message
  750. };
  751. },
  752. /**
  753. * 将字节数转换为合适的单位表示(Byte、KB、MB、GB、TB)
  754. * @param {number} bytes - 字节数
  755. * @param {number} [decimals=2] - 小数点后保留的位数
  756. * @returns {string} 格式化后的字符串,包含数值和单位
  757. */
  758. formatBytes(bytes, decimals = 2) {
  759. if (bytes === 0) return '0 Byte';
  760. const k = 1024;
  761. const sizes = ['Byte', 'KB', 'MB', 'GB', 'TB'];
  762. // 计算合适的单位级别
  763. const i = Math.floor(Math.log(bytes) / Math.log(k));
  764. // 转换为对应单位的值
  765. const value = bytes / Math.pow(k, i);
  766. // 格式化为指定小数位的字符串
  767. return parseFloat(value.toFixed(decimals)) + ' ' + sizes[Math.min(i, sizes.length - 1)];
  768. },
  769. // 手动刷新
  770. manualRefresh() {
  771. this.refresh();
  772. },
  773. // 处理自动刷新选项
  774. handleAutoRefresh(command) {
  775. // 清除之前的定时器
  776. if (this.timer) {
  777. clearInterval(this.timer);
  778. this.timer = null;
  779. }
  780. // 设置新的刷新间隔
  781. this.autoRefreshInterval = parseInt(command);
  782. // 如果间隔大于0,设置新的定时器
  783. if (this.autoRefreshInterval > 0) {
  784. this.timer = setInterval(() => {
  785. this.refresh();
  786. }, this.autoRefreshInterval * 60 * 1000); // 转换为毫秒
  787. this.$message.success(`已设置${this.autoRefreshInterval}分钟自动刷新`);
  788. } else {
  789. this.$message.info('已关闭自动刷新');
  790. }
  791. },
  792. refresh() {
  793. rechargeComsumption().then(res=>{
  794. if(res.code === 200){
  795. this.balance = res.data.balance;
  796. this.todayComsumption = res.data.todayComsumption;
  797. this.yesterdayComsumption = res.data.yesterdayComsumption;
  798. let calculateRemainingDays1 = this.calculateRemainingDays(this.balance,this.todayComsumption,this.yesterdayComsumption);
  799. this.percentage = calculateRemainingDays1.percentage;
  800. this.remainMessage = calculateRemainingDays1.message;
  801. }
  802. });
  803. trafficLog().then(res=>{
  804. if(res.code === 200) {
  805. this.todayTraffic = res.data.today;
  806. this.thisMonthTraffic = res.data.thisMonth;
  807. }
  808. })
  809. dealerAggregated().then(res=>{
  810. if(res.code === 200){
  811. this.dealderCount = res.data.dealderCount;
  812. this.groupMgrCount = res.data.groupMgrCount;
  813. this.memberCount = res.data.memberCount;
  814. this.normalNum = res.data.normalNum;
  815. this.blackNum = res.data.blackNum;
  816. }
  817. })
  818. let param = {
  819. startTime: '',
  820. endTime: ''
  821. };
  822. // 获取当前日期时间
  823. const today = dayjs();
  824. param.startTime = this.formatDate(today);
  825. param.endTime = this.formatDate(today);
  826. analysisPreview(param).then(res=>{
  827. if(res.code === 200){
  828. this.watchUserCount = res.data.watchUserCount;
  829. this.completedUserCount = res.data.completedUserCount;
  830. this.completedRate = res.data.completedRate;
  831. this.watchCount = res.data.watchCount;
  832. this.completedCount = res.data.completedCount;
  833. this.answerMemberCount = res.data.answerMemberCount;
  834. this.correctUserCount = res.data.correctUserCount;
  835. this.correctRate = res.data.correctRate;
  836. this.rewardCount = res.data.rewardCount;
  837. this.rewardMoney = res.data.rewardMoney;
  838. }
  839. })
  840. smsBalance().then(res=>{
  841. if(res.code === 200){
  842. if(res.data == null) {
  843. this.smsRemainCount = 0;
  844. } else {
  845. this.smsRemainCount = res.data;
  846. }
  847. }
  848. })
  849. authorizationInfo().then(res=>{
  850. if(res.code === 200){
  851. this.todayWatchUserCount = res.data.todayWatchUserCount;
  852. this.versionLimit = res.data.versionLimit;
  853. }
  854. })
  855. this.handleCourseWatchChart()
  856. this.handleViewChartData()
  857. // 经销商会员观看TOP10
  858. this.handleDealerChartData()
  859. this.handleAnswerRedPackViewerChart()
  860. this.handleAnswerRedPackMoneyViewerChart()
  861. },
  862. /**
  863. * 将数字添加千位分隔符
  864. * @param {number|string} num - 需要格式化的数字
  865. * @return {string} 添加千位分隔符后的字符串
  866. */
  867. formatNumberWithCommas(num) {
  868. if (num === null || num === undefined || isNaN(Number(num))) {
  869. return '0';
  870. }
  871. const numStr = String(num);
  872. // 处理负数
  873. const isNegative = numStr.startsWith('-');
  874. const absNumStr = isNegative ? numStr.slice(1) : numStr;
  875. // 分离整数部分和小数部分
  876. const parts = absNumStr.split('.');
  877. const integerPart = parts[0];
  878. const decimalPart = parts.length > 1 ? '.' + parts[1] : '';
  879. const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
  880. return (isNegative ? '-' : '') + formattedInteger + decimalPart;
  881. },
  882. handleToggleDiv(selected){
  883. this.selectedDiv = selected;
  884. if (selected === 1) {
  885. this.$nextTick(() => {
  886. if (this.courseWatchChart) {
  887. this.courseWatchChart.resize();
  888. } else {
  889. }
  890. });
  891. }
  892. else if (selected === 0) {
  893. this.$nextTick(() => {
  894. if (this.viewerChart) this.viewerChart.resize();
  895. if (this.dealerChart) this.dealerChart.resize();
  896. });
  897. } else if (selected === 2) {
  898. this.$nextTick(() => {
  899. if (this.answerRedPackViewerChart) this.answerRedPackViewerChart.resize();
  900. if (this.answerRedPackMoneyViewerChart) this.answerRedPackMoneyViewerChart.resize();
  901. });
  902. }
  903. if(this.selectedDiv === 0){
  904. this.handleViewChartData()
  905. this.handleDealerChartData()
  906. } else if(this.selectedDiv === 1) {
  907. this.handleCourseWatchChart()
  908. } else if(this.selectedDiv === 2) {
  909. this.handleAnswerRedPackViewerChart()
  910. this.handleAnswerRedPackMoneyViewerChart()
  911. }
  912. },
  913. formatDate(date) {
  914. return dayjs(date).format('YYYY-MM-DD');
  915. },
  916. getParam(){
  917. let param = {
  918. startTime: '',
  919. endTime: ''
  920. };
  921. // 获取当前日期时间
  922. const today = dayjs();
  923. let type = 0;
  924. if (this.queryTime === '今日') {
  925. param.startTime = this.formatDate(today);
  926. param.endTime = this.formatDate(today);
  927. type = 0;
  928. } else if (this.queryTime === '昨日') {
  929. const yesterday = today.subtract(1, 'day');
  930. param.startTime = this.formatDate(yesterday);
  931. param.endTime = this.formatDate(yesterday);
  932. type = 1;
  933. } else if (this.queryTime === '本周') {
  934. param.startTime = this.formatDate(today.startOf('week'));
  935. param.endTime = this.formatDate(today.endOf('week'));
  936. type = 2;
  937. } else if (this.queryTime === '本月') {
  938. param.startTime = this.formatDate(today.startOf('month'));
  939. param.endTime = this.formatDate(today.endOf('month'));
  940. type = 3;
  941. } else if (this.queryTime === '上月') {
  942. const lastMonth = today.subtract(1, 'month');
  943. param.startTime = this.formatDate(lastMonth.startOf('month'));
  944. param.endTime = this.formatDate(lastMonth.endOf('month'));
  945. type = 4;
  946. } else {
  947. console.warn(`未知的 queryTime: ${this.queryTime}, 默认使用今日`);
  948. param.startTime = this.formatDate(today);
  949. param.endTime = this.formatDate(today);
  950. }
  951. param.type = type;
  952. param.sort = this.delerSort;
  953. return param;
  954. },
  955. // 分析概览
  956. handleAnalysis(e){
  957. let param = this.getParam();
  958. analysisPreview(param).then(res=>{
  959. if(res.code === 200){
  960. this.watchUserCount = res.data.watchUserCount;
  961. this.completedUserCount = res.data.completedUserCount;
  962. this.completedRate = res.data.completedRate;
  963. this.watchCount = res.data.watchCount;
  964. this.completedCount = res.data.completedCount;
  965. this.answerMemberCount = res.data.answerMemberCount;
  966. this.correctUserCount = res.data.correctUserCount;
  967. this.correctRate = res.data.correctRate;
  968. this.rewardCount = res.data.rewardCount;
  969. this.rewardMoney = res.data.rewardMoney;
  970. }
  971. })
  972. if(this.selectedDiv === 0){
  973. this.handleViewChartData()
  974. this.handleDealerChartData()
  975. } else if(this.selectedDiv === 1) {
  976. this.handleCourseWatchChart()
  977. } else if(this.selectedDiv === 2) {
  978. this.handleAnswerRedPackViewerChart()
  979. this.handleAnswerRedPackMoneyViewerChart()
  980. }
  981. },
  982. handleAnswerRedPackViewerChart(){
  983. let param = this.getParam();
  984. param = {...param,statisticalType:this.viewerType,dataType: this.dataType};
  985. rewardMoneyTopTen(param).then(res=>{
  986. if(res.code === 200){
  987. let data = res.data;
  988. let companyNameList = data.map(e=>e.companyName)
  989. let courseNameList = data.map(e=>e.courseName)
  990. let rewardMoneyList = data.map(e=>e.rewardMoney)
  991. if(this.dataType === '0'){
  992. redPackageOption.xAxis.data = companyNameList;
  993. }else{
  994. redPackageOption.xAxis.data = courseNameList;
  995. }
  996. redPackageOption.series[0].data = rewardMoneyList;
  997. this.answerRedPackViewerChart.setOption(redPackageOption)
  998. }
  999. })
  1000. },
  1001. handleAnswerRedPackMoneyViewerChart(){
  1002. let param = this.getParam();
  1003. param = {...param,statisticalType:this.viewerType,dataType: this.dataType};
  1004. rewardMoneyTrend(param).then(res=>{
  1005. if(res.code === 200){
  1006. let data = res.data;
  1007. let option = data.map(e=>[e.x,e.rewardMoney])
  1008. lineChartOption.series[0].data = option;
  1009. this.answerRedPackMoneyViewerChart.setOption(lineChartOption)
  1010. }
  1011. })
  1012. },
  1013. handleCourseWatchChart() {
  1014. let param = this.getParam();
  1015. param = {...param,statisticalType:this.viewerType};
  1016. watchCourseTopTen(param).then(res=>{
  1017. if(res.code === 200){
  1018. let data = res.data;
  1019. let watchUserCountList = data.map(e=>e.watchUserCount);
  1020. let completedUserCountList = data.map(e=>e.completedUserCount);
  1021. let answerUserCountList = data.map(e=>e.answerUserCount);
  1022. let correctUserCountList = data.map(e=>e.correctUserCount);
  1023. let courseNameList = data.map(e=>e.courseName);
  1024. courseWatchOption.xAxis.data = courseNameList;
  1025. courseWatchOption.series[0].data = watchUserCountList;
  1026. courseWatchOption.series[1].data = completedUserCountList;
  1027. courseWatchOption.series[2].data = answerUserCountList;
  1028. courseWatchOption.series[3].data = correctUserCountList;
  1029. this.courseWatchChart.setOption(courseWatchOption)
  1030. }
  1031. })
  1032. },
  1033. handleDealerChartData(){
  1034. let param = this.getParam();
  1035. // 经销商会员观看TOP10
  1036. deaMemberTopTen({...param,statisticalType: this.viewerType}).then(res=>{
  1037. if(res.code === 200){
  1038. let data = res.data;
  1039. let companyNameList = data.map(e=>e.companyName);
  1040. let watchUserList = data.map(e=>e.watchUserCount);
  1041. dealerOption.yAxis.data = companyNameList;
  1042. dealerOption.series[0].data = watchUserList;
  1043. this.dealerChart.setOption(dealerOption)
  1044. }
  1045. })
  1046. },
  1047. handleViewChartData(){
  1048. let param = this.getParam();
  1049. watchEndPlayTrend({...param}).then(res=>{
  1050. if(res.code === 200){
  1051. let data = res.data;
  1052. let watchUserCountList = data.map(e=>e.watchUserCount);
  1053. let completedUserCountList = data.map(e=>e.completedUserCount);
  1054. let xAxis = data.map(e=>e.x);
  1055. viewCharOption.series[0].data = watchUserCountList;
  1056. viewCharOption.series[1].data = completedUserCountList;
  1057. viewCharOption.xAxis.data = xAxis;
  1058. this.viewerChart.setOption(viewCharOption);
  1059. }
  1060. })
  1061. },
  1062. initViewerChart() {
  1063. this.viewerChart = echarts.init(this.$refs.viewerChart)
  1064. this.viewerChart.setOption(viewCharOption)
  1065. },
  1066. initDealerChart() {
  1067. this.dealerChart = echarts.init(this.$refs.dealerChart)
  1068. this.dealerChart.setOption(dealerOption)
  1069. },
  1070. initCourseWatchChart() {
  1071. this.courseWatchChart = echarts.init(this.$refs.courseWatchChart)
  1072. this.courseWatchChart.setOption(courseWatchOption)
  1073. },
  1074. initAnswerRedPackViewerChart(){
  1075. this.answerRedPackViewerChart = echarts.init(this.$refs.answerRedPackViewerChart)
  1076. this.answerRedPackViewerChart.setOption(redPackageOption)
  1077. },
  1078. initAnswerRedPackMoneyViewerChart(){
  1079. this.answerRedPackMoneyViewerChart = echarts.init(this.$refs.answerRedPackMoneyViewerChart)
  1080. this.answerRedPackMoneyViewerChart.setOption(lineChartOption)
  1081. }
  1082. },
  1083. beforeDestroy() {
  1084. // 组件销毁时清除定时器
  1085. if (this.timer) {
  1086. clearInterval(this.timer);
  1087. this.timer = null;
  1088. }
  1089. // window.removeEventListener('resize', this.resizeHandler)
  1090. this.viewerChart && this.viewerChart.dispose()
  1091. this.dealerChart && this.dealerChart.dispose()
  1092. }
  1093. }
  1094. </script>
  1095. <style scoped>
  1096. .action-group .el-button + .el-button,
  1097. .action-group .el-dropdown {
  1098. margin-left: 10px;
  1099. }
  1100. .is-active {
  1101. color: #409EFF;
  1102. font-weight: bold;
  1103. }
  1104. ::v-deep .el-radio-button__inner:hover {
  1105. color: #409EFF; /* 鼠标悬浮时的文字颜色,可以根据需要调整 */
  1106. }
  1107. ::v-deep .el-radio-button.is-active .el-radio-button__inner {
  1108. background-color: #409EFF; /* 选中时的背景色 */
  1109. border-color: #409EFF; /* 选中时的边框色 */
  1110. color: #FFFFFF; /* 选中时的文字颜色 (通常是白色) */
  1111. box-shadow: -1px 0 0 0 #409EFF; /* 处理按钮间的连接缝隙 */
  1112. }
  1113. /* 如果需要,也可以修改非选中状态下的聚焦(focus)或悬浮(hover)样式 */
  1114. /* 例如,让非选中按钮悬浮时边框和文字也变蓝 */
  1115. ::v-deep .el-radio-button:not(.is-active) .el-radio-button__inner:hover {
  1116. color: #409EFF;
  1117. /* border-color: #b3d8ff; Element UI 默认悬浮边框色,可以按需修改 */
  1118. }
  1119. /* 聚焦时的外框,如果需要的话 */
  1120. ::v-deep .el-radio-button:focus:not(.is-checked) .el-radio-button__inner {
  1121. /* border-color: #409EFF; */ /* Element UI 默认的 focus 颜色通常关联主题色 */
  1122. /* box-shadow: 0 0 2px 2px rgba(64, 158, 255, 0.2); */ /* 示例 focus 光晕 */
  1123. }
  1124. .statistics-dashboard {
  1125. padding: 20px;
  1126. background-color: #f5f7fa;
  1127. }
  1128. .overview-section,
  1129. .analysis-section {
  1130. margin-bottom: 20px;
  1131. border-radius: 4px;
  1132. }
  1133. .header {
  1134. display: flex;
  1135. justify-content: space-between;
  1136. align-items: center;
  1137. font-size: 16px;
  1138. font-weight: 500;
  1139. }
  1140. .data-card {
  1141. background-color: #fff;
  1142. border-radius: 4px;
  1143. padding: 15px;
  1144. height: 100px;
  1145. display: flex;
  1146. flex-direction: column;
  1147. position: relative;
  1148. }
  1149. .card-title {
  1150. color: #606266;
  1151. font-size: 14px;
  1152. margin-bottom: 10px;
  1153. }
  1154. .card-value {
  1155. font-size: 24px;
  1156. font-weight: bold;
  1157. margin-top: auto;
  1158. }
  1159. .highlight {
  1160. color: #409EFF;
  1161. }
  1162. .card-sub {
  1163. display: flex;
  1164. justify-content: space-between;
  1165. font-size: 12px;
  1166. color: #909399;
  1167. margin-top: 5px;
  1168. }
  1169. .card-desc {
  1170. font-size: 12px;
  1171. color: #909399;
  1172. margin-top: 5px;
  1173. }
  1174. .card-badge {
  1175. position: absolute;
  1176. top: 15px;
  1177. right: 15px;
  1178. background: #f0f9eb;
  1179. color: #67c23a;
  1180. padding: 2px 5px;
  1181. border-radius: 4px;
  1182. }
  1183. .cdn-label {
  1184. background-color: #409EFF;
  1185. color: white;
  1186. padding: 2px 5px;
  1187. border-radius: 4px;
  1188. margin-right: 5px;
  1189. font-size: 12px;
  1190. }
  1191. .tab-group {
  1192. display: flex;
  1193. gap: 10px;
  1194. }
  1195. .action-group {
  1196. display: flex;
  1197. gap: 10px;
  1198. }
  1199. .analysis-card {
  1200. border-radius: 4px;
  1201. padding: 20px;
  1202. display: flex;
  1203. align-items: center;
  1204. }
  1205. .card-icon {
  1206. width: 50px;
  1207. height: 50px;
  1208. background-color: rgba(64, 158, 255, 0.1);
  1209. border-radius: 8px;
  1210. display: flex;
  1211. justify-content: center;
  1212. align-items: center;
  1213. font-size: 24px;
  1214. color: #409EFF;
  1215. margin-right: 20px;
  1216. }
  1217. .card-content {
  1218. display: flex;
  1219. }
  1220. .card-row {
  1221. display: flex;
  1222. justify-content: center;
  1223. justify-items: center;
  1224. flex-direction: column;
  1225. padding: 10px;
  1226. .highlight{
  1227. text-align: center;
  1228. margin-top: 1em;
  1229. font-family: BebasNeue;
  1230. color: #1677ff;
  1231. font-size: 26px;
  1232. line-height: 42px;
  1233. font-weight: 400;
  1234. margin-top: 8px;
  1235. }
  1236. font-size: 15px;
  1237. color: #000;
  1238. }
  1239. .charts-section {
  1240. margin-top: 20px;
  1241. }
  1242. .chart-header {
  1243. display: flex;
  1244. justify-content: space-between;
  1245. align-items: center;
  1246. }
  1247. .view-more {
  1248. font-size: 12px;
  1249. }
  1250. .legend {
  1251. display: flex;
  1252. gap: 15px;
  1253. }
  1254. .legend-item {
  1255. display: flex;
  1256. align-items: center;
  1257. font-size: 12px;
  1258. }
  1259. .dot {
  1260. width: 10px;
  1261. height: 10px;
  1262. border-radius: 50%;
  1263. margin-right: 5px;
  1264. }
  1265. .viewer-dot {
  1266. background-color: #409EFF;
  1267. }
  1268. .complete-dot {
  1269. background-color: #67C23A;
  1270. }
  1271. .chart-container {
  1272. height: 350px;
  1273. width: 100%;
  1274. }
  1275. .analysis-card-check{
  1276. display: flex;
  1277. flex-direction: row;
  1278. border: 1px solid transparent;
  1279. background-color: #fff;
  1280. border-radius: 4px;
  1281. }
  1282. .analysis-card-check:hover{
  1283. cursor: pointer;
  1284. }
  1285. .analysis-card-check-selected:after{
  1286. content: "";
  1287. display: block;
  1288. border-width: 15px;
  1289. position: absolute;
  1290. bottom: -30px;
  1291. left: 50%;
  1292. margin-left: -32px;
  1293. border-style: solid dashed dashed solid;
  1294. border-color: #4592FF transparent transparent transparent;
  1295. font-size: 0;
  1296. line-height: 0;
  1297. z-index:1;
  1298. }
  1299. .analysis-card-check-selected:before{
  1300. content: "";
  1301. display: block;
  1302. border-width: 15px;
  1303. position: absolute;
  1304. bottom: -30px;
  1305. left: 50%;
  1306. margin-left: -32px;
  1307. border-style: solid dashed dashed solid;
  1308. border-color: #4592FF transparent transparent transparent;
  1309. font-size: 0;
  1310. line-height: 0;
  1311. z-index:1;
  1312. }
  1313. .analysis-card-check-selected{
  1314. border: 1px solid #4592FF;
  1315. background-color: #e7f1ff;
  1316. }
  1317. .color{
  1318. position: relative;
  1319. border: 1px solid #4592FF;
  1320. background-color: #e7f1ff;
  1321. }
  1322. .color:after {
  1323. bottom: -27px;
  1324. border-color: #E7F1FF transparent transparent transparent;
  1325. }
  1326. .legend-group{
  1327. }
  1328. </style>