This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LOGGING = { | |
| "version": 1, | |
| "disable_existing_loggers": False, | |
| "root": {"level": "DEBUG", "handlers": ["console"]}, | |
| "formatters": { | |
| "verbose": { | |
| "format": "%(levelname)s %(asctime)s %(module)s " | |
| "%(process)d %(thread)d %(message)s" | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style lang="sass" scoped> | |
| .upload | |
| &__documents | |
| border: 1px dashed #eee | |
| border-radius: 0.2em | |
| margin: 0.5em | |
| padding: 1em 0 0.5em 0.5em | |
| transition: all 0.1s ease-in | |
| &:hover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import FileIcon from '@/components/files/FileIcon' | |
| import { DraggingMixins, UploadMixin } from '@/mixins/upload' | |
| import { ACCEPT_INPUT } from '@/upload-config' | |
| export default { | |
| name: 'Documents', | |
| props: { | |
| documents: { | |
| type: Array, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const DraggingMixins = { | |
| dragenter() { | |
| this.dragging = true | |
| }, | |
| drop() { | |
| this.dragging = false | |
| }, | |
| dragleave() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { MAX_FILE_SIZE } from '@/upload-config' | |
| import { uploadDocument } from '@/api/documents' | |
| import { LoadingBar } from 'iview' | |
| const STATUS_INITIAL = 0 | |
| const STATUS_SAVING = 1 | |
| const STATUS_SUCCESS = 2 | |
| const STATUS_FAILED = 3 | |
| const prepareFiles = (fieldName, files) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="upload"> | |
| <h2 class="upload__title"> | |
| Documents | |
| <span v-if="documents"> | |
| ({{documents.length}}) | |
| </span> | |
| </h2> | |
| <form enctype="multipart/form-data" novalidate class="upload__documents" id="document_upload"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function upload(uri, data) { | |
| return fetch(uri, { | |
| headers: getHeaders(true), | |
| cors: true, | |
| method: 'POST', | |
| body: data | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const ACCEPT_INPUT = [ | |
| 'application/csv', | |
| 'text/csv', | |
| 'image/*', | |
| 'application/pdf', | |
| 'text/plain', | |
| 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', | |
| 'application/vnd.ms-excel', | |
| 'application/pdf', | |
| 'application/msword', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div class="awesome"> | |
| <img class="awesome__logo" src="@/assets/logo.png"> | |
| <h2 class="awesome__heading">Awesome</h2> | |
| </div> | |
| </template> | |
| <script> | |
| export default { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <Awesome class="awesome--dark awesome--raised"></Awesome> | |
| </template> |