audit-process-risk.vue 25 KB

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