index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="blacklog-container">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="close">
  4. </uni-nav-bar>
  5. <!-- <div style="height: 88rpx;width: 100%;"></div> -->
  6. <fileMain ref="fileMainRef" @getFiles="getFiles" @close="close"></fileMain>
  7. </view>
  8. </template>
  9. <script>
  10. import Vue from "vue";
  11. import fileMain from '@/pages/doc/docList.vue';
  12. export default {
  13. components: {
  14. fileMain
  15. },
  16. data() {
  17. return {
  18. isShow: false,
  19. title: '申请',
  20. fileIds: []
  21. }
  22. },
  23. methods: {
  24. getFiles(val = []) {
  25. console.log(val, '选择的文件ID')
  26. // 通过事件传递选中的文件ID
  27. uni.$emit('selectFilesResult', {
  28. files: val
  29. })
  30. },
  31. close() {
  32. uni.navigateBack()
  33. }
  34. },
  35. mounted() {
  36. },
  37. async onLoad(option = {}) {
  38. console.log(option, 'filesChoose onLoad')
  39. if (option.files) {
  40. try {
  41. this.fileIds = JSON.parse(decodeURIComponent(option.files)) || []
  42. } catch (e) {
  43. this.fileIds = []
  44. }
  45. }
  46. console.log(this.fileIds, 'fileIds')
  47. this.$nextTick(() => {
  48. if (this.$refs.fileMainRef) {
  49. this.$refs.fileMainRef.open(this.fileIds, option.isEdit)
  50. }
  51. })
  52. },
  53. }
  54. </script>
  55. <style>
  56. </style>