index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  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. <el-dropdown class="dropdown-menu" trigger="click">
  8. <span class="el-dropdown-link">
  9. 部门方案查看 <i class="el-icon-arrow-down el-icon--right"></i>
  10. </span>
  11. <el-dropdown-menu slot="dropdown">
  12. <el-dropdown-item>全部部门</el-dropdown-item>
  13. <el-dropdown-item>销售部</el-dropdown-item>
  14. <el-dropdown-item>市场部</el-dropdown-item>
  15. </el-dropdown-menu>
  16. </el-dropdown>
  17. </div>
  18. <el-row :gutter="20">
  19. <el-col :span="3">
  20. <div class="data-card">
  21. <div class="card-title">
  22. <i class="el-icon-user-solid"></i>
  23. 分公司数量
  24. </div>
  25. <div class="card-value highlight">{{dealderCount}}</div>
  26. </div>
  27. </el-col>
  28. <el-col :span="3">
  29. <div class="data-card">
  30. <div class="card-title">
  31. <i class="el-icon-user"></i>
  32. 销售数量
  33. </div>
  34. <div class="card-value highlight">{{groupMgrCount}}</div>
  35. </div>
  36. </el-col>
  37. <el-col :span="3">
  38. <div class="data-card">
  39. <div class="card-title">
  40. <i class="el-icon-shopping-cart-full"></i>
  41. 会员数量
  42. </div>
  43. <div class="card-value highlight">{{memberCount}}</div>
  44. <div class="card-badge">
  45. </div>
  46. </div>
  47. </el-col>
  48. <el-col :span="3">
  49. <div class="data-card">
  50. <div class="card-title">
  51. <i class="el-icon-money"></i>
  52. 可用余额
  53. </div>
  54. <div class="card-value highlight">143,650.07</div>
  55. </div>
  56. </el-col>
  57. <el-col :span="3">
  58. <div class="data-card">
  59. <div class="card-title">
  60. <span>今日消耗</span>
  61. </div>
  62. <div class="card-value highlight">1,093.70</div>
  63. <div class="card-sub">
  64. <span>昨日消耗(元)</span>
  65. <span class="sub-value">1952.8</span>
  66. </div>
  67. <el-progress :percentage="74" :show-text="false" color="#409EFF"></el-progress>
  68. <div class="card-desc">预测不足74天</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">1.79T</div>
  78. <div class="card-sub">
  79. <span>本月</span>
  80. <span class="sub-value">18.45T</span>
  81. </div>
  82. </div>
  83. </el-col>
  84. <el-col :span="3">
  85. <div class="data-card">
  86. <div class="card-title">
  87. <i class="el-icon-message"></i>
  88. 短信剩余条数
  89. </div>
  90. <div class="card-value highlight">{{smsRemainCount}}</div>
  91. </div>
  92. </el-col>
  93. <el-col :span="3">
  94. <div class="data-card">
  95. <div class="card-title">
  96. 平台今日看课人数
  97. </div>
  98. <div class="card-value highlight">{{todayWatchUserCount}}</div>
  99. <div class="card-sub">
  100. <span>配额上限</span>
  101. <span class="sub-value">{{todayWatchUserCount}}/{{versionLimit}}</span>
  102. </div>
  103. <el-progress :percentage="70" :show-text="false" color="#409EFF"></el-progress>
  104. </div>
  105. </el-col>
  106. </el-row>
  107. </el-card>
  108. <!-- 分析概览 (Analysis Overview) -->
  109. <div class="analysis-section" shadow="never">
  110. <div slot="header" class="header">
  111. <span>分析概览</span>
  112. <div class="tab-group">
  113. <el-radio-group v-model="queryTime" size="medium" @change="handleAnalysis">
  114. <el-radio-button label="今日"></el-radio-button>
  115. <el-radio-button label="昨日"></el-radio-button>
  116. <el-radio-button label="本周"></el-radio-button>
  117. <el-radio-button label="本月"></el-radio-button>
  118. <el-radio-button label="上月"></el-radio-button>
  119. </el-radio-group>
  120. </div>
  121. <div class="action-group">
  122. <el-button size="small" plain icon="el-icon-refresh">手动刷新</el-button>
  123. <el-button size="small" plain>自动刷新</el-button>
  124. <el-button size="small" type="primary">刷新</el-button>
  125. </div>
  126. </div>
  127. </div>
  128. <div>
  129. <el-row :gutter="20">
  130. <el-col :span="12" style="position: relative">
  131. <div class="analysis-card-check" :class="selectedDiv===0?'analysis-card-check-selected color':''" @click="handleToggleDiv(0)">
  132. <div class="analysis-card">
  133. <div class="card-icon"><i class="el-icon-monitor"></i></div>
  134. <div class="card-content">
  135. <div class="card-row">
  136. <span>观看人数</span>
  137. <span class="highlight">{{watchUserCount}}</span>
  138. </div>
  139. <div class="card-row">
  140. <span>完播人数</span>
  141. <span class="highlight">{{completedUserCount}}</span>
  142. </div>
  143. <div class="card-row">
  144. <span>完播率</span>
  145. <span class="highlight">{{completedRate}}%</span>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="analysis-card">
  150. <div class="card-icon"><i class="el-icon-video-play"></i></div>
  151. <div class="card-content">
  152. <div class="card-row">
  153. <span>观看次数</span>
  154. <span class="highlight">{{watchCount}}</span>
  155. </div>
  156. <div class="card-row">
  157. <span>完播次数</span>
  158. <span class="highlight">{{completedCount}}</span>
  159. </div>
  160. <div class="card-row">
  161. <span>视频完播率</span>
  162. <span class="highlight">{{watchRate}}</span>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </el-col>
  168. <el-col :span="6" style="position: relative">
  169. <div class="analysis-card-check" :class="selectedDiv===1?'analysis-card-check-selected color':''" @click="handleToggleDiv(1)">
  170. <div class="analysis-card">
  171. <div class="card-icon"><i class="el-icon-headset"></i></div>
  172. <div class="card-content">
  173. <div class="card-row">
  174. <span>答题人数</span>
  175. <span class="highlight">{{answerMemberCount}}</span>
  176. </div>
  177. <div class="card-row">
  178. <span>正确人数</span>
  179. <span class="highlight">{{correctUserCount}}</span>
  180. </div>
  181. <div class="card-row">
  182. <span>正确率</span>
  183. <span class="highlight">{{correctRate}}%</span>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </el-col>
  189. <el-col :span="6" style="position: relative">
  190. <div class="analysis-card-check" :class="selectedDiv===2?'analysis-card-check-selected color':''" @click="handleToggleDiv(2)">
  191. <div class="analysis-card">
  192. <div class="card-icon"><i class="el-icon-present"></i></div>
  193. <div class="card-content">
  194. <div class="card-row">
  195. <span>答题红包个数</span>
  196. <span class="highlight">{{rewardCount}}</span>
  197. </div>
  198. <div class="card-row">
  199. <span>答题红包金额(元)</span>
  200. <span class="highlight">{{rewardMoney}}</span>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </el-col>
  206. </el-row>
  207. </div>
  208. <!-- 图表区域 (Charts Area) -->
  209. <el-row :gutter="20" class="charts-section">
  210. <el-col :span="12">
  211. <el-card shadow="never">
  212. <div slot="header" class="chart-header">
  213. <span>会员观看、完播人数趋势图</span>
  214. <div class="legend">
  215. <div class="legend-item">
  216. <span class="dot viewer-dot"></span>
  217. <span>观看人数</span>
  218. </div>
  219. <div class="legend-item">
  220. <span class="dot complete-dot"></span>
  221. <span>完播人数</span>
  222. </div>
  223. </div>
  224. <el-button size="small" plain class="view-more">平台每日统计 <i class="el-icon-arrow-right"></i></el-button>
  225. </div>
  226. <div ref="viewerChart" class="chart-container"></div>
  227. </el-card>
  228. </el-col>
  229. <el-col :span="12">
  230. <el-card shadow="never">
  231. <div slot="header" class="chart-header">
  232. <span>经销商会员观看TOP10</span>
  233. <div class="legend">
  234. <el-radio-group v-model="viewerType" size="small" @change="handleDealerChartData">
  235. <el-radio-button label="0">按观看人数</el-radio-button>
  236. <el-radio-button label="1">按完播人数</el-radio-button>
  237. </el-radio-group>
  238. </div>
  239. <el-button size="small" plain class="view-more">经销商统计 <i class="el-icon-arrow-right"></i></el-button>
  240. </div>
  241. <div ref="dealerChart" class="chart-container"></div>
  242. </el-card>
  243. </el-col>
  244. </el-row>
  245. <el-card shadow="never">
  246. <div slot="header" class="chart-header">
  247. <span>经销商会员观看TOP10</span>
  248. <div class="legend">
  249. <el-radio-group v-model="viewerType" size="small" @change="handleDealerChartData">
  250. <el-radio-button label="0">按观看人数</el-radio-button>
  251. <el-radio-button label="1">按完播人数</el-radio-button>
  252. </el-radio-group>
  253. </div>
  254. <div class="legend">
  255. <el-radio-group v-model="radio">
  256. <el-radio :label="3">前10名</el-radio>
  257. <el-radio :label="6">倒数10名</el-radio>
  258. </el-radio-group>
  259. </div>
  260. <div class="legend">
  261. <div class="legend-item">
  262. <span class="dot viewer-dot"></span>
  263. <span>观看人数</span>
  264. </div>
  265. <div class="legend-item">
  266. <span class="dot complete-dot"></span>
  267. <span>完播人数</span>
  268. </div>
  269. <div class="legend-item">
  270. <span class="dot" style="background-color: #E6A23C"></span>
  271. <span>答题人数</span>
  272. </div>
  273. <div class="legend-item">
  274. <span class="dot" style="background-color: #F56C6C"></span>
  275. <span>正确人数</span>
  276. </div>
  277. </div>
  278. <el-button size="small" plain class="view-more">经销商统计 <i class="el-icon-arrow-right"></i></el-button>
  279. </div>
  280. <div ref="courseWatchChart" class="chart-container"></div>
  281. </el-card>
  282. </div>
  283. </template>
  284. <script>
  285. import * as echarts from 'echarts'
  286. import {
  287. analysisPreview,
  288. authorizationInfo,
  289. dealerAggregated, deaMemberTopTen,
  290. smsBalance,
  291. watchCourseTopTen, watchEndPlayTrend
  292. } from "@/api/statistics/statistics";
  293. import dayjs from 'dayjs';
  294. import parallelModel from "echarts/src/coord/parallel/ParallelModel";
  295. const viewCharOption = {
  296. tooltip: {
  297. trigger: 'axis',
  298. axisPointer: {
  299. type: 'shadow'
  300. }
  301. },
  302. grid: {
  303. left: '3%',
  304. right: '4%',
  305. bottom: '3%',
  306. containLabel: true
  307. },
  308. xAxis: {
  309. type: 'category',
  310. 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']
  311. },
  312. yAxis: {
  313. type: 'value'
  314. },
  315. series: [
  316. {
  317. name: '观看人数',
  318. type: 'bar',
  319. data: [],
  320. itemStyle: {
  321. color: '#409EFF'
  322. }
  323. },
  324. {
  325. name: '完播人数',
  326. type: 'bar',
  327. data: [],
  328. itemStyle: {
  329. color: '#67C23A'
  330. }
  331. }
  332. ]
  333. }
  334. const dealerOption = {
  335. tooltip: {
  336. trigger: 'axis',
  337. axisPointer: {
  338. type: 'shadow'
  339. }
  340. },
  341. grid: {
  342. left: '3%',
  343. right: '4%',
  344. bottom: '3%',
  345. containLabel: true
  346. },
  347. xAxis: {
  348. type: 'value'
  349. },
  350. yAxis: {
  351. type: 'category',
  352. data: []
  353. },
  354. series: [
  355. {
  356. name: '观看人数',
  357. type: 'bar',
  358. data: [],
  359. itemStyle: {
  360. color: '#409EFF'
  361. }
  362. }
  363. ]
  364. }
  365. const courseWatchOption = {
  366. tooltip: {
  367. trigger: 'axis',
  368. axisPointer: {
  369. type: 'shadow'
  370. }
  371. },
  372. grid: {
  373. left: '3%',
  374. right: '4%',
  375. bottom: '8%',
  376. top: '3%',
  377. containLabel: true
  378. },
  379. xAxis: {
  380. type: 'category',
  381. data: [],
  382. axisLabel: {
  383. interval: 0,
  384. rotate: 30,
  385. fontSize: 10,
  386. width: 100,
  387. overflow: 'truncate'
  388. }
  389. },
  390. yAxis: {
  391. type: 'value',
  392. splitLine: {
  393. lineStyle: {
  394. type: 'dashed'
  395. }
  396. }
  397. },
  398. series: [
  399. {
  400. name: '观看人数',
  401. type: 'bar',
  402. data: [],
  403. itemStyle: {
  404. color: '#409EFF'
  405. }
  406. },
  407. {
  408. name: '完播人数',
  409. type: 'bar',
  410. data: [],
  411. itemStyle: {
  412. color: '#67C23A'
  413. }
  414. },
  415. {
  416. name: '答题人数',
  417. type: 'bar',
  418. data: [],
  419. itemStyle: {
  420. color: '#E6A23C'
  421. }
  422. },
  423. {
  424. name: '正确人数',
  425. type: 'bar',
  426. data: [],
  427. itemStyle: {
  428. color: '#F56C6C'
  429. }
  430. }
  431. ]
  432. }
  433. export default {
  434. name: 'StatisticsDashboard',
  435. data() {
  436. return {
  437. smsRemainCount: 0,
  438. viewerType: '0',
  439. viewerChart: null,
  440. dealerChart: null,
  441. // 分公司数量
  442. dealderCount: 0,
  443. // 销售数量
  444. groupMgrCount: 0,
  445. // 会员总数量
  446. memberCount: 0,
  447. // 正常会员数量
  448. normalNum: 0,
  449. // 黑名单会员数量
  450. blackNum: 0,
  451. // 观看人数
  452. watchUserCount: 0,
  453. // 完播人数
  454. completedUserCount: 0,
  455. // 完播率
  456. completedRate: 0,
  457. // 观看次数
  458. watchCount:0,
  459. // 完播次数
  460. completedCount: 0,
  461. // 视频完播率
  462. watchRate: 0,
  463. // 答题人数
  464. answerMemberCount: 0,
  465. // 正确人数
  466. correctUserCount: 0,
  467. correctRate: 0.0,
  468. // 答题红包个数
  469. rewardCount: 0,
  470. // 答题红包金额
  471. rewardMoney: 0.0,
  472. queryTime: '今日',
  473. todayWatchUserCount: 0,
  474. versionLimit: 0,
  475. /// 选中的分析概览
  476. selectedDiv: 0,
  477. filterType: 0
  478. }
  479. },
  480. mounted() {
  481. this.$nextTick(() => {
  482. this.initViewerChart()
  483. this.initDealerChart()
  484. this.initCourseWatchChart();
  485. // 监听窗口大小变化,重新渲染图表
  486. window.addEventListener('resize', () => {
  487. this.viewerChart && this.viewerChart.resize()
  488. this.dealerChart && this.dealerChart.resize()
  489. })
  490. })
  491. },
  492. created() {
  493. dealerAggregated().then(res=>{
  494. if(res.code === 200){
  495. this.dealderCount = res.data.dealderCount;
  496. this.groupMgrCount = res.data.groupMgrCount;
  497. this.memberCount = res.data.memberCount;
  498. this.normalNum = res.data.normalNum;
  499. this.blackNum = res.data.blackNum;
  500. }
  501. })
  502. let param = {
  503. startTime: '',
  504. endTime: ''
  505. };
  506. // 获取当前日期时间
  507. const today = dayjs();
  508. param.startTime = this.formatDate(today);
  509. param.endTime = this.formatDate(today);
  510. analysisPreview(param).then(res=>{
  511. if(res.code === 200){
  512. this.watchUserCount = res.data.watchUserCount;
  513. this.completedUserCount = res.data.completedUserCount;
  514. this.completedRate = res.data.completedRate;
  515. this.watchCount = res.data.watchCount;
  516. this.completedCount = res.data.completedCount;
  517. this.answerMemberCount = res.data.answerMemberCount;
  518. this.correctUserCount = res.data.correctUserCount;
  519. this.correctRate = res.data.correctRate;
  520. this.rewardCount = res.data.rewardCount;
  521. this.rewardMoney = res.data.rewardMoney;
  522. }
  523. })
  524. smsBalance().then(res=>{
  525. if(res.code === 200){
  526. this.smsRemainCount = res.data;
  527. }
  528. })
  529. authorizationInfo().then(res=>{
  530. if(res.code === 200){
  531. this.todayWatchUserCount = res.data.todayWatchUserCount;
  532. this.versionLimit = res.data.versionLimit;
  533. }
  534. })
  535. let startTime = this.formatDate(today);
  536. let endTime = this.formatDate(today);
  537. watchCourseTopTen({...param,type: 0,statisticalType: 0,startTime: startTime,endTime: endTime}).then(res=>{
  538. if(res.code === 200){
  539. // this.handleAnalysis();
  540. }
  541. })
  542. watchEndPlayTrend({...param,type: 0,statisticalType: 0,startTime: startTime,endTime: endTime}).then(res=>{
  543. if(res.code === 200){
  544. this.handleViewChartData(res.data)
  545. }
  546. })
  547. // 经销商会员观看TOP10
  548. deaMemberTopTen({...param,type: 0,statisticalType: 0,startTime: startTime,endTime: endTime}).then(res=>{
  549. if(res.code === 200){
  550. this.handleDealerChartData(res.data)
  551. }
  552. })
  553. },
  554. methods: {
  555. handleToggleDiv(selected){
  556. this.selectedDiv = selected;
  557. },
  558. formatDate(date) {
  559. return dayjs(date).format('YYYY-MM-DD');
  560. },
  561. getParam(){
  562. let param = {
  563. startTime: '',
  564. endTime: ''
  565. };
  566. // 获取当前日期时间
  567. const today = dayjs();
  568. let type = 0;
  569. if (this.queryTime === '今日') {
  570. param.startTime = this.formatDate(today);
  571. param.endTime = this.formatDate(today);
  572. type = 0;
  573. } else if (this.queryTime === '昨日') {
  574. const yesterday = today.subtract(1, 'day');
  575. param.startTime = this.formatDate(yesterday);
  576. param.endTime = this.formatDate(yesterday);
  577. type = 1;
  578. } else if (this.queryTime === '本周') {
  579. param.startTime = this.formatDate(today.startOf('week'));
  580. param.endTime = this.formatDate(today.endOf('week'));
  581. type = 2;
  582. } else if (this.queryTime === '本月') {
  583. param.startTime = this.formatDate(today.startOf('month'));
  584. param.endTime = this.formatDate(today.endOf('month'));
  585. type = 3;
  586. } else if (this.queryTime === '上月') {
  587. const lastMonth = today.subtract(1, 'month');
  588. param.startTime = this.formatDate(lastMonth.startOf('month'));
  589. param.endTime = this.formatDate(lastMonth.endOf('month'));
  590. type = 4;
  591. } else {
  592. console.warn(`未知的 queryTime: ${this.queryTime}, 默认使用今日`);
  593. param.startTime = this.formatDate(today);
  594. param.endTime = this.formatDate(today);
  595. }
  596. param.type = type;
  597. return param;
  598. },
  599. // 分析概览
  600. handleAnalysis(){
  601. let param = this.getParam();
  602. analysisPreview(param).then(res=>{
  603. if(res.code === 200){
  604. this.watchUserCount = res.data.watchUserCount;
  605. this.completedUserCount = res.data.completedUserCount;
  606. this.completedRate = res.data.completedRate;
  607. this.watchCount = res.data.watchCount;
  608. this.completedCount = res.data.completedCount;
  609. this.answerMemberCount = res.data.answerMemberCount;
  610. this.correctUserCount = res.data.correctUserCount;
  611. this.correctRate = res.data.correctRate;
  612. this.rewardCount = res.data.rewardCount;
  613. this.rewardMoney = res.data.rewardMoney;
  614. }
  615. })
  616. this.handleViewChartData()
  617. this.handleDealerChartData()
  618. },
  619. handleDealerChartData(){
  620. let param = this.getParam();
  621. // 经销商会员观看TOP10
  622. deaMemberTopTen({...param,statisticalType: this.viewerType}).then(res=>{
  623. if(res.code === 200){
  624. let data = res.data;
  625. let companyNameList = data.map(e=>e.companyName);
  626. let watchUserList = data.map(e=>e.watchUserCount);
  627. dealerOption.yAxis.data = companyNameList;
  628. dealerOption.series[0].data = watchUserList;
  629. this.dealerChart.setOption(dealerOption)
  630. }
  631. })
  632. },
  633. handleViewChartData(){
  634. let param = this.getParam();
  635. watchEndPlayTrend({...param}).then(res=>{
  636. if(res.code === 200){
  637. let data = res.data;
  638. let watchUserCountList = data.map(e=>e.watchUserCount);
  639. let completedUserCountList = data.map(e=>e.completedUserCount);
  640. let xAxis = data.map(e=>e.x);
  641. viewCharOption.series[0].data = watchUserCountList;
  642. viewCharOption.series[1].data = completedUserCountList;
  643. viewCharOption.xAxis.data = xAxis;
  644. this.viewerChart.setOption(viewCharOption);
  645. }
  646. })
  647. },
  648. initViewerChart() {
  649. this.viewerChart = echarts.init(this.$refs.viewerChart)
  650. this.viewerChart.setOption(viewCharOption)
  651. },
  652. initDealerChart() {
  653. this.dealerChart = echarts.init(this.$refs.dealerChart)
  654. this.dealerChart.setOption(dealerOption)
  655. },
  656. initCourseWatchChart() {
  657. this.courseWatchChart = echarts.init(this.$refs.courseWatchChart)
  658. this.courseWatchChart.setOption(courseWatchOption)
  659. },
  660. },
  661. beforeDestroy() {
  662. window.removeEventListener('resize', this.resizeHandler)
  663. this.viewerChart && this.viewerChart.dispose()
  664. this.dealerChart && this.dealerChart.dispose()
  665. }
  666. }
  667. </script>
  668. <style scoped>
  669. ::v-deep .el-radio-button__inner:hover {
  670. color: #409EFF; /* 鼠标悬浮时的文字颜色,可以根据需要调整 */
  671. }
  672. ::v-deep .el-radio-button.is-active .el-radio-button__inner {
  673. background-color: #409EFF; /* 选中时的背景色 */
  674. border-color: #409EFF; /* 选中时的边框色 */
  675. color: #FFFFFF; /* 选中时的文字颜色 (通常是白色) */
  676. box-shadow: -1px 0 0 0 #409EFF; /* 处理按钮间的连接缝隙 */
  677. }
  678. /* 如果需要,也可以修改非选中状态下的聚焦(focus)或悬浮(hover)样式 */
  679. /* 例如,让非选中按钮悬浮时边框和文字也变蓝 */
  680. ::v-deep .el-radio-button:not(.is-active) .el-radio-button__inner:hover {
  681. color: #409EFF;
  682. /* border-color: #b3d8ff; Element UI 默认悬浮边框色,可以按需修改 */
  683. }
  684. /* 聚焦时的外框,如果需要的话 */
  685. ::v-deep .el-radio-button:focus:not(.is-checked) .el-radio-button__inner {
  686. /* border-color: #409EFF; */ /* Element UI 默认的 focus 颜色通常关联主题色 */
  687. /* box-shadow: 0 0 2px 2px rgba(64, 158, 255, 0.2); */ /* 示例 focus 光晕 */
  688. }
  689. .statistics-dashboard {
  690. padding: 20px;
  691. background-color: #f5f7fa;
  692. }
  693. .overview-section,
  694. .analysis-section {
  695. margin-bottom: 20px;
  696. border-radius: 4px;
  697. }
  698. .header {
  699. display: flex;
  700. justify-content: space-between;
  701. align-items: center;
  702. font-size: 16px;
  703. font-weight: 500;
  704. }
  705. .data-card {
  706. background-color: #fff;
  707. border-radius: 4px;
  708. padding: 15px;
  709. height: 100px;
  710. display: flex;
  711. flex-direction: column;
  712. position: relative;
  713. }
  714. .card-title {
  715. color: #606266;
  716. font-size: 14px;
  717. margin-bottom: 10px;
  718. }
  719. .card-value {
  720. font-size: 24px;
  721. font-weight: bold;
  722. margin-top: auto;
  723. }
  724. .highlight {
  725. color: #409EFF;
  726. }
  727. .card-sub {
  728. display: flex;
  729. justify-content: space-between;
  730. font-size: 12px;
  731. color: #909399;
  732. margin-top: 5px;
  733. }
  734. .card-desc {
  735. font-size: 12px;
  736. color: #909399;
  737. margin-top: 5px;
  738. }
  739. .card-badge {
  740. position: absolute;
  741. top: 15px;
  742. right: 15px;
  743. background: #f0f9eb;
  744. color: #67c23a;
  745. padding: 2px 5px;
  746. border-radius: 4px;
  747. }
  748. .cdn-label {
  749. background-color: #409EFF;
  750. color: white;
  751. padding: 2px 5px;
  752. border-radius: 4px;
  753. margin-right: 5px;
  754. font-size: 12px;
  755. }
  756. .tab-group {
  757. display: flex;
  758. gap: 10px;
  759. }
  760. .action-group {
  761. display: flex;
  762. gap: 10px;
  763. }
  764. .analysis-card {
  765. border-radius: 4px;
  766. padding: 20px;
  767. display: flex;
  768. }
  769. .card-icon {
  770. width: 50px;
  771. height: 50px;
  772. background-color: rgba(64, 158, 255, 0.1);
  773. border-radius: 8px;
  774. display: flex;
  775. justify-content: center;
  776. align-items: center;
  777. font-size: 24px;
  778. color: #409EFF;
  779. margin-right: 20px;
  780. }
  781. .card-content {
  782. display: flex;
  783. }
  784. .card-row {
  785. display: flex;
  786. justify-content: center;
  787. justify-items: center;
  788. flex-direction: column;
  789. padding: 10px;
  790. .highlight{
  791. text-align: center;
  792. margin-top: 1em;
  793. font-family: BebasNeue;
  794. color: #1677ff;
  795. font-size: 26px;
  796. line-height: 42px;
  797. font-weight: 400;
  798. margin-top: 8px;
  799. }
  800. font-size: 15px;
  801. color: #000;
  802. }
  803. .charts-section {
  804. margin-top: 20px;
  805. }
  806. .chart-header {
  807. display: flex;
  808. justify-content: space-between;
  809. align-items: center;
  810. }
  811. .view-more {
  812. font-size: 12px;
  813. }
  814. .legend {
  815. display: flex;
  816. gap: 15px;
  817. }
  818. .legend-item {
  819. display: flex;
  820. align-items: center;
  821. font-size: 12px;
  822. }
  823. .dot {
  824. width: 10px;
  825. height: 10px;
  826. border-radius: 50%;
  827. margin-right: 5px;
  828. }
  829. .viewer-dot {
  830. background-color: #409EFF;
  831. }
  832. .complete-dot {
  833. background-color: #67C23A;
  834. }
  835. .chart-container {
  836. height: 350px;
  837. width: 100%;
  838. }
  839. .analysis-card-check{
  840. display: flex;
  841. flex-direction: row;
  842. border: 1px solid transparent;
  843. background-color: #fff;
  844. border-radius: 4px;
  845. }
  846. .analysis-card-check:hover{
  847. cursor: pointer;
  848. }
  849. .analysis-card-check-selected:after{
  850. content: "";
  851. display: block;
  852. border-width: 15px;
  853. position: absolute;
  854. bottom: -30px;
  855. left: 50%;
  856. margin-left: -32px;
  857. border-style: solid dashed dashed solid;
  858. border-color: #4592FF transparent transparent transparent;
  859. font-size: 0;
  860. line-height: 0;
  861. z-index:1;
  862. }
  863. .analysis-card-check-selected:before{
  864. content: "";
  865. display: block;
  866. border-width: 15px;
  867. position: absolute;
  868. bottom: -30px;
  869. left: 50%;
  870. margin-left: -32px;
  871. border-style: solid dashed dashed solid;
  872. border-color: #4592FF transparent transparent transparent;
  873. font-size: 0;
  874. line-height: 0;
  875. z-index:1;
  876. }
  877. .analysis-card-check-selected{
  878. border: 1px solid #4592FF;
  879. background-color: #e7f1ff;
  880. }
  881. .color{
  882. position: relative;
  883. border: 1px solid #4592FF;
  884. background-color: #e7f1ff;
  885. }
  886. .color:after {
  887. bottom: -27px;
  888. border-color: #E7F1FF transparent transparent transparent;
  889. }
  890. .legend-group{
  891. }
  892. </style>