bfg-common 1.4.304 → 1.4.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,7 +62,8 @@ const getCorrectRuForm = (value: number | string, type: string): string => {
62
62
  export const validateField = (
63
63
  localization: UI_I_Localization,
64
64
  value: string,
65
- checkZero: boolean = false
65
+ checkZero: boolean = false,
66
+ checkDayRange: boolean = false // параметр для проверки диапазона дней
66
67
  ): string => {
67
68
  // Если поле пустое
68
69
  if (!value) {
@@ -74,7 +75,7 @@ export const validateField = (
74
75
  return localization.common.theValueTooSmall
75
76
  }
76
77
 
77
- if (value.length > 3) {
78
+ if (value.length > 3 ) {
78
79
  return localization.common.theValueTooLarge
79
80
  }
80
81
  // Если значение не является цифрой
@@ -82,6 +83,10 @@ export const validateField = (
82
83
  return localization.common.inputContainsInvalidCharacters
83
84
  }
84
85
 
86
+ if (checkDayRange && !/^([1-9]|[1-2][0-9]|3[0-1])$/.test(value)) {
87
+ return localization.common.theValueTooLarge
88
+ }
89
+
85
90
  return ''
86
91
  }
87
92
  export const validateDate = (
@@ -134,7 +134,12 @@ const schedulerOnDayErrorText = computed<string>(() => {
134
134
  if (!isInitTimeIntervalValidation.value || isDisabledMonthlyDayField.value)
135
135
  return ''
136
136
 
137
- return validateField(localization.value, model.value.frg_monthly_day, true)
137
+ return validateField(
138
+ localization.value,
139
+ model.value.frg_monthly_day,
140
+ true,
141
+ true
142
+ )
138
143
  })
139
144
  watch(
140
145
  schedulerOnDayErrorText,
@@ -217,7 +217,7 @@ const generateCronExpression = (
217
217
  case 'after-startup':
218
218
  const suffixDelay =
219
219
  interval.frg_after_startup === 0 ? '' : `-${interval.frg_after_startup}`
220
- cronExpression = `0 0 0 0 0 after_procurator_startup${suffixDelay}` // Выполняется после запуска procurator_startup с задержой N минут
220
+ cronExpression = `* * * * * after_procurator_startup${suffixDelay}` // Выполняется после запуска procurator_startup с задержой N минут
221
221
  break
222
222
  case 'hour':
223
223
  cronExpression = generateHourlyCronExpression(interval)
@@ -14,7 +14,7 @@ export const scheduledTaskDefaultFormFunc = (): UI_I_ScheduleNewTasksForm => {
14
14
  frg_end_time: '',
15
15
  frg_start_on_time: '',
16
16
  frg_monthly_mode: 'day',
17
- frg_monthly_day: 0,
17
+ frg_monthly_day: 1,
18
18
  frq_week_day: '',
19
19
  frq_ordinal_number: '',
20
20
  frg_on_time: '',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.304",
4
+ "version": "1.4.306",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",