Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions frontend/src/views/system/user/User.vue
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
/>
<el-date-picker
v-else
v-model="state.form.system_variables[index].variableValues"
v-model="state.form.system_variables[index].variableValue"
type="date"
style="width: 236px"
value-format="YYYY-MM-DD"
Expand Down Expand Up @@ -543,6 +543,7 @@ import UserImport from './UserImport.vue'
import SuccessFilled from '@/assets/svg/gou_icon.svg'
import icon_replace_outlined from '@/assets/svg/icon_replace_outlined.svg'
import CircleCloseFilled from '@/assets/svg/icon_ban_filled.svg'
import { ElButton } from 'element-plus-secondary'
import icon_searchOutline_outlined from '@/assets/svg/icon_search-outline_outlined.svg'
import { useI18n } from 'vue-i18n'
import EmptyBackground from '@/views/dashboard/common/EmptyBackground.vue'
Expand Down Expand Up @@ -1017,10 +1018,9 @@ const formatVariableValues = () => {
if (!state.form.system_variables?.length) return []
return state.form.system_variables.map((ele: any) => ({
variableId: ele.variableId,
variableValues:
variableValueMap.value[ele.variableId].var_type === 'number'
? [ele.variableValue]
: ele.variableValues,
variableValues: ['number', 'datetime'].includes(variableValueMap.value[ele.variableId].var_type)
? [ele.variableValue]
: ele.variableValues,
}))
}

Expand Down Expand Up @@ -1082,7 +1082,7 @@ const validateSystemVariables = () => {
return true
}

if (obj.var_type === 'number' && !ele.variableValue) {
if (obj.var_type === 'number' && [null, undefined, ''].includes(ele.variableValue)) {
ElMessage.error(t('variables.​​cannot_be_empty'))
return true
}
Expand All @@ -1098,8 +1098,8 @@ const validateSystemVariables = () => {
if (obj.var_type === 'datetime') {
const [min, max] = obj.value
if (
+new Date(ele.variableValues) > +new Date(max) ||
+new Date(ele.variableValues) < +new Date(min)
+new Date(ele.variableValue) > +new Date(max) ||
+new Date(ele.variableValue) < +new Date(min)
) {
ElMessage.error(
t('variables.1_to_100_de', {
Expand Down
Loading