import { mapActions } from "vuex"; import $_can from "@Global/policy/can"; import $_name from "@Global/utils/category-name/name"; import $_color from "@Global/utils/module-color"; const global = { methods: { $_getPath(subPath = "", is_complete_url = false) { if (is_complete_url && process.env.MIX_PUSHER_APP_HAS_CDN == 'true') { return subPath; } else { subPath = subPath.startsWith("/") ? subPath.substr(1) : subPath; const path = process.env.MIX_PUSHER_APP_PUBLIC_PATH ? process.env.MIX_PUSHER_APP_PUBLIC_PATH : "/"; return path + subPath; } }, //Modal ...mapActions("modal", [ "$_dialog", "$_helper", "openModal", "$_closeModal" ]), $_openModal(name, data) { if (typeof name == 'object') { this.openModal(name) } else { this.openModal({...data, ...{name}}) } }, $_can, $_name, $_color, } }; export { global };