Alireza Hassani 4 years ago
commit e726b99d12

@ -2,6 +2,13 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/api-axios-handler" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/auth" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/permission" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/task" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/theme" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/uncomplete/theme" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/we-packages/url-generator" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/wm-blog" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/wm-common" vcs="Git" />
<mapping directory="$PROJECT_DIR$/modules/wm-core" vcs="Git" />

@ -25,7 +25,7 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
$schedule->command('today:schedule')->daily();
$schedule->command('today:run')->everyFiveMinutes();
$schedule->command('today:run')->everyMinute();
}
/**

11214
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -37,6 +37,7 @@
"object-to-formdata": "^2.1.2",
"postcss-loader": "^3.0.0",
"raw-loader": "^0.5.1",
"v-mask": "^2.2.3",
"vee-validate": "^2.2.15",
"vue-advanced-cropper": "^0.14.1",
"vue-apexcharts": "^1.4.0",
@ -47,6 +48,7 @@
"vue-gallery": "^2.0.1",
"vue-jalali-moment": "^1.0.0",
"vue-moment": "^4.1.0",
"vue-persian-datetime-picker": "^2.1.6",
"vue-router": "^3.0.2",
"vue-scroll-reveal": "^1.0.11",
"vue-the-mask": "^0.11.1",
@ -62,10 +64,10 @@
"cross-env": "^5.1",
"deepmerge": "^4.0.0",
"fibers": "^4.0.1",
"jquery": "^3.4.1",
"jquery": "^3.5.1",
"laravel-mix": "^4.0.15",
"material-design-icons-iconfont": "^4.0.3",
"node-sass": "^4.12.0",
"node-sass": "^4.14.1",
"popper.js": "^2.0.0-next.4",
"pug": "^2.0.3",
"pug-loader": "^2.4.0",

@ -0,0 +1,142 @@
<template>
<div>
<v-text-field
v-model="dateShow"
:label="label"
prepend-icon="WMi-calendar-alt"
color="purple"
:id="'my-custom-date-' + uniqueId"
readonly
:color="color"
@click="show = true"
/>
<date-picker
v-model="dateShow"
locale="fa,en"
:locale-config="localeConfig"
:format="defaultDisplayFormat"
:inputFormat="defaultInputFormat"
@change="$emit('input', $event.format(defaultFormat))"
:type="type"
:auto-submit="true"
:element="'my-custom-date-' + uniqueId"
:editable="true"
:show="show"
:min="minimum"
:max="maximum"
@close="show = false"
:color="color"
/>
</div>
</template>
<script>
import VuePersianDatetimePicker from 'vue-persian-datetime-picker'
import moment from 'jalali-moment';
export default {
components: {
datePicker: VuePersianDatetimePicker
},
props: {
color: {default: 'black'},
defaultDate: {
default: 'now',
type: String,
validator: (val) => ['now', 'empty'].includes(val)
},
min: {default: null},
max: {default: null},
displayFormat: {default: null},
inputFormat: {default: null},
format: {default: null},
type: {
default: 'datetime',
type: String,
validator: (val) => ['datetime', 'time', 'date'].includes(val)
},
label: {default: 'در تاریخ '},
value: {default: null},
},
data: () => ({
localeConfig: {
fa: {
lang: {label: 'شمسی'}
},
en: {
lang: {label: 'Gregorian'}
}
},
show: false,
uniqueId: Math.floor(Math.random() * 10000)
}),
computed: {
dateShow: {
get() {
if (this.value) {
return moment(new Date(this.value)).format(this.defaultDisplayFormat);
} else {
if (this.defaultDate === 'now' ) {
this.$emit('input', moment(new Date()).format(this.defaultFormat));
return moment(new Date()).format(this.defaultDisplayFormat);
} else {
return '';
}
}
},
set(value) {
}
},
defaultDisplayFormat() {
if (!this.displayFormat) {
if (this.type === 'datetime') {
return 'jDD jMMMM jYYYY ساعت HH:mm';
} else if(this.type === 'date') {
return 'jDD jMMMM jYYYY';
} else if(this.type === 'time') {
return 'HH:mm';
}
}
return this.displayFormat
},
defaultInputFormat() {
if (!this.inputFormat) {
if (this.type === 'datetime') {
return 'YYYY-MM-DD HH:mm';
} else if(this.type === 'date') {
return 'YYYY-MM-DD';
} else if(this.type === 'time') {
return 'HH:mm';
}
}
return this.inputFormat
},
defaultFormat() {
if (!this.format) {
if (this.type === 'datetime') {
return 'YYYY-MM-DD HH:mm';
} else if(this.type === 'date') {
return 'YYYY-MM-DD';
} else if(this.type === 'time') {
return 'HH:mm';
}
}
return this.format
},
minimum() {
if (this.min === 'now') {
return moment(new Date()).format(this.defaultInputFormat);
} else {
return this.min;
}
},
maximum() {
if (this.max === 'now') {
return moment(new Date()).format(this.defaultInputFormat);
} else {
return this.max;
}
},
}
}
</script>

@ -1,7 +1,7 @@
<template>
<v-row :class="`radio-group ${theme}`">
<v-col v-for="(item, index) in items" :key="index" :xl="item.size" class="pt-0" @click="changeSelected($event, item || {})">
<div :class="{'active':value ? value == item.id : item.id == currentSelect, [item.theme]: true, ['bubble']: true}">
<div :class="{'active': isActive(item), [item.theme]: true, ['bubble']: true}">
<div class="body">
<div :class="`icon ${(item.customIconClass) ? item.customIconClass : ''}`">
<v-icon>WMi-{{ item.icon }}</v-icon>
@ -20,22 +20,54 @@
<script>
export default {
props: {
items: {},
initialSelect: {default: 1},
items: {default: () => ([])},
value: {default: null},
multiple: {default: false},
name: {default: 'default_name'},
theme: String,
},
data() {
return {
currentSelect: this.initialSelect,
currentSelect: this.value,
}
},
methods: {
changeSelected($event, item) {
if (Array.isArray(this.value) || this.multiple) {
this.changeSelectedMultiple(item);
} else {
this.changeSelectedSingle(item);
}
},
changeSelectedMultiple(item) {
if (!Array.isArray(this.currentSelect)) {
this.currentSelect = [];
}
if (this.currentSelect.includes(item.id)) {
const index = this.currentSelect.findIndex(x => x === item.id);
this.currentSelect.splice(index, 1);
} else {
this.currentSelect.push(item.id);
}
let items = [];
for (let value of this.items.filter(x => this.currentSelect.includes(x.id))) {
items.push({'name': this.name, 'value': value.value});
}
this.$emit('changeState', items);
this.$emit('input', this.currentSelect);
},
changeSelectedSingle(item) {
this.currentSelect = item.id;
this.$emit('changeState', {'name':this.name,'value':item.value})
this.$emit('input', item.id);
this.$emit('changeState', {'name':this.name,'value': item.value});
this.$emit('input', this.currentSelect);
},
isActive(item) {
if (this.multiple) {
return this.value && Array.isArray(this.value) ? this.value.includes(item.id) : (Array.isArray(this.currentSelect) ? this.currentSelect.includes(item.id) : false );
} else {
return this.value ? this.value === item.id : item.id === this.currentSelect
}
}
}
}

@ -1,5 +1,10 @@
<template>
<router-link :to="{ name: URL }" :class="`back-button fade-in fast ${theme} `" style="animation-delay: 0.1s;">
<a v-if="href" :href="'/' + href" :class="`back-button fade-in fast ${theme} `" style="animation-delay: 0.1s;">
<div class="tile" :style="'background-image: linear-gradient(to right, #'+gradientBegin+' , #'+gradientEnd+'); '">
<v-icon> WMi-right-open</v-icon>
</div>
</a>
<router-link v-else :to="{ name: URL }" :class="`back-button fade-in fast ${theme} `" style="animation-delay: 0.1s;">
<div class="tile" :style="'background-image: linear-gradient(to right, #'+gradientBegin+' , #'+gradientEnd+'); '">
<v-icon> WMi-right-open</v-icon>
</div>
@ -10,6 +15,7 @@ s
export default {
props: {
URL: { default: "Home" },
href: { default: null },
gradientBegin: { default: "eeeeee" },
gradientEnd: { default: "dadada" },
theme: { default: "light" },

@ -74,6 +74,8 @@ Vue.component("we-hint-text", HintText);
import HintBlock from "@Global/components/Blocks/Hint.vue";
Vue.component("hint-block", HintBlock);
import PersianDate from '@Global/components/Inputs/PersianDate'
Vue.component("we-persian-date", PersianDate);

@ -83,6 +83,22 @@ const addIndexTreeToList = list => {
return recursiveFunctionIndexToTree(list);
};
const addHierarchyToList = list => {
function recursiveFunctionIndexToTree( list, parent_id = null, hierarchy = [] ) {
for (const item of list) {
if (item.parent_id === parent_id) {
let cloneHierarchy = [...hierarchy];
cloneHierarchy.push(item.id);
item['hierarchy'] = cloneHierarchy ;
recursiveFunctionIndexToTree(list, item.id, cloneHierarchy);
}
}
return list;
}
return recursiveFunctionIndexToTree(list);
};
const listSearchSelect = Options => {
let treeArray = Options.array ? Options.array : [];
var listArray = Options.list ? Options.list : convertTreeToList(treeArray);
@ -278,5 +294,6 @@ export {
deleteTreeArray,
listSearchSelect,
convertListToTree,
addIndexTreeToList
addIndexTreeToList,
addHierarchyToList
};

@ -1,6 +1,7 @@
export default class Cron {
constructor(options) {
this.date_time = options['date_time'] ? options.date_time : '';
this.date = options['date'] ? options.date : '';
this.time = options['time'] ? options.time : '';
this.cron = options['cron'] ? options.cron : '';
@ -8,11 +9,17 @@ export default class Cron {
}
dateToCron() {
let date;
if (this.date !== '' && this.time !== '') {
let date = new Date(this.date + 'T'+ this.time);
console.log(this.date, date, date.getMonth(), date.getDay());
date = new Date(this.date + 'T' + this.time);
}
else if (this.date_time !== '') {
date = new Date(this.date_time);
}
if (date) {
return {
cron: `${date.getMinutes()} ${date.getHours()} ${date.getDate()} ${date.getMonth()} *`,
cron: `${date.getMinutes()} ${date.getHours()} ${date.getDate()} ${date.getMonth() + 1 } *`,
year: date.getFullYear()
}
}
@ -21,16 +28,18 @@ export default class Cron {
cronToDate() {
let cronArray = this.cron.split(' ');
const month = (parseInt(cronArray[3]) + 1) > 9 ? parseInt(cronArray[3]) + 1 : '0' + (parseInt(cronArray[3]) + 1).toString();
const month = (parseInt(cronArray[3])) > 9 ? parseInt(cronArray[3]) : '0' + (parseInt(cronArray[3])).toString();
const day = cronArray[2].length < 2 ? '0' + cronArray[2] : cronArray[2];
const hour = cronArray[1].length < 2 ? '0'+cronArray[1] : cronArray[1];
const minute = cronArray[0].length < 2 ? '0'+cronArray[0] : cronArray[0];
let time = `${hour}:${minute}`;
let date = `${this.year}-${month}-${day}`;
let date_time = `${this.year}-${month}-${day} ${hour}:${minute}`;
return {
time,
date
date,
date_time
}
}

@ -11,6 +11,9 @@ const formatToYMD = function (date = null, split = "-" ) {
if (day.length < 2) day = `0${day}`;
return [year, month, day].join(split);
}
};
const addMinutes = function (date, minutes) {
return new Date(date.getTime() + minutes*60000);
};
export {formatToYMD};
export {formatToYMD, addMinutes};

Loading…
Cancel
Save