analysis.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <!--
  2. * @Author: your name
  3. * @Date: 2021-11-25 10:40:42
  4. * @LastEditTime: 2022-03-02 10:37:43
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 数据分析
  7. * @FilePath: \Foshan4A2.0\src\views\dashboard\components\analysis.vue
  8. -->
  9. <template>
  10. <div class="dashboard-analysis">
  11. <div class="dashboard-list">
  12. <!--账号信息分布-->
  13. <div class="tu-account box-public-shadow">
  14. <div class="tu-account-content h100 flex">
  15. <div class="tu-account-content-left relative">
  16. <commonChartsPie :option="accountOption" id="tu-account-content" />
  17. </div>
  18. <div class="tu-account-content-right relative">
  19. <dateType @getTypeData="checkAccountType" :arrs="tuArrs" />
  20. <commonChartsNum :arrs="accountTeamsOne" />
  21. </div>
  22. </div>
  23. </div>
  24. <!--角色概览-->
  25. <div v-if="OpenRole" class="tu-user box-public-shadow l22">
  26. <div class="tu-user-content h100 flex">
  27. <div class="tu-user-content-left relative">
  28. <commonChartsPie :option="userOption" id="tu-user-content" />
  29. </div>
  30. <div class="tu-user-content-right">
  31. <commonChartsNum :arrs="userTeams" />
  32. </div>
  33. </div>
  34. </div>
  35. <!--权限概览-->
  36. <div class="tu-power box-public-shadow flex1 l22">
  37. <div class="tu-power-content-left relative">
  38. <commonChartsBar :option="towerOption" id="tu-tower-content" />
  39. </div>
  40. </div>
  41. </div>
  42. <div class="dashboard-list">
  43. <!--异常操作情况-->
  44. <div class="tu-unusual box-public-shadow flex1">
  45. <div class="tu-unusual-content h100 flex">
  46. <div class="tu-unusual-content-left w160 relative">
  47. <commonChartsPie :option="unusualOption" id="tu-unusual-content" />
  48. </div>
  49. <div class="tu-unusual-content-right">
  50. <commonChartsNum style="margin-top:0;" :arrs="unusualTeams" />
  51. </div>
  52. </div>
  53. </div>
  54. <!--登录情况-->
  55. <div class="tu-login box-public-shadow flex1 l22">
  56. <div class="tu-login-content h100 flex">
  57. <div class="tu-login-content-left w160 relative">
  58. <commonChartsPie :option="loginOption" id="tu-login-content" />
  59. </div>
  60. <div class="tu-login-content-right">
  61. <commonChartsNum :arrs="loginTeams" />
  62. </div>
  63. </div>
  64. </div>
  65. <!--授权情况-->
  66. <div class="tu-authorize box-public-shadow flex1 l22">
  67. <div class="tu-authorize-content h100 flex">
  68. <div class="tu-authorize-content-left w160 relative">
  69. <commonChartsPie :option="authorizeOption" id="tu-authorize-content" />
  70. </div>
  71. <div class="tu-authorize-content-right">
  72. <div v-for="(item,index) in authorizeArr" :key="index" class="behavior-list">
  73. <span :style="{'background':item.color}" class="icon"></span>
  74. <span class="name">{{item.name}}:</span>
  75. <span class="num">{{item.num}}</span>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <!--行为情况-->
  81. <div class="tu-behavior box-public-shadow flex1 l22">
  82. <div class="tu-behavior-content h100 flex">
  83. <div class="tu-behavior-content-left w160 relative">
  84. <commonChartsPie :option="behaviorOption" id="tu-behavior-content" />
  85. </div>
  86. <div class="tu-behavior-content-right">
  87. <div v-for="(item,index) in behaviorArr" :key="index" class="behavior-list">
  88. <span :style="{'background':item.color}" class="icon"></span>
  89. <span class="name">{{item.name}}:</span>
  90. <span class="num">{{item.num}}</span>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <div class="dashboard-list">
  97. <!--API调用情况-->
  98. <div class="tu-api box-public-shadow flex1">
  99. <div class="tu-api-content h100 flex">
  100. <div class="tu-api-content-left flex1 relative">
  101. <dateType @getTypeData="checkApiType" />
  102. <commonChartsLine :option="apiOption" id="tu-api-content" />
  103. </div>
  104. <div class="tu-api-content-right">
  105. <commonChartsNum :arrs="apiTeams" />
  106. </div>
  107. </div>
  108. </div>
  109. <!--系统运行异常情况-->
  110. <div class="tu-system box-public-shadow l22 flex1">
  111. <div class="tu-system-content h100 flex">
  112. <div class="tu-system-content-left flex1 relative">
  113. <dateType @getTypeData="checkSysType" />
  114. <commonChartsLine :option="systemOption" id="tu-system-content" />
  115. </div>
  116. <div class="tu-system-content-right">
  117. <commonChartsNum :arrs="systemTeams" />
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <script>
  125. import commonChartsPie from '@/layout/components/Echarts/commonChartsPie.vue'
  126. import commonChartsBar from '@/layout/components/Echarts/commonChartsBar.vue'
  127. import commonChartsLine from '@/layout/components/Echarts/commonChartsLine.vue'
  128. import commonProgress from '@/layout/components/Echarts/commonProgress.vue'
  129. import commonChartsNum from '@/layout/components/EchartsNum/index.vue'
  130. import dateType from '@/layout/components/dateType/index.vue'
  131. import { GetUserAna, GetOfficerAna, GetRoleAna, GetAuthAna } from '@/api/apiHome'
  132. import { mapGetters } from 'vuex'
  133. export default {
  134. name: 'Analysis',
  135. components: { commonChartsPie, commonChartsBar, commonChartsNum, commonChartsLine, commonProgress, dateType },
  136. data () {
  137. return {
  138. OpenRole: 1,
  139. // 账号信息分析饼图数据
  140. accountOption: {
  141. color: ['#94C6E0', '#F4C23A', '#8969BE', '#E752A3'],
  142. legend: {
  143. show: false
  144. },
  145. title: {
  146. text: '账号信息分析'
  147. },
  148. series: [
  149. {
  150. top: 43,
  151. name: '账号',
  152. type: 'pie',
  153. radius: ['30%', '50%'],
  154. label: {
  155. position: 'inner',
  156. fontSize: 14,
  157. show: false
  158. },
  159. hoverAnimation: false,
  160. data: [
  161. { value: 0, name: '账号数' },
  162. { value: 0, name: '账号组数' },
  163. ]
  164. },
  165. {
  166. top: 43,
  167. name: '账号',
  168. type: 'pie',
  169. radius: ['60%', '100%'],
  170. label: {
  171. position: 'inner',
  172. fontSize: 14,
  173. show: false
  174. },
  175. hoverAnimation: false,
  176. data: [
  177. { value: 0, name: '日活跃度' },
  178. { value: 0, name: '月活跃度' }
  179. ]
  180. }
  181. ]
  182. },
  183. //账号信息分析切换
  184. tuArrs: [
  185. {
  186. name: '账号',
  187. value: 1
  188. },
  189. {
  190. name: '职员',
  191. value: 2
  192. }
  193. ],
  194. // 账号信息分析数字
  195. accountTeamsOne: [
  196. {
  197. number: 0,
  198. txt: '账号数',
  199. color: '#94C6E0',
  200. key: 'userCount',
  201. ana: 'officeCount'
  202. },
  203. {
  204. number: 0,
  205. txt: '账号分组',
  206. color: '#F4C23A',
  207. key: 'groupCount',
  208. ana: 'groupCount'
  209. },
  210. {
  211. number: 0,
  212. txt: '日活跃度',
  213. color: '#8969BE',
  214. key: 'dayAct',
  215. ana: 'dayAct'
  216. },
  217. {
  218. number: 0,
  219. txt: '月活跃度',
  220. color: '#E752A3',
  221. key: 'monthAct',
  222. ana: 'monthAct'
  223. }
  224. ],
  225. // 权限类型分析柱状图数据
  226. towerOption: {
  227. title: {
  228. text: '权限概览'
  229. },
  230. tooltip: {
  231. trigger: 'axis',
  232. axisPointer: {
  233. // Use axis to trigger tooltip
  234. type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
  235. }
  236. },
  237. legend: {
  238. data: ['前端权限', 'API权限', '数据权限'],
  239. itemWidth: 12,
  240. itemHeight: 12,
  241. itemGap: 24,
  242. right: 0,
  243. textStyle: {
  244. color: '#303133',
  245. fontSize: 14,
  246. fontWeight: 'bold'
  247. }
  248. },
  249. xAxis: {
  250. data: [],
  251. axisLabel: {
  252. formatter: function (val) {
  253. const str = val.split('')
  254. if (str.length <= 3) {
  255. return str.join('')
  256. } else {
  257. for (let i = 0; i < str.length; i++) {
  258. if (i % 3 === 0 && i !== 0) {
  259. str.splice(i, 0, '\n')
  260. }
  261. }
  262. return str.join('')
  263. }
  264. }
  265. }
  266. },
  267. color: ['#7569BE', '#F4C23A', '#E752A3'],
  268. series: [
  269. {
  270. name: '前端权限',
  271. type: 'bar',
  272. stack: 'total',
  273. label: {
  274. show: false
  275. },
  276. data: []
  277. },
  278. {
  279. name: 'API权限',
  280. type: 'bar',
  281. stack: 'total',
  282. label: {
  283. show: false
  284. },
  285. data: []
  286. },
  287. {
  288. name: '数据权限',
  289. type: 'bar',
  290. stack: 'total',
  291. label: {
  292. show: false
  293. },
  294. data: []
  295. }
  296. ]
  297. },
  298. // 系统运行异常情况折线图数据
  299. systemOption: {
  300. title: {
  301. text: '系统运行异常情况'
  302. },
  303. color: ['#EC3535', '#FA9F63', '#C462A7'],
  304. xAxis: {
  305. data: ['1月', '2月', '3月', '4月', '5月', '6月']
  306. },
  307. series: [
  308. {
  309. name: 'Email',
  310. type: 'line',
  311. stack: 'Total',
  312. showSymbol: false,
  313. data: [120, 132, 101, 134, 90, 230, 210]
  314. },
  315. {
  316. name: 'Union',
  317. type: 'line',
  318. stack: 'Total',
  319. showSymbol: false,
  320. data: [20, 32, 1, 34, 9, 23, 21]
  321. },
  322. {
  323. name: 'Video',
  324. type: 'line',
  325. stack: 'Total',
  326. showSymbol: false,
  327. data: [120, 132, 101, 134, 90, 230, 210]
  328. }
  329. ]
  330. },
  331. // 系统运行异常情况数字
  332. systemTeams: [
  333. {
  334. number: null,
  335. txt: '高危异常',
  336. color: '#EC3535'
  337. },
  338. {
  339. number: null,
  340. txt: '中危异常',
  341. color: '#C462A7'
  342. },
  343. {
  344. number: null,
  345. txt: '低危异常',
  346. color: '#FA9F63'
  347. }
  348. ],
  349. // API调用情况折线图数据
  350. apiOption: {
  351. title: {
  352. text: 'API调用情况'
  353. },
  354. color: ['#30A3D8', '#F25555', '#F4C23A', '#E752A3', '#8969BE', '#85EAC8'],
  355. xAxis: {
  356. data: ['1月', '2月', '3月', '4月', '5月', '6月']
  357. },
  358. series: [
  359. {
  360. name: '企业微信',
  361. type: 'line',
  362. stack: 'Total',
  363. showSymbol: false,
  364. data: [120, 132, 101, 134, 90, 230, 210]
  365. },
  366. {
  367. name: 'OA系统',
  368. type: 'line',
  369. stack: 'Total',
  370. showSymbol: false,
  371. data: [20, 32, 1, 34, 9, 23, 21]
  372. },
  373. {
  374. name: '项目建设',
  375. type: 'line',
  376. stack: 'Total',
  377. showSymbol: false,
  378. data: [120, 132, 101, 134, 90, 230, 210]
  379. },
  380. {
  381. name: '勘察设计',
  382. type: 'line',
  383. stack: 'Total',
  384. showSymbol: false,
  385. data: [120, 132, 101, 134, 90, 230, 210]
  386. },
  387. {
  388. name: '4A平台',
  389. type: 'line',
  390. stack: 'Total',
  391. showSymbol: false,
  392. data: [20, 32, 1, 34, 9, 23, 21]
  393. },
  394. {
  395. name: '智慧工地',
  396. type: 'line',
  397. stack: 'Total',
  398. showSymbol: false,
  399. data: [120, 132, 101, 134, 90, 230, 210]
  400. }
  401. ]
  402. },
  403. // API调用情况数字
  404. apiTeams: [
  405. {
  406. number: null,
  407. txt: '企业微信',
  408. color: '#30A3D8'
  409. },
  410. {
  411. number: null,
  412. txt: 'OA系统',
  413. color: '#F25555'
  414. },
  415. {
  416. number: null,
  417. txt: '项目建设',
  418. color: '#F4C23A'
  419. },
  420. {
  421. number: null,
  422. txt: '勘察建设',
  423. color: '#E752A3'
  424. },
  425. {
  426. number: null,
  427. txt: '4A平台',
  428. color: '#8969BE'
  429. },
  430. {
  431. number: null,
  432. txt: '智慧工地',
  433. color: '#85EAC8'
  434. }
  435. ],
  436. // 登录情况数据
  437. loginOption: {
  438. title: {
  439. text: '登录情况'
  440. },
  441. color: ['#8969BE', '#F4C23A', '#E752A3'],
  442. series: [
  443. {
  444. name: '登录情况',
  445. radius: ['40%', '100%'],
  446. data: [
  447. { value: 2780, name: '正常登录' },
  448. { value: 735, name: '异常登录' },
  449. { value: 165, name: '登陆失败' }
  450. ]
  451. }
  452. ]
  453. },
  454. //角色概览
  455. userOption: {
  456. title: {
  457. text: '角色概览'
  458. },
  459. color: ['#8969BE', '#F4C23A', '#E752A3'],
  460. series: [
  461. {
  462. name: '角色概览',
  463. top: 43,
  464. radius: ['40%', '100%'],
  465. data: [
  466. { value: 1048, key: 'roleCount', name: '角色总数' },
  467. { value: 735, key: 'defRoleCunt', name: '互斥角色数' },
  468. { value: 735, key: 'unuseRole', name: '未使用角色数' }
  469. ]
  470. }
  471. ]
  472. },
  473. // 登录情况数字
  474. userTeams: [
  475. {
  476. number: 2780,
  477. txt: '角色总数',
  478. color: '#8969BE',
  479. key: 'roleCount'
  480. },
  481. {
  482. number: 2136,
  483. txt: '互斥角色数',
  484. color: '#F4C23A',
  485. key: 'defRoleCunt'
  486. },
  487. {
  488. number: 1355,
  489. txt: '未使用角色数',
  490. color: '#E752A3',
  491. key: 'unuseRole'
  492. }
  493. ],
  494. // 登录情况数字
  495. loginTeams: [
  496. {
  497. number: 2780,
  498. txt: '正常登录',
  499. color: '#8969BE'
  500. },
  501. {
  502. number: 735,
  503. txt: '异常登录',
  504. color: '#F4C23A'
  505. },
  506. {
  507. number: 165,
  508. txt: '非系统异常',
  509. color: '#E752A3'
  510. }
  511. ],
  512. // 授权情况数据
  513. authorizeOption: {
  514. title: {
  515. text: '授权情况'
  516. },
  517. color: ['#8969BE', '#94C6E0', '#85EAC8', '#F4C23A', '#E752A3'],
  518. series: [
  519. {
  520. name: '授权情况',
  521. radius: ['40%', '100%'],
  522. data: [
  523. { value: 1276, name: '账号授权' },
  524. { value: 126, name: '分组授权' },
  525. { value: 1236, name: '职员授权' },
  526. { value: 12736, name: '组织授权' },
  527. { value: 127, name: '角色授权' }
  528. ]
  529. }
  530. ]
  531. },
  532. // 授权情况数字
  533. authorizeArr: [
  534. {
  535. color: '#8969BE',
  536. name: '账号授权',
  537. num: '1276'
  538. },
  539. {
  540. color: '#94C6E0',
  541. name: '分组授权',
  542. num: '126'
  543. },
  544. {
  545. color: '#85EAC8',
  546. name: '职员授权',
  547. num: '1236'
  548. },
  549. {
  550. color: '#F4C23A',
  551. name: '组织授权',
  552. num: '12736'
  553. },
  554. {
  555. color: '#E752A3',
  556. name: '角色授权',
  557. num: '127'
  558. }
  559. ],
  560. // 行为情况数据
  561. behaviorOption: {
  562. title: {
  563. text: '行为情况'
  564. },
  565. color: ['#8969BE', '#F25555', '#F4C23A', '#E752A3', '#94C6E0', '#85EAC8'],
  566. series: [
  567. {
  568. name: '行为情况',
  569. radius: ['40%', '100%'],
  570. data: [
  571. { value: 1275, name: '4A平台' },
  572. { value: 2210, name: 'OA系统' },
  573. { value: 2220, name: '项目建设' },
  574. { value: 2230, name: '勘察设计' },
  575. { value: 2210, name: '企业微信' },
  576. { value: 2250, name: '智慧工程' }
  577. ]
  578. }
  579. ]
  580. },
  581. // 授权情况数字
  582. behaviorArr: [
  583. {
  584. color: '#8969BE',
  585. name: '4A平台',
  586. num: '1275'
  587. },
  588. {
  589. color: '#F25555',
  590. name: 'OA系统',
  591. num: '2210'
  592. },
  593. {
  594. color: '#F4C23A',
  595. name: '项目建设',
  596. num: '2220'
  597. },
  598. {
  599. color: '#E752A3',
  600. name: '勘察设计',
  601. num: '2230'
  602. },
  603. {
  604. color: '#94C6E0',
  605. name: '企业微信',
  606. num: '2210'
  607. },
  608. {
  609. color: '#85EAC8',
  610. name: '智慧工地',
  611. num: '2250'
  612. }
  613. ],
  614. // 数据概况
  615. unusualOption: {
  616. title: {
  617. text: '数据概况'
  618. },
  619. color: ['#F56C6C', '#F4C23A', '#E752A3', '#8969BE'],
  620. series: [
  621. {
  622. name: '数据',
  623. type: 'pie',
  624. radius: ['30%', '50%'],
  625. label: {
  626. position: 'inner',
  627. fontSize: 14,
  628. show: false
  629. },
  630. hoverAnimation: false,
  631. data: [
  632. { value: 1275, name: '下发有效' },
  633. { value: 220, name: '接收有效' },
  634. ]
  635. },
  636. {
  637. name: '数据',
  638. type: 'pie',
  639. radius: ['60%', '100%'],
  640. label: {
  641. position: 'inner',
  642. fontSize: 14,
  643. show: false
  644. },
  645. hoverAnimation: false,
  646. data: [
  647. { value: 220, name: '下发无效' },
  648. { value: 220, name: '接收无效' }
  649. ]
  650. }
  651. ]
  652. },
  653. // 数据概况数字
  654. unusualTeams: [
  655. {
  656. number: 1275,
  657. txt: '下发有效',
  658. color: '#8969BE'
  659. },
  660. {
  661. number: 220,
  662. txt: '下发无效',
  663. color: '#E752A3'
  664. },
  665. {
  666. number: 220,
  667. txt: '接收有效',
  668. color: '#F4C23A'
  669. },
  670. {
  671. number: 220,
  672. txt: '接收无效',
  673. color: '#F56C6C'
  674. }
  675. ],
  676. // 权限概览切换
  677. barArrs: [
  678. {
  679. name: '应用分析',
  680. value: 1
  681. },
  682. {
  683. name: '权限分析',
  684. value: 2
  685. }
  686. ]
  687. }
  688. },
  689. computed: {
  690. ...mapGetters(['systemSet']),
  691. },
  692. created () {
  693. const { OpenRole } = typeof this.systemSet === "string" ? JSON.parse(this.systemSet) : this.systemSet; //1是请求角色 0是请求用户
  694. this.OpenRole = OpenRole
  695. this.pageInit()
  696. },
  697. methods: {
  698. //账号信息切换
  699. checkAccountType (params) {
  700. if (params.value === 1 && params.name === '账号') {
  701. this.accountOption.title.text = '账号信息分析'
  702. this.accountTeamsOne[0].txt = '账号数'
  703. this.accountTeamsOne[1].txt = '账号分组'
  704. this.getUserAna()
  705. } else {
  706. this.accountOption.title.text = '职员信息分析'
  707. this.accountTeamsOne[0].txt = '职员数'
  708. this.accountTeamsOne[1].txt = '组织及岗位数'
  709. this.getOfficerAna()
  710. }
  711. },
  712. // 系统运行异常情况-日期选择
  713. checkSysType (params) {
  714. //console.log(`系统运行异常情况---->name:${params.name},value:${params.value}`)
  715. },
  716. // API调用情况-日期选择
  717. checkApiType (params) {
  718. //console.log(`API调用情况---->name:${params.name},value:${params.value}`)
  719. },
  720. //---------------获取数据方法------------------
  721. //获取账号信息分析
  722. async getUserAna () {
  723. try {
  724. const result = await GetUserAna()
  725. if (result.code === 0) {
  726. const res = result.returnData
  727. const keys = Object.entries(res)
  728. this.accountOption.series[0].name = '账号'
  729. this.accountOption.series[1].name = '账号'
  730. this.accountTeamsOne.forEach(item => {
  731. keys.filter(p => {
  732. if (item.key === p[0]) {
  733. item.number = p[1]
  734. }
  735. })
  736. })
  737. this.accountOption.series[0].data[0].value = res.userCount
  738. this.accountOption.series[0].data[1].value = res.groupCount
  739. this.accountOption.series[1].data[0].value = res.dayAct
  740. this.accountOption.series[1].data[1].value = res.monthAct
  741. } else {
  742. this.$message.error(result.message)
  743. }
  744. } catch (error) {
  745. console.log('网络错误:', error)
  746. }
  747. },
  748. //获取职员信息分析
  749. async getOfficerAna () {
  750. try {
  751. const result = await GetOfficerAna()
  752. if (result.code === 0) {
  753. const res = result.returnData
  754. const keys = Object.entries(res)
  755. this.accountOption.series[0].name = '职员'
  756. this.accountOption.series[1].name = '职员'
  757. this.accountTeamsOne.forEach(item => {
  758. keys.filter(p => {
  759. if (item.ana === p[0]) {
  760. item.number = p[1]
  761. }
  762. })
  763. })
  764. this.accountOption.series[0].data[0].value = res.officeCount
  765. this.accountOption.series[0].data[1].value = res.groupCount
  766. this.accountOption.series[1].data[0].value = res.dayAct
  767. this.accountOption.series[1].data[1].value = res.monthAct
  768. } else {
  769. this.$message.error(result.message)
  770. }
  771. } catch (error) {
  772. console.log('网络错误:', error)
  773. }
  774. },
  775. //获取角色信息分析
  776. async getRoleAna () {
  777. try {
  778. const result = await GetRoleAna()
  779. if (result.code === 0) {
  780. const res = result.returnData
  781. const keys = Object.entries(res)
  782. this.userTeams.forEach(item => {
  783. keys.filter(p => {
  784. if (item.key === p[0]) {
  785. item.number = p[1]
  786. }
  787. })
  788. })
  789. this.userOption.series[0].data.forEach(item => {
  790. keys.filter(p => {
  791. if (item.key === p[0]) {
  792. item.value = p[1]
  793. }
  794. })
  795. })
  796. } else {
  797. this.$message.error(result.message)
  798. }
  799. } catch (error) {
  800. console.log('网络错误:', error)
  801. }
  802. },
  803. //获取权限信息分析
  804. async getAuthAna () {
  805. try {
  806. const result = await GetAuthAna()
  807. if (result.code === 0) {
  808. const res = result.returnData
  809. const [appName, frontAuth, apiAuth, dataAuth] = [[], [], [], []]
  810. for (const p of res) {
  811. appName.push(p.appName)
  812. frontAuth.push(p.frontAuth)
  813. apiAuth.push(p.apiAuth)
  814. dataAuth.push(p.dataAuth)
  815. }
  816. this.towerOption.xAxis.data = appName
  817. this.towerOption.series[0].data = frontAuth
  818. this.towerOption.series[1].data = apiAuth
  819. this.towerOption.series[2].data = dataAuth
  820. } else {
  821. this.$message.error(result.message)
  822. }
  823. } catch (error) {
  824. console.log('网络错误:', error)
  825. }
  826. },
  827. pageInit () {
  828. this.getUserAna()
  829. this.getRoleAna()
  830. this.getAuthAna()
  831. }
  832. }
  833. }
  834. </script>
  835. <style lang="scss" scoped>
  836. .dashboard-analysis {
  837. // height: calc(100vh - 395px);
  838. // overflow-x: hidden;
  839. // overflow-y: scroll;
  840. .w160 {
  841. width: 160px;
  842. }
  843. .titleMsg {
  844. position: absolute;
  845. left: 0;
  846. top: 0;
  847. font-size: 24px;
  848. font-weight: bold;
  849. }
  850. .progressScale {
  851. top: 25px;
  852. transform: scale(1.2);
  853. }
  854. .dashboard-list {
  855. display: flex;
  856. margin-bottom: 24px;
  857. .tu-account {
  858. .tu-account-content-left {
  859. width: 212px;
  860. }
  861. .tu-account-content-right {
  862. flex: 1;
  863. margin-left: 50px;
  864. width: 150px;
  865. .account-team {
  866. margin-top: 36px;
  867. .account-team-list {
  868. font-size: 14px;
  869. font-family: Microsoft YaHei;
  870. font-weight: 400;
  871. color: #909399;
  872. margin-top: 18px;
  873. }
  874. }
  875. }
  876. }
  877. .tu-user {
  878. .tu-user-content-left {
  879. width: 212px;
  880. margin-right: 50px;
  881. }
  882. }
  883. .tu-sync {
  884. height: 280px;
  885. }
  886. .tu-system {
  887. height: 392px;
  888. }
  889. .behavior-list {
  890. margin-top: 16px;
  891. .icon {
  892. display: inline-block;
  893. width: 3px;
  894. height: 12px;
  895. background: #8969be;
  896. margin-right: 9px;
  897. }
  898. .name {
  899. font-size: 14px;
  900. font-family: Microsoft YaHei;
  901. font-weight: bold;
  902. color: #303133;
  903. }
  904. .num {
  905. font-size: 16px;
  906. font-family: DIN;
  907. font-weight: 500;
  908. color: #909399;
  909. }
  910. &:first-child {
  911. margin-top: 59px;
  912. }
  913. }
  914. }
  915. }
  916. </style>