This commit is contained in:
@@ -6,9 +6,6 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
todo: translation get value for key should not return ?? if it's empty, instead just return empty
|
|
||||||
This will avoid fouc on slow retrieval
|
|
||||||
|
|
||||||
todo: help links for User, Users, Translations, Translation
|
todo: help links for User, Users, Translations, Translation
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -359,6 +359,10 @@ export default {
|
|||||||
singleSelect: {
|
singleSelect: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
reload: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -390,6 +394,11 @@ export default {
|
|||||||
if (newValue.length != oldValue.length) {
|
if (newValue.length != oldValue.length) {
|
||||||
this.handleSelectChange();
|
this.handleSelectChange();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
reload: function(newValue, oldValue) {
|
||||||
|
if (newValue != oldValue) {
|
||||||
|
this.getDataFromApi();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
:dataListSort="dataListSort"
|
:dataListSort="dataListSort"
|
||||||
:showSelect="false"
|
:showSelect="false"
|
||||||
:singleSelect="false"
|
:singleSelect="false"
|
||||||
|
:reload="reload"
|
||||||
v-on:update:selected="handleSelected"
|
v-on:update:selected="handleSelected"
|
||||||
>
|
>
|
||||||
</gz-data-table>
|
</gz-data-table>
|
||||||
@@ -18,9 +19,14 @@
|
|||||||
multiple
|
multiple
|
||||||
chips
|
chips
|
||||||
></v-file-input>
|
></v-file-input>
|
||||||
<v-btn v-if="uploadFiles.length > 0" color="primary" text @click="upload">{{
|
<v-btn
|
||||||
$ay.t("Upload")
|
v-if="uploadFiles.length > 0"
|
||||||
}}</v-btn>
|
:loading="uploading"
|
||||||
|
color="primary"
|
||||||
|
text
|
||||||
|
@click="upload"
|
||||||
|
>{{ $ay.t("Upload") }}</v-btn
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -43,7 +49,9 @@ export default {
|
|||||||
dataListKey: "TranslationDataList",
|
dataListKey: "TranslationDataList",
|
||||||
dataListFilter: "",
|
dataListFilter: "",
|
||||||
dataListSort: "",
|
dataListSort: "",
|
||||||
rights: window.$gz.role.defaultRightsObject()
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
|
reload: false,
|
||||||
|
uploading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -62,15 +70,19 @@ export default {
|
|||||||
fileData: JSON.stringify(fileData)
|
fileData: JSON.stringify(fileData)
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
|
vm.uploading = true;
|
||||||
let res = await window.$gz.api.upload("translation/upload", at);
|
let res = await window.$gz.api.upload("translation/upload", at);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
window.$gz.errorHandler.handleFormError(res.error);
|
window.$gz.errorHandler.handleFormError(res.error);
|
||||||
} else {
|
} else {
|
||||||
vm.uploadFiles = [];
|
vm.uploadFiles = [];
|
||||||
//TODO: trigger grid refresh
|
|
||||||
|
this.reload = !this.reload;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error);
|
window.$gz.errorHandler.handleFormError(error);
|
||||||
|
} finally {
|
||||||
|
vm.uploading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSelected(selectedItems) {
|
handleSelected(selectedItems) {
|
||||||
@@ -89,12 +101,12 @@ function clickHandler(menuItem) {
|
|||||||
let m = window.$gz.menu.parseMenuItem(menuItem);
|
let m = window.$gz.menu.parseMenuItem(menuItem);
|
||||||
if (m.owner == FORM_KEY && !m.disabled) {
|
if (m.owner == FORM_KEY && !m.disabled) {
|
||||||
switch (m.key) {
|
switch (m.key) {
|
||||||
case "new":
|
// case "new":
|
||||||
m.vm.$router.push({
|
// m.vm.$router.push({
|
||||||
name: "adm-translation",
|
// name: "adm-translation",
|
||||||
params: { recordid: 0 }
|
// params: { recordid: 0 }
|
||||||
});
|
// });
|
||||||
break;
|
// break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -119,31 +131,23 @@ function generateMenu(vm) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (vm.rights.change) {
|
|
||||||
menuOptions.menuItems.push({
|
|
||||||
title: "New",
|
|
||||||
icon: "fa-plus",
|
|
||||||
surface: true,
|
|
||||||
key: FORM_KEY + ":new",
|
|
||||||
vm: vm
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//STUB REPORTS
|
|
||||||
//Report not Print, print is a further option
|
|
||||||
menuOptions.menuItems.push({
|
|
||||||
title: "Report",
|
|
||||||
icon: "fa-file-alt",
|
|
||||||
key: FORM_KEY + ":report",
|
|
||||||
vm: vm
|
|
||||||
});
|
|
||||||
|
|
||||||
menuOptions.menuItems.push({
|
// //STUB REPORTS
|
||||||
title: "stub: Last report used",
|
// //Report not Print, print is a further option
|
||||||
icon: "fa-file-alt",
|
// menuOptions.menuItems.push({
|
||||||
key: FORM_KEY + ":report:STUBlastusedreportid",
|
// title: "Report",
|
||||||
vm: vm
|
// icon: "fa-file-alt",
|
||||||
});
|
// key: FORM_KEY + ":report",
|
||||||
|
// vm: vm
|
||||||
|
// });
|
||||||
|
|
||||||
|
// menuOptions.menuItems.push({
|
||||||
|
// title: "stub: Last report used",
|
||||||
|
// icon: "fa-file-alt",
|
||||||
|
// key: FORM_KEY + ":report:STUBlastusedreportid",
|
||||||
|
// vm: vm
|
||||||
|
// });
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user