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
* 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.
@ -74,7 +74,7 @@ return [
* 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.
*/
'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.

@ -12,6 +12,6 @@ class DatabaseSeeder extends Seeder
public function run()
{
// $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-vue": "^1.0.0-beta.2",
"@fortawesome/fontawesome-free": "^5.5.0",
"@riophae/vue-treeselect": "^0.4.0",
"ajv": "^6.10.0",
"apexcharts": "^3.8.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/Store/app.js": "/js/vue/Modules/Store/app.js?id=0076ff8cc3ac14215ddb",
"/js/vue/User/app.js": "/js/vue/User/app.js?id=177d52042c2071ccddeb"
}
}

@ -7,7 +7,7 @@
</a>
<div class="Name caption"> {{ getAuthUser.name }} </div>
<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>
<!-- <div class="Notification" dark>
@ -38,21 +38,12 @@
</a>
</v-flex>
</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 class="pt-0" dense>
<v-divider class="Divider"></v-divider>
<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>
</template>
</a>
@ -66,6 +57,7 @@ import Tile from "@Global/components/Drawer/Tile";
import Notifications from "@Global/components/Drawer/Notifications";
import Routes from "@Global/utils/common/routes";
import { mapActions, mapGetters } from "vuex";
// import { getTime } from "@Global/utils/date/time";
export default {
data() {
return {
@ -81,7 +73,8 @@ export default {
titleEn: " My Users ",
titleFa: " کاربران مجموعه ی من ",
icon: "question_answer",
permission: "",
permission: "indexUser",
module: "core",
href: Routes.user(),
},
{
@ -94,16 +87,11 @@ export default {
],
user: { name: "" },
timeNow: "",
mainHref: Routes.main(),
};
},
mounted(){
var self = this;
self.getTime(new Date())
setInterval(function() {
self.getTime(new Date())
}, 2000);
mounted() {
let self = this;
},
components: {
"wm-list-tile": Tile,
@ -111,20 +99,10 @@ export default {
},
computed: {
...mapGetters("auth", ["getAuthUser"]),
...mapGetters("common", ["getCurrentTime"]),
},
methods: {
...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>

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

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

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

@ -9,7 +9,7 @@ if (TokenService.getToken()) {
if (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');
}

@ -10,7 +10,8 @@ import PageTitle from "@Global/components/Dividers/PageTitle.vue";
import Checkbox from "@Global/components/Inputs/Checkbox.vue";
import InfoBlock from "@Global/components/Misc/InfoBlock.vue";
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-PageTitle", PageTitle);
@ -18,6 +19,11 @@ Vue.component("WM-Checkbox", Checkbox);
Vue.component("wm-info-block", InfoBlock);
Vue.component("wm-breadcrumbs", Breadcrumbs);
Vue.component("wm-dialog", Dialog);
Vue.component("wm-helper", Helper);
//setTime
import store from "@Global/store/index";
store.dispatch('common/setCurrentTime');
//jalali => 0.6MB
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 {
getCurrentModule: state => state.current_module,
getCurrentModuleInfo: state => state.current_module_info,
getCurrentTime: state => state.time_now,
}

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

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

@ -1,59 +1,64 @@
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}
data.name = 'modal_' + data.name;
if (state.modals.findIndex(x => x.name == data.name) == -1) {
state.modals.push(data);
let module = data.name.split("_");
rootState[module[1]].relation = data.rel ? data.rel : {};
rootState[module[1]].current_model = data.model ? data.model : {};
if (data.rel) {
rootState[module[1]].relation = data.rel
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';
}
},
$_closeModalStack({ state, rootState }) {
if (state.modals.length) {
let last_data = [...state.modals].pop();
let module = last_data.name.split("_")[1];
if (state.modals.length > 1) {
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();
}
},
$_dialog:({state, commit}, properties) => {
state.modal.dialog = true;
$_dialog:({commit, dispatch}, properties) => {
properties['name'] = 'modal_dialog';
dispatch('$_openModalStack', properties);
commit('SET_DIALOG_TYPE', properties.type);
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,
},
modals: [],
rel: [],
model: [],
dialogProperties: {},
dialogType: {},
};

@ -41,6 +41,11 @@ export default {
updateClientCategory: "update-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",
storeClientStatus: "store-client-status",
updateClientStatus: "update-client-status",

@ -66,6 +66,28 @@ const convertTreeToList = data => {
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 => {
let treeArray = Options.array ? Options.array : [];
var listArray = Options.list ? Options.list : convertTreeToList(treeArray);
@ -243,5 +265,6 @@ export {
insertTreeArray,
updateTreeArray,
deleteTreeArray,
listSearchSelect
listSearchSelect,
convertListToTree
};

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

@ -24,7 +24,7 @@
<tbody>
<tr class="LTR">
<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>
</tr>
</tbody>
@ -34,7 +34,7 @@
<v-divider></v-divider>
<v-card-actions>
<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-btn>
<v-btn color="black" depressed dark @click="register">
@ -47,27 +47,27 @@
<script>
import {mapGetters, mapActions} from 'vuex';
export default {
name: "modal_rolePermission_trialConfirm",
methods: {
async register() {
let response = await this.actviveTrial(this.getCurrentModule.id);
if (response.status == 200) {
this.$_closeModal('role_permission/trial_confirmation')
if (this.modal && this.getModal(this.$options.name).model) {
let response = await this.actviveTrial(this.getModal(this.$options.name).model.id);
if (response.status == 200) {
this.$_closeModalStack();
}
}
},
...mapActions("role_permission", ["actviveTrial"])
...mapActions("rolePermission", ["actviveTrial"])
},
computed: {
...mapGetters("modal", ["isModal"]),
...mapGetters("role_permission", ["getCurrentModule"]),
...mapGetters("modal", ["isModalStack", "getModal"]),
modal: {
get() {
return this.isModal("role_permission/trial_confirmation");
return this.isModalStack(this.$options.name);
},
set(value) {
if (value) {
this.$_openModal("role_permission/trial_confirmation");
} else {
this.$_closeModal("role_permission/trial_confirmation");
if (!value) {
this.$_closeModalStack();
}
}
},

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

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

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<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>

Loading…
Cancel
Save