You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.5 KiB

  1. <template>
  2. <base-modal
  3. :disabled="disabled"
  4. :text="$t('generic.delete')"
  5. >
  6. <template v-slot="slotProps">
  7. <base-card
  8. :title="title"
  9. :agree-text="buttonTrueText"
  10. :cancel-text="buttonFalseText"
  11. @agree="ok(); slotProps.close()"
  12. @cancel="slotProps.close"
  13. >
  14. <template #content>
  15. {{ message }}
  16. <v-list dense>
  17. <v-list-item v-for="(item, i) in items" :key="i">
  18. <v-list-item-content>
  19. <v-list-item-title>{{ item[itemKey] }}</v-list-item-title>
  20. </v-list-item-content>
  21. </v-list-item>
  22. </v-list>
  23. </template>
  24. </base-card>
  25. </template>
  26. </base-modal>
  27. </template>
  28. <script>
  29. import BaseCard from '@/components/molecules/BaseCard'
  30. import BaseModal from '@/components/molecules/BaseModal'
  31. export default {
  32. components: {
  33. BaseCard,
  34. BaseModal
  35. },
  36. props: {
  37. title: {
  38. type: String,
  39. default: '',
  40. required: true
  41. },
  42. message: {
  43. type: String,
  44. default: '',
  45. required: true
  46. },
  47. items: {
  48. type: Array,
  49. default: () => [],
  50. required: true
  51. },
  52. itemKey: {
  53. type: String,
  54. default: '',
  55. required: true
  56. },
  57. disabled: {
  58. type: Boolean,
  59. default: false
  60. },
  61. buttonTrueText: {
  62. type: String,
  63. default: 'Yes'
  64. },
  65. buttonFalseText: {
  66. type: String,
  67. default: 'Cancel'
  68. }
  69. },
  70. methods: {
  71. ok() {
  72. this.$emit('ok')
  73. }
  74. }
  75. }
  76. </script>