This commit is contained in:
@@ -6,21 +6,17 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
|
|||||||
todo: Administration - Attached files manager
|
todo: Administration - Attached files manager
|
||||||
replicate v7
|
replicate v7
|
||||||
|
|
||||||
|
BULK OPS
|
||||||
DELETE bulk OP
|
DELETE bulk OP
|
||||||
delete selected file Attachments db record and physical file if present or just the fileAttachment if missing the physical file
|
delete selected file Attachments db record and physical file if present or just the fileAttachment if missing the physical file
|
||||||
This is how you fix broken missing file links, because it's bulk it's not too onerous
|
This is how you fix broken missing file links, because it's bulk it's not too onerous
|
||||||
|
MOVE bulk op
|
||||||
|
Select one ore more files then select MOVE
|
||||||
|
UI pops up to select object type and manually type in the id
|
||||||
|
it then checks to see that that object exists before moving them to it
|
||||||
|
|
||||||
|
Add physical file path to grid data
|
||||||
Add physical file path to grid data
|
|
||||||
REplace notes with physical file path for grid but keep notes in there as an option`
|
REplace notes with physical file path for grid but keep notes in there as an option`
|
||||||
|
|
||||||
MOVE bulk op
|
|
||||||
Select one ore more files then select MOVE
|
|
||||||
UI pops up to select object type and manually type in the id
|
|
||||||
it then checks to see that that object exists before moving them to it
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TESTING:
|
TESTING:
|
||||||
Delete a file that's been attached in windows
|
Delete a file that's been attached in windows
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
v-on:selection-change="handleSelected"
|
v-on:selection-change="handleSelected"
|
||||||
>
|
>
|
||||||
</gz-data-table>
|
</gz-data-table>
|
||||||
{{ selectedItems }}
|
|
||||||
<template v-if="jobActive">
|
<template v-if="jobActive">
|
||||||
<v-progress-circular
|
<v-progress-circular
|
||||||
indeterminate
|
indeterminate
|
||||||
@@ -48,11 +48,44 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelected(selected) {
|
canBulkOp() {
|
||||||
console.log(selected);
|
return (
|
||||||
this.selectedItems = selected;
|
this.rights.change &&
|
||||||
|
this.selectedItems &&
|
||||||
|
this.selectedItems.length > 0
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
handleSelected(selected) {
|
||||||
|
this.selectedItems = selected;
|
||||||
|
|
||||||
|
if (this.canBulkOp()) {
|
||||||
|
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":duplicate");
|
||||||
|
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":new");
|
||||||
|
} else {
|
||||||
|
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":duplicate");
|
||||||
|
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":new");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async deleteSelected() {
|
||||||
|
let vm = this;
|
||||||
|
try {
|
||||||
|
let dialogResult = await window.$gz.dialog.confirmDelete();
|
||||||
|
if (dialogResult != true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let url = API_BASE_URL + vm.$route.params.recordid;
|
||||||
|
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
let res = await window.$gz.api.remove(url);
|
||||||
|
if (res.error) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
window.$gz.errorHandler.handleFormError(ex, vm);
|
||||||
|
}
|
||||||
|
},
|
||||||
async startMaintenanceJob() {
|
async startMaintenanceJob() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
|
|
||||||
@@ -131,6 +164,12 @@ function clickHandler(menuItem) {
|
|||||||
case "START_MAINTENANCE_JOB":
|
case "START_MAINTENANCE_JOB":
|
||||||
m.vm.startMaintenanceJob();
|
m.vm.startMaintenanceJob();
|
||||||
break;
|
break;
|
||||||
|
case "MOVE_SELECTED":
|
||||||
|
m.vm.moveSelected();
|
||||||
|
break;
|
||||||
|
case "DELETE_SELECTED":
|
||||||
|
m.vm.deleteSelected();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -176,6 +215,22 @@ function generateMenu(vm) {
|
|||||||
key: FORM_KEY + ":START_MAINTENANCE_JOB",
|
key: FORM_KEY + ":START_MAINTENANCE_JOB",
|
||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
|
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "MoveSelected",
|
||||||
|
icon: "fa-people-carry",
|
||||||
|
surface: false,
|
||||||
|
key: FORM_KEY + ":MOVE_SELECTED",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "DeleteSelected",
|
||||||
|
icon: "fa-trash-alt",
|
||||||
|
surface: false,
|
||||||
|
key: FORM_KEY + ":DELETE_SELECTED",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
@@ -188,7 +243,9 @@ function generateMenu(vm) {
|
|||||||
async function fetchTranslatedText(vm) {
|
async function fetchTranslatedText(vm) {
|
||||||
await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
"StartAttachmentMaintenanceJob",
|
"StartAttachmentMaintenanceJob",
|
||||||
"JobExclusiveWarning"
|
"JobExclusiveWarning",
|
||||||
|
"DeleteSelected",
|
||||||
|
"MoveSelected"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user