audit-message-list.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <div :class="$style.rowHeight">
  4. <div :class="$style.rightcard">
  5. <a-tabs ref="tabs" v-model="expressions[0].stringValue" @change="tabTypeChange">
  6. <a-tab-pane key="1">
  7. <!-- 0 -->
  8. <span slot="tab">
  9. 共享申请
  10. </span>
  11. <a-card>
  12. <sd-data-table
  13. ref="messageTable"
  14. :filter-expressions="expressions"
  15. :columns="columns"
  16. :actions="actions"
  17. form-id="iamModelMaintain"
  18. data-url="api/xcoa-mobile/v1/iammodelshare/iamModelShareQueryList"
  19. >
  20. <div slot="action" slot-scope="text, record">
  21. <a-button
  22. v-if="record['applyStatus'] === 0"
  23. type="primary"
  24. style="margin-right: 15px;"
  25. @click="handleClick(record, 'ok')"
  26. >通过</a-button
  27. >
  28. <a-button v-if="record['applyStatus'] === 0" @click="handleClick(record, 'no')"
  29. >拒绝</a-button
  30. >
  31. </div>
  32. <!-- 申请结果 -->
  33. <template slot="applyStatus" slot-scope="text, record">
  34. <span v-if="record['applyStatus'] === 0">待审核</span>
  35. <span v-else-if="record['applyStatus'] === 1">已通过</span>
  36. <span v-else-if="record['applyStatus'] === 2">已拒绝</span>
  37. </template>
  38. </sd-data-table>
  39. </a-card>
  40. </a-tab-pane>
  41. <a-tab-pane key="0">
  42. <!-- 1 -->
  43. <span slot="tab">
  44. 提交申请
  45. </span>
  46. <a-card>
  47. <sd-data-table
  48. ref="submitTable"
  49. :filter-expressions="expressions"
  50. :columns="columns"
  51. :actions="actions"
  52. form-id="iamModelMaintain"
  53. data-url="api/xcoa-mobile/v1/iammodelshare/iamModelShareQueryList"
  54. >
  55. <template slot="applyStatus" slot-scope="text, record">
  56. <span v-if="record['applyStatus'] === 0">待审核</span>
  57. <span v-else-if="record['applyStatus'] === 1">已通过</span>
  58. <span v-else-if="record['applyStatus'] === 2">已拒绝</span>
  59. </template>
  60. </sd-data-table>
  61. </a-card>
  62. </a-tab-pane>
  63. </a-tabs>
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  70. import components from './_import-components/audit-view-list-import'
  71. import TableColumnTypes from '@/common/services/table-column-types'
  72. import auditMaintainService from './audit-maintain-service'
  73. export default {
  74. name: 'AuditMessageList',
  75. metaInfo: {
  76. title: '消息通知',
  77. },
  78. components: {
  79. ...components,
  80. },
  81. mixins: [auditAdvancedGroupMixins],
  82. data() {
  83. return {
  84. key: 0,
  85. treeData: [],
  86. searchform: 'searchform',
  87. formData: {
  88. tagCode: '',
  89. tagName: '',
  90. tagType: '',
  91. },
  92. formId: 'iamModelMaintain',
  93. columns: [
  94. {
  95. title: '申请模型名称',
  96. dataIndex: 'reservestring5',
  97. },
  98. {
  99. title: '申请人',
  100. dataIndex: 'reservestring4',
  101. },
  102. // 审核人
  103. {
  104. title: '审核人',
  105. dataIndex: 'reservestring3',
  106. },
  107. // 标签描述
  108. {
  109. title: '操作时间',
  110. dataIndex: 'creationTime',
  111. sdRender: TableColumnTypes.date,
  112. },
  113. // 申请结果
  114. {
  115. title: '申请结果',
  116. dataIndex: 'applyStatus',
  117. scopedSlots: { customRender: 'applyStatus' },
  118. },
  119. {
  120. title: '操作',
  121. dataIndex: 'action',
  122. scopedSlots: { customRender: 'action' },
  123. },
  124. ],
  125. actions: [],
  126. type: '0',
  127. expressions: [
  128. {
  129. dataType: 'str',
  130. name: 'messageType',
  131. op: 'eq',
  132. stringValue: '1',
  133. },
  134. ],
  135. catalogId: null,
  136. catalogName: '',
  137. isroot: true,
  138. }
  139. },
  140. watch: {
  141. type(val) {
  142. this.expressions = [
  143. {
  144. dataType: 'str',
  145. name: 'messageType',
  146. op: 'eq',
  147. stringValue: val,
  148. },
  149. ]
  150. if (val === '1') {
  151. // 如果没有操作列,添加操作列
  152. const isHasAction = this.columns.some((item) => item.dataIndex === 'action')
  153. if (!isHasAction) {
  154. this.columns.push({
  155. title: '操作',
  156. dataIndex: 'action',
  157. scopedSlots: { customRender: 'action' },
  158. })
  159. }
  160. this.$refs.messageTable.refresh()
  161. } else if (val === '0') {
  162. // 删除columns中的操作列
  163. this.columns.splice(this.columns.length - 1, 1)
  164. // this.$refs.submitTable.refresh()
  165. }
  166. },
  167. },
  168. methods: {
  169. tabTypeChange(val) {},
  170. handleClick(record, type) {
  171. const status = type === 'ok' ? 1 : 2
  172. auditMaintainService.updateApplyStatus({ id: record.id, applyStatus: status }).then(() => {
  173. this.$refs.messageTable.refresh()
  174. })
  175. },
  176. },
  177. }
  178. </script>
  179. <style module lang="scss">
  180. @use '@/common/design' as *;
  181. .wrap-height {
  182. height: 100%;
  183. .row-height {
  184. display: flex;
  185. flex: auto;
  186. height: 100%;
  187. .rightcard {
  188. flex: 1;
  189. width: calc(100% - 20%);
  190. height: 100%;
  191. }
  192. }
  193. }
  194. .no-action {
  195. color: $text-color-secondary;
  196. }
  197. </style>