diff --git a/package.json b/package.json index 90256adec6ffb58af9f1564d5f1093c97a65ef68..336031e4696130f22bd9a32ff99e3227558bd90c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "panda-xform", - "version": "2.8.3", - "description": "2.8.3: 鍏宠仈琛ㄥ崟鏄犲皠瀛楁鏌ヨ娣诲姞鐨勫瓧娈�", + "version": "2.8.4", + "description": "2.8.4: 榛樿褰撳墠鏃堕棿bug", "keywords": [ "panda-xform" ], diff --git a/src/core/widgets/date/Time/index.js b/src/core/widgets/date/Time/index.js index 708cfa8c87082565a5adb89db0bda6247952e6c5..c6390ad82709e0acf66f22fc7e9069153cf1d6c4 100644 --- a/src/core/widgets/date/Time/index.js +++ b/src/core/widgets/date/Time/index.js @@ -22,10 +22,12 @@ const Time = (props) => { useEffect(() => { if (addons) { - let value = presetValue || (options === '榛樿涓哄綋鍓嶆椂闂�' ? moment(new Date()).format('HH:mm:ss') : null) + let value = presetValue || (options === '榛樿涓哄綋鍓嶆椂闂�' ? moment().format('YYYY-MM-DD HH:mm:ss') : null) + console.log('value', options, value) addons.setValue(addons.dataPath, value) } else { - onChange(presetValue) + let value = presetValue || (options === '榛樿涓哄綋鍓嶆椂闂�' ? moment().format('YYYY-MM-DD HH:mm:ss') : null) + onChange(value) } }, [presetValue, options]) diff --git a/src/core/widgets/settings/groupBase/TimeDefault/index.js b/src/core/widgets/settings/groupBase/TimeDefault/index.js index e031de7d1d8d43e664698dc8f8c3c8ad05b0dd38..8824a464b8c89c686916e86f28fa100ec722aa90 100644 --- a/src/core/widgets/settings/groupBase/TimeDefault/index.js +++ b/src/core/widgets/settings/groupBase/TimeDefault/index.js @@ -1,19 +1,21 @@ import React, { useState, useEffect, useMemo } from 'react' import { TimePicker } from 'antd' import locale from 'antd/lib/date-picker/locale/zh_CN' +import moment from 'moment' const TimeDefault = (props) => { - const { onChange } = props + const { value, onChange } = props const { format } = props.addons.formData - const dateChange = (date, dateStr) => { - onChange(dateStr) + const dateChange = (time, dateStr) => { + onChange(moment(time).format('YYYY-MM-DD HH:mm:ss')) } return ( <TimePicker + value={value ? moment(value) : null} picker={format} onChange={dateChange} showTime={format === 'dateTime'} diff --git a/src/core/widgets/settings/groupSource/MappedField/index.js b/src/core/widgets/settings/groupSource/MappedField/index.js index 8a94576066e40354f7cfe4f2f7acf55d9aecba79..71ee5136c31516948e49041e7efb76ad1d3149a7 100644 --- a/src/core/widgets/settings/groupSource/MappedField/index.js +++ b/src/core/widgets/settings/groupSource/MappedField/index.js @@ -71,8 +71,8 @@ const MappedField = (props) => { key={key} style={{ display: 'flex', - marginBottom: '5px ', - justifyContent: 'center' + marginBottom: '5px', + justifyContent: 'center', }} align="baseline" >