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