add-fun-dialog.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!--
  2. 关联功能资源
  3. @Author: linqian
  4. @Date: 2021-10-18 14:08
  5. -->
  6. <template>
  7. <div>
  8. <!-- 搜索栏 -->
  9. <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
  10. <!-- 列表 -->
  11. <vxe-table-basic
  12. :gridOptions="gridOptions"
  13. :tableColumn="tableColumn"
  14. :tableData="tableData"
  15. :paginationConfig="paginationConfig"
  16. @paginationChange="getPagination"
  17. ></vxe-table-basic>
  18. <div v-footer>
  19. <dg-button @click="handleClose">取消</dg-button>
  20. <dg-button type="primary" @click="handleSave">保存</dg-button>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import searchBar from '@/components/search-bar';
  26. import { searchOpt } from '@/mixins/page-opt';
  27. import { appRestApi } from '@/api/application';
  28. import vxeTableBasic from '@/components/vxe-table-basic';
  29. import { getRedAppFuncList } from '@/api/list-manage';
  30. export default {
  31. components: { searchBar, vxeTableBasic },
  32. mixins: [searchOpt],
  33. props: {
  34. parentNode: Object,
  35. operateType: String,
  36. attrBelongType: String
  37. },
  38. data() {
  39. return {
  40. conditionForm: [
  41. {
  42. label: '应用系统名称',
  43. name: 'applyCode',
  44. op: 'like',
  45. value: '',
  46. component: 'SelectApp',
  47. apiUrl: appRestApi.table,
  48. valueName: 'applyCode',
  49. labelName: 'applyName'
  50. }
  51. ],
  52. gridOptions: {
  53. treeConfig: { children: 'child', indent: 40 }
  54. },
  55. tableColumn: [
  56. {
  57. align: 'left',
  58. headerAlign: 'center',
  59. title: '应用功能名称',
  60. field: 'label',
  61. treeNode: true
  62. }
  63. ],
  64. tableData: [],
  65. paginationConfig: {
  66. pageSize: 10,
  67. currentPage: 1,
  68. total: 0
  69. }
  70. };
  71. },
  72. computed: {},
  73. methods: {
  74. getPagination({ pageSize, currentPage }) {
  75. this.paginationConfig.pageSize = pageSize;
  76. this.paginationConfig.currentPage = currentPage;
  77. this.getList();
  78. },
  79. /**
  80. * 获取列表
  81. */
  82. getList() {
  83. const params = {
  84. page: this.paginationConfig.currentPage - 1,
  85. size: this.paginationConfig.pageSize,
  86. searchCondition: this.condition
  87. };
  88. getRedAppFuncList(params).then((res) => {
  89. const { content, totalElements } = res.data;
  90. this.tableData = content;
  91. this.paginationConfig.total = totalElements;
  92. });
  93. },
  94. receiveSearch(value) {
  95. this.condition = value;
  96. this.paginationConfig.currentPage = 1;
  97. this.getList();
  98. },
  99. handleClose() {
  100. this.$emit('close');
  101. },
  102. handleSubmit() {
  103. this.$emit('success');
  104. }
  105. },
  106. created() {
  107. this.getList();
  108. },
  109. mounted() {}
  110. };
  111. </script>
  112. <style lang='scss'>
  113. </style>