Skip to content

Commit b5df4eb

Browse files
committed
fix(User Management): The variable value is a date, not a range. After selecting a date value, it is necessary to verify whether this value is within the date range set for the variable.
1 parent a88ea2e commit b5df4eb

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

frontend/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"Details": "Details"
99
},
1010
"variables": {
11+
"please_select_date": "Please select a date",
1112
"number_variable_error": "Please enter the correct numerical range.",
1213
"built_in": "Built-in",
1314
"normal_value": "Normal value",

frontend/src/i18n/ko-KR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"return_to_view": "화면으로 돌아가기"
2525
},
2626
"variables": {
27+
"please_select_date": "날짜를 선택하십시오",
2728
"number_variable_error": "올바른 숫자 범위를 입력하십시오.",
2829
"built_in": "내장형",
2930
"normal_value": "정상값",
@@ -944,4 +945,4 @@
944945
"to_doc": "API 보기",
945946
"trigger_limit": "최대 {0}개의 API 키 생성 지원"
946947
}
947-
}
948+
}

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"return_to_view": "返回查看"
2525
},
2626
"variables": {
27+
"please_select_date": "请选择日期",
2728
"number_variable_error": "请输入正确的数值范围",
2829
"built_in": "已内置",
2930
"normal_value": "常规值",

frontend/src/views/system/user/User.vue

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,10 @@
452452
<el-date-picker
453453
v-else
454454
v-model="state.form.system_variables[index].variableValues"
455-
type="daterange"
456-
style="max-width: 236px"
455+
type="date"
456+
style="width: 236px"
457457
value-format="YYYY-MM-DD"
458-
range-separator=""
459-
:start-placeholder="$t('variables.start_date')"
460-
:end-placeholder="$t('variables.end_date')"
458+
:placeholder="$t('variables.please_select_date')"
461459
/>
462460
<el-tooltip
463461
:offset="14"
@@ -1099,12 +1097,9 @@ const validateSystemVariables = () => {
10991097
11001098
if (obj.var_type === 'datetime') {
11011099
const [min, max] = obj.value
1102-
const [minVal, maxVal] = ele.variableValues
11031100
if (
1104-
+new Date(minVal) > +new Date(max) ||
1105-
+new Date(maxVal) < +new Date(min) ||
1106-
+new Date(maxVal) > +new Date(max) ||
1107-
+new Date(minVal) < +new Date(min)
1101+
+new Date(ele.variableValues) > +new Date(max) ||
1102+
+new Date(ele.variableValues) < +new Date(min)
11081103
) {
11091104
ElMessage.error(
11101105
t('variables.1_to_100_de', {

0 commit comments

Comments
 (0)