iam-audit-dsc-bottom-div.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <template>
  2. <div :class="$style.mainDiv">
  3. <div :class="$style.title">问题整改情况</div>
  4. <a-row>
  5. <a-col :span="5">
  6. <div :class="[$style.pietitle]">
  7. <sd-echart :options="leftpie" autoresize :class="$style.onepieClass"/></div
  8. ></a-col>
  9. <a-col :span="5">
  10. <div :class="[$style.pietitle]">
  11. <sd-echart :options="rightpie" autoresize :class="$style.onepieClass" /> </div
  12. ></a-col>
  13. <a-col :span="14">
  14. <!-- <div style="padding-left: 200px" :class="[$style.pietitle]">需要整改的问题</div> -->
  15. <sd-echart :options="onepie" autoresize :class="$style.onepieClass" />
  16. </a-col>
  17. </a-row>
  18. </div>
  19. </template>
  20. <script>
  21. import 'echarts/lib/component/title'
  22. import 'echarts/lib/chart/pie'
  23. import 'echarts/lib/component/legend'
  24. import 'echarts/lib/component/tooltip'
  25. import iamAuditDscService from './iam-audit-dsc-service'
  26. import components from './_import-components/iam-audit-dsc-bottom-div-import'
  27. export default {
  28. name: 'IamAuditDscBottomDiv',
  29. metaInfo: {
  30. title: 'IamAuditDscBottomDiv',
  31. },
  32. components: {
  33. ...components,
  34. },
  35. props: {
  36. /**
  37. * 统计的组织ID
  38. */
  39. unidId: {
  40. type: Array,
  41. default: () => {
  42. return []
  43. },
  44. },
  45. /**
  46. * 统计的年份
  47. */
  48. planYear: {
  49. type: String,
  50. default: null,
  51. },
  52. },
  53. data() {
  54. return {
  55. leftactiveKey: '1',
  56. rightactiveKey: '1',
  57. total: 0,
  58. leftpie: {
  59. legend: {
  60. show: false,
  61. },
  62. color: ['#fff', '#8675ff', '#dce0fa'],
  63. series: [
  64. {
  65. left: 100,
  66. top: 65,
  67. type: 'pie',
  68. radius: [1111, 1111],
  69. label: {
  70. show: true,
  71. position: 'center',
  72. fontSize: 30,
  73. fontWeight: '600',
  74. color: '#8675ff',
  75. },
  76. emphasis: {
  77. disabled: true,
  78. scale: true,
  79. scaleSize: 0,
  80. },
  81. tooltip: {
  82. show: false,
  83. },
  84. labelLine: {
  85. show: true,
  86. },
  87. data: [],
  88. },
  89. {
  90. top: 65,
  91. left: 100,
  92. type: 'pie',
  93. radius: [73, 90],
  94. avoidLabelOverlap: false,
  95. label: {
  96. show: false,
  97. position: 'center',
  98. },
  99. legendHoverLink: false,
  100. emphasis: {
  101. scale: true,
  102. scaleSize: 0,
  103. },
  104. labelLine: {
  105. show: false,
  106. },
  107. data: [],
  108. },
  109. {
  110. type: 'pie',
  111. top: -270,
  112. left: 100,
  113. radius: [1111, 1111],
  114. label: {
  115. show: true,
  116. position: 'center',
  117. fontSize: 15,
  118. fontWeight: '600',
  119. color: 'rgba(0, 0, 0, 0.65)',
  120. },
  121. emphasis: {
  122. disabled: true,
  123. scale: true,
  124. scaleSize: 0,
  125. },
  126. tooltip: {
  127. show: false,
  128. },
  129. labelLine: {
  130. show: true,
  131. },
  132. data: [{ value: 0, name: '整改完成率' }],
  133. },
  134. ],
  135. },
  136. rightpie: {
  137. legend: {
  138. show: false,
  139. },
  140. color: ['#fff', '#54c5eb', '#dce0fa'],
  141. series: [
  142. {
  143. top: 65,
  144. type: 'pie',
  145. radius: [1111, 1111],
  146. label: {
  147. show: true,
  148. position: 'center',
  149. fontSize: 30,
  150. fontWeight: '600',
  151. color: '#54c5eb',
  152. },
  153. emphasis: {
  154. disabled: true,
  155. scale: true,
  156. scaleSize: 0,
  157. },
  158. tooltip: {
  159. show: false,
  160. },
  161. labelLine: {
  162. show: true,
  163. },
  164. data: [],
  165. },
  166. {
  167. top: 65,
  168. type: 'pie',
  169. radius: [73, 90],
  170. avoidLabelOverlap: false,
  171. label: {
  172. show: false,
  173. position: 'center',
  174. },
  175. legendHoverLink: false,
  176. emphasis: {
  177. scale: true,
  178. scaleSize: 0,
  179. },
  180. labelLine: {
  181. show: false,
  182. },
  183. data: [],
  184. },
  185. {
  186. type: 'pie',
  187. top: -270,
  188. radius: [1111, 1111],
  189. label: {
  190. show: true,
  191. position: 'center',
  192. fontSize: 15,
  193. fontWeight: '600',
  194. color: 'rgba(0, 0, 0, 0.65)',
  195. },
  196. emphasis: {
  197. disabled: true,
  198. scale: true,
  199. scaleSize: 0,
  200. },
  201. tooltip: {
  202. show: false,
  203. },
  204. labelLine: {
  205. show: true,
  206. },
  207. data: [{ value: 0, name: '到期整改率' }],
  208. },
  209. ],
  210. },
  211. onepie: {
  212. color: ['#000', '#bb7ec4', '#ffb74a', '#ff4a55', '#54c5eb', '#dce0fa'],
  213. textStyle: {
  214. color: '#8a8a8a',
  215. fontSize: 13,
  216. },
  217. tooltip: {
  218. trigger: 'item',
  219. },
  220. legend: {
  221. orient: 'vertical',
  222. right: 170,
  223. icon: 'circle',
  224. top: 90,
  225. textStyle: {
  226. width: 1000,
  227. backgroundColor: {
  228. image: require('./backgroundimg.png'),
  229. },
  230. color: '#8a8a8a',
  231. lineHeight: 25,
  232. padding: [0, 20, 0, 0],
  233. },
  234. data: [],
  235. },
  236. series: [
  237. {
  238. type: 'pie',
  239. top: 68,
  240. left: -500,
  241. radius: [1111, 1111],
  242. label: {
  243. show: true,
  244. position: 'center',
  245. fontSize: 20,
  246. fontWeight: 'bold',
  247. },
  248. emphasis: {
  249. disabled: true,
  250. scale: true,
  251. scaleSize: 0,
  252. },
  253. tooltip: {
  254. show: false,
  255. },
  256. labelLine: {
  257. show: true,
  258. },
  259. data: [],
  260. },
  261. {
  262. type: 'pie',
  263. left: -500,
  264. top: 70,
  265. radius: [60, 90],
  266. data: [],
  267. emphasis: {
  268. itemStyle: {
  269. shadowBlur: 10,
  270. shadowOffsetX: 0,
  271. shadowColor: 'rgba(0, 0, 0, 0.5)',
  272. },
  273. },
  274. label: {
  275. minMargin: 5,
  276. edgeDistance: 10,
  277. lineHeight: 15,
  278. padding: [0, -65],
  279. formatter: (params) => {
  280. return (
  281. params.data.name.split('\u2003')[0] +
  282. ' ' +
  283. Math.round(this.total * (params.percent / 100)) +
  284. '\n'
  285. )
  286. },
  287. },
  288. labelLine: {
  289. length2: '80px',
  290. },
  291. },
  292. {
  293. type: 'pie',
  294. top: -270,
  295. left: -500,
  296. radius: [1111, 1111],
  297. label: {
  298. show: true,
  299. position: 'center',
  300. fontSize: 15,
  301. fontWeight: '600',
  302. color: 'rgba(0, 0, 0, 0.65)',
  303. },
  304. emphasis: {
  305. disabled: true,
  306. scale: true,
  307. scaleSize: 0,
  308. },
  309. tooltip: {
  310. show: false,
  311. },
  312. labelLine: {
  313. show: true,
  314. },
  315. data: [{ value: 0, name: '需要整改的问题' }],
  316. },
  317. ],
  318. },
  319. }
  320. },
  321. computed: {
  322. // 因为props传值不会自动更新,使用计算值
  323. selectYear() {
  324. return this.planYear
  325. },
  326. // 因为props传值不会自动更新,使用计算值
  327. selectUnidId() {
  328. if (this.unidId.length > 0) {
  329. return this.unidId[0].id
  330. } else {
  331. return null
  332. }
  333. },
  334. },
  335. created() {
  336. // 获取项目总览
  337. this.getData()
  338. },
  339. methods: {
  340. getData() {
  341. // 获取项目总览
  342. const params = {
  343. unitId: this.selectUnidId,
  344. planYear: this.selectYear,
  345. }
  346. iamAuditDscService.getQuestionRectResult(params).then((res) => {
  347. // 设置整改完成率
  348. this.leftpie.series[0].data.push({ value: 0, name: res.data.COMPLATE_PERCENT })
  349. this.leftpie.series[1].data.push({
  350. value: parseFloat(res.data.COMPLATE_PERCENT.replace('%', '')),
  351. })
  352. this.leftpie.series[1].data.push({
  353. value: 100 - parseFloat(res.data.COMPLATE_PERCENT.replace('%', '')),
  354. })
  355. // 设置到期整改率
  356. this.rightpie.series[0].data.push({ value: 0, name: res.data.BECOME_PERCENT })
  357. this.rightpie.series[1].data.push({
  358. value: parseFloat(res.data.BECOME_PERCENT.replace('%', '')),
  359. })
  360. this.rightpie.series[1].data.push({
  361. value: 100 - parseFloat(res.data.BECOME_PERCENT.replace('%', '')),
  362. })
  363. // 设置总条数
  364. this.onepie.series[0].data.push({ value: 0, name: res.data.TOTAL + '条' })
  365. this.total = res.data.TOTAL
  366. this.onepie.legend.data.push({
  367. name:
  368. '已整改\u2003\u2003\u2003\u2003\u2003' +
  369. res.data.DONE_PERCENT +
  370. (res.data.DONE_PERCENT.length === 2
  371. ? '\u2003\u2003\u2003\u2003\u2002'
  372. : '\u2003\u2003\u2003\u2003') +
  373. res.data.DONE_RATE +
  374. '万元',
  375. })
  376. // { value: 1048, name: 'Search Engine' }
  377. // 已整改
  378. this.onepie.series[1].data.push({
  379. value: parseFloat(res.data.DONE_PERCENT.replace('%', '')),
  380. name:
  381. '已整改\u2003\u2003\u2003\u2003\u2003' +
  382. res.data.DONE_PERCENT +
  383. (res.data.DONE_PERCENT.length === 2
  384. ? '\u2003\u2003\u2003\u2003\u2002'
  385. : '\u2003\u2003\u2003\u2003') +
  386. res.data.DONE_RATE +
  387. '万元',
  388. tooltip: {
  389. formatter: () => {
  390. return res.data.DONE_PERCENT
  391. },
  392. },
  393. })
  394. // 整改中
  395. this.onepie.legend.data.push({
  396. name:
  397. '整改中\u2003\u2003\u2003\u2003\u2003' +
  398. res.data.DOING_PERCENT +
  399. (res.data.DOING_PERCENT.length === 2
  400. ? '\u2003\u2003\u2003\u2003\u2002'
  401. : '\u2003\u2003\u2003\u2003') +
  402. res.data.DOING_RATE +
  403. '万元',
  404. })
  405. this.onepie.series[1].data.push({
  406. value: parseFloat(res.data.DOING_PERCENT.replace('%', '')),
  407. name:
  408. '整改中\u2003\u2003\u2003\u2003\u2003' +
  409. res.data.DOING_PERCENT +
  410. (res.data.DOING_PERCENT.length === 2
  411. ? '\u2003\u2003\u2003\u2003\u2002'
  412. : '\u2003\u2003\u2003\u2003') +
  413. res.data.DOING_RATE +
  414. '万元',
  415. tooltip: {
  416. formatter: () => {
  417. return res.data.DOING_PERCENT
  418. },
  419. },
  420. })
  421. // 超期未整改
  422. this.onepie.legend.data.push({
  423. name:
  424. '超期未整改\u2003\u2003\u2003' +
  425. res.data.EXPIRE_PERCENT +
  426. (res.data.EXPIRE_PERCENT.length === 2
  427. ? '\u2003\u2003\u2003\u2003\u2002'
  428. : '\u2003\u2003\u2003\u2003') +
  429. res.data.EXPIRE_RATE +
  430. '万元',
  431. })
  432. this.onepie.series[1].data.push({
  433. value: parseFloat(res.data.EXPIRE_PERCENT.replace('%', '')),
  434. name:
  435. '超期未整改\u2003\u2003\u2003' +
  436. res.data.EXPIRE_PERCENT +
  437. (res.data.EXPIRE_PERCENT.length === 2
  438. ? '\u2003\u2003\u2003\u2003\u2002'
  439. : '\u2003\u2003\u2003\u2003') +
  440. res.data.EXPIRE_RATE +
  441. '万元',
  442. tooltip: {
  443. formatter: () => {
  444. return res.data.EXPIRE_PERCENT
  445. },
  446. },
  447. label: {
  448. padding: [0, -90],
  449. },
  450. labelLine: {
  451. length2: 115,
  452. },
  453. })
  454. // 风险接受
  455. this.onepie.legend.data.push({
  456. name:
  457. '风险接受\u2003\u2003\u2003\u2003' +
  458. res.data.RISK_PERCENT +
  459. (res.data.RISK_PERCENT.length === 2
  460. ? '\u2003\u2003\u2003\u2003\u2002'
  461. : '\u2003\u2003\u2003\u2003') +
  462. res.data.RISK_RATE +
  463. '万元',
  464. })
  465. this.onepie.series[1].data.push({
  466. value: parseFloat(res.data.RISK_PERCENT.replace('%', '')),
  467. name:
  468. '风险接受\u2003\u2003\u2003\u2003' +
  469. res.data.RISK_PERCENT +
  470. (res.data.RISK_PERCENT.length === 2
  471. ? '\u2003\u2003\u2003\u2003\u2002'
  472. : '\u2003\u2003\u2003\u2003') +
  473. res.data.RISK_RATE +
  474. '万元',
  475. tooltip: {
  476. formatter: () => {
  477. return res.data.RISK_PERCENT
  478. },
  479. },
  480. label: {
  481. padding: [0, -80],
  482. },
  483. labelLine: {
  484. length2: 105,
  485. },
  486. })
  487. // 未整改
  488. this.onepie.legend.data.push({
  489. name:
  490. '未整改\u2003\u2003\u2003\u2003\u2003' +
  491. res.data.TODO_PERCENT +
  492. (res.data.TODO_PERCENT.length === 2
  493. ? '\u2003\u2003\u2003\u2003\u2002'
  494. : '\u2003\u2003\u2003\u2003') +
  495. res.data.TODO_RATE +
  496. '万元',
  497. })
  498. this.onepie.series[1].data.push({
  499. value: parseFloat(res.data.TODO_PERCENT.replace('%', '')),
  500. name:
  501. '未整改\u2003\u2003\u2003\u2003\u2003' +
  502. res.data.TODO_PERCENT +
  503. (res.data.TODO_PERCENT.length === 2
  504. ? '\u2003\u2003\u2003\u2003\u2002'
  505. : '\u2003\u2003\u2003\u2003') +
  506. res.data.TODO_RATE +
  507. '万元',
  508. tooltip: {
  509. formatter: () => {
  510. return res.data.TODO_PERCENT
  511. },
  512. },
  513. })
  514. })
  515. },
  516. },
  517. }
  518. </script>
  519. <style module lang="scss">
  520. @use '@/common/design' as *;
  521. .main-div {
  522. height: 380px;
  523. margin: 0 10px;
  524. background: #fff;
  525. border-radius: 10px;
  526. .title {
  527. padding: 25px 0 10px 0;
  528. margin: 0 25px;
  529. font-weight: 600;
  530. border-bottom: 1px solid #e8e8e8;
  531. }
  532. }
  533. .onepie-class {
  534. width: 100%;
  535. height: 330px;
  536. }
  537. .pietitle {
  538. height: 50px;
  539. font-weight: bold;
  540. line-height: 75px;
  541. }
  542. </style>