|
49 | 49 | v-if="!data[field.name]" |
50 | 50 | :fileTypes="['image/*']" |
51 | 51 | :validateFile="validateFile" |
52 | | - @success="(file) => (data[field.name] = file)" |
| 52 | + @success="(file) => (data[field.name] = file.file_url)" |
53 | 53 | > |
54 | 54 | <template |
55 | 55 | v-slot="{ file, progress, uploading, openFileSelector }" |
|
70 | 70 | :class="field.size == 'lg' ? 'px-5 py-5' : 'px-20 py-8'" |
71 | 71 | > |
72 | 72 | <img |
73 | | - :src="data[field.name]?.file_url || data[field.name]" |
| 73 | + :src="data[field.name]" |
74 | 74 | class="rounded" |
75 | 75 | :class="field.size == 'lg' ? 'w-36' : 'size-6'" |
76 | 76 | /> |
77 | 77 | </div> |
78 | 78 | <div class="flex flex-col flex-wrap"> |
79 | 79 | <span class="break-all text-ink-gray-9"> |
80 | | - {{ |
81 | | - data[field.name]?.file_name || |
82 | | - data[field.name].split('/').pop() |
83 | | - }} |
84 | | - </span> |
85 | | - <span |
86 | | - v-if="data[field.name]?.file_size" |
87 | | - class="text-sm text-ink-gray-5 mt-1" |
88 | | - > |
89 | | - {{ getFileSize(data[field.name]?.file_size) }} |
| 80 | + {{ data[field.name].split('/').pop() }} |
90 | 81 | </span> |
91 | 82 | </div> |
92 | 83 | <X |
|
105 | 96 | /> |
106 | 97 | <!-- <div v-else> |
107 | 98 | {{ data[field.name] }} |
108 | | - |
| 99 | +
|
109 | 100 | </div> --> |
110 | 101 | <FormControl |
111 | 102 | v-else |
|
127 | 118 | </template> |
128 | 119 | <script setup> |
129 | 120 | import { FormControl, FileUploader, Button, Switch } from 'frappe-ui' |
130 | | -import { computed, onMounted, watch } from 'vue' |
131 | | -import { getFileSize, validateFile } from '@/utils' |
| 121 | +import { onMounted, watch } from 'vue' |
| 122 | +import { validateFile } from '@/utils' |
132 | 123 | import { X } from 'lucide-vue-next' |
133 | 124 | import Link from '@/components/Controls/Link.vue' |
134 | 125 | import CodeEditor from '@/components/Controls/CodeEditor.vue' |
|
0 commit comments