iam-audit-dsc-top-div.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <a-row>
  3. <a-col
  4. v-for="(one, index) in ['sjry', 'xmzs', 'yqdxm', 'dg', 'sjfx', 'sjzg']"
  5. :key="one"
  6. :span="4"
  7. :class="one + '-col'"
  8. >
  9. <div :class="$style.mainDiv" @click="fnOpenModel(one)">
  10. <div :class="$style.leftDiv">
  11. <div :class="$style.title">{{ title[index] }}</div>
  12. <div :class="$style.number">{{ number[index] }}</div>
  13. </div>
  14. <div :class="$style.rightDiv">
  15. <a-avatar :style="{ backgroundColor: bgcolor[index] }" :class="$style.avatar" :size="65">
  16. <template v-slot:icon>
  17. <sd-icon
  18. :style="{
  19. marginLeft: index === 0 ? '5px' : '0px',
  20. marginTop: index === 3 ? '20px' : '0px',
  21. }"
  22. :type="icon[index]"
  23. theme="fill"
  24. >
  25. </sd-icon>
  26. </template>
  27. </a-avatar>
  28. </div>
  29. </div>
  30. </a-col>
  31. </a-row>
  32. </template>
  33. <script>
  34. import axios from '@/common/services/axios-instance'
  35. import iamAuditDscService from './iam-audit-dsc-service'
  36. import components from './_import-components/iam-audit-dsc-top-div-import'
  37. export default {
  38. name: 'IamAuditDscTopDiv',
  39. metaInfo: {
  40. title: 'IamAuditTopDiv',
  41. },
  42. components,
  43. props: {
  44. /**
  45. * 统计的组织ID
  46. */
  47. unidId: {
  48. type: Array,
  49. default: () => {
  50. return []
  51. },
  52. },
  53. /**
  54. * 统计的年份
  55. */
  56. planYear: {
  57. type: String,
  58. default: null,
  59. },
  60. },
  61. data() {
  62. return {
  63. icon: [
  64. 'sd-audit-dsc-user-icon',
  65. 'sd-audit-dsc-project-all-icon',
  66. 'sd-audit-dsc-project-start-icon',
  67. 'sd-audit-dsc-gzdg-icon',
  68. 'sd-audit-dsc-find-icon',
  69. 'sd-audit-dsc-rectify-icon',
  70. ],
  71. title: [
  72. '审计人员数',
  73. '项目总数',
  74. '已启动项目数',
  75. '底稿数量',
  76. '审计发现数量',
  77. '已整改问题数量',
  78. ],
  79. bgcolor: ['#bb7ec4', '#ffb648', '#ff4a55', '#00a389', '#54c5eb', '#bb7ec4'],
  80. number: [],
  81. }
  82. },
  83. computed: {
  84. // 因为props传值不会自动更新,使用计算值
  85. selectYear() {
  86. return this.planYear
  87. },
  88. // 因为props传值不会自动更新,使用计算值
  89. selectUnidId() {
  90. if (this.unidId.length > 0) {
  91. return this.unidId[0].id
  92. } else {
  93. return null
  94. }
  95. },
  96. // 因为props传值不会自动更新,使用计算值
  97. selectUnidText() {
  98. if (this.unidId.length > 0) {
  99. return this.unidId[0].name
  100. } else {
  101. return null
  102. }
  103. },
  104. },
  105. watch: {
  106. // 年份和组织变化时,重新加载数据
  107. selectYear() {
  108. this.getData()
  109. },
  110. selectUnidId() {
  111. this.getData()
  112. },
  113. },
  114. created() {
  115. // 创建时获取内容
  116. this.getData()
  117. },
  118. methods: {
  119. /**
  120. * 打开对应的模块
  121. */
  122. fnOpenModel(type) {
  123. // 审计人员
  124. if (type === 'sjry') {
  125. if (this.selectUnidId) {
  126. iamAuditDscService.getOrgId(this.selectUnidId).then((res) => {
  127. window.open(
  128. `#/iam-audit-dsc-userbase-list?depid=${res.data}&deptext=${this.selectUnidText}`
  129. )
  130. })
  131. } else {
  132. window.open(`#/iam-audit-dsc-userbase-list`)
  133. }
  134. }
  135. // 所有项目列表
  136. if (type === 'xmzs') {
  137. window.open(
  138. '#/iam-audit-dsc-project-list?params={"unitNames":"\'' +
  139. this.selectUnidText +
  140. '\'","planYear":"' +
  141. this.selectYear +
  142. '","unitIds":"' +
  143. this.selectUnidId +
  144. '"}&type=projectlist'
  145. )
  146. }
  147. // 已启动项目列表
  148. if (type === 'yqdxm') {
  149. window.open(
  150. '#/iam-audit-dsc-project-list?params={"unitNames":"\'' +
  151. this.selectUnidText +
  152. '\'","planYear":"' +
  153. this.selectYear +
  154. '","status":"start","unitIds":"' +
  155. this.selectUnidId +
  156. '"}&type=projectlist'
  157. )
  158. }
  159. // 底稿
  160. if (type === 'dg') {
  161. }
  162. // 审计发现
  163. if (type === 'sjfx') {
  164. window.open(
  165. '#/iam-audit-dsc-find-list?params={"unitNames":"\'' +
  166. this.selectUnidText +
  167. '\'","dateStart":"' +
  168. this.selectYear +
  169. '","dimension":"decision","unitIds":"' +
  170. this.selectUnidId +
  171. '"}&type=projectlist'
  172. )
  173. }
  174. // 已整改问题数量
  175. if (type === 'sjzg') {
  176. window.open(
  177. '#/iam-audit-dsc-rectify-list?params={"unitNames":"\'' +
  178. this.selectUnidText +
  179. '\'","dateStart":"' +
  180. this.selectYear +
  181. '","dimension":"decision","unitIds":"' +
  182. this.selectUnidId +
  183. '"}&type=projectlist'
  184. )
  185. }
  186. },
  187. /**
  188. * 初始化数据
  189. */
  190. getData() {
  191. this.number = []
  192. // 获取整体数量
  193. const params = {
  194. unitId: this.selectUnidId,
  195. planYear: this.selectYear,
  196. }
  197. if (this.selectUnidId) {
  198. iamAuditDscService.getAllNumResult(params).then((res) => {
  199. // 按顺序将内容写入
  200. const data = res.data
  201. // 审计人员数量
  202. this.number.push(data.PERSON_NUM)
  203. // 项目总数
  204. this.number.push(data.PROJECT_TOTAL_NUM)
  205. // 已启动项目数
  206. this.number.push(data.STARTED_PROJECT_NUM)
  207. // 底稿数量
  208. this.number.push(data.PAPER_NUM)
  209. // 审计发现数量
  210. this.number.push(data.FIND_NUM)
  211. // 已整改问题数量
  212. this.number.push(data.RECT_NUM)
  213. })
  214. }
  215. },
  216. },
  217. }
  218. </script>
  219. <style module lang="scss">
  220. @use '@/common/design' as *;
  221. .main-div {
  222. display: flex;
  223. height: 105px;
  224. margin: 0 10px;
  225. cursor: pointer;
  226. background: #fff;
  227. border-radius: 10px;
  228. .left-div {
  229. display: flex;
  230. flex-direction: column;
  231. width: 70%;
  232. padding-left: 22px;
  233. .title {
  234. height: 40%;
  235. font-weight: 600;
  236. line-height: 60px;
  237. }
  238. .number {
  239. height: 60%;
  240. font-size: 45px;
  241. font-weight: 700;
  242. line-height: 45px;
  243. }
  244. }
  245. .right-div {
  246. width: 30%;
  247. .avatar {
  248. margin-top: 20px;
  249. }
  250. }
  251. }
  252. :global(.dg-col) {
  253. .main-div {
  254. cursor: not-allowed;
  255. }
  256. }
  257. </style>