aliqasemi 4 years ago
commit 4e1ade88cd

@ -79,7 +79,8 @@ return [
'region' => 'us-east-1', 'region' => 'us-east-1',
'bucket' => env('MINIO_BUCKET','your minio bucket name'), 'bucket' => env('MINIO_BUCKET','your minio bucket name'),
'endpoint' => env('MINIO_ENDPOINT','http://localhost:8000'), 'endpoint' => env('MINIO_ENDPOINT','http://localhost:8000'),
'url' => 'https://cdn.willaspace.com/'. env('MINIO_BUCKET') 'url' => 'https://cdn.willaspace.com/'. env('MINIO_BUCKET'),
'use_path_style_endpoint' => true,
], ],
], ],

@ -8,7 +8,7 @@
<div class="Name caption"> {{ getAuthUser.name }} </div> <div class="Name caption"> {{ getAuthUser.name }} </div>
<div class="Time"> <div class="Time">
<div class="En Bold">{{ getCurrentTime }}</div> <div class="En Bold">{{ getCurrentTime }}</div>
<div class="Fa Thin">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div> <div class="Fa Thin">{{ currentDate() }}</div>
</div> </div>
<!-- <div class="Notification" dark> <!-- <div class="Notification" dark>
<wm-notifications></wm-notifications> <wm-notifications></wm-notifications>
@ -19,7 +19,7 @@
<v-list class="pa-1"> <v-list class="pa-1">
<div class="row user-info"> <div class="row user-info">
<v-flex lg9 class="pa-3"> <v-flex lg9 class="pa-3">
<img class="Avatar" :src="$_getPath()+'images/Global/Misc/Avatar.png'" /> <img class="Avatar" :src="$_getPath('images/Global/Misc/Avatar.png')" />
<div class="Title"> <div class="Title">
<div class="Name Fa">{{ getAuthUser.name }}</div> <div class="Name Fa">{{ getAuthUser.name }}</div>
<div class="Role Fa">مدیریت</div> <div class="Role Fa">مدیریت</div>
@ -80,6 +80,7 @@
import Tile from "@Global/components/Drawer/Tile"; 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 {convertNowToJalali} from "@Global/utils/date/jalali-date";
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters } from "vuex";
export default { export default {
data() { data() {
@ -140,6 +141,9 @@
}, },
methods: { methods: {
...mapActions("auth", ["logout"]), ...mapActions("auth", ["logout"]),
currentDate() {
return convertNowToJalali(null, 'dddd jDD jMMMM jYYYY');
}
}, },
computed: { computed: {
...mapGetters("auth", ["getAuthUser"]), ...mapGetters("auth", ["getAuthUser"]),

@ -1,5 +1,5 @@
<template> <template>
<button :disabled="disabled" :type="type" :class="`slide-button ${theme}`"> <button :disabled="disabled" @click="$emit('click')" :type="type" :class="`slide-button ${theme}`">
<div class="overlay"></div> <div class="overlay"></div>
<div v-if="prepend_icon != ''" class="prepend-icon"> <div v-if="prepend_icon != ''" class="prepend-icon">
<v-icon>WMi-{{ prepend_icon }}</v-icon> <v-icon>WMi-{{ prepend_icon }}</v-icon>

@ -12,6 +12,7 @@ var CommingSoonArray = [
"client_export", "client_export",
"blog-videos", "blog-videos",
"roll-staff", "roll-staff",
"service-specialInfo"
]; ];
const commingSoon = { const commingSoon = {
methods: { methods: {

@ -1,5 +1,7 @@
import Vue from "vue"; import Vue from "vue";
import '@Global/utils/common/Object';
// global Styles // global Styles
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; //for tree select import "@riophae/vue-treeselect/dist/vue-treeselect.css"; //for tree select

@ -24,6 +24,7 @@ export default class {
constructor(paths, callbackDynamicImport, redirect) { constructor(paths, callbackDynamicImport, redirect) {
this.create(paths, callbackDynamicImport, redirect); this.create(paths, callbackDynamicImport, redirect);
this.beforeLoad(); this.beforeLoad();
this.afterLoad();
return this.router; return this.router;
} }
@ -63,6 +64,9 @@ export default class {
beforeLoad() { beforeLoad() {
this.router.beforeEach((to, from, next) => { this.router.beforeEach((to, from, next) => {
this.setTitle(to);
const isPublic = to.matched.some(record => record.meta.public); const isPublic = to.matched.some(record => record.meta.public);
const onlyWhenLoggedOut = to.matched.some( const onlyWhenLoggedOut = to.matched.some(
record => record.meta.onlyWhenLoggedOut record => record.meta.onlyWhenLoggedOut
@ -84,6 +88,17 @@ export default class {
} }
setTitle(to) {
const DEFAULT_TITLE = 'willaEngine';
document.title = to.meta.title || DEFAULT_TITLE;
}
afterLoad() {
this.router.afterEach((to, from) => {
});
}
} }

@ -0,0 +1,42 @@
// Warn if overriding existing method
if(Array.prototype.equals)
console.warn("Overriding existing Array.prototype.equals. Possible causes: New API defines the method, there's a framework conflict or you've got double inclusions in your code.");
// attach the .equals method to Array's prototype to call it on any array
Array.prototype.equals = function (array) {
// if the other array is a falsy value, return
if (!array)
return false;
// compare lengths - can save a lot of time
if (this.length != array.length)
return false;
for (var i = 0, l=this.length; i < l; i++) {
// Check if we have nested arrays
if (this[i] instanceof Array && array[i] instanceof Array) {
// recurse into the nested arrays
if (!this[i].equals(array[i]))
return false;
}
else if (this[i] != array[i]) {
// Warning - two different object instances will never be equal: {x:20} != {x:20}
return false;
}
}
return true;
}
// Hide method from for-in loops
Object.defineProperty(Array.prototype, "equals", {enumerable: false});
Array.prototype.matchItems = function (array) {
// if the other array is a falsy value, return
if (!array)
return [];
return this.filter(item => array.includes(item));
}
// Hide method from for-in loops
Object.defineProperty(Array.prototype, "matchItems", {enumerable: false});

@ -287,6 +287,25 @@ const insertTreeArray = (
// }; // };
const filterByLevel = (list, level1) => {
let filteredList = [];
let level = parseInt(level1);
checkLevel(list);
function checkLevel(list, parentId = null, levelCounter = 1) {
list.map(item => {
if(item.parent_id == parentId) {
if(levelCounter == level) {
filteredList.push(item);
} else {
checkLevel(list, item.id, levelCounter + 1);
}
}
})
}
return filteredList;
}
export { export {
convertTreeToList, convertTreeToList,
insertTreeArray, insertTreeArray,
@ -295,5 +314,6 @@ export {
listSearchSelect, listSearchSelect,
convertListToTree, convertListToTree,
addIndexTreeToList, addIndexTreeToList,
addHierarchyToList addHierarchyToList,
filterByLevel
}; };

@ -0,0 +1,114 @@
import {filterByLevel} from '@Global/utils/common/ProcessTreeArray'
export default class DynamicFilter {
constructor(arrayData, filterObject) {
this.arrayData = arrayData;
this.filterObject = filterObject;
for (const name in filterObject) {
if (filterObject.hasOwnProperty(name)) {
if(filterObject[name] && typeof filterObject[name].type !== 'undefined'){
this[filterObject[name].type](name);
} else {
this[name](this.filterObject[name]);
}
}
}
return this.arrayData;
}
like(name) {
const value = this.filterObject[name].val;
if(value !== null) {
this.arrayData = this.arrayData.filter(data => data[name].indexOf(value) !== -1 );
}
}
between(name) {
const value1 = this.filterObject[name].val1;
const value2 = this.filterObject[name].val2;
if (value1 && value2) {
if(typeof value1 === 'number' && typeof value2 === 'number') {
this.arrayData = this.arrayData.filter(data => value1 <= data[name] && data[name] <= value2);
} else {
let {from, to} = this.checkDateAndParse(value1, value2);
this.arrayData = this.arrayData.filter(data => {
const check = Date.parse(data[name]);
return check >= from && check <= to;
});
}
} else if (value1) {
this.greater(name);
} else if(value2) {
this.less(name);
}
}
checkDateAndParse(value1, value2) {
let from, to = null;
if(value1 && value1.length <= 10) {
from = Date.parse(value1 + 'T00:00:00');
} else {
from = Date.parse(value1);
}
if(value2 && value2.length <= 10) {
to = Date.parse(value2 + 'T23:59:59');
} else {
to = Date.parse(value1);
}
return {from, to};
}
greater(name) {
const value1 = this.filterObject[name].val1;
if(typeof value1 === 'number') {
this.arrayData = this.arrayData.filter(data => value1 <= data[name]);
} else {
let {from} = this.checkDateAndParse(value1);
this.arrayData = this.arrayData.filter(data => {
const check = Date.parse(data[name]);
return check >= from;
});
}
}
less(name) {
const value2 = this.filterObject[name].val2;
if(typeof value2 === 'number') {
this.arrayData = this.arrayData.filter(data => data[name] <= value2);
} else {
let {to} = this.checkDateAndParse(value2);
this.arrayData = this.arrayData.filter(data => {
const check = Date.parse(data[name]);
return check <= to;
});
}
}
in(name) {
const value = this.filterObject[name].val;
const key = this.filterObject[name].key ? this.filterObject[name].key : 'id';
this.arrayData = this.arrayData.filter(data => {
if (typeof data[name] === 'object') {
return data[name].map(item => item[key]).matchItems(value).length > 0;
}
});
}
level(value) {
if(value) {
this.arrayData = filterByLevel(this.arrayData, value);
}
}
}

@ -6,4 +6,8 @@ const convertToJalali = function (date = null, format = "jYYYY/jMM/jDD", default
const convertNowToJalali = function (date = null, format = "jYYYY/jMM/jDD" ) { const convertNowToJalali = function (date = null, format = "jYYYY/jMM/jDD" ) {
return date ? moment(date).locale('fa').format(format) : moment(new Date()).locale('fa').format(format) ; return date ? moment(date).locale('fa').format(format) : moment(new Date()).locale('fa').format(format) ;
}; };
export { convertToJalali, convertNowToJalali };
const convertToRelativedDateJalali = function (date = null, defaultDate = 'مشخص نشده است.' ) {
return date ? moment(date).locale('fa').fromNow() : defaultDate;
};
export { convertToJalali, convertNowToJalali, convertToRelativedDateJalali };

@ -11,6 +11,6 @@
| |
*/ */
Route::view('/main/{any?}', 'Home'); Route::view('main/{any?}', 'Home');
Route::view('/WebsiteManagement/{any?}', 'WebsiteManagement'); Route::view('WebsiteManagement/{any?}', 'WebsiteManagement');
Route::redirect('/{any?}', '/main/home'); Route::redirect('{any?}/{any1?}/{any3?}', '/main/home');

Loading…
Cancel
Save