diff --git a/package.json b/package.json index 417606900..c544d500e 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "bootstrap-vue-font-awesome-picker": "^0.1.3", "chart.js": "^2.7.2", "dateformat": "^3.0.3", + "downloadjs": "^1.4.7", "faker": "^5.1.0", "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", diff --git a/resources/assets/js/admin/settings/customCaseList/Tables.vue b/resources/assets/js/admin/settings/customCaseList/Tables.vue index d5787e36e..84c30e264 100644 --- a/resources/assets/js/admin/settings/customCaseList/Tables.vue +++ b/resources/assets/js/admin/settings/customCaseList/Tables.vue @@ -28,7 +28,9 @@ import ButtonFleft from "../../../components/home/ButtonFleft.vue"; import Ellipsis from "../../../components/utils/ellipsis.vue"; import utils from "../../../utils/utils"; import OwnerCell from "../../../components/vuetable/OwnerCell"; -import ModalDeleteCaseList from "./../../Modals/ModalDeleteCaseList.vue" +import ModalDeleteCaseList from "./../../Modals/ModalDeleteCaseList.vue"; +import download from "downloadjs"; + export default { name: "Tables", props: ["module"], @@ -188,8 +190,14 @@ export default { editCustomCaseList(data) { }, + /** + * Export the Custom Case List in a json + * @param {object} data + */ downloadCaseList(data) { - + var fileName = data.name, + typeMime = "text/plain"; + download(JSON.stringify(data), fileName + ".json", typeMime); }, /** * Show options in the ellipsis