|
@@ -13,25 +13,22 @@
|
|
|
<span class="mx-2 text-secondary">|</span>
|
|
|
<div moe>
|
|
|
<a start show class="">Add</a>
|
|
|
- <form url="/api/handoutClient/create" style="width: 500px;">
|
|
|
+ <form url="/api/handoutClient/create" id="handoutForm" style="width: 500px;">
|
|
|
<input type="hidden" name="clientUid" value="{{ $patient->uid }}">
|
|
|
@if(@$note)
|
|
|
<input type="hidden" name="noteUid" value="{{ $note->uid }}">
|
|
|
@endif
|
|
|
- <div id="handoutSelectComponent" class="mb-2" v-cloak>
|
|
|
+ <div id="handoutSelectComponent" v-cloak class="mb-2">
|
|
|
<input type="hidden" name="handoutUid" :value="selectedHandoutUid" />
|
|
|
- <input type="search" class="form-control" placeholder="Search Handout" @keyup="filterHandouts" />
|
|
|
+ <input type="search" v-model="search" class="form-control" placeholder="Search Handout" @keyup="filterHandouts" />
|
|
|
<div class="mt-3" style="max-height: 430px;overflow-y: auto;overflow-x:hidden;">
|
|
|
- <div class="row">
|
|
|
+ <div class="row" style="max-height:300px;">
|
|
|
<div v-for="handout in handoutsList" class="col-md-4 mb-2 handout" :class="selectedHandoutUid == handout.uid ? 'selected':''" @click="selectedHandoutUid = handout.uid">
|
|
|
- <div class="d-flex flex-column h-100 border rounded p-2 handout-detail">
|
|
|
+ <a class="d-flex flex-column h-100 border rounded p-2 handout-detail c-pointer pdf-viewer-trigger" native target="_blank" :href="'/api/handout/download/'+handout.uid" title="View">
|
|
|
<i v-if="selectedHandoutUid == handout.uid" class="fas fa-check-circle"></i>
|
|
|
<img :src="'/api/handout/download-thumbnail/'+handout.uid" :alt="handout.display_name" onerror="if (this.src != '/img/pdf.png') this.src = '/img/pdf.png';">
|
|
|
- <h6 class="mt-2 mb-0 text-center">@{{ handout.display_name }}</h6>
|
|
|
-
|
|
|
- <a class="c-pointer preview pdf-viewer-trigger" native target="_blank" :href="'/api/handout/download/'+handout.uid" title="View">Preview PDF</a>
|
|
|
-
|
|
|
- </div>
|
|
|
+ <h6 class="mt-auto pt-1 mb-0 text-center">@{{ handout.display_name }}</h6>
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -39,7 +36,7 @@
|
|
|
</div>
|
|
|
<div class="d-flex align-items-center">
|
|
|
<button class="btn btn-sm btn-primary mr-2" submit>Save</button>
|
|
|
- <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
|
|
|
+ <button class="btn btn-sm btn-default mr-2 border" on-handout-close cancel>Cancel</button>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
@@ -103,14 +100,14 @@
|
|
|
handoutsList: [],
|
|
|
selectedHandoutUid: null,
|
|
|
search: null,
|
|
|
- preview: null,
|
|
|
+ preview: null
|
|
|
},
|
|
|
methods: {
|
|
|
togglePreview: function(handoutUid) {
|
|
|
this.preview = handoutUid;
|
|
|
if (!handoutUid) {
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
filterHandouts: function(evt) {
|
|
|
var self = this;
|
|
@@ -136,12 +133,23 @@
|
|
|
self.handoutsList = data;
|
|
|
|
|
|
},
|
|
|
+ onClose: function() {
|
|
|
+ var self = this;
|
|
|
+ $('[on-handout-close]').click(function(){
|
|
|
+ self.selectedHandoutUid = null;
|
|
|
+ self.search = null;
|
|
|
+ self.handoutsList = self.handouts;
|
|
|
+ $('[stag-popup-key="pdf-viewer"]').removeClass('show');
|
|
|
+ });
|
|
|
+ },
|
|
|
init: function() {
|
|
|
this.handoutsList = this.handouts;
|
|
|
+ this.onClose();
|
|
|
}
|
|
|
},
|
|
|
mounted: function() {
|
|
|
this.init();
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
-</script>
|
|
|
+</script>
|