kpi-job-list.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div>
  3. <a-card>
  4. <sd-data-table-ex
  5. ref="dataTable"
  6. :filter-expressions="expressions"
  7. :columns="columns"
  8. :actions="actions"
  9. form-id="kpiJobInfo"
  10. page-id="kpi/job/kpiJobInfo"
  11. show-selection
  12. :modal-props="{ class: 'noBottom' }"
  13. @searchbtnClick="searchbtnClick"
  14. >
  15. <div slot="islink" slot-scope="text, record">
  16. <a :title="text" @click="rowClick(record)">{{ text }}</a>
  17. </div>
  18. </sd-data-table-ex>
  19. </a-card>
  20. </div>
  21. </template>
  22. <script>
  23. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  24. import TableColumnTypes from '@/common/services/table-column-types'
  25. import TableActionTypes from '@/common/services/table-action-types'
  26. import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
  27. import components from './_import-components/kpi-job-list-import'
  28. export default {
  29. name: 'KpiJobList',
  30. metaInfo: {
  31. title: '指标定时任务列表',
  32. },
  33. components: {
  34. ...components,
  35. },
  36. mixins: [auditAdvancedQueryMixins],
  37. data() {
  38. return {
  39. checked: true,
  40. checking: false, // 按钮是否执行中
  41. dataType: [],
  42. searchform: 'searchform',
  43. expressions: [],
  44. formData: {
  45. name: '',
  46. databaseStatus: '',
  47. },
  48. columns: [
  49. {
  50. title: '序号',
  51. customRender: (text, record, index) => `${index + 1}`,
  52. width: '80px',
  53. },
  54. {
  55. title: '时间维度',
  56. dataIndex: 'jobFrequency',
  57. scopedSlots: { customRender: 'islink' },
  58. width: '300px',
  59. },
  60. {
  61. title: '执行规则',
  62. dataIndex: 'jobCron',
  63. },
  64. {
  65. title: '启用',
  66. dataIndex: 'jobStatus',
  67. sdRender: TableColumnTypes.ex.switch,
  68. },
  69. ],
  70. actions: [
  71. {
  72. label: '删除',
  73. permission: null,
  74. type: TableActionTypes.ex.delete,
  75. },
  76. {
  77. label: '新建',
  78. type: TableActionTypes.primary, // 新建按钮,不需要回调,自动处理
  79. permission: 'create', // 权限控制
  80. callback: () => {
  81. const url = '/kpi-job-form' // 新页面要打开的路由地址
  82. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  83. if (refreshFlag) {
  84. // 这里写或者调刷新的方法
  85. this.refresh()
  86. }
  87. })
  88. },
  89. },
  90. ],
  91. }
  92. },
  93. mounted() {},
  94. methods: {
  95. // 开关点击事件
  96. switchClick(record) {},
  97. clearSelection() {
  98. this.$refs.sjzlTable.clearSelection()
  99. },
  100. // 刷新列表
  101. refresh() {
  102. this.$refs.dataTable.refresh()
  103. },
  104. // 新建、详情打开新页面
  105. rowClick(record) {
  106. const url = '/kpi-job-form?record=' + record.id // 新页面要打开的路由地址
  107. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  108. if (refreshFlag) {
  109. this.refresh()
  110. }
  111. })
  112. },
  113. // 重置查询
  114. resetForm() {
  115. this.expressions = []
  116. this.formData = {}
  117. },
  118. },
  119. }
  120. </script>
  121. <style module lang="scss">
  122. @use '@/common/design' as *;
  123. </style>