audit-process-risk.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. <template>
  2. <a-spin :spinning="isshowLoading" tip="正在导出请稍等……" size="large">
  3. <div :class="$style.title">
  4. <a-form-model layout="inline">
  5. <a-form-model-item label="单位:">
  6. <div style="width: 300px">
  7. <SdGroupPicker
  8. ref="cRelSelect"
  9. v-model="companyUnit"
  10. :single="true"
  11. :root-node="userNodeTree"
  12. @change="changecompany"
  13. />
  14. </div>
  15. </a-form-model-item>
  16. <a-form-model-item>
  17. <div :class="$style.time">
  18. <a-row>
  19. <a-col :span="6">
  20. <a-select v-model="searchForm.timeType">
  21. <a-select-option key="1" value="1">推送时间</a-select-option>
  22. <a-select-option key="2" value="2">业务时间</a-select-option>
  23. </a-select>
  24. </a-col>
  25. <a-col :span="18">
  26. <a-range-picker v-model="searchForm.timeArr" />
  27. </a-col>
  28. </a-row>
  29. </div>
  30. </a-form-model-item>
  31. <a-form-model-item>
  32. <a-button type="primary" @click="searchData">查询</a-button>
  33. </a-form-model-item>
  34. </a-form-model>
  35. <a-divider></a-divider>
  36. <a-spin :spinning="pieLoading" tip="正在加载请稍等……" size="large">
  37. <div :class="$style.contentView">
  38. <div :class="[$style.viewBody, $style.viewBodySmall]">
  39. <div :class="$style.contentTitle">问题推送数量</div>
  40. <a-form-model layout="inline" :class="$style.searchform">
  41. <a-form-model-item label="业务领域:">
  42. <div style="width: 300px">
  43. <!-- 多选 -->
  44. <a-select
  45. v-model="searchForm.area"
  46. mode="multiple"
  47. :max-tag-count="2"
  48. @change="areaChange"
  49. >
  50. <template slot="maxTagPlaceholder">
  51. ...
  52. </template>
  53. <a-select-option v-for="(item, i) in areaOption" :key="i" :value="item.id">{{
  54. item.name
  55. }}</a-select-option>
  56. </a-select>
  57. </div>
  58. </a-form-model-item>
  59. <!-- 查询搜索 -->
  60. </a-form-model>
  61. <!-- -->
  62. <div :class="$style.numberofissues">
  63. <!-- 总推送数量,问题数,非问题数 已整改数 未整改数 -->
  64. <div v-for="(item, i) in sumList" :key="i">{{ item.name }}:{{ item.value }}</div>
  65. </div>
  66. <!-- -->
  67. </div>
  68. <div :class="[$style.viewBody]">
  69. <div :class="$style.contentTitle">问题领域分布</div>
  70. <div v-if="isshowpie" id="pie" :class="$style.pie"></div>
  71. <a-empty
  72. v-else
  73. style="height: 400px;
  74. line-height: 400px;"
  75. />
  76. </div>
  77. </div>
  78. </a-spin>
  79. <a-spin :spinning="scatterLoading" tip="正在加载请稍等……" size="large">
  80. <div :class="[$style.viewBody, $style.viewBodyBig]">
  81. <div :class="$style.contentTitle">责任人分析</div>
  82. <div id="scatter" :class="$style.scatter"></div>
  83. </div>
  84. </a-spin>
  85. <!-- 审计问题推送及整改率情况对标 -->
  86. <div :class="[$style.viewBody, $style.viewBodyBig]">
  87. <div :class="$style.contentTitle">审计问题推送及整改率情况对标</div>
  88. <div :class="$style.table">
  89. <div ref="tableHeight" :class="$style.tableone">
  90. <h1 :class="$style.tabletitle">疑点问题排名</h1>
  91. <sd-table
  92. :row-key="(row) => row.id"
  93. :scroll="{ y: tablHeight }"
  94. :columns="column1"
  95. :loading="loadingTable1"
  96. :data-source="tableData1"
  97. :pagination="false"
  98. ></sd-table>
  99. </div>
  100. <div :class="$style.tableone">
  101. <h1 :class="$style.tabletitle">整改率排名</h1>
  102. <sd-table
  103. :row-key="(row) => row.id"
  104. :scroll="{ y: tablHeight }"
  105. :loading="loadingTable2"
  106. :columns="column2"
  107. :data-source="tableData2"
  108. :pagination="false"
  109. ></sd-table>
  110. </div>
  111. </div>
  112. <!-- 下载按钮 -->
  113. <div :class="$style.download" @click="downLoadTable">
  114. <a-icon type="vertical-align-bottom" :style="{ fontSize: '18px' }" />
  115. </div>
  116. </div>
  117. </div>
  118. </a-spin>
  119. </template>
  120. <script>
  121. import components from './_import-components/audit-process-risk-import'
  122. import DataService from '../dataUphold/data-config'
  123. import auditMaintainService from '../maintain/audit-maintain-service'
  124. import AuditRiskbraryService from './riskLibrary'
  125. import { getUserInfo } from '@/common/store-mixin'
  126. import echarts from 'echarts'
  127. import moment from 'moment'
  128. import download from '@/common/services/download'
  129. import { message, Modal } from 'ant-design-vue'
  130. import SdGroupPicker from '../report/audit-company-select.vue'
  131. export default {
  132. name: 'AuditProcessRisk',
  133. metaInfo: {
  134. title: 'AuditProcessRisk',
  135. },
  136. components: {
  137. ...components,
  138. SdGroupPicker,
  139. },
  140. data() {
  141. return {
  142. searchForm: {
  143. area: [],
  144. // 推送日期
  145. pushDataSd: '',
  146. pushDataEd: '',
  147. // 业务日期
  148. timeArr: [],
  149. // 单位
  150. unitName: '',
  151. unitCode: '',
  152. timeType: '1',
  153. },
  154. areaOption: [],
  155. companyUnit: [],
  156. userNodeTree: [],
  157. isshowLoading: false,
  158. sumList: [
  159. {
  160. name: '总推送数',
  161. value: 0,
  162. key: 'total',
  163. },
  164. {
  165. name: '问题数',
  166. value: 0,
  167. key: 'questionNum',
  168. },
  169. {
  170. name: '非问题数',
  171. value: 0,
  172. key: 'nonQuestionNum',
  173. },
  174. {
  175. name: '已整改数',
  176. value: 0,
  177. key: 'reformNum',
  178. },
  179. {
  180. name: '未整改数',
  181. value: 0,
  182. key: 'nonReformNum',
  183. },
  184. ],
  185. pieLoading: false,
  186. isshowpie: false,
  187. listLoading: false,
  188. scatterLoading: false,
  189. // 下钻领域
  190. drillDomain: '',
  191. // 下钻数据
  192. // 领域
  193. domainData: [],
  194. // 阶段
  195. purchaseData: [],
  196. statusData: [],
  197. echartsPie: null,
  198. echartsScatter: null,
  199. tableData1: [],
  200. tableData2: [],
  201. loadingTable1: false,
  202. loadingTable2: false,
  203. // //单位编码
  204. // private String unitCode;
  205. // //单位名称
  206. // private String unitName;
  207. // //问题数量
  208. // private Integer count;
  209. // //整改率
  210. // private String reformRate;
  211. column1: [
  212. {
  213. title: '序号',
  214. dataIndex: 'id',
  215. width: '80px',
  216. },
  217. {
  218. title: '单位编码',
  219. dataIndex: 'unitCode',
  220. width: '100px',
  221. },
  222. {
  223. title: '单位名称',
  224. dataIndex: 'unitName',
  225. // 超出隐藏
  226. ellipsis: true,
  227. },
  228. {
  229. title: '疑点问题数量',
  230. dataIndex: 'count',
  231. width: '140px',
  232. },
  233. ],
  234. column2: [
  235. {
  236. title: '序号',
  237. dataIndex: 'id',
  238. width: '80px',
  239. },
  240. {
  241. title: '单位编码',
  242. dataIndex: 'unitCode',
  243. width: '100px',
  244. },
  245. {
  246. title: '单位名称',
  247. dataIndex: 'unitName',
  248. ellipsis: true,
  249. },
  250. {
  251. title: '整改率',
  252. dataIndex: 'reformRate',
  253. width: '100px',
  254. },
  255. ],
  256. tablHeight: 0,
  257. isJt: false,
  258. scatterData: [],
  259. }
  260. },
  261. created() {
  262. this.initUserCompanyRole()
  263. },
  264. mounted() {
  265. this.tablHeight = this.$refs.tableHeight.clientHeight - 130
  266. },
  267. methods: {
  268. // 初始化, 获取当前人群的权限,
  269. initUserCompanyRole() {
  270. // 初始化时间
  271. this.searchForm.timeArr = [moment().startOf('year'), moment()]
  272. const userInfo = getUserInfo()
  273. DataService.getCompany(userInfo.account).then((res) => {
  274. // 100000和100001
  275. const roleCompany = ['100000', '100001']
  276. this.userNodeTree = [
  277. {
  278. code: res.data.id,
  279. name: res.data.name,
  280. orgCode: res.data.code,
  281. },
  282. ]
  283. this.companyUnit = [
  284. {
  285. code: res.data.id,
  286. name: res.data.name,
  287. orgCode: res.data.code,
  288. },
  289. ]
  290. if (roleCompany.includes(res.data.code)) {
  291. this.isJt = true
  292. this.userNodeTree = [
  293. {
  294. code: '28951',
  295. name: '国家电力投资集团有限公司',
  296. orgCode: '100000',
  297. },
  298. ]
  299. this.companyUnit = [
  300. {
  301. code: '28951',
  302. name: '国家电力投资集团有限公司',
  303. orgCode: '100000',
  304. },
  305. ]
  306. }
  307. this.searchForm.unitName = this.companyUnit[0].name
  308. this.searchForm.unitCode = this.companyUnit[0].orgCode
  309. this.initAreaData()
  310. this.initPieData()
  311. this.initTable()
  312. this.getScatterData()
  313. })
  314. },
  315. // 获取领域信息
  316. initAreaData() {
  317. auditMaintainService.getAreaListAll().then((res) => {
  318. this.areaOption = res.data
  319. // 默认选择第一个领域
  320. // 调用查询问题推送数量接口
  321. this.getSumData()
  322. })
  323. },
  324. // 领域变化
  325. areaChange(val) {
  326. // 根据val的值过滤选项
  327. this.getSumData()
  328. },
  329. // 查询问题推送数量
  330. getSumData() {
  331. this.listLoading = true
  332. AuditRiskbraryService.getCountStatistics(this.searchParams('area'))
  333. .then((res) => {
  334. const data = res.data
  335. // 如果data的key和sumList的key相同,就赋值
  336. this.sumList = this.sumList.map((item) => {
  337. return {
  338. ...item,
  339. value: data[item.key] || 0,
  340. }
  341. })
  342. })
  343. .finally(() => {
  344. this.listLoading = false
  345. })
  346. },
  347. changecompany(data) {
  348. this.searchForm.unitName = data[0]?.name || ''
  349. this.searchForm.unitCode = data[0]?.orgCode || ''
  350. },
  351. // 获取数据
  352. searchParams(type) {
  353. // 如果包含领域,如果包含下钻
  354. const params = {}
  355. // 时间类型
  356. let timeArr = this.searchForm.timeArr.map((item) => (item ? moment(item)._d.getTime() : ''))
  357. // 如果业务实践时间
  358. if (this.searchForm.timeType === '1') {
  359. timeArr = timeArr.map((item) => (item ? moment(item).format('YYYY-MM-DD') : ''))
  360. params.pushDateSt = timeArr[0]
  361. params.pushDateEd = timeArr[1]
  362. } else {
  363. //
  364. // 格式为年月日时分秒
  365. params.bussTimeSt = timeArr[0]
  366. params.bussTimeEd = timeArr[1]
  367. }
  368. params.unitCode = this.searchForm.unitCode
  369. if (type === 'area') {
  370. params.modelDomainList = this.searchForm.area
  371. }
  372. // 如果是下钻
  373. if (type === 'drill') {
  374. params.modelDomainId = this.drillDomain
  375. }
  376. return params
  377. },
  378. searchData() {
  379. this.getSumData()
  380. this.initPieData()
  381. this.getScatterData()
  382. this.initTable()
  383. },
  384. // 获取饼图数据
  385. // 初始化 ,领域分布 ,阶段分布
  386. initPieData() {
  387. // 外层
  388. this.pieLoading = true
  389. AuditRiskbraryService.getDomainDistribution(this.searchParams())
  390. .then((res1) => {
  391. // 内层
  392. AuditRiskbraryService.getStatusStatistics(this.searchParams()).then((res2) => {
  393. this.domainData = res1.data.data
  394. this.statusData = res2.data
  395. this.isshowpie = this.domainData.length !== 0
  396. this.$nextTick(() => {
  397. this.initPie()
  398. })
  399. })
  400. })
  401. .finally(() => {
  402. setTimeout(() => {
  403. this.pieLoading = false
  404. }, 60000)
  405. })
  406. },
  407. // 初始化饼图
  408. initPie() {
  409. const pie = document.getElementById('pie')
  410. this.echartsPie = echarts.init(pie)
  411. this.echartsPie.clear()
  412. const color = ['#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4']
  413. // //期限内已整改
  414. // private Integer status0;
  415. // //逾期已整改
  416. // private Integer status1;
  417. // //期限内未整改已完成
  418. // private Integer status2;
  419. // //逾期未整改完成
  420. // private Integer status3;
  421. const statusKey = [
  422. {
  423. name: '期限内已整改',
  424. key: 'status0',
  425. },
  426. {
  427. name: '逾期已整改',
  428. key: 'status1',
  429. },
  430. {
  431. name: '期限内未整改',
  432. key: 'status2',
  433. },
  434. {
  435. name: '逾期未整改',
  436. key: 'status3',
  437. },
  438. ]
  439. let inside = statusKey.map((item) => {
  440. return {
  441. name: item.name,
  442. value: this.statusData[item.key] || 0,
  443. }
  444. })
  445. // 过滤等于0的数据
  446. inside = inside.filter((item) => item.value !== 0)
  447. const outer = this.domainData.map((item) => {
  448. return {
  449. name: item.domainName,
  450. value: item.count,
  451. modelDomainId: item.modelDomainId,
  452. }
  453. })
  454. // 如果outer===0
  455. if (outer.length === 0) {
  456. this.pieLoading = false
  457. this.isshowpie = false
  458. }
  459. const option = {
  460. tooltip: {
  461. trigger: 'item',
  462. formatter: '{a} <br/>{b}: {c} ({d}%)',
  463. },
  464. color,
  465. legend: {
  466. data: [
  467. ...this.purchaseData.map((item) => item.modelPhaseName),
  468. ...this.domainData.map((item) => item.domainName),
  469. ],
  470. },
  471. series: [
  472. {
  473. name: '占比',
  474. type: 'pie',
  475. selectedMode: 'single',
  476. radius: [0, '30%'],
  477. label: {
  478. position: 'inner',
  479. fontSize: 14,
  480. },
  481. labelLine: {
  482. show: false,
  483. },
  484. // 饼图中心
  485. data: inside,
  486. itemStyle: {
  487. color: function(colos) {
  488. return colos.dataIndex === 1 ? '#91cc75' : '#5470c6'
  489. },
  490. },
  491. },
  492. {
  493. name: '占比',
  494. type: 'pie',
  495. radius: ['45%', '60%'],
  496. labelLine: {
  497. length: 30,
  498. },
  499. label: {
  500. formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ',
  501. backgroundColor: '#F6F8FC',
  502. borderColor: '#8C8D8E',
  503. borderWidth: 1,
  504. borderRadius: 4,
  505. rich: {
  506. a: {
  507. color: '#6E7079',
  508. lineHeight: 22,
  509. align: 'center',
  510. },
  511. hr: {
  512. borderColor: '#8C8D8E',
  513. width: '100%',
  514. borderWidth: 1,
  515. height: 0,
  516. },
  517. b: {
  518. color: '#4C5058',
  519. fontSize: 14,
  520. fontWeight: 'bold',
  521. lineHeight: 33,
  522. },
  523. per: {
  524. color: '#fff',
  525. backgroundColor: '#4C5058',
  526. padding: [3, 4],
  527. borderRadius: 4,
  528. },
  529. },
  530. },
  531. data: outer,
  532. itemStyle: {},
  533. },
  534. ],
  535. }
  536. this.echartsPie.setOption(option)
  537. this.pieLoading = false
  538. // 监听外圈点击事件
  539. this.echartsPie.on('click', (params) => {
  540. this.drillDomain = params.data.modelDomainId
  541. if (this.drillDomain) {
  542. AuditRiskbraryService.getPhaseDistribution(this.searchParams('drill')).then((res) => {
  543. this.purchaseData = res.data.data
  544. this.echartsPie.clear()
  545. const that = this
  546. // 重新绘制 下钻
  547. const setOption = {
  548. legend: {
  549. top: 'bottom',
  550. },
  551. title: {
  552. text: params.data.name,
  553. left: 'center',
  554. },
  555. tooltip: {
  556. trigger: 'item',
  557. formatter: '{a} <br/>{b}: {c} ({d}%)',
  558. },
  559. graphic: [
  560. {
  561. type: 'text',
  562. left: 50,
  563. top: 20,
  564. style: {
  565. text: '返回',
  566. fontSize: 18,
  567. },
  568. onclick: function() {
  569. that.echartsPie.clear()
  570. that.initPie()
  571. },
  572. },
  573. ],
  574. color: ['#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4'],
  575. series: [
  576. {
  577. name: '问题个数',
  578. type: 'pie',
  579. radius: [20, 100],
  580. center: ['50%', '50%'],
  581. roseType: 'area',
  582. itemStyle: {
  583. borderRadius: 8,
  584. },
  585. data: this.purchaseData.map((item) => {
  586. return {
  587. value: item.count,
  588. name: item.modelPhaseName,
  589. }
  590. }),
  591. },
  592. ],
  593. }
  594. this.echartsPie.setOption(setOption)
  595. })
  596. }
  597. })
  598. // 添加尺寸变化监听
  599. window.addEventListener('resize', () => {
  600. this.echartsPie.resize()
  601. })
  602. },
  603. // 初始化散点图数据
  604. getScatterData() {
  605. this.scatterLoading = true
  606. AuditRiskbraryService.getResPersonStatistics(this.searchParams())
  607. .then((res) => {
  608. this.scatterData = res.data.data
  609. this.initScatter()
  610. })
  611. .finally(() => {
  612. setTimeout(() => {
  613. this.scatterLoading = false
  614. }, 60000)
  615. })
  616. },
  617. // 初始化散点图
  618. initScatter() {
  619. const scatter = document.getElementById('scatter')
  620. this.echartsScatter = echarts.init(scatter)
  621. this.echartsScatter.clear()
  622. const legendData = this.scatterData.map((item) => item.modelName)
  623. const option = {
  624. color: [
  625. '#dd4444',
  626. '#fec42c',
  627. '#80F1BE',
  628. '#fac858',
  629. '#ee6666',
  630. '#73c0de',
  631. '#3ba272',
  632. '#fc8452',
  633. '#9a60b4',
  634. ],
  635. legend: {
  636. type: 'scroll',
  637. orient: 'vertical', // 图例列表的布局朝向(垂直排列)
  638. right: 0,
  639. height: '80%',
  640. data: legendData,
  641. y: 'center',
  642. bottom: 10,
  643. itemGap: 15, // 图例的上下间距
  644. itemWidth: 8, // 图例左侧图块的长度
  645. padding: 5,
  646. textStyle: {
  647. fontSize: 16,
  648. fontWeight: 400,
  649. color: '#33333',
  650. },
  651. pageTextStyle: {
  652. // 设置分页的当前页与总页码的文本样式
  653. color: 'rgba(36, 196, 221, 0.95)',
  654. },
  655. pageIconColor: '#6495ed', // 翻页下一页的三角按钮颜色
  656. pageIconInactiveColor: '#aaa', // 翻页(即翻页到头时)
  657. pageIconSize: 20, // 翻页按钮大小
  658. pageButtonGap: 22, // 翻页按钮与图例的间距
  659. formatter: function(name) {
  660. // 截取字符串八个
  661. return name.length > 8 ? name.substring(0, 8) + '...' : name
  662. },
  663. },
  664. grid: {
  665. left: '5%',
  666. right: 300,
  667. top: '18%',
  668. bottom: '10%',
  669. },
  670. tooltip: {
  671. backgroundColor: 'rgba(255,255,255,0.1)',
  672. // 文字颜色
  673. textStyle: {
  674. color: '#33333',
  675. },
  676. formatter: function(param) {
  677. var value = param.data
  678. // prettier-ignore
  679. return '<div style="border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 18px;padding-bottom: 7px;margin-bottom: 7px">'
  680. + param.seriesName + ''
  681. + '</div>'
  682. + '问题数量' + ':' + value[0] + '<br>'
  683. + '非问题数量' + ':' + value[1] + '<br>';
  684. },
  685. },
  686. xAxis: {
  687. type: 'value',
  688. name: '问题数量',
  689. nameGap: 16,
  690. // 最小步长
  691. minInterval: 1,
  692. nameTextStyle: {
  693. fontSize: 16,
  694. },
  695. splitLine: {
  696. show: false,
  697. },
  698. },
  699. yAxis: {
  700. type: 'value',
  701. name: '非问题数量',
  702. nameLocation: 'end',
  703. minInterval: 1,
  704. nameGap: 20,
  705. nameTextStyle: {
  706. fontSize: 16,
  707. },
  708. splitLine: {
  709. show: false,
  710. },
  711. },
  712. series: this.scatterData.map((item) => {
  713. // 分为三档
  714. // 大于10为15
  715. // 大于10020
  716. // 大于1000为25
  717. const symbolSize = item.questionNum > 1000 ? 50 : item.questionNum > 100 ? 40 : 30
  718. return {
  719. name: item.modelName,
  720. type: 'scatter',
  721. symbolSize: symbolSize,
  722. itemStyle: {
  723. opacity: 0.8,
  724. },
  725. data: [[item.questionNum, item.nonQuestionNum]],
  726. }
  727. }),
  728. }
  729. this.echartsScatter.setOption(option)
  730. this.scatterLoading = false
  731. window.addEventListener('resize', () => {
  732. this.echartsScatter.resize()
  733. })
  734. },
  735. // 初始化表格
  736. initTable() {
  737. this.loadingTable1 = true
  738. this.loadingTable2 = true
  739. AuditRiskbraryService.getQuestionNumRank(this.searchParams())
  740. .then((res) => {
  741. this.tableData1 = res.data.data.map((item, index) => {
  742. return {
  743. ...item,
  744. id: index + 1,
  745. }
  746. })
  747. })
  748. .finally(() => {
  749. this.loadingTable1 = false
  750. })
  751. AuditRiskbraryService.getReformRateRank(this.searchParams())
  752. .then((res) => {
  753. this.tableData2 = res.data.data.map((item, index) => {
  754. // reformRate: "0.08%" 如果超出两位小数则四舍五入
  755. const reformRate = item.reformRate
  756. const reformRateNum = Number(reformRate.replace('%', ''))
  757. item.reformRate = reformRateNum.toFixed(2) + '%'
  758. return {
  759. ...item,
  760. id: index + 1,
  761. }
  762. })
  763. })
  764. .finally(() => {
  765. this.loadingTable2 = false
  766. })
  767. },
  768. // downLoad
  769. downLoadTable() {
  770. this.isshowLoading = true
  771. AuditRiskbraryService.downLoadTwoTable(this.searchParams())
  772. .then((res) => {
  773. if (res.status === 200) {
  774. const url = URL.createObjectURL(res.data)
  775. const filename = res.headers['content-disposition']
  776. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  777. download(url, decodeURI(fname))
  778. // 导出成功
  779. message.success('导出成功')
  780. } else {
  781. Modal.warning({
  782. title: '提示',
  783. content: '导出报错,请联系管理员!',
  784. })
  785. return false
  786. }
  787. })
  788. .finally(() => {
  789. this.isshowLoading = false
  790. })
  791. },
  792. },
  793. }
  794. </script>
  795. <style module lang="scss">
  796. @use '@/common/design' as *;
  797. .title {
  798. min-height: 100%;
  799. padding: 20px;
  800. background: #fff;
  801. }
  802. ::v-deep .ant-card-body {
  803. height: 100%;
  804. }
  805. .scatter {
  806. width: 100%;
  807. height: 500px;
  808. }
  809. .content-view {
  810. display: flex;
  811. justify-content: space-between;
  812. height: calc(100% - 70px);
  813. }
  814. .view-body {
  815. position: relative;
  816. // flex: 1;
  817. width: 68%;
  818. height: 500px;
  819. border: 1px solid #0086d6;
  820. border-radius: 10px;
  821. // title居中浮动
  822. .content-title {
  823. position: absolute;
  824. top: -20px;
  825. left: calc(50% - 75px);
  826. width: 150px;
  827. height: 40px;
  828. font-size: 18px;
  829. font-weight: 600;
  830. line-height: 40px;
  831. color: #fff;
  832. text-align: center;
  833. background: #02a7f0;
  834. border-radius: 5px;
  835. }
  836. &:last-child .content-title {
  837. background-color: #0086d6;
  838. }
  839. .searchform {
  840. padding: 25px 0 10px 15px;
  841. }
  842. }
  843. .view-body-big {
  844. width: 100%;
  845. margin-top: 50px;
  846. .content-title {
  847. left: calc(50% - 140px);
  848. width: 280px;
  849. }
  850. }
  851. .view-body-small {
  852. width: 30%;
  853. margin-right: 2%;
  854. }
  855. .time {
  856. display: flex;
  857. align-items: center;
  858. justify-content: flex-start;
  859. }
  860. .numberofissues {
  861. display: flex;
  862. flex-direction: column;
  863. align-items: center;
  864. justify-content: space-between;
  865. width: 90%;
  866. height: calc(100% - 100px);
  867. margin: 10px auto;
  868. > div {
  869. width: 90%;
  870. height: 60px;
  871. font-weight: 600;
  872. line-height: 60px;
  873. color: #fff;
  874. text-align: center;
  875. background-color: #015478;
  876. border-radius: 10px;
  877. }
  878. :nth-child(1) {
  879. width: 100%;
  880. background-color: #1b365d;
  881. }
  882. }
  883. .pie {
  884. width: 100%;
  885. height: calc(100% - 60px);
  886. margin-top: 40px;
  887. }
  888. .table {
  889. display: flex;
  890. justify-content: space-between;
  891. height: 100%;
  892. padding: 20px;
  893. margin-top: 20px;
  894. .tableone {
  895. align-items: center;
  896. width: 48%;
  897. height: 95%;
  898. padding: 10px;
  899. background-color: #fff;
  900. border-radius: 10px;
  901. box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  902. .tabletitle {
  903. margin-bottom: 10px;
  904. font-size: 20px;
  905. font-weight: 600;
  906. }
  907. }
  908. }
  909. // 右上角
  910. .download {
  911. position: absolute;
  912. top: 10px;
  913. right: 10px;
  914. z-index: 1;
  915. cursor: pointer;
  916. }
  917. </style>