This commit is contained in:
2020-04-24 21:39:46 +00:00
parent 4dc4e4e982
commit 8e35815456

View File

@@ -6,138 +6,149 @@
@drop.prevent="onDrop" @drop.prevent="onDrop"
@dragover.prevent @dragover.prevent
> >
<span class="v-label v-label--active theme--light"> <div>
<v-btn depressed tile @click="revealedClicked">
{{ $ay.t("Attachments")
}}<v-icon v-text="reveal ? 'fa-eye-slash' : 'fa-eye'" right></v-icon
></v-btn>
</div>
<template v-if="reveal">
<!-- <span class="v-label v-label--active theme--light">
{{ $ay.t("Attachments") }} {{ $ay.t("Attachments") }}
</span> </span> -->
<template v-if="readonly"> <template v-if="readonly">
<!-- Note: this is just a copy of the inner part of read/write version below <!-- Note: this is just a copy of the inner part of read/write version below
with the action taken out --> with the action taken out -->
<div class="mt-4" :style="cardTextStyle()"> <div class="mt-4" :style="cardTextStyle()">
<v-list color="grey lighten-5" three-line> <v-list color="grey lighten-5" three-line>
<v-list-item <v-list-item
v-for="item in displayList" v-for="item in displayList"
:key="item.id" :key="item.id"
:href="item.url" :href="item.url"
target="_blank" target="_blank"
> >
<v-list-item-avatar> <v-list-item-avatar>
<v-icon v-text="item.icon"></v-icon> <v-icon v-text="item.icon"></v-icon>
</v-list-item-avatar> </v-list-item-avatar>
<v-list-item-content> <v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title> <v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-subtitle v-text="item.date"></v-list-item-subtitle> <v-list-item-subtitle v-text="item.date"></v-list-item-subtitle>
<v-list-item-subtitle v-text="item.notes"></v-list-item-subtitle> <v-list-item-subtitle
</v-list-item-content> v-text="item.notes"
</v-list-item> ></v-list-item-subtitle>
</v-list> </v-list-item-content>
</div> </v-list-item>
</template> </v-list>
<template v-else> </div>
<v-tabs v-model="tab" color="primary"> </template>
<v-tabs-slider></v-tabs-slider> <template v-else>
<v-tab key="list"><v-icon>fa-folder</v-icon></v-tab> <v-tabs v-model="tab" color="primary">
<v-tab key="attach"><v-icon>fa-paperclip</v-icon></v-tab> <v-tabs-slider></v-tabs-slider>
<v-tabs-items v-model="tab"> <v-tab key="list"><v-icon>fa-folder</v-icon></v-tab>
<v-tab-item key="list"> <v-tab key="attach"><v-icon>fa-paperclip</v-icon></v-tab>
<div class="mt-4" :style="cardTextStyle()"> <v-tabs-items v-model="tab">
<v-list color="grey lighten-5" three-line> <v-tab-item key="list">
<v-list-item <div class="mt-4" :style="cardTextStyle()">
v-for="item in displayList" <v-list color="grey lighten-5" three-line>
:key="item.id" <v-list-item
:href="item.url" v-for="item in displayList"
target="_blank" :key="item.id"
> :href="item.url"
<v-list-item-avatar> target="_blank"
<v-icon v-text="item.icon"></v-icon> >
</v-list-item-avatar> <v-list-item-avatar>
<v-icon v-text="item.icon"></v-icon>
</v-list-item-avatar>
<v-list-item-content> <v-list-item-content>
<v-list-item-title v-text="item.name"></v-list-item-title> <v-list-item-title v-text="item.name"></v-list-item-title>
<v-list-item-subtitle <v-list-item-subtitle
v-text="item.date" v-text="item.date"
></v-list-item-subtitle> ></v-list-item-subtitle>
<v-list-item-subtitle <v-list-item-subtitle
v-text="item.notes" v-text="item.notes"
></v-list-item-subtitle> ></v-list-item-subtitle>
</v-list-item-content> </v-list-item-content>
<v-list-item-action> <v-list-item-action>
<v-btn large @click="openEditMenu(item, $event)" icon> <v-btn large @click="openEditMenu(item, $event)" icon>
<v-icon>fa-edit</v-icon> <v-icon>fa-edit</v-icon>
</v-btn> </v-btn>
</v-list-item-action> </v-list-item-action>
</v-list-item> </v-list-item>
</v-list> </v-list>
</div> </div>
</v-tab-item> </v-tab-item>
<v-tab-item key="attach"> <v-tab-item key="attach">
<div class="mt-8"> <div class="mt-8">
<v-file-input <v-file-input
v-model="uploadFiles" v-model="uploadFiles"
:label="$ay.t('AttachFile')" :label="$ay.t('AttachFile')"
prepend-icon="fa-paperclip" prepend-icon="fa-paperclip"
multiple multiple
chips chips
></v-file-input> ></v-file-input>
<v-text-field
v-model="notes"
:label="$ay.t('AttachmentNotes')"
></v-text-field>
<v-btn color="primary" text @click="upload">{{
$ay.t("Upload")
}}</v-btn>
</div>
</v-tab-item>
</v-tabs-items>
</v-tabs>
<v-menu
min-width="360"
v-model="editMenu"
:close-on-content-click="false"
offset-y
:position-x="menuX"
:position-y="menuY"
absolute
>
<v-card>
<v-card-title>{{ $ay.t("FileAttachment") }}</v-card-title>
<div class="ma-6">
<v-text-field <v-text-field
v-model="notes" v-model="editName"
:label="$ay.t('AttachmentFileName')"
></v-text-field>
<v-text-field
v-model="editNotes"
:label="$ay.t('AttachmentNotes')" :label="$ay.t('AttachmentNotes')"
></v-text-field> ></v-text-field>
<v-btn color="primary" text @click="upload">{{
$ay.t("Upload")
}}</v-btn>
</div> </div>
</v-tab-item> <v-card-actions>
</v-tabs-items> <v-btn @click="remove()" text>
</v-tabs> {{ $ay.t("Delete") }}
<v-menu </v-btn>
min-width="360" <v-spacer></v-spacer>
v-model="editMenu" <v-btn text @click="editMenu = false">{{
:close-on-content-click="false" $ay.t("Cancel")
offset-y }}</v-btn>
:position-x="menuX" <v-btn color="primary" text @click="saveEdit">{{
:position-y="menuY" $ay.t("OK")
absolute }}</v-btn>
> </v-card-actions>
<v-card> </v-card>
<v-card-title>{{ $ay.t("FileAttachment") }}</v-card-title> </v-menu>
<div class="ma-6"> </template>
<v-text-field
v-model="editName"
:label="$ay.t('AttachmentFileName')"
></v-text-field>
<v-text-field
v-model="editNotes"
:label="$ay.t('AttachmentNotes')"
></v-text-field>
</div>
<v-card-actions>
<v-btn @click="remove()" text>
{{ $ay.t("Delete") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn text @click="editMenu = false">{{ $ay.t("Cancel") }}</v-btn>
<v-btn color="primary" text @click="saveEdit">{{
$ay.t("OK")
}}</v-btn>
</v-card-actions>
</v-card>
</v-menu>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
created() {
this.getList();
},
data() { data() {
return { return {
reveal: false,
height: 300, height: 300,
displayList: [], displayList: [],
notes: null, notes: null,
@@ -158,6 +169,12 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
revealedClicked() {
this.reveal = !this.reveal;
if (this.reveal) {
this.getList();
}
},
onResize() { onResize() {
this.height = window.innerHeight * 0.8; this.height = window.innerHeight * 0.8;
}, },