selectResult.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!--
  2. * @Date: 2022-08-26 16:29:24
  3. * @LastEditors: StavinLi 495727881@qq.com
  4. * @LastEditTime: 2022-09-21 14:36:30
  5. * @FilePath: /Workflow-Vue3/src/components/selectResult.vue
  6. -->
  7. <template>
  8. <div class="select-result l">
  9. <p class="clear">
  10. 已选({{ total }})
  11. <a @click="emits('del')">清空</a>
  12. </p>
  13. <ul>
  14. <template v-for="{ type, data, cancel } in list" :key="type">
  15. <template v-if="type === 'role'">
  16. <li v-for="item in data" :key="item.roleId">
  17. <img src="@/assets/images/workflow/icon_role.png" />
  18. <span>{{ item.roleName }}</span>
  19. <img src="@/assets/images/workflow/cancel.png" @click="cancel(item)" />
  20. </li>
  21. </template>
  22. <template v-if="type === 'department'">
  23. <li v-for="item in data" :key="item.id">
  24. <img src="@/assets/images/workflow/icon_file.png" />
  25. <span>{{ item.departmentName }}</span>
  26. <img src="@/assets/images/workflow/cancel.png" @click="cancel(item)" />
  27. </li>
  28. </template>
  29. <template v-if="type === 'employee'">
  30. <li v-for="item in data" :key="item.id">
  31. <span>{{ item.name }}</span>
  32. <icon-close-one theme="outline" size="17" fill="#333" @click="cancel(item)"></icon-close-one>
  33. <!-- <img src="@/assets/images/cancel.png" @click="cancel(item)"> -->
  34. </li>
  35. </template>
  36. </template>
  37. </ul>
  38. </div>
  39. </template>
  40. <script setup>
  41. import { CloseOne as iconCloseOne } from '@icon-park/vue-next'
  42. defineProps({
  43. total: {
  44. type: Number,
  45. default: 0
  46. },
  47. list: {
  48. type: Array,
  49. default: () => [{ type: 'role', data, cancel }]
  50. }
  51. })
  52. let emits = defineEmits(['del'])
  53. </script>
  54. <style lang="scss">
  55. .select-result {
  56. width: 276px;
  57. height: 100%;
  58. font-size: 12px;
  59. ul {
  60. height: 460px;
  61. overflow-y: auto;
  62. li {
  63. margin: 11px 26px 13px 19px;
  64. line-height: 17px;
  65. display: flex;
  66. justify-content: space-between;
  67. align-items: center;
  68. span {
  69. vertical-align: middle;
  70. }
  71. img {
  72. &:first-of-type {
  73. width: 14px;
  74. vertical-align: middle;
  75. margin-right: 5px;
  76. }
  77. &:last-of-type {
  78. float: right;
  79. margin-top: 2px;
  80. width: 14px;
  81. }
  82. }
  83. }
  84. }
  85. p {
  86. padding-left: 19px;
  87. padding-right: 20px;
  88. line-height: 37px;
  89. border-bottom: 1px solid #f2f2f2;
  90. a {
  91. float: right;
  92. }
  93. }
  94. }
  95. </style>