Commit 46b49f31 authored by 田翔's avatar 田翔

fix: 关联选择不赋值问题,时间默认值问题

parent 2ab288bb
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.5.7", "version": "2.5.8",
"description": "2.5.7: 手机号正则校验", "description": "2.5.8: 关联选择不赋值问题,时间默认值问题",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -11,7 +11,7 @@ const DateTime = (props) => { ...@@ -11,7 +11,7 @@ const DateTime = (props) => {
useEffect(() => { useEffect(() => {
if (addons) { if (addons) {
let value = presetValue || (options === '默认为当前时间' ? moment(new Date()).format('YYYY-MM-DD HH:ss:mm') : null) let value = presetValue || (options === '默认为当前时间' ? moment(new Date()).format('YYYY-MM-DD HH:mm:ss') : null)
addons.setValue(addons.dataPath, value) addons.setValue(addons.dataPath, value)
} else { } else {
onChange(presetValue) onChange(presetValue)
...@@ -28,7 +28,7 @@ const DateTime = (props) => { ...@@ -28,7 +28,7 @@ const DateTime = (props) => {
const dateChange = (date, dateStr) => { const dateChange = (date, dateStr) => {
if (date && date._d) { if (date && date._d) {
onChange(moment(date._d).format('YYYY-MM-DD HH:ss:mm')) onChange(moment(date._d).format('YYYY-MM-DD HH:mm:ss'))
} else { } else {
onChange(null) onChange(null)
} }
......
...@@ -17,7 +17,7 @@ const Time = (props) => { ...@@ -17,7 +17,7 @@ const Time = (props) => {
} }
const timeChange = (time, timeStr) => { const timeChange = (time, timeStr) => {
onChange(moment(time).format('YYYY-MM-DD HH:ss:mm')) onChange(moment(time).format('YYYY-MM-DD HH:mm:ss'))
} }
useEffect(() => { useEffect(() => {
......
import React, { useState } from 'react' import React, { useEffect, useState } from 'react'
import { Select, message } from 'antd' import { Select, message } from 'antd'
import { GetSelectItemList } from '../../../../apis/process' import { GetSelectItemList } from '../../../../apis/process'
...@@ -7,9 +7,17 @@ const { Option } = Select ...@@ -7,9 +7,17 @@ const { Option } = Select
const RelevanceSelect = (props) => { const RelevanceSelect = (props) => {
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { disabled, placeholder, fieldParent, dictionary } = schema const { disabled, placeholder, fieldParent, dictionary, presetValue } = schema
const [options, setOptions] = useState([]) const [options, setOptions] = useState([])
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
} else {
onChange(presetValue)
}
}, [presetValue])
const selectChange = (value) => { const selectChange = (value) => {
if (addons) { if (addons) {
onChange(value) onChange(value)
......
...@@ -10,7 +10,7 @@ const DateDefault = (props) => { ...@@ -10,7 +10,7 @@ const DateDefault = (props) => {
const dateChange = (date, dateStr) => { const dateChange = (date, dateStr) => {
if (date && date._d) { if (date && date._d) {
onChange(moment(date._d).format('YYYY-MM-DD HH:ss:mm')) onChange(moment(date._d).format('YYYY-MM-DD HH:mm:ss'))
} else { } else {
onChange(null) onChange(null)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment