merge - change - product - icon

pull/1/head
alireza hassani 5 years ago
commit 0913aada3b

@ -6,7 +6,7 @@ return [
* The disk on which to store added files and derived images by default. Choose * The disk on which to store added files and derived images by default. Choose
* one or more of the disks you've configured in config/filesystems.php. * one or more of the disks you've configured in config/filesystems.php.
*/ */
'disk_name' => env('APP_DEBUG', true) ? 'media_dev' : 'media', 'disk_name' => env('MEDIA_DISK', 'media'),
/* /*
* The maximum file size of an item in bytes. * The maximum file size of an item in bytes.
@ -74,7 +74,7 @@ return [
* When urls to files get generated, this class will be called. Leave empty * When urls to files get generated, this class will be called. Leave empty
* if your files are stored locally above the site root or on s3. * if your files are stored locally above the site root or on s3.
*/ */
'url_generator' => env('APP_DEBUG', true) ? null : 'WM\Common\Services\Media\UrlGenerator\FtpUrlGenerator', 'url_generator' => env('MEDIA_DISK', 'media') != 'media' ? null : 'WM\Common\Services\Media\UrlGenerator\FtpUrlGenerator',
/* /*
* Whether to activate versioning when urls to files get generated. * Whether to activate versioning when urls to files get generated.

@ -12,6 +12,6 @@ class DatabaseSeeder extends Seeder
public function run() public function run()
{ {
// $this->call(ModuleSeeder::class); // $this->call(ModuleSeeder::class);
$this->call(ElementTypeSeeder::class); $this->call(HelpSeeder::class);
} }
} }

4348
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -14,6 +14,7 @@
"@ckeditor/ckeditor5-font": "^11.2.1", "@ckeditor/ckeditor5-font": "^11.2.1",
"@ckeditor/ckeditor5-vue": "^1.0.0-beta.2", "@ckeditor/ckeditor5-vue": "^1.0.0-beta.2",
"@fortawesome/fontawesome-free": "^5.5.0", "@fortawesome/fontawesome-free": "^5.5.0",
"@riophae/vue-treeselect": "^0.4.0",
"ajv": "^6.10.0", "ajv": "^6.10.0",
"apexcharts": "^3.8.3", "apexcharts": "^3.8.3",
"apollo-boost": "^0.4.3", "apollo-boost": "^0.4.3",

@ -4,4 +4,4 @@
"/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=e9a742ddfd5ff64b9511", "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=e9a742ddfd5ff64b9511",
"/js/vue/Modules/Store/app.js": "/js/vue/Modules/Store/app.js?id=0076ff8cc3ac14215ddb", "/js/vue/Modules/Store/app.js": "/js/vue/Modules/Store/app.js?id=0076ff8cc3ac14215ddb",
"/js/vue/User/app.js": "/js/vue/User/app.js?id=177d52042c2071ccddeb" "/js/vue/User/app.js": "/js/vue/User/app.js?id=177d52042c2071ccddeb"
} }

@ -7,7 +7,7 @@
</a> </a>
<div class="Name caption"> {{ getAuthUser.name }} </div> <div class="Name caption"> {{ getAuthUser.name }} </div>
<div class="Time"> <div class="Time">
<div class="WM-Font-22 En Bold">{{ timeNow }}</div> <div class="WM-Font-22 En Bold">{{ getCurrentTime }}</div>
<div class="WM-Font-14 Fa FaNum">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div> <div class="WM-Font-14 Fa FaNum">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div>
</div> </div>
<!-- <div class="Notification" dark> <!-- <div class="Notification" dark>
@ -38,21 +38,12 @@
</a> </a>
</v-flex> </v-flex>
</div> </div>
<!-- <v-list-tile avatar>
<v-list-tile-avatar>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title class="Name">{{ getAuthUser.name }}</v-list-tile-title>
<div class="Role">مدیریت</div>
</v-list-tile-content>
</v-list-tile> -->
</v-list> </v-list>
<v-list class="pt-0" dense> <v-list class="pt-0" dense>
<v-divider class="Divider"></v-divider> <v-divider class="Divider"></v-divider>
<a :href="item.href" v-for="(item, key) in Items" :key="key"> <a :href="item.href" v-for="(item, key) in Items" :key="key">
<template v-if="$_hasPermission(item.permission)"> <template v-if="$_hasPermission(item.permission, false, item.module)">
<wm-list-tile :TitleFa="item.titleFa" :TitleEn="item.titleEn"></wm-list-tile> <wm-list-tile :TitleFa="item.titleFa" :TitleEn="item.titleEn"></wm-list-tile>
</template> </template>
</a> </a>
@ -66,6 +57,7 @@ import Tile from "@Global/components/Drawer/Tile";
import Notifications from "@Global/components/Drawer/Notifications"; import Notifications from "@Global/components/Drawer/Notifications";
import Routes from "@Global/utils/common/routes"; import Routes from "@Global/utils/common/routes";
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters } from "vuex";
// import { getTime } from "@Global/utils/date/time";
export default { export default {
data() { data() {
return { return {
@ -81,7 +73,8 @@ export default {
titleEn: " My Users ", titleEn: " My Users ",
titleFa: " کاربران مجموعه ی من ", titleFa: " کاربران مجموعه ی من ",
icon: "question_answer", icon: "question_answer",
permission: "", permission: "indexUser",
module: "core",
href: Routes.user(), href: Routes.user(),
}, },
{ {
@ -94,16 +87,11 @@ export default {
], ],
user: { name: "" }, user: { name: "" },
timeNow: "",
mainHref: Routes.main(), mainHref: Routes.main(),
}; };
}, },
mounted(){ mounted() {
var self = this; let self = this;
self.getTime(new Date())
setInterval(function() {
self.getTime(new Date())
}, 2000);
}, },
components: { components: {
"wm-list-tile": Tile, "wm-list-tile": Tile,
@ -111,20 +99,10 @@ export default {
}, },
computed: { computed: {
...mapGetters("auth", ["getAuthUser"]), ...mapGetters("auth", ["getAuthUser"]),
...mapGetters("common", ["getCurrentTime"]),
}, },
methods: { methods: {
...mapActions("auth", ["logout"]), ...mapActions("auth", ["logout"]),
getTime(date) {
let h = this.addZero(date.getHours());
let m = this.addZero(date.getMinutes());
this.timeNow = h + ":" + m;
},
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
} }
}; };
</script> </script>

@ -8,6 +8,7 @@
import vue2Dropzone from 'vue2-dropzone' import vue2Dropzone from 'vue2-dropzone'
import { TokenService } from '@Global/services/storage.services' import { TokenService } from '@Global/services/storage.services'
import commonState from '@Global/store/modules/common/state'; import commonState from '@Global/store/modules/common/state';
import Routes from '@Global/utils/common/routes';
import { url } from '@Common/mixins/urls'; import { url } from '@Common/mixins/urls';
import axios from 'axios'; import axios from 'axios';
import 'vue2-dropzone/dist/vue2Dropzone.min.css' import 'vue2-dropzone/dist/vue2Dropzone.min.css'
@ -23,7 +24,7 @@ export default {
data() { data() {
return { return {
dropzoneOptions: { dropzoneOptions: {
url: url('storeFile'), url: Routes.api() + url('storeFile'),
thumbnailWidth: 200, thumbnailWidth: 200,
headers: { "Authorization": `Bearer ${TokenService.getToken()}`, "Module": `${commonState.current_module}` }, headers: { "Authorization": `Bearer ${TokenService.getToken()}`, "Module": `${commonState.current_module}` },
addRemoveLinks: true, addRemoveLinks: true,

@ -44,6 +44,7 @@
<script> <script>
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters } from "vuex";
export default { export default {
name: "modal_modal_dialog",
data: () => ({ data: () => ({
defaultMessage: { defaultMessage: {
delete: { delete: {
@ -76,36 +77,30 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters("modal", [ ...mapGetters("modal", ["isModalStack", "getModal", "getDialogType", "getDialogProperties"]),
"getDialogType",
"getDialogProperties",
"isModal"
]),
modal: { modal: {
get() { get() {
return this.isModal("modal/dialog"); return this.isModalStack(this.$options.name);
}, },
set(value) { set(value) {
if (value) { if (!value) {
this.$_openModal("modal/dialog"); this.$_closeModalStack();
} else { }
this.$_closeModal("modal/dialog"); }
} },
}
}
}, },
methods: { methods: {
async confirm() { async confirm() {
if (typeof this.getDialogProperties.success == "function") { if (typeof this.getDialogProperties.success == "function") {
await this.getDialogProperties.success(); await this.getDialogProperties.success();
} }
this.$_closeModal("modal/dialog"); this.$_closeModalStack();
}, },
async cancel() { async cancel() {
if (typeof this.getDialogProperties.close == "function") { if (typeof this.getDialogProperties.close == "function") {
await this.getDialogProperties.close(); await this.getDialogProperties.close();
} }
this.$_closeModal("modal/dialog"); this.$_closeModalStack();
} }
} }
}; };

@ -0,0 +1,71 @@
<template>
<v-dialog v-model="modal" :width="properties.width || '40%'" transition="slide-x-transition">
<v-card class="RTL">
<v-card-title class="red lighten-5" primary-title>
<WM-PartTitle
class="WM-Margin-T-20"
:TitleFa="properties.name || 'عنوان'"
:TitleEn="properties.name_en || 'title'"
:color="properties.color || 'orange'"
></WM-PartTitle>
</v-card-title>
<v-card-text>
<div
class="WM-Align-R WM-Margin-T-10"
>{{ properties.description || 'پیام'}}</div>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
:color="properties.color || 'orange'"
depressed
dark
@click="$_closeModalStack()"
>
<v-icon dark right>fas fa-trash-alt</v-icon>
متوجه شدم!
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
import { mapActions, mapGetters } from "vuex";
import axios from 'axios';
import { url } from '@Common/mixins/urls';
export default {
name: "modal_modal_helper",
data: () => ({
properties: {}
}),
computed: {
...mapGetters("modal", ["isModalStack", "getModal"]),
modal: {
get() {
return this.isModalStack(this.$options.name);
},
set(value) {
if (!value) {
this.$_closeModalStack();
}
}
},
},
methods: {
async getDate() {
if (this.modal) {
let response = await axios.get(url('help', {help: this.getModal(this.$options.name).slug}));
if (response && response.status == 200) {
this.properties = response.data.data;
}
}
}
},
created() {
this.getDate();
},
};
</script>

@ -1,11 +1,8 @@
var CommingSoonArray = [ var CommingSoonArray = [
"document", "document",
"discount", "discount",
"transaction",
"email", "email",
"prescription", "prescription",
"user_sms",
"crm-setting", "crm-setting",
"crm-statistics", "crm-statistics",
]; ];

@ -5,26 +5,33 @@ import permissionList from "@Global/utils/Permissions/list";
import { UserService } from "@Global/services/storage.services"; import { UserService } from "@Global/services/storage.services";
const global = { const global = {
methods: { methods: {
$_getPath(subPath = '') { $_getPath(subPath = "") {
const path = process.env.MIX_PUSHER_APP_PUBLIC_PATH ? process.env.MIX_PUSHER_APP_PUBLIC_PATH : '/'; const path = process.env.MIX_PUSHER_APP_PUBLIC_PATH
? process.env.MIX_PUSHER_APP_PUBLIC_PATH
: "/";
return path + subPath; return path + subPath;
}, },
//Modal //Modal
...mapActions("modal", ["$_openModal", "$_closeModal", "$_openModalCallback", "$_closeModalCallback", "$_dialog", "$_openModalStack", "$_closeModalStack"]), ...mapActions("modal", [
"$_dialog",
"$_helper",
"$_openModalStack",
"$_closeModalStack"
]),
//Permission //Permission
$_hasPermission(permission, owner = false) { $_hasPermission(permission, owner = false, module = null) {
let currentModule = globalStore.state.common.current_module; let currentModule = module ? module : globalStore.state.common.current_module;
let permissions = authStore.state.auth.permissions; let permissions = authStore.state.auth.permissions;
let multiPermission = permission.split("|"); let multiPermission = permission.split("|");
let siteOwner = !!UserService.get().is_owner; let siteOwner = UserService.get().is_owner == "true";
for (const iterator of multiPermission) { for (const iterator of multiPermission) {
if (iterator == "") { if (iterator == "") {
return true; return true;
} }
permission = permissionList[iterator]; permission = permissionList[iterator];
if ( if (
siteOwner || siteOwner ||
owner || owner ||

@ -9,7 +9,7 @@ if (TokenService.getToken()) {
if (PermissionService.get()) { if (PermissionService.get()) {
store.commit('auth/SET_AUTH_PERMISSIONS', PermissionService.get()) store.commit('auth/SET_AUTH_PERMISSIONS', PermissionService.get())
} else if (TokenService.getToken() && UserService.get() && UserService.get().is_owner == false) { } else if (TokenService.getToken() && UserService.get() && UserService.get().is_owner == 'false') {
store.dispatch('auth/loadAuthPermissions'); store.dispatch('auth/loadAuthPermissions');
} }

@ -10,7 +10,8 @@ import PageTitle from "@Global/components/Dividers/PageTitle.vue";
import Checkbox from "@Global/components/Inputs/Checkbox.vue"; import Checkbox from "@Global/components/Inputs/Checkbox.vue";
import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; import InfoBlock from "@Global/components/Misc/InfoBlock.vue";
import Breadcrumbs from "@Global/components/Misc/Breadcrumbs"; import Breadcrumbs from "@Global/components/Misc/Breadcrumbs";
import Dialog from "@Global/components/Misc/Dialog.vue"; import Dialog from "@Global/components/Modals/Dialog.vue";
import Helper from "@Global/components/Modals/Helper.vue";
Vue.component("WM-PartTitle", PartTitle); Vue.component("WM-PartTitle", PartTitle);
Vue.component("WM-PageTitle", PageTitle); Vue.component("WM-PageTitle", PageTitle);
@ -18,6 +19,11 @@ Vue.component("WM-Checkbox", Checkbox);
Vue.component("wm-info-block", InfoBlock); Vue.component("wm-info-block", InfoBlock);
Vue.component("wm-breadcrumbs", Breadcrumbs); Vue.component("wm-breadcrumbs", Breadcrumbs);
Vue.component("wm-dialog", Dialog); Vue.component("wm-dialog", Dialog);
Vue.component("wm-helper", Helper);
//setTime
import store from "@Global/store/index";
store.dispatch('common/setCurrentTime');
//jalali => 0.6MB //jalali => 0.6MB
import jalaliMoment from "vue-jalali-moment" import jalaliMoment from "vue-jalali-moment"

@ -0,0 +1,9 @@
import { getTime } from "@Global/utils/date/time";
export default {
setCurrentTime:({ commit }) => {
commit('SET_CURRENT_TIME', getTime());
setInterval(function() {
commit('SET_CURRENT_TIME', getTime());
}, 2000);
},
}

@ -1,4 +1,5 @@
export default { export default {
getCurrentModule: state => state.current_module, getCurrentModule: state => state.current_module,
getCurrentModuleInfo: state => state.current_module_info, getCurrentModuleInfo: state => state.current_module_info,
getCurrentTime: state => state.time_now,
} }

@ -4,5 +4,8 @@ export default {
}, },
SET_CURRENT_MODULE_INFO(state, moduleInfo) { SET_CURRENT_MODULE_INFO(state, moduleInfo) {
state.current_module_info = moduleInfo; state.current_module_info = moduleInfo;
} },
SET_CURRENT_TIME(state, currentTime) {
state.time_now = currentTime;
},
}; };

@ -1,4 +1,5 @@
export default { export default {
time_now: "",
current_module: "", current_module: "",
current_module_info: { current_module_info: {
name: "" name: ""

@ -1,59 +1,64 @@
export default { export default {
$_openModal: ({ rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = true;
} else {
rootState.modal[modalArray[0]] = true;
}
},
$_closeModal: ({ state, rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = false;
} else {
rootState.modal[modalArray[0]] = false;
}
state.properties = null;
},
$_openModalCallback ({ dispatch }, data) {
dispatch(data.module + '/openModal' + data.type.charAt(0).toUpperCase() + data.type.slice(1), data, { root: true });
},
$_closeModalCallback: ({ dispatch }, data) => {
dispatch(data.module + '/closeModal' + data.type.charAt(0).toUpperCase() + data.type.slice(1) , data, { root: true });
},
$_openModalStack({ state, rootState }, data) { // data: {name, rel, model, form_data, data, modal_pop_data, type} $_openModalStack({ state, rootState }, data) { // data: {name, rel, model, form_data, data, modal_pop_data, type}
data.name = 'modal_' + data.name; data.name = 'modal_' + data.name;
if (state.modals.findIndex(x => x.name == data.name) == -1) { if (state.modals.findIndex(x => x.name == data.name) == -1) {
state.modals.push(data); state.modals.push(data);
let module = data.name.split("_"); let module = data.name.split("_");
if (data.rel) {
rootState[module[1]].relation = data.rel ? data.rel : {}; rootState[module[1]].relation = data.rel
rootState[module[1]].current_model = data.model ? data.model : {}; state.rel.push(data.rel);
}
if (data.model) {
rootState[module[1]].current_model = data.model;
state.model.push(data.model);
}
rootState[module[1]].page_type = data.page_type ? data.page_type : 'modal'; rootState[module[1]].page_type = data.page_type ? data.page_type : 'modal';
} }
}, },
$_closeModalStack({ state, rootState }) { $_closeModalStack({ state, rootState }) {
if (state.modals.length) { if (state.modals.length) {
let last_data = [...state.modals].pop(); let last_data = [...state.modals].pop();
let module = last_data.name.split("_")[1];
if (state.modals.length > 1) { if (state.modals.length > 1) {
state.modals[state.modals.length - 2]['last_modal_data'] = last_data; state.modals[state.modals.length - 2]['last_modal_data'] = last_data;
} else {
rootState[module].page_type = '';
}
if(last_data.rel) {
state.rel.pop();
if (state.rel.length) {
rootState[module].relation = state.rel[state.rel.length - 1];
} else {
rootState[module].relation = {};
}
}
if(last_data.model) {
state.model.pop();
if (state.model.length) {
rootState[module].current_model = state.model[state.model.length - 1];
} else {
rootState[module].current_model = {};
}
} }
let module = last_data.name.split("_");
rootState[module[1]].relation = {};
rootState[module[1]].current_model = {};
rootState[module[1]].page_type = '';
state.modals.pop(); state.modals.pop();
} }
}, },
$_dialog:({state, commit}, properties) => { $_dialog:({commit, dispatch}, properties) => {
state.modal.dialog = true; properties['name'] = 'modal_dialog';
dispatch('$_openModalStack', properties);
commit('SET_DIALOG_TYPE', properties.type); commit('SET_DIALOG_TYPE', properties.type);
commit('SET_DIALOG_PROPERTIES', properties); commit('SET_DIALOG_PROPERTIES', properties);
}, },
$_helper:({dispatch}, slug) => {
let data = {};
data['name'] = 'modal_helper';
data['slug'] = slug;
dispatch('$_openModalStack', data);
},
}; };

@ -6,6 +6,8 @@ export default {
dialog: false, dialog: false,
}, },
modals: [], modals: [],
rel: [],
model: [],
dialogProperties: {}, dialogProperties: {},
dialogType: {}, dialogType: {},
}; };

@ -41,6 +41,11 @@ export default {
updateClientCategory: "update-client-category", updateClientCategory: "update-client-category",
deleteClientCategory: "delete-client-category", deleteClientCategory: "delete-client-category",
indexClientTitle: "index-client-title",
storeClientTitle: "store-client-title",
updateClientTitle: "update-client-title",
deleteClientTitle: "delete-client-title",
indexClientStatus: "index-client-status", indexClientStatus: "index-client-status",
storeClientStatus: "store-client-status", storeClientStatus: "store-client-status",
updateClientStatus: "update-client-status", updateClientStatus: "update-client-status",

@ -66,6 +66,28 @@ const convertTreeToList = data => {
return recursiveFunction(data, 1); return recursiveFunction(data, 1);
}; };
const convertListToTree = list => {
function recursiveFunctionToTree( list, parent_id = null ) {
let object = [];
for (const item of list) {
item.label = item.label ? item.label : item.name;
if (item.id) {
if (item.parent_id == parent_id) {
let children = recursiveFunctionToTree(list, item.id);
if (children.length) {
item['children'] = children;
}
object.push(item);
}
}
}
return object;
}
return recursiveFunctionToTree(list);
};
const listSearchSelect = Options => { const listSearchSelect = Options => {
let treeArray = Options.array ? Options.array : []; let treeArray = Options.array ? Options.array : [];
var listArray = Options.list ? Options.list : convertTreeToList(treeArray); var listArray = Options.list ? Options.list : convertTreeToList(treeArray);
@ -243,5 +265,6 @@ export {
insertTreeArray, insertTreeArray,
updateTreeArray, updateTreeArray,
deleteTreeArray, deleteTreeArray,
listSearchSelect listSearchSelect,
convertListToTree
}; };

@ -11,4 +11,7 @@ export default {
originHostName() { originHostName() {
return process.env.MIX_PUSHER_APP_ORIGIN_HOST_NAME || 'www.willaengine.ir'; return process.env.MIX_PUSHER_APP_ORIGIN_HOST_NAME || 'www.willaengine.ir';
}, },
api() {
return process.env.MIX_PUSHER_APP_API || '';
},
} }

@ -0,0 +1,16 @@
const formatToYMD = function (date = null, split = "-" ) {
if (!date) {
date = new Date();
}
let month = `${date.getMonth() + 1}`;
let day = `${date.getDate()}`;
const year = date.getFullYear();
if (month.length < 2) month = `0${month}`;
if (day.length < 2) day = `0${day}`;
return [year, month, day].join(split);
}
export {formatToYMD};

@ -0,0 +1,9 @@
import moment from "jalali-moment";
const convertToJalali = function (date = null, format = "jYYYY/jMM/jDD", defaultDate = 'مشخص نشده است.' ) {
return date ? moment(date).format(format) : defaultDate ;
}
const convertNowToJalali = function (date = null, format = "jYYYY/jMM/jDD" ) {
return date ? moment(date).format(format) : moment(new Date()).format(format) ;
}
export { convertToJalali, convertNowToJalali };

@ -0,0 +1,14 @@
const getTime = (date = null) => {
date = date ? date : new Date();
let h = addZero(date.getHours());
let m = addZero(date.getMinutes());
return h + ":" + m;
};
const addZero= (i) => {
if (i < 10) {
i = "0" + i;
}
return i;
};
export { getTime };

@ -56,20 +56,19 @@
<script> <script>
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
export default { export default {
name: "modal_rolePermission_paymentConfirm",
computed: { computed: {
...mapGetters("modal", ["isModal"]), ...mapGetters("modal", ["isModalStack", "getModal"]),
modal: { modal: {
get() { get() {
return this.isModal("role_permission/payment_confirmation"); return this.isModalStack(this.$options.name);
}, },
set(value) { set(value) {
if (value) { if (!value) {
this.$_openModal("role_permission/payment_confirmation"); this.$_closeModalStack();
} else {
this.$_closeModal("role_permission/payment_confirmation");
} }
} }
} },
}, },
} }
</script> </script>

@ -24,7 +24,7 @@
<tbody> <tbody>
<tr class="LTR"> <tr class="LTR">
<td class="Itrator">1</td> <td class="Itrator">1</td>
<td class="Title">{{ getCurrentModule.title_fa }}</td> <td class="Title">{{ modal && getModal(this.$options.name).model ? getModal(this.$options.name).model.title_fa : '' }}</td>
<td class="Price En">{{ expiredDate | moment("jYYYY-jMM-jDD") }} 24:00</td> <td class="Price En">{{ expiredDate | moment("jYYYY-jMM-jDD") }} 24:00</td>
</tr> </tr>
</tbody> </tbody>
@ -34,7 +34,7 @@
<v-divider></v-divider> <v-divider></v-divider>
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="red" depressed dark @click="$_closeModal('role_permission/trial_confirmation')"> <v-btn color="red" depressed dark @click="$_closeModalStack();">
<v-icon dark right>fas fa-times</v-icon>انصراف <v-icon dark right>fas fa-times</v-icon>انصراف
</v-btn> </v-btn>
<v-btn color="black" depressed dark @click="register"> <v-btn color="black" depressed dark @click="register">
@ -47,27 +47,27 @@
<script> <script>
import {mapGetters, mapActions} from 'vuex'; import {mapGetters, mapActions} from 'vuex';
export default { export default {
name: "modal_rolePermission_trialConfirm",
methods: { methods: {
async register() { async register() {
let response = await this.actviveTrial(this.getCurrentModule.id); if (this.modal && this.getModal(this.$options.name).model) {
if (response.status == 200) { let response = await this.actviveTrial(this.getModal(this.$options.name).model.id);
this.$_closeModal('role_permission/trial_confirmation') if (response.status == 200) {
this.$_closeModalStack();
}
} }
}, },
...mapActions("role_permission", ["actviveTrial"]) ...mapActions("rolePermission", ["actviveTrial"])
}, },
computed: { computed: {
...mapGetters("modal", ["isModal"]), ...mapGetters("modal", ["isModalStack", "getModal"]),
...mapGetters("role_permission", ["getCurrentModule"]),
modal: { modal: {
get() { get() {
return this.isModal("role_permission/trial_confirmation"); return this.isModalStack(this.$options.name);
}, },
set(value) { set(value) {
if (value) { if (!value) {
this.$_openModal("role_permission/trial_confirmation"); this.$_closeModalStack();
} else {
this.$_closeModal("role_permission/trial_confirmation");
} }
} }
}, },

@ -31,7 +31,7 @@
<v-btn <v-btn
v-on="on" v-on="on"
small small
@click.native="$_openModal('role_permission/trial_confirmation'), SET_CURRENT_MODULE(module)" @click.native="$_openModalStack({ name: 'rolePermission_trialConfirm', model: module})"
slot="activator" slot="activator"
fab fab
:color="module.color_class" :color="module.color_class"
@ -44,7 +44,7 @@
<!-- <v-tooltip top transition="slide-x-transition" color="black" v-if="module.has_module == 'no' || module.is_trial == 'yes'"> <!-- <v-tooltip top transition="slide-x-transition" color="black" v-if="module.has_module == 'no' || module.is_trial == 'yes'">
<template v-slot:activator="{ on }"> <template v-slot:activator="{ on }">
<v-btn <v-btn
@click.native="$_openModal('role_permission/payment_confirmation'), SET_CURRENT_ALL_MODULE(module)" @click.native="$_openModalStack({ name: 'rolePermission_paymentConfirm', model: module})"
slot="activator" slot="activator"
fab fab
:color="module.color_class" :color="module.color_class"
@ -110,9 +110,6 @@ export default {
// "wm-payment-confirmation": PaymentConfirmation, // "wm-payment-confirmation": PaymentConfirmation,
"wm-trial-confirmation": TrialConfirmation "wm-trial-confirmation": TrialConfirmation
}, },
props: {
color: { default: "grey darken-4" }
},
data() { data() {
return { return {
breadcrumbItems: [ breadcrumbItems: [
@ -131,23 +128,20 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters("role_permission", ["getAllModules", "getModules"]) ...mapGetters("rolePermission", ["getAllModules", "getModules"])
}, },
methods: { methods: {
...mapActions("role_permission", ["loadAllModules", "loadModules"]), ...mapActions("rolePermission", ["loadAllModules", "loadModules"]),
...mapMutations("role_permission", ["SET_CURRENT_MODULE"]),
async loadPage() { async loadPage() {
await this.loadAllModules({ home_page: true }); await this.loadAllModules({ home_page: true });
let response = await this.loadModules({ home_page: true }); await this.loadModules({ home_page: true });
if (response && response.status == 200) { for (const allModule of this.getAllModules) {
for (const allModule of this.getAllModules) { let module = this.getModules.find(x => x.id == allModule.id);
let module = this.getModules.find(x => x.id == allModule.id); if (module) {
if (module) { allModule['has_module'] = 'yes';
allModule['has_module'] = 'yes'; allModule['is_trial'] = module.is_trial;
allModule['is_trial'] = module.is_trial; } else {
} else { allModule['has_module'] = 'no';
allModule['has_module'] = 'no';
}
} }
} }
this.allModules = this.getAllModules; this.allModules = this.getAllModules;

@ -41,15 +41,14 @@ export default {
"wm-tile": Tile, "wm-tile": Tile,
}, },
computed: { computed: {
...mapGetters("role_permission", ["getModules"]), ...mapGetters("rolePermission", ["getModules"]),
...mapGetters("auth", ["getAuthUser"]), ...mapGetters("auth", ["getAuthUser"]),
}, },
methods: { methods: {
...mapActions("role_permission", ["loadModules"]), ...mapActions("rolePermission", ["loadModules"]),
}, },
created() { created() {
this.loadModules({ home_page: true }); this.loadModules({ home_page: true });
} }
}; };
</script> </script>

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> <!-- <link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> -->
<title> Website Management </title> <title> Website Management </title>

Loading…
Cancel
Save