AssignRequest.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div>
  3. <table-lists style="min-height:auto" ref="tableLists" v-model="data" :filter="filter" :filterReset="0" requestApi="/system/auth/getRequest">
  4. <template slot="filterContent">
  5. <FormItem>
  6. <Input type="text" size="large" v-model="filter.keyword" placeholder="搜索关键词"/>
  7. </FormItem>
  8. </template>
  9. <Table size="large" ellipsis :columns="columns" :data="data.lists['noAssign']" stripe height="270">
  10. <template slot-scope="{ row }" slot="op">
  11. <Button size="small" type="success" @click="add(row)">加入</Button>
  12. </template>
  13. </Table>
  14. </table-lists>
  15. <Table size="large" ellipsis style="margin-top: 10px" :columns="columns" :data="data.lists['assign']" stripe height="270">
  16. <template slot-scope="{row,index}" slot="op">
  17. <Button size="small" type="error" @click="remove(row,index)">移出</Button>
  18. </template>
  19. </Table>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'AssignRequest',
  25. data() {
  26. return {
  27. data: {
  28. lists:[]
  29. },
  30. filter: {
  31. keyword: "",
  32. id: 0,
  33. },
  34. columns: [
  35. {
  36. type: 'ID',
  37. key: 'id',
  38. width: 70,
  39. align: 'center'
  40. },
  41. {
  42. title: '名称',
  43. key: 'name',
  44. },
  45. {
  46. title: 'ACTION',
  47. key: 'action',
  48. },
  49. {
  50. title: '操作',
  51. slot: 'op',
  52. width: 140,
  53. },
  54. ]
  55. }
  56. },
  57. props: {
  58. id: Number,
  59. },
  60. created() {
  61. this.filter.id = this.id;
  62. },
  63. methods: {
  64. remove(row) {
  65. this.$request('/system/auth/removeRequest').data({
  66. id: this.id,
  67. requestId: row.id
  68. }).success(() => {
  69. this.reload();
  70. }).get();
  71. },
  72. add(row) {
  73. this.$request('/system/auth/assignRequest').data({
  74. id: this.id,
  75. requestId: row.id
  76. }).success(() => {
  77. this.reload();
  78. }).get();
  79. },
  80. reload() {
  81. this.$refs.tableLists.reload(true);
  82. this.$emit('reload')
  83. }
  84. }
  85. }
  86. </script>