batch-delete-appfunc.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!--
  2. 批量删除应用功能红名单
  3. @Author: linqian
  4. @Date: 2021-07-14 10:09
  5. -->
  6. <template>
  7. <div>
  8. <p>是否确定移除以下应用功能红名单?</p>
  9. <p style="margin-top: 10px; margin-bottom: 5px">选中的应用功能列表:</p>
  10. <!-- 表格树 -->
  11. <vxe-grid v-bind="gridOptions" ref="vxeGrid" :data="targetData"></vxe-grid>
  12. <div v-footer>
  13. <dg-button @click="handleCancel">取消</dg-button>
  14. <dg-button type="primary" @click="handleSubmit">确定</dg-button>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import getTreeDataMixin from '@/pages/common/transfer-tree/mixin';
  20. import { delBatchRedAppFunc } from '@/api/list-manage';
  21. export default {
  22. props: {
  23. data: [Array],
  24. value: {
  25. type: Array,
  26. default() {
  27. return [];
  28. }
  29. },
  30. selectedData: [Array]
  31. },
  32. mixins: [getTreeDataMixin],
  33. components: {},
  34. data() {
  35. return {
  36. appName: '',
  37. valueName: 'id',
  38. childrenName: 'child',
  39. pidName: 'p',
  40. gridOptions: {
  41. border: true,
  42. rowId: 'id',
  43. treeConfig: { children: 'child', indent: 40, expandAll: false },
  44. loading: false,
  45. checkboxConfig: {
  46. // 设置复选框支持分页勾选,需要设置 rowId 行数据主键
  47. reserve: true
  48. },
  49. columns: [
  50. { type: 'seq', width: 60, align: 'center', title: '序号' },
  51. { title: '应用功能名称', field: 'label', treeNode: true, align: 'left', headerAlign: 'center' }
  52. ]
  53. }
  54. };
  55. },
  56. computed: {},
  57. methods: {
  58. handleCancel() {
  59. this.$emit('close');
  60. },
  61. // 批量删除
  62. handleSubmit() {
  63. delBatchRedAppFunc({
  64. listIds: this.selectedData.map(item => item.listId)
  65. }).then((res) => {
  66. this.$message.success('删除成功!');
  67. this.$emit('success');
  68. });
  69. }
  70. },
  71. created() {},
  72. mounted() {}
  73. };
  74. </script>
  75. <style lang='scss' scoped>
  76. @import url('../index.scss');
  77. </style>