Skip to content

Commit fe1bfcf

Browse files
committed
fix(System Variables): Date variable row permissions: greater than, less than or equal to, no filtering.
1 parent b21d963 commit fe1bfcf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@
451451
/>
452452
<el-date-picker
453453
v-else
454-
v-model="state.form.system_variables[index].variableValues"
454+
v-model="state.form.system_variables[index].variableValue"
455455
type="date"
456456
style="width: 236px"
457457
value-format="YYYY-MM-DD"
@@ -543,6 +543,7 @@ import UserImport from './UserImport.vue'
543543
import SuccessFilled from '@/assets/svg/gou_icon.svg'
544544
import icon_replace_outlined from '@/assets/svg/icon_replace_outlined.svg'
545545
import CircleCloseFilled from '@/assets/svg/icon_ban_filled.svg'
546+
import { ElButton } from 'element-plus-secondary'
546547
import icon_searchOutline_outlined from '@/assets/svg/icon_search-outline_outlined.svg'
547548
import { useI18n } from 'vue-i18n'
548549
import EmptyBackground from '@/views/dashboard/common/EmptyBackground.vue'
@@ -1017,10 +1018,9 @@ const formatVariableValues = () => {
10171018
if (!state.form.system_variables?.length) return []
10181019
return state.form.system_variables.map((ele: any) => ({
10191020
variableId: ele.variableId,
1020-
variableValues:
1021-
variableValueMap.value[ele.variableId].var_type === 'number'
1022-
? [ele.variableValue]
1023-
: ele.variableValues,
1021+
variableValues: ['number', 'datetime'].includes(variableValueMap.value[ele.variableId].var_type)
1022+
? [ele.variableValue]
1023+
: ele.variableValues,
10241024
}))
10251025
}
10261026
@@ -1082,7 +1082,7 @@ const validateSystemVariables = () => {
10821082
return true
10831083
}
10841084
1085-
if (obj.var_type === 'number' && !ele.variableValue) {
1085+
if (obj.var_type === 'number' && [null, undefined, ''].includes(ele.variableValue)) {
10861086
ElMessage.error(t('variables.​​cannot_be_empty'))
10871087
return true
10881088
}
@@ -1098,8 +1098,8 @@ const validateSystemVariables = () => {
10981098
if (obj.var_type === 'datetime') {
10991099
const [min, max] = obj.value
11001100
if (
1101-
+new Date(ele.variableValues) > +new Date(max) ||
1102-
+new Date(ele.variableValues) < +new Date(min)
1101+
+new Date(ele.variableValue) > +new Date(max) ||
1102+
+new Date(ele.variableValue) < +new Date(min)
11031103
) {
11041104
ElMessage.error(
11051105
t('variables.1_to_100_de', {

0 commit comments

Comments
 (0)