This commit is contained in:
@@ -81,6 +81,15 @@ export default {
|
|||||||
label: { type: String, default: "" }
|
label: { type: String, default: "" }
|
||||||
},
|
},
|
||||||
watch: {
|
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) {
|
value(val) {
|
||||||
this.fetchValueIfNotPresent();
|
this.fetchValueIfNotPresent();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,7 +34,25 @@
|
|||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row>
|
<v-row>
|
||||||
aytype selector ayid selector
|
<v-col cols="12">
|
||||||
|
<v-select
|
||||||
|
v-model="moveType"
|
||||||
|
:items="selectLists.objectTypes"
|
||||||
|
item-text="name"
|
||||||
|
item-value="id"
|
||||||
|
:label="$ay.t('AyaType')"
|
||||||
|
></v-select>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" v-if="moveType != 0">
|
||||||
|
<gz-pick-list
|
||||||
|
:ayaType="moveType"
|
||||||
|
:showEditIcon="false"
|
||||||
|
:includeInactive="true"
|
||||||
|
v-model="moveId"
|
||||||
|
label="Id"
|
||||||
|
></gz-pick-list>
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@@ -59,7 +77,8 @@ export default {
|
|||||||
async created() {
|
async created() {
|
||||||
this.rights = window.$gz.role.getRights(window.$gz.type.FileAttachment);
|
this.rights = window.$gz.role.getRights(window.$gz.type.FileAttachment);
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
//await fetchTranslatedText(this);
|
await fetchTranslatedText(this);
|
||||||
|
await populateSelectionLists(this);
|
||||||
generateMenu(this);
|
generateMenu(this);
|
||||||
this.handleSelected([]); //start out read only no selection state for bulk ops options
|
this.handleSelected([]); //start out read only no selection state for bulk ops options
|
||||||
},
|
},
|
||||||
@@ -70,13 +89,18 @@ export default {
|
|||||||
return {
|
return {
|
||||||
jobActive: false,
|
jobActive: false,
|
||||||
reload: false,
|
reload: false,
|
||||||
moveDialog: false,
|
moveDialog: true,
|
||||||
|
moveType: null,
|
||||||
|
moveId: null,
|
||||||
selectedItems: [],
|
selectedItems: [],
|
||||||
currentListViewId: 1,
|
currentListViewId: 1,
|
||||||
dataListKey: "AttachmentDataList",
|
dataListKey: "AttachmentDataList",
|
||||||
dataListFilter: "",
|
dataListFilter: "",
|
||||||
dataListSort: "",
|
dataListSort: "",
|
||||||
rights: window.$gz.role.defaultRightsObject(),
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
|
selectLists: {
|
||||||
|
objectTypes: []
|
||||||
|
},
|
||||||
formState: {
|
formState: {
|
||||||
ready: true,
|
ready: true,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@@ -124,18 +148,14 @@ export default {
|
|||||||
let vm = this;
|
let vm = this;
|
||||||
try {
|
try {
|
||||||
//called from move dialog, already selected
|
//called from move dialog, already selected
|
||||||
vm.moveDialog=false;
|
vm.moveDialog = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let dialogResult = await window.$gz.dialog.confirmDelete();
|
|
||||||
if (dialogResult != true) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//TODO: Gather the ID and type here
|
|
||||||
|
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
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) {
|
if (res.error) {
|
||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
@@ -330,4 +350,17 @@ async function fetchTranslatedText(vm) {
|
|||||||
"MoveSelected"
|
"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);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user