bfg-common 1.4.304 → 1.4.305

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 = (
@@ -126,7 +126,9 @@ const isDisabledMonthlyDayField = computed<boolean>(
126
126
  () => model.value.frg_monthly_mode === 'week'
127
127
  )
128
128
 
129
- const isInitTimeIntervalValidation = ref<boolean>(false)
129
+ const isInitTimeIntervalValidation = ref<boolean>(
130
+ model.value.frg_monthly_day === 0
131
+ )
130
132
  const onInitTimeIntervalValidation = (): void => {
131
133
  isInitTimeIntervalValidation.value = true
132
134
  }
@@ -134,7 +136,12 @@ const schedulerOnDayErrorText = computed<string>(() => {
134
136
  if (!isInitTimeIntervalValidation.value || isDisabledMonthlyDayField.value)
135
137
  return ''
136
138
 
137
- return validateField(localization.value, model.value.frg_monthly_day, true)
139
+ return validateField(
140
+ localization.value,
141
+ model.value.frg_monthly_day,
142
+ true,
143
+ true
144
+ )
138
145
  })
139
146
  watch(
140
147
  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)
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.305",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",