index.vue 44 KB

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