spacerose

Untitled

Nov 21st, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.54 KB | None | 0 0
  1. <template>
  2. <!-- <v-container> -->
  3. <div class="ld-select-receivers-wrapper">
  4. <!-- <v-row no-gutters v-if="label">
  5. <span class="font-weight-bold">{{ label }}:</span>
  6. </v-row> -->
  7. <v-col cols="12">
  8. <v-row class="no-gutters">
  9. <v-col>
  10. <vue-multiselect
  11. v-if="selectedReceivers"
  12. id="multiselect-id"
  13. ref="multiselect"
  14. v-model="selectedReceivers"
  15. :class="{ 'multiselect--extended': !isRestrictedToIds, 'multiselect--mobile-select': isMobile }"
  16. style="padding: 0"
  17. label="name"
  18. track-by="name"
  19. :placeholder="myPlaceholder"
  20. open-direction="bottom"
  21. select-label=""
  22. :options="receivers"
  23. :multiple="multiselect"
  24. :loading="loading"
  25. :searchable="true"
  26. :internal-search="isRestrictedToIds"
  27. :clear-on-select="true"
  28. :options-limit="300"
  29. :max-height="250"
  30. :show-no-results="true"
  31. :hide-selected="true"
  32. :show-no-options="false"
  33. :disabled="readonly"
  34. :allowEmpty="!lastLocked"
  35. v-on="bindOn"
  36. @select="receiverSelected"
  37. @remove="receiverRemoved"
  38. @input="receiverInputHandler"
  39. @open="onOpen"
  40. >
  41. <template slot="clear" slot-scope="props">
  42. <div
  43. v-if="selectedReceivers.length"
  44. class="multiselect-clear"
  45. @mousedown.prevent.stop="clearAll(props.search)"
  46. />
  47. </template>
  48. <!-------------->
  49. <!-- Chips -->
  50. <!-------------->
  51. <template slot="tag" slot-scope="props">
  52. <template v-if="isGroupUsers(props)">
  53. <v-tooltip bottom close-delay="3000">
  54. <template v-slot:activator="{ on }">
  55. <v-chip
  56. v-on="on"
  57. small
  58. :close="canRemove"
  59. color="primary_light"
  60. class="v-chip--select-multi white--text"
  61. @click:close="receiverRemoved(props.option)"
  62. >
  63. <v-icon class="user-icon mr-1">
  64. {{ tagIcon(props.option) }}
  65. </v-icon>
  66. <span :class="{ mobileChipContent: isMobile }">
  67. {{ props.option.displayName }}
  68. </span>
  69. </v-chip>
  70. </template>
  71. <div>
  72. <span v-html="getNamesByGroupId(props.option.id)"></span>
  73. </div>
  74. </v-tooltip>
  75. </template>
  76. <template v-else-if="isBadge(props)">
  77. <v-chip
  78. color="primary_light"
  79. :close="canRemove"
  80. small
  81. class="chip--select-multi white--text"
  82. @click:close="receiverRemoved(props.option)"
  83. >
  84. <svg-icon icon="label" width="16px" height="12px" class="mr-1" />
  85. <span :class="{ mobileChipContent: isMobile }">{{ props.option.displayName }}</span>
  86. </v-chip>
  87. </template>
  88. <template v-else-if="isGRKAttr(props)">
  89. <v-chip
  90. color="primary_light"
  91. :close="canRemove"
  92. small
  93. class="chip--select-multi white--text"
  94. @click:close="receiverRemoved(props.option)"
  95. >
  96. <svg-icon icon="user_filled" width="16px" height="12px" class="mr-1" />
  97. <span :class="{ mobileChipContent: isMobile }">{{ props.option.displayName }}</span>
  98. </v-chip>
  99. </template>
  100. <template v-else>
  101. <!-- <div v-if="!tooltipFields.length">
  102. <v-chip
  103. color="primary_light"
  104. :close="canRemove"
  105. small
  106. class="chip--select-multi white--text"
  107. @click:close="receiverRemoved(props.option)"
  108. >
  109. <v-icon class="user-icon mr-1">
  110. {{ tagIcon(props.option) }}
  111. </v-icon>
  112. <span :class="{ mobileChipContent: isMobile }">{{ props.option.displayName }}</span>
  113. </v-chip>
  114. </div> -->
  115. <user-tooltip-chip
  116. :user="props.option"
  117. :text="props.option.displayName"
  118. :icon="tagIcon(props.option)"
  119. :can-close="canRemove"
  120. @close="receiverRemoved(props.option)"
  121. />
  122. </template>
  123. </template>
  124. <!-------------->
  125. <!-- Options -->
  126. <!-------------->
  127. <template slot="option" slot-scope="option">
  128. <v-row class="py-2" no-gutters>
  129. <v-col class="d-flex align-center">
  130. <v-icon class="align-self-start" size="18">
  131. {{ tagIcon(option.option) }}
  132. </v-icon>
  133. <div>
  134. <div>
  135. <template v-if="option.option.fullName">
  136. {{ option.option.fullName }}
  137. </template>
  138. <template v-else>
  139. {{ option.option.name }}
  140. <template v-if="option.option.positionName">({{ option.option.positionName }})</template>
  141. </template>
  142. </div>
  143. <div v-if="formatOption">{{ formatOption(option.option) }}</div>
  144. <div v-else>{{ option.option.departmentName }}</div>
  145. </div>
  146. </v-col>
  147. </v-row>
  148. </template>
  149. <span slot="noResult">{{ notFoundMessage }}</span>
  150. </vue-multiselect>
  151. </v-col>
  152. </v-row>
  153.  
  154. <!-- Частые контакты -->
  155.  
  156. <v-row class="no-gutters mt-3" style="min-height: 20px">
  157. <template v-if="attributes">
  158. <!-- <v-col v-if="favoriteLabel && favoriteReceivers.length" class="col-12 mb-1">
  159. <translate class="text-body-1 black--text lighten-1 font-weight-bold">Частые контакты</translate>
  160. </v-col> -->
  161. <v-col v-if="1 === 2">
  162. <v-row
  163. align="center"
  164. no-gutters
  165. justify="center"
  166.  
  167. >
  168. <!-- :class="{ 'position-start': favoriteLabel || favoriteReceivers.length < 3 }" -->
  169.  
  170. <div v-if="!tooltipFields.length">
  171. <v-sheet :max-width="favoriteReceiversWidth">
  172. <v-slide-group multiple>
  173. <v-slide-item
  174. v-for="(value, key) of Object.keys(attributes)"
  175. :key="'fav-rec:' + key"
  176. >
  177.  
  178. <!-- Если это не юзер, то отображаем chip без тултипов -->
  179. <template>
  180. <v-chip
  181. close
  182. small
  183. class="chip--select-multi white--text primary_light"
  184. @click="onFavoriteClick(key)"
  185. @click:close="deleteFavoriteReceiver(key, index)"
  186. >
  187. <!-- <v-icon class="user-icon mr-1"> group </v-icon> -->
  188. {{ value }}
  189. </v-chip>
  190. </template>
  191. </v-slide-item>
  192. </v-slide-group>
  193. </v-sheet>
  194. </div>
  195. </v-row>
  196. </v-col>
  197. <datatable
  198. ref="table"
  199. class="material ngx-flex elevation-0"
  200. sort-type="multi"
  201. column-mode="standard"
  202. :rows="attributes"
  203. :scrollbar-v="true"
  204. :header-height="32"
  205. :row-height="26"
  206. selection-type="singleClick"
  207.  
  208. @select="onFavoriteClick()"
  209. >
  210. <!-- :columns="[{prop: 'RS', name: 'Р/с', sortable: true, canAutoResize:true},
  211. {prop: 'RSBankName', name: 'В банке', sortable: true, canAutoResize:true},
  212. {prop: 'KS', name: 'К/с', sortable: true, canAutoResize:true},
  213. {prop: 'KSBankName', name: 'В банке', sortable: true, canAutoResize:true}]" -->
  214. </datatable>
  215. </template>
  216. </v-row>
  217. </v-col>
  218. </div>
  219. <!-- </v-container> -->
  220. </template>
  221.  
Add Comment
Please, Sign In to add comment