xm-spic-desensitize-config.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <a-card>
  3. <sd-data-table-ex
  4. ref="refTable"
  5. form-id="spicDesensitize"
  6. page-id="audit/spicdesensitize/spicDesensitize"
  7. show-selection
  8. :columns="columns"
  9. :actions="actions"
  10. >
  11. <template slot="islink" slot-scope="text, record">
  12. <a :title="text" @click="rowClick(record)">{{ text }}</a>
  13. </template>
  14. </sd-data-table-ex>
  15. </a-card>
  16. </template>
  17. <script>
  18. import TableActionTypes from '@/common/services/table-action-types'
  19. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  20. import components from './_import-components/xm-spic-desensitize-config-import'
  21. export default {
  22. name: 'XmSpicDesensitizeConfig',
  23. metaInfo: {
  24. title: '脱敏配置',
  25. },
  26. components,
  27. data() {
  28. return {
  29. columns: [
  30. { title: '序号', customRender: (text, record, index) => `${index + 1}`, width: '180px' },
  31. { title: '标题', dataIndex: 'title', scopedSlots: { customRender: 'islink' } },
  32. ],
  33. actions: [
  34. {
  35. label: '新建',
  36. id: 'new',
  37. permission: 'create',
  38. type: TableActionTypes.primary,
  39. callback: () => {
  40. const url = '/xm-spic-desensitize-config-form'
  41. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  42. if (refreshFlag) {
  43. this.refresh()
  44. }
  45. })
  46. },
  47. },
  48. {
  49. label: '删除',
  50. id: 'delete',
  51. type: TableActionTypes.oa.delete,
  52. },
  53. ],
  54. }
  55. },
  56. methods: {
  57. rowClick(record) {
  58. const url = '/xm-spic-desensitize-config-form?record=' + record.id
  59. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  60. if (refreshFlag) {
  61. this.$refs.refTable.refresh()
  62. }
  63. })
  64. },
  65. refresh() {
  66. this.$refs.refTable.refresh()
  67. },
  68. },
  69. }
  70. </script>
  71. <style module lang="scss">
  72. @use '@/common/design' as *;
  73. </style>