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

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

parent 2ab288bb
{
"name": "panda-xform",
"version": "2.5.7",
"description": "2.5.7: 手机号正则校验",
"version": "2.5.8",
"description": "2.5.8: 关联选择不赋值问题,时间默认值问题",
"keywords": [
"panda-xform"
],
......
......@@ -11,7 +11,7 @@ const DateTime = (props) => {
useEffect(() => {
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)
} else {
onChange(presetValue)
......@@ -28,7 +28,7 @@ const DateTime = (props) => {
const dateChange = (date, dateStr) => {
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 {
onChange(null)
}
......
......@@ -17,7 +17,7 @@ const Time = (props) => {
}
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(() => {
......
......@@ -165,7 +165,7 @@ const FileUpload = (props) => {
setShowList(JSON.stringify(fileList))
}
}, [value])
return (
<div className={styles.uploadBox}>
<Upload
......
import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import { Select, message } from 'antd'
import { GetSelectItemList } from '../../../../apis/process'
......@@ -7,9 +7,17 @@ const { Option } = Select
const RelevanceSelect = (props) => {
const { value, onChange, schema, addons } = props
const { disabled, placeholder, fieldParent, dictionary } = schema
const { disabled, placeholder, fieldParent, dictionary, presetValue } = schema
const [options, setOptions] = useState([])
useEffect(() => {
if (addons) {
addons.setValue(addons.dataPath, presetValue)
} else {
onChange(presetValue)
}
}, [presetValue])
const selectChange = (value) => {
if (addons) {
onChange(value)
......
......@@ -10,7 +10,7 @@ const DateDefault = (props) => {
const dateChange = (date, dateStr) => {
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 {
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