AddFilePopup.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <u-popup class="jnpf-select" :maskCloseAble="maskCloseAble" mode="bottom" v-model="showPopup"
  3. :safeAreaInsetBottom="safeAreaInsetBottom" @close="close">
  4. <view class="u-select">
  5. <view class="u-select__header" @touchmove.stop.prevent="">
  6. <view class="u-select__header__cancel u-select__header__btn" :style="{ color: cancelColor }"
  7. hover-class="u-hover-class" :hover-stay-time="150" @tap="close()"
  8. style="width: 60rpx;text-align: center;">
  9. <text v-if="cancelBtn">{{cancelText}}</text>
  10. </view>
  11. <view class="u-select__header__title" style="flex: 1;text-align: center;">
  12. {{title}}
  13. </view>
  14. <view class="u-select__header__confirm u-select__header__btn" :style="{ color: confirmColor }"
  15. style="width: 60rpx;text-align: center;" hover-class="u-hover-class" :hover-stay-time="150"
  16. @touchmove.stop="" @tap.stop="handleConfirm()">
  17. <text v-if="confirmBtn">{{confirmText}}</text>
  18. </view>
  19. </view>
  20. <view class="u-select__body u-select__body__multiple">
  21. <scroll-view :scroll-y="true" style="height: 100%">
  22. <view class="u-flex u-p-l-20 u-p-r-20" style="height: 100rpx;border-bottom: 1rpx solid #f0f2f6;"
  23. @click="radioGroupChange('add')">
  24. <text class="u-m-r-20 u-font-28 icon-ym icon-ym-add-folder"></text>
  25. <text>新建文件夹</text>
  26. </view>
  27. <!-- #ifndef APP-HARMONY -->
  28. <view class="u-flex u-p-l-20 u-p-r-20 uploadFileBtn" @click="radioGroupChange('up')">
  29. <JnpfUploadFileComment ref="lsjUpload" height="100rpx" childId="upload" :size="10"
  30. :parentId="parentId" @callback="onCallback">
  31. </JnpfUploadFileComment>
  32. </view>
  33. <!-- #endif -->
  34. </scroll-view>
  35. </view>
  36. </view>
  37. </u-popup>
  38. </template>
  39. <script>
  40. import resources from '@/libs/resources.js'
  41. export default {
  42. props: {
  43. height: {
  44. type: [Number, String],
  45. default: ''
  46. },
  47. cancelBtn: {
  48. type: Boolean,
  49. default: true
  50. },
  51. confirmBtn: {
  52. type: Boolean,
  53. default: true
  54. },
  55. show: {
  56. type: Boolean,
  57. default: false
  58. },
  59. cancelColor: {
  60. type: String,
  61. default: '#606266'
  62. },
  63. confirmColor: {
  64. type: String,
  65. default: '#2979ff'
  66. },
  67. safeAreaInsetBottom: {
  68. type: Boolean,
  69. default: false
  70. },
  71. maskCloseAble: {
  72. type: Boolean,
  73. default: true
  74. },
  75. title: {
  76. type: String,
  77. default: ''
  78. },
  79. parentId: {
  80. type: [String, Number],
  81. default: 0
  82. },
  83. cancelText: {
  84. type: String,
  85. default: '取消'
  86. },
  87. confirmText: {
  88. type: String,
  89. default: '确认'
  90. }
  91. },
  92. data() {
  93. return {
  94. showPopup: false,
  95. icon: resources.message.nodata,
  96. option: {},
  97. id: ''
  98. }
  99. },
  100. watch: {
  101. show: {
  102. handler(val) {
  103. this.showPopup = val
  104. },
  105. immediate: true
  106. }
  107. },
  108. computed: {
  109. baseURL() {
  110. return this.define.baseURL
  111. },
  112. token() {
  113. return uni.getStorageSync('token')
  114. },
  115. },
  116. methods: {
  117. //文件上传
  118. onCallback(e) {
  119. this.$emit('onCallback', e)
  120. },
  121. // 获取默认选中的值
  122. radioGroupChange(e) {
  123. this.$emit('confirm', e)
  124. },
  125. close() {
  126. this.$emit('close');
  127. },
  128. }
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .notData-box {
  133. width: 100%;
  134. height: 100%;
  135. justify-content: center;
  136. align-items: center;
  137. margin-top: -50px;
  138. .notData-inner {
  139. width: 286rpx;
  140. height: 222rpx;
  141. align-items: center;
  142. .iconImg {
  143. width: 100% !important;
  144. height: 100% !important;
  145. }
  146. }
  147. .notData-inner-text {
  148. color: #909399;
  149. }
  150. }
  151. .jnpf-select {
  152. width: 100%;
  153. .u-select {
  154. &__header {
  155. display: flex;
  156. flex-direction: row;
  157. align-items: center;
  158. justify-content: space-between;
  159. height: 40px;
  160. padding: 0 20px;
  161. position: relative;
  162. ::after {
  163. content: "";
  164. position: absolute;
  165. border-bottom: 0.5px solid #eaeef1;
  166. transform: scaleY(0.5);
  167. bottom: 0;
  168. right: 0;
  169. left: 0;
  170. }
  171. }
  172. &__body {
  173. width: 100%;
  174. overflow: hidden;
  175. background-color: #fff;
  176. &__picker-view {
  177. height: 100%;
  178. box-sizing: border-box;
  179. &__item {
  180. display: flex;
  181. align-items: center;
  182. justify-content: center;
  183. font-size: 32rpx;
  184. padding: 0 8rpx;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. </style>