audit-summarry-interest-list.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <audit-form-top-banner :form-data="'readonly'">
  3. <a-spin :spinning="isshowLoading" tip="正在导出请稍等……" size="large">
  4. <a-card :class="$style.conditions">
  5. <a-form-model
  6. ref="advancedSearchForm"
  7. class="ant-advanced-search-form"
  8. :model="form"
  9. v-bind="formItemLayout"
  10. layout="inline"
  11. >
  12. <div :class="$style.buttonContent">
  13. <a-button @click="exportExcel">导出</a-button>
  14. </div>
  15. </a-form-model>
  16. </a-card>
  17. <div>
  18. <a-card>
  19. <sd-data-table
  20. ref="SJMXDataTable"
  21. :key="dataKey"
  22. :columns="columns"
  23. :process-req="processReq"
  24. form-id="iamModelMaintain"
  25. :scroll="{ x: 1300 }"
  26. :hidePagination="true"
  27. show-selection
  28. data-url="api/xcoa-mobile/v1/iamquestionreform/iamQuestionReformSummary"
  29. :filter-expressions="expressions"
  30. >
  31. <div slot="viewFlag" slot-scope="text, record">
  32. <span>{{ record.viewFlag === 1 ? '已查看' : '未查看' }}</span>
  33. </div>
  34. <div slot="action" slot-scope="text, record">
  35. <!-- 如果 -->
  36. <a-button type="link" @click="showModal(record)">详情</a-button>
  37. <a-button
  38. type="link"
  39. @click="
  40. () => {
  41. modelLogicContent = record.configIdea
  42. modelLogicVisible = true
  43. }
  44. "
  45. >模型逻辑</a-button
  46. >
  47. <a-button
  48. v-if="record.reformAuth === 1 || record.reformAuth === '1'"
  49. type="link"
  50. :disabled="record.viewFlag === 1"
  51. @click="viewFlagClick(record)"
  52. >{{ record.viewFlag === 1 ? '已查看' : '查看' }}</a-button
  53. >
  54. </div>
  55. </sd-data-table>
  56. </a-card>
  57. <a-modal v-model="visible" title="问题详情" :footer="null" width="1200px" @cancel="cancel">
  58. <div :class="$style.modelDetail">
  59. <span>模型编码:{{ modelDetail.batchCode }}</span>
  60. <span>模型名称:{{ modelDetail.batchName }}</span>
  61. <span>业务领域:{{ modelDetail.modelDomainName }}</span>
  62. </div>
  63. <div :class="$style.detail">
  64. <a-table
  65. :columns="columnsDetail"
  66. :data-source="dataDetail"
  67. :row-key="(_, index) => index"
  68. :scroll="{ x: 1150, y: 500 }"
  69. >
  70. </a-table>
  71. </div>
  72. </a-modal>
  73. </div>
  74. <audit-model-logic v-model="modelLogicVisible" :content="modelLogicContent" />
  75. </a-spin>
  76. </audit-form-top-banner>
  77. </template>
  78. <script>
  79. import components from './_import-components/audit-summarry-list-import'
  80. import AuditRiskbraryService from '@product/iam/audit/riskLibrary/riskLibrary'
  81. import { message, Modal } from 'ant-design-vue'
  82. import auditFormTopBanner from './audit-top-banner'
  83. import download from '@/common/services/download'
  84. import auditModelLogic from './audit-model-logic'
  85. import { sdSessionStorage } from '@/common/services/storage-service'
  86. export default {
  87. name: 'AuditSummarryInterestList',
  88. metaInfo: {
  89. title: '审计问题明细-关注类',
  90. },
  91. components: {
  92. auditModelLogic,
  93. ...components,
  94. auditFormTopBanner,
  95. },
  96. data() {
  97. return {
  98. isshowLoading: false,
  99. modelLogicVisible: false,
  100. modelLogicContent: '',
  101. modelDetail: {},
  102. form: {
  103. viewFlag: null,
  104. },
  105. visible: false,
  106. ModalquestionDetail: '',
  107. dataKey: 0,
  108. formItemLayout: {
  109. labelCol: { span: 6 },
  110. wrapperCol: { span: 14 },
  111. },
  112. columns: [
  113. {
  114. title: '序号',
  115. dataIndex: 'sortNumber',
  116. width: '70px',
  117. customRender: (text, record, index) => `${index + 1}`,
  118. },
  119. {
  120. title: '风险描述',
  121. dataIndex: 'risk',
  122. },
  123. {
  124. title: '状态',
  125. dataIndex: 'viewFlag',
  126. scopedSlots: { customRender: 'viewFlag' },
  127. },
  128. {
  129. title: '查看人',
  130. dataIndex: 'modifyEmpAccount',
  131. },
  132. // 查看时间
  133. {
  134. title: '查看时间',
  135. dataIndex: 'viewTime',
  136. },
  137. {
  138. title: '操作',
  139. dataIndex: 'sharedSetting',
  140. fixed: 'right',
  141. width: '150px',
  142. scopedSlots: { customRender: 'action' },
  143. },
  144. ],
  145. expressions: [
  146. {
  147. dataType: 'str',
  148. name: 'modelType',
  149. op: 'eq',
  150. stringValue: '0',
  151. },
  152. ],
  153. queryData: {},
  154. columnsDetail: [],
  155. dataDetail: [],
  156. }
  157. },
  158. created() {
  159. this.initQueryData()
  160. },
  161. methods: {
  162. //
  163. // 初始化initQueryData
  164. initQueryData() {
  165. this.queryData = this.$route.query
  166. this.queryData.modelType = '2'
  167. },
  168. // 导出
  169. exportExcel() {
  170. // 判断选中的数据,至少选中一条数据
  171. const selectedRows = this.$refs.SJMXDataTable.getSelectedRows()
  172. if (selectedRows.length === 0) {
  173. message.warning('请至少选择一条数据')
  174. return
  175. }
  176. this.isshowLoading = true
  177. // 调用导出
  178. // 导出参数
  179. const params = selectedRows.map((item) => {
  180. return {
  181. modelId: item.modelId,
  182. detailGroupId: item.detailGroupId,
  183. businessCode: item.businessCode,
  184. jmEventType: item.jmEventType,
  185. eventTagName: item.eventTagName,
  186. modelTypeName: item.modelTypeName,
  187. pushDate: item.pushDate,
  188. unitCode: item.unitCode,
  189. modelType: item.modelType,
  190. bussKey: item.bussKey || null,
  191. }
  192. })
  193. // exportQuestionDetail
  194. AuditRiskbraryService.exportQuestionDetail(params)
  195. .then((res) => {
  196. if (res.status === 200) {
  197. //
  198. const url = URL.createObjectURL(res.data)
  199. const filename = res.headers['content-disposition']
  200. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  201. download(url, decodeURI(fname))
  202. // 导出成功
  203. message.success('导出成功')
  204. } else {
  205. Modal.warning({
  206. title: '提示',
  207. content: '导出报错,请联系管理员!',
  208. })
  209. return false
  210. }
  211. })
  212. .finally(() => {
  213. this.isshowLoading = false
  214. })
  215. },
  216. processReq(req) {
  217. const cacheData = sdSessionStorage.getItem('riskDetail')
  218. req.data.maxResults = this.$route.query.maxResults * 1 || 10
  219. req.data.startPosition = this.$route.query.startPosition * 1 || 0
  220. req.data.expressions = [
  221. { dataType: 'str', name: 'id', op: 'eq', stringValue: this.$route.query.recordId },
  222. ...JSON.parse(cacheData),
  223. ]
  224. return req
  225. },
  226. handleSearch() {
  227. this.dataKey++
  228. },
  229. handleReset() {
  230. this.$refs.advancedSearchForm.resetFields()
  231. },
  232. viewFlagClick(row) {
  233. const params = {
  234. modelId: row.modelId,
  235. detailGroupId: row.detailGroupId,
  236. jmEventType: row.jmEventType,
  237. businessCode: row.businessCode,
  238. bussKey: row.bussKey || null,
  239. pushDate: row.pushDate,
  240. unitCode: row.unitCode,
  241. viewFlag: 1,
  242. reformStatus: 1,
  243. }
  244. AuditRiskbraryService.saveIamQuestionReform(params).then((res) => {
  245. if (res) {
  246. message.success('提交成功')
  247. this.handleSearch()
  248. }
  249. })
  250. },
  251. // showModal(row) {
  252. // this.ModalquestionDetail = JSON.parse(row.questionDetail)
  253. // this.visible = true
  254. // },
  255. showModal(row) {
  256. // 审核状态
  257. this.detailStatus = row.status !== 1
  258. const params = {
  259. modelId: row.modelId,
  260. detailGroupId: row.detailGroupId,
  261. jmEventType: row.jmEventType,
  262. businessCode: row.businessCode,
  263. bussKey: row.bussKey || null,
  264. pushDate: row.pushDate,
  265. unitCode: row.unitCode,
  266. }
  267. const formData = new FormData()
  268. Object.keys(params).forEach((key) => {
  269. formData.append(key, params[key])
  270. })
  271. this.modelDetail = {
  272. modelDomainName: row.modelDomainName,
  273. batchName: row.modelName,
  274. batchCode: row.modelCode,
  275. riskData: row.risk,
  276. }
  277. // 地址audit-risk-detail 参数params
  278. const detailJson = JSON.stringify(this.modelDetail)
  279. const queryJson = JSON.stringify(params)
  280. window.open(
  281. `#/audit-risk-detail?queryJson=${queryJson}&modelDetail=${detailJson}&detailStatus=${this.detailStatus}`
  282. )
  283. },
  284. cancel() {
  285. this.visible = false
  286. this.dataDetail = []
  287. this.columnsDetail = []
  288. this.modelDetail = {}
  289. },
  290. },
  291. }
  292. </script>
  293. <style module lang="scss">
  294. @use '@/common/design' as *;
  295. .wrap-height {
  296. height: 100%;
  297. .row-height {
  298. display: flex;
  299. flex: auto;
  300. height: 100%;
  301. .rightcard {
  302. flex: 1;
  303. width: calc(100% - 20%);
  304. height: 100%;
  305. }
  306. }
  307. }
  308. .button-content {
  309. button {
  310. margin: 0 4px;
  311. }
  312. }
  313. .no-action {
  314. padding: 0 15px;
  315. color: $text-color-secondary;
  316. }
  317. .detail {
  318. width: 100%;
  319. overflow-x: auto;
  320. }
  321. .detail-delete {
  322. display: flex;
  323. justify-content: flex-end;
  324. }
  325. .model-detail {
  326. display: flex;
  327. margin-bottom: 10px;
  328. span {
  329. margin-right: 20px;
  330. }
  331. }
  332. </style>