From 3e91727b76786f284bff5ae3d28b5c32472b8921 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 30 Jun 2020 20:48:26 +0000 Subject: [PATCH] --- ayanova/src/components/pick-list.vue | 9 ++++ ayanova/src/views/adm-attachments.vue | 59 +++++++++++++++++++++------ 2 files changed, 55 insertions(+), 13 deletions(-) diff --git a/ayanova/src/components/pick-list.vue b/ayanova/src/components/pick-list.vue index 77640e9d..68664fdd 100644 --- a/ayanova/src/components/pick-list.vue +++ b/ayanova/src/components/pick-list.vue @@ -81,6 +81,15 @@ export default { label: { type: String, default: "" } }, watch: { + ayaType(val,oldVal){ + if(val!=oldVal && oldVal!=null){ + //change of type so clear out the list + this.searchResults=[]; + this.searchEntry=null; + this.lastSelection=null; + this.initialized=false; + } + }, value(val) { this.fetchValueIfNotPresent(); }, diff --git a/ayanova/src/views/adm-attachments.vue b/ayanova/src/views/adm-attachments.vue index 2819e4c7..c8130130 100644 --- a/ayanova/src/views/adm-attachments.vue +++ b/ayanova/src/views/adm-attachments.vue @@ -34,7 +34,25 @@ - aytype selector ayid selector + + + + + + + @@ -59,7 +77,8 @@ export default { async created() { this.rights = window.$gz.role.getRights(window.$gz.type.FileAttachment); window.$gz.eventBus.$on("menu-click", clickHandler); - //await fetchTranslatedText(this); + await fetchTranslatedText(this); + await populateSelectionLists(this); generateMenu(this); this.handleSelected([]); //start out read only no selection state for bulk ops options }, @@ -70,13 +89,18 @@ export default { return { jobActive: false, reload: false, - moveDialog: false, + moveDialog: true, + moveType: null, + moveId: null, selectedItems: [], currentListViewId: 1, dataListKey: "AttachmentDataList", dataListFilter: "", dataListSort: "", rights: window.$gz.role.defaultRightsObject(), + selectLists: { + objectTypes: [] + }, formState: { ready: true, dirty: false, @@ -124,18 +148,14 @@ export default { let vm = this; try { //called from move dialog, already selected - vm.moveDialog=false; - - - - let dialogResult = await window.$gz.dialog.confirmDelete(); - if (dialogResult != true) { - return; - } - //TODO: Gather the ID and type here + vm.moveDialog = false; window.$gz.form.deleteAllErrorBoxErrors(vm); - let res = await window.$gz.api.remove(url); + let res = await window.$gz.api.upsert("attachment/bulk-move", { + idList: this.selectedItems, + ayaType: this.moveType, + toId: this.moveId + }); if (res.error) { vm.formState.serverError = res.error; window.$gz.form.setErrorBoxErrors(vm); @@ -330,4 +350,17 @@ async function fetchTranslatedText(vm) { "MoveSelected" ]); } + +////////////////////// +// +// +async function populateSelectionLists(vm) { + let res = await window.$gz.api.get("enum-list/list/Core"); + if (res.error) { + window.$gz.errorHandler.handleFormError(res.error, vm); + } else { + vm.selectLists.objectTypes = res.data; + window.$gz.form.addNoSelectionItem(vm.selectLists.objectTypes); + } +}