audit-deploy-list.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div>
  3. <a-card>
  4. <!-- 高级搜索组件 -->
  5. <audit-advanced-query
  6. :expand="expand"
  7. :search-data="formData"
  8. :ref-name="searchform"
  9. :search-style="{ height: '150px', left: '20px', top: '80px' }"
  10. :search-fun="handleSearch"
  11. @searchedClick="searchedClick"
  12. >
  13. <template>
  14. <a-col :span="12">
  15. <a-form-model-item :label="'目录名称'" prop="contentsTitle">
  16. <a-input v-model="formData.contentsTitle" allow-clear />
  17. </a-form-model-item>
  18. </a-col>
  19. </template>
  20. </audit-advanced-query>
  21. <sd-data-table-ex
  22. ref="deployDataTable"
  23. :filter-expressions="expressions"
  24. :columns="columns"
  25. :actions="actions"
  26. form-id="iamDirectoryDeploy"
  27. page-id="audit/deploy/iamDirectoryDeploy"
  28. :search-fields="['contentsTitle']"
  29. show-selection
  30. :show-advance-query="true"
  31. @searchbtnClick="searchbtnClick"
  32. >
  33. <div slot="islink" slot-scope="text, record">
  34. <a @click="rowClick(record)">{{ text }}</a>
  35. </div>
  36. </sd-data-table-ex>
  37. </a-card>
  38. </div>
  39. </template>
  40. <script>
  41. import TableActionTypes from '@/common/services/table-action-types'
  42. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  43. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  44. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  45. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  46. import components from './_import-components/audit-deploy-list-import'
  47. export default {
  48. name: 'AuditDeployList',
  49. metaInfo: {
  50. title: '目录配置',
  51. },
  52. components: {
  53. ...components,
  54. auditAdvancedQuery,
  55. },
  56. mixins: [auditAdvancedQueryMixins, auditAdvancedGroupMixins],
  57. data() {
  58. return {
  59. searchform: 'searchform',
  60. expressions: [],
  61. formId: 'iamDirectoryDeploy',
  62. formData: {
  63. contentsTitle: '',
  64. },
  65. columns: [
  66. {
  67. title: '序号',
  68. dataIndex: 'sortNumber',
  69. customRender: (text, record, index) => `${index + 1}`,
  70. width: '80px',
  71. },
  72. {
  73. title: '目录名称',
  74. dataIndex: 'contentsTitle',
  75. scopedSlots: { customRender: 'islink' },
  76. },
  77. {
  78. title: '显示顺序',
  79. dataIndex: 'contentsOrder',
  80. defaultSortOrder: 'asc', // 没有点击任何排序列时,默认的排序列
  81. width: '10%',
  82. },
  83. {
  84. title: '归辑内容',
  85. dataIndex: 'collectionContent',
  86. width: '35%',
  87. },
  88. {
  89. title: '简要描述',
  90. dataIndex: 'remarks',
  91. },
  92. ],
  93. actions: [
  94. {
  95. label: '新建',
  96. id: 'new',
  97. permission: 'create',
  98. type: TableActionTypes.primary,
  99. callback: () => {
  100. const url = '/audit-deploy-form' // 新页面要打开的路由地址
  101. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  102. if (refreshFlag) {
  103. // 这里写或者调刷新的方法
  104. this.refresh()
  105. }
  106. })
  107. },
  108. },
  109. {
  110. label: '删除',
  111. id: 'delete',
  112. type: TableActionTypes.oa.delete, // 删除按钮,不需要回调,会自动处理
  113. },
  114. ],
  115. }
  116. },
  117. methods: {
  118. // 查询
  119. handleSearch() {
  120. this.expressions = []
  121. // 项目名称
  122. if (this.formData.contentsTitle) {
  123. this.expressions.push({
  124. dataType: 'str',
  125. name: 'contentsTitle',
  126. op: 'like',
  127. stringValue: `%${this.formData.contentsTitle}%`,
  128. })
  129. }
  130. },
  131. refresh() {
  132. return this.$refs.deployDataTable.refresh(true)
  133. },
  134. rowClick(record) {
  135. const url = '/audit-deploy-form?record=' + record.id // 新页面要打开的路由地址
  136. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  137. if (refreshFlag) {
  138. this.refresh()
  139. }
  140. })
  141. },
  142. },
  143. }
  144. </script>
  145. <style module lang="scss">
  146. @use '@/common/design' as *;
  147. </style>